From f570b50382ed4e3129ac016a0df63446033f96b8 Mon Sep 17 00:00:00 2001 From: MasterBel2 Date: Mon, 27 Jun 2022 05:17:59 +1000 Subject: [PATCH] Rename `obj.supressButtonReaction` to `obj.suppressButtonReaction` `obj.supressButtonReaction` will still work for the time being, so this can be merged ASAP without breaking code. A warning will be listed once in the log. Please remove this concession ASAP. --- libs/chiliui/chili/headers/skinutils.lua | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/libs/chiliui/chili/headers/skinutils.lua b/libs/chiliui/chili/headers/skinutils.lua index 95d7f1dad..bb0c0001f 100644 --- a/libs/chiliui/chili/headers/skinutils.lua +++ b/libs/chiliui/chili/headers/skinutils.lua @@ -515,7 +515,7 @@ end --// ============================================================================= --// - +local warned function DrawButton(obj) if obj.debug then Spring.Echo("DrawButton", obj.name, obj.state.pressed) @@ -526,8 +526,16 @@ function DrawButton(obj) local skLeft, skTop, skRight, skBottom = unpack4(obj.tiles) + if obj.supressButtonReaction ~= nil then + obj.suppressButtonReaction = obj.supressButtonReaction + if not warned then + Spring.Echo("Warning: supressButtonReaction is deprecated; use suppressButtonReaction instead!") + warned = true + end + end + local bgcolor = obj.backgroundColor - if not obj.supressButtonReaction then + if not obj.suppressButtonReaction then if (obj.state.pressed) then bgcolor = obj.pressBackgroundColor or mulColor(bgcolor, 0.4) elseif (obj.state.hovered) --[[ or (obj.state.focused)]] then @@ -548,7 +556,7 @@ function DrawButton(obj) local fgcolor = obj.borderColor if not obj.state.enabled then fgcolor = mixColors(fgcolor, obj.disabledColor, 0.8) - elseif not obj.supressButtonReaction then + elseif not obj.suppressButtonReaction then if (obj.state.pressed) then fgcolor = obj.pressForegroundColor or mulColor(fgcolor, 0.4) elseif (obj.state.hovered) --[[ or (obj.state.focused)]] then