diff options
author | Dan Goodliffe <dan@randomdan.homeip.net> | 2022-10-08 18:40:58 +0100 |
---|---|---|
committer | Dan Goodliffe <dan@randomdan.homeip.net> | 2022-10-08 18:40:58 +0100 |
commit | 920ae293f6830833146a524345dfbf00669e785b (patch) | |
tree | b971a645b4bb3347ac1ccac31efc05b9445b4ca4 /ui/editNetwork.cpp | |
parent | Move addStraight to impl.h (diff) | |
download | ilt-920ae293f6830833146a524345dfbf00669e785b.tar.bz2 ilt-920ae293f6830833146a524345dfbf00669e785b.tar.xz ilt-920ae293f6830833146a524345dfbf00669e785b.zip |
Add a rather dumb builder for joining nodes
Diffstat (limited to 'ui/editNetwork.cpp')
-rw-r--r-- | ui/editNetwork.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/ui/editNetwork.cpp b/ui/editNetwork.cpp index a51d7fb..3ab7059 100644 --- a/ui/editNetwork.cpp +++ b/ui/editNetwork.cpp @@ -1,4 +1,5 @@ #include "editNetwork.h" +#include "builders/join.h" #include "builders/straight.h" #include "text.h" #include <game/gamestate.h> @@ -7,6 +8,7 @@ EditNetwork::EditNetwork(Network * n) : network {n}, builderToolbar { {"ui/icon/network.png", mode.toggle<BuilderStraight>()}, + {"ui/icon/network.png", mode.toggle<BuilderJoin>()}, } { } @@ -16,7 +18,7 @@ EditNetwork::~EditNetwork() = default; bool EditNetwork::click(const SDL_MouseButtonEvent & e, const Ray & ray) { - if (builder) { + if (builder && (e.button == SDL_BUTTON_LEFT || e.button == SDL_BUTTON_MIDDLE)) { builder->click(network, gameState->geoData.get(), e, ray); return true; } |