]> git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/menu/xonotic/inputbox.qc
take3: format 903 files
[xonotic/xonotic-data.pk3dir.git] / qcsrc / menu / xonotic / inputbox.qc
index 22a7ce71741284dd91f7969c865ffe644a59e157..6645e64f8a0cd4039a92f141bc66b7bac772447b 100644 (file)
@@ -26,27 +26,30 @@ void XonoticInputBox_focusLeave(entity me)
 }
 void XonoticInputBox_setText(entity me, string val)
 {
-       if(me.text != val)
-       {
+       if (me.text != val) {
                SUPER(XonoticInputBox).setText(me, val);
-               if(me.onChange)
+               if (me.onChange) {
                        me.onChange(me, me.onChangeEntity);
-               if(me.saveImmediately)
+               }
+               if (me.saveImmediately) {
                        me.saveCvars(me);
-       }
-       else
+               }
+       } else {
                SUPER(XonoticInputBox).setText(me, val);
+       }
 }
 void XonoticInputBox_loadCvars(entity me)
 {
-       if (!me.cvarName)
+       if (!me.cvarName) {
                return;
+       }
        SUPER(XonoticInputBox).setText(me, cvar_string(me.cvarName));
 }
 void XonoticInputBox_saveCvars(entity me)
 {
-       if (!me.cvarName)
+       if (!me.cvarName) {
                return;
+       }
        cvar_set(me.cvarName, me.text);
        CheckSendCvars(me, me.cvarName);
 }
@@ -54,17 +57,17 @@ float XonoticInputBox_keyDown(entity me, float key, float ascii, float shift)
 {
        float r;
        r = 0;
-       if(key == K_ENTER || key == K_KP_ENTER)
-       {
-               if(me.cvarName)
-               {
+       if (key == K_ENTER || key == K_KP_ENTER) {
+               if (me.cvarName) {
                        me.saveCvars(me);
                        r = 1;
                }
-               if(me.onEnter)
+               if (me.onEnter) {
                        me.onEnter(me, me.onEnterEntity);
+               }
        }
-       if(SUPER(XonoticInputBox).keyDown(me, key, ascii, shift))
+       if (SUPER(XonoticInputBox).keyDown(me, key, ascii, shift)) {
                r = 1;
+       }
        return r;
 }