Commit bf38b390 authored by gerstrong@gmail.com's avatar [email protected]

Improved Save game code. Now you can choose between typed names or printed timestamps

parent ba7fead8
**************************************************************
Commander Genius
(c)2008-2018 Gerstrong
(c)2008-2020 Gerstrong
Resources:
(c)2018 Zilem
(c)2018-2020 Zilem
Porting and Support:
(c)2010-2018 Pelya (Android-Distro)
(c)2010-2020 Pelya (Android-Distro)
Released under GNU/GPL
......
......@@ -2,6 +2,8 @@ v???:
-------
- Fixed problem with some dialogs in vorticon keen engine
- Improved the code for save game menus
- Added option where you can choose whether you type your save game
or a timestamp is automatically entered instead
v2.3.9:
......
......@@ -121,13 +121,14 @@ bool CGameLauncher::setupMenu()
mLauncherDialog.add(new CGUIText("Pick a Game",
GsRect<float>(0.14f, 0.01f, 0.72f, 0.05f)));
/*
const auto openSettingsMenuEvent = [&]()
{
mLauncherDialog.enable(false);
gEventManager.add( new OpenMenuEvent(
new SettingsMenu(Style::NONE) ) );
};
*/
/*
mpOptionButton =
mLauncherDialog.add(
......
......@@ -332,6 +332,7 @@ void CSettings::loadDefaultGameCfg()
setOption( GameOption::KEYSTACK, "Keystacking ", "keystack", 0 );
setOption( GameOption::LVLREPLAYABILITY,"Replay Levels ", "level_replayability", 0 );
setOption( GameOption::RISEBONUS, "Rising Bonus ", "rise_bonus", 1 );
setOption( GameOption::NOTYPING, "No Typing ", "no_typing", 0 );
setOption( GameOption::MODERN, "Modern Style ", "modern_style", 1 );
setOption( GameOption::HUD, "HUD Display ", "hud", 1 );
setOption( GameOption::SPECIALFX, "Special Effects", "specialfx", 1 );
......
......@@ -37,6 +37,7 @@ public:
options[GameOption::KEYSTACK].value = 0;
options[GameOption::LVLREPLAYABILITY].value = 0;
options[GameOption::RISEBONUS].value = 0;
options[GameOption::NOTYPING].value = 0;
options[GameOption::MODERN].value = 1;
options[GameOption::HUD].value = 0;
options[GameOption::SPECIALFX].value = 0;
......
......@@ -25,7 +25,7 @@ mStyle(style)
}
else if(style == Style::VORTICON)
{
GsRect<float> dlgRect(0.15f, 0.282f, 0.70f, 0.5f);
GsRect<float> dlgRect(0.15f, 0.282f, 0.70f, 0.6f);
mpMenuDialog->setRect(dlgRect);
......
......@@ -19,7 +19,7 @@ GameMenu( GsRect<float>(0.1f, 0.14f, 0.8f,
{
mpOptionList.push_back( new Switch( option.second.menuname, style ) );
mpMenuDialog->add( mpOptionList.back() );
}
}
setMenuLabel("OPTIONSMENULABEL");
......
......@@ -21,12 +21,6 @@
const std::string EMPTY_TEXT = "EMPTY";
#ifdef NOTYPESAVE
const bool nontypesaves = true;
#else
const bool nontypesaves = false;
#endif
CSaveMenu::CSaveMenu(const Style &style) :
GameMenu(GsRect<float>(0.1f, 0.0f, 0.8f, 1.0f), style )
......@@ -95,7 +89,9 @@ void CSaveMenu::ponder(const float deltaT)
auto &curWidget = mpMenuDialog->CurrentWidget();
auto pInput = std::dynamic_pointer_cast<InputText>(curWidget);
if(nontypesaves)
const auto noTyping = gBehaviorEngine.mOptions[GameOption::NOTYPING].value;
if(noTyping)
{
GameMenu::ponder(deltaT);
/*auto &list =
......@@ -154,6 +150,8 @@ void CSaveMenu::sendEvent(std::shared_ptr<CEvent> &command)
auto &curWidget = mpMenuDialog->CurrentWidget();
auto pInput = std::dynamic_pointer_cast<InputText>(curWidget);
const auto noTyping = gBehaviorEngine.mOptions[GameOption::NOTYPING].value;
// Before all events are sent to the dialog which handles selection catch some specific events
// required for the saving process.
if( CommandEvent *ev = dynamic_cast<CommandEvent*>(command.get()) )
......@@ -163,7 +161,7 @@ void CSaveMenu::sendEvent(std::shared_ptr<CEvent> &command)
{
if(ev->mCommand == IC_JUMP || ev->mCommand == IC_STATUS)
{
if(nontypesaves)
if(noTyping)
{
const std::string saveText = getTimeStr();
......
......@@ -25,7 +25,7 @@
SettingsMenu::SettingsMenu(const Style &style) :
GameMenu( GsRect<float>(0.25f, 0.24f, 0.5f, 0.40f),
GameMenu( GsRect<float>(0.25f, 0.24f, 0.5f, 0.40f),
style )
{
......
......@@ -15,6 +15,7 @@ enum class GameOption
ALLOWPKING,
KEYSTACK,
LVLREPLAYABILITY, RISEBONUS,
NOTYPING,
MODERN,
HUD,SPECIALFX,
SHOWFPS,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment