(release 30)BugFix: fix mButtonState behaviour for non-Push-Down "Buttons"#435
Merged
SlySven merged 4 commits intoMudlet:release_30from Mar 24, 2017
Merged
Conversation
…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>
vadi2
approved these changes
Mar 23, 2017
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

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". 😀