mirror of
https://github.com/RocketRobz/SavvyManager.git
synced 2025-06-18 17:15:34 -04:00
Add changing character height
This commit is contained in:
parent
0b3d7409ad
commit
378f3ebfa8
@ -172,6 +172,13 @@ extern void writeSS4AssistantCharacterId(u16 id);
|
||||
extern u16 getSS4MewtubeCharacterId(int video, int slot);
|
||||
extern void writeSS4MewtubeCharacterId(u16 id, int video, int slot);
|
||||
|
||||
extern u8 readSS2CharacterHeight(void);
|
||||
extern void writeSS2CharacterHeight(u8 height);
|
||||
extern u8 readSS3CharacterHeight(u16 id);
|
||||
extern void writeSS3CharacterHeight(u16 id, u8 height);
|
||||
extern u8 readSS4CharacterHeight(u16 id);
|
||||
extern void writeSS4CharacterHeight(u16 id, u8 height);
|
||||
|
||||
extern u8 readSS2CharacterPoseSet(void);
|
||||
extern void writeSS2CharacterPoseSet(u8 poseSet);
|
||||
extern u8 readSS3CharacterPoseSet(u16 id);
|
||||
|
@ -1302,6 +1302,14 @@ bool getSS2CharacterGenderNoExceptions(void) {
|
||||
return (ss2Save[0x102] == 2);
|
||||
}
|
||||
|
||||
u8 readSS2CharacterHeight(void) {
|
||||
return ss2CharacterData.height;
|
||||
}
|
||||
|
||||
void writeSS2CharacterHeight(u8 height) {
|
||||
ss2CharacterData.height = height;
|
||||
}
|
||||
|
||||
u8 readSS2CharacterPoseSet(void) {
|
||||
return ss2CharacterData.poseSet;
|
||||
}
|
||||
@ -1698,6 +1706,21 @@ bool getSS3CharacterGenderNoExceptions(u16 id) {
|
||||
return (ss3CharacterGenderCheck.gender == 2);
|
||||
}
|
||||
|
||||
u8 readSS3CharacterHeight(u16 id) {
|
||||
ss3to4character ss3CharacterTemp;
|
||||
tonccpy(&ss3CharacterTemp, (char*)ss3Save+getSS3CharacterOffset(id), 0x36);
|
||||
|
||||
return ss3CharacterTemp.height;
|
||||
}
|
||||
|
||||
void writeSS3CharacterHeight(u16 id, u8 height) {
|
||||
ss3to4character ss3CharacterTemp;
|
||||
tonccpy(&ss3CharacterTemp, (char*)ss3Save+getSS3CharacterOffset(id), 0x36);
|
||||
|
||||
ss3CharacterTemp.height = height;
|
||||
tonccpy((char*)ss3Save+getSS3CharacterOffset(id), &ss3CharacterTemp, 0x36);
|
||||
}
|
||||
|
||||
u8 readSS3CharacterPoseSet(u16 id) {
|
||||
ss3to4character ss3CharacterTemp;
|
||||
tonccpy(&ss3CharacterTemp, (char*)ss3Save+getSS3CharacterOffset(id), 0x36);
|
||||
@ -2498,6 +2521,21 @@ void changeSS4CharacterGender(u16 id) {
|
||||
getSS4CharacterGenderNoExceptions(id) ? changeSS4CharacterGenderToFemale(id) : changeSS4CharacterGenderToMale(id);
|
||||
}
|
||||
|
||||
u8 readSS4CharacterHeight(u16 id) {
|
||||
ss3to4character ss4CharacterTemp;
|
||||
tonccpy(&ss4CharacterTemp, (char*)ss4Save+getSS4CharacterOffset(id), 0x3E);
|
||||
|
||||
return ss4CharacterTemp.height;
|
||||
}
|
||||
|
||||
void writeSS4CharacterHeight(u16 id, u8 height) {
|
||||
ss3to4character ss4CharacterTemp;
|
||||
tonccpy(&ss4CharacterTemp, (char*)ss4Save+getSS4CharacterOffset(id), 0x3E);
|
||||
|
||||
ss4CharacterTemp.height = height;
|
||||
tonccpy((char*)ss4Save+getSS4CharacterOffset(id), &ss4CharacterTemp, 0x3E);
|
||||
}
|
||||
|
||||
u8 readSS4CharacterPoseSet(u16 id) {
|
||||
ss3to4character ss4CharacterTemp;
|
||||
tonccpy(&ss4CharacterTemp, (char*)ss4Save+getSS4CharacterOffset(id), 0x3E);
|
||||
|
@ -128,9 +128,16 @@ const char* getSS4CharName(u16 charId) {
|
||||
return "???";
|
||||
}
|
||||
|
||||
static const char* poseSetNames[] = {
|
||||
"Active",
|
||||
"Cute",
|
||||
"Cool",
|
||||
};
|
||||
|
||||
extern bool ss3DLCharactersBackedUp;
|
||||
|
||||
static u16 currentCharId = 0;
|
||||
static u8 currentHeight = 0;
|
||||
static u8 currentPoseSet = 0;
|
||||
|
||||
CharacterChange::CharacterChange() {
|
||||
@ -953,15 +960,28 @@ void CharacterChange::Draw(void) const {
|
||||
bool isMale = false;
|
||||
if (highlightedGame == 3) {
|
||||
isMale = getSS4CharacterGenderNoExceptions(currentCharId);
|
||||
currentHeight = readSS4CharacterHeight(currentCharId);
|
||||
currentPoseSet = readSS4CharacterPoseSet(currentCharId);
|
||||
} else if (highlightedGame == 2) {
|
||||
isMale = getSS3CharacterGenderNoExceptions(currentCharId);
|
||||
currentHeight = readSS3CharacterHeight(currentCharId);
|
||||
currentPoseSet = readSS3CharacterPoseSet(currentCharId);
|
||||
} else if (highlightedGame == 1) {
|
||||
isMale = getSS2CharacterGenderNoExceptions();
|
||||
currentHeight = readSS2CharacterHeight();
|
||||
currentPoseSet = readSS2CharacterPoseSet();
|
||||
}
|
||||
|
||||
char heightString[24];
|
||||
if (currentHeight == 0) {
|
||||
sprintf(heightString, "Height: < Invisible >");
|
||||
} else {
|
||||
sprintf(heightString, "Height: < %i >", currentHeight);
|
||||
}
|
||||
|
||||
char poseSetString[24];
|
||||
sprintf(poseSetString, "Pose Set: < %s >", poseSetNames[currentPoseSet-1]);
|
||||
|
||||
int i2 = (highlightedGame == 3 ? 8 : 0);
|
||||
i2 += 48;
|
||||
GFX::DrawSprite(sprites_item_button_idx, 16, i2-20);
|
||||
@ -969,12 +989,9 @@ void CharacterChange::Draw(void) const {
|
||||
Gui::DrawString(64, i2, 0.65, BLACK, (highlightedGame == 3) ? (isMale ? "Gender: < Male >" : "Gender: < Female >") : (isMale ? "Gender: Male" : "Gender: Female"));
|
||||
i2 += 48;
|
||||
GFX::DrawSprite(sprites_item_button_idx, 16, i2-20);
|
||||
const char* poseSetString = "Pose Set: < Active >";
|
||||
if (currentPoseSet == 2) {
|
||||
poseSetString = "Pose Set: < Cute >";
|
||||
} else if (currentPoseSet == 3) {
|
||||
poseSetString = "Pose Set: < Cool >";
|
||||
}
|
||||
Gui::DrawString(64, i2, 0.65, BLACK, heightString);
|
||||
i2 += 48;
|
||||
GFX::DrawSprite(sprites_item_button_idx, 16, i2-20);
|
||||
Gui::DrawString(64, i2, 0.65, BLACK, poseSetString);
|
||||
} else if (subScreenMode == 1) {
|
||||
cursorY = 64+(48*characterChangeMenu_cursorPositionOnScreen);
|
||||
@ -2002,8 +2019,8 @@ void CharacterChange::Logic(u32 hDown, u32 hDownRepeat, u32 hHeld, touchPosition
|
||||
if (hDown & KEY_DDOWN) {
|
||||
sndHighlight();
|
||||
characterAttributeList_cursorPosition++;
|
||||
if (characterAttributeList_cursorPosition > 1) {
|
||||
characterAttributeList_cursorPosition = 1;
|
||||
if (characterAttributeList_cursorPosition > 2) {
|
||||
characterAttributeList_cursorPosition = 2;
|
||||
}
|
||||
}
|
||||
|
||||
@ -2017,6 +2034,23 @@ void CharacterChange::Logic(u32 hDown, u32 hDownRepeat, u32 hHeld, touchPosition
|
||||
}
|
||||
break;
|
||||
case 1:
|
||||
sndHighlight();
|
||||
currentHeight--;
|
||||
if (highlightedGame == 3) {
|
||||
if (currentHeight < 1) currentHeight = 3;
|
||||
} else {
|
||||
if (currentHeight == 0xFF) currentHeight = 3;
|
||||
}
|
||||
if (highlightedGame == 3) {
|
||||
writeSS4CharacterHeight(currentCharId, currentHeight);
|
||||
} else if (highlightedGame == 2) {
|
||||
writeSS3CharacterHeight(currentCharId, currentHeight);
|
||||
} else if (highlightedGame == 1) {
|
||||
writeSS2CharacterHeight(currentHeight);
|
||||
}
|
||||
changesMade = true;
|
||||
break;
|
||||
case 2:
|
||||
sndHighlight();
|
||||
currentPoseSet--;
|
||||
if (currentPoseSet < 1) currentPoseSet = 3;
|
||||
@ -2042,6 +2076,19 @@ void CharacterChange::Logic(u32 hDown, u32 hDownRepeat, u32 hHeld, touchPosition
|
||||
}
|
||||
break;
|
||||
case 1:
|
||||
sndHighlight();
|
||||
currentHeight++;
|
||||
if (currentHeight > 3) currentHeight = (highlightedGame == 3) ? 1 : 0;
|
||||
if (highlightedGame == 3) {
|
||||
writeSS4CharacterHeight(currentCharId, currentHeight);
|
||||
} else if (highlightedGame == 2) {
|
||||
writeSS3CharacterHeight(currentCharId, currentHeight);
|
||||
} else if (highlightedGame == 1) {
|
||||
writeSS2CharacterHeight(currentHeight);
|
||||
}
|
||||
changesMade = true;
|
||||
break;
|
||||
case 2:
|
||||
sndHighlight();
|
||||
currentPoseSet++;
|
||||
if (currentPoseSet > 3) currentPoseSet = 1;
|
||||
@ -2066,6 +2113,9 @@ void CharacterChange::Logic(u32 hDown, u32 hDownRepeat, u32 hHeld, touchPosition
|
||||
writeSS4CharacterToSave(currentCharId);
|
||||
} else if (highlightedGame == 2) {
|
||||
writeSS3CharacterToSave(currentCharId);
|
||||
} else if (highlightedGame == 1) {
|
||||
writeSS2Character();
|
||||
writeSS2CharacterToSave();
|
||||
}
|
||||
changesMade = false;
|
||||
}
|
||||
@ -2135,7 +2185,9 @@ void CharacterChange::Logic(u32 hDown, u32 hDownRepeat, u32 hHeld, touchPosition
|
||||
sndSelect();
|
||||
displayNothing = true;
|
||||
subScreenMode = characterChangeMenuOps[characterChangeMenu_cursorPosition];
|
||||
if ((subScreenMode == 4) && (import_highlightedGame == 4) && !exportedCharListGotten[highlightedGame]) {
|
||||
if ((subScreenMode == 2) && (highlightedGame == 1)) {
|
||||
readSS2Character();
|
||||
} else if ((subScreenMode == 4) && (import_highlightedGame == 4) && !exportedCharListGotten[highlightedGame]) {
|
||||
gspWaitForVBlank();
|
||||
getExportedCharacterContents();
|
||||
exportedCharListGotten[highlightedGame] = true;
|
||||
|
Loading…
Reference in New Issue
Block a user