]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/menu/menu.qc
Revise focus sound, use a time guard to prevent "Geiger counter" effect
[xonotic/xonotic-data.pk3dir.git] / qcsrc / menu / menu.qc
index aa771649d663fa705e6980d4870ef3d5174624b0..0a93992efa9d20c42a920c195ae299737b7cdf23 100644 (file)
@@ -1001,3 +1001,14 @@ void m_goto(string itemname)
                }
        }
 }
+
+float menuLastFocusSoundTime;
+void m_play_focus_sound()
+{
+       if(cvar("menu_sounds") > 1)
+               if(time - menuLastFocusSoundTime > 0.25)
+               {
+                       localsound("sound/menu/focus.wav");
+                       menuLastFocusSoundTime = time;
+               }
+}