Add state for active objects to GUI#201
Open
robalni wants to merge 1 commit intoblue-nebula:masterfrom
robalni:ui-state
Open
Add state for active objects to GUI#201robalni wants to merge 1 commit intoblue-nebula:masterfrom robalni:ui-state
robalni wants to merge 1 commit intoblue-nebula:masterfrom
robalni:ui-state
Conversation
Fixes #200 about sliders that only work when the mouse is over them. This commit adds two things; state variables (`*childpath`) with function that modifies it, and modifications to relevant GUI object (e.g. button, slider) functions so that they use that function to register as a unique object and find out whether they are active. The GUI code now keeps track of the "path" to each object. By "path" I mean e.g. go to the 3rd top-level child and then to it's 2nd child. This is similar to what it looks like they do in Red Eclipse 2. This is not a perfect solution because it's possible that these paths change when objects are added or removed but it is much better than just giving each object a simple number as ID because when something is changed inside one list it doesn't change the path to an object that is not a child of that list. The modifications to the GUI objects are usually done so that the mouse-up action only happens if the object is the active object (the mouse was pressed down on that object).
MoonPadUSer
reviewed
Sep 11, 2020
MoonPadUSer
reviewed
Sep 11, 2020
Contributor
|
functionality wise it looks pretty good so far |
MoonPadUSer
suggested changes
Sep 11, 2020
Contributor
MoonPadUSer
left a comment
There was a problem hiding this comment.
Works. But codestyle could be improved
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.
Fixes #200 about sliders that only work when the mouse is over them.
This commit adds two things; state variables (
*childpath) withfunction that modifies it, and modifications to relevant GUI object
(e.g. button, slider) functions so that they use that function to
register as a unique object and find out whether they are active.
The GUI code now keeps track of the "path" to each object. By "path" I
mean e.g. go to the 3rd top-level child and then to it's 2nd child.
This is similar to what it looks like they do in Red Eclipse 2. This is
not a perfect solution because it's possible that these paths change
when objects are added or removed but it is much better than just giving
each object a simple number as ID because when something is changed
inside one list it doesn't change the path to an object that is not a
child of that list.
The modifications to the GUI objects are usually done so that the
mouse-up action only happens if the object is the active object (the
mouse was pressed down on that object).