Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rename obj.supressButtonReaction to obj.suppressButtonReaction #547

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 11 additions & 3 deletions libs/chiliui/chili/headers/skinutils.lua
Original file line number Diff line number Diff line change
Expand Up @@ -515,7 +515,7 @@ end

--// =============================================================================
--//

local warned
function DrawButton(obj)
if obj.debug then
Spring.Echo("DrawButton", obj.name, obj.state.pressed)
Expand All @@ -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
Expand All @@ -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
Expand Down