DDraceNetwork Docs
|
#include <tooltips.h>
Public Member Functions | |
CTooltips () | |
virtual int | Sizeof () const override |
void | DoToolTip (const void *pId, const CUIRect *pNearRect, const char *pText, float WidthHint=-1.0f) |
virtual void | OnReset () override |
virtual void | OnRender () override |
Public Member Functions inherited from CComponent | |
virtual | ~CComponent () |
virtual int | Sizeof () const =0 |
class CGameClient * | GameClient () const |
class IClient * | Client () const |
virtual void | OnStateChange (int NewState, int OldState) |
virtual void | OnConsoleInit () |
virtual void | OnInit () |
virtual void | OnShutdown () |
virtual void | OnReset () |
virtual void | OnWindowResize () |
virtual void | OnRefreshSkins () |
virtual void | OnRender () |
virtual void | OnNewSnapshot () |
virtual void | OnRelease () |
virtual void | OnMapLoad () |
virtual void | OnMessage (int Msg, void *pRawMsg) |
virtual bool | OnCursorMove (float x, float y, IInput::ECursorType CursorType) |
virtual bool | OnInput (const IInput::CEvent &Event) |
Private Member Functions | |
void | SetActiveTooltip (CTooltip &Tooltip) |
void | ClearActiveTooltip () |
Private Attributes | |
std::unordered_map< uintptr_t, CTooltip > | m_Tooltips |
std::optional< std::reference_wrapper< CTooltip > > | m_ActiveTooltip |
std::optional< std::reference_wrapper< CTooltip > > | m_PreviousTooltip |
int64_t | m_HoverTime |
Additional Inherited Members | |
Protected Member Functions inherited from CComponent | |
class IKernel * | Kernel () const |
class IEngine * | Engine () const |
class IGraphics * | Graphics () const |
class ITextRender * | TextRender () const |
class IInput * | Input () const |
class IStorage * | Storage () const |
class CUi * | Ui () const |
class ISound * | Sound () const |
class CRenderTools * | RenderTools () const |
class IConfigManager * | ConfigManager () const |
class CConfig * | Config () const |
class IConsole * | Console () const |
class IDemoPlayer * | DemoPlayer () const |
class IDemoRecorder * | DemoRecorder (int Recorder) const |
class IFavorites * | Favorites () const |
class IServerBrowser * | ServerBrowser () const |
class CLayers * | Layers () const |
class CCollision * | Collision () const |
int64_t | time () const |
float | LocalTime () const |
class IHttp * | Http () const |
Protected Attributes inherited from CComponent | |
CGameClient * | m_pClient |
A component that manages and renders UI tooltips.
Should be among the last components to render.
CTooltips::CTooltips | ( | ) |
|
inlineprivate |
void CTooltips::DoToolTip | ( | const void * | pId, |
const CUIRect * | pNearRect, | ||
const char * | pText, | ||
float | WidthHint = -1.0f |
||
) |
Adds the tooltip to a cache and renders it when active.
On the first call to this function, the data passed is cached, afterwards the calls are used to detect if the tooltip should be activated. If multiple tooltips cover the same rect or the rects intersect, then the tooltip that is added later has priority.
pId | The ID of the tooltip. Usually a reference to some g_Config value. |
pNearRect | Place the tooltip near this rect. |
pText | The text to display in the tooltip. |
WidthHint | The maximum width of the tooltip, or -1.0f for unlimited. |
|
overridevirtual |
Called when the component should get rendered.
The render order depends on the component insertion order.
Reimplemented from CComponent.
|
overridevirtual |
Called to reset the component. This method is usually called on your component constructor to avoid code duplication.
Reimplemented from CComponent.
|
private |
Tooltip | A reference to the tooltip that should be active. |
|
inlineoverridevirtual |
Gets the size of the non-abstract component.
Implements CComponent.
|
private |
|
private |
|
private |
|
private |