]> git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/menu/item/checkbox.qc
Uncrustify menu/{anim,item}/*
[xonotic/xonotic-data.pk3dir.git] / qcsrc / menu / item / checkbox.qc
index cda07c518bace964a9d7548fbf123d0c6843f1dd..17bc50103e262850a8707a281fa9615f0af060c9 100644 (file)
@@ -1,55 +1,57 @@
 #ifndef ITEM_CHECKBOX_H
-#define ITEM_CHECKBOX_H
-#include "button.qc"
-void CheckBox_Click(entity me, entity other);
-CLASS(CheckBox, 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)
-       ATTRIB(CheckBox, checked, float, 0)
-       ATTRIB(CheckBox, onClick, void(entity, entity), CheckBox_Click)
-       ATTRIB(CheckBox, srcMulti, float, 0)
-       ATTRIB(CheckBox, disabled, float, 0)
-ENDCLASS(CheckBox)
+       #define ITEM_CHECKBOX_H
+       #include "button.qc"
+       void CheckBox_Click(entity me, entity other);
+       CLASS(CheckBox, 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)
+               ATTRIB(CheckBox, checked, float, 0)
+               ATTRIB(CheckBox, onClick, void(entity, entity), CheckBox_Click)
+               ATTRIB(CheckBox, srcMulti, float, 0)
+               ATTRIB(CheckBox, disabled, float, 0)
+       ENDCLASS(CheckBox)
 #endif
 
 #ifdef IMPLEMENTATION
-void CheckBox_setChecked(entity me, float val)
-{
-       me.checked = val;
-}
-void CheckBox_Click(entity me, entity other)
-{
-       me.setChecked(me, !me.checked);
-}
-string CheckBox_toString(entity me)
-{
-       return strcat(SUPER(CheckBox).toString(me), ", ", me.checked ? "checked" : "unchecked");
-}
-void CheckBox_configureCheckBox(entity me, string txt, float sz, string gfx)
-{
-       me.configureButton(me, txt, sz, gfx);
-       me.align = 0;
-}
-void CheckBox_draw(entity me)
-{
-       float s;
-       s = me.pressed;
-       if(me.useDownAsChecked)
+       void CheckBox_setChecked(entity me, float val)
        {
-               me.srcSuffix = string_null;
-               me.forcePressed = me.checked;
+               me.checked = val;
+       }
+       void CheckBox_Click(entity me, entity other)
+       {
+               me.setChecked(me, !me.checked);
+       }
+       string CheckBox_toString(entity me)
+       {
+               return strcat(SUPER(CheckBox).toString(me), ", ", me.checked ? "checked" : "unchecked");
+       }
+       void CheckBox_configureCheckBox(entity me, string txt, float sz, string gfx)
+       {
+               me.configureButton(me, txt, sz, gfx);
+               me.align = 0;
+       }
+       void CheckBox_draw(entity me)
+       {
+               float s;
+               s = me.pressed;
+               if (me.useDownAsChecked)
+               {
+                       me.srcSuffix = string_null;
+                       me.forcePressed = me.checked;
+               }
+               else
+               {
+                       me.srcSuffix = (me.checked ? "1" : "0");
+               }
+               me.pressed = s;
+               SUPER(CheckBox).draw(me);
+       }
+       void CheckBox_playClickSound(entity me)
+       {
+               m_play_click_sound(MENU_SOUND_SELECT);
        }
-       else
-               me.srcSuffix = (me.checked ? "1" : "0");
-       me.pressed = s;
-       SUPER(CheckBox).draw(me);
-}
-void CheckBox_playClickSound(entity me)
-{
-       m_play_click_sound(MENU_SOUND_SELECT);
-}
 #endif