Move GUI<>::FallBackSprite and GUI<>::FallBackColor to CGUIColor::operator|| and CGUISpriteInstance::operator||.

Leaves only setting management in GUIutil.h.

Differential Revision: https://code.wildfiregames.com/D2185
This was SVN commit r22689.
This commit is contained in:
elexis
2019-08-18 15:17:49 +00:00
parent 4e55808cf9
commit 9985fcf5bd
9 changed files with 64 additions and 56 deletions
+7 -7
View File
@@ -145,19 +145,19 @@ CGUIColor IGUIButtonBehavior::ChooseColor()
if (!enabled)
{
GUI<CGUIColor>::GetSetting(this, "textcolor_disabled", color2);
return GUI<>::FallBackColor(color2, color);
return color2 || color;
}
else if (m_MouseHovering)
{
if (m_Pressed)
{
GUI<CGUIColor>::GetSetting(this, "textcolor_pressed", color2);
return GUI<>::FallBackColor(color2, color);
return color2 || color;
}
else
{
GUI<CGUIColor>::GetSetting(this, "textcolor_over", color2);
return GUI<>::FallBackColor(color2, color);
return color2 || color;
}
}
else
@@ -170,14 +170,14 @@ void IGUIButtonBehavior::DrawButton(const CRect& rect, const float& z, CGUISprit
GUI<bool>::GetSetting(this, "enabled", enabled);
if (!enabled)
GetGUI()->DrawSprite(GUI<>::FallBackSprite(sprite_disabled, sprite), cell_id, z, rect);
m_pGUI->DrawSprite(sprite_disabled || sprite, cell_id, z, rect);
else if (m_MouseHovering)
{
if (m_Pressed)
GetGUI()->DrawSprite(GUI<>::FallBackSprite(sprite_pressed, sprite), cell_id, z, rect);
m_pGUI->DrawSprite(sprite_pressed || sprite, cell_id, z, rect);
else
GetGUI()->DrawSprite(GUI<>::FallBackSprite(sprite_over, sprite), cell_id, z, rect);
m_pGUI->DrawSprite(sprite_over || sprite, cell_id, z, rect);
}
else
GetGUI()->DrawSprite(sprite, cell_id, z, rect);
m_pGUI->DrawSprite(sprite, cell_id, z, rect);
}