From 926126d5adf457dbc5c92fd83c7231415ea22d04 Mon Sep 17 00:00:00 2001 From: erihel Date: Mon, 1 Apr 2013 18:24:12 +0200 Subject: * Changed loading of scene and player info (there's problem with locales using , as comma separator). Issue #137 * Changed way of saving files. Now it's not based on slot (from 000 to 999) but it uses save name as a base. * Changed way of displaying saved games. Listing directory instead of checking from 000 to 999. Issue #138 --- src/object/robotmain.h | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'src/object/robotmain.h') diff --git a/src/object/robotmain.h b/src/object/robotmain.h index fe5fbd5..fc62072 100644 --- a/src/object/robotmain.h +++ b/src/object/robotmain.h @@ -352,6 +352,9 @@ public: CObject* IOReadObject(char *line, const char* filename, int objRank); int CreateSpot(Math::Vector pos, Gfx::Color color); + + void SetNumericLocale(); + void RestoreNumericLocale(); protected: bool EventFrame(const Event &event); @@ -390,6 +393,7 @@ protected: void ExecuteCmd(char *cmd); bool TestGadgetQuantity(int rank); void UpdateSpeedLabel(); + protected: CApplication* m_app; @@ -540,5 +544,7 @@ protected: Gfx::Color m_colorRefWater; Gfx::Color m_colorNewWater; float m_colorShiftWater; + + std::string m_oldLocale; }; -- cgit v1.2.3-1-g7c22 From ebffda717b1b633baba7a313267505614f89f26e Mon Sep 17 00:00:00 2001 From: krzys-h Date: Sat, 13 Apr 2013 11:44:16 +0200 Subject: Implemented AudioChange (partially) There is some issues due to #173 Issue #172 --- src/object/robotmain.h | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) (limited to 'src/object/robotmain.h') diff --git a/src/object/robotmain.h b/src/object/robotmain.h index fc62072..d3b18bc 100644 --- a/src/object/robotmain.h +++ b/src/object/robotmain.h @@ -99,13 +99,25 @@ struct EndTake Math::Vector pos; float dist; ObjectType type; - int min; // wins if> + int min; // wins if > int max; // wins if < int lost; // lost if <= bool immediat; char message[100]; }; +struct AudioChange +{ + Math::Vector pos; + float dist; + ObjectType type; + int min; // change if > + int max; // change if < + char music[100]; + bool repeat; + bool changed; +}; + const int MAXNEWSCRIPTNAME = 20; @@ -248,6 +260,7 @@ public: void ResetObject(); void ResetCreate(); + void UpdateAudio(bool frame); Error CheckEndMission(bool frame); void CheckEndMessage(const char* message); int GetObligatoryToken(); @@ -522,6 +535,9 @@ protected: long m_endTakeResearch; float m_endTakeWinDelay; float m_endTakeLostDelay; + + int m_audioChangeTotal; + AudioChange m_audioChange[10]; int m_obligatoryTotal; char m_obligatoryToken[100][20]; -- cgit v1.2.3-1-g7c22 From 6ea0031d83db660946084a28dcf7d48eb3644a6d Mon Sep 17 00:00:00 2001 From: krzys-h Date: Sat, 13 Apr 2013 16:35:35 +0200 Subject: Added loading from custom files for Audio --- src/object/robotmain.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/object/robotmain.h') diff --git a/src/object/robotmain.h b/src/object/robotmain.h index d3b18bc..6ff53f1 100644 --- a/src/object/robotmain.h +++ b/src/object/robotmain.h @@ -461,7 +461,7 @@ protected: bool m_cheatRadar; bool m_audioRepeat; bool m_shortCut; - int m_audioTrack; + std::string m_audioTrack; int m_delayWriteMessage; int m_movieInfoIndex; -- cgit v1.2.3-1-g7c22 From dd180dd88739eb7dd71a6431b2651a18a36599d3 Mon Sep 17 00:00:00 2001 From: krzys-h Date: Sat, 20 Apr 2013 12:08:48 +0200 Subject: Added powermin= and powermax= parameters Issue #174 --- src/object/robotmain.h | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src/object/robotmain.h') diff --git a/src/object/robotmain.h b/src/object/robotmain.h index 6ff53f1..7ed84c5 100644 --- a/src/object/robotmain.h +++ b/src/object/robotmain.h @@ -102,6 +102,8 @@ struct EndTake int min; // wins if > int max; // wins if < int lost; // lost if <= + float powermin; // wins if energy cell >= + float powermax; // wins if energy cell <= bool immediat; char message[100]; }; @@ -113,6 +115,8 @@ struct AudioChange ObjectType type; int min; // change if > int max; // change if < + float powermin; // change if energy cell >= + float powermax; // change if energy cell <= char music[100]; bool repeat; bool changed; -- cgit v1.2.3-1-g7c22 From fc28a8e8406e4b5fd810a09ed3b9524af8d69482 Mon Sep 17 00:00:00 2001 From: krzys-h Date: Sun, 28 Apr 2013 18:33:59 +0200 Subject: Implemented EndMissionNever (#181) --- src/object/robotmain.h | 1 + 1 file changed, 1 insertion(+) (limited to 'src/object/robotmain.h') diff --git a/src/object/robotmain.h b/src/object/robotmain.h index 7ed84c5..73315af 100644 --- a/src/object/robotmain.h +++ b/src/object/robotmain.h @@ -537,6 +537,7 @@ protected: int m_endTakeTotal; EndTake m_endTake[10]; long m_endTakeResearch; + bool m_endTakeNever; float m_endTakeWinDelay; float m_endTakeLostDelay; -- cgit v1.2.3-1-g7c22 From 75950c55ba2065e792dc573adbaa31897cbc113a Mon Sep 17 00:00:00 2001 From: krzys-h Date: Mon, 29 Apr 2013 17:26:32 +0200 Subject: MissionController improved --- src/object/robotmain.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src/object/robotmain.h') diff --git a/src/object/robotmain.h b/src/object/robotmain.h index 73315af..1ab1b46 100644 --- a/src/object/robotmain.h +++ b/src/object/robotmain.h @@ -469,6 +469,8 @@ protected: int m_delayWriteMessage; int m_movieInfoIndex; + CObject* m_controller; + //Level Checker flags bool m_beginObject; bool m_terrainGenerate; -- cgit v1.2.3-1-g7c22 From 643153d64dd25cb27fae76c9cc22e9bdaa2e352e Mon Sep 17 00:00:00 2001 From: krzys-h Date: Tue, 30 Apr 2013 21:43:59 +0200 Subject: Added function endmission() Works only with MissionFile version=3 Created for MissionController, but works on any bot - 1st parameter: * ResultWin - win mission * ResultLost - lost mission * ResultLostQuick - lost mission (Me died) - 2nd parameter: win/lost delay, like in mission file. Doesn't work for ResultLostQuick. Please don't use for cheating =) --- src/object/robotmain.h | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src/object/robotmain.h') diff --git a/src/object/robotmain.h b/src/object/robotmain.h index 1ab1b46..f80d611 100644 --- a/src/object/robotmain.h +++ b/src/object/robotmain.h @@ -265,6 +265,7 @@ public: void ResetObject(); void ResetCreate(); void UpdateAudio(bool frame); + void SetEndMission(Error result, float delay); Error CheckEndMission(bool frame); void CheckEndMessage(const char* message); int GetObligatoryToken(); @@ -556,6 +557,8 @@ protected: int m_freeBuild; // constructible buildings int m_freeResearch; // researches possible + Error m_missionResult; + ShowLimit m_showLimit[MAXSHOWLIMIT]; Gfx::Color m_colorRefBot; -- cgit v1.2.3-1-g7c22 From d815fbf09e0e99b42d449bce7083bc0968f581be Mon Sep 17 00:00:00 2001 From: krzys-h Date: Wed, 1 May 2013 21:02:43 +0200 Subject: Saving information to profile (#154) --- src/object/robotmain.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/object/robotmain.h') diff --git a/src/object/robotmain.h b/src/object/robotmain.h index f80d611..6c331ab 100644 --- a/src/object/robotmain.h +++ b/src/object/robotmain.h @@ -552,7 +552,7 @@ protected: int m_prohibitedTotal; char m_prohibitedToken[100][20]; - char m_gamerName[100]; + std::string m_gamerName; int m_freeBuild; // constructible buildings int m_freeResearch; // researches possible -- cgit v1.2.3-1-g7c22 From 02b65fecd3e99df5ef4fcd953795d06b616bf035 Mon Sep 17 00:00:00 2001 From: krzys-h Date: Thu, 2 May 2013 18:07:20 +0200 Subject: Fixed Destroyer button * Commands were executed for all Destroyers on map * Button can't be clicked when Destroyer is working --- src/object/robotmain.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/object/robotmain.h') diff --git a/src/object/robotmain.h b/src/object/robotmain.h index 6c331ab..adabf64 100644 --- a/src/object/robotmain.h +++ b/src/object/robotmain.h @@ -374,6 +374,8 @@ public: void SetNumericLocale(); void RestoreNumericLocale(); + CObject* GetSelect(); + protected: bool EventFrame(const Event &event); bool EventObject(const Event &event); @@ -404,7 +406,6 @@ protected: void DeleteAllObjects(); void UpdateInfoText(); CObject* SearchObject(ObjectType type); - CObject* GetSelect(); void StartDisplayVisit(EventType event); void FrameVisit(float rTime); void StopDisplayVisit(); -- cgit v1.2.3-1-g7c22 From 6333d2d38e9801f67925cae194b07abcf8f1260e Mon Sep 17 00:00:00 2001 From: krzys-h Date: Sat, 4 May 2013 11:56:03 +0200 Subject: Removed most of "No such node" messages --- src/object/robotmain.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/object/robotmain.h') diff --git a/src/object/robotmain.h b/src/object/robotmain.h index adabf64..a459a59 100644 --- a/src/object/robotmain.h +++ b/src/object/robotmain.h @@ -191,7 +191,7 @@ const int AXIS_INVALID = -1; class CRobotMain : public CSingleton { public: - CRobotMain(CApplication* app); + CRobotMain(CApplication* app, bool loadProfile); ~CRobotMain(); Gfx::CCamera* GetCamera(); -- cgit v1.2.3-1-g7c22 From 8765d58b02c9afd00186bae4a0045dff32f7d102 Mon Sep 17 00:00:00 2001 From: Piotr Dziwinski Date: Sun, 26 May 2013 17:47:54 +0200 Subject: Fixed code formatting * moved braces to new lines * fixed some function/variable names * fixed whitespace issues --- src/object/robotmain.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src/object/robotmain.h') diff --git a/src/object/robotmain.h b/src/object/robotmain.h index a459a59..a75509d 100644 --- a/src/object/robotmain.h +++ b/src/object/robotmain.h @@ -370,7 +370,7 @@ public: CObject* IOReadObject(char *line, const char* filename, int objRank); int CreateSpot(Math::Vector pos, Gfx::Color color); - + void SetNumericLocale(); void RestoreNumericLocale(); @@ -412,7 +412,7 @@ protected: void ExecuteCmd(char *cmd); bool TestGadgetQuantity(int rank); void UpdateSpeedLabel(); - + protected: CApplication* m_app; @@ -544,7 +544,7 @@ protected: bool m_endTakeNever; float m_endTakeWinDelay; float m_endTakeLostDelay; - + int m_audioChangeTotal; AudioChange m_audioChange[10]; @@ -571,7 +571,7 @@ protected: Gfx::Color m_colorRefWater; Gfx::Color m_colorNewWater; float m_colorShiftWater; - + std::string m_oldLocale; }; -- cgit v1.2.3-1-g7c22 From 7874aca10ce6da823f88e8aabe4a0ea6431cc480 Mon Sep 17 00:00:00 2001 From: Piotr Dziwinski Date: Sun, 16 Jun 2013 21:39:21 +0200 Subject: Enhanced logging, option to auto-start mission * added logging of application events * changed debug mode flag to independent debug modes * added option to auto-start mission (load a mission immediately after startup) * removed "enum value out of range" prints * some refactoring --- src/object/robotmain.h | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'src/object/robotmain.h') diff --git a/src/object/robotmain.h b/src/object/robotmain.h index a75509d..04efea7 100644 --- a/src/object/robotmain.h +++ b/src/object/robotmain.h @@ -199,6 +199,9 @@ public: Ui::CInterface* GetInterface(); Ui::CDisplayText* GetDisplayText(); + //! Caused the given mission to be loaded immediately after start + void LoadSceneOnStart(const std::string& name, int rank); + void CreateIni(); //! Sets the default input bindings (key and axes) @@ -226,7 +229,7 @@ public: void ResetKeyStates(); void ChangePhase(Phase phase); - bool EventProcess(Event &event); + bool ProcessEvent(Event &event); bool CreateShortcuts(); void ScenePerso(); -- cgit v1.2.3-1-g7c22 From bfcce26f8949f4ba42cc1bd8203dff51884aa0da Mon Sep 17 00:00:00 2001 From: Piotr Dziwinski Date: Sat, 22 Jun 2013 01:11:37 +0200 Subject: Changes in build organization * targets are now created in top-level build directory * more things are now configured through CMake options * changed debug build detection from NDEBUG to DEV_BUILD * moved po and desktop directories * moved last unit test out of src directory --- src/object/robotmain.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/object/robotmain.h') diff --git a/src/object/robotmain.h b/src/object/robotmain.h index 04efea7..525e5df 100644 --- a/src/object/robotmain.h +++ b/src/object/robotmain.h @@ -192,7 +192,7 @@ class CRobotMain : public CSingleton { public: CRobotMain(CApplication* app, bool loadProfile); - ~CRobotMain(); + virtual ~CRobotMain(); Gfx::CCamera* GetCamera(); Gfx::CTerrain* GetTerrain(); -- cgit v1.2.3-1-g7c22