From f4e222248f4959ea82b9e94ec0e21dcecbecac88 Mon Sep 17 00:00:00 2001 From: krzys-h Date: Sun, 24 Mar 2013 19:05:20 +0100 Subject: [PATCH] Retro mode now disables possibility of writing and running programs --- src/object/brain.cpp | 24 +++++++++++++----------- src/object/robotmain.cpp | 4 ++++ src/object/robotmain.h | 4 +++- 3 files changed, 20 insertions(+), 12 deletions(-) diff --git a/src/object/brain.cpp b/src/object/brain.cpp index babb38d5..1f428b74 100644 --- a/src/object/brain.cpp +++ b/src/object/brain.cpp @@ -1288,18 +1288,20 @@ bool CBrain::CreateInterface(bool bSelect) type == OBJECT_BEE || type == OBJECT_WORM ) // vehicle? { - ddim.x = dim.x*5.1f; - ddim.y = dim.y*2.0f; - pos.x = ox+sx*0.0f; - pos.y = oy+sy*0.0f; - pw->CreateList(pos, ddim, -1, EVENT_OBJECT_PROGLIST, 1.10f); - UpdateScript(pw); + if (!(CRobotMain::GetInstancePointer()->GetRetroMode())) { + ddim.x = dim.x*5.1f; + ddim.y = dim.y*2.0f; + pos.x = ox+sx*0.0f; + pos.y = oy+sy*0.0f; + pw->CreateList(pos, ddim, -1, EVENT_OBJECT_PROGLIST, 1.10f); + UpdateScript(pw); - pos.x = ox+sx*5.2f; - pos.y = oy+sy*1.0f; - pw->CreateButton(pos, dim, 8, EVENT_OBJECT_PROGRUN); - pos.y = oy+sy*0.0f; - pw->CreateButton(pos, dim, 22, EVENT_OBJECT_PROGEDIT); + pos.x = ox+sx*5.2f; + pos.y = oy+sy*1.0f; + pw->CreateButton(pos, dim, 8, EVENT_OBJECT_PROGRUN); + pos.y = oy+sy*0.0f; + pw->CreateButton(pos, dim, 22, EVENT_OBJECT_PROGEDIT); + } } if ( type == OBJECT_HUMAN || diff --git a/src/object/robotmain.cpp b/src/object/robotmain.cpp index 2fde5671..8dedb8c0 100644 --- a/src/object/robotmain.cpp +++ b/src/object/robotmain.cpp @@ -6795,6 +6795,10 @@ const char* CRobotMain::GetFilesDir() return m_dialog->GetFilesDir().c_str(); } +bool CRobotMain::GetRetroMode() +{ + return m_retroStyle; +} //! Change the player's name void CRobotMain::SetGamerName(const char *name) diff --git a/src/object/robotmain.h b/src/object/robotmain.h index 181a1cbe..0bcd2dce 100644 --- a/src/object/robotmain.h +++ b/src/object/robotmain.h @@ -304,6 +304,7 @@ public: const char* GetSavegameDir(); const char* GetPublicDir(); const char* GetFilesDir(); + bool GetRetroMode(); void SetGamerName(const char *name); char* GetGamerName(); @@ -447,6 +448,7 @@ protected: int m_delayWriteMessage; int m_movieInfoIndex; + //Level Checker flags bool m_beginObject; bool m_terrainGenerate; bool m_terrainInitTextures; @@ -454,7 +456,7 @@ protected: bool m_terrainCreate; int m_version; // Mission file version - bool m_retroStyle; // Retro style + bool m_retroStyle; // Retro bool m_immediatSatCom; // SatCom immediately? bool m_beginSatCom; // messages SatCom poster? bool m_movieLock; // movie in progress?