From 2600f3cd1a35f1845e84cb4955968576ec2fc05d Mon Sep 17 00:00:00 2001 From: Steve Date: Tue, 20 Feb 2018 12:31:41 +0000 Subject: [PATCH] Restrict displaying of trophies during mission. --- src/game/trophies.c | 38 ++++++++++++++++++++++---------------- src/hub/hub.c | 2 ++ src/hub/postMission.c | 2 ++ src/structs.h | 1 + src/world/world.c | 2 ++ 5 files changed, 29 insertions(+), 16 deletions(-) diff --git a/src/game/trophies.c b/src/game/trophies.c index 27864ce..2e84057 100644 --- a/src/game/trophies.c +++ b/src/game/trophies.c @@ -249,28 +249,34 @@ void awardTrophies(void) void doTrophyAlerts(void) { - if (!alertTrophy) + if (app.config.trophyAlert == 1 || (app.config.trophyAlert == 2 && !app.restrictTrophyAlert)) { - nextAlert(); - } - else if (alertTrophy) - { - alertRect.x = MIN(alertRect.x + 24, -1); - - if (alertRect.x > -150) + if (!alertTrophy) { - alertTimer--; + nextAlert(); } - - if (alertTimer <= 0) + else if (alertTrophy) { - saveScreenshot(alertTrophy->id); - alertTrophy->notify = 0; - resetAlert(); + alertRect.x = MIN(alertRect.x + 24, -1); + + if (alertRect.x > -150) + { + alertTimer--; + } + + if (alertTimer <= 0) + { + if (app.config.trophyScreenshot) + { + saveScreenshot(alertTrophy->id); + } + alertTrophy->notify = 0; + resetAlert(); + } } + + sparkleAngle = mod(sparkleAngle + 0.25, 360); } - - sparkleAngle = mod(sparkleAngle + 0.25, 360); } static void nextAlert(void) diff --git a/src/hub/hub.c b/src/hub/hub.c index e1fa79a..c8fe3b9 100644 --- a/src/hub/hub.c +++ b/src/hub/hub.c @@ -200,6 +200,8 @@ void initHub(void) app.delegate.logic = &logic; app.delegate.draw = &draw; + app.restrictTrophyAlert = 0; + playMusic(1); endSectionTransition(); diff --git a/src/hub/postMission.c b/src/hub/postMission.c index 30eac94..d2ebc0c 100644 --- a/src/hub/postMission.c +++ b/src/hub/postMission.c @@ -34,6 +34,8 @@ void initPostMission(void) app.delegate.logic = logic; app.delegate.draw = draw; + app.restrictTrophyAlert = 0; + endSectionTransition(); } diff --git a/src/structs.h b/src/structs.h index 11b9f29..f72a30d 100644 --- a/src/structs.h +++ b/src/structs.h @@ -354,6 +354,7 @@ typedef struct { int awaitingWidgetInput; int lastKeyPressed; int lastButtonPressed; + int restrictTrophyAlert; Config config; } App; diff --git a/src/world/world.c b/src/world/world.c index 8ac990c..0555dbc 100644 --- a/src/world/world.c +++ b/src/world/world.c @@ -120,6 +120,8 @@ void initWorld(void) app.delegate.logic = logic; app.delegate.draw = draw; + app.restrictTrophyAlert = 1; + endSectionTransition(); }