From 6f13e748c526576198d197ad194f4c1d8fdadec0 Mon Sep 17 00:00:00 2001 From: Clyne Sullivan Date: Sat, 2 Jul 2016 09:58:12 -0400 Subject: new xml, wip quest menu --- include/ui_quest.hpp | 38 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100644 include/ui_quest.hpp (limited to 'include') diff --git a/include/ui_quest.hpp b/include/ui_quest.hpp new file mode 100644 index 0000000..a0f3ad4 --- /dev/null +++ b/include/ui_quest.hpp @@ -0,0 +1,38 @@ +#ifndef UI_QUEST_HPP_ +#define UI_QUEST_HPP_ + +#include +#include + +namespace ui { + namespace quest { + bool _toggle = false; + + void toggle(void) { + _toggle ^= true; + } + + void draw(void) { + if (!_toggle) + return; + + float top_y = offset.y + 200; + ui::drawNiceBox(vec2 {offset.x - 200, top_y }, + vec2 {offset.x + 200, offset.y - 200 }, + -0.7f); + + ui::putStringCentered(offset.x, top_y - 40, "Current Quests:"); + + auto y = top_y - 100; + const auto x = offset.x - 180; + for (const auto &q : player->qh.current) { + ui::putText(x, y, q.title.c_str()); + y -= 20; + ui::putText(x + 40, y, q.desc.c_str()); + y -= 40; + } + } + } +} + +#endif // UI_QUEST_HPP_ -- cgit v1.2.3