]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Menu: fix Apply buttons not working if a button is pressed with the spacebar
authorterencehill <piuntn@gmail.com>
Tue, 28 Dec 2021 14:11:20 +0000 (15:11 +0100)
committerterencehill <piuntn@gmail.com>
Tue, 28 Dec 2021 14:11:20 +0000 (15:11 +0100)
qcsrc/menu/item/button.qc

index 77e4ccad264fee8f912abdb8573ba154af71289c..e9f418ad9c24f79063b80dd848bc9f7f056cbe46 100644 (file)
                if (me.clickTime > 0 && me.clickTime <= frametime)
                {
                        // keyboard click timer expired? Fire the event then.
-                       if (!me.disabled)
-                               if (me.onClick) me.onClick(me, me.onClickEntity);
+                       if (!me.disabled && me.onClick)
+                       {
+                               if(me.applyButton)
+                                       me.applyButton.disabled = false;
+                               me.onClick(me, me.onClickEntity);
+                               if(me.disableOnClick)
+                                       me.disabled = true;
+                       }
                }
                me.clickTime -= frametime;