47 Com_Error(ERR_FATAL,
"Action_Init: NULL a->generic.name");
108 Com_Error(ERR_FATAL,
"Static_Init: NULL s->generic.name");
199 Com_Error(ERR_FATAL,
"Keybind_Init: NULL k->generic.name");
228 char string[MAX_STRING_CHARS];
253 strcpy(
string,
"???");
288 for (i = 0; i < menu->
nitems; i++) {
301 for (key = 0; ; key++) {
322 if (key != K_ESCAPE) {
357 if (key == K_BACKSPACE || key == K_DEL) {
400 int w = f->
width * CHAR_WIDTH;
430 flags |= UI_DRAWCURSOR;
439 f->
field.visibleChars * CHAR_WIDTH, CHAR_HEIGHT + 2,
color);
455 return Q_isdigit(key) || key ==
'+' || key ==
'-' || key ==
'.';
458 return Q_isprint(key);
468 if (IF_KeyEvent(&f->
field, key)) {
492 ret = IF_CharEvent(&f->
field, key);
510 int val = s->
cvar->integer;
546 int maxLength, length;
562 if (maxLength < length) {
570 maxLength * CHAR_WIDTH;
667 int val = s->
cvar->integer;
765 int val = s->
cvar->integer;
767 if (val == 0 || val == 1)
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++) {
1113 if (key > 32 && key < 127) {
1133 for (i = 0; i < l->
numItems; i++) {
1173 case K_KP_DOWNARROW:
1277 int y, h, barHeight;
1291 if (barHeight > 0) {
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) {
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++) {
1484 qsort(l->
items + offset, l->
numItems - offset,
sizeof(
char *), cmpfunc);
1486 for (i = 0; i < l->
numItems; i++) {
1487 if (l->
items[i] == n) {
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;
1594 steps = Q_rint(value / s->
step);
1677 display_value *= 100.f;
1681 snprintf(sbuf,
sizeof(sbuf), s->
format, display_value);
1683 snprintf(sbuf,
sizeof(sbuf),
"%.1f", display_value);
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");
1788 Com_Error(ERR_FATAL,
"Menu_AddItem: too many items");
1798 mins[0] = mins[1] = 9999;
1799 maxs[0] = maxs[1] = -9999;
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;
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;
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];
2047 for (i = 0; i <
m->nitems; i++) {
2069 for (i = 0; i < menu->
nitems; i++) {
2072 if (item == focus) {
2075 item->
focus(item, qtrue);
2076 }
else if (item->
status) {
2082 item->
focus(item, qfalse);
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);
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;
2217 UI_CENTER | UI_ALTCOLOR, menu->
title);
2239 for (i = 0; i < menu->
nitems; i++) {
2240 item = menu->
items[i];
2281 Com_Error(ERR_FATAL,
"Menu_Draw: unknown item type");
2306 switch (item->
type) {
2338 switch (item->
type) {
2362 switch (item->
type) {
2378 switch (item->
type) {
2388 switch (item->
type) {
2413 case K_KP_DOWNARROW:
2419 case K_KP_LEFTARROW:
2425 case K_KP_RIGHTARROW:
2461 sound = menu->
keydown(menu, key);
2489 for (i = 0; i < menu->
nitems; i++) {
2490 item = menu->
items[i];
2508 for (i = 0; i < menu->
nitems; i++) {
2509 item = menu->
items[i];
2552 for (i = 0; i < menu->
nitems; i++) {
2553 item = menu->
items[i];
2591 for (i = 0; i < menu->
nitems; i++) {
2592 item = menu->
items[i];