ui_draw.c 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_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.c:

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 cvar_tmn_show_tooltips
static const int TOOLTIP_DELAY = 500
static qboolean tooltipVisible = qfalse
static uiTimer_ttooltipTimer
static int noticeTime
static char noticeText [256]
static uiNode_tnoticeWindow
static uiNode_tdrawOverNode
 Node we will draw over.

Detailed Description

Definition in file ui_draw.c.


Function Documentation

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 62 of file ui_draw.c.

Referenced by UI_EditorNodeDraw(), UI_SelectBoxNodeDraw(), UI_TodoNodeDraw(), and UI_VideoNodeDraw().

static void UI_CheckTooltipDelay ( uiNode_t node,
uiTimer_t timer 
) [static]

Definition at line 200 of file ui_draw.c.

References qtrue, tooltipVisible, and UI_TimerStop().

Referenced by UI_InitDraw().

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

Displays a message over all windows.

See also:
HUD_DisplayMessage
Parameters:
[in] time is a ms values
[in] text text is already translated here
[in] windowName Window name where we must display the notice; else NULL to use the current active window

Definition at line 411 of file ui_draw.c.

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

Referenced by E_EmployeeDelete_f(), E_EmployeeHire_f(), HUD_DisplayMessage(), UI_CheckCvar(), and UI_KeyBindingNodeKeyPressed().

void UI_Draw ( void   ) 
void UI_DrawCursor ( void   ) 

Definition at line 399 of file ui_draw.c.

References mousePosX, mousePosY, and UI_DrawDragAndDrop().

Referenced by SCR_DrawCursor().

static void UI_DrawNode ( uiNode_t node  )  [static]
static 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 288 of file ui_draw.c.

References ALIGN_CC, LONGLINES_WRAP, noticeText, uiNode_s::pos, qfalse, R_Color(), R_FontTextSize(), UI_DrawFill(), UI_DrawString(), UI_WindowNodeGetNoticePosition(), VID_NORM_WIDTH, viddef, and viddef_t::virtualWidth.

Referenced by UI_Draw().

void UI_InitDraw ( void   ) 

Definition at line 427 of file ui_draw.c.

References CVAR_ARCHIVE, Cvar_Get(), TOOLTIP_DELAY, UI_AllocTimer(), and UI_CheckTooltipDelay().

Referenced by UI_Init().


Variable Documentation

Node we will draw over.

See also:
UI_CaptureDrawOver
uiBehaviour_t.drawOverWindow

Definition at line 55 of file ui_draw.c.

Definition at line 41 of file ui_draw.c.

char noticeText[256] [static]

Definition at line 47 of file ui_draw.c.

Referenced by UI_DisplayNotice(), and UI_DrawNotice().

int noticeTime [static]

Definition at line 46 of file ui_draw.c.

Referenced by UI_DisplayNotice(), and UI_Draw().

Definition at line 48 of file ui_draw.c.

const int TOOLTIP_DELAY = 500 [static]

Definition at line 42 of file ui_draw.c.

Referenced by UI_InitDraw().

Definition at line 44 of file ui_draw.c.

qboolean tooltipVisible = qfalse [static]

Definition at line 43 of file ui_draw.c.

Referenced by UI_CheckTooltipDelay(), and UI_Draw().


Generated by  doxygen 1.6.2