Add npc text color constants

This commit is contained in:
GriffinR
2022-08-09 16:03:42 -04:00
parent 0c1adf2115
commit fbdbc5851c
84 changed files with 318 additions and 294 deletions
+11 -3
View File
@@ -1542,18 +1542,26 @@ void SetSeenMon(void)
void ResetContextNpcTextColor(void)
{
gSelectedObjectEvent = 0;
gSpecialVar_TextColor = 0xFF;
gSpecialVar_TextColor = NPC_TEXT_COLOR_DEFAULT;
}
u8 ContextNpcGetTextColor(void)
{
u8 gfxId;
if (gSpecialVar_TextColor != 0xFF)
if (gSpecialVar_TextColor != NPC_TEXT_COLOR_DEFAULT)
{
// A text color has been specified, use that
return gSpecialVar_TextColor;
}
else if (gSelectedObjectEvent == 0)
return 3;
{
// No text color specified and no object selected, use neutral
return NPC_TEXT_COLOR_NEUTRAL;
}
else
{
// An object is selected and no color has been specified.
// Use the text color normally associated with this object's sprite.
gfxId = gObjectEvents[gSelectedObjectEvent].graphicsId;
if (gfxId >= OBJ_EVENT_GFX_VAR_0)
gfxId = VarGetObjectEventGraphicsId(gfxId - OBJ_EVENT_GFX_VAR_0);