Changeset View
Changeset View
Standalone View
Standalone View
source/gui/ObjectTypes/CTooltip.cpp
Show First 20 Lines • Show All 141 Lines • ▼ Show 20 Lines | |||||
void CTooltip::HandleMessage(SGUIMessage& Message) | void CTooltip::HandleMessage(SGUIMessage& Message) | ||||
{ | { | ||||
IGUIObject::HandleMessage(Message); | IGUIObject::HandleMessage(Message); | ||||
IGUITextOwner::HandleMessage(Message); | IGUITextOwner::HandleMessage(Message); | ||||
} | } | ||||
void CTooltip::Draw() | void CTooltip::Draw() | ||||
{ | { | ||||
float z = 900.f; // TODO: Find a nicer way of putting the tooltip on top of everything else | |||||
// Normally IGUITextOwner will handle this updating but since SetupText can modify the position | // Normally IGUITextOwner will handle this updating but since SetupText can modify the position | ||||
// we need to call it now *before* we do the rest of the drawing | // we need to call it now *before* we do the rest of the drawing | ||||
if (!m_GeneratedTextsValid) | if (!m_GeneratedTextsValid) | ||||
{ | { | ||||
SetupText(); | SetupText(); | ||||
m_GeneratedTextsValid = true; | m_GeneratedTextsValid = true; | ||||
} | } | ||||
m_pGUI.DrawSprite(m_Sprite, z, m_CachedActualSize); | m_pGUI.DrawSprite(m_Sprite, GetBufferedZ(), m_CachedActualSize); | ||||
DrawText(0, m_TextColor, m_CachedActualSize.TopLeft(), GetBufferedZ() + 0.1f); | |||||
} | |||||
DrawText(0, m_TextColor, m_CachedActualSize.TopLeft(), z + 0.1f); | float CTooltip::GetBufferedZ() const | ||||
{ | |||||
const float z = 900.f; // TODO: Find a nicer way of putting the tooltip on top of everything else. | |||||
return z; | |||||
} | } |
Wildfire Games · Phabricator