diff --git a/.devsPrefs/red-kangaroo/TodoGraphics/Menu2.png b/.devsPrefs/red-kangaroo/TodoGraphics/Menu2.png new file mode 100644 index 000000000..f2c1ef1be Binary files /dev/null and b/.devsPrefs/red-kangaroo/TodoGraphics/Menu2.png differ diff --git a/.devsPrefs/red-kangaroo/TodoGraphics/Menu3.png b/.devsPrefs/red-kangaroo/TodoGraphics/Menu3.png new file mode 100644 index 000000000..bb77cb634 Binary files /dev/null and b/.devsPrefs/red-kangaroo/TodoGraphics/Menu3.png differ diff --git a/.devsPrefs/red-kangaroo/TodoGraphics/Menu4.png b/.devsPrefs/red-kangaroo/TodoGraphics/Menu4.png new file mode 100644 index 000000000..33def5426 Binary files /dev/null and b/.devsPrefs/red-kangaroo/TodoGraphics/Menu4.png differ diff --git a/.devsPrefs/red-kangaroo/TodoGraphics/Menu5.png b/.devsPrefs/red-kangaroo/TodoGraphics/Menu5.png new file mode 100644 index 000000000..9d5e250d4 Binary files /dev/null and b/.devsPrefs/red-kangaroo/TodoGraphics/Menu5.png differ diff --git a/FeLib/Include/feio.h b/FeLib/Include/feio.h index 119f63290..bce26f0b9 100644 --- a/FeLib/Include/feio.h +++ b/FeLib/Include/feio.h @@ -41,7 +41,8 @@ class iosystem static int Menu(std::vector vBackGround, v2, cfestring&, cfestring&, col16, cfestring& = CONST_S(""), - cfestring& = CONST_S("")); + cfestring& = CONST_S(""), + truth = false); static void TextScreen(cfestring&, v2 Disp = ZERO_V2, col16 = 0xFFFF, truth = true, truth = true, bitmapeditor = 0); diff --git a/FeLib/Source/feio.cpp b/FeLib/Source/feio.cpp index 06995a639..24d4d4997 100644 --- a/FeLib/Source/feio.cpp +++ b/FeLib/Source/feio.cpp @@ -161,7 +161,7 @@ int iSelectedPrevious=-1; int iosystem::Menu(std::vector vBackGround, v2 Pos, cfestring& Topic, cfestring& sMS, col16 Color, cfestring& SmallText1, - cfestring& SmallText2) + cfestring& SmallText2, truth ExtraMenuGraphics) { if(CountChars('\r', sMS) < 1) return (-1); @@ -180,7 +180,12 @@ int iosystem::Menu(std::vector vBackGround, v2 Pos, while(!bReady) { - cbitmap* BackGround = vBackGround.size()>iSelected?vBackGround[iSelected]:NULL; + cbitmap* BackGround = NULL; + if(ExtraMenuGraphics) + BackGround = vBackGround.size()>iSelected?vBackGround[iSelected]:NULL; + else + BackGround = vBackGround[0]; + if(BackGround){ if( (RES.X!=BackGround->GetSize().X) || (RES.Y!=BackGround->GetSize().Y) ){ blitdata B = DEFAULT_BLITDATA; @@ -207,14 +212,14 @@ int iosystem::Menu(std::vector vBackGround, v2 Pos, } }else Buffer.ClearToColor(0); - + #ifndef NOSOUND - if(iSelectedPrevious != iSelected){ + if(ExtraMenuGraphics && iSelectedPrevious != iSelected){ soundeffects::playSound(festring()<<"Main Menu Entry "<<(iSelected+1)); iSelectedPrevious = iSelected; } #endif - + clock_t StartTime = clock(); sCopyOfMS = Topic; int i; @@ -298,7 +303,7 @@ int iosystem::Menu(std::vector vBackGround, v2 Pos, } else { - //FONT->Printf(&Buffer, v2(100, 100), Color, "%s", "NUKES IS HERE!"); + //FONT->Printf(&Buffer, v2(100, 100), Color, "%s", "NUKES IS HERE!"); Buffer.FastBlit(DOUBLE_BUFFER); graphics::BlitDBToScreen(); k = GET_KEY(false); @@ -921,7 +926,7 @@ struct sAlertConfirmMsg{ void iosystem::AlertConfirmMsgDraw(bitmap* Buffer) { if(!sAlertConfirmMsgInst.bShow)return; - + //TODO calc all line withs to determine the full popup width to not look bad if overflow, see specialkeys help dialog creation int iLineHeight=20; v2 v2Border(700,100+(sAlertConfirmMsgInst.vfsCritMsgs.size()*iLineHeight)); @@ -944,7 +949,7 @@ void iosystem::AlertConfirmMsgDraw(bitmap* Buffer) bool iosystem::AlertConfirmMsg(const char* cMsg,std::vector vfsCritMsgs,bool bConfirmMode) { static bool bDummyInit = [](){graphics::AddDrawAboveAll(&AlertConfirmMsgDraw,100100,"iosystem::AlertConfirmMsgDraw"); return true;}(); - + bInUse=true; sAlertConfirmMsgInst.bShow=true; @@ -1186,7 +1191,7 @@ festring iosystem::ContinueMenu(col16 TopicColor, col16 ListColor, * Generating a new level is probably bad as it will ignore whatever happened in that level and may create * duplicated items (uniques) and characters (uniques that died) when they should not exist, * may be only for fully random (with non unique things on it) levels such workaround could be used... - * + * * TODO for file extensions, find the type only at the end, use std::string if easier/clearer to implement */ }else diff --git a/Graphics/Menu.png b/Graphics/Menu.png new file mode 100644 index 000000000..264e9ea36 Binary files /dev/null and b/Graphics/Menu.png differ diff --git a/Graphics/Menu2.png b/Graphics/Menu2.png index f2c1ef1be..77921ad93 100644 Binary files a/Graphics/Menu2.png and b/Graphics/Menu2.png differ diff --git a/Main/Include/iconf.h b/Main/Include/iconf.h index b17e1e7cf..f89d02c71 100644 --- a/Main/Include/iconf.h +++ b/Main/Include/iconf.h @@ -72,11 +72,12 @@ class ivanconfig static int GetAltListItemPos() { return AltListItemPos.Value; } static truth GetPlaySounds() { return PlaySounds.Value; } static truth IsShowTurn() { return ShowTurn.Value; } - static truth IsAllowMouseOnFelist(){return AllowMouseOnFelist.Value;} + static truth IsAllowMouseOnFelist(){ return AllowMouseOnFelist.Value; } static truth IsStartingOutlinedGfx() { return bStartingOutlinedGfx; } static long GetVolume() { return Volume.Value; } static long GetSfxVolume() { return SfxVolume.Value; } static long GetMIDIOutputDevice() { return MIDIOutputDevice.Value; } + static truth GetExtraMenuGraphics(){ return UseExtraMenuGraphics.Value; } #ifndef __DJGPP__ static int GetGraphicsScale() { return GraphicsScale.Value; } @@ -149,6 +150,7 @@ class ivanconfig static void SfxVolumeChanger(numberoption*, long); static void AltSilhouetteDisplayer(const cycleoption* O, festring& Entry); static void AllowMouseOnFelistChanger(truthoption*, truth); + static void UseExtraMenuGraphicsChanger(truthoption*, truth); #ifndef __DJGPP__ static void GraphicsScaleDisplayer(const cycleoption*, festring&); @@ -261,6 +263,7 @@ class ivanconfig static truthoption ShowTurn; static truthoption AllowMouseOnFelist; + static truthoption UseExtraMenuGraphics; }; inline long ivanconfig::ApplyContrastTo(long L) diff --git a/Main/Source/game.cpp b/Main/Source/game.cpp index 6661035a9..6d877a603 100644 --- a/Main/Source/game.cpp +++ b/Main/Source/game.cpp @@ -4643,7 +4643,8 @@ int game::Menu(std::vector vBackGround, v2 Pos, cfestring& Topic, cfest col16 Color, cfestring& SmallText1, cfestring& SmallText2) { globalwindowhandler::DisableControlLoops(); - int Return = iosystem::Menu(vBackGround, Pos, Topic, sMS, Color, SmallText1, SmallText2); + int Return = iosystem::Menu(vBackGround, Pos, Topic, sMS, Color, SmallText1, SmallText2, + ivanconfig::GetExtraMenuGraphics()); globalwindowhandler::EnableControlLoops(); return Return; } diff --git a/Main/Source/iconf.cpp b/Main/Source/iconf.cpp index 5ec222d60..e0ba6a018 100644 --- a/Main/Source/iconf.cpp +++ b/Main/Source/iconf.cpp @@ -351,6 +351,13 @@ cycleoption ivanconfig::ScalingQuality( "ScalingQuality", "", 0, 2, &ScalingQualityDisplayer); +truthoption ivanconfig::UseExtraMenuGraphics("UseExtraMenuGraphics", + "Use extra main menu graphics", + "Add changing graphics and sounds to the main menu.", + false, + &configsystem::NormalTruthDisplayer, + &configsystem::NormalTruthChangeInterface, + &UseExtraMenuGraphicsChanger); #endif col24 ivanconfig::ContrastLuminance = NORMAL_LUMINANCE; truthoption ivanconfig::PlaySounds( "PlaySounds", @@ -1019,6 +1026,13 @@ void ivanconfig::AllowMouseOnFelistChanger(truthoption* O, truth What) graphics::SetAllowMouseInFullScreen(What); } +void ivanconfig::UseExtraMenuGraphicsChanger(truthoption* O, truth What) +{ + if(O!=NULL)O->Value = What; + felist::SetAllowMouse(What); + graphics::SetAllowMouseInFullScreen(What); +} + void ivanconfig::FullScreenModeChanger(truthoption*, truth) { graphics::SwitchMode(); @@ -1065,9 +1079,9 @@ void ivanconfig::VolumeHandler(long Value) void ivanconfig::SfxVolumeHandler(long Value) { SfxVolumeChanger(&SfxVolume, Value); - + soundeffects::SetSfxVolume(SfxVolume.Value); - + if(game::IsRunning()) { game::GetCurrentArea()->SendNewDrawRequest(); @@ -1160,6 +1174,7 @@ void ivanconfig::Initialize() configsystem::AddOption(fsCategory,&HitIndicator); configsystem::AddOption(fsCategory,&ShowMap); configsystem::AddOption(fsCategory,&TransparentMapLM); + configsystem::AddOption(fsCategory,&UseExtraMenuGraphics); fsCategory="Sounds"; configsystem::AddOption(fsCategory,&PlaySounds); @@ -1222,7 +1237,8 @@ void ivanconfig::Initialize() SelectedBkgColorChanger(NULL, SelectedBkgColor.Value); AutoPickUpMatchingChanger(NULL, AutoPickUpMatching.Value); AllowMouseOnFelistChanger(NULL, AllowMouseOnFelist.Value); - + UseExtraMenuGraphicsChanger(NULL, UseExtraMenuGraphics.Value); + #ifndef NOSOUND soundeffects::SetEnableSfx(PlaySounds.Value); soundeffects::SetSfxVolume(SfxVolume.Value); diff --git a/Main/Source/main.cpp b/Main/Source/main.cpp index 60391c4a1..146f3cc40 100644 --- a/Main/Source/main.cpp +++ b/Main/Source/main.cpp @@ -175,7 +175,8 @@ int main(int argc, char** argv) CONST_S("Released under the GNU\r" "General Public License\r" "More info: see COPYING\r"), - CONST_S("IVAN v" IVAN_VERSION "\r")); + CONST_S("IVAN v" IVAN_VERSION "\r"), + ivanconfig::GetExtraMenuGraphics()); switch(Select) {