UFO: Alien Invasion
Loading...
Searching...
No Matches
ui_draw.cpp File Reference
#include "ui_main.h"
#include "ui_nodes.h"
#include "ui_internal.h"
#include "ui_draw.h"
#include "ui_actions.h"
#include "ui_input.h"
#include "ui_node.h"
#include "ui_timer.h"
#include "ui_dragndrop.h"
#include "ui_tooltip.h"
#include "ui_render.h"
#include "node/ui_node_abstractnode.h"
#include "../client.h"
#include "../renderer/r_draw.h"
#include "../renderer/r_misc.h"
Include dependency graph for ui_draw.cpp:

Go to the source code of this file.

Functions

void UI_CaptureDrawOver (uiNode_t *node)
 Capture a node we will draw over all nodes (per window).
static void UI_CheckTooltipDelay (uiNode_t *node, uiTimer_t *timer)
static void UI_DrawNode (uiNode_t *node)
static void UI_DrawNotice (void)
 Generic notice function that renders a message to the screen.
void UI_Draw (void)
 Draws the window stack.
void UI_DrawCursor (void)
void UI_DisplayNotice (const char *text, int time, const char *windowName)
 Displays a message over all windows.
void UI_InitDraw (void)

Variables

static const int TOOLTIP_DELAY = 500
static cvar_tui_show_tooltips
static bool tooltipVisible = false
static uiTimer_ttooltipTimer
static int noticeTime
static char noticeText [256]
static uiNode_tnoticeWindow
static uiNode_tdrawOverNode
 Node we will draw over.

Function Documentation

◆ UI_CaptureDrawOver()

void UI_CaptureDrawOver ( uiNode_t * node)

Capture a node we will draw over all nodes (per window).

Note
The node must be captured every frames
Todo
it can be better to capture the draw over only one time (need new event like mouseEnter, mouseLeave)

Definition at line 64 of file ui_draw.cpp.

References drawOverNode.

Referenced by uiEditorNode::draw(), uiSelectBoxNode::draw(), and uiVideoNode::draw().

◆ UI_CheckTooltipDelay()

void UI_CheckTooltipDelay ( uiNode_t * node,
uiTimer_t * timer )
static

Definition at line 201 of file ui_draw.cpp.

References tooltipVisible, and UI_TimerStop().

Referenced by UI_InitDraw().

◆ UI_DisplayNotice()

void UI_DisplayNotice ( const char * text,
int time,
const char * windowName )

Displays a message over all windows.

See also
HUD_DisplayMessage
Parameters
[in]timeis a ms values
[in]texttext is already translated here
[in]windowNameWindow name where we must display the notice; else nullptr to use the current active window

Definition at line 411 of file ui_draw.cpp.

References CL_Milliseconds(), Com_Printf(), noticeText, noticeTime, noticeWindow, Q_strncpyz(), UI_GetActiveWindow(), and UI_GetWindow().

Referenced by CL_RContextCvarChange(), CL_RImagesCvarChange(), GAME_GetImportData(), and HUD_DisplayMessage().

◆ UI_Draw()

◆ UI_DrawCursor()

void UI_DrawCursor ( void )

Definition at line 399 of file ui_draw.cpp.

References mousePosX, mousePosY, and UI_DrawDragAndDrop().

Referenced by SCR_DrawCursor().

◆ UI_DrawNode()

◆ UI_DrawNotice()

void UI_DrawNotice ( void )
static

Generic notice function that renders a message to the screen.

Todo
Move it into Window node, and/or convert it in a reserved named string node and update the protocol

< Delta-x position. Relative to original x position.

Definition at line 296 of file ui_draw.cpp.

References ALIGN_CC, LONGLINES_WRAP, noticeText, noticeWindow, R_Color(), R_FontTextSize(), UI_DrawFill(), UI_DrawString(), UI_WindowNodeGetNoticePosition(), VID_NORM_WIDTH, and viddef.

Referenced by UI_Draw().

◆ UI_InitDraw()

void UI_InitDraw ( void )

Variable Documentation

◆ drawOverNode

uiNode_t* drawOverNode
static

Node we will draw over.

See also
UI_CaptureDrawOver
uiBehaviour_t.drawOverWindow

Definition at line 57 of file ui_draw.cpp.

Referenced by UI_CaptureDrawOver(), and UI_Draw().

◆ noticeText

char noticeText[256]
static

Definition at line 49 of file ui_draw.cpp.

Referenced by UI_DisplayNotice(), and UI_DrawNotice().

◆ noticeTime

int noticeTime
static

Definition at line 48 of file ui_draw.cpp.

Referenced by UI_DisplayNotice(), and UI_Draw().

◆ noticeWindow

uiNode_t* noticeWindow
static

Definition at line 50 of file ui_draw.cpp.

Referenced by UI_DisplayNotice(), UI_Draw(), and UI_DrawNotice().

◆ TOOLTIP_DELAY

const int TOOLTIP_DELAY = 500
static

Definition at line 42 of file ui_draw.cpp.

Referenced by UI_InitDraw().

◆ tooltipTimer

uiTimer_t* tooltipTimer
static

Definition at line 46 of file ui_draw.cpp.

Referenced by UI_Draw(), and UI_InitDraw().

◆ tooltipVisible

bool tooltipVisible = false
static

Definition at line 45 of file ui_draw.cpp.

Referenced by UI_CheckTooltipDelay(), and UI_Draw().

◆ ui_show_tooltips

cvar_t* ui_show_tooltips
static

Definition at line 44 of file ui_draw.cpp.

Referenced by UI_Draw(), and UI_InitDraw().