Changeset View
Changeset View
Standalone View
Standalone View
source/gui/CTooltip.cpp
Show All 19 Lines | |||||
#include "CTooltip.h" | #include "CTooltip.h" | ||||
#include "CGUI.h" | #include "CGUI.h" | ||||
#include <algorithm> | #include <algorithm> | ||||
CTooltip::CTooltip(CGUI* pGUI) | CTooltip::CTooltip(CGUI* pGUI) | ||||
: IGUIObject(pGUI), IGUITextOwner(pGUI) | : IGUIObject(pGUI), IGUITextOwner(pGUI) | ||||
{ | { | ||||
// Set up a blank piece of text, to be replaced with a more | |||||
// interesting message later | |||||
AddText(new SGUIText()); | |||||
} | |||||
CTooltip::~CTooltip() | |||||
{ | |||||
} | |||||
void CTooltip::AddSettings() | |||||
{ | |||||
// If the tooltip is an object by itself: | // If the tooltip is an object by itself: | ||||
AddSetting(GUIST_float, "buffer_zone"); | AddSetting(GUIST_float, "buffer_zone"); | ||||
AddSetting(GUIST_CGUIString, "caption"); | AddSetting(GUIST_CGUIString, "caption"); | ||||
AddSetting(GUIST_CStrW, "font"); | AddSetting(GUIST_CStrW, "font"); | ||||
AddSetting(GUIST_CGUISpriteInstance, "sprite"); | AddSetting(GUIST_CGUISpriteInstance, "sprite"); | ||||
AddSetting(GUIST_int, "delay"); | AddSetting(GUIST_int, "delay"); | ||||
AddSetting(GUIST_CGUIColor, "textcolor"); | AddSetting(GUIST_CGUIColor, "textcolor"); | ||||
AddSetting(GUIST_float, "maxwidth"); | AddSetting(GUIST_float, "maxwidth"); | ||||
Show All 11 Lines | void CTooltip::AddSettings() | ||||
// This is set by GUITooltip | // This is set by GUITooltip | ||||
AddSetting(GUIST_CPos, "_mousepos"); | AddSetting(GUIST_CPos, "_mousepos"); | ||||
// Defaults | // Defaults | ||||
GUI<int>::SetSetting(this, "delay", 500); | GUI<int>::SetSetting(this, "delay", 500); | ||||
GUI<EVAlign>::SetSetting(this, "anchor", EVAlign_Bottom); | GUI<EVAlign>::SetSetting(this, "anchor", EVAlign_Bottom); | ||||
GUI<EAlign>::SetSetting(this, "text_align", EAlign_Left); | GUI<EAlign>::SetSetting(this, "text_align", EAlign_Left); | ||||
// Set up a blank piece of text, to be replaced with a more | IGUIObject::AddSettings(); | ||||
// interesting message later | |||||
AddText(new SGUIText()); | |||||
} | |||||
CTooltip::~CTooltip() | |||||
{ | |||||
} | } | ||||
void CTooltip::SetupText() | void CTooltip::SetupText() | ||||
{ | { | ||||
if (!GetGUI()) | if (!GetGUI()) | ||||
return; | return; | ||||
ENSURE(m_GeneratedTexts.size() == 1); | ENSURE(m_GeneratedTexts.size() == 1); | ||||
▲ Show 20 Lines • Show All 107 Lines • Show Last 20 Lines |
Wildfire Games · Phabricator