From: terencehill Date: Tue, 28 Dec 2021 14:11:20 +0000 (+0100) Subject: Menu: fix Apply buttons not working if a button is pressed with the spacebar X-Git-Tag: xonotic-v0.8.5~259 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=0186db45dc96a0dd45058b259e2f38f5468d3ce6;p=xonotic%2Fxonotic-data.pk3dir.git Menu: fix Apply buttons not working if a button is pressed with the spacebar --- diff --git a/qcsrc/menu/item/button.qc b/qcsrc/menu/item/button.qc index 77e4ccad2..e9f418ad9 100644 --- a/qcsrc/menu/item/button.qc +++ b/qcsrc/menu/item/button.qc @@ -121,8 +121,14 @@ 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;