58 bool restarting =
false;
72 LOG_TRACEF(
"^4MQC Build information: ^1%s", WATERMARK);
76 if (
cvar(
"developer") > 0)
78 for (
int i = 0; ; ++i)
93 float ddsload =
cvar(
"r_texture_dds_load");
94 float texcomp =
cvar(
"gl_texturecompression");
96 if (ddsload !=
cvar(
"r_texture_dds_load") || texcomp !=
cvar(
"gl_texturecompression"))
localcmd(
"\nr_restart\n");
100 if (
cvar(
"_menu_initialized"))
183 if (fh < 0)
error(
"cannot load any menu skin\n");
185 for (
string s; (s =
fgets(fh)); )
188 if (
substring(s, 0, 6) ==
"title ")
continue;
189 if (
substring(s, 0, 7) ==
"author ")
continue;
239 LOG_TRACE(
"Warning: released an already released button");
267 e.keyGrabbed(e, key, ascii);
288 LOG_TRACE(
"Warning: pressed an already pressed button");
314 isz = (width_is_larger ? isz_h : isz_w);
317 isz = (width_is_larger ? isz_w : isz_h);
329 vector org =
eX * (algn.x * (1 - isz.x)) +
eY * (algn.y * (1 - isz.y));
335 if (
main.mainNexposee.ModalController_state == 0)
return;
339 for (
int i = 0, l = 0; i < len; ++i)
359 case "1":
case "4":
case "7":
362 case "2":
case "5":
case "8":
365 case "3":
case "6":
case "9":
374 case "7":
case "8":
case "9":
377 case "4":
case "5":
case "6":
380 case "1":
case "2":
case "3":
425 if (tooltippos.x < 0)
return false;
426 if (tooltippos.y < 0)
return false;
435 avoidplus.x = (SKINAVOID_TOOLTIP_x + SKINSIZE_CURSOR_x - SKINOFFSET_CURSOR_x * SKINSIZE_CURSOR_x) /
conwidth;
436 avoidplus.y = (SKINAVOID_TOOLTIP_y + SKINSIZE_CURSOR_y - SKINOFFSET_CURSOR_y * SKINSIZE_CURSOR_y) /
conheight;
453 v.x = pos.x - avoidminus.x;
457 v.y = pos.y - avoidminus.y;
465 v.x = pos.x + avoidplus.x;
473 for (
entity it = root; it.instanceOfContainer; )
475 while (it.instanceOfNexposee && it.focusedChild)
477 it = it.focusedChild;
478 pos =
globalToBox(pos, it.Container_origin, it.Container_size);
480 if (it.instanceOfNexposee)
482 it = it.itemFromPoint(it, pos);
483 if (it.tooltip) best = it;
484 else if (
menu_tooltips == 2 && (it.controlledCvar || it.onClickCommand)) best = it;
487 else if (it.instanceOfModalController)
489 it = it.focusedChild;
493 it = it.itemFromPoint(it, pos);
496 if (it.tooltip) best = it;
497 else if (
menu_tooltips == 2 && (it.controlledCvar || it.onClickCommand)) best = it;
498 pos =
globalToBox(pos, it.Container_origin, it.Container_size);
532 static string prev_tooltip;
550 if (it.instanceOfListBox && it.isScrolling(it)) it =
NULL;
552 if (it && prev_tooltip != it.tooltip)
556 strcpy(prev_tooltip, it.tooltip);
656 vector p = SKINBORDER_TOOLTIP;
661 p.x += SKINMARGIN_TOOLTIP_x /
conwidth;
680 static float connected_time;
690 connected_time =
time;
714 localcmd(
"cd loop $menu_cdtrack\n");
720 localcmd(
"set menu_video_played 1\n");
728 t =
cvar(
"menu_slowmo");
775 draw_Fill(
'0 0 0',
'1 1 0', SKINCOLOR_BACKGROUND, 1);
778 if (menuAlpha <= 0 && SKINALPHA_CURSOR_INTRO > 0)
786 else if (SKINALPHA_BACKGROUND_INGAME)
792 SKINALIGN_BACKGROUND_INGAME,
false);
827 if (dMouse !=
'0 0 0')
885 if (mode == 1)
return;
890 if (mode == 0)
return;
899 if (it.classname ==
"vtbl") continue;
907 innermost.parent.setFocus(innermost.parent, innermost);
915 if (par.instanceOfModalController)
917 if (wnd.tabSelectingButton)
922 par.initializeDialog(par, wnd);
924 else if (par.instanceOfNexposee)
927 par.selectedChild = wnd;
928 par.animationState = 1;
931 else if (par.instanceOfContainer)
934 if (par.focused) par.setFocus(par, wnd);
940 if (!wnd.instanceOfContainer)
return;
941 entity focus = wnd.preferredFocusedGrandChild(wnd);
947 if (par.focused) par.setFocus(par, wnd);
974 if (e.classname !=
"vtbl")
break;
979 e.hideMenuOnClose =
true;
990 static float menuLastFocusSoundTime;
991 if (
cvar(
"menu_sounds") < 2)
return;
992 if (
time - menuLastFocusSoundTime <= 0.25)
return;
994 menuLastFocusSoundTime =
time;
999 if (!
cvar(
"menu_sounds"))
return;
string getWrappedLine_remaining
void RegisterSLCategories()
#define static_init_precache()
#define FOREACH_ENTITY_ORDERED(cond, body)
void Container_setFocus(entity me, entity other)
ERASEABLE void IL_ENDFRAME()
spree_cen s1 spree_cen s1 spree_cen s1 spree_cen s1 spree_cen s1 spree_cen s1 spree_cen s1 f1 s1 strcat(_("Level %s: "), "^BG%s\3\, _("^BGPress ^F2%s^BG to enter the game"))
vector(float skel, float bonenum) _skel_get_boneabs_hidden
#define vdist(v, cmp, f)
Vector distance comparison, avoids sqrt()
void TabButton_Click(entity button, entity tab)
void execute_next_frame()
string getWrappedLine(float w, vector theFontSize, textLengthUpToWidth_widthFunction_t tw)
#define static_init_late()