Added DizzyEgg's colored natures to summary screen

This commit is contained in:
Ninjdai 2023-11-13 20:53:25 +01:00
parent 14574d6548
commit b86e8c883b
18 changed files with 74 additions and 19 deletions

View File

@ -60,6 +60,7 @@ If you have suggestions, found bugs, or just want to talk, feel free to DM me on
- Ellabrella (Text speed changes)
- Zeturic (X/Y-style wrapping summary screen)
- Anon822 (Physical/Special split icons in battle)
- DizzyEgg (Colored natures)
### Tools used
- Porymap

Binary file not shown.

After

Width:  |  Height:  |  Size: 162 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 164 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 167 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 162 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 164 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 168 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 164 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 166 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 168 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 159 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 163 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 165 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 163 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 165 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 168 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 164 B

View File

@ -315,6 +315,7 @@ static void DestroyMoveSelectorSprites(u8);
static void SetMainMoveSelectorColor(u8);
static void KeepMoveSelectorVisible(u8);
static void SummaryScreen_DestroyAnimDelayTask(void);
static void BufferStat(u8 *dst, s8 natureMod, u32 stat, u32 strId, u32 n);
// const rom data
#include "data/text/move_descriptions.h"
@ -3459,21 +3460,17 @@ static void PrintRibbonCount(void)
static void BufferLeftColumnStats(void)
{
u8 *currentHPString = Alloc(8);
u8 *maxHPString = Alloc(8);
u8 *attackString = Alloc(8);
u8 *defenseString = Alloc(8);
ConvertIntToDecimalStringN(currentHPString, sMonSummaryScreen->summary.currentHP, STR_CONV_MODE_RIGHT_ALIGN, 3);
ConvertIntToDecimalStringN(maxHPString, sMonSummaryScreen->summary.maxHP, STR_CONV_MODE_RIGHT_ALIGN, 3);
ConvertIntToDecimalStringN(attackString, sMonSummaryScreen->summary.atk, STR_CONV_MODE_RIGHT_ALIGN, 7);
ConvertIntToDecimalStringN(defenseString, sMonSummaryScreen->summary.def, STR_CONV_MODE_RIGHT_ALIGN, 7);
u8 *currentHPString = Alloc(20);
u8 *maxHPString = Alloc(20);
u8 *attackString = Alloc(20);
u8 *defenseString = Alloc(20);
const s8 *natureMod = gNatureStatTable[sMonSummaryScreen->summary.nature];
DynamicPlaceholderTextUtil_Reset();
DynamicPlaceholderTextUtil_SetPlaceholderPtr(0, currentHPString);
DynamicPlaceholderTextUtil_SetPlaceholderPtr(1, maxHPString);
DynamicPlaceholderTextUtil_SetPlaceholderPtr(2, attackString);
DynamicPlaceholderTextUtil_SetPlaceholderPtr(3, defenseString);
BufferStat(currentHPString, 0, sMonSummaryScreen->summary.currentHP, 0, 3);
BufferStat(maxHPString, 0, sMonSummaryScreen->summary.maxHP, 1, 3);
BufferStat(attackString, natureMod[STAT_ATK - 1], sMonSummaryScreen->summary.atk, 2, 7);
BufferStat(defenseString, natureMod[STAT_DEF - 1], sMonSummaryScreen->summary.def, 3, 7);
DynamicPlaceholderTextUtil_ExpandPlaceholders(gStringVar4, sStatsLeftColumnLayout);
Free(currentHPString);
@ -3489,14 +3486,12 @@ static void PrintLeftColumnStats(void)
static void BufferRightColumnStats(void)
{
ConvertIntToDecimalStringN(gStringVar1, sMonSummaryScreen->summary.spatk, STR_CONV_MODE_RIGHT_ALIGN, 3);
ConvertIntToDecimalStringN(gStringVar2, sMonSummaryScreen->summary.spdef, STR_CONV_MODE_RIGHT_ALIGN, 3);
ConvertIntToDecimalStringN(gStringVar3, sMonSummaryScreen->summary.speed, STR_CONV_MODE_RIGHT_ALIGN, 3);
const s8 *natureMod = gNatureStatTable[sMonSummaryScreen->summary.nature];
DynamicPlaceholderTextUtil_Reset();
DynamicPlaceholderTextUtil_SetPlaceholderPtr(0, gStringVar1);
DynamicPlaceholderTextUtil_SetPlaceholderPtr(1, gStringVar2);
DynamicPlaceholderTextUtil_SetPlaceholderPtr(2, gStringVar3);
BufferStat(gStringVar1, natureMod[STAT_SPATK - 1], sMonSummaryScreen->summary.spatk, 0, 3);
BufferStat(gStringVar2, natureMod[STAT_SPDEF - 1], sMonSummaryScreen->summary.spdef, 1, 3);
BufferStat(gStringVar3, natureMod[STAT_SPEED - 1], sMonSummaryScreen->summary.speed, 2, 3);
DynamicPlaceholderTextUtil_ExpandPlaceholders(gStringVar4, sStatsRightColumnLayout);
}
@ -4242,3 +4237,62 @@ static void KeepMoveSelectorVisible(u8 firstSpriteId)
gSprites[spriteIds[i]].invisible = FALSE;
}
}
static void BufferStat(u8 *dst, s8 natureMod, u32 stat, u32 strId, u32 n)
{
static const u8 sTextNatureDown[] = _("{COLOR}{08}");
static const u8 sTextNatureUp[] = _("{COLOR}{05}");
static const u8 sTextNatureNeutral[] = _("{COLOR}{01}");
u8 *txtPtr;
if (natureMod == 0)
txtPtr = StringCopy(dst, sTextNatureNeutral);
else if (natureMod > 0)
txtPtr = StringCopy(dst, sTextNatureUp);
else
txtPtr = StringCopy(dst, sTextNatureDown);
ConvertIntToDecimalStringN(txtPtr, stat, STR_CONV_MODE_RIGHT_ALIGN, n);
DynamicPlaceholderTextUtil_SetPlaceholderPtr(strId, dst);
}
/*
static const u16 sIVRankingsPal[] = INCBIN_U16( "graphics/interface/ivs/ivs.gbapal");
static const u8 sIVRankings_E_Minus[] = INCBIN_U8( "graphics/interface/ivs/e_minus.4bpp");
static const u8 sIVRankings_E[] = INCBIN_U8( "graphics/interface/ivs/e.4bpp");
static const u8 sIVRankings_E_Plus[] = INCBIN_U8( "graphics/interface/ivs/e_plus.4bpp");
static const u8 sIVRankings_D_Minus[] = INCBIN_U8( "graphics/interface/ivs/d_minus.4bpp");
static const u8 sIVRankings_D[] = INCBIN_U8( "graphics/interface/ivs/d.4bpp");
static const u8 sIVRankings_D_Plus[] = INCBIN_U8( "graphics/interface/ivs/d_plus.4bpp");
static const u8 sIVRankings_C_Minus[] = INCBIN_U8( "graphics/interface/ivs/c_minus.4bpp");
static const u8 sIVRankings_C[] = INCBIN_U8( "graphics/interface/ivs/c.4bpp");
static const u8 sIVRankings_C_Plus[] = INCBIN_U8( "graphics/interface/ivs/c_plus.4bpp");
static const u8 sIVRankings_B_Minus[] = INCBIN_U8( "graphics/interface/ivs/b_minus.4bpp");
static const u8 sIVRankings_B[] = INCBIN_U8( "graphics/interface/ivs/b.4bpp");
static const u8 sIVRankings_B_Plus[] = INCBIN_U8( "graphics/interface/ivs/b_plus.4bpp");
static const u8 sIVRankings_A_Minus[] = INCBIN_U8( "graphics/interface/ivs/a_minus.4bpp");
static const u8 sIVRankings_A[] = INCBIN_U8( "graphics/interface/ivs/a.4bpp");
static const u8 sIVRankings_A_Plus[] = INCBIN_U8( "graphics/interface/ivs/a_plus.4bpp");
static const u8 sIVRankings_S[] = INCBIN_U8( "graphics/interface/ivs/s.4bpp");
static const u8 * const sIVRankings_Images[] =
{
[0 ... 2] = sIVRankings_E_Minus,
[3 ... 4] = sIVRankings_E,
[5 ... 6] = sIVRankings_E_Plus,
[7 ... 8] = sIVRankings_D_Minus,
[9 ... 10] = sIVRankings_D,
[11 ... 12] = sIVRankings_D_Plus,
[13 ... 14] = sIVRankings_C_Minus,
[15 ... 16] = sIVRankings_C,
[17 ... 18] = sIVRankings_C_Plus,
[19 ... 20] = sIVRankings_B_Minus,
[21 ... 22] = sIVRankings_B,
[23 ... 24] = sIVRankings_B_Plus,
[25 ... 26] = sIVRankings_A_Minus,
[27 ... 28] = sIVRankings_A,
[29 ... 30] = sIVRankings_A_Plus,
[31] = sIVRankings_S,
};
*/