aboutsummaryrefslogtreecommitdiffstats
path: root/src/gameplay.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/gameplay.cpp')
-rw-r--r--src/gameplay.cpp30
1 files changed, 25 insertions, 5 deletions
diff --git a/src/gameplay.cpp b/src/gameplay.cpp
index c170511..4e67bb8 100644
--- a/src/gameplay.cpp
+++ b/src/gameplay.cpp
@@ -8,17 +8,37 @@ extern Player *player;
extern void mainLoop(void);
+void waitForDialog(void){
+ do{
+ mainLoop();
+ }while(ui::dialogBoxExists);
+}
+
int compTestQuest(NPC *speaker){
- ui::dialogBox(speaker->name,"Ooo, that's a nice quest you got there. Lemme finish that for you ;).");
+ ui::dialogBox(speaker->name,NULL,"Ooo, that's a nice quest you got there. Lemme finish that for you ;).");
player->qh.finish("Test",player);
return 0;
}
int giveTestQuest(NPC *speaker){
- unsigned int i;
- ui::dialogBox(speaker->name,"Here, have a quest!");
- player->qh.assign("Test");
- currentWorld->npc[1]->addAIFunc(compTestQuest,true);
+ unsigned char i;
+
+ char opt[]=":Yes:No";
+ ui::dialogBox(speaker->name,opt,"Here, have a quest!");
+
+ waitForDialog();
+
+ if(ui::dialogOptChosen == 1){
+
+ ui::dialogBox(speaker->name,NULL,"Have a good day! :)");
+
+ waitForDialog();
+
+ player->qh.assign("Test");
+ currentWorld->npc[1]->addAIFunc(compTestQuest,true);
+
+ }else return 1;
+
return 0;
}