From a2a0cdd6ce772fef9e7c2043e168af7248bd2016 Mon Sep 17 00:00:00 2001 From: RocketRobz Date: Sun, 12 Jul 2020 21:42:08 -0600 Subject: [PATCH] Press X to remove a character --- include/gfx.hpp | 2 +- source/gfx.cpp | 7 ++++++- source/screens/photoStudio.cpp | 32 +++++++++++++++++++++++++++----- 3 files changed, 34 insertions(+), 7 deletions(-) diff --git a/include/gfx.hpp b/include/gfx.hpp index 94dab41..cb533d0 100644 --- a/include/gfx.hpp +++ b/include/gfx.hpp @@ -28,7 +28,7 @@ extern bool shiftBySubPixel; namespace GFX { // Load & Unload default sheets. - void resetCharStatus(void); + void resetCharStatus(int num = -1); Result loadSheets(); Result unloadSheets(); void loadGameSelSheets(); diff --git a/source/gfx.cpp b/source/gfx.cpp index 740671a..ac65ae3 100644 --- a/source/gfx.cpp +++ b/source/gfx.cpp @@ -34,7 +34,12 @@ static int timeOutside = 0; // 0 == Day, 1 == Sunset, 2 == Night bool shiftBySubPixel = false; -void GFX::resetCharStatus(void) { +void GFX::resetCharStatus(int num) { + if (num > -1) { + chracterSpriteFound[num] = false; + return; + } + chracterSpriteFound[0] = false; chracterSpriteFound[1] = false; chracterSpriteFound[2] = false; diff --git a/source/screens/photoStudio.cpp b/source/screens/photoStudio.cpp index d323680..e375e3e 100644 --- a/source/screens/photoStudio.cpp +++ b/source/screens/photoStudio.cpp @@ -178,7 +178,8 @@ void PhotoStudio::drawMsg(void) const { GFX::DrawSprite(sprites_msg_idx, 160, 8, -1, 1); GFX::DrawSprite(messageNo == 4 ? sprites_icon_question_idx : sprites_icon_msg_idx, 132, -2); - Gui::DrawStringCentered(0, 84, 0.60, BLACK, "This feature is not available yet."); + Gui::DrawStringCentered(0, 84, 0.60, BLACK, "Please remove latest"); + Gui::DrawStringCentered(0, 104, 0.60, BLACK, "character(s) first."); GFX::DrawSprite(sprites_button_msg_shadow_idx, 114, 197); GFX::DrawSprite(sprites_button_msg_idx, 115, 188); @@ -310,6 +311,10 @@ void PhotoStudio::Draw(void) const { Gui::DrawString(8, 8, 0.50, WHITE, "<"); Gui::DrawString(304, 8, 0.50, WHITE, ">"); + if (currentCharNum > 0) { + Gui::DrawString(96, 184, 0.55, WHITE, ": Remove character"); + } + //if (char_highlightedGame[currentCharNum] != 4) { // Selected season Gui::DrawString(120-36, 208, 0.65, WHITE, "L"); @@ -411,13 +416,13 @@ void PhotoStudio::Draw(void) const { i2 += 48; GFX::DrawSprite(sprites_item_button_idx, 16, i2-20); if (currentCharNum==4) { - Gui::DrawString(32, i2, 0.65, WHITE, "Change character < 5 >"); + Gui::DrawString(32, i2, 0.65, WHITE, characterPicked[4] ? "Change character < 5 >" : "Add character < 5 >"); } else if (currentCharNum==3) { - Gui::DrawString(32, i2, 0.65, WHITE, "Change character < 4 >"); + Gui::DrawString(32, i2, 0.65, WHITE, characterPicked[3] ? "Change character < 4 >" : "Add character < 4 >"); } else if (currentCharNum==2) { - Gui::DrawString(32, i2, 0.65, WHITE, "Change character < 3 >"); + Gui::DrawString(32, i2, 0.65, WHITE, characterPicked[2] ? "Change character < 3 >" : "Add character < 3 >"); } else if (currentCharNum==1) { - Gui::DrawString(32, i2, 0.65, WHITE, "Change character < 2 >"); + Gui::DrawString(32, i2, 0.65, WHITE, characterPicked[1] ? "Change character < 2 >" : "Add character < 2 >"); } else { Gui::DrawString(32, i2, 0.65, WHITE, "Change character < 1 >"); } @@ -534,6 +539,23 @@ void PhotoStudio::Logic(u32 hDown, u32 hHeld, touchPosition touch) { subScreenMode = 0; } + if ((hDown & KEY_X) && (currentCharNum > 0) && characterPicked[currentCharNum]) { + if ((currentCharNum == 4) || !characterPicked[currentCharNum+1]) { + sndSelect(); + characterPicked[currentCharNum] = false; + previewCharacterFound[currentCharNum] = false; + GFX::resetCharStatus(currentCharNum); + currentCharNum--; + charsShown--; + subScreenMode = 0; + renderTop = true; + loadChrImage(); + } else { + sndBack(); + showMessage = true; + } + } + if (hDown & KEY_SELECT) { sndSelect(); subScreenMode = 0;