Skip to content

Conversation

@robalni
Copy link
Contributor

@robalni robalni commented Aug 16, 2020

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).

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
Copy link
Contributor

functionality wise it looks pretty good so far

Copy link
Contributor

@MoonPadUSer MoonPadUSer left a comment

Choose a reason for hiding this comment

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

Works. But codestyle could be improved

@TheAssassin TheAssassin added this to the 1.7.0 milestone Dec 31, 2025
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.

GUI doesn't remember focus

3 participants