Merge pull request #2950 from myk002/myk_no_disabled_click

[HotkeyLabel] don't trigger on click if the widget is disabled
develop
Myk 2023-02-26 09:24:46 -08:00 committed by GitHub
commit 0dff8099ab
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 1 deletions

@ -36,6 +36,7 @@ changelog.txt uses a syntax similar to RST, with a few special sequences:
## New Plugins
## Fixes
-@ ``widgets.HotkeyLabel``: don't trigger on click if the widget is disabled
- ``dfhack.job.isSuitableMaterial``: now properly detects lack of fire and magma safety for vulnerable materials with high melting points
## Misc Improvements

@ -1472,7 +1472,8 @@ end
function HotkeyLabel:onInput(keys)
if HotkeyLabel.super.onInput(self, keys) then
return true
elseif keys._MOUSE_L_DOWN and self:getMousePos() and self.on_activate then
elseif keys._MOUSE_L_DOWN and self:getMousePos() and self.on_activate
and not is_disabled(self) then
self.on_activate()
return true
end