]> git.xonotic.org Git - voretournament/voretournament.git/blobdiff - data/qcsrc/menu/voret/inputbox.c
Get VoreTournament code to compile with gmqcc. To be compiled with the same parameter...
[voretournament/voretournament.git] / data / qcsrc / menu / voret / inputbox.c
index 9c10b2b19f0c5908186f91c88fafd3152e0d5e30..4acac9f59314e15a1ff32bf15cd71655a62ae579 100644 (file)
@@ -5,9 +5,9 @@ CLASS(VoretInputBox) EXTENDS(InputBox)
        METHOD(VoretInputBox, setText, void(entity, string))\r
        ATTRIB(VoretInputBox, fontSize, float, SKINFONTSIZE_NORMAL)\r
        ATTRIB(VoretInputBox, image, string, SKINGFX_INPUTBOX)\r
-       ATTRIB(VoretInputBox, onChange, void(entity, entity), SUB_Null)\r
+       ATTRIB(VoretInputBox, onChange, void(entity, entity), func_null)\r
        ATTRIB(VoretInputBox, onChangeEntity, entity, NULL)\r
-       ATTRIB(VoretInputBox, onEnter, void(entity, entity), SUB_Null)\r
+       ATTRIB(VoretInputBox, onEnter, void(entity, entity), func_null)\r
        ATTRIB(VoretInputBox, onEnterEntity, entity, NULL)\r
        ATTRIB(VoretInputBox, marginLeft, float, SKINMARGIN_INPUTBOX_CHARS)\r
        ATTRIB(VoretInputBox, marginRight, float, SKINMARGIN_INPUTBOX_CHARS)\r
@@ -53,7 +53,8 @@ void setTextVoretInputBox(entity me, string new)
        if(me.text != new)\r
        {\r
                setTextInputBox(me, new);\r
-               me.onChange(me, me.onChangeEntity);\r
+               if(me.onChange)\r
+                       me.onChange(me, me.onChangeEntity);\r
        }\r
        else\r
                setTextInputBox(me, new);\r