From: Severin Meyer Date: Fri, 23 Jan 2015 19:20:32 +0000 (+0100) Subject: Play SELECT sound when using checkbox or its subtypes X-Git-Tag: xonotic-v0.8.1~147^2~10 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=271e99698c34b55bc70af1bc49a66b2d6505a480;p=xonotic%2Fxonotic-data.pk3dir.git Play SELECT sound when using checkbox or its subtypes --- diff --git a/qcsrc/menu/item/checkbox.c b/qcsrc/menu/item/checkbox.c index 94f67ba70..2540cc846 100644 --- a/qcsrc/menu/item/checkbox.c +++ b/qcsrc/menu/item/checkbox.c @@ -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 diff --git a/qcsrc/menu/menu.qh b/qcsrc/menu/menu.qh index ef2cb512d..c78dc938a 100644 --- a/qcsrc/menu/menu.qh +++ b/qcsrc/menu/menu.qh @@ -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);