diff --git a/src/game/GameModel.cpp b/src/game/GameModel.cpp index 28ed5501d..756604408 100644 --- a/src/game/GameModel.cpp +++ b/src/game/GameModel.cpp @@ -169,6 +169,10 @@ void GameModel::BuildMenus() { tempTool = new Element_LIGH_Tool(i, sim->elements[i].Name, sim->elements[i].Description, PIXR(sim->elements[i].Colour), PIXG(sim->elements[i].Colour), PIXB(sim->elements[i].Colour)); } + else if(i == PT_STKM || i == PT_FIGH || i == PT_STKM2) + { + tempTool = new PlopTool(i, sim->elements[i].Name, sim->elements[i].Description, PIXR(sim->elements[i].Colour), PIXG(sim->elements[i].Colour), PIXB(sim->elements[i].Colour)); + } else { tempTool = new ElementTool(i, sim->elements[i].Name, sim->elements[i].Description, PIXR(sim->elements[i].Colour), PIXG(sim->elements[i].Colour), PIXB(sim->elements[i].Colour)); diff --git a/src/game/Tool.cpp b/src/game/Tool.cpp index 352587627..43c28001b 100644 --- a/src/game/Tool.cpp +++ b/src/game/Tool.cpp @@ -151,4 +151,9 @@ void Element_LIGH_Tool::Draw(Simulation * sim, Brush * brush, ui::Point position sim->parts[p].life = 55; sim->parts[p].temp = sim->parts[p].life*150; // temperature of the lighting shows the power of the lighting } +} + +void PlopTool::Click(Simulation * sim, Brush * brush, ui::Point position) +{ + sim->create_part(-1, position.X, position.Y, toolID); } \ No newline at end of file diff --git a/src/game/Tool.h b/src/game/Tool.h index f10d5f7a7..1b7076890 100644 --- a/src/game/Tool.h +++ b/src/game/Tool.h @@ -96,6 +96,21 @@ public: virtual void DrawFill(Simulation * sim, Brush * brush, ui::Point position); }; +class PlopTool: public ElementTool +{ +public: + PlopTool(int id, string name, string description, int r, int g, int b, VideoBuffer * (*textureGen)(int, int, int) = NULL): + ElementTool(id, name, description, r, g, b) + { + } + virtual ~PlopTool() {} + virtual void Draw(Simulation * sim, Brush * brush, ui::Point position) {} + virtual void Click(Simulation * sim, Brush * brush, ui::Point position); + virtual void DrawLine(Simulation * sim, Brush * brush, ui::Point position1, ui::Point position2, bool dragging = false) { } + virtual void DrawRect(Simulation * sim, Brush * brush, ui::Point position1, ui::Point position2) { } + virtual void DrawFill(Simulation * sim, Brush * brush, ui::Point position) { } +}; + class WallTool: public Tool { public: