Skip to content

(release 30)BugFix: fix mButtonState behaviour for non-Push-Down "Buttons"#435

Merged
SlySven merged 4 commits intoMudlet:release_30from
SlySven:(release_30)bugFix_ButtonCommands
Mar 24, 2017
Merged

(release 30)BugFix: fix mButtonState behaviour for non-Push-Down "Buttons"#435
SlySven merged 4 commits intoMudlet:release_30from
SlySven:(release_30)bugFix_ButtonCommands

Conversation

@SlySven
Copy link
Copy Markdown
Member

@SlySven SlySven commented Mar 23, 2017

The first three commits do a fair amount of de-crufting which make it easier to find the salient issues which are addressed in the fourth commit. This PR fixes: Bug 1673672 "Disabling button up still keeps the command toggle". 😀

SlySven added 4 commits March 23, 2017 14:06
…ument

Removes one bit of cruft that will be involved in area I am working on.

Signed-off-by: Stephen Lyons <slysven@virginmedia.com>
The mudlet class is a singleton and there are means to get it thoughout
the application so it is pointless to pass it as an argument to a function
purely so it can be passed to another function.  This commit refactors the
code to use the global value directly where needed - which includes an area
of code that this series of commits affect.

Signed-off-by: Stephen Lyons <slysven@virginmedia.com>
…hods

Further decrufting.

Signed-off-by: Stephen Lyons <slysven@virginmedia.com>
Revised: (void)TAction::execute() to always send the string associated with
the "down" command for a non-push down button. This fixes:
https://bugs.launchpad.net/mudlet/+bug/1673672 "Disabling button up still
keeps the command toggle". It also clearly sets TConsole::mButtonState to
1 if the button is up or 2 if it is down, as per:
http://wiki.mudlet.org/w/Manual:Lua_Functions#getButtonState .  Steps are
also taken to ensure a non-pushdown button is never left in a "down" state.

Refactored: (int)TAction::mButtonState ==> (bool)TAction::mButtonState
now true is used to indicate the button is in the pushed-down state - there
did appear to be some confusion about this in the past with 0,1 AND 2 being
used in various places.

BugFix: Disabled buttons are now hidden on floating toolbars as expected
{I do have future plans to allow the option for a button to be present but
"greyed-out" if disabled in the future...!}

Signed-off-by: Stephen Lyons <slysven@virginmedia.com>
@SlySven SlySven self-assigned this Mar 23, 2017
@SlySven SlySven requested a review from vadi2 March 23, 2017 14:25
Copy link
Copy Markdown
Member

@vadi2 vadi2 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does what it says and a much easier PR to digest and get in! I like it!

selection_004

Don't have to tag your name, you can't escape Git's scrutiny at either rate... 😃

@SlySven SlySven merged commit ead45e8 into Mudlet:release_30 Mar 24, 2017
@SlySven SlySven deleted the (release_30)bugFix_ButtonCommands branch October 12, 2017 04:02
@SlySven SlySven restored the (release_30)bugFix_ButtonCommands branch June 22, 2020 18:05
@SlySven SlySven deleted the (release_30)bugFix_ButtonCommands branch June 22, 2020 18:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants