parent
1e5fd80b7e
commit
949fc48d26
1 changed files with 19 additions and 30 deletions
|
@ -3360,36 +3360,23 @@ static void PrintRibbonCount(void)
|
||||||
PrintTextOnWindow(AddWindowFromTemplateList(sPageSkillsTemplate, PSS_DATA_WINDOW_SKILLS_RIBBON_COUNT), text, x, 1, 0, 0);
|
PrintTextOnWindow(AddWindowFromTemplateList(sPageSkillsTemplate, PSS_DATA_WINDOW_SKILLS_RIBBON_COUNT), text, x, 1, 0, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Based on https://www.pokecommunity.com/showpost.php?p=10024409&postcount=21
|
|
||||||
static void BufferStat(u8 *dst, s8 natureMod, u32 stat, u32 strId, u32 n) {
|
|
||||||
static const u8 textNatureMinus[] = _("{COLOR_HIGHLIGHT_SHADOW}{BLUE}{TRANSPARENT}{07}"); // Blue
|
|
||||||
static const u8 textNaturePlus[] = _("{COLOR_HIGHLIGHT_SHADOW}{05}{TRANSPARENT}{06}"); // Red
|
|
||||||
static const u8 textNatureNone[] = _("{COLOR_HIGHLIGHT_SHADOW}{01}{TRANSPARENT}{DARK_GRAY}"); // Black
|
|
||||||
u8 *txtPtr;
|
|
||||||
if (natureMod == 0)
|
|
||||||
txtPtr = StringCopy(dst, textNatureNone);
|
|
||||||
else if (natureMod > 0)
|
|
||||||
txtPtr = StringCopy(dst, textNaturePlus);
|
|
||||||
else
|
|
||||||
txtPtr = StringCopy(dst, textNatureMinus);
|
|
||||||
|
|
||||||
ConvertIntToDecimalStringN(txtPtr, stat, STR_CONV_MODE_RIGHT_ALIGN, n);
|
|
||||||
DynamicPlaceholderTextUtil_SetPlaceholderPtr(strId, dst);
|
|
||||||
}
|
|
||||||
|
|
||||||
static void BufferLeftColumnStats(void)
|
static void BufferLeftColumnStats(void)
|
||||||
{
|
{
|
||||||
u8 *currentHPString = Alloc(20);
|
u8 *currentHPString = Alloc(8);
|
||||||
u8 *maxHPString = Alloc(20);
|
u8 *maxHPString = Alloc(8);
|
||||||
u8 *attackString = Alloc(20);
|
u8 *attackString = Alloc(8);
|
||||||
u8 *defenseString = Alloc(20);
|
u8 *defenseString = Alloc(8);
|
||||||
const s8 *natureMod = gNatureStatTable[sMonSummaryScreen->summary.nature];
|
|
||||||
|
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);
|
||||||
|
|
||||||
DynamicPlaceholderTextUtil_Reset();
|
DynamicPlaceholderTextUtil_Reset();
|
||||||
BufferStat(currentHPString, 0, sMonSummaryScreen->summary.currentHP, 0, 3);
|
DynamicPlaceholderTextUtil_SetPlaceholderPtr(0, currentHPString);
|
||||||
BufferStat(maxHPString, 0, sMonSummaryScreen->summary.maxHP, 1, 3);
|
DynamicPlaceholderTextUtil_SetPlaceholderPtr(1, maxHPString);
|
||||||
BufferStat(attackString, natureMod[STAT_ATK - 1], sMonSummaryScreen->summary.atk, 2, 7);
|
DynamicPlaceholderTextUtil_SetPlaceholderPtr(2, attackString);
|
||||||
BufferStat(defenseString, natureMod[STAT_DEF - 1], sMonSummaryScreen->summary.def, 3, 7);
|
DynamicPlaceholderTextUtil_SetPlaceholderPtr(3, defenseString);
|
||||||
DynamicPlaceholderTextUtil_ExpandPlaceholders(gStringVar4, sStatsLeftColumnLayout);
|
DynamicPlaceholderTextUtil_ExpandPlaceholders(gStringVar4, sStatsLeftColumnLayout);
|
||||||
|
|
||||||
Free(currentHPString);
|
Free(currentHPString);
|
||||||
|
@ -3405,12 +3392,14 @@ static void PrintLeftColumnStats(void)
|
||||||
|
|
||||||
static void BufferRightColumnStats(void)
|
static void BufferRightColumnStats(void)
|
||||||
{
|
{
|
||||||
const s8 *natureMod = gNatureStatTable[sMonSummaryScreen->summary.nature];
|
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);
|
||||||
|
|
||||||
DynamicPlaceholderTextUtil_Reset();
|
DynamicPlaceholderTextUtil_Reset();
|
||||||
BufferStat(gStringVar1, natureMod[STAT_SPATK - 1], sMonSummaryScreen->summary.spatk, 0, 3);
|
DynamicPlaceholderTextUtil_SetPlaceholderPtr(0, gStringVar1);
|
||||||
BufferStat(gStringVar2, natureMod[STAT_SPDEF - 1], sMonSummaryScreen->summary.spdef, 1, 3);
|
DynamicPlaceholderTextUtil_SetPlaceholderPtr(1, gStringVar2);
|
||||||
BufferStat(gStringVar3, natureMod[STAT_SPEED - 1], sMonSummaryScreen->summary.speed, 2, 3);
|
DynamicPlaceholderTextUtil_SetPlaceholderPtr(2, gStringVar3);
|
||||||
DynamicPlaceholderTextUtil_ExpandPlaceholders(gStringVar4, sStatsRightColumnLayout);
|
DynamicPlaceholderTextUtil_ExpandPlaceholders(gStringVar4, sStatsRightColumnLayout);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue