1 ///////////////////////////////////////////////
3 ///////////////////////
4 // This file belongs to dpmod/darkplaces
5 // AK contains all menu functions (especially the required ones)
6 ///////////////////////////////////////////////
8 float mouseButtonsPressed;
15 float menuInitialized;
16 float menuNotTheFirstFrame;
19 float conwidth_s, conheight_s, vidwidth_s, vidheight_s, vidpixelheight_s,
20 realconwidth, realconheight;
25 vidwidth_s = vidheight_s = vidpixelheight_s = 0; // Force updateConwidths on next draw.
34 gamestatus = gamestatus | GAME_ISSERVER;
35 if(clientstate() == CS_CONNECTED || isdemo())
36 gamestatus = gamestatus | GAME_CONNECTED;
38 gamestatus = gamestatus | GAME_DEVELOPER;
44 cvar_set("_menu_alpha", "0");
45 prvm_language = cvar_string("prvm_language");
46 if(prvm_language == "")
49 cvar_set("prvm_language", prvm_language);
50 localcmd("\nmenu_restart\n");
53 prvm_language = strzone(prvm_language);
54 cvar_set("_menu_prvm_language", prvm_language);
57 dprintf("^4MQC Build information: ^1%s\n", WATERMARK);
60 // list all game dirs (TEST)
67 s = getgamedirinfo(i, GETGAMEDIRINFO_NAME);
70 dprint(s, ": ", getgamedirinfo(i, GETGAMEDIRINFO_DESCRIPTION));
74 // needs to be done so early because of the constants they create
75 CALL_ACCUMULATED_FUNCTION(RegisterWeapons);
76 CALL_ACCUMULATED_FUNCTION(RegisterGametypes);
78 RegisterSLCategories();
80 float ddsload = cvar("r_texture_dds_load");
81 float texcomp = cvar("gl_texturecompression");
83 if(ddsload != cvar("r_texture_dds_load") || texcomp != cvar("gl_texturecompression"))
84 localcmd("\nr_restart\n");
88 if(cvar("_menu_initialized")) // always show menu after menu_restart
92 cvar_set("_menu_initialized", "1");
97 const float MENU_ASPECT = 1.25; // 1280x1024
99 void draw_reset_cropped()
101 draw_reset(conwidth, conheight, 0.5 * (realconwidth - conwidth), 0.5 * (realconheight - conheight));
103 void draw_reset_full()
105 draw_reset(realconwidth, realconheight, 0, 0);
108 void UpdateConWidthHeight(float w, float h, float p)
110 if (w != vidwidth_s || h != vidheight_s || p != vidpixelheight_s)
112 if (updateConwidths(w, h, p))
113 localcmd(sprintf("\nexec %s\n", cvar_string("menu_font_cfg")));
116 vidpixelheight_s = p;
118 conwidth_s = conwidth;
119 conheight_s = conheight;
120 realconwidth = cvar("vid_conwidth");
121 realconheight = cvar("vid_conheight");
122 if(realconwidth / realconheight > MENU_ASPECT)
125 conwidth = realconheight * MENU_ASPECT;
126 conheight = realconheight;
131 conwidth = realconwidth;
132 conheight = realconwidth / MENU_ASPECT;
136 if(conwidth_s != conwidth || conheight_s != conheight)
138 draw_reset_cropped();
139 main.resizeNotify(main, '0 0 0', eX * conwidth + eY * conheight, '0 0 0', eX * conwidth + eY * conheight);
144 vidwidth_s = vidheight_s = vidpixelheight_s = 0; // retry next frame
148 string m_goto_buffer;
149 void m_init_delayed()
151 float fh, glob, n, i;
154 draw_reset_cropped();
162 if(cvar_string("menu_skin") != "")
164 draw_currentSkin = strcat("gfx/menu/", cvar_string("menu_skin"));
165 fh = fopen(language_filename(strcat(draw_currentSkin, "/skinvalues.txt")), FILE_READ);
168 if(cvar_defstring("menu_skin") != "")
170 cvar_set("menu_skin", cvar_defstring("menu_skin"));
171 draw_currentSkin = strcat("gfx/menu/", cvar_string("menu_skin"));
172 fh = fopen(language_filename(strcat(draw_currentSkin, "/skinvalues.txt")), FILE_READ);
176 draw_currentSkin = "gfx/menu/default";
177 fh = fopen(language_filename(strcat(draw_currentSkin, "/skinvalues.txt")), FILE_READ);
181 error("cannot load any menu skin\n");
183 draw_currentSkin = strzone(draw_currentSkin);
184 while((s = fgets(fh)))
186 // these two are handled by skinlist.qc
187 if(substring(s, 0, 6) == "title ")
189 if(substring(s, 0, 7) == "author ")
191 n = tokenize_console(s);
193 Skin_ApplySetting(argv(0), substring(s, argv_start_index(1), argv_end_index(-1) - argv_start_index(1)));
197 glob = search_begin(strcat(draw_currentSkin, "/*.tga"), TRUE, TRUE);
200 n = search_getsize(glob);
201 for(i = 0; i < n; ++i)
202 precache_pic(search_getfilename(glob, i));
206 draw_setMousePointer(SKINGFX_CURSOR, SKINSIZE_CURSOR, SKINOFFSET_CURSOR);
209 anim = spawnAnimHost();
210 main = spawnMainWindow(); main.configureMainWindow(main);
213 main.resizeNotify(main, '0 0 0', eX * conwidth + eY * conheight, '0 0 0', eX * conwidth + eY * conheight);
216 menuMousePos = '0.5 0.5 0';
222 m_goto(m_goto_buffer);
223 strunzone(m_goto_buffer);
224 m_goto_buffer = string_null;
228 m_display(); // delayed menu display
231 void m_keyup (float key, float ascii)
237 draw_reset_cropped();
238 main.keyUp(main, key, ascii, menuShiftState);
239 if(key >= K_MOUSE1 && key <= K_MOUSE3)
241 --mouseButtonsPressed;
242 if(!mouseButtonsPressed)
243 main.mouseRelease(main, menuMousePos);
244 if(mouseButtonsPressed < 0)
246 mouseButtonsPressed = 0;
247 dprint("Warning: released an already released button\n");
250 if(key == K_ALT) menuShiftState -= (menuShiftState & S_ALT);
251 if(key == K_CTRL) menuShiftState -= (menuShiftState & S_CTRL);
252 if(key == K_SHIFT) menuShiftState -= (menuShiftState & S_SHIFT);
255 void m_keydown(float key, float ascii)
263 if(key >= K_MOUSE1 && key <= K_MOUSE3)
265 // detect a click outside of the game window
266 vector p = getmousepos();
267 if(p_x < 0 || p_x > realconwidth || p_y < 0 || p_y > realconheight)
269 ++mouseButtonsPressed;
279 e.keyGrabbed(e, key, ascii);
283 draw_reset_cropped();
284 if(key >= K_MOUSE1 && key <= K_MOUSE3)
285 if(!mouseButtonsPressed)
286 main.mousePress(main, menuMousePos);
287 if(!main.keyDown(main, key, ascii, menuShiftState))
289 if(gamestatus & (GAME_ISSERVER | GAME_CONNECTED)) // don't back out to console only
290 m_hide(); // disable menu on unhandled ESC
292 if(key >= K_MOUSE1 && key <= K_MOUSE3)
294 ++mouseButtonsPressed;
295 if(mouseButtonsPressed > 10)
297 mouseButtonsPressed = 10;
298 dprint("Warning: pressed an already pressed button\n");
301 if(key == K_ALT) menuShiftState |= S_ALT;
302 if(key == K_CTRL) menuShiftState |= S_CTRL;
303 if(key == K_SHIFT) menuShiftState |= S_SHIFT;
306 const float SCALEMODE_CROP = 0;
307 const float SCALEMODE_LETTERBOX = 1;
308 const float SCALEMODE_WIDTH = 2;
309 const float SCALEMODE_HEIGHT = 3;
310 const float SCALEMODE_STRETCH = 4;
311 void draw_Picture_Aligned(vector algn, float scalemode, string img, float a)
313 vector sz, org, isz, isz_w, isz_h;
314 float width_is_larger;
316 sz = draw_PictureSize(img);
317 width_is_larger = (sz_x * draw_scale_y >= sz_y * draw_scale_x);
318 isz_w = '1 0 0' + '0 1 0' * ((sz_y / sz_x) * (draw_scale_x / draw_scale_y));
319 isz_h = '0 1 0' + '1 0 0' * ((sz_x / sz_y) * (draw_scale_y / draw_scale_x));
328 isz = (width_is_larger ? isz_h : isz_w);
330 case SCALEMODE_LETTERBOX:
331 isz = (width_is_larger ? isz_w : isz_h);
333 case SCALEMODE_WIDTH:
336 case SCALEMODE_HEIGHT:
339 case SCALEMODE_STRETCH:
344 org = eX * (algn_x * (1 - isz_x)) + eY * (algn_y * (1 - isz_y));
345 draw_Picture(org, img, isz, '1 1 1', a);
348 void drawBackground(string img, float a, string algn, float force1)
350 if(main.mainNexposee.ModalController_state == 0)
360 scalemode = SCALEMODE_CROP;
363 for(i = 0; i < strlen(algn); ++i)
365 c = substring(algn, i, 1);
368 case "c": scalemode = SCALEMODE_CROP; goto nopic;
369 case "l": scalemode = SCALEMODE_LETTERBOX; goto nopic;
370 case "h": scalemode = SCALEMODE_HEIGHT; goto nopic;
371 case "w": scalemode = SCALEMODE_WIDTH; goto nopic;
372 case "s": scalemode = SCALEMODE_STRETCH; goto nopic;
373 case "1": case "4": case "7": v_x = 0.0; break;
374 case "2": case "5": case "8": v_x = 0.5; break;
375 case "3": case "6": case "9": v_x = 1.0; break;
376 default: v_x = random(); break;
380 case "7": case "8": case "9": v_y = 0.0; break;
381 case "4": case "5": case "6": v_y = 0.5; break;
382 case "1": case "2": case "3": v_y = 1.0; break;
383 default: v_y = random(); break;
386 draw_Picture_Aligned(v, scalemode, img, a);
388 // force all secondary layers to use alpha 1. Prevents ugly issues
389 // with overlap. It's a flag because it cannot be used for the
391 draw_Picture_Aligned(v, scalemode, strcat(img, "_l", ftos(l+1)), 1);
393 draw_Picture_Aligned(v, scalemode, strcat(img, "_l", ftos(l+1)), a);
400 float menu_tooltips_old;
401 vector menuTooltipAveragedMousePos;
402 entity menuTooltipItem;
403 vector menuTooltipOrigin;
404 vector menuTooltipSize;
405 float menuTooltipAlpha;
406 string menuTooltipText;
407 float menuTooltipState; // 0: static, 1: fading in, 2: fading out
408 float m_testmousetooltipbox(vector pos)
410 if(pos_x >= menuTooltipOrigin_x && pos_x < menuTooltipOrigin_x + menuTooltipSize_x)
411 if(pos_y >= menuTooltipOrigin_y && pos_y < menuTooltipOrigin_y + menuTooltipSize_y)
415 float m_testtooltipbox(vector tooltippos)
421 if(tooltippos_x + menuTooltipSize_x > 1)
423 if(tooltippos_y + menuTooltipSize_y > 1)
425 menuTooltipOrigin = tooltippos;
428 float m_allocatetooltipbox(vector pos)
430 vector avoidplus, avoidminus;
433 avoidplus_x = (SKINAVOID_TOOLTIP_x + SKINSIZE_CURSOR_x - SKINOFFSET_CURSOR_x * SKINSIZE_CURSOR_x) / conwidth;
434 avoidplus_y = (SKINAVOID_TOOLTIP_y + SKINSIZE_CURSOR_y - SKINOFFSET_CURSOR_y * SKINSIZE_CURSOR_y) / conheight;
437 avoidminus_x = (SKINAVOID_TOOLTIP_x + SKINOFFSET_CURSOR_x * SKINSIZE_CURSOR_x) / conwidth + menuTooltipSize_x;
438 avoidminus_y = (SKINAVOID_TOOLTIP_y + SKINOFFSET_CURSOR_y * SKINSIZE_CURSOR_y) / conheight + menuTooltipSize_y;
443 if(m_testtooltipbox(v))
447 v_x = pos_x - menuTooltipSize_x * 0.5;
448 if(m_testtooltipbox(v))
452 v_x = pos_x - avoidminus_x;
453 if(m_testtooltipbox(v))
457 v_y = pos_y - avoidminus_y;
458 if(m_testtooltipbox(v))
462 v_x = pos_x - menuTooltipSize_x * 0.5;
463 if(m_testtooltipbox(v))
467 v_x = pos_x + avoidplus_x;
468 if(m_testtooltipbox(v))
473 entity m_findtooltipitem(entity root, vector pos)
481 while(it.instanceOfContainer)
483 while(it.instanceOfNexposee && it.focusedChild)
485 it = it.focusedChild;
486 pos = globalToBox(pos, it.Container_origin, it.Container_size);
488 if(it.instanceOfNexposee)
490 it = it.itemFromPoint(it, pos);
493 else if(menu_tooltips == 2 && (it.cvarName || it.onClickCommand))
497 else if(it.instanceOfModalController)
498 it = it.focusedChild;
500 it = it.itemFromPoint(it, pos);
505 else if(menu_tooltips == 2 && (it.cvarName || it.onClickCommand))
507 pos = globalToBox(pos, it.Container_origin, it.Container_size);
514 if (menu_tooltips == 2)
517 if (menuTooltipItem.cvarName)
519 if (getCvarsMulti(menuTooltipItem))
520 s = strcat("[", menuTooltipItem.cvarName, " ", getCvarsMulti(menuTooltipItem), "]");
522 s = strcat("[", menuTooltipItem.cvarName, "]");
524 else if (menuTooltipItem.onClickCommand)
525 s = strcat("<", menuTooltipItem.onClickCommand, ">");
527 return menuTooltipItem.tooltip;
528 if (menuTooltipItem.tooltip)
529 return strcat(menuTooltipItem.tooltip, " ", s);
532 return menuTooltipItem.tooltip;
534 void m_tooltip(vector pos)
541 menu_tooltips = cvar("menu_tooltips");
544 // don't return immediately, fade out the active tooltip first
545 if (menuTooltipItem == world)
548 menu_tooltips_old = menu_tooltips;
552 f = bound(0, frametime * 2, 1);
553 menuTooltipAveragedMousePos = menuTooltipAveragedMousePos * (1 - f) + pos * f;
554 f = vlen(pos - menuTooltipAveragedMousePos);
556 it = m_findtooltipitem(main, pos);
560 fontsize = '1 0 0' * (SKINFONTSIZE_TOOLTIP / conwidth) + '0 1 0' * (SKINFONTSIZE_TOOLTIP / conheight);
562 // float menuTooltipState; // 0: static, 1: fading in, 2: fading out
563 if(it != menuTooltipItem)
565 switch(menuTooltipState)
570 // another item: fade out first
571 menuTooltipState = 2;
576 menuTooltipState = 1;
577 menuTooltipItem = it;
579 menuTooltipOrigin_x = -1; // unallocated
582 strunzone(menuTooltipText);
583 menuTooltipText = strzone(gettooltip());
587 getWrappedLine_remaining = menuTooltipText;
588 while(getWrappedLine_remaining)
590 s = getWrappedLine(SKINWIDTH_TOOLTIP, fontsize, draw_TextWidth_WithoutColors);
592 f = draw_TextWidth(s, FALSE, fontsize);
596 menuTooltipSize_x = w + 2 * (SKINMARGIN_TOOLTIP_x / conwidth);
597 menuTooltipSize_y = i * fontsize_y + 2 * (SKINMARGIN_TOOLTIP_y / conheight);
598 menuTooltipSize_z = 0;
602 // changing item while fading in: fade out first
603 menuTooltipState = 2;
606 // changing item while fading out: can't
610 else if(menuTooltipState == 2) // re-fade in?
611 menuTooltipState = 1;
614 if(!m_testmousetooltipbox(pos))
615 menuTooltipState = 2; // fade out if mouse touches it
617 switch(menuTooltipState)
620 menuTooltipAlpha = bound(0, menuTooltipAlpha + 5 * frametime, 1);
621 if(menuTooltipAlpha == 1)
622 menuTooltipState = 0;
625 menuTooltipAlpha = bound(0, menuTooltipAlpha - 2 * frametime, 1);
626 if(menuTooltipAlpha == 0)
628 menuTooltipState = 0;
629 menuTooltipItem = world;
634 if(menuTooltipItem == world)
638 strunzone(menuTooltipText);
639 menuTooltipText = string_null;
645 if(menu_tooltips != menu_tooltips_old)
647 if (menu_tooltips != 0 && menu_tooltips_old != 0)
648 menuTooltipItem = world; // reload tooltip next frame
649 menu_tooltips_old = menu_tooltips;
651 else if(menuTooltipOrigin_x < 0) // unallocated?
652 m_allocatetooltipbox(pos);
654 if(menuTooltipOrigin_x >= 0)
657 p = SKINBORDER_TOOLTIP;
659 p_y *= 1 / conheight;
660 draw_BorderPicture(menuTooltipOrigin, SKINGFX_TOOLTIP, menuTooltipSize, '1 1 1', menuTooltipAlpha, p);
661 p = menuTooltipOrigin;
662 p_x += SKINMARGIN_TOOLTIP_x / conwidth;
663 p_y += SKINMARGIN_TOOLTIP_y / conheight;
664 getWrappedLine_remaining = menuTooltipText;
665 while(getWrappedLine_remaining)
667 s = getWrappedLine(SKINWIDTH_TOOLTIP, fontsize, draw_TextWidth_WithoutColors);
668 draw_Text(p, s, fontsize, SKINCOLOR_TOOLTIP, SKINALPHA_TOOLTIP * menuTooltipAlpha, FALSE);
675 void m_draw(float width, float height)
682 execute_next_frame();
684 menuMouseMode = cvar("menu_mouse_absolute");
689 UpdateConWidthHeight(width, height, cvar("vid_pixelheight"));
693 // TODO draw an info image about this situation
697 if(!menuNotTheFirstFrame)
699 menuNotTheFirstFrame = 1;
701 if(!cvar("menu_video_played"))
703 localcmd("cd loop $menu_cdtrack; play sound/announcer/default/welcome.wav\n");
704 menuLogoAlpha = -0.8; // no idea why, but when I start this at zero, it jumps instead of fading FIXME
706 // ALWAYS set this cvar; if we start but menu is not active, this means we want no background music!
707 localcmd("set menu_video_played 1\n");
711 realFrametime = frametime = min(0.2, t - menuPrevTime);
715 t = cvar("menu_slowmo");
726 if(getmousetarget() == (menuMouseMode ? MT_CLIENT : MT_MENU) && (getkeydest() == KEY_MENU || getkeydest() == KEY_MENU_GRABBED))
727 setkeydest(keyGrabber ? KEY_MENU_GRABBED : KEY_MENU);
732 if(cvar("cl_capturevideo"))
733 frametime = t / cvar("cl_capturevideo_fps"); // make capturevideo work smoothly
735 prevMenuAlpha = menuAlpha;
738 if(menuAlpha == 0 && menuLogoAlpha < 2)
740 menuLogoAlpha = menuLogoAlpha + frametime * 2;
744 menuAlpha = min(1, menuAlpha + frametime * 5);
750 menuAlpha = max(0, menuAlpha - frametime * 5);
754 draw_reset_cropped();
756 if(!(gamestatus & (GAME_CONNECTED | GAME_ISSERVER)))
758 if(menuLogoAlpha > 0)
761 draw_Fill('0 0 0', '1 1 0', SKINCOLOR_BACKGROUND, 1);
762 drawBackground(SKINGFX_BACKGROUND, bound(0, menuLogoAlpha, 1), SKINALIGN_BACKGROUND, TRUE);
763 draw_reset_cropped();
764 if(menuAlpha <= 0 && SKINALPHA_CURSOR_INTRO > 0)
766 draw_alpha = SKINALPHA_CURSOR_INTRO * bound(0, menuLogoAlpha, 1);
767 draw_drawMousePointer(menuMousePos);
772 else if(SKINALPHA_BACKGROUND_INGAME)
777 drawBackground(SKINGFX_BACKGROUND_INGAME, menuAlpha * SKINALPHA_BACKGROUND_INGAME, SKINALIGN_BACKGROUND_INGAME, FALSE);
778 draw_reset_cropped();
782 if(menuAlpha != prevMenuAlpha)
783 cvar_set("_menu_alpha", ftos(menuAlpha));
785 draw_reset_cropped();
787 draw_reset_cropped();
791 if(prevMenuAlpha > 0)
792 main.initializeDialog(main, main.firstChild);
793 draw_reset_cropped();
798 draw_alpha *= menuAlpha;
802 // do not update mouse position
803 // it prevents mouse jumping to '0 0 0' when menu is fading out
805 else if(menuMouseMode)
808 newMouse = globalToBox(getmousepos(), draw_shift, draw_scale);
809 if(newMouse != '0 0 0')
810 if(newMouse != menuMousePos)
812 menuMousePos = newMouse;
813 if(mouseButtonsPressed)
814 main.mouseDrag(main, menuMousePos);
816 main.mouseMove(main, menuMousePos);
823 vector dMouse, minpos, maxpos;
824 dMouse = getmousepos() * (frametime / realFrametime); // for capturevideo
825 if(dMouse != '0 0 0')
827 minpos = globalToBox('0 0 0', draw_shift, draw_scale);
828 maxpos = globalToBox(eX * (realconwidth - 1) + eY * (realconheight - 1), draw_shift, draw_scale);
829 dMouse = globalToBoxSize(dMouse, draw_scale);
830 menuMousePos += dMouse * cvar("menu_mouse_speed");
831 menuMousePos_x = bound(minpos_x, menuMousePos_x, maxpos_x);
832 menuMousePos_y = bound(minpos_y, menuMousePos_y, maxpos_y);
833 if(mouseButtonsPressed)
834 main.mouseDrag(main, menuMousePos);
836 main.mouseMove(main, menuMousePos);
842 m_tooltip(menuMousePos);
844 draw_alpha = max(draw_alpha, SKINALPHA_CURSOR_INTRO * bound(0, menuLogoAlpha, 1));
846 draw_drawMousePointer(menuMousePos);
848 draw_reset_cropped();
857 setkeydest(KEY_MENU);
858 setmousetarget((menuMouseMode ? MT_CLIENT : MT_MENU));
863 if(mouseButtonsPressed)
864 main.mouseRelease(main, menuMousePos);
865 mouseButtonsPressed = 0;
867 main.focusEnter(main);
868 main.showNotify(main);
874 setkeydest(KEY_GAME);
875 setmousetarget(MT_CLIENT);
880 main.focusLeave(main);
881 main.hideNotify(main);
884 void m_toggle(float mode)
905 for(e = NULL; (e = nextent(e)) != NULL; )
907 if(e.classname != "vtbl")
913 void m_focus_item_chain(entity outermost, entity innermost)
915 if(innermost.parent != outermost)
916 m_focus_item_chain(outermost, innermost.parent);
917 innermost.parent.setFocus(innermost.parent, innermost);
920 void m_activate_window(entity wnd)
925 m_activate_window(par);
927 if(par.instanceOfModalController)
929 if(wnd.tabSelectingButton)
931 TabButton_Click(wnd.tabSelectingButton, wnd);
934 par.initializeDialog(par, wnd);
936 else if(par.instanceOfNexposee)
938 // nexposee (sorry for violating abstraction here)
939 par.selectedChild = wnd;
940 par.animationState = 1;
941 Container_setFocus(par, NULL);
943 else if(par.instanceOfContainer)
947 par.setFocus(par, wnd);
951 void m_setpointerfocus(entity wnd)
953 if(wnd.instanceOfContainer)
955 entity focus = wnd.preferredFocusedGrandChild(wnd);
958 menuMousePos = focus.origin + 0.5 * focus.size;
959 menuMousePos_x *= 1 / conwidth;
960 menuMousePos_y *= 1 / conheight;
961 if(wnd.focused) // why does this never happen?
962 m_focus_item_chain(wnd, focus);
967 void m_goto(string itemname)
973 strunzone(m_goto_buffer);
974 m_goto_buffer = strzone(itemname);
977 if(itemname == "") // this can be called by GameCommand
979 if(gamestatus & (GAME_ISSERVER | GAME_CONNECTED))
985 m_activate_window(main.mainNexposee);
991 for(e = NULL; (e = find(e, name, itemname)); )
992 if(e.classname != "vtbl")
995 if((e) && (!e.requiresConnection || (gamestatus & (GAME_ISSERVER | GAME_CONNECTED))))
998 m_activate_window(e);
999 m_setpointerfocus(e);
1005 float menuLastFocusSoundTime;
1006 void m_play_focus_sound()
1008 if(cvar("menu_sounds") > 1)
1009 if(time - menuLastFocusSoundTime > 0.25)
1011 localsound("sound/menu/focus.wav");
1012 menuLastFocusSoundTime = time;
1016 void m_play_click_sound(string soundfile)
1018 if(cvar("menu_sounds"))
1019 localsound(soundfile);