--- /dev/null
+#ifndef UI_QUEST_HPP_
+#define UI_QUEST_HPP_
+
+#include <ui.hpp>
+#include <common.hpp>
+
+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_
goto COMMONAIFUNC;
}
}
- } while((oxml = oxml->NextSiblingElement()));
+ } while((oxml = oxml->NextSiblingElement("quest")));
}
// handle give tags
}
// asdlfkj
+
auto txml = exml->FirstChildElement("content");
if (txml == nullptr)
goto OTHERSTUFF;
#include <ui.hpp>
+#include <ui_quest.hpp>
#include <brice.hpp>
#include <world.hpp>
#include <gametime.hpp>
// will return if not toggled
action::draw(vec2 {player->loc.x + player->width / 2, player->loc.y + player->height + game::HLINE});
+ // will return if not toggled
+ quest::draw();
+
if (pageTexReady) {
GLfloat page_loc[] = {offset.x - 300, SCREEN_HEIGHT - 100, -6.0,
currentWorld->addObject(item->name, "o shit waddup",
player->loc.x + player->width / 2, player->loc.y + player->height / 2);
}
+ } else if (SDL_KEY == SDLK_h) {
+ quest::toggle();
} else switch (SDL_KEY) {
case SDLK_F3:
debug ^= true;
--- /dev/null
+<?xml version="1.0"?>
+<World>
+ <style background="0" bgm="assets/music/embark.wav" folder="assets/style/classic/"/>
+ <generation type="Random" width="1600"/>
+ <time>6000</time>
+ <spawnx>-300</spawnx>
+ <npc name="Sanc" hasDialog="true"/>
+ <npc name="Bob" hasDialog="true" spawnx="30"/>
+ <structure type="1" spawnx="300" alive="1"/>
+ <structure inside="bobshouse.xml" type="1" spawnx="10" alive="1"/>
+ <chest alive="1"/>
+</World>
+
+<Dialog name="Bob">
+ <text id="0" nextid="1" pause="true">
+ <give id="Dank MayMay" count="10"/>
+ <content alive="1">
+ Hey there! The name's Bob. Good to see you've finally woken up from your nap by the cliff there... lol
+ </content>
+ </text>
+ <text id="1" pause="true" alive="1">
+ <quest assign="Check out m'swag, man!" desc="Go inside Bob's house and check out the stuff he has."/>
+ <content>
+ Looks like you've got yourself pretty empty handed... you know, I have a simple solution for that. Come on inside, I have somethin' to show you.
+ </content>
+ </text>
+</Dialog>
+
+<Dialog name="Sanc">
+ <text id="0">
+ <set id="Slow" value="0"/>
+ <set id="canSprint" value="1"/>
+ </text>
+</Dialog>
+++ /dev/null
-<?xml version="1.0"?>
-<World>
- <style background="0" bgm="assets/music/embark.wav" folder="assets/style/classic/"/>
- <generation type="Random" width="500"/>
- <link right="playerSpawnHill2.xml"/>
- <hill peakx="0" peaky="1000" width="50"/>
- <weather>Rainy</weather>
- <time>3400</time>
- <spawnx>-880</spawnx>
- <trigger spawnx="-850" id="first" notext="1"/>
- <npc name="Guy" hasDialog="true" spawnx="0" canMove="false"/>
-</World>
-
-<Trigger id="first">Guy</Trigger>
-
-<Dialog name="Guy">
- <text id="0" nextid="1">
- Hello there! My name is Ralph.
- <gotox>300</gotox>
- </text>
- <text id="1">
- ...
- <gotox>1000</gotox>
- <set id="Slow" value="0"/>
- <set id="canSprint" value="1"/>
- </text>
- <text id="1" nextid="1" pause="true">
- Broooooooooooooo...
- </text>
-</Dialog>
-
-<Dialog name="Big Dave">
- <text id="0" stop="true">
- Hey friend! It's dangerous out there, here take these!
- Wait, promise you'll stop by my stand in the local market!
- <give id="Wood Sword" count="1"/> <give id="Hunters Bow" count="1"/> <give id="Crude Arrow" count="110"/> <give id="Fried Chicken" count="1"/> <give id="Mossy Torch" count="1"/></text>
-</Dialog>
+++ /dev/null
-<?xml version="1.0"?>
-<IndoorWorld>
- <style background="1" bgm="assets/music/theme_jazz.wav"/>
- <link outside="playerSpawnHill1.xml"/>
- <floor width="300"/>
- <floor width="200" start="100"/>
- <npc name="Bob" hasDialog="true" floor="2"/>
-</IndoorWorld>
-
-<Dialog name="Bob">
- <text id="0" nextid="1" pause="true">
- Hey. Have a Dank MayMay :)
- <give id="Dank MayMay" count="1"/></text>
- <text id="1" nextid="2">
- What? You want another Dank MayMay?
- </text>
- <text id="2" nextid="3" pause="true">
- K.
- <give id="Dank MayMay" count="1"/></text>
- <text id="3" nextid="4">
- Well... I'm out of Dank MayMays.
- </text>
- <text id="4">
- Have a sword though.
- <give id="Wood Sword" count="1"/></text>
-</Dialog>
+++ /dev/null
-<?xml version="1.0"?>
-<World>
- <style background="0" bgm="assets/music/embark.wav" folder="assets/style/rustic/"/>
- <generation type="Random" width="1000"/>
- <structure type="5" inside="playerSpawnHill1_Building1.xml"/>
- <npc name="Swag"/>
- <link left="playerSpawnHill1.xml"/>
-</World>
+++ /dev/null
-<?xml version="1.0"?>
-<World>
- <style background="0" bgm="assets/music/embark.wav" folder="assets/style/classic/"/>
- <generation type="Random" width="1600"/>
- <time>6000</time>
- <spawnx>-300</spawnx>
- <npc name="Sanc" hasDialog="true" health="1" x="220.66983" y="63.798996" dindex="0"/>
- <npc name="Bob" hasDialog="true" spawnx="30" health="1" x="-118.29799" y="62.499027" dindex="9999"/>
- <structure type="1" spawnx="300" alive="1"/>
- <structure inside="bobshouse.xml" type="1" spawnx="10" alive="1"/>
- <chest alive="1"/>
-</World>
-
-<Dialog name="Bob">
- <text id="0" nextid="1" pause="true">
- <give id="Dank MayMay" count="10"/>
- <content alive="1">
- Hey there! The name's Bob. Good to see you've finally woken up from your nap by the cliff there... lol
- </content>
- </text>
- <text id="1" pause="true" alive="1">
- <quest assign="Check out m'swag, man!" health="1" x="-197.83293" y="71.963989" dindex="0">
- No description
- </quest>
- <content health="1" x="-206.1515" y="70.798996" dindex="0">
- Looks like you've got yourself pretty empty handed... you know, I have a simple solution for that. Come on inside, I have somethin' to show you.
- </content>
- </text>
-</Dialog>
-
-<Dialog name="Sanc">
- <text id="0">
- <set id="Slow" value="0"/>
- <set id="canSprint" value="1"/>
- </text>
-</Dialog>