summaryrefslogtreecommitdiff
path: root/ui/gameMainSelector.h
diff options
context:
space:
mode:
authorDan Goodliffe <dan@randomdan.homeip.net>2022-01-18 02:07:33 +0000
committerDan Goodliffe <dan@randomdan.homeip.net>2022-01-18 02:07:33 +0000
commit917b3049a10dcc41d6d02f332e81b5dd05aff33d (patch)
treec97c3d9417246233d190567afca1e3473367426d /ui/gameMainSelector.h
parentCollection::removeAll returns how many matched by type (diff)
downloadilt-917b3049a10dcc41d6d02f332e81b5dd05aff33d.tar.bz2
ilt-917b3049a10dcc41d6d02f332e81b5dd05aff33d.tar.xz
ilt-917b3049a10dcc41d6d02f332e81b5dd05aff33d.zip
Beginnings of network editor
Pushes gameMainSelector clicks/moves into a different target
Diffstat (limited to 'ui/gameMainSelector.h')
-rw-r--r--ui/gameMainSelector.h39
1 files changed, 39 insertions, 0 deletions
diff --git a/ui/gameMainSelector.h b/ui/gameMainSelector.h
new file mode 100644
index 0000000..e0715c9
--- /dev/null
+++ b/ui/gameMainSelector.h
@@ -0,0 +1,39 @@
+#pragma once
+
+#include "special_members.hpp"
+#include "uiComponent.h"
+#include <glm/glm.hpp>
+#include <memory>
+#include <string>
+class Ray;
+class UIShader;
+union SDL_Event;
+class Camera;
+
+class GameMainSelector : public UIComponent {
+public:
+ class ClickReceiver {
+ public:
+ ClickReceiver() = default;
+ virtual ~ClickReceiver() = default;
+ DEFAULT_MOVE_COPY(ClickReceiver);
+
+ virtual void click(const Ray &) = 0;
+ virtual void move(const Ray &) = 0;
+ virtual bool handleMove() = 0;
+ };
+
+ GameMainSelector(const Camera * c, glm::vec2 size);
+
+ void render(const UIShader & shader, const Position & pos) const override;
+
+ bool handleInput(const SDL_Event & e, const Position &) override;
+
+ void defaultClick(const Ray & ray);
+
+ std::unique_ptr<ClickReceiver> target;
+
+private:
+ const Camera * camera;
+ std::string clicked;
+};