Changeset View
Changeset View
Standalone View
Standalone View
ps/trunk/source/gui/CTooltip.cpp
Show All 20 Lines | |||||
#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) | ||||
{ | { | ||||
// If the tooltip is an object by itself: | // If the tooltip is an object by itself: | ||||
AddSetting(GUIST_float, "buffer_zone"); | AddSetting<float>("buffer_zone"); | ||||
AddSetting(GUIST_CGUIString, "caption"); | AddSetting<CGUIString>("caption"); | ||||
AddSetting(GUIST_CStrW, "font"); | AddSetting<CStrW>("font"); | ||||
AddSetting(GUIST_CGUISpriteInstance, "sprite"); | AddSetting<CGUISpriteInstance>("sprite"); | ||||
AddSetting(GUIST_int, "delay"); | AddSetting<int>("delay"); | ||||
AddSetting(GUIST_CGUIColor, "textcolor"); | AddSetting<CGUIColor>("textcolor"); | ||||
AddSetting(GUIST_float, "maxwidth"); | AddSetting<float>("maxwidth"); | ||||
AddSetting(GUIST_CPos, "offset"); | AddSetting<CPos>("offset"); | ||||
AddSetting(GUIST_EVAlign, "anchor"); | AddSetting<EVAlign>("anchor"); | ||||
AddSetting(GUIST_EAlign, "text_align"); | AddSetting<EAlign>("text_align"); | ||||
// 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(GUIST_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(GUIST_CStr, "use_object"); | AddSetting<CStr>("use_object"); | ||||
AddSetting(GUIST_bool, "hide_object"); | AddSetting<bool>("hide_object"); | ||||
// Private settings: | // Private settings: | ||||
// This is set by GUITooltip | // This is set by GUITooltip | ||||
AddSetting(GUIST_CPos, "_mousepos"); | AddSetting<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 | // Set up a blank piece of text, to be replaced with a more | ||||
// interesting message later | // interesting message later | ||||
▲ Show 20 Lines • Show All 120 Lines • Show Last 20 Lines |
Wildfire Games · Phabricator