Trim tabs to allow for separated out dialogs

Co-authored-by: sigonasr2 <sigonasr2@gmail.com>
master
sigonasr2 2 years ago
parent 1877bd793f
commit 1355943754
  1. BIN
      C++ProjectTemplate
  2. 17
      main.cpp
  3. 14
      object.h

Binary file not shown.

@ -166,13 +166,11 @@ int EQUIP_ITEM_MENU_CURSOR=0;
int EQUIP_ITEM_MENU_OFFSET=0;
std::vector<int> EQUIP_ITEM_MENU_CONTENTS={};
std::vector<std::pair<Item*,int>> SHOP_MENU_CONTENTS={};
std::array<int,16> MESSAGE_BOX_DIALOG_ANSWERS={-1};
int MESSAGE_BOX_DIALOG_ANSWER=-1;
int MESSAGE_BOX_DIALOG_CHOICES_MADE=0;
std::vector<std::string> MESSAGE_BOX_CHOICE_LIST={};
bool waitingForChoice=false;
int MESSAGE_BOX_DIALOG_CHOICE_CURSOR=0;
bool insideChoice=false;
bool selectionMade=false;
/*
[Choice1,Choice2,Choice3]
@ -192,10 +190,6 @@ void DisplayMessageBox(std::string targetT) {
messageBoxMarker=0;
messageBoxStartMarker=0;
messageBoxStopMarker=0;
for (int i=0;i<MESSAGE_BOX_DIALOG_ANSWERS.size();i++) {
MESSAGE_BOX_DIALOG_ANSWERS[i]=-1;
}
MESSAGE_BOX_DIALOG_CHOICES_MADE=0;
}
bool MOUSE_PRESSED_DOWN=false,MOUSE_DOWN=false,MOUSE_RELEASED=false; //TODO Implement Mouse things.
@ -701,10 +695,6 @@ This is a test message that lets us trigger straight from a cutscene! Cool!)"),
}
}
messageBoxLoad=false;
for (int i=0;i<16;i++) {
MESSAGE_BOX_DIALOG_ANSWERS[i]=-1;
}
MESSAGE_BOX_DIALOG_CHOICES_MADE=0;
} else {
if (MessageBoxAllowedToAdvance()) {
if (messageBoxFinalText[messageBoxMarker]=='[') {
@ -800,9 +790,12 @@ This is a test message that lets us trigger straight from a cutscene! Cool!)"),
}
}
if (ACTIONKEYPRESSED) {
MESSAGE_BOX_DIALOG_ANSWERS[MESSAGE_BOX_DIALOG_CHOICES_MADE++]=MESSAGE_BOX_DIALOG_CHOICE_CURSOR;
MESSAGE_BOX_DIALOG_ANSWER=MESSAGE_BOX_DIALOG_CHOICE_CURSOR;
waitingForChoice=false;
std::string responseText="";
while (messageBoxFinalText[messageBoxMarker]=='\t') {
messageBoxMarker++;
}
if (messageBoxFinalText[messageBoxMarker]=='>') {
messageBoxMarker++;
int counter=0;

@ -180,12 +180,22 @@ class TrashCan_Obj : public Object{
return {{"You dig around the trash can.","Nope! Just looks like plain ol' trash."}};}
};
extern int MESSAGE_BOX_DIALOG_ANSWER;
class Shopkeeper_Obj : public Object{
DynamicObject(Shopkeeper_Obj)
std::vector<std::pair<Item*,int>> itemList;
std::string welcomeMessage="Welcome! Please choose an option: [BUY,SELL]>0:Please take a look through our wares.>1:What would you like to sell?<";
std::string welcomeMessage="Welcome! Please choose an option: [BUY,SELL,FDSAJIVDSAJ]\
>0:Please take a look through our wares.\
>1:What would you like to sell?\
>2:Are you okay?<";
Interaction Interact()override{
return {{welcomeMessage}};
if (MESSAGE_BOX_DIALOG_ANSWER==2) {
MESSAGE_BOX_DIALOG_ANSWER=0;
return {{"No! Stay away!"}};
} else {
return {{welcomeMessage}};
}
}
};
#endif
Loading…
Cancel
Save