ui_node_messagelist.c File Reference

#include "../ui_main.h"
#include "../ui_internal.h"
#include "../ui_font.h"
#include "../ui_actions.h"
#include "../ui_parse.h"
#include "../ui_render.h"
#include "../ui_icon.h"
#include "ui_node_text.h"
#include "ui_node_messagelist.h"
#include "ui_node_abstractnode.h"
#include "../../client.h"
#include "../../campaign/cp_messages.h"
#include "../../../shared/parse.h"
Include dependency graph for ui_node_messagelist.c:

Go to the source code of this file.

Defines

#define EXTRADATA(node)   UI_EXTRADATA(node, abstractScrollableExtraData_t)
#define EXTRADATACONST(node)   UI_EXTRADATACONST(node, abstractScrollableExtraData_t)

Functions

static int UI_MessageGetLines (const uiNode_t *node, message_t *message, const char *fontID, int width)
static uiIcon_tUI_MessageGetIcon (const message_t *message)
static void UI_MessageDraw (const uiNode_t *node, message_t *message, const char *fontID, int x, int y, int width, int *screenLines)
static void UI_MessageListNodeDraw (uiNode_t *node)
 Draws the messagesystem node.
static void UI_MessageListNodeMouseWheel (uiNode_t *node, qboolean down, int x, int y)
void UI_RegisterMessageListNode (uiBehaviour_t *behaviour)

Variables

static const int LINEHEIGHT = 20
static const int DATETIME_COLUUI_SIZE = 180
static char * lastDate

Detailed Description

Todo:
add getter/setter to cleanup access to extradata from cl_*.c files (check "u.text.")

Definition in file ui_node_messagelist.c.


Define Documentation

#define EXTRADATA ( node   )     UI_EXTRADATA(node, abstractScrollableExtraData_t)

< message_t

Definition at line 41 of file ui_node_messagelist.c.

#define EXTRADATACONST ( node   )     UI_EXTRADATACONST(node, abstractScrollableExtraData_t)

Definition at line 42 of file ui_node_messagelist.c.


Function Documentation

static void UI_MessageDraw ( const uiNode_t node,
message_t message,
const char *  fontID,
int  x,
int  y,
int  width,
int *  screenLines 
) [static]
static uiIcon_t* UI_MessageGetIcon ( const message_t message  )  [static]
static int UI_MessageGetLines ( const uiNode_t node,
message_t message,
const char *  fontID,
int  width 
) [static]
Returns:
Number of lines need to display this message

Definition at line 52 of file ui_node_messagelist.c.

References DATETIME_COLUUI_SIZE, LONGLINES_WRAP, uiNode_s::padding, R_FontTextSize(), message_s::text, and message_s::timestamp.

Referenced by UI_MessageListNodeDraw().

static void UI_MessageListNodeDraw ( uiNode_t node  )  [static]

Draws the messagesystem node.

Parameters:
[in] node The context node

< if newer messages are on top, autoscroll is not need

Note:
posY can be negative (if we must display last line of the first message)

Definition at line 167 of file ui_node_messagelist.c.

References cp_messageStack, EXTRADATA, lastDate, LINEHEIGHT, message_s::lineUsed, message_s::next, uiNode_s::padding, pos, uiNode_s::size, UI_AbstractScrollableNodeIsSizeChange(), UI_AbstractScrollableNodeSetY(), UI_GetFontFromNode(), UI_GetNodeAbsPos(), UI_MessageDraw(), and UI_MessageGetLines().

Referenced by UI_RegisterMessageListNode().

static void UI_MessageListNodeMouseWheel ( uiNode_t node,
qboolean  down,
int  x,
int  y 
) [static]
void UI_RegisterMessageListNode ( uiBehaviour_t behaviour  ) 

Variable Documentation

const int DATETIME_COLUUI_SIZE = 180 [static]

Definition at line 47 of file ui_node_messagelist.c.

Referenced by UI_MessageDraw(), and UI_MessageGetLines().

char* lastDate [static]

Definition at line 63 of file ui_node_messagelist.c.

Referenced by UI_MessageDraw(), and UI_MessageListNodeDraw().

const int LINEHEIGHT = 20 [static]
Todo:
use the font height?

Definition at line 45 of file ui_node_messagelist.c.

Referenced by UI_MessageDraw(), and UI_MessageListNodeDraw().


Generated by  doxygen 1.6.2