]> git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Play SELECT sound when using checkbox or its subtypes
authorSeverin Meyer <sev.ch@web.de>
Fri, 23 Jan 2015 19:20:32 +0000 (20:20 +0100)
committerSeverin Meyer <sev.ch@web.de>
Fri, 23 Jan 2015 19:20:32 +0000 (20:20 +0100)
qcsrc/menu/item/checkbox.c
qcsrc/menu/menu.qh

index 94f67ba709ef7422b1d0b3a76e488b1b9f8f5acf..2540cc846fdbddf80ef44a5d8f4bd022e7f1dee8 100644 (file)
@@ -3,6 +3,7 @@ void CheckBox_Click(entity me, entity other);
 CLASS(CheckBox) EXTENDS(Button)
        METHOD(CheckBox, configureCheckBox, void(entity, string, float, string))
        METHOD(CheckBox, draw, void(entity))
+       METHOD(CheckBox, playClickSound, void(entity))
        METHOD(CheckBox, toString, string(entity))
        METHOD(CheckBox, setChecked, void(entity, float))
        ATTRIB(CheckBox, useDownAsChecked, float, 0)
@@ -45,4 +46,8 @@ void CheckBox_draw(entity me)
        me.pressed = s;
        SUPER(CheckBox).draw(me);
 }
+void CheckBox_playClickSound(entity me)
+{
+       m_play_click_sound(MENU_SOUND_SELECT);
+}
 #endif
index ef2cb512d01ea5226bae66a7ebbc5a660f8d8322..c78dc938ab16daed24ee375fde7d46e70e815e9d 100644 (file)
@@ -42,6 +42,7 @@ void m_sync();
 // sounds
 
 const string MENU_SOUND_EXECUTE = "sound/menu/execute.wav";
+const string MENU_SOUND_SELECT  = "sound/menu/select.wav";
 
 void m_play_focus_sound();
 void m_play_click_sound(string soundfile);