Add npc text color constants
This commit is contained in:
+11
-3
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user