From e146ae50abc021cbff765aa73327408c7d4661ea Mon Sep 17 00:00:00 2001 From: jacob1 Date: Thu, 6 Jun 2013 23:23:48 -0400 Subject: [PATCH] some minor changes to tools --- src/gui/game/GameModel.cpp | 2 +- src/gui/game/Tool.h | 6 +++--- src/simulation/tools/AirTool.cpp | 9 +++++---- src/simulation/tools/Cool.cpp | 7 ++++--- src/simulation/tools/Heat.cpp | 7 ++++--- src/simulation/tools/NGrv.cpp | 2 +- src/simulation/tools/PGrv.cpp | 2 +- src/simulation/tools/Vac.cpp | 11 ++++++----- 8 files changed, 25 insertions(+), 21 deletions(-) diff --git a/src/gui/game/GameModel.cpp b/src/gui/game/GameModel.cpp index 363f275f7..4353316d0 100644 --- a/src/gui/game/GameModel.cpp +++ b/src/gui/game/GameModel.cpp @@ -312,7 +312,7 @@ void GameModel::BuildMenus() menuList[SC_TOOL]->AddTool(tempTool); } //Add special sign and prop tools - menuList[SC_TOOL]->AddTool(new WindTool(0, "WIND", "Create air movement", 64, 64, 64, "DEFAULT_UI_WIND")); + menuList[SC_TOOL]->AddTool(new WindTool(0, "WIND", "Create air movement.", 64, 64, 64, "DEFAULT_UI_WIND")); menuList[SC_TOOL]->AddTool(new PropertyTool()); menuList[SC_TOOL]->AddTool(new SignTool()); menuList[SC_TOOL]->AddTool(new SampleTool(this)); diff --git a/src/gui/game/Tool.h b/src/gui/game/Tool.h index 37b79e3b6..8b75f3f63 100644 --- a/src/gui/game/Tool.h +++ b/src/gui/game/Tool.h @@ -45,7 +45,7 @@ class SignTool: public Tool { public: SignTool(): - Tool(0, "SIGN", "Sign. Click a sign to edit or anywhere else to create a new one", 0, 0, 0, "DEFAULT_UI_SIGN", SignTool::GetIcon) + Tool(0, "SIGN", "Sign. Click a sign to edit or anywhere else to create a new one.", 0, 0, 0, "DEFAULT_UI_SIGN", SignTool::GetIcon) { } static VideoBuffer * GetIcon(int toolID, int width, int height); @@ -64,7 +64,7 @@ class SampleTool: public Tool GameModel * gameModel; public: SampleTool(GameModel * model): - Tool(0, "SMPL", "Sample an element on the screen", 0, 0, 0, "DEFAULT_UI_SAMPLE", SampleTool::GetIcon), + Tool(0, "SMPL", "Sample an element on the screen.", 0, 0, 0, "DEFAULT_UI_SAMPLE", SampleTool::GetIcon), gameModel(model) { } @@ -81,7 +81,7 @@ class PropertyTool: public Tool { public: PropertyTool(): - Tool(0, "PROP", "Property Edit. Click to alter the properties of elements in the field", 0xfe, 0xa9, 0x00, "DEFAULT_UI_PROPERTY", NULL) + Tool(0, "PROP", "Property Edit. Click to alter the properties of elements in the field.", 0xfe, 0xa9, 0x00, "DEFAULT_UI_PROPERTY", NULL) { } virtual ~PropertyTool() {} diff --git a/src/simulation/tools/AirTool.cpp b/src/simulation/tools/AirTool.cpp index 5d7f4054b..506252e2f 100644 --- a/src/simulation/tools/AirTool.cpp +++ b/src/simulation/tools/AirTool.cpp @@ -1,20 +1,21 @@ #include "ToolClasses.h" #include "simulation/Air.h" -//#TPT-Directive ToolClass Tool_Air TOOL_AIR 3 +//#TPT-Directive ToolClass Tool_Air TOOL_AIR 2 Tool_Air::Tool_Air() { Identifier = "DEFAULT_TOOL_AIR"; Name = "AIR"; Colour = PIXPACK(0xFFFFFF); - Description = "Creates air pressure"; + Description = "Air, creates airflow and pressure."; } int Tool_Air::Perform(Simulation * sim, Particle * cpart, int x, int y, float strength) { sim->air->pv[y/CELL][x/CELL] += strength*0.05f; - if(sim->air->pv[y/CELL][x/CELL] > 256.0f) + + if (sim->air->pv[y/CELL][x/CELL] > 256.0f) sim->air->pv[y/CELL][x/CELL] = 256.0f; - if(sim->air->pv[y/CELL][x/CELL] < -256.0f) + else if (sim->air->pv[y/CELL][x/CELL] < -256.0f) sim->air->pv[y/CELL][x/CELL] = -256.0f; return 1; } diff --git a/src/simulation/tools/Cool.cpp b/src/simulation/tools/Cool.cpp index 16a7f91e7..db49e6115 100644 --- a/src/simulation/tools/Cool.cpp +++ b/src/simulation/tools/Cool.cpp @@ -5,7 +5,7 @@ Tool_Cool::Tool_Cool() Identifier = "DEFAULT_TOOL_COOL"; Name = "COOL"; Colour = PIXPACK(0x00DDFF); - Description = "Cools particles"; + Description = "Cools the targeted element."; } int Tool_Cool::Perform(Simulation * sim, Particle * cpart, int x, int y, float strength) @@ -16,9 +16,10 @@ int Tool_Cool::Perform(Simulation * sim, Particle * cpart, int x, int y, float s cpart->temp -= strength*.1f; else cpart->temp -= strength*2.0f; - if(cpart->temp > MAX_TEMP) + + if (cpart->temp > MAX_TEMP) cpart->temp = MAX_TEMP; - if(cpart->temp < 0) + else if (cpart->temp < 0) cpart->temp = 0; return 1; } diff --git a/src/simulation/tools/Heat.cpp b/src/simulation/tools/Heat.cpp index 0d77d5558..dac33477f 100644 --- a/src/simulation/tools/Heat.cpp +++ b/src/simulation/tools/Heat.cpp @@ -5,7 +5,7 @@ Tool_Heat::Tool_Heat() Identifier = "DEFAULT_TOOL_HEAT"; Name = "HEAT"; Colour = PIXPACK(0xFFDD00); - Description = "Heats particles"; + Description = "Heats the targeted element."; } int Tool_Heat::Perform(Simulation * sim, Particle * cpart, int x, int y, float strength) @@ -16,9 +16,10 @@ int Tool_Heat::Perform(Simulation * sim, Particle * cpart, int x, int y, float s cpart->temp += strength*.1f; else cpart->temp += strength*2.0f; - if(cpart->temp > MAX_TEMP) + + if (cpart->temp > MAX_TEMP) cpart->temp = MAX_TEMP; - if(cpart->temp < 0) + else if (cpart->temp < 0) cpart->temp = 0; return 1; } diff --git a/src/simulation/tools/NGrv.cpp b/src/simulation/tools/NGrv.cpp index 89af1ea86..c1fa2c198 100644 --- a/src/simulation/tools/NGrv.cpp +++ b/src/simulation/tools/NGrv.cpp @@ -6,7 +6,7 @@ Tool_NGrv::Tool_NGrv() Identifier = "DEFAULT_TOOL_NGRV"; Name = "NGRV"; Colour = PIXPACK(0xAACCFF); - Description = "Creates a short-lasting negative gravity well"; + Description = "Creates a short-lasting negative gravity well."; } int Tool_NGrv::Perform(Simulation * sim, Particle * cpart, int x, int y, float strength) diff --git a/src/simulation/tools/PGrv.cpp b/src/simulation/tools/PGrv.cpp index e2c9fb0e5..a7635707e 100644 --- a/src/simulation/tools/PGrv.cpp +++ b/src/simulation/tools/PGrv.cpp @@ -6,7 +6,7 @@ Tool_PGrv::Tool_PGrv() Identifier = "DEFAULT_TOOL_PGRV"; Name = "PGRV"; Colour = PIXPACK(0xCCCCFF); - Description = "Creates a short-lasting gravity well"; + Description = "Creates a short-lasting gravity well."; } int Tool_PGrv::Perform(Simulation * sim, Particle * cpart, int x, int y, float strength) diff --git a/src/simulation/tools/Vac.cpp b/src/simulation/tools/Vac.cpp index 86beb5475..eded57c3c 100644 --- a/src/simulation/tools/Vac.cpp +++ b/src/simulation/tools/Vac.cpp @@ -1,20 +1,21 @@ #include "ToolClasses.h" #include "simulation/Air.h" -//#TPT-Directive ToolClass Tool_Vac TOOL_VAC 2 +//#TPT-Directive ToolClass Tool_Vac TOOL_VAC 3 Tool_Vac::Tool_Vac() { Identifier = "DEFAULT_TOOL_VAC"; Name = "VAC"; Colour = PIXPACK(0x303030); - Description = "Reduces air pressure"; + Description = "Vacuum, reduces air pressure."; } int Tool_Vac::Perform(Simulation * sim, Particle * cpart, int x, int y, float strength) { - sim->air->pv[y/CELL][x/CELL] -= strength*0.05f;; - if(sim->air->pv[y/CELL][x/CELL] > 256.0f) + sim->air->pv[y/CELL][x/CELL] -= strength*0.05f; + + if (sim->air->pv[y/CELL][x/CELL] > 256.0f) sim->air->pv[y/CELL][x/CELL] = 256.0f; - if(sim->air->pv[y/CELL][x/CELL] < -256.0f) + else if (sim->air->pv[y/CELL][x/CELL] < -256.0f) sim->air->pv[y/CELL][x/CELL] = -256.0f; return 1; }