Show OK / Cancel dialog for restarting and quitting missions.
This commit is contained in:
parent
6d64cefce8
commit
6af1df919d
|
@ -26,10 +26,12 @@ static void handleKeyboard(void);
|
||||||
static void postBattle(void);
|
static void postBattle(void);
|
||||||
void destroyBattle(void);
|
void destroyBattle(void);
|
||||||
static void doBattle(void);
|
static void doBattle(void);
|
||||||
|
static void optQuitBattle(void);
|
||||||
static void quitBattle(void);
|
static void quitBattle(void);
|
||||||
static void drawMenu(void);
|
static void drawMenu(void);
|
||||||
static void continueGame(void);
|
static void continueGame(void);
|
||||||
static void resume(void);
|
static void resume(void);
|
||||||
|
static void restart(void);
|
||||||
static void retry(void);
|
static void retry(void);
|
||||||
static void start(void);
|
static void start(void);
|
||||||
static void options(void);
|
static void options(void);
|
||||||
|
@ -86,8 +88,8 @@ void initBattle(void)
|
||||||
|
|
||||||
getWidget("resume", "inBattle")->action = resume;
|
getWidget("resume", "inBattle")->action = resume;
|
||||||
getWidget("options", "inBattle")->action = options;
|
getWidget("options", "inBattle")->action = options;
|
||||||
getWidget("restart", "inBattle")->action = retry;
|
getWidget("restart", "inBattle")->action = restart;
|
||||||
getWidget("quit", "inBattle")->action = quitBattle;
|
getWidget("quit", "inBattle")->action = optQuitBattle;
|
||||||
|
|
||||||
getWidget("continue", "battleWon")->action = continueGame;
|
getWidget("continue", "battleWon")->action = continueGame;
|
||||||
getWidget("retry", "battleWon")->action = retry;
|
getWidget("retry", "battleWon")->action = retry;
|
||||||
|
@ -361,8 +363,20 @@ static void returnFromOptions(void)
|
||||||
selectWidget("resume", "inBattle");
|
selectWidget("resume", "inBattle");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void ignoreRestartQuit(void)
|
||||||
|
{
|
||||||
|
app.modalDialog.type = MD_NONE;
|
||||||
|
}
|
||||||
|
|
||||||
|
static void restart(void)
|
||||||
|
{
|
||||||
|
showOKCancelDialog(&retry, &ignoreRestartQuit, _("Are you sure you want to restart? You will lose your current progress."));
|
||||||
|
}
|
||||||
|
|
||||||
static void retry(void)
|
static void retry(void)
|
||||||
{
|
{
|
||||||
|
app.modalDialog.type = MD_NONE;
|
||||||
|
|
||||||
postBattle();
|
postBattle();
|
||||||
|
|
||||||
destroyBattle();
|
destroyBattle();
|
||||||
|
@ -372,8 +386,15 @@ static void retry(void)
|
||||||
loadMission(game.currentMission->filename);
|
loadMission(game.currentMission->filename);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void optQuitBattle(void)
|
||||||
|
{
|
||||||
|
showOKCancelDialog(&quitBattle, &ignoreRestartQuit, _("Are you sure you want to quit? You will lose your current progress."));
|
||||||
|
}
|
||||||
|
|
||||||
static void quitBattle(void)
|
static void quitBattle(void)
|
||||||
{
|
{
|
||||||
|
app.modalDialog.type = MD_NONE;
|
||||||
|
|
||||||
postBattle();
|
postBattle();
|
||||||
|
|
||||||
destroyBattle();
|
destroyBattle();
|
||||||
|
|
|
@ -88,6 +88,8 @@ extern void doSpawners(void);
|
||||||
extern void cancelScript(void);
|
extern void cancelScript(void);
|
||||||
extern void awardTrophy(char *id);
|
extern void awardTrophy(char *id);
|
||||||
extern void initCredits(void);
|
extern void initCredits(void);
|
||||||
|
extern void showOKCancelDialog(void (*okCallback)(void), void (*cancelCallback)(void), const char *format, ...);
|
||||||
|
extern char *getTranslatedString(char *string);
|
||||||
|
|
||||||
extern App app;
|
extern App app;
|
||||||
extern Battle battle;
|
extern Battle battle;
|
||||||
|
|
Loading…
Reference in New Issue