Add Photo Studio mode

This commit is contained in:
RocketRobz 2020-06-25 15:56:29 -06:00
parent 1039b9ad71
commit 731e8bde91
14 changed files with 1008 additions and 175 deletions

View File

@ -1,21 +1,8 @@
const char* import_ss1CharacterNames[] {
"Grace",
"Renee",
"Dominic",
"Eunice",
"Felicity",
"Libby",
"Didi",
"Olivia",
};
#ifndef _SAVVY_MANAGER_IMPORT_SS1_CHAR_NAMES_HPP
#define _SAVVY_MANAGER_IMPORT_SS1_CHAR_NAMES_HPP
bool import_ss1CharacterGenders[] {
false, // Female
false, // Female
true, // Male
false, // Female
false, // Female
false, // Female
false, // Female
false, // Female
};
extern const char* import_ss1CharacterNames[8];
extern bool import_ss1CharacterGenders[8];
#endif

View File

@ -1,85 +1,12 @@
const char* import_ss2CharacterNames[] {
"Michaela",
"Evie", // (EUR/JAP)
"Emmylou",
"Avery", // aka Lola (EUR)
"Shoko", // (JAP)
"India", // aka Elena (EUR)
"Daphne", // aka Shivani (EUR)
"Genevieve", // aka Faye (EUR)
"Celeste", // aka Clarissa (EUR)
"Ingrid",
"Deborah", // aka Elsepth (EUR)
"Daisy", // aka Flora (EUR)
"Teagan", // aka Tess (EUR)
"Nicky",
"Brienne",
"Clara",
"Yukiko",
"Dorothy",
"Dulcie",
};
#ifndef _SAVVY_MANAGER_IMPORT_SS2_CHAR_NAMES_HPP
#define _SAVVY_MANAGER_IMPORT_SS2_CHAR_NAMES_HPP
const char* import_nsbCharacterNames[] {
"Michaela", // (USA)
"Evie",
"Harriet",
"Avery", // Lola (EUR)
"Shoko", // (JAP)
"India", // Elena (EUR)
"Daphne", // Shivani (EUR)
"Genevieve", // Faye (EUR)
"Celeste", // Clarissa (EUR)
"Ingrid",
"Deborah", // Elsepth (EUR)
"Daisy", // Flora (EUR)
"Tess",
"Nicky",
"Zahra",
"Clara",
"Yukiko",
"Dorothy",
"Dulcie",
};
extern const char* import_ss2CharacterNames[19];
bool import_ss2CharacterGenders[] {
false, // Female
false, // Female
false, // Female
false, // Female
false, // Female
false, // Female
false, // Female
false, // Female
false, // Female
false, // Female
false, // Female
false, // Female
false, // Female
false, // Female
false, // Female
false, // Female
false, // Female
false, // Female
};
extern const char* import_nsbCharacterNames[19];
/*bool import_ss2CharacterTieColors[] {
false, // Pink
true, // Light Green
false, // Pink
false, // Pink
true, // Light Green
false, // Pink
false, // Pink
false, // Pink
false, // Pink
false, // Pink
false, // Pink
false, // Pink
false, // Pink
false, // Pink
false, // Pink
false, // Pink
false, // Pink
false, // Pink
};*/
extern bool import_ss2CharacterGenders[19];
/*extern bool import_ss2CharacterTieColors[19];*/
#endif

View File

@ -0,0 +1,11 @@
const char* import_ss3BgNames[] {
"Blue",
"Lover's Bell",
"Bougainville",
};
int import_ss3BgNums[] {
0,
1,
2,
};

View File

@ -1,41 +1,8 @@
const char* import_ss3CharacterNames[] {
"Sophie",
"Callie",
"Laurie",
"Noor",
"Yuzu", // Noor (JAP)
"Arabella",
"Sasha",
"Zoey",
"Kirsty",
"Rainbow",
"Magda",
"Adelaide",
"Molly",
"Ruby",
"Sapphire",
"Amber",
"Mickey",
"Ricky", // File does not exist, so he's not shown
};
#ifndef _SAVVY_MANAGER_IMPORT_SS3_CHAR_NAMES_HPP
#define _SAVVY_MANAGER_IMPORT_SS3_CHAR_NAMES_HPP
bool import_ss3CharacterGenders[] {
false, // Female
false, // Female
false, // Female
false, // Female
false, // Female
false, // Female
false, // Female
false, // Female
false, // Female
false, // Female
false, // Female
false, // Female
false, // Female
false, // Female
false, // Female
false, // Female
true, // Male
true, // Male
};
extern const char* import_ss3CharacterNames[18];
extern bool import_ss3CharacterGenders[18];
#endif

View File

@ -0,0 +1,25 @@
const char* import_ss4BgNames[] {
"Blue",
"NIN10 Pro.",
"Beautician",
"Hair Salon",
"Celestial Hotel",
"Live Music Club",
"Menswear Shop",
"VIP Room",
"Restauraunt",
"Cinema",
};
int import_ss4BgNums[] {
0,
3,
4,
5,
6,
7,
8,
9,
10,
11
};

View File

@ -1,33 +1,8 @@
const char* import_ss4CharacterNames[] {
"Rosie",
"Yolanda",
"Alina",
"Cece",
"Lorelei",
"Camilla",
"Janice",
"Margot",
"Niamh",
"Pippa",
"Angelique",
"Abigail",
"Jo",
"Madeira",
};
#ifndef _SAVVY_MANAGER_IMPORT_SS4_CHAR_NAMES_HPP
#define _SAVVY_MANAGER_IMPORT_SS4_CHAR_NAMES_HPP
bool import_ss4CharacterGenders[] {
false, // Female
false, // Female
false, // Female
false, // Female
false, // Female
false, // Female
false, // Female
false, // Female
false, // Female
false, // Female
false, // Female
false, // Female
false, // Female
false, // Female
};
extern const char* import_ss4CharacterNames[14];
extern bool import_ss4CharacterGenders[14];
#endif

View File

@ -0,0 +1,77 @@
#ifndef _SAVVY_MANAGER_PHOTO_STUDIO_HPP
#define _SAVVY_MANAGER_PHOTO_STUDIO_HPP
#include "common.hpp"
#include <memory>
#include <vector>
class PhotoStudio : public Screen {
public:
void Draw(void) const override;
void Logic(u32 hDown, u32 hHeld, touchPosition touch) override;
PhotoStudio();
private:
void preview() const;
void getList();
void getMaxChars();
const char* seasonName(void) const;
const char* import_characterName(void) const;
const char* import_SS2CharacterNames(int i) const;
const char* import_characterNameDisplay(void) const;
const char* ss1Title(void) const;
const char* ss2Title(void) const;
const char* ss3Title(void) const;
const char* ss4Title(void) const;
void drawMsg(void) const;
void loadChrImage(bool Robz);
void addEveryone(void);
int subScreenMode = 0;
/*
0: What to change
1: Studio BG list
2: Character list
*/
mutable int cursorX, cursorY;
int photo_highlightedGame = 0;
int seasonNo = 0;
char chrFilePath[256];
char chrFilePath2[256];
bool displayNothing = false;
bool displayStudioBg = true;
bool characterPicked = false;
mutable int charFadeAlpha = 0;
bool previewCharacter = false;
bool previewCharacterFound = false;
bool showMessage = false;
int messageNo = 0;
int zoomIn = 0;
u16 totalCharacters = 0;
u16 import_totalCharacters = 0;
int characterList_cursorPosition = 0;
int characterList_cursorPositionOnScreen = 0;
int characterChangeMenu_cursorPosition = 0;
int characterChangeMenu_cursorPositionOnScreen = 0;
int characterChangeMenu_optionShownFirst = 0;
int characterChangeMenuOps[4] = {0};
int characterChangeMenuOptions = 2;
int importCharacterList_cursorPosition = 0;
int importCharacterList_cursorPositionOnScreen = 0;
int characterShownFirst = 0;
int import_characterShownFirst = 0;
bool exportedCharListGotten[4] = {false};
};
#endif

View File

@ -17,7 +17,7 @@ private:
int cursorAlpha = 0;
const char* yearText = "2019-2020 RocketRobz";
const char* manageSaveText = "Manage Save Data";
const char* photoStudioText = "Photo Studio (TBA)";
const char* photoStudioText = "Photo Studio";
const char* settingsText = "Settings";
const char* returnToHomeText = ": Return to HOME Menu";
const char* exitText = "X: Exit";

View File

@ -0,0 +1,23 @@
#include <stdbool.h>
const char* import_ss1CharacterNames[] = {
"Grace",
"Renee",
"Dominic",
"Eunice",
"Felicity",
"Libby",
"Didi",
"Olivia",
};
bool import_ss1CharacterGenders[] = {
false, // Female
false, // Female
true, // Male
false, // Female
false, // Female
false, // Female
false, // Female
false, // Female
};

View File

@ -0,0 +1,87 @@
#include <stdbool.h>
const char* import_ss2CharacterNames[] = {
"Michaela",
"Evie", // (EUR/JAP)
"Emmylou",
"Avery", // aka Lola (EUR)
"Shoko", // (JAP)
"India", // aka Elena (EUR)
"Daphne", // aka Shivani (EUR)
"Genevieve", // aka Faye (EUR)
"Celeste", // aka Clarissa (EUR)
"Ingrid",
"Deborah", // aka Elsepth (EUR)
"Daisy", // aka Flora (EUR)
"Teagan", // aka Tess (EUR)
"Nicky",
"Brienne",
"Clara",
"Yukiko",
"Dorothy",
"Dulcie",
};
const char* import_nsbCharacterNames[] = {
"Michaela", // (USA)
"Evie",
"Harriet",
"Avery", // Lola (EUR)
"Shoko", // (JAP)
"India", // Elena (EUR)
"Daphne", // Shivani (EUR)
"Genevieve", // Faye (EUR)
"Celeste", // Clarissa (EUR)
"Ingrid",
"Deborah", // Elsepth (EUR)
"Daisy", // Flora (EUR)
"Tess",
"Nicky",
"Zahra",
"Clara",
"Yukiko",
"Dorothy",
"Dulcie",
};
bool import_ss2CharacterGenders[] = {
false, // Female
false, // Female
false, // Female
false, // Female
false, // Female
false, // Female
false, // Female
false, // Female
false, // Female
false, // Female
false, // Female
false, // Female
false, // Female
false, // Female
false, // Female
false, // Female
false, // Female
false, // Female
};
/*bool import_ss2CharacterTieColors[] = {
false, // Pink
true, // Light Green
false, // Pink
false, // Pink
true, // Light Green
false, // Pink
false, // Pink
false, // Pink
false, // Pink
false, // Pink
false, // Pink
false, // Pink
false, // Pink
false, // Pink
false, // Pink
false, // Pink
false, // Pink
false, // Pink
};*/

View File

@ -0,0 +1,43 @@
#include <stdbool.h>
const char* import_ss3CharacterNames[] = {
"Sophie",
"Callie",
"Laurie",
"Noor",
"Yuzu", // Noor (JAP)
"Arabella",
"Sasha",
"Zoey",
"Kirsty",
"Rainbow",
"Magda",
"Adelaide",
"Molly",
"Ruby",
"Sapphire",
"Amber",
"Mickey",
"Ricky", // File does not exist, so he's not shown
};
bool import_ss3CharacterGenders[] = {
false, // Female
false, // Female
false, // Female
false, // Female
false, // Female
false, // Female
false, // Female
false, // Female
false, // Female
false, // Female
false, // Female
false, // Female
false, // Female
false, // Female
false, // Female
false, // Female
true, // Male
true, // Male
};

View File

@ -0,0 +1,35 @@
#include <stdbool.h>
const char* import_ss4CharacterNames[] = {
"Rosie",
"Yolanda",
"Alina",
"Cece",
"Lorelei",
"Camilla",
"Janice",
"Margot",
"Niamh",
"Pippa",
"Angelique",
"Abigail",
"Jo",
"Madeira",
};
bool import_ss4CharacterGenders[] = {
false, // Female
false, // Female
false, // Female
false, // Female
false, // Female
false, // Female
false, // Female
false, // Female
false, // Female
false, // Female
false, // Female
false, // Female
false, // Female
false, // Female
};

View File

@ -0,0 +1,672 @@
#include "photoStudio.hpp"
#include "screenvars.h"
#include "titleScreen.hpp"
#include "savedata.h"
#include "file_browse.h"
#include "import_ss1charnames.h"
#include "import_ss2charnames.h"
#include "import_ss3charnames.h"
#include "import_ss4charnames.h"
#include "import_ss3bgnames.h"
#include "import_ss4bgnames.h"
#include <unistd.h>
PhotoStudio::PhotoStudio() {
this->getList();
}
void PhotoStudio::getList() {
this->getMaxChars();
}
void PhotoStudio::getMaxChars() {
if (this->subScreenMode == 1) {
if (photo_highlightedGame == 3) {
import_totalCharacters = 9;
} else if (photo_highlightedGame == 2) {
import_totalCharacters = 2;
} else if (photo_highlightedGame == 1) {
import_totalCharacters = 0;
} else if (photo_highlightedGame == 0) {
import_totalCharacters = 0;
}
} else {
if (photo_highlightedGame == 4) {
import_totalCharacters = numberOfExportedCharacters-1;
} else if (photo_highlightedGame == 3) {
import_totalCharacters = 0xD;
} else if (photo_highlightedGame == 2) {
import_totalCharacters = 0x10;
} else if (photo_highlightedGame == 1) {
import_totalCharacters = 0x12;
} else if (photo_highlightedGame == 0) {
import_totalCharacters = 0x7;
}
}
}
const char* PhotoStudio::seasonName(void) const {
switch (seasonNo) {
case 0:
return "Spring";
case 1:
return "Summer";
case 2:
return "Fall";
case 3:
return "Winter";
}
return "null";
}
const char* PhotoStudio::import_characterName(void) const {
switch (photo_highlightedGame) {
case 0:
return import_ss1CharacterNames[importCharacterList_cursorPosition];
case 1:
return import_ss2CharacterNames[importCharacterList_cursorPosition];
case 2:
return import_ss3CharacterNames[importCharacterList_cursorPosition];
case 3:
return import_ss4CharacterNames[importCharacterList_cursorPosition];
}
return "null";
}
const char* PhotoStudio::import_SS2CharacterNames(int i) const {
switch (sysRegion) {
default:
return import_ss2CharacterNames[i];
case CFG_REGION_EUR:
case CFG_REGION_AUS:
return import_nsbCharacterNames[i];
}
}
const char* PhotoStudio::import_characterNameDisplay(void) const {
switch (photo_highlightedGame) {
case 0:
return import_ss1CharacterNames[importCharacterList_cursorPosition];
case 1:
return import_SS2CharacterNames(importCharacterList_cursorPosition);
case 2:
return import_ss3CharacterNames[importCharacterList_cursorPosition];
case 3:
return import_ss4CharacterNames[importCharacterList_cursorPosition];
}
return "null";
}
const char* PhotoStudio::ss1Title(void) const {
switch (sysRegion) {
default:
return "Style Savvy";
case CFG_REGION_EUR:
case CFG_REGION_AUS:
return "Style Boutique";
case CFG_REGION_JPN:
return "Wagamama Fashion: Girls Mode";
case CFG_REGION_KOR:
return "Namanui Collection: Girls Style";
}
}
const char* PhotoStudio::ss2Title(void) const {
switch (sysRegion) {
default:
return "Style Savvy: Trendsetters";
case CFG_REGION_EUR:
case CFG_REGION_AUS:
return "New Style Boutique";
case CFG_REGION_JPN:
return "Girls Mode: Yokubari Sengen";
case CFG_REGION_KOR:
return "Girls Style: Paesyeon Lideo Seon-eon!";
}
}
const char* PhotoStudio::ss3Title(void) const {
switch (sysRegion) {
default:
return "Style Savvy: Fashion Forward";
case CFG_REGION_EUR:
case CFG_REGION_AUS:
return "New Style Boutique 2: Fashion Forward";
case CFG_REGION_JPN:
return "Girls Mode 3: Kirakira * Code";
case CFG_REGION_KOR:
return "Girls Style: Kirakira * Code";
}
}
const char* PhotoStudio::ss4Title(void) const {
switch (sysRegion) {
default:
return "Style Savvy: Styling Star";
case CFG_REGION_EUR:
case CFG_REGION_AUS:
return "New Style Boutique 3: Styling Star";
case CFG_REGION_JPN:
return "Girls Mode 4: Star Stylist";
case CFG_REGION_KOR:
return "Girls Style: Star Stylist";
}
}
void PhotoStudio::drawMsg(void) const {
GFX::DrawSprite(sprites_msg_idx, 0, 8, 1, 1);
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.");
GFX::DrawSprite(sprites_button_msg_shadow_idx, 114, 197);
GFX::DrawSprite(sprites_button_msg_idx, 115, 188);
Gui::DrawString(134, 196, 0.70, MSG_BUTTONTEXT, " OK!");
}
void PhotoStudio::loadChrImage(bool Robz) {
this->previewCharacter = false;
gspWaitForVBlank();
if (photo_highlightedGame == 4) {
if (numberOfExportedCharacters > 0) {
sprintf(this->chrFilePath, "sdmc:/3ds/SavvyManager/SS%i/characters/previews/%s.t3x", highlightedGame+1, getExportedCharacterName(this->importCharacterList_cursorPosition)); // All Seasons
} else {
sprintf(this->chrFilePath, "romfs:/gfx/null.t3x"); // All Seasons
}
this->previewCharacterFound = GFX::loadCharSprite(this->chrFilePath, this->chrFilePath);
} else {
sprintf(this->chrFilePath, "romfs:/gfx/ss%i_%s.t3x", highlightedGame+1, (Robz ? "Robz" : import_characterName())); // All Seasons
sprintf(this->chrFilePath2, "romfs:/gfx/ss%i_%s%i.t3x", highlightedGame+1, (Robz ? "Robz" : import_characterName()), this->seasonNo); // One Season
this->previewCharacterFound = GFX::loadCharSprite(this->chrFilePath, this->chrFilePath2);
}
this->previewCharacter = true;
}
void PhotoStudio::Draw(void) const {
Gui::ScreenDraw(Top);
if (this->displayStudioBg) {
GFX::showBgSprite(zoomIn);
} else {
Gui::Draw_Rect(0, 0, 400, 240, WHITE); // Fill gaps of BG
for(int w = 0; w < 7; w++) {
for(int h = 0; h < 3; h++) {
GFX::DrawSprite(sprites_phone_bg_idx, -72+bg_xPos+w*72, bg_yPos+h*136);
}
}
}
if (this->previewCharacter) {
if (this->previewCharacterFound) {
GFX::showCharSprite(this->zoomIn, this->charFadeAlpha);
} else {
Gui::DrawStringCentered(0, 104, 0.65, WHITE, (this->photo_highlightedGame==4 ? "Preview not found." : "Preview unavailable."));
}
}
this->preview();
if (fadealpha > 0) Gui::Draw_Rect(0, 0, 400, 240, C2D_Color32(fadecolor, fadecolor, fadecolor, fadealpha)); // Fade in/out effect
if (cinemaWide) {
Gui::Draw_Rect(0, 0, 400, 36, C2D_Color32(0, 0, 0, 255));
Gui::Draw_Rect(0, 204, 400, 36, C2D_Color32(0, 0, 0, 255));
}
Gui::ScreenDraw(Bottom);
Gui::Draw_Rect(0, 0, 320, 240, WHITE); // Fill gaps of BG
for(int w = 0; w < 7; w++) {
for(int h = 0; h < 3; h++) {
GFX::DrawSprite(sprites_phone_bg_idx, -76+bg_xPos+w*72, bg_yPos+h*136);
}
}
this->cursorX = 248;
if (this->subScreenMode == 2) {
this->cursorY = 64+(48*this->importCharacterList_cursorPositionOnScreen);
// Game name
switch (this->photo_highlightedGame) {
case 4:
Gui::DrawStringCentered(0, 8, 0.50, BLACK, "Your character files");
break;
case 3:
Gui::DrawStringCentered(0, 8, 0.50, BLACK, ss4Title());
break;
case 2:
Gui::DrawStringCentered(0, 8, 0.50, BLACK, ss3Title());
break;
case 1:
Gui::DrawStringCentered(0, 8, 0.50, BLACK, ss2Title());
break;
case 0:
Gui::DrawStringCentered(0, 8, 0.50, BLACK, ss1Title());
break;
}
Gui::DrawString(8, 8, 0.50, BLACK, "<");
Gui::DrawString(304, 8, 0.50, BLACK, ">");
if (photo_highlightedGame != 4) {
// Selected season
Gui::DrawString(120, 208, 0.65, BLACK, "L");
Gui::DrawStringCentered(0, 210, 0.50, BLACK, this->seasonName());
Gui::DrawString(192, 208, 0.65, BLACK, "R");
}
if (!displayNothing) {
int i2 = 48;
for (int i = import_characterShownFirst; i < import_characterShownFirst+3; i++) {
if (photo_highlightedGame == 4) {
if (i >= numberOfExportedCharacters) break;
GFX::DrawSprite(sprites_item_button_idx, 16, i2-20);
GFX::DrawSprite((getExportedCharacterGender(i) ? sprites_icon_male_idx : sprites_icon_female_idx), 12, i2-8);
Gui::DrawString(64, i2, 0.65, BLACK, getExportedCharacterName(i));
} else if (photo_highlightedGame == 3) {
GFX::DrawSprite(sprites_item_button_idx, 16, i2-20);
GFX::DrawSprite((import_ss4CharacterGenders[i] ? sprites_icon_male_idx : sprites_icon_female_idx), 12, i2-8);
Gui::DrawString(64, i2, 0.65, BLACK, import_ss4CharacterNames[i]);
} else if (photo_highlightedGame == 2) {
GFX::DrawSprite(sprites_item_button_idx, 16, i2-20);
GFX::DrawSprite((import_ss3CharacterGenders[i] ? sprites_icon_male_idx : sprites_icon_female_idx), 12, i2-8);
Gui::DrawString(64, i2, 0.65, BLACK, import_ss3CharacterNames[i]);
} else if (photo_highlightedGame == 1) {
GFX::DrawSprite(sprites_item_button_idx, 16, i2-20);
GFX::DrawSprite((import_ss2CharacterGenders[i] ? sprites_icon_male_idx : sprites_icon_female_idx)/*+import_ss2CharacterTieColors[i]*/, 12, i2-8);
Gui::DrawString(64, i2, 0.65, BLACK, import_SS2CharacterNames(i));
} else if (photo_highlightedGame == 0) {
GFX::DrawSprite(sprites_item_button_idx, 16, i2-20);
GFX::DrawSprite((import_ss1CharacterGenders[i] ? sprites_icon_male_idx : sprites_icon_female_idx), 12, i2-8);
Gui::DrawString(64, i2, 0.65, BLACK, import_ss1CharacterNames[i]);
}
i2 += 48;
}
}
} else if (this->subScreenMode == 1) {
this->cursorY = 64+(48*this->importCharacterList_cursorPositionOnScreen);
// Game name
switch (this->photo_highlightedGame) {
case 4:
Gui::DrawStringCentered(0, 8, 0.50, BLACK, "Your character files");
break;
case 3:
Gui::DrawStringCentered(0, 8, 0.50, BLACK, ss4Title());
break;
case 2:
Gui::DrawStringCentered(0, 8, 0.50, BLACK, ss3Title());
break;
case 1:
Gui::DrawStringCentered(0, 8, 0.50, BLACK, ss2Title());
break;
case 0:
Gui::DrawStringCentered(0, 8, 0.50, BLACK, ss1Title());
break;
}
Gui::DrawString(8, 8, 0.50, BLACK, "<");
Gui::DrawString(304, 8, 0.50, BLACK, ">");
/*if (photo_highlightedGame != 4) {
// Selected season
Gui::DrawString(120, 208, 0.65, BLACK, "L");
Gui::DrawStringCentered(0, 210, 0.50, BLACK, this->seasonName());
Gui::DrawString(192, 208, 0.65, BLACK, "R");
}*/
if (!displayNothing) {
int i2 = 48;
for (int i = import_characterShownFirst; i < import_characterShownFirst+3; i++) {
if (photo_highlightedGame == 3) {
GFX::DrawSprite(sprites_item_button_idx, 16, i2-20);
Gui::DrawString(32, i2, 0.65, BLACK, import_ss4BgNames[i]);
} else if (photo_highlightedGame == 2) {
GFX::DrawSprite(sprites_item_button_idx, 16, i2-20);
Gui::DrawString(32, i2, 0.65, BLACK, import_ss3BgNames[i]);
} else if (photo_highlightedGame == 1) {
GFX::DrawSprite(sprites_item_button_idx, 16, i2-20);
//Gui::DrawString(32, i2, 0.65, BLACK, import_SS2CharacterNames(i));
} else if (photo_highlightedGame == 0) {
GFX::DrawSprite(sprites_item_button_idx, 16, i2-20);
//Gui::DrawString(32, i2, 0.65, BLACK, import_ss1CharacterNames[i]);
}
i2 += 48;
}
}
} else {
this->cursorY = 64+(48*this->characterChangeMenu_cursorPositionOnScreen);
Gui::DrawString(8, 8, 0.50, BLACK, "What do you want to do?");
Gui::DrawString(116, 210, 0.50, BLACK, ": Take photo");
int i2 = 0;
i2 += 48;
GFX::DrawSprite(sprites_item_button_idx, 16, i2-20);
Gui::DrawString(32, i2, 0.65, BLACK, "Change studio BG");
i2 += 48;
GFX::DrawSprite(sprites_item_button_idx, 16, i2-20);
Gui::DrawString(32, i2, 0.65, BLACK, "Change character");
}
GFX::DrawSprite(sprites_button_shadow_idx, 5, 199);
GFX::DrawSprite(sprites_button_red_idx, 5, 195);
GFX::DrawSprite(sprites_arrow_back_idx, 19, 195);
GFX::DrawSprite(sprites_button_b_idx, 44, 218);
GFX::drawCursor(this->cursorX, this->cursorY);
if (showMessage) {
drawMsg();
}
if (fadealpha > 0) Gui::Draw_Rect(0, 0, 400, 240, C2D_Color32(fadecolor, fadecolor, fadecolor, fadealpha)); // Fade in/out effect
}
void PhotoStudio::preview() const {
if (this->previewCharacter) {
switch (iFps) {
default:
this->charFadeAlpha += 20;
break;
case 30:
this->charFadeAlpha += 40;
break;
case 24:
this->charFadeAlpha += 55;
break;
}
if (this->charFadeAlpha > 255) this->charFadeAlpha = 255;
} else {
this->charFadeAlpha = 0;
}
}
void PhotoStudio::Logic(u32 hDown, u32 hHeld, touchPosition touch) {
if (hDown & KEY_CPAD_UP) {
this->zoomIn++;
if (this->zoomIn > 2) this->zoomIn = 2;
}
if (hDown & KEY_CPAD_DOWN) {
this->zoomIn--;
if (this->zoomIn < 0) this->zoomIn = 0;
}
if (this->showMessage) {
if ((hDown & KEY_A) || ((hDown & KEY_TOUCH) && touch.px >= 115 && touch.px < 115+90 && touch.py >= 188 && touch.py < 188+47)) {
sndSelect();
this->showMessage = false;
}
} else if (this->subScreenMode == 2) {
if (showCursor) {
if (hDown & KEY_DUP) {
sndHighlight();
this->importCharacterList_cursorPosition--;
this->importCharacterList_cursorPositionOnScreen--;
if (this->importCharacterList_cursorPosition < 0) {
this->importCharacterList_cursorPosition = 0;
this->import_characterShownFirst = 0;
} else if (this->importCharacterList_cursorPosition < this->import_characterShownFirst) {
this->import_characterShownFirst--;
}
if (this->importCharacterList_cursorPositionOnScreen < 0) {
this->importCharacterList_cursorPositionOnScreen = 0;
}
this->loadChrImage(false);
}
if (hDown & KEY_DDOWN) {
sndHighlight();
this->importCharacterList_cursorPosition++;
this->importCharacterList_cursorPositionOnScreen++;
if (this->importCharacterList_cursorPosition > this->import_totalCharacters) {
this->importCharacterList_cursorPosition = this->import_totalCharacters;
this->import_characterShownFirst = this->import_totalCharacters-2;
if (this->import_characterShownFirst < 0) this->import_characterShownFirst = 0;
if (this->importCharacterList_cursorPositionOnScreen > this->import_totalCharacters) {
this->importCharacterList_cursorPositionOnScreen = this->import_totalCharacters;
}
} else if (this->importCharacterList_cursorPosition > this->import_characterShownFirst+2) {
this->import_characterShownFirst++;
}
if (this->importCharacterList_cursorPositionOnScreen > 2) {
this->importCharacterList_cursorPositionOnScreen = 2;
}
this->loadChrImage(false);
}
}
if (hDown & KEY_A) {
sndSelect();
this->subScreenMode = 0;
}
if (hDown & KEY_DLEFT) {
sndHighlight();
this->photo_highlightedGame--;
if (this->photo_highlightedGame < 0) this->photo_highlightedGame = 4;
this->getMaxChars();
}
if (hDown & KEY_DRIGHT) {
sndHighlight();
this->photo_highlightedGame++;
if (this->photo_highlightedGame > 4) this->photo_highlightedGame = 0;
this->getMaxChars();
}
if ((hDown & KEY_DLEFT) || (hDown & KEY_DRIGHT)) {
this->importCharacterList_cursorPosition = 0;
this->importCharacterList_cursorPositionOnScreen = 0;
this->import_characterShownFirst = 0;
if (this->photo_highlightedGame == 4) {
this->previewCharacter = false;
if (!this->exportedCharListGotten[highlightedGame]) {
this->displayNothing = true;
gspWaitForVBlank();
getExportedCharacterContents();
this->exportedCharListGotten[highlightedGame] = true;
this->displayNothing = false;
}
}
this->getMaxChars();
this->loadChrImage(false);
}
if (this->photo_highlightedGame != 4) {
if ((hDown & KEY_L) || (hDown & KEY_ZL)) {
sndHighlight();
this->seasonNo--;
if (this->seasonNo < 0) this->seasonNo = 3;
this->loadChrImage(false);
}
if ((hDown & KEY_R) || (hDown & KEY_ZR)) {
sndHighlight();
this->seasonNo++;
if (this->seasonNo > 3) this->seasonNo = 0;
this->loadChrImage(false);
}
}
if ((hDown & KEY_B) || ((hDown & KEY_TOUCH) && touchingBackButton())) {
sndBack();
this->subScreenMode = 0;
}
} else if (this->subScreenMode == 1) {
if (showCursor) {
if (hDown & KEY_DUP) {
sndHighlight();
this->importCharacterList_cursorPosition--;
this->importCharacterList_cursorPositionOnScreen--;
if (this->importCharacterList_cursorPosition < 0) {
this->importCharacterList_cursorPosition = 0;
this->import_characterShownFirst = 0;
} else if (this->importCharacterList_cursorPosition < this->import_characterShownFirst) {
this->import_characterShownFirst--;
}
if (this->importCharacterList_cursorPositionOnScreen < 0) {
this->importCharacterList_cursorPositionOnScreen = 0;
}
switch (this->photo_highlightedGame) {
case 2:
studioBg = import_ss3BgNums[this->importCharacterList_cursorPosition];
break;
case 3:
studioBg = import_ss4BgNums[this->importCharacterList_cursorPosition];
break;
}
this->displayStudioBg = false;
gspWaitForVBlank();
GFX::loadBgSprite();
this->displayStudioBg = true;
}
if (hDown & KEY_DDOWN) {
sndHighlight();
this->importCharacterList_cursorPosition++;
this->importCharacterList_cursorPositionOnScreen++;
if (this->importCharacterList_cursorPosition > this->import_totalCharacters) {
this->importCharacterList_cursorPosition = this->import_totalCharacters;
this->import_characterShownFirst = this->import_totalCharacters-2;
if (this->import_characterShownFirst < 0) this->import_characterShownFirst = 0;
if (this->importCharacterList_cursorPositionOnScreen > this->import_totalCharacters) {
this->importCharacterList_cursorPositionOnScreen = this->import_totalCharacters;
}
} else if (this->importCharacterList_cursorPosition > this->import_characterShownFirst+2) {
this->import_characterShownFirst++;
}
if (this->importCharacterList_cursorPositionOnScreen > 2) {
this->importCharacterList_cursorPositionOnScreen = 2;
}
switch (this->photo_highlightedGame) {
case 2:
studioBg = import_ss3BgNums[this->importCharacterList_cursorPosition];
break;
case 3:
studioBg = import_ss4BgNums[this->importCharacterList_cursorPosition];
break;
}
this->displayStudioBg = false;
gspWaitForVBlank();
GFX::loadBgSprite();
this->displayStudioBg = true;
}
}
if (hDown & KEY_A) {
sndSelect();
this->subScreenMode = 0;
}
if (hDown & KEY_DLEFT) {
sndHighlight();
this->photo_highlightedGame--;
if (this->photo_highlightedGame < 0) this->photo_highlightedGame = 3;
this->getMaxChars();
}
if (hDown & KEY_DRIGHT) {
sndHighlight();
this->photo_highlightedGame++;
if (this->photo_highlightedGame > 3) this->photo_highlightedGame = 0;
this->getMaxChars();
}
if ((hDown & KEY_DLEFT) || (hDown & KEY_DRIGHT)) {
this->importCharacterList_cursorPosition = 0;
this->importCharacterList_cursorPositionOnScreen = 0;
this->import_characterShownFirst = 0;
this->getMaxChars();
switch (this->photo_highlightedGame) {
case 2:
studioBg = import_ss3BgNums[this->importCharacterList_cursorPosition];
break;
case 3:
studioBg = import_ss4BgNums[this->importCharacterList_cursorPosition];
break;
}
this->displayStudioBg = false;
gspWaitForVBlank();
GFX::loadBgSprite();
this->displayStudioBg = true;
}
if ((hDown & KEY_B) || ((hDown & KEY_TOUCH) && touchingBackButton())) {
sndBack();
this->subScreenMode = 0;
this->previewCharacter = this->characterPicked;
}
} else {
if (showCursor) {
if (hDown & KEY_DUP) {
sndHighlight();
this->characterChangeMenu_cursorPosition--;
this->characterChangeMenu_cursorPositionOnScreen--;
if (this->characterChangeMenu_cursorPosition < 0) {
this->characterChangeMenu_cursorPosition = 0;
}
if (this->characterChangeMenu_cursorPositionOnScreen < 0) {
this->characterChangeMenu_cursorPositionOnScreen = 0;
}
}
if (hDown & KEY_DDOWN) {
sndHighlight();
this->characterChangeMenu_cursorPosition++;
this->characterChangeMenu_cursorPositionOnScreen++;
if (this->characterChangeMenu_cursorPosition > 1) {
this->characterChangeMenu_cursorPosition = 1;
}
if (this->characterChangeMenu_cursorPositionOnScreen > 1) {
this->characterChangeMenu_cursorPositionOnScreen = 1;
}
}
}
if (hDown & KEY_A) {
highlightedGame = 3; // Use SS4 character renders
if (this->characterChangeMenu_cursorPosition == 0) {
sndSelect();
this->subScreenMode = 1;
this->getMaxChars();
this->previewCharacter = false;
} else if (this->characterChangeMenu_cursorPosition == 1) {
sndSelect();
this->displayNothing = true;
this->subScreenMode = 2;
if ((this->subScreenMode == 4) && (this->photo_highlightedGame == 4) && !this->exportedCharListGotten[highlightedGame]) {
gspWaitForVBlank();
getExportedCharacterContents();
this->exportedCharListGotten[highlightedGame] = true;
}
this->getMaxChars();
this->displayNothing = false;
this->loadChrImage(false);
this->characterPicked = true;
}
}
if ((hDown & KEY_B) || ((hDown & KEY_TOUCH) && touchingBackButton())) {
sndBack();
highlightedGame = 1;
this->characterList_cursorPosition = 0;
this->characterList_cursorPositionOnScreen = 0;
this->characterShownFirst = 0;
this->characterChangeMenu_cursorPosition = 0;
this->characterChangeMenu_cursorPositionOnScreen = 0;
this->characterChangeMenu_optionShownFirst = 0;
Gui::setScreen(std::make_unique<titleScreen>(), true);
}
}
}

View File

@ -3,6 +3,7 @@
#include "screenvars.h"
#include "settings.hpp"
#include "gameSelect.hpp"
#include "photoStudio.hpp"
extern u64 appID;
extern int titleSelection;
@ -111,6 +112,9 @@ void titleScreen::Logic(u32 hDown, u32 hHeld, touchPosition touch) {
case 0:
Gui::setScreen(std::make_unique<GameSelect>(), true);
break;
case 1:
Gui::setScreen(std::make_unique<PhotoStudio>(), true);
break;
case 2:
Gui::setScreen(std::make_unique<Settings>(), true);
break;