diff options
author | Clyne Sullivan <tullivan99@gmail.com> | 2015-12-01 08:38:21 -0500 |
---|---|---|
committer | Clyne Sullivan <tullivan99@gmail.com> | 2015-12-01 08:38:21 -0500 |
commit | d8554c12fdea5640df0ba42925f296f1711ba389 (patch) | |
tree | 8204651ac0e7dc6189ffabb9df39763b19c61886 /src/ui.cpp | |
parent | 45bca98b792f8ced1a57ef8c5beed2a90a79d47f (diff) |
andy cant code
Diffstat (limited to 'src/ui.cpp')
-rw-r--r-- | src/ui.cpp | 16 |
1 files changed, 12 insertions, 4 deletions
@@ -49,6 +49,8 @@ static char *dialogOptText[4]; static float dialogOptLoc[4][3]; static unsigned char dialogOptCount = 0; +extern void mainLoop(void); + /* * Toggled by pressing 'q', disables some controls when true. */ @@ -366,11 +368,10 @@ namespace ui { return width; } - - void dialogBox(const char *name,char *opt,const char *text,...){ + void dialogBox(const char *name,const char *opt,const char *text,...){ va_list dialogArgs; unsigned int len; - char *sopt; + char *sopt,*soptbuf; /* * Set up the text buffer. @@ -404,7 +405,9 @@ namespace ui { dialogOptChosen=0; dialogOptCount=0; - sopt=strtok(opt,":"); + soptbuf = new char[strlen(opt)+1]; + + sopt=strtok(soptbuf,":"); while(sopt != NULL){ dialogOptText[dialogOptCount] = new char[strlen(sopt)+1]; //(char *)malloc(strlen(sopt)); strcpy(dialogOptText[dialogOptCount++],sopt); @@ -418,6 +421,11 @@ namespace ui { dialogBoxExists = true; } + void waitForDialog(void){ + do{ + mainLoop(); + }while(ui::dialogBoxExists); + } void importantText(const char *text,...){ va_list textArgs; char *ttext,*rtext; |