Quake II RTX doxygen
1.0 dev
|
|
#include "ui.h"
#include "common/files.h"
Go to the source code of this file.
◆ CHECK_NITEMS
Value:
Com_Printf("Too many items\n"); \
return; \
}
Definition at line 47 of file script.c.
◆ Activate()
◆ Parse_Action()
Definition at line 192 of file script.c.
194 static const cmd_option_t o_action[] = {
200 int uiFlags = UI_CENTER;
207 uiFlags = UI_LEFT | UI_ALTCOLOR;
218 Com_Printf(
"Usage: %s <name> <command>\n",
Cmd_Argv(0));
228 a->generic.uiFlags = uiFlags;
Referenced by Parse_File().
◆ Parse_Background()
◆ Parse_Banner()
◆ Parse_Bind()
Definition at line 281 of file script.c.
283 static const cmd_option_t o_bind[] = {
285 {
"S:",
"altstatus" },
289 char *status =
"Press Enter to change, Backspace to clear";
290 char *altstatus =
"Press the desired key, Escape to cancel";
307 Com_Printf(
"Usage: %s <name> <command>\n",
Cmd_Argv(0));
316 k->generic.uiFlags = UI_CENTER;
Referenced by Parse_File().
◆ Parse_Bitmap()
Definition at line 235 of file script.c.
237 static const cmd_option_t o_bitmap[] = {
243 char *status = NULL, *altname = NULL;
260 Com_Printf(
"Usage: %s <name> <command>\n",
Cmd_Argv(0));
275 b->
pics[1] = R_RegisterPic(altname);
Referenced by Parse_File().
◆ Parse_Blank()
◆ Parse_Color()
Definition at line 524 of file script.c.
529 Com_Printf(
"Usage: %s <state> <color>\n",
Cmd_Argv(0));
536 if (!strcmp(s,
"normal")) {
538 }
else if (!strcmp(s,
"active")) {
540 }
else if (!strcmp(s,
"selection")) {
542 }
else if (!strcmp(s,
"disabled")) {
545 Com_Printf(
"Unknown state '%s'\n", s);
Referenced by Parse_File().
◆ Parse_Field()
Definition at line 414 of file script.c.
416 static const cmd_option_t o_field[] = {
425 qboolean center = qfalse;
445 if (width < 1 || width > 32) {
446 Com_Printf(
"Invalid width\n");
461 f->generic.flags = flags;
Referenced by Parse_File().
◆ Parse_File()
static qboolean Parse_File |
( |
const char * |
path, |
|
|
int |
depth |
|
) |
| |
|
static |
Definition at line 624 of file script.c.
626 char *raw, *data, *p, *cmd;
631 ret = FS_LoadFile(path, (
void **)&raw);
633 if (ret != Q_ERR_NOENT || depth) {
634 Com_WPrintf(
"Couldn't %s %s: %s\n", depth ?
"include" :
"load",
644 p = strchr(data,
'\n');
655 if (!strcmp(cmd,
"end")) {
660 Com_WPrintf(
"Menu entry without items\n");
664 }
else if (!strcmp(cmd,
"title")) {
669 }
else if (!strcmp(cmd,
"plaque")) {
671 }
else if (!strcmp(cmd,
"banner")) {
673 }
else if (!strcmp(cmd,
"footer")) {
675 }
else if (!strcmp(cmd,
"background")) {
677 }
else if (!strcmp(cmd,
"style")) {
679 }
else if (!strcmp(cmd,
"values")) {
681 }
else if (!strcmp(cmd,
"strings")) {
683 }
else if (!strcmp(cmd,
"pairs")) {
685 }
else if (!strcmp(cmd,
"range")) {
687 }
else if (!strcmp(cmd,
"action")) {
689 }
else if (!strcmp(cmd,
"bitmap")) {
691 }
else if (!strcmp(cmd,
"bind")) {
693 }
else if (!strcmp(cmd,
"savegame")) {
695 }
else if (!strcmp(cmd,
"loadgame")) {
697 }
else if (!strcmp(cmd,
"toggle")) {
699 }
else if (!strcmp(cmd,
"field")) {
701 }
else if (!strcmp(cmd,
"blank")) {
703 }
else if (!strcmp(cmd,
"ifeq")) {
705 }
else if (!strcmp(cmd,
"ifneq")) {
707 }
else if (!strcmp(cmd,
"endif")) {
710 Com_WPrintf(
"Unknown keyword '%s'\n", cmd);
713 if (!strcmp(cmd,
"begin")) {
716 Com_WPrintf(
"Expected menu name after '%s'\n", cmd);
724 List_Remove(&menu->
entry);
734 }
else if (!strcmp(cmd,
"include")) {
737 Com_WPrintf(
"Expected file name after '%s'\n", cmd);
741 Com_WPrintf(
"Includes too deeply nested\n");
745 }
else if (!strcmp(cmd,
"color")) {
747 }
else if (!strcmp(cmd,
"background")) {
757 }
else if (!strcmp(cmd,
"font")) {
759 }
else if (!strcmp(cmd,
"cursor")) {
763 }
else if (!strcmp(cmd,
"weapon")) {
766 Com_WPrintf(
"Unknown keyword '%s'\n", cmd);
782 Com_WPrintf(
"Menu entry without 'end' terminator\n");
Referenced by UI_LoadScript().
◆ Parse_Footer()
◆ Parse_If()
Definition at line 606 of file script.c.
609 Com_Printf(
"Usage: %s <cvar> <value>]\n",
Cmd_Argv(0));
615 Com_Printf(
"Nested ifeq or ifneq are not supported\n");
Referenced by Parse_File().
◆ Parse_Pairs()
Definition at line 96 of file script.c.
113 if (numItems < 2 || (numItems & 1)) {
114 Com_Printf(
"Usage: %s <name> <cvar> <desc1> <value1> [...]\n",
Cmd_Argv(0));
126 s->itemnames =
UI_Mallocz(
sizeof(
char *) * (numItems + 1));
127 s->itemvalues =
UI_Mallocz(
sizeof(
char *) * (numItems + 1));
128 for (i = 0; i < numItems; i++) {
132 s->numItems = numItems;
Referenced by Parse_File().
◆ Parse_Plaque()
◆ Parse_Range()
Definition at line 143 of file script.c.
148 qboolean percentage = qfalse;
168 Com_Printf(
"Usage: %s <name> <cvar> <min> <max> [step]\n",
Cmd_Argv(0));
187 s->percentage = percentage;
Referenced by Parse_File().
◆ Parse_Savegame()
Definition at line 324 of file script.c.
341 Com_Printf(
"Usage: %s <dir>\n",
Cmd_Argv(0));
348 a->generic.type = type;
351 a->generic.uiFlags = UI_CENTER;
Referenced by Parse_File().
◆ Parse_Spin()
Definition at line 58 of file script.c.
76 Com_Printf(
"Usage: %s <name> <cvar> <desc1> [...]\n",
Cmd_Argv(0));
83 s->generic.type = type;
87 s->itemnames =
UI_Mallocz(
sizeof(
char *) * (numItems + 1));
88 for (i = 0; i < numItems; i++) {
91 s->numItems = numItems;
Referenced by Parse_File().
◆ Parse_Style()
Definition at line 493 of file script.c.
495 static const cmd_option_t o_style[] = {
497 {
"C",
"no-compact" },
498 {
"t",
"transparent" },
499 {
"T",
"no-transparent" },
Referenced by Parse_File().
◆ Parse_Toggle()
Definition at line 361 of file script.c.
363 static const char *yes_no_names[] = {
"no",
"yes", NULL };
365 qboolean negate = qfalse;
368 char *b, *status = NULL;
381 Com_Printf(
"Usage: %s <name> <cvar> [~][bit]\n",
Cmd_Argv(0));
392 if (bit < 0 || bit >= 32) {
393 Com_Printf(
"Invalid bit number: %d\n", bit);
402 s->generic.type = type;
406 s->itemnames = (
char **)yes_no_names;
Referenced by Parse_File().
◆ UI_LoadScript()
◆ o_common
const cmd_option_t o_common[] |
|
static |
◆ o_range
const cmd_option_t o_range[] |
|
static |
Initial value:= {
{ "s:", "status" },
{ "f:", "format" },
{ "p", "percentage" },
{ NULL }
}
Definition at line 137 of file script.c.
Referenced by Parse_Range().
static void Parse_Toggle(menuFrameWork_t *menu)
static void Parse_Field(menuFrameWork_t *menu)
static void Parse_If(menuFrameWork_t *menu, qboolean equals)
static void Parse_Bitmap(menuFrameWork_t *menu)
const char * Q_ErrorString(qerror_t error)
static const cmd_option_t o_common[]
static void Parse_Pairs(menuFrameWork_t *menu)
void Cmd_TokenizeString(const char *text, qboolean macroExpand)
char * Cmd_ArgsFrom(int from)
static void Parse_Footer(menuFrameWork_t *menu)
static void Parse_Banner(menuFrameWork_t *menu)
int Cmd_ParseOptions(const cmd_option_t *opt)
void Cbuf_AddText(cmdbuf_t *buf, const char *text)
char * va(const char *format,...)
static void Parse_Bind(menuFrameWork_t *menu)
static void Parse_Spin(menuFrameWork_t *menu, menuType_t type)
static void Parse_Action(menuFrameWork_t *menu)
static void Parse_Color(void)
size_t COM_Compress(char *data)
static void Parse_Plaque(menuFrameWork_t *menu)
cvar_t * Cvar_WeakGet(const char *var_name)
static void Parse_Range(menuFrameWork_t *menu)
struct uiStatic_s::@9 color
qboolean R_GetPicSize(int *w, int *h, qhandle_t pic)
static menuSound_t Activate(menuCommon_t *self)
static void Parse_Savegame(menuFrameWork_t *menu, menuType_t type)
static const cmd_option_t o_range[]
static void Parse_Style(menuFrameWork_t *menu)
size_t Cmd_ArgvBuffer(int arg, char *buffer, size_t size)
menuFrameWork_t * UI_FindMenu(const char *name)
qhandle_t backgroundHandle
static qboolean Parse_File(const char *path, int depth)
qboolean SCR_ParseColor(const char *s, color_t *color)
CONST PIXELFORMATDESCRIPTOR int
static void Parse_Blank(menuFrameWork_t *menu)
static void Parse_Background(menuFrameWork_t *menu)