Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Editor: update properties referencing GUIs on GUI removal or id change #2670

Conversation

ivan-mogilko
Copy link
Contributor

Fix #2542

  1. Properties that let select GUI display a dropdown list of gui script names instead of being raw number fields. The displayed names are mapped to GUI number internally, so no data upgrade is necessary.
  2. Whenever a GUI is removed, or has ID changed by command, SettingsComponent class updates all of its properties and fixes GUI selection. If selected GUI got removed, property is changed to 0 ("None").

The feature is purely in UI and does not change data format.

@ivan-mogilko ivan-mogilko added what: editor related to the game editor context: ui/ux labels Jan 27, 2025
@ivan-mogilko ivan-mogilko force-pushed the 362--editorguiselproperties branch from f487b83 to 4390b6d Compare January 28, 2025 08:04
@ivan-mogilko
Copy link
Contributor Author

ivan-mogilko commented Jan 28, 2025

I used existing Game.GUIAddedOrRemoved event, and had to add a special event for gui ID changing to GuiComponent.
But I think that these events (both old and new) are a hack. IMO we need some sort of a IGameListener (made up name) interface that would contain all similar events, and through which various managers would notify others about changes they made. I do not have spare time to design something like that right now. Added comments with this idea into the code.

@ivan-mogilko ivan-mogilko merged commit b4616cc into adventuregamestudio:master Jan 29, 2025
21 checks passed
@ivan-mogilko ivan-mogilko deleted the 362--editorguiselproperties branch January 29, 2025 11:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
context: ui/ux what: editor related to the game editor
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Deleting a GUI doesn't update Custom text-window setting
1 participant