Skip to content

Fixes 26 : add modulable size light and display the value of the size and the colors in the light editor#26

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

Fixes 26 : add modulable size light and display the value of the size and the colors in the light editor#26
Osman-Kahraman merged 4 commits into
Osman-Kahraman:mainfrom
Hazim-AS:6-enhancement-save-button-light-editor

Conversation

@Hazim-AS

@Hazim-AS Hazim-AS commented Mar 17, 2026

Copy link
Copy Markdown
Contributor

I wasn't entirely satisfied with my commit so I decided to add some enhancement that seemed needed like :

  • Modulable light size
  • Display the value of the light colors and the size and we changed it
image

linked to #23 and #6

@Hazim-AS Hazim-AS changed the title Fixes 25 : add modulable size light and display the value of the size and the colors in the light editor Fixes 26 : add modulable size light and display the value of the size and the colors in the light editor Mar 17, 2026

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

First of all, I REALLY liked the way of your fixes. The light size was holding a static value which was 100, finding this issue and fixing with dynamical way shows your passion.

I already added notes inside of your codes. Please check it out.

And as a summary, you only need to fix Black formatting which is easiest thing of this repo. Of course I can do this in 5 sec and push it but I really wanna encourage you deal with your own.

After this black formatting fix, it will be approved PR for this repo.

Thanks.

Comment thread game_engine/core/ui.py Outdated
with open(f"items/{name}.py", "w", encoding="utf-8") as file:
file.write(
f"""
file.write(f"""

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.

It leads to fail black formatting on ci.yml. Try to use this command before push.

python3 -m black game_engine/

It will pass on CI/CD pipeline, after this command

Comment thread game_engine/core/ui.py Outdated
{_memory["text"]["name"]}
''')"""
)
''')""")

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.

Same here that I mentioned on previous comment.

self.light_editor_prompt_bool = False
elif light_editor_prompt_surf.item_coords == (260, 135):
light.update({"coords": [0, 0], "size": 100, "RGB": (int(R), int(G), int(B))})
light.update({"coords": [0, 0], "size": int(size), "RGB": (int(R), int(G), int(B))})

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.

perfectly added dynamic value, thanks for this improvement @Hazim-AS

G = UI.listen("G") * 255/100
B = UI.listen("B") * 255/100
UI.text(f"Size : {size}\n R : {int(R)}\n G : {int(G)}\n B : {int(B)}", 25, (70, 12), (200, 200, 200), scrollbar_area, font="impact")
R = UI.listen("R") * 255 / 100

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.

I liked the way you implemented and adjusted the new scrollbar_area.

Tested. And works as intended. 👍

Osman-Kahraman and others added 2 commits March 17, 2026 22:24
It was using `or` statement for unsaved changes prompt. That means if you make some changes for size doesn't trigger that prompt and closes the light_editor
@Hazim-AS

Copy link
Copy Markdown
Contributor Author

it's done I think

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

yep, it passes the pipeline

@Osman-Kahraman
Osman-Kahraman merged commit 8a986c8 into Osman-Kahraman:main Mar 18, 2026
1 check passed
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