From d7a96dbfbd5fe0217af612574038ae3fe41c8ae6 Mon Sep 17 00:00:00 2001 From: Steve Date: Mon, 25 Apr 2016 17:21:42 +0100 Subject: [PATCH] Show trophy alert at end of mission (not during, as the banner can obstruct the play area). --- src/battle/battle.c | 24 +++++++++++++++++------- src/battle/battle.h | 2 ++ 2 files changed, 19 insertions(+), 7 deletions(-) diff --git a/src/battle/battle.c b/src/battle/battle.c index 6e67df6..217158b 100644 --- a/src/battle/battle.c +++ b/src/battle/battle.c @@ -110,6 +110,11 @@ static void logic(void) doPlayerSelect(); } } + + if (battle.status != MS_IN_PROGRESS && battle.missionFinishedTimer <= -FPS * 2) + { + doTrophyAlerts(); + } } doWidgets(); @@ -177,15 +182,15 @@ static void doBattle(void) if (battle.status != MS_IN_PROGRESS) { battle.missionFinishedTimer--; - } + + if (battle.unwinnable && battle.missionFinishedTimer <= -FPS * 6) + { + postBattle(); - if (battle.unwinnable && battle.missionFinishedTimer <= -FPS * 6) - { - postBattle(); + destroyBattle(); - destroyBattle(); - - initGalacticMap(); + initGalacticMap(); + } } } @@ -235,6 +240,11 @@ static void draw(void) drawOptions(); break; } + + if (battle.status != MS_IN_PROGRESS && battle.status != MS_PAUSED && battle.missionFinishedTimer <= -FPS * 2) + { + drawTrophyAlert(); + } } static void drawMenu(void) diff --git a/src/battle/battle.h b/src/battle/battle.h index 96bfbb6..2c153a6 100644 --- a/src/battle/battle.h +++ b/src/battle/battle.h @@ -86,6 +86,8 @@ extern void clearInput(void); extern void runScriptFunction(const char *format, ...); extern void doSpawners(void); extern void awardPostMissionTrophies(void); +extern void doTrophyAlerts(void); +extern void drawTrophyAlert(void); extern App app; extern Battle battle;