Quake II RTX doxygen
1.0 dev
|
|
Go to the documentation of this file.
21 #include "common/files.h"
47 #define CHECK_NITEMS \
48 if (menu->nitems >= MAXMENUITEMS) { \
49 Com_Printf("Too many items\n"); \
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;
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;
140 {
"p",
"percentage" },
148 qboolean percentage = qfalse;
168 Com_Printf(
"Usage: %s <name> <cvar> <min> <max> [step]\n",
Cmd_Argv(0));
187 s->percentage = percentage;
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;
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);
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;
341 Com_Printf(
"Usage: %s <dir>\n",
Cmd_Argv(0));
348 a->generic.type = type;
351 a->generic.uiFlags = UI_CENTER;
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;
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;
488 menu->
image = R_RegisterPic(s);
495 static const cmd_option_t o_style[] = {
497 {
"C",
"no-compact" },
498 {
"t",
"transparent" },
499 {
"T",
"no-transparent" },
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);
552 Com_Printf(
"Usage: %s <plaque> [logo]\n",
Cmd_Argv(0));
574 Com_Printf(
"Usage: %s <banner>\n",
Cmd_Argv(0));
588 Com_Printf(
"Usage: %s <footer>\n",
Cmd_Argv(0));
609 Com_Printf(
"Usage: %s <cvar> <value>]\n",
Cmd_Argv(0));
615 Com_Printf(
"Nested ifeq or ifneq are not supported\n");
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");
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)