aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorClyne Sullivan <tullivan99@gmail.com>2017-07-22 10:09:13 -0400
committerClyne Sullivan <tullivan99@gmail.com>2017-07-22 10:09:13 -0400
commit132172601e249327d30b3756c9dbfc73cb2b6b0c (patch)
treea8bf275357e5c4125970359f3714f4a61fa8dbc7 /include
parent0649af210afa6e7da051d655c3b28a7cd3b9ebc6 (diff)
dialog options now function
Diffstat (limited to 'include')
-rw-r--r--include/ui.hpp16
1 files changed, 10 insertions, 6 deletions
diff --git a/include/ui.hpp b/include/ui.hpp
index 3f0a67f..fa711d2 100644
--- a/include/ui.hpp
+++ b/include/ui.hpp
@@ -32,13 +32,17 @@ public:
void update(entityx::EntityManager &en, entityx::EventManager &ev, entityx::TimeDelta dt) override;
};
-struct OptionDim {
+struct DialogOption {
float x;
float y;
float width;
-};
-using DialogOption = std::pair<OptionDim, std::string>;
+ std::string text;
+ std::string value;
+
+ DialogOption(float _x, float _y, float _width, std::string _text, std::string _value)
+ : x(_x), y(_y), width(_width), text(_text), value(_value) {}
+};
class UISystem : public entityx::System<UISystem> {
private:
@@ -49,7 +53,7 @@ private:
static std::string dialogText;
static std::string importantText;
static std::vector<DialogOption> dialogOptions;
- static int dialogOptionResult;
+ static std::string dialogOptionResult;
public:
UISystem(void) {}
@@ -83,12 +87,12 @@ public:
static float putStringCentered(const vec2& p, const std::string& s, bool print = true);
static void dialogBox(const std::string& n, const std::string& s, ...);
- static void dialogAddOption(const std::string& o);
+ static void dialogAddOption(const std::string& o, const std::string& value);
static void dialogImportant(const std::string& s);
static void waitForDialog(void);
static void advanceDialog(void);
- static int getDialogResult(void);
+ static std::string getDialogResult(void);
};
namespace ui {