6 ///////////////////////////////////////////////
8 ///////////////////////
9 // This file belongs to dpmod/darkplaces
10 // AK contains all menu functions (especially the required ones)
11 ///////////////////////////////////////////////
13 float mouseButtonsPressed;
20 float menuInitialized;
21 float menuNotTheFirstFrame;
24 float conwidth_s, conheight_s, vidwidth_s, vidheight_s, vidpixelheight_s,
25 realconwidth, realconheight;
30 vidwidth_s = vidheight_s = vidpixelheight_s = 0; // Force updateConwidths on next draw.
39 gamestatus = gamestatus | GAME_ISSERVER;
40 if(clientstate() == CS_CONNECTED || isdemo())
41 gamestatus = gamestatus | GAME_CONNECTED;
43 gamestatus = gamestatus | GAME_DEVELOPER;
49 cvar_set("_menu_alpha", "0");
50 prvm_language = cvar_string("prvm_language");
51 if(prvm_language == "")
54 cvar_set("prvm_language", prvm_language);
55 localcmd("\nmenu_restart\n");
58 prvm_language = strzone(prvm_language);
59 cvar_set("_menu_prvm_language", prvm_language);
62 dprintf("^4MQC Build information: ^1%s\n", WATERMARK);
65 // list all game dirs (TEST)
72 s = getgamedirinfo(i, GETGAMEDIRINFO_NAME);
75 dprint(s, ": ", getgamedirinfo(i, GETGAMEDIRINFO_DESCRIPTION));
79 // needs to be done so early because of the constants they create
80 CALL_ACCUMULATED_FUNCTION(RegisterWeapons);
81 CALL_ACCUMULATED_FUNCTION(RegisterGametypes);
83 RegisterSLCategories();
85 float ddsload = cvar("r_texture_dds_load");
86 float texcomp = cvar("gl_texturecompression");
88 if(ddsload != cvar("r_texture_dds_load") || texcomp != cvar("gl_texturecompression"))
89 localcmd("\nr_restart\n");
93 if(cvar("_menu_initialized")) // always show menu after menu_restart
97 cvar_set("_menu_initialized", "1");
102 const float MENU_ASPECT = 1.25; // 1280x1024
104 void draw_reset_cropped()
106 draw_reset(conwidth, conheight, 0.5 * (realconwidth - conwidth), 0.5 * (realconheight - conheight));
108 void draw_reset_full()
110 draw_reset(realconwidth, realconheight, 0, 0);
113 void UpdateConWidthHeight(float w, float h, float p)
115 if (w != vidwidth_s || h != vidheight_s || p != vidpixelheight_s)
117 if (updateConwidths(w, h, p))
118 localcmd(sprintf("\nexec %s\n", cvar_string("menu_font_cfg")));
121 vidpixelheight_s = p;
123 conwidth_s = conwidth;
124 conheight_s = conheight;
125 realconwidth = cvar("vid_conwidth");
126 realconheight = cvar("vid_conheight");
127 if(realconwidth / realconheight > MENU_ASPECT)
130 conwidth = realconheight * MENU_ASPECT;
131 conheight = realconheight;
136 conwidth = realconwidth;
137 conheight = realconwidth / MENU_ASPECT;
141 if(conwidth_s != conwidth || conheight_s != conheight)
143 draw_reset_cropped();
144 main.resizeNotify(main, '0 0 0', eX * conwidth + eY * conheight, '0 0 0', eX * conwidth + eY * conheight);
149 vidwidth_s = vidheight_s = vidpixelheight_s = 0; // retry next frame
153 string m_goto_buffer;
154 void m_init_delayed()
156 float fh, glob, n, i;
159 draw_reset_cropped();
167 if(cvar_string("menu_skin") != "")
169 draw_currentSkin = strcat("gfx/menu/", cvar_string("menu_skin"));
170 fh = fopen(language_filename(strcat(draw_currentSkin, "/skinvalues.txt")), FILE_READ);
173 if(cvar_defstring("menu_skin") != "")
175 cvar_set("menu_skin", cvar_defstring("menu_skin"));
176 draw_currentSkin = strcat("gfx/menu/", cvar_string("menu_skin"));
177 fh = fopen(language_filename(strcat(draw_currentSkin, "/skinvalues.txt")), FILE_READ);
181 draw_currentSkin = "gfx/menu/default";
182 fh = fopen(language_filename(strcat(draw_currentSkin, "/skinvalues.txt")), FILE_READ);
186 error("cannot load any menu skin\n");
188 draw_currentSkin = strzone(draw_currentSkin);
189 while((s = fgets(fh)))
191 // these two are handled by skinlist.qc
192 if(substring(s, 0, 6) == "title ")
194 if(substring(s, 0, 7) == "author ")
196 n = tokenize_console(s);
198 Skin_ApplySetting(argv(0), substring(s, argv_start_index(1), argv_end_index(-1) - argv_start_index(1)));
202 glob = search_begin(strcat(draw_currentSkin, "/*.tga"), true, true);
205 n = search_getsize(glob);
206 for(i = 0; i < n; ++i)
207 precache_pic(search_getfilename(glob, i));
211 draw_setMousePointer(SKINGFX_CURSOR, SKINSIZE_CURSOR, SKINOFFSET_CURSOR);
214 anim = spawnAnimHost();
215 main = spawnMainWindow(); main.configureMainWindow(main);
218 main.resizeNotify(main, '0 0 0', eX * conwidth + eY * conheight, '0 0 0', eX * conwidth + eY * conheight);
221 menuMousePos = '0.5 0.5 0';
227 m_goto(m_goto_buffer);
228 strunzone(m_goto_buffer);
229 m_goto_buffer = string_null;
233 m_display(); // delayed menu display
236 void m_keyup (float key, float ascii)
242 draw_reset_cropped();
243 main.keyUp(main, key, ascii, menuShiftState);
244 if(key >= K_MOUSE1 && key <= K_MOUSE3)
246 --mouseButtonsPressed;
247 if(!mouseButtonsPressed)
248 main.mouseRelease(main, menuMousePos);
249 if(mouseButtonsPressed < 0)
251 mouseButtonsPressed = 0;
252 dprint("Warning: released an already released button\n");
255 if(key == K_ALT) menuShiftState -= (menuShiftState & S_ALT);
256 if(key == K_CTRL) menuShiftState -= (menuShiftState & S_CTRL);
257 if(key == K_SHIFT) menuShiftState -= (menuShiftState & S_SHIFT);
260 void m_keydown(float key, float ascii)
268 if(key >= K_MOUSE1 && key <= K_MOUSE3)
270 // detect a click outside of the game window
271 vector p = getmousepos();
272 if(p.x < 0 || p.x > realconwidth || p.y < 0 || p.y > realconheight)
274 ++mouseButtonsPressed;
284 e.keyGrabbed(e, key, ascii);
288 draw_reset_cropped();
289 if(key >= K_MOUSE1 && key <= K_MOUSE3)
290 if(!mouseButtonsPressed)
291 main.mousePress(main, menuMousePos);
292 if(!main.keyDown(main, key, ascii, menuShiftState))
294 if(gamestatus & (GAME_ISSERVER | GAME_CONNECTED)) // don't back out to console only
295 m_hide(); // disable menu on unhandled ESC
297 if(key >= K_MOUSE1 && key <= K_MOUSE3)
299 ++mouseButtonsPressed;
300 if(mouseButtonsPressed > 10)
302 mouseButtonsPressed = 10;
303 dprint("Warning: pressed an already pressed button\n");
306 if(key == K_ALT) menuShiftState |= S_ALT;
307 if(key == K_CTRL) menuShiftState |= S_CTRL;
308 if(key == K_SHIFT) menuShiftState |= S_SHIFT;
311 const float SCALEMODE_CROP = 0;
312 const float SCALEMODE_LETTERBOX = 1;
313 const float SCALEMODE_WIDTH = 2;
314 const float SCALEMODE_HEIGHT = 3;
315 const float SCALEMODE_STRETCH = 4;
316 void draw_Picture_Aligned(vector algn, float scalemode, string img, float a)
318 vector sz, org, isz, isz_w, isz_h;
319 float width_is_larger;
321 sz = draw_PictureSize(img);
322 width_is_larger = (sz.x * draw_scale.y >= sz.y * draw_scale.x);
323 isz_w = '1 0 0' + '0 1 0' * ((sz.y / sz.x) * (draw_scale.x / draw_scale.y));
324 isz_h = '0 1 0' + '1 0 0' * ((sz.x / sz.y) * (draw_scale.y / draw_scale.x));
330 isz = (width_is_larger ? isz_h : isz_w);
332 case SCALEMODE_LETTERBOX:
333 isz = (width_is_larger ? isz_w : isz_h);
335 case SCALEMODE_WIDTH:
338 case SCALEMODE_HEIGHT:
341 case SCALEMODE_STRETCH:
346 org = eX * (algn.x * (1 - isz.x)) + eY * (algn.y * (1 - isz.y));
347 draw_Picture(org, img, isz, '1 1 1', a);
350 void drawBackground(string img, float a, string algn, float force1)
352 if(main.mainNexposee.ModalController_state == 0)
362 scalemode = SCALEMODE_CROP;
365 for(i = 0; i < strlen(algn); ++i)
367 c = substring(algn, i, 1);
370 case "c": scalemode = SCALEMODE_CROP; goto nopic;
371 case "l": scalemode = SCALEMODE_LETTERBOX; goto nopic;
372 case "h": scalemode = SCALEMODE_HEIGHT; goto nopic;
373 case "w": scalemode = SCALEMODE_WIDTH; goto nopic;
374 case "s": scalemode = SCALEMODE_STRETCH; goto nopic;
375 case "1": case "4": case "7": v.x = 0.0; break;
376 case "2": case "5": case "8": v.x = 0.5; break;
377 case "3": case "6": case "9": v.x = 1.0; break;
378 default: v.x = random(); break;
382 case "7": case "8": case "9": v.y = 0.0; break;
383 case "4": case "5": case "6": v.y = 0.5; break;
384 case "1": case "2": case "3": v.y = 1.0; break;
385 default: v.y = random(); break;
388 draw_Picture_Aligned(v, scalemode, img, a);
390 // force all secondary layers to use alpha 1. Prevents ugly issues
391 // with overlap. It's a flag because it cannot be used for the
393 draw_Picture_Aligned(v, scalemode, strcat(img, "_l", ftos(l+1)), 1);
395 draw_Picture_Aligned(v, scalemode, strcat(img, "_l", ftos(l+1)), a);
402 float menu_tooltips_old;
403 vector menuTooltipAveragedMousePos;
404 entity menuTooltipItem;
405 vector menuTooltipOrigin;
406 vector menuTooltipSize;
407 float menuTooltipAlpha;
408 string menuTooltipText;
409 float menuTooltipState; // 0: static, 1: fading in, 2: fading out
410 float m_testmousetooltipbox(vector pos)
412 if(pos.x >= menuTooltipOrigin.x && pos.x < menuTooltipOrigin.x + menuTooltipSize.x)
413 if(pos.y >= menuTooltipOrigin.y && pos.y < menuTooltipOrigin.y + menuTooltipSize.y)
417 float m_testtooltipbox(vector tooltippos)
423 if(tooltippos.x + menuTooltipSize.x > 1)
425 if(tooltippos.y + menuTooltipSize.y > 1)
427 menuTooltipOrigin = tooltippos;
430 float m_allocatetooltipbox(vector pos)
432 vector avoidplus, avoidminus;
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;
439 avoidminus.x = (SKINAVOID_TOOLTIP_x + SKINOFFSET_CURSOR_x * SKINSIZE_CURSOR_x) / conwidth + menuTooltipSize.x;
440 avoidminus.y = (SKINAVOID_TOOLTIP_y + SKINOFFSET_CURSOR_y * SKINSIZE_CURSOR_y) / conheight + menuTooltipSize.y;
445 if(m_testtooltipbox(v))
449 v.x = pos.x - menuTooltipSize.x * 0.5;
450 if(m_testtooltipbox(v))
454 v.x = pos.x - avoidminus.x;
455 if(m_testtooltipbox(v))
459 v.y = pos.y - avoidminus.y;
460 if(m_testtooltipbox(v))
464 v.x = pos.x - menuTooltipSize.x * 0.5;
465 if(m_testtooltipbox(v))
469 v.x = pos.x + avoidplus.x;
470 if(m_testtooltipbox(v))
475 entity m_findtooltipitem(entity root, vector pos)
483 while(it.instanceOfContainer)
485 while(it.instanceOfNexposee && it.focusedChild)
487 it = it.focusedChild;
488 pos = globalToBox(pos, it.Container_origin, it.Container_size);
490 if(it.instanceOfNexposee)
492 it = it.itemFromPoint(it, pos);
495 else if(menu_tooltips == 2 && (it.cvarName || it.onClickCommand))
499 else if(it.instanceOfModalController)
500 it = it.focusedChild;
502 it = it.itemFromPoint(it, pos);
507 else if(menu_tooltips == 2 && (it.cvarName || it.onClickCommand))
509 pos = globalToBox(pos, it.Container_origin, it.Container_size);
516 if (menu_tooltips == 2)
519 if (menuTooltipItem.cvarName)
521 if (getCvarsMulti(menuTooltipItem))
522 s = strcat("[", menuTooltipItem.cvarName, " ", getCvarsMulti(menuTooltipItem), "]");
524 s = strcat("[", menuTooltipItem.cvarName, "]");
526 else if (menuTooltipItem.onClickCommand)
527 s = strcat("<", menuTooltipItem.onClickCommand, ">");
529 return menuTooltipItem.tooltip;
530 if (menuTooltipItem.tooltip)
531 return strcat(menuTooltipItem.tooltip, " ", s);
534 return menuTooltipItem.tooltip;
536 void m_tooltip(vector pos)
543 menu_tooltips = cvar("menu_tooltips");
546 // don't return immediately, fade out the active tooltip first
547 if (menuTooltipItem == world)
550 menu_tooltips_old = menu_tooltips;
554 f = bound(0, frametime * 2, 1);
555 menuTooltipAveragedMousePos = menuTooltipAveragedMousePos * (1 - f) + pos * f;
556 f = vlen(pos - menuTooltipAveragedMousePos);
558 it = m_findtooltipitem(main, pos);
562 fontsize = '1 0 0' * (SKINFONTSIZE_TOOLTIP / conwidth) + '0 1 0' * (SKINFONTSIZE_TOOLTIP / conheight);
564 // float menuTooltipState; // 0: static, 1: fading in, 2: fading out
565 if(it != menuTooltipItem)
567 switch(menuTooltipState)
572 // another item: fade out first
573 menuTooltipState = 2;
578 menuTooltipState = 1;
579 menuTooltipItem = it;
581 menuTooltipOrigin.x = -1; // unallocated
584 strunzone(menuTooltipText);
585 menuTooltipText = strzone(gettooltip());
589 getWrappedLine_remaining = menuTooltipText;
590 while(getWrappedLine_remaining)
592 s = getWrappedLine(SKINWIDTH_TOOLTIP, fontsize, draw_TextWidth_WithoutColors);
594 f = draw_TextWidth(s, false, fontsize);
598 menuTooltipSize.x = w + 2 * (SKINMARGIN_TOOLTIP_x / conwidth);
599 menuTooltipSize.y = i * fontsize.y + 2 * (SKINMARGIN_TOOLTIP_y / conheight);
600 menuTooltipSize.z = 0;
604 // changing item while fading in: fade out first
605 menuTooltipState = 2;
608 // changing item while fading out: can't
612 else if(menuTooltipState == 2) // re-fade in?
613 menuTooltipState = 1;
616 if(!m_testmousetooltipbox(pos))
617 menuTooltipState = 2; // fade out if mouse touches it
619 switch(menuTooltipState)
622 menuTooltipAlpha = bound(0, menuTooltipAlpha + 5 * frametime, 1);
623 if(menuTooltipAlpha == 1)
624 menuTooltipState = 0;
627 menuTooltipAlpha = bound(0, menuTooltipAlpha - 2 * frametime, 1);
628 if(menuTooltipAlpha == 0)
630 menuTooltipState = 0;
631 menuTooltipItem = world;
636 if(menuTooltipItem == world)
640 strunzone(menuTooltipText);
641 menuTooltipText = string_null;
647 if(menu_tooltips != menu_tooltips_old)
649 if (menu_tooltips != 0 && menu_tooltips_old != 0)
650 menuTooltipItem = world; // reload tooltip next frame
651 menu_tooltips_old = menu_tooltips;
653 else if(menuTooltipOrigin.x < 0) // unallocated?
654 m_allocatetooltipbox(pos);
656 if(menuTooltipOrigin.x >= 0)
659 p = SKINBORDER_TOOLTIP;
661 p.y *= 1 / conheight;
662 draw_BorderPicture(menuTooltipOrigin, SKINGFX_TOOLTIP, menuTooltipSize, '1 1 1', menuTooltipAlpha, p);
663 p = menuTooltipOrigin;
664 p.x += SKINMARGIN_TOOLTIP_x / conwidth;
665 p.y += SKINMARGIN_TOOLTIP_y / conheight;
666 getWrappedLine_remaining = menuTooltipText;
667 while(getWrappedLine_remaining)
669 s = getWrappedLine(SKINWIDTH_TOOLTIP, fontsize, draw_TextWidth_WithoutColors);
670 draw_Text(p, s, fontsize, SKINCOLOR_TOOLTIP, SKINALPHA_TOOLTIP * menuTooltipAlpha, false);
677 void m_draw(float width, float height)
684 execute_next_frame();
686 menuMouseMode = cvar("menu_mouse_absolute");
691 UpdateConWidthHeight(width, height, cvar("vid_pixelheight"));
695 // TODO draw an info image about this situation
699 if(!menuNotTheFirstFrame)
701 menuNotTheFirstFrame = 1;
703 if(!cvar("menu_video_played"))
705 localcmd("cd loop $menu_cdtrack; play sound/announcer/default/welcome.wav\n");
706 menuLogoAlpha = -0.8; // no idea why, but when I start this at zero, it jumps instead of fading FIXME
708 // ALWAYS set this cvar; if we start but menu is not active, this means we want no background music!
709 localcmd("set menu_video_played 1\n");
713 realFrametime = frametime = min(0.2, t - menuPrevTime);
717 t = cvar("menu_slowmo");
728 if(getmousetarget() == (menuMouseMode ? MT_CLIENT : MT_MENU) && (getkeydest() == KEY_MENU || getkeydest() == KEY_MENU_GRABBED))
729 setkeydest(keyGrabber ? KEY_MENU_GRABBED : KEY_MENU);
734 if(cvar("cl_capturevideo"))
735 frametime = t / cvar("cl_capturevideo_fps"); // make capturevideo work smoothly
737 prevMenuAlpha = menuAlpha;
740 if(menuAlpha == 0 && menuLogoAlpha < 2)
742 menuLogoAlpha = menuLogoAlpha + frametime * 2;
746 menuAlpha = min(1, menuAlpha + frametime * 5);
752 menuAlpha = max(0, menuAlpha - frametime * 5);
756 draw_reset_cropped();
758 if(!(gamestatus & (GAME_CONNECTED | GAME_ISSERVER)))
760 if(menuLogoAlpha > 0)
763 draw_Fill('0 0 0', '1 1 0', SKINCOLOR_BACKGROUND, 1);
764 drawBackground(SKINGFX_BACKGROUND, bound(0, menuLogoAlpha, 1), SKINALIGN_BACKGROUND, true);
765 draw_reset_cropped();
766 if(menuAlpha <= 0 && SKINALPHA_CURSOR_INTRO > 0)
768 draw_alpha = SKINALPHA_CURSOR_INTRO * bound(0, menuLogoAlpha, 1);
769 draw_drawMousePointer(menuMousePos);
774 else if(SKINALPHA_BACKGROUND_INGAME)
779 drawBackground(SKINGFX_BACKGROUND_INGAME, menuAlpha * SKINALPHA_BACKGROUND_INGAME, SKINALIGN_BACKGROUND_INGAME, false);
780 draw_reset_cropped();
784 if(menuAlpha != prevMenuAlpha)
785 cvar_set("_menu_alpha", ftos(menuAlpha));
787 draw_reset_cropped();
789 draw_reset_cropped();
793 if(prevMenuAlpha > 0)
794 main.initializeDialog(main, main.firstChild);
795 draw_reset_cropped();
800 draw_alpha *= menuAlpha;
804 // do not update mouse position
805 // it prevents mouse jumping to '0 0 0' when menu is fading out
807 else if(menuMouseMode)
810 newMouse = globalToBox(getmousepos(), draw_shift, draw_scale);
811 if(newMouse != '0 0 0')
812 if(newMouse != menuMousePos)
814 menuMousePos = newMouse;
815 if(mouseButtonsPressed)
816 main.mouseDrag(main, menuMousePos);
818 main.mouseMove(main, menuMousePos);
825 vector dMouse, minpos, maxpos;
826 dMouse = getmousepos() * (frametime / realFrametime); // for capturevideo
827 if(dMouse != '0 0 0')
829 minpos = globalToBox('0 0 0', draw_shift, draw_scale);
830 maxpos = globalToBox(eX * (realconwidth - 1) + eY * (realconheight - 1), draw_shift, draw_scale);
831 dMouse = globalToBoxSize(dMouse, draw_scale);
832 menuMousePos += dMouse * cvar("menu_mouse_speed");
833 menuMousePos.x = bound(minpos.x, menuMousePos.x, maxpos.x);
834 menuMousePos.y = bound(minpos.y, menuMousePos.y, maxpos.y);
835 if(mouseButtonsPressed)
836 main.mouseDrag(main, menuMousePos);
838 main.mouseMove(main, menuMousePos);
844 m_tooltip(menuMousePos);
846 draw_alpha = max(draw_alpha, SKINALPHA_CURSOR_INTRO * bound(0, menuLogoAlpha, 1));
848 draw_drawMousePointer(menuMousePos);
850 draw_reset_cropped();
859 setkeydest(KEY_MENU);
860 setmousetarget((menuMouseMode ? MT_CLIENT : MT_MENU));
865 if(mouseButtonsPressed)
866 main.mouseRelease(main, menuMousePos);
867 mouseButtonsPressed = 0;
869 main.focusEnter(main);
870 main.showNotify(main);
876 setkeydest(KEY_GAME);
877 setmousetarget(MT_CLIENT);
882 main.focusLeave(main);
883 main.hideNotify(main);
886 void m_toggle(float mode)
907 for(e = NULL; (e = nextent(e)) != NULL; )
909 if(e.classname != "vtbl")
915 void m_focus_item_chain(entity outermost, entity innermost)
917 if(innermost.parent != outermost)
918 m_focus_item_chain(outermost, innermost.parent);
919 innermost.parent.setFocus(innermost.parent, innermost);
922 void m_activate_window(entity wnd)
927 m_activate_window(par);
929 if(par.instanceOfModalController)
931 if(wnd.tabSelectingButton)
933 TabButton_Click(wnd.tabSelectingButton, wnd);
936 par.initializeDialog(par, wnd);
938 else if(par.instanceOfNexposee)
940 // nexposee (sorry for violating abstraction here)
941 par.selectedChild = wnd;
942 par.animationState = 1;
943 Container_setFocus(par, NULL);
945 else if(par.instanceOfContainer)
949 par.setFocus(par, wnd);
953 void m_setpointerfocus(entity wnd)
955 if(wnd.instanceOfContainer)
957 entity focus = wnd.preferredFocusedGrandChild(wnd);
960 menuMousePos = focus.origin + 0.5 * focus.size;
961 menuMousePos.x *= 1 / conwidth;
962 menuMousePos.y *= 1 / conheight;
963 if(wnd.focused) // why does this never happen?
964 m_focus_item_chain(wnd, focus);
969 void m_goto(string itemname)
975 strunzone(m_goto_buffer);
976 m_goto_buffer = strzone(itemname);
979 if(itemname == "") // this can be called by GameCommand
981 if(gamestatus & (GAME_ISSERVER | GAME_CONNECTED))
987 m_activate_window(main.mainNexposee);
993 for(e = NULL; (e = find(e, name, itemname)); )
994 if(e.classname != "vtbl")
997 if((e) && (!e.requiresConnection || (gamestatus & (GAME_ISSERVER | GAME_CONNECTED))))
1000 m_activate_window(e);
1001 m_setpointerfocus(e);
1007 float menuLastFocusSoundTime;
1008 void m_play_focus_sound()
1010 if(cvar("menu_sounds") > 1)
1011 if(time - menuLastFocusSoundTime > 0.25)
1013 localsound(MENU_SOUND_FOCUS);
1014 menuLastFocusSoundTime = time;
1018 void m_play_click_sound(string soundfile)
1020 if(cvar("menu_sounds"))
1021 localsound(soundfile);