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

Added option for turing off sandwich main menu button

parent c1cc18eb
...@@ -280,14 +280,15 @@ void CSettings::setOption( const GameOption opt, ...@@ -280,14 +280,15 @@ void CSettings::setOption( const GameOption opt,
*/ */
void CSettings::loadDefaultGameCfg() void CSettings::loadDefaultGameCfg()
{ {
setOption( GameOption::ALLOWPKING, "Friendly Fire ", "pking", 1 ); setOption( GameOption::ALLOWPKING, "Friendly Fire ", "pking", 1 );
setOption( GameOption::KEYSTACK, "Keystacking ", "keystack", 0 ); setOption( GameOption::KEYSTACK, "Keystacking ", "keystack", 0 );
setOption( GameOption::LVLREPLAYABILITY,"Replay Levels ", "level_replayability", 0 ); setOption( GameOption::LVLREPLAYABILITY,"Replay Levels ", "level_replayability", 0 );
setOption( GameOption::RISEBONUS, "Rising Bonus ", "rise_bonus", 1 ); setOption( GameOption::RISEBONUS, "Rising Bonus ", "rise_bonus", 1 );
setOption( GameOption::MODERN, "Modern Style ", "modern_style", 1 ); setOption( GameOption::MODERN, "Modern Style ", "modern_style", 1 );
setOption( GameOption::HUD, "HUD Display ", "hud", 1 ); setOption( GameOption::HUD, "HUD Display ", "hud", 1 );
setOption( GameOption::SPECIALFX, "Special Effects ", "specialfx", 1 ); setOption( GameOption::SPECIALFX, "Special Effects", "specialfx", 1 );
setOption( GameOption::SHOWFPS, "Show FPS ", "showfps", 0 ); setOption( GameOption::SHOWFPS, "Show FPS ", "showfps", 0 );
setOption( GameOption::SANDWICHMENU, "Menu Button ", "sandwichbutton", 1 );
} }
/** /**
......
...@@ -17,7 +17,8 @@ enum class GameOption ...@@ -17,7 +17,8 @@ enum class GameOption
LVLREPLAYABILITY, RISEBONUS, LVLREPLAYABILITY, RISEBONUS,
MODERN, MODERN,
HUD,SPECIALFX, HUD,SPECIALFX,
SHOWFPS SHOWFPS,
SANDWICHMENU
}; };
struct stOption struct stOption
......
...@@ -662,11 +662,14 @@ void CPlayGameGalaxy::render() ...@@ -662,11 +662,14 @@ void CPlayGameGalaxy::render()
// The position of the sandwich menu depends on the configured blit resolution // The position of the sandwich menu depends on the configured blit resolution
mMenuButtonRect.x = gVideoDriver.getBlitSurface()->w-mMenuButtonRect.w; mMenuButtonRect.x = gVideoDriver.getBlitSurface()->w-mMenuButtonRect.w;
auto menuButtonRectWithBorder = mMenuButtonRect; if(gBehaviorEngine.mOptions[GameOption::SANDWICHMENU].value)
menuButtonRectWithBorder.y += gVideoDriver.getVidConfig().mHorizBorders; {
auto menuButtonRectWithBorder = mMenuButtonRect;
menuButtonRectWithBorder.y += gVideoDriver.getVidConfig().mHorizBorders;
// Draw a menu button where the mouse/finger might tap on // Draw a menu button where the mouse/finger might tap on
drawMenuInGameButton(menuButtonRectWithBorder); drawMenuInGameButton(menuButtonRectWithBorder);
}
// Draw some Textboxes with Messages only if one of those is open and needs to be drawn // Draw some Textboxes with Messages only if one of those is open and needs to be drawn
if(msgboxactive) if(msgboxactive)
......
...@@ -57,8 +57,41 @@ mTimer(0) ...@@ -57,8 +57,41 @@ mTimer(0)
setupGalaxyObjectOnMap(0x2D10, A_SHIKADI_STAND); setupGalaxyObjectOnMap(0x2D10, A_SHIKADI_STAND);
xDirection = LEFT; xDirection = LEFT;
loadPythonScripts("shikadi");
} }
bool CShikadi::loadPythonScripts(const std::string &scriptBaseName)
{
#if USE_PYTHON3
auto pModule = gPython.loadModule( scriptBaseName, JoinPaths(gKeenFiles.gameDir ,"ai") );
if (pModule != nullptr)
{
//loadAiGetterBool(pModule, "moreAgressive", mMoreAgressive);
mp_processState = static_cast<GASOFctr>(&CShikadi::processPython);
Py_DECREF(pModule);
}
else
{
return false;
}
Py_Finalize();
#endif
return true;
}
void CShikadi::processPython()
{
}
void CShikadi::processStanding() void CShikadi::processStanding()
{ {
if(getActionStatus(A_SHIKADI_WALK)) if(getActionStatus(A_SHIKADI_WALK))
......
...@@ -39,6 +39,10 @@ public: ...@@ -39,6 +39,10 @@ public:
* What happens if the slug gets touched by another object * What happens if the slug gets touched by another object
*/ */
void getTouchedBy(CSpriteObject &theObject); void getTouchedBy(CSpriteObject &theObject);
void processPython();
bool loadPythonScripts(const std::string &scriptBaseName) override;
private: private:
int mHealth; int mHealth;
......
...@@ -90,14 +90,14 @@ bool Audio::init() ...@@ -90,14 +90,14 @@ bool Audio::init()
mAudioSpec.channels, mAudioSpec.channels,
mAudioSpec.samples) < 0 ) mAudioSpec.samples) < 0 )
{ {
gLogging << "Mix_OpenAudio: " << Mix_GetError(); gLogging << "Mix_OpenAudio: " << Mix_GetError() << "\n";
return false; return false;
} }
{ {
int n = Mix_GetNumChunkDecoders(); int n = Mix_GetNumChunkDecoders();
gLogging << "There are "<< n << " available chunk(sample) decoders"; gLogging << "There are "<< n << " available chunk(sample) decoders" << "\n";
for(int i=0; i<n; ++i) for(int i=0; i<n; ++i)
{ {
...@@ -106,7 +106,7 @@ bool Audio::init() ...@@ -106,7 +106,7 @@ bool Audio::init()
n = Mix_GetNumMusicDecoders(); n = Mix_GetNumMusicDecoders();
gLogging << "There are " << n << "available music decoders:"; gLogging << "There are " << n << "available music decoders:" << "\n";
for(int i=0; i<n; ++i) for(int i=0; i<n; ++i)
{ {
......
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