Skip to content

Commit

Permalink
Adding HUD toggle third state
Browse files Browse the repository at this point in the history
  • Loading branch information
vitor251093 committed Jun 8, 2024
1 parent 088a945 commit 1b23fed
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 3 deletions.
20 changes: 17 additions & 3 deletions src/KHDays_Plugin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ extern int videoRenderer;

int KHDaysPlugin::GameScene = -1;
int KHDaysPlugin::priorGameScene = -1;
int KHDaysPlugin::HUDState = 0;
bool KHDaysPlugin::ShowMap = true;
bool KHDaysPlugin::ShowTarget = false;
bool KHDaysPlugin::ShowMissionGauge = false;
Expand Down Expand Up @@ -126,9 +127,22 @@ void KHDaysPlugin::hudRefresh(melonDS::NDS* nds)

void KHDaysPlugin::hudToggle(melonDS::NDS* nds)
{
ShowMap = !ShowMap;
ShowTarget = !ShowTarget;
ShowMissionGauge = !ShowMissionGauge;
HUDState = (HUDState + 1) % 3;
if (HUDState == 0) {
ShowMap = true;
ShowTarget = false;
ShowMissionGauge = false;
}
else if (HUDState == 1) {
ShowMap = false;
ShowTarget = true;
ShowMissionGauge = true;
}
else {
ShowMap = false;
ShowTarget = false;
ShowMissionGauge = false;
}
hudRefresh(nds);
}

Expand Down
1 change: 1 addition & 0 deletions src/KHDays_Plugin.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ class KHDaysPlugin
private:
static int GameScene;
static int priorGameScene;
static int HUDState;
static bool ShowMap;
static bool ShowTarget;
static bool ShowMissionGauge;
Expand Down

0 comments on commit 1b23fed

Please sign in to comment.