tbftss/src/challenges/challengeHome.c

564 lines
12 KiB
C
Raw Normal View History

2016-02-27 17:16:21 +01:00
/*
2019-01-01 17:14:11 +01:00
Copyright (C) 2015-2019 Parallel Realities
2016-02-27 17:16:21 +01:00
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
#include "challengeHome.h"
static void logic(void);
static void draw(void);
static void handleKeyboard(void);
static void drawChallenges(void);
static void doChallenges(void);
static void startChallengeMission(void);
2016-02-29 10:54:03 +01:00
static void drawMenu(void);
static void resume(void);
static void stats(void);
2016-05-15 09:19:26 +02:00
static void trophies(void);
2016-02-29 10:54:03 +01:00
static void options(void);
2016-05-15 09:19:26 +02:00
static void ok(void);
2016-02-29 10:54:03 +01:00
static void returnFromOptions(void);
2016-02-29 11:47:10 +01:00
static void unlockChallenges(void);
2016-02-29 10:54:03 +01:00
static void quit(void);
2016-03-02 07:58:03 +01:00
static void updateChallengeMissionData(void);
static char *listRestrictions(void);
2016-05-15 09:19:26 +02:00
static void prevPage(void);
static void nextPage(void);
static void fighterDatabase(void);
2016-02-27 17:16:21 +01:00
static SDL_Texture *background;
2018-12-06 09:37:19 +01:00
static AtlasImage *planetTexture;
static AtlasImage *challengeIcon;
static AtlasImage *challengeIconHighlight;
2016-02-27 17:16:21 +01:00
static Widget *start;
2016-02-29 13:09:36 +01:00
static PointF planet;
2016-02-29 10:54:03 +01:00
static int show;
2016-05-15 09:19:26 +02:00
static int page;
static float maxPages;
2016-03-02 07:58:03 +01:00
static char timeLimit[MAX_DESCRIPTION_LENGTH];
static char restrictions[MAX_DESCRIPTION_LENGTH];
2016-03-02 23:19:26 +01:00
static int hasRestrictions;
2016-05-15 09:19:26 +02:00
static Widget *prev;
static Widget *next;
2016-07-19 10:26:19 +02:00
static char *CHALLENGES_TEXT;
static char *COMPLETED_TEXT;
static char *PAGE_TEXT;
static char *LOCKED_TEXT;
static char *CRAFT_TEXT;
static char *TIME_TEXT;
static char *RESTRICTIONS_TEXT;
2016-02-27 17:16:21 +01:00
void initChallengeHome(void)
{
2016-05-15 09:19:26 +02:00
Mission *m;
2016-02-27 17:16:21 +01:00
startSectionTransition();
2016-03-09 13:31:33 +01:00
2016-02-27 17:16:21 +01:00
stopMusic();
2016-03-09 13:31:33 +01:00
2016-02-29 11:47:10 +01:00
updateAllMissions();
2016-03-09 13:31:33 +01:00
2016-02-29 11:47:10 +01:00
unlockChallenges();
2016-03-09 13:31:33 +01:00
awardChallengeTrophies();
2016-03-10 19:02:19 +01:00
awardStatsTrophies();
2016-03-09 13:31:33 +01:00
2016-05-15 09:19:26 +02:00
app.saveGame = 1;
2016-07-19 10:26:19 +02:00
CHALLENGES_TEXT = _("Challenges");
COMPLETED_TEXT = _("Completed : %d / %d");
PAGE_TEXT = _("Page : %d / %d");
LOCKED_TEXT = _("[Locked]");
CRAFT_TEXT = _("Craft: %s");
TIME_TEXT = _("Time Limit: %s");
RESTRICTIONS_TEXT = _("Restrictions: %s");
2016-03-09 13:31:33 +01:00
2016-02-27 17:16:21 +01:00
app.delegate.logic = &logic;
app.delegate.draw = &draw;
memset(&app.keyboard, 0, sizeof(int) * MAX_KEYBOARD_KEYS);
2016-03-09 13:31:33 +01:00
background = getTexture(getBackgroundTextureName(rand()));
2018-12-06 09:37:19 +01:00
planetTexture = getAtlasImage(getPlanetTextureName(rand()));
challengeIcon = getAtlasImage("gfx/challenges/challengeIcon.png");
challengeIconHighlight = getAtlasImage("gfx/challenges/challengeIconHighlight.png");
2016-03-09 13:31:33 +01:00
2016-02-27 17:16:21 +01:00
battle.camera.x = battle.camera.y = 0;
2016-03-09 13:31:33 +01:00
2018-12-14 09:00:16 +01:00
planet.x = rand() % app.winWidth;
planet.y = rand() % app.winHeight;
2016-05-15 09:19:26 +02:00
maxPages = page = 0;
for (m = game.challengeMissionHead.next ; m != NULL ; m = m->next)
{
maxPages++;
}
maxPages /= CHALLENGES_PER_PAGE;
maxPages = ceil(maxPages);
2016-03-09 13:31:33 +01:00
2016-02-29 10:54:03 +01:00
show = SHOW_CHALLENGES;
2016-03-09 13:31:33 +01:00
2016-02-27 17:16:21 +01:00
start = getWidget("start", "challenges");
start->action = startChallengeMission;
2016-03-09 13:31:33 +01:00
2016-02-29 10:54:03 +01:00
getWidget("resume", "challengesMenu")->action = resume;
getWidget("stats", "challengesMenu")->action = stats;
2016-05-15 09:19:26 +02:00
getWidget("trophies", "challengesMenu")->action = trophies;
getWidget("fighterDB", "challengesMenu")->action = fighterDatabase;
2016-02-29 10:54:03 +01:00
getWidget("options", "challengesMenu")->action = options;
getWidget("quit", "challengesMenu")->action = quit;
2016-03-09 13:31:33 +01:00
2016-05-15 09:19:26 +02:00
getWidget("ok", "stats")->action = ok;
getWidget("ok", "trophies")->action = ok;
getWidget("ok", "fighterDB")->action = ok;
2016-05-15 09:19:26 +02:00
prev = getWidget("prev", "challenges");
prev->action = prevPage;
prev->visible = 0;
next = getWidget("next", "challenges");
next->action = nextPage;
next->visible = 1;
2016-03-09 13:31:33 +01:00
/* select first challenge if none chosen */
if (!game.currentMission)
{
game.currentMission = game.challengeMissionHead.next;
updateChallengeMissionData();
}
2016-08-12 09:56:40 +02:00
SDL_SetWindowGrab(app.window, 0);
2018-05-06 19:50:11 +02:00
autoSizeWidgetButtons("challenges", 1);
2016-03-09 13:31:33 +01:00
2016-02-27 17:16:21 +01:00
endSectionTransition();
2016-03-09 13:31:33 +01:00
2016-05-29 12:48:11 +02:00
playMusic("music/main/covert_operations.mp3", 1);
2016-02-27 17:16:21 +01:00
}
2016-05-15 09:19:26 +02:00
static void nextPage(void)
{
page = MIN(page + 1, maxPages - 1);
next->visible = page < maxPages - 1;
prev->visible = 1;
}
static void prevPage(void)
{
page = MAX(0, page - 1);
next->visible = 1;
prev->visible = page > 0;
}
2016-02-29 11:47:10 +01:00
static void unlockChallenges(void)
2016-02-27 17:16:21 +01:00
{
Mission *m;
int i, prevCompleted;
2016-03-09 13:31:33 +01:00
i = game.completedChallenges = game.totalChallenges = 0;
2016-03-09 13:31:33 +01:00
prevCompleted = 1;
2016-02-27 17:16:21 +01:00
for (m = game.challengeMissionHead.next ; m != NULL ; m = m->next)
{
m->available = (prevCompleted > 0 || dev.debug);
2016-03-09 13:31:33 +01:00
game.completedChallenges += m->completedChallenges;
game.totalChallenges += m->totalChallenges;
prevCompleted = m->completedChallenges;
2016-03-09 13:31:33 +01:00
i++;
2016-02-27 17:16:21 +01:00
}
}
static void logic(void)
{
handleKeyboard();
2016-03-09 13:31:33 +01:00
2016-02-27 17:16:21 +01:00
scrollBackground(-0.25, 0);
2016-03-09 13:31:33 +01:00
2016-02-27 17:16:21 +01:00
doStars(0.5, 0);
2016-03-09 13:31:33 +01:00
2016-02-29 13:09:36 +01:00
planet.x -= 0.25;
if (planet.x <= -200)
{
2018-12-14 09:00:16 +01:00
planet.x = app.winWidth + 128 + (rand() % app.winWidth);
planet.y = (rand() % app.winHeight - 128);
2016-02-29 13:09:36 +01:00
}
2016-03-09 13:31:33 +01:00
2016-02-29 10:54:03 +01:00
switch (show)
{
case SHOW_CHALLENGES:
doChallenges();
break;
2016-03-09 13:31:33 +01:00
2016-02-29 10:54:03 +01:00
case SHOW_MENU:
break;
2016-03-09 13:31:33 +01:00
2016-02-29 10:54:03 +01:00
case SHOW_STATS:
break;
2016-03-09 13:31:33 +01:00
2016-02-29 10:54:03 +01:00
case SHOW_OPTIONS:
break;
}
2016-03-09 13:31:33 +01:00
2016-02-27 17:16:21 +01:00
doWidgets();
2016-05-15 09:19:26 +02:00
if (show == SHOW_FIGHTER_DB)
{
doFighterDatabase();
}
app.doTrophyAlerts = 1;
2016-02-27 17:16:21 +01:00
}
static void doChallenges(void)
{
Mission *c;
2016-05-15 09:19:26 +02:00
int i, startIndex, end;
i = 0;
startIndex = page * CHALLENGES_PER_PAGE;
end = startIndex + CHALLENGES_PER_PAGE;
2016-02-27 17:16:21 +01:00
for (c = game.challengeMissionHead.next ; c != NULL ; c = c->next)
{
2018-12-13 08:59:31 +01:00
if (i >= startIndex && i < end && app.mouse.button[SDL_BUTTON_LEFT] && collision(app.uiMouse.x, app.uiMouse.y, 3, 3, c->rect.x, c->rect.y, c->rect.w, c->rect.h))
2016-02-27 17:16:21 +01:00
{
if (c->available)
{
game.currentMission = c;
2016-03-09 13:31:33 +01:00
2016-03-02 07:58:03 +01:00
updateChallengeMissionData();
2016-03-09 13:31:33 +01:00
2016-03-05 16:35:09 +01:00
start->enabled = 1;
2016-03-09 13:31:33 +01:00
2016-03-05 16:35:09 +01:00
playSound(SND_GUI_CLICK);
2016-03-02 07:58:03 +01:00
}
2016-03-09 13:31:33 +01:00
2016-02-27 17:16:21 +01:00
app.mouse.button[SDL_BUTTON_LEFT] = 0;
}
2016-05-15 09:19:26 +02:00
i++;
2016-02-27 17:16:21 +01:00
}
}
2016-03-02 07:58:03 +01:00
static void updateChallengeMissionData(void)
{
STRNCPY(timeLimit, timeToString(game.currentMission->challengeData.timeLimit, 0), MAX_DESCRIPTION_LENGTH);
sprintf(restrictions, "%s", listRestrictions());
2016-03-02 23:19:26 +01:00
}
static void addRestriction(char *buffer, int restricted, char *description)
{
if (restricted)
{
if (strlen(buffer) > 0)
{
strcat(buffer, ". ");
}
2016-03-09 13:31:33 +01:00
2016-03-02 23:19:26 +01:00
strcat(buffer, description);
2016-03-09 13:31:33 +01:00
2016-03-02 23:19:26 +01:00
hasRestrictions = 1;
2016-03-02 07:58:03 +01:00
}
}
static char *listRestrictions(void)
{
2016-03-02 23:19:26 +01:00
static char textBuffer[MAX_DESCRIPTION_LENGTH];
2016-03-09 13:31:33 +01:00
2016-03-02 23:19:26 +01:00
memset(textBuffer, '\0', MAX_DESCRIPTION_LENGTH);
2016-03-09 13:31:33 +01:00
2016-03-02 23:19:26 +01:00
hasRestrictions = 0;
2016-03-09 13:31:33 +01:00
2016-03-02 23:19:26 +01:00
addRestriction(textBuffer, game.currentMission->challengeData.noMissiles, _("No Missiles"));
addRestriction(textBuffer, game.currentMission->challengeData.noECM, _("No ECM"));
addRestriction(textBuffer, game.currentMission->challengeData.noBoost, _("No Boost"));
addRestriction(textBuffer, game.currentMission->challengeData.noGuns, _("No Guns"));
2016-03-09 13:31:33 +01:00
2016-03-02 23:19:26 +01:00
return strlen(textBuffer) > 0 ? textBuffer : "-";
2016-03-02 07:58:03 +01:00
}
2016-02-27 17:16:21 +01:00
static void draw(void)
{
drawBackground(background);
2016-03-09 13:31:33 +01:00
blit(planetTexture, planet.x, planet.y, 1);
2016-03-09 13:31:33 +01:00
2016-02-27 17:16:21 +01:00
drawStars();
2016-05-15 09:19:26 +02:00
if (show == SHOW_MENU)
{
SDL_SetRenderDrawBlendMode(app.renderer, SDL_BLENDMODE_BLEND);
SDL_SetRenderDrawColor(app.renderer, 0, 0, 0, 128);
SDL_RenderFillRect(app.renderer, NULL);
SDL_SetRenderDrawBlendMode(app.renderer, SDL_BLENDMODE_NONE);
}
2018-12-13 08:59:31 +01:00
SDL_SetRenderTarget(app.renderer, app.uiBuffer);
2018-12-14 09:00:16 +01:00
drawText(UI_WIDTH / 2, 40, 28, TA_CENTER, colors.white, CHALLENGES_TEXT);
drawText(UI_WIDTH / 2, 83, 16, TA_CENTER, colors.lightGrey, COMPLETED_TEXT, game.completedChallenges, game.totalChallenges);
drawText(UI_WIDTH / 2, 110, 16, TA_CENTER, colors.lightGrey, PAGE_TEXT, page + 1, (int)maxPages);
2016-03-09 13:31:33 +01:00
2016-02-27 17:16:21 +01:00
drawChallenges();
2016-03-09 13:31:33 +01:00
2016-02-29 10:54:03 +01:00
switch (show)
{
case SHOW_CHALLENGES:
drawWidgets("challenges");
break;
2016-03-09 13:31:33 +01:00
2016-02-29 10:54:03 +01:00
case SHOW_MENU:
drawMenu();
break;
2016-03-09 13:31:33 +01:00
2016-02-29 10:54:03 +01:00
case SHOW_STATS:
drawStats();
break;
2016-05-15 09:19:26 +02:00
case SHOW_TROPHIES:
drawTrophies();
break;
2016-03-09 13:31:33 +01:00
2016-02-29 10:54:03 +01:00
case SHOW_OPTIONS:
drawOptions();
break;
case SHOW_FIGHTER_DB:
drawFighterDatabase();
break;
2016-02-29 10:54:03 +01:00
}
2018-12-13 08:59:31 +01:00
SDL_SetRenderTarget(app.renderer, app.backBuffer);
2016-02-27 17:16:21 +01:00
}
static void drawChallenges(void)
{
Mission *m;
Challenge *c;
2016-02-27 17:16:21 +01:00
SDL_Rect r;
2016-05-15 09:19:26 +02:00
int i, start, end;
2016-03-09 13:31:33 +01:00
2016-02-27 17:16:21 +01:00
r.x = 135;
2016-03-02 07:58:03 +01:00
r.y = 165;
2016-02-27 17:16:21 +01:00
r.w = r.h = 96;
2016-03-09 13:31:33 +01:00
2016-05-15 09:19:26 +02:00
start = page * CHALLENGES_PER_PAGE;
end = start + CHALLENGES_PER_PAGE;
2016-02-27 17:16:21 +01:00
i = 0;
2016-03-09 13:31:33 +01:00
for (m = game.challengeMissionHead.next ; m != NULL ; m = m->next)
2016-02-27 17:16:21 +01:00
{
m->rect = r;
2016-03-09 13:31:33 +01:00
2016-05-15 09:19:26 +02:00
if (i >= start && i < end)
2016-02-27 17:16:21 +01:00
{
if (game.currentMission == m)
2016-02-27 17:16:21 +01:00
{
2016-04-10 13:00:29 +02:00
blit(challengeIconHighlight, r.x, r.y, 0);
2016-02-27 17:16:21 +01:00
}
else
{
2016-04-10 13:00:29 +02:00
blit(challengeIcon, r.x, r.y, 0);
2016-02-27 17:16:21 +01:00
}
2016-03-09 13:31:33 +01:00
2016-02-27 17:16:21 +01:00
drawText(r.x + (r.w / 2), r.y + 28, 30, TA_CENTER, colors.white, "%d", i + 1);
2016-03-09 13:31:33 +01:00
if (m->available)
{
drawText(r.x + (r.w / 2), r.y + r.w + 5, 18, TA_CENTER, (m->completedChallenges < m->totalChallenges) ? colors.white : colors.green, "%d / %d", m->completedChallenges, m->totalChallenges);
}
else
{
2016-07-19 10:26:19 +02:00
drawText(r.x + (r.w / 2), r.y + r.w + 5, 18, TA_CENTER, colors.lightGrey, LOCKED_TEXT);
}
2016-03-09 13:31:33 +01:00
2016-02-27 17:16:21 +01:00
r.x += 150;
2016-03-09 13:31:33 +01:00
2018-12-14 09:00:16 +01:00
if (r.x > UI_WIDTH - 200)
2016-02-27 17:16:21 +01:00
{
r.y += 165;
r.x = 135;
}
}
2016-03-09 13:31:33 +01:00
2016-02-27 17:16:21 +01:00
i++;
}
2016-03-09 13:31:33 +01:00
2018-12-14 09:00:16 +01:00
r.y = UI_HEIGHT - 245;
2016-03-02 07:58:03 +01:00
r.x = 100;
2018-12-14 09:00:16 +01:00
r.w = UI_WIDTH - 200;
2016-03-02 07:58:03 +01:00
r.h = 150;
2016-03-09 13:31:33 +01:00
2016-03-02 07:58:03 +01:00
SDL_SetRenderDrawBlendMode(app.renderer, SDL_BLENDMODE_BLEND);
SDL_SetRenderDrawColor(app.renderer, 0, 0, 0, 128);
SDL_RenderFillRect(app.renderer, &r);
SDL_SetRenderDrawBlendMode(app.renderer, SDL_BLENDMODE_NONE);
2018-12-11 09:24:25 +01:00
SDL_SetRenderDrawColor(app.renderer, 64, 64, 64, 255);
2016-03-02 07:58:03 +01:00
SDL_RenderDrawRect(app.renderer, &r);
2016-03-09 13:31:33 +01:00
2016-03-02 07:58:03 +01:00
r.y = 240;
2016-03-09 13:31:33 +01:00
2016-02-28 14:02:57 +01:00
if (game.currentMission)
{
2018-12-14 09:00:16 +01:00
drawText(UI_WIDTH / 2, SCREEN_HEIGHT - r.y, 24, TA_CENTER, colors.white, game.currentMission->description);
2016-03-09 13:31:33 +01:00
2016-03-02 07:58:03 +01:00
r.y -= 50;
c = game.currentMission->challengeData.challenges[0];
2018-12-14 09:00:16 +01:00
drawText((UI_WIDTH / 2) - 25, SCREEN_HEIGHT - r.y, 18, TA_RIGHT, colors.white, CRAFT_TEXT, game.currentMission->craft);
drawText((UI_WIDTH / 2) + 25, SCREEN_HEIGHT - r.y, 18, TA_LEFT, (c->passed) ? colors.green : colors.white, "1. %s", getChallengeDescription(c));
2016-03-09 13:31:33 +01:00
2016-03-02 07:58:03 +01:00
r.y -= 30;
2018-12-14 09:00:16 +01:00
drawText((UI_WIDTH / 2) - 25, SCREEN_HEIGHT - r.y, 18, TA_RIGHT, colors.white, TIME_TEXT, timeLimit);
2016-03-09 13:31:33 +01:00
c = game.currentMission->challengeData.challenges[1];
if (c)
2016-03-02 23:19:26 +01:00
{
2018-12-14 09:00:16 +01:00
drawText((UI_WIDTH / 2) + 25, SCREEN_HEIGHT - r.y, 18, TA_LEFT, (c->passed) ? colors.green : colors.white, "2. %s", getChallengeDescription(c));
2016-03-02 23:19:26 +01:00
}
2016-03-09 13:31:33 +01:00
2016-03-02 07:58:03 +01:00
r.y -= 30;
2018-12-14 09:00:16 +01:00
drawText((UI_WIDTH / 2) - 25, SCREEN_HEIGHT - r.y, 18, TA_RIGHT, hasRestrictions ? colors.red : colors.white, RESTRICTIONS_TEXT, restrictions);
2016-03-09 13:31:33 +01:00
c = game.currentMission->challengeData.challenges[2];
if (c)
2016-03-02 23:19:26 +01:00
{
2018-12-14 09:00:16 +01:00
drawText((UI_WIDTH / 2) + 25, SCREEN_HEIGHT - r.y, 18, TA_LEFT, (c->passed) ? colors.green : colors.white, "3. %s", getChallengeDescription(c));
2016-03-02 23:19:26 +01:00
}
2016-02-28 14:02:57 +01:00
}
2016-02-27 17:16:21 +01:00
}
2016-02-29 10:54:03 +01:00
static void drawMenu(void)
{
SDL_Rect r;
2016-03-09 13:31:33 +01:00
2016-02-29 10:54:03 +01:00
r.w = 400;
2016-05-15 09:19:26 +02:00
r.h = 500;
2018-12-14 09:00:16 +01:00
r.x = (UI_WIDTH / 2) - r.w / 2;
r.y = (UI_HEIGHT / 2) - r.h / 2;
2016-03-09 13:31:33 +01:00
2018-12-11 09:24:25 +01:00
SDL_SetRenderDrawColor(app.renderer, 0, 0, 0, 255);
2016-02-29 10:54:03 +01:00
SDL_RenderFillRect(app.renderer, &r);
SDL_SetRenderDrawColor(app.renderer, 200, 200, 200, 255);
SDL_RenderDrawRect(app.renderer, &r);
2016-03-09 13:31:33 +01:00
2016-02-29 10:54:03 +01:00
drawWidgets("challengesMenu");
}
static void resume(void)
{
show = SHOW_CHALLENGES;
}
static void options(void)
{
show = SHOW_OPTIONS;
2016-03-09 13:31:33 +01:00
2016-02-29 10:54:03 +01:00
initOptions(returnFromOptions);
}
static void stats(void)
{
selectWidget("ok", "stats");
2016-03-09 13:31:33 +01:00
2016-02-29 10:54:03 +01:00
show = SHOW_STATS;
2016-03-09 13:31:33 +01:00
2016-02-29 10:54:03 +01:00
initStatsDisplay();
}
static void fighterDatabase(void)
{
show = SHOW_FIGHTER_DB;
initFighterDatabaseDisplay();
}
2016-05-15 09:19:26 +02:00
static void trophies(void)
{
selectWidget("ok", "trophies");
show = SHOW_TROPHIES;
initTrophiesDisplay();
}
static void ok(void)
2016-02-29 10:54:03 +01:00
{
selectWidget("resume", "challengesMenu");
2016-03-09 13:31:33 +01:00
2016-02-29 10:54:03 +01:00
show = SHOW_MENU;
}
static void returnFromOptions(void)
{
show = SHOW_MENU;
2016-03-09 13:31:33 +01:00
2016-02-29 10:54:03 +01:00
selectWidget("resume", "challengesMenu");
}
static void quit(void)
{
initTitle();
}
2016-02-27 17:16:21 +01:00
static void handleKeyboard(void)
{
if (app.keyboard[SDL_SCANCODE_ESCAPE] && !app.awaitingWidgetInput)
2016-02-27 19:12:18 +01:00
{
2016-02-29 10:54:03 +01:00
switch (show)
{
case SHOW_CHALLENGES:
selectWidget("resume", "challengesMenu");
show = SHOW_MENU;
playSound(SND_GUI_CLOSE);
break;
2016-03-09 13:31:33 +01:00
2016-02-29 10:54:03 +01:00
case SHOW_MENU:
show = SHOW_CHALLENGES;
break;
2016-03-09 13:31:33 +01:00
2016-02-29 10:54:03 +01:00
case SHOW_OPTIONS:
case SHOW_STATS:
2016-05-15 09:19:26 +02:00
case SHOW_TROPHIES:
case SHOW_FIGHTER_DB:
2016-02-29 10:54:03 +01:00
show = SHOW_MENU;
selectWidget("resume", "challengesMenu");
break;
}
2016-03-09 13:31:33 +01:00
2016-02-29 10:54:03 +01:00
playSound(SND_GUI_CLOSE);
2016-03-09 13:31:33 +01:00
2016-03-05 16:35:09 +01:00
clearInput();
2016-02-27 19:12:18 +01:00
}
2016-02-27 17:16:21 +01:00
}
static void startChallengeMission(void)
{
initBattle();
2016-03-09 13:31:33 +01:00
2016-02-27 17:16:21 +01:00
loadMission(game.currentMission->filename);
}