Skip to content

Fixes #6 : Save button Light Editor - #23

Merged
Osman-Kahraman merged 9 commits into
Osman-Kahraman:mainfrom
Hazim-AS:6-enhancement-save-button-light-editor
Mar 11, 2026
Merged

Osman-Kahraman merged 9 commits into
Osman-Kahraman:mainfrom
Hazim-AS:6-enhancement-save-button-light-editor

Conversation

@Hazim-AS

Copy link
Copy Markdown
Contributor

Enhancement #6 : Add a save button to the light editor, track dirty state and open prompt if data not saved when quitting the light editor

@Hazim-AS Hazim-AS closed this Mar 10, 2026
@Hazim-AS Hazim-AS reopened this Mar 10, 2026
@Hazim-AS Hazim-AS changed the title Enhancement #6 : Save button Light Editor Fixes #6 : Save button Light Editor Mar 10, 2026
@Osman-Kahraman
Osman-Kahraman self-requested a review March 11, 2026 00:58

@Osman-Kahraman Osman-Kahraman left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

Overall, I like the improvements made to the light editor @Hazim-AS. The behavior when closing the window without touching the RGB sliders now correctly avoids saving changes, which aligns with the original issue’s intent.

However, I noticed two logic issues that should probably be addressed.

First, the cancel command only works once. After clicking cancel a single time, the light_editor_prompt dialog is no longer triggered again. Normally it should continue prompting the user until the changes are either saved or discarded.
Second, there is a critical logic issue with the discard flow. If I modify the RGB sliders and then close the light editor window, selecting Discard still ends up saving the changes. In this case the editor should completely revert the changes and avoid persisting them.

To summarize:

  1. The cancel command should repeatedly trigger the light_editor_prompt until the user explicitly saves or discards.
  2. When Discard is selected after making changes, the editor should revert the modifications instead of saving them.

Once these logic issues are fixed, the feature should behave exactly as expected and I'm going to merge your PR. Thank you.

Comment thread game_engine/ui/designer.py
elif self.light_editor_bool:
coords = list(self.unconverted_objectCoords)
coords[0] += self.objectSize[0] * self.win_scale
R_initial, G_initial, B_initial = 0, 0, 0

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

good logic, I liked this part of your code @Hazim-AS

@Hazim-AS

Hazim-AS commented Mar 11, 2026 •

Copy link
Copy Markdown
Contributor Author

Hi, I checked out why the prompt bugged, it was because I put the prompt window on the light_editor window, it should work without problem now since i changed the prompt window position

Edit : I also made sure the button of the editor deactivated when the prompt appeared

@Hazim-AS
Hazim-AS requested a review from Osman-Kahraman March 11, 2026 03:08

@Osman-Kahraman Osman-Kahraman left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

Yes I tested the previous bugs, everything seems good for merge with main.

@Osman-Kahraman

Copy link
Copy Markdown
Owner

After the CI check, I will merge it. Thank you

@Osman-Kahraman
Osman-Kahraman self-requested a review March 11, 2026 05:45
@Osman-Kahraman
Osman-Kahraman merged commit 934fc41 into Osman-Kahraman:main Mar 11, 2026
1 check passed
@Hazim-AS

Hazim-AS commented Mar 17, 2026 •

Copy link
Copy Markdown
Contributor Author

Hi, I wanted to improve my commit so I decided to added modulable size and display the value of the size and the color, do you want me to add that ?

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