Quake II RTX doxygen
1.0 dev
|
|
#include "ui.h"
#include "server/server.h"
Go to the source code of this file.
|
static void | Action_Free (menuAction_t *a) |
|
static void | Action_Init (menuAction_t *a) |
|
static void | Action_Draw (menuAction_t *a) |
|
static void | Static_Init (menuStatic_t *s) |
|
static void | Static_Draw (menuStatic_t *s) |
|
static void | Bitmap_Free (menuBitmap_t *b) |
|
static void | Bitmap_Init (menuBitmap_t *b) |
|
static void | Bitmap_Draw (menuBitmap_t *b) |
|
static void | Keybind_Free (menuKeybind_t *k) |
|
static void | Keybind_Init (menuKeybind_t *k) |
|
static void | Keybind_Draw (menuKeybind_t *k) |
|
static void | Keybind_Push (menuKeybind_t *k) |
|
static void | Keybind_Pop (menuKeybind_t *k) |
|
static void | Keybind_Update (menuFrameWork_t *menu) |
|
static void | Keybind_Remove (const char *cmd) |
|
static qboolean | keybind_cb (void *arg, int key) |
|
static menuSound_t | Keybind_DoEnter (menuKeybind_t *k) |
|
static menuSound_t | Keybind_Key (menuKeybind_t *k, int key) |
|
static void | Field_Push (menuField_t *f) |
|
static void | Field_Pop (menuField_t *f) |
|
static void | Field_Free (menuField_t *f) |
|
static void | Field_Init (menuField_t *f) |
|
static void | Field_Draw (menuField_t *f) |
|
static qboolean | Field_TestKey (menuField_t *f, int key) |
|
static int | Field_Key (menuField_t *f, int key) |
|
static int | Field_Char (menuField_t *f, int key) |
|
static void | SpinControl_Push (menuSpinControl_t *s) |
|
static void | SpinControl_Pop (menuSpinControl_t *s) |
|
static void | SpinControl_Free (menuSpinControl_t *s) |
|
void | SpinControl_Init (menuSpinControl_t *s) |
|
static int | SpinControl_DoEnter (menuSpinControl_t *s) |
|
static int | SpinControl_DoSlide (menuSpinControl_t *s, int dir) |
|
static void | SpinControl_Draw (menuSpinControl_t *s) |
|
static void | BitField_Push (menuSpinControl_t *s) |
|
static void | BitField_Pop (menuSpinControl_t *s) |
|
static void | BitField_Free (menuSpinControl_t *s) |
|
static void | Pairs_Push (menuSpinControl_t *s) |
|
static void | Pairs_Pop (menuSpinControl_t *s) |
|
static void | Pairs_Free (menuSpinControl_t *s) |
|
static void | Strings_Push (menuSpinControl_t *s) |
|
static void | Strings_Pop (menuSpinControl_t *s) |
|
static void | Toggle_Push (menuSpinControl_t *s) |
|
static void | Toggle_Pop (menuSpinControl_t *s) |
|
static void | MenuList_ValidatePrestep (menuList_t *l) |
|
static void | MenuList_AdjustPrestep (menuList_t *l) |
|
void | MenuList_Init (menuList_t *l) |
|
void | MenuList_SetValue (menuList_t *l, int value) |
|
static menuSound_t | MenuList_SetColumn (menuList_t *l, int value) |
|
static menuSound_t | MenuList_FindColumn (menuList_t *l, int rel) |
|
static menuSound_t | MenuList_PrevColumn (menuList_t *l) |
|
static menuSound_t | MenuList_NextColumn (menuList_t *l) |
|
static menuSound_t | MenuList_Click (menuList_t *l) |
|
static menuSound_t | MenuList_Key (menuList_t *l, int key) |
|
static menuSound_t | MenuList_MouseMove (menuList_t *l) |
|
static void | MenuList_DrawString (int x, int y, int flags, menuListColumn_t *column, const char *string) |
|
static void | MenuList_Draw (menuList_t *l) |
|
void | MenuList_Sort (menuList_t *l, int offset, int(*cmpfunc)(const void *, const void *)) |
|
static menuSound_t | Slider_DoSlide (menuSlider_t *s, int dir) |
|
static void | Slider_Push (menuSlider_t *s) |
|
static void | Slider_Pop (menuSlider_t *s) |
|
static void | Slider_Free (menuSlider_t *s) |
|
static void | Slider_Init (menuSlider_t *s) |
|
static menuSound_t | Slider_Click (menuSlider_t *s) |
|
static menuSound_t | Slider_MouseMove (menuSlider_t *s) |
|
static menuSound_t | Slider_Key (menuSlider_t *s, int key) |
|
static void | Slider_Draw (menuSlider_t *s) |
|
static void | Separator_Init (menuSeparator_t *s) |
|
static void | Separator_Draw (menuSeparator_t *s) |
|
static void | Savegame_Push (menuAction_t *a) |
|
static int | Common_DoEnter (menuCommon_t *item) |
|
void | Menu_AddItem (menuFrameWork_t *menu, void *item) |
|
static void | UI_ClearBounds (int mins[2], int maxs[2]) |
|
static void | UI_AddRectToBounds (const vrect_t *rc, int mins[2], int maxs[2]) |
|
void | Menu_Init (menuFrameWork_t *menu) |
|
void | Menu_Size (menuFrameWork_t *menu) |
|
menuCommon_t * | Menu_ItemAtCursor (menuFrameWork_t *m) |
|
void | Menu_SetFocus (menuCommon_t *focus) |
|
menuSound_t | Menu_AdjustCursor (menuFrameWork_t *m, int dir) |
|
static void | Menu_DrawStatus (menuFrameWork_t *menu) |
|
void | Menu_Draw (menuFrameWork_t *menu) |
|
menuSound_t | Menu_SelectItem (menuFrameWork_t *s) |
|
menuSound_t | Menu_SlideItem (menuFrameWork_t *s, int dir) |
|
menuSound_t | Menu_KeyEvent (menuCommon_t *item, int key) |
|
menuSound_t | Menu_CharEvent (menuCommon_t *item, int key) |
|
menuSound_t | Menu_MouseMove (menuCommon_t *item) |
|
static menuSound_t | Menu_DefaultKey (menuFrameWork_t *m, int key) |
|
menuSound_t | Menu_Keydown (menuFrameWork_t *menu, int key) |
|
menuCommon_t * | Menu_HitTest (menuFrameWork_t *menu) |
|
qboolean | Menu_Push (menuFrameWork_t *menu) |
|
void | Menu_Pop (menuFrameWork_t *menu) |
|
void | Menu_Free (menuFrameWork_t *menu) |
|
◆ Action_Draw()
◆ Action_Free()
◆ Action_Init()
◆ BitField_Free()
◆ BitField_Pop()
◆ BitField_Push()
◆ Bitmap_Draw()
◆ Bitmap_Free()
◆ Bitmap_Init()
◆ Common_DoEnter()
◆ Field_Char()
◆ Field_Draw()
Definition at line 424 of file menu.c.
430 flags |= UI_DRAWCURSOR;
439 f->
field.visibleChars * CHAR_WIDTH, CHAR_HEIGHT + 2,
color);
Referenced by Menu_Draw().
◆ Field_Free()
◆ Field_Init()
◆ Field_Key()
◆ Field_Pop()
◆ Field_Push()
◆ Field_TestKey()
Definition at line 452 of file menu.c.
455 return Q_isdigit(key) || key ==
'+' || key ==
'-' || key ==
'.';
458 return Q_isprint(key);
Referenced by Field_Char(), and Field_Key().
◆ keybind_cb()
static qboolean keybind_cb |
( |
void * |
arg, |
|
|
int |
key |
|
) |
| |
|
static |
◆ Keybind_DoEnter()
◆ Keybind_Draw()
Definition at line 226 of file menu.c.
228 char string[MAX_STRING_CHARS];
253 strcpy(
string,
"???");
Referenced by Menu_Draw().
◆ Keybind_Free()
◆ Keybind_Init()
◆ Keybind_Key()
◆ Keybind_Pop()
◆ Keybind_Push()
◆ Keybind_Remove()
static void Keybind_Remove |
( |
const char * |
cmd | ) |
|
|
static |
◆ Keybind_Update()
◆ Menu_AddItem()
Definition at line 1785 of file menu.c.
1788 Com_Error(ERR_FATAL,
"Menu_AddItem: too many items");
Referenced by M_Menu_Demos(), M_Menu_PlayerConfig(), M_Menu_Servers(), Parse_Action(), Parse_Bind(), Parse_Bitmap(), Parse_Blank(), Parse_Field(), Parse_Pairs(), Parse_Range(), Parse_Savegame(), Parse_Spin(), and Parse_Toggle().
◆ Menu_AdjustCursor()
Definition at line 2101 of file menu.c.
2108 for (i = 0; i <
m->nitems; i++) {
2124 if (cursor >=
m->nitems)
2130 }
while (cursor != pos);
2135 cursor =
m->nitems - 1;
2140 }
while (cursor != pos);
Referenced by Menu_DefaultKey().
◆ Menu_CharEvent()
◆ Menu_DefaultKey()
Definition at line 2398 of file menu.c.
2413 case K_KP_DOWNARROW:
2419 case K_KP_LEFTARROW:
2425 case K_KP_RIGHTARROW:
Referenced by Menu_Keydown().
◆ Menu_Draw()
◆ Menu_DrawStatus()
Definition at line 2148 of file menu.c.
2150 int linewidth =
uis.
width / CHAR_WIDTH;
2164 for (p = txt; *p > 32; p++)
2169 if ((l < linewidth && x + l > linewidth) || (x == linewidth)) {
2184 for (l = 0; l < count; l++) {
2185 x = (
uis.
width - lens[l] * CHAR_WIDTH) / 2;
2186 y = menu->
y2 - (count - l) * CHAR_HEIGHT;
Referenced by Menu_Draw().
◆ Menu_Free()
◆ Menu_HitTest()
◆ Menu_Init()
Definition at line 1817 of file menu.c.
1827 for (i = 0; i < menu->
nitems; i++) {
1828 item = menu->
items[i];
1831 if (condition->
cvar)
1833 qboolean equals = condition->
cvar->integer == condition->
value;
1834 if (equals == condition->
equals)
1846 for (i = 0; i < menu->
nitems; i++) {
1847 item = menu->
items[i];
1886 Com_Error(ERR_FATAL,
"Menu_Init: unknown item type");
1892 if (!focus && menu->
nitems) {
1893 for (i = 0; i < menu->
nitems; i++) {
1894 item = menu->
items[i];
1908 for (i = 0; i < menu->
nitems; i++) {
1909 item = menu->
items[i];
1922 if (menu->
mins[0] < 0) menu->
mins[0] = 0;
1923 if (menu->
mins[1] < 0) menu->
mins[1] = 0;
Referenced by UI_PushMenu(), and UI_Resize().
◆ Menu_ItemAtCursor()
◆ Menu_Keydown()
◆ Menu_KeyEvent()
◆ Menu_MouseMove()
◆ Menu_Pop()
◆ Menu_Push()
◆ Menu_SelectItem()
◆ Menu_SetFocus()
◆ Menu_Size()
Definition at line 1928 of file menu.c.
1935 for (i = 0, h = 0; i < menu->
nitems; i++) {
1936 item = menu->
items[i];
1942 if (widest < item->
width) {
1943 widest = item->
width;
1997 h += menu->
logo_rc.height + 5;
2011 for (i = 0; i < menu->
nitems; i++) {
2012 item = menu->
items[i];
Referenced by Menu_Init().
◆ Menu_SlideItem()
◆ MenuList_AdjustPrestep()
◆ MenuList_Click()
Definition at line 967 of file menu.c.
981 int barHeight, pageHeight, prestepHeight;
982 float pageFrac, prestepFrac;
993 pageHeight = Q_rint(barHeight * pageFrac);
994 prestepHeight = Q_rint(barHeight * prestepFrac);
1000 rect.height = prestepHeight;
1008 rect.y = y + prestepHeight;
1009 rect.height = pageHeight;
1017 rect.y = y + prestepHeight + pageHeight;
1018 rect.height = barHeight - prestepHeight - pageHeight;
1064 rect.x += rect.width;
1073 for (i = l->
prestep; i < j; i++) {
Referenced by MenuList_Key().
◆ MenuList_Draw()
Definition at line 1333 of file menu.c.
1339 float pageFrac, prestepFrac;
1351 int flags = UI_ALTCOLOR;
1396 yy + Q_rint(barHeight * prestepFrac),
1398 Q_rint(barHeight * pageFrac),
1424 for (i = l->
prestep; i < k; i++) {
Referenced by Menu_Draw().
◆ MenuList_DrawString()
Definition at line 1304 of file menu.c.
1311 rc.right = x + column->
width - 1;
1313 rc.bottom = y + CHAR_HEIGHT + 1;
1315 if ((column->
uiFlags & UI_CENTER) == UI_CENTER) {
1316 x += column->
width / 2 - 1;
1317 }
else if (column->
uiFlags & UI_RIGHT) {
Referenced by MenuList_Draw().
◆ MenuList_FindColumn()
◆ MenuList_Init()
◆ MenuList_Key()
Definition at line 1100 of file menu.c.
1113 if (key > 32 && key < 127) {
1133 for (i = 0; i < l->
numItems; i++) {
1173 case K_KP_DOWNARROW:
Referenced by Menu_KeyEvent().
◆ MenuList_MouseMove()
◆ MenuList_NextColumn()
◆ MenuList_PrevColumn()
◆ MenuList_SetColumn()
◆ MenuList_SetValue()
◆ MenuList_Sort()
◆ MenuList_ValidatePrestep()
◆ Pairs_Free()
◆ Pairs_Pop()
◆ Pairs_Push()
◆ Savegame_Push()
Definition at line 1726 of file menu.c.
1742 qboolean is_auto_save = strcmp(a->
cmd,
"save0") == 0;
1743 qboolean is_quick_save = strcmp(a->
cmd,
"quick") == 0;
1744 if (is_auto_save || is_quick_save)
1746 char *new_name =
va(
"%s - %s", a->
generic.
name, is_auto_save ?
"Auto Save" :
"Quick Save");
Referenced by Menu_Push().
◆ Separator_Draw()
◆ Separator_Init()
◆ Slider_Click()
Definition at line 1542 of file menu.c.
1551 x = CHAR_WIDTH + (
SLIDER_RANGE - 1) * CHAR_WIDTH * pos;
1557 rect.height = CHAR_HEIGHT;
1564 rect.width = CHAR_WIDTH;
1565 rect.height = CHAR_HEIGHT;
1575 rect.height = CHAR_HEIGHT;
Referenced by Slider_Key().
◆ Slider_DoSlide()
◆ Slider_Draw()
Definition at line 1647 of file menu.c.
1677 display_value *= 100.f;
1681 snprintf(sbuf,
sizeof(sbuf), s->
format, display_value);
1683 snprintf(sbuf,
sizeof(sbuf),
"%.1f", display_value);
Referenced by Menu_Draw().
◆ Slider_Free()
◆ Slider_Init()
◆ Slider_Key()
◆ Slider_MouseMove()
◆ Slider_Pop()
◆ Slider_Push()
◆ SpinControl_DoEnter()
◆ SpinControl_DoSlide()
◆ SpinControl_Draw()
◆ SpinControl_Free()
◆ SpinControl_Init()
Definition at line 543 of file menu.c.
546 int maxLength, length;
562 if (maxLength < length) {
570 maxLength * CHAR_WIDTH;
Referenced by Change(), and Menu_Init().
◆ SpinControl_Pop()
◆ SpinControl_Push()
◆ Static_Draw()
◆ Static_Init()
◆ Strings_Pop()
◆ Strings_Push()
◆ Toggle_Pop()
◆ Toggle_Push()
Definition at line 763 of file menu.c.
765 int val = s->
cvar->integer;
767 if (val == 0 || val == 1)
Referenced by Menu_Push().
◆ UI_AddRectToBounds()
static void UI_AddRectToBounds |
( |
const vrect_t * |
rc, |
|
|
int |
mins[2], |
|
|
int |
maxs[2] |
|
) |
| |
|
static |
Definition at line 1802 of file menu.c.
1804 if (mins[0] > rc->x) {
1806 }
else if (maxs[0] < rc->x + rc->width) {
1807 maxs[0] = rc->x + rc->width;
1810 if (mins[1] > rc->y) {
1812 }
else if (maxs[1] < rc->y + rc->height) {
1813 maxs[1] = rc->y + rc->height;
Referenced by Menu_Init().
◆ UI_ClearBounds()
static void UI_ClearBounds |
( |
int |
mins[2], |
|
|
int |
maxs[2] |
|
) |
| |
|
static |
Definition at line 1796 of file menu.c.
1798 mins[0] = mins[1] = 9999;
1799 maxs[0] = maxs[1] = -9999;
Referenced by Menu_Init().
void(* R_SetColor)(uint32_t color)
menuCommon_t * mouseTracker
void(* R_ClearColor)(void)
#define DOUBLE_CLICK_DELAY
void UI_DrawChar(int x, int y, int flags, int ch)
int Key_EnumBindings(int key, const char *binding)
char * UI_GetColumn(char *s, int n)
#define GENERIC_SPACING(x)
qhandle_t bitmapCursors[NUM_CURSOR_FRAMES]
#define MLIST_SCROLLBAR_WIDTH
void Com_Error(error_type_t type, const char *fmt,...)
void UI_StartSound(menuSound_t sound)
void Cvar_SetValue(cvar_t *var, float value, from_t from)
char * va(const char *format,...)
void UI_StringDimensions(vrect_t *rc, int flags, const char *string)
void(* R_DrawPic)(int x, int y, qhandle_t pic)
void Key_SetBinding(int keynum, const char *binding)
void UI_DrawString(int x, int y, int flags, const char *string)
int(* R_DrawString)(int x, int y, int flags, size_t maxChars, const char *string, qhandle_t font)
void Cvar_SetByVar(cvar_t *var, const char *value, from_t from)
char * Key_KeynumToString(int keynum)
void UI_DrawRect8(const vrect_t *rc, int border, int c)
void Cvar_SetInteger(cvar_t *var, int value, from_t from)
void(* R_DrawFill32)(int x, int y, int w, int h, uint32_t color)
void IF_Replace(inputField_t *field, const char *text)
struct uiStatic_s::@9 color
void(* R_SetClipRect)(const clipRect_t *clip)
void(* R_DrawStretchPic)(int x, int y, int w, int h, qhandle_t pic)
qboolean UI_CursorInRect(vrect_t *rect)
#define UI_IsItemSelectable(item)
#define NUM_CURSOR_FRAMES
char * SV_GetSaveInfo(const char *dir)
size_t Q_concat(char *dest, size_t size,...)
void Key_WaitKey(keywaitcb_t wait, void *arg)
void IF_Init(inputField_t *field, size_t visibleChars, size_t maxChars)