Commit e5d7ac22 authored by gerstrong@gmail.com's avatar gerstrong@gmail.com

Added option for turing off sandwich main menu button

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