]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/menu/item/checkbox.c
More fun stuff
[xonotic/xonotic-data.pk3dir.git] / qcsrc / menu / item / checkbox.c
index adbedf95a5ca242149aa4d6474e48e16e5f5c38d..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)
@@ -14,7 +15,7 @@ ENDCLASS(CheckBox)
 #endif
 
 #ifdef IMPLEMENTATION
-void setCheckedCheckBox(entity me, float val)
+void CheckBox_setChecked(entity me, float val)
 {
        me.checked = val;
 }
@@ -22,16 +23,16 @@ void CheckBox_Click(entity me, entity other)
 {
        me.setChecked(me, !me.checked);
 }
-string toStringCheckBox(entity me)
+string CheckBox_toString(entity me)
 {
        return strcat(SUPER(CheckBox).toString(me), ", ", me.checked ? "checked" : "unchecked");
 }
-void configureCheckBoxCheckBox(entity me, string txt, float sz, string gfx)
+void CheckBox_configureCheckBox(entity me, string txt, float sz, string gfx)
 {
        me.configureButton(me, txt, sz, gfx);
        me.align = 0;
 }
-void drawCheckBox(entity me)
+void CheckBox_draw(entity me)
 {
        float s;
        s = me.pressed;
@@ -42,7 +43,11 @@ void drawCheckBox(entity me)
        }
        else
                me.srcSuffix = (me.checked ? "1" : "0");
-       SUPER(CheckBox).draw(me);
        me.pressed = s;
+       SUPER(CheckBox).draw(me);
+}
+void CheckBox_playClickSound(entity me)
+{
+       m_play_click_sound(MENU_SOUND_SELECT);
 }
 #endif