Changeset View
Changeset View
Standalone View
Standalone View
source/gui/CTooltip.cpp
Show All 24 Lines | |||||
CTooltip::CTooltip(CGUI& pGUI) | CTooltip::CTooltip(CGUI& pGUI) | ||||
: IGUIObject(pGUI), IGUITextOwner(pGUI) | : IGUIObject(pGUI), IGUITextOwner(pGUI) | ||||
{ | { | ||||
// If the tooltip is an object by itself: | // If the tooltip is an object by itself: | ||||
AddSetting<float>("buffer_zone"); | AddSetting<float>("buffer_zone"); | ||||
AddSetting<CGUIString>("caption"); | AddSetting<CGUIString>("caption"); | ||||
AddSetting<CStrW>("font"); | AddSetting<CStrW>("font"); | ||||
AddSetting<CGUISpriteInstance>("sprite"); | AddSetting<CGUISpriteInstance>("sprite"); | ||||
AddSetting<i32>("delay"); // in milliseconds | AddSetting<i32>("delay", 500); // in milliseconds | ||||
AddSetting<CGUIColor>("textcolor"); | AddSetting<CGUIColor>("textcolor"); | ||||
AddSetting<float>("maxwidth"); | AddSetting<float>("maxwidth"); | ||||
AddSetting<CPos>("offset"); | AddSetting<CPos>("offset"); | ||||
AddSetting<EVAlign>("anchor"); | AddSetting<EVAlign>("anchor", EVAlign_Bottom); | ||||
AddSetting<EAlign>("text_align"); | AddSetting<EAlign>("text_align", EAlign_Left); | ||||
// This is used for tooltips that are hidden/revealed manually by scripts, rather than through the standard tooltip display mechanism | // This is used for tooltips that are hidden/revealed manually by scripts, rather than through the standard tooltip display mechanism | ||||
AddSetting<bool>("independent"); | AddSetting<bool>("independent"); | ||||
// If the tooltip is just a reference to another object: | // If the tooltip is just a reference to another object: | ||||
AddSetting<CStr>("use_object"); | AddSetting<CStr>("use_object"); | ||||
AddSetting<bool>("hide_object"); | AddSetting<bool>("hide_object"); | ||||
// Private settings: | // Private settings: | ||||
// This is set by GUITooltip | // This is set by GUITooltip | ||||
AddSetting<CPos>("_mousepos"); | AddSetting<CPos>("_mousepos"); | ||||
// Defaults | |||||
SetSetting<i32>("delay", 500, true); | |||||
SetSetting<EVAlign>("anchor", EVAlign_Bottom, true); | |||||
SetSetting<EAlign>("text_align", EAlign_Left, true); | |||||
// Set up a blank piece of text, to be replaced with a more | // Set up a blank piece of text, to be replaced with a more | ||||
// interesting message later | // interesting message later | ||||
AddText(); | AddText(); | ||||
} | } | ||||
CTooltip::~CTooltip() | CTooltip::~CTooltip() | ||||
{ | { | ||||
} | } | ||||
▲ Show 20 Lines • Show All 90 Lines • Show Last 20 Lines |
Wildfire Games · Phabricator