summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--kurator/src/Title.cpp19
-rw-r--r--kurator/src/Title.h1
2 files changed, 19 insertions, 1 deletions
diff --git a/kurator/src/Title.cpp b/kurator/src/Title.cpp
index 5778ac8..3ada1d5 100644
--- a/kurator/src/Title.cpp
+++ b/kurator/src/Title.cpp
@@ -4,6 +4,7 @@
#include <utility>
#include <raylib.h>
+#include <imgui.h>
#include "Session.h"
#include "Battle.h"
@@ -22,8 +23,17 @@ Title::Title(std::shared_ptr<Session> _session) :
void
Title::update(const float)
{
+ ImGui::SetNextWindowSize({GetScreenWidth()/3.0f, 0.0f}, ImGuiCond_Once);
+ ImGui::SetNextWindowPos({GetScreenWidth()/2.0f, GetScreenHeight()/2.0f}, ImGuiCond_Once, {0.5f, 0.4f});
+ if (ImGui::Begin("Main Menu", nullptr, ImGuiWindowFlags_NoResize | ImGuiWindowFlags_NoCollapse)) {
+ if (ImGui::Button("Start", {-1.0f, 0.0f}))
+ start_battle();
+ if (ImGui::Button("Exit", {-1.0f, 0.0f}))
+ session->quit();
+ }
+ ImGui::End();
if (IsKeyPressed(KEY_SPACE))
- session->set(std::make_shared<Battle>(session));
+ start_battle();
}
@@ -38,4 +48,11 @@ Title::draw() const
}
+void
+Title::start_battle()
+{
+ session->set(std::make_shared<Battle>(session));
+}
+
+
} // namespace kurator
diff --git a/kurator/src/Title.h b/kurator/src/Title.h
index c29dc99..b350196 100644
--- a/kurator/src/Title.h
+++ b/kurator/src/Title.h
@@ -18,6 +18,7 @@ public:
void draw() const override;
private:
std::shared_ptr<Session> session;
+ void start_battle();
};