Skip to content

refactor(weather-editor): migrate isl light editor#2414

Merged
davo0411 merged 9 commits into
community-shaders:devfrom
SkrubbySkrubInAShrub:ISL-to-weather-editor
May 31, 2026
Merged

refactor(weather-editor): migrate isl light editor#2414
davo0411 merged 9 commits into
community-shaders:devfrom
SkrubbySkrubInAShrub:ISL-to-weather-editor

Conversation

@SkrubbySkrubInAShrub
Copy link
Copy Markdown
Collaborator

@SkrubbySkrubInAShrub SkrubbySkrubInAShrub commented May 24, 2026

First step of lighting editor rework.
the current design is aimed at letting ISL be absorbed into LLF, while making the weather editor the central place to edit game visuals.

Summary by CodeRabbit

  • New Features

    • Lighting editor is now accessible as a dedicated "Lighting editor" category within the main editor's objects panel.
  • Improvements

    • Removed the standalone enable toggle for the lighting editor for a simpler workflow.
    • Editor now gathers lights when opened and automatically resets overrides when appropriate.
    • Lighting overrides are applied more consistently; on/off controls for point lights respect only the specific lighting toggles.

Review Change Stack

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented May 24, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: 34ee46ee-8b34-48f0-884f-43a0cf5bd379

📥 Commits

Reviewing files that changed from the base of the PR and between 30d6c3f and d3157c2.

📒 Files selected for processing (1)
  • src/WeatherEditor/LightEditor.h

📝 Walkthrough

Walkthrough

LightEditor ownership moves from InverseSquareLighting to EditorWindow. EditorWindow now stores and renders the Lighting editor, calls its GatherLights/ResetOverrides lifecycle methods, and InverseSquareLighting queries EditorWindow::GetSingleton()->lightEditor for overrides and disable flags. LightEditor drops its internal enabled flag and adds ResetOverrides().

Changes

LightEditor Ownership Migration

Layer / File(s) Summary
EditorWindow LightEditor member
src/WeatherEditor/EditorWindow.h
Add #include "LightEditor.h" and a LightEditor lightEditor; member to EditorWindow.
EditorWindow UI integration
src/WeatherEditor/EditorWindow.cpp
Add "Lighting editor" category to objects panel; render lightEditor.DrawSettings() in a scrollable region when selected; call lightEditor.GatherLights() during Draw() when open; call lightEditor.ResetOverrides() on open transition.
LightEditor internal adaptation
src/WeatherEditor/LightEditor.h, src/WeatherEditor/LightEditor.cpp
Update includes, remove the "Enable Light Editor" checkbox and the enabled field, add ResetOverrides(), simplify GatherLights() to use Menu::GetSingleton()->ShouldSwallowInput(), and remove enabled-based guard from ApplyOverrides().
InverseSquareLighting decoupling
src/Features/InverseSquareLighting.h, src/Features/InverseSquareLighting.cpp
Remove LightEditor member and include from InverseSquareLighting, update feature summary bullets, add WeatherEditor/EditorWindow.h include, and switch ProcessLight to use EditorWindow::GetSingleton()->lightEditor for ApplyOverrides and disable flags.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

Suggested reviewers

  • alandtse
  • davo0411

Poem

🐰 I hopped from feature into window's light,

Moved the editor where the settings sit right,
No flag to gate, one singleton calls,
Resets and gathers when the editor wakes,
A rabbit cheers the cleaner paths.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 5.56% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately captures the main refactoring effort: moving the inverse square lighting (isl) light editor from the InverseSquareLighting feature into the weather editor for centralized visual editing.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Warning

There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure.

🔧 OpenGrep (1.22.0)

OpenGrep fatal error (exit code 2): [00.11][ERROR]: Error: exception Unix_error: No such file or directory stat src/WeatherEditor/LightEditor.h
Raised by primitive operation at UTmp.replace_named_pipe_by_regular_file_if_needed in file "libs/commons/UTmp.ml", line 145, characters 8-27
Called from Scan_CLI.replace_target_roots_by_regular_files_where_needed.(fun) in file "src/osemgrep/cli_scan/Scan_CLI.ml", lines 1086-1087, characters 19-65
Called from List_.fast_map in file "libs/commons/List_.ml", line 81, characters 17-20
Called f


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@github-actions
Copy link
Copy Markdown

No actionable suggestions for changed features.

@SkrubbySkrubInAShrub SkrubbySkrubInAShrub added the deferred Defer to next cycle label May 24, 2026
Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 2

🧹 Nitpick comments (1)
src/WeatherEditor/EditorWindow.h (1)

67-68: PR metadata: tighten commit title and add issue linkage

Suggested title: refactor(weather-editor): migrate isl light editor
If this maps to a tracker item, add Addresses #<id> (or Implements #<id>).

As per coding guidelines **/*: “When reviewing PRs, please provide suggestions for Conventional Commit Titles … [and] Issue References.”

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@src/WeatherEditor/EditorWindow.h` around lines 67 - 68, Update the PR commit
title and description to follow Conventional Commits by using the suggested
title format (e.g., "refactor(weather-editor): migrate isl light editor") and,
if this change maps to a tracker item, append an issue reference like "Addresses
#<id>" or "Implements #<id>" in the PR description; mention the relevant symbol
(LightEditor in EditorWindow.h) in the PR body to provide context for reviewers.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@src/Features/InverseSquareLighting.cpp`:
- Around line 49-57: The code checks a non-existent member editorRef.enabled
causing a compile error; edit the conditional that sets
LightLimitFix::LightFlags::Disabled (the if using bsLight->pointLight, isInvSq,
and editorRef) to remove the stale "editorRef.enabled &&" clause so the decision
only depends on bsLight->pointLight and the editor flags
editorRef.disableInvSqLights / editorRef.disableRegularLights (keep the existing
isInvSq logic and the call to light.lightFlags.set(...)).

In `@src/WeatherEditor/EditorWindow.cpp`:
- Around line 1427-1429: EditorWindow::Draw() currently calls
lightEditor.GatherLights() only while open, so when open flips false the
LightEditor cleanup isn't run; update UpdateOpenState() to detect the open ->
closed transition and invoke a dedicated cleanup/restore method on lightEditor
(e.g., LightEditor::RestoreState() or LightEditor::ResetOverrides()) to perform
the same cleanup GatherLights() would do at close; if that method doesn't exist,
add it to LightEditor and have it clear selected overrides/restore state, then
call it from UpdateOpenState() when transitioning to closed.

---

Nitpick comments:
In `@src/WeatherEditor/EditorWindow.h`:
- Around line 67-68: Update the PR commit title and description to follow
Conventional Commits by using the suggested title format (e.g.,
"refactor(weather-editor): migrate isl light editor") and, if this change maps
to a tracker item, append an issue reference like "Addresses #<id>" or
"Implements #<id>" in the PR description; mention the relevant symbol
(LightEditor in EditorWindow.h) in the PR body to provide context for reviewers.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: e3767410-af44-4594-ab2f-06882a37adac

📥 Commits

Reviewing files that changed from the base of the PR and between 61675d5 and 659a24b.

📒 Files selected for processing (6)
  • src/Features/InverseSquareLighting.cpp
  • src/Features/InverseSquareLighting.h
  • src/WeatherEditor/EditorWindow.cpp
  • src/WeatherEditor/EditorWindow.h
  • src/WeatherEditor/LightEditor.cpp
  • src/WeatherEditor/LightEditor.h

Comment thread src/WeatherEditor/EditorWindow.cpp
@SkrubbySkrubInAShrub SkrubbySkrubInAShrub changed the title feat(weather-editor): move ISL editor into weather editor. refactor(weather-editor): migrate isl light editor May 24, 2026
@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 25, 2026

✅ A pre-release build is available for this PR:
Download

SkrubbySkrubInAShrub and others added 7 commits May 26, 2026 13:38
…d includes

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
… window

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…erEditor

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@src/Features/InverseSquareLighting.cpp`:
- Around line 49-57: The disableInvSqLights and disableRegularLights members of
LightEditor are read uninitialized by InverseSquareLighting::ProcessLight via
EditorWindow::GetSingleton()->lightEditor, causing indeterminate behavior;
initialize these flags to sensible defaults (e.g., false) by adding default
member initializers in the LightEditor declaration or setting them in
LightEditor’s constructor so EditorWindow::GetSingleton()->lightEditor has
well-defined values before any ImGui interaction.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: e0b1a506-2901-4252-95b4-4db1aee872df

📥 Commits

Reviewing files that changed from the base of the PR and between bf43ca6 and 30d6c3f.

📒 Files selected for processing (6)
  • src/Features/InverseSquareLighting.cpp
  • src/Features/InverseSquareLighting.h
  • src/WeatherEditor/EditorWindow.cpp
  • src/WeatherEditor/EditorWindow.h
  • src/WeatherEditor/LightEditor.cpp
  • src/WeatherEditor/LightEditor.h

Comment thread src/Features/InverseSquareLighting.cpp
@SkrubbySkrubInAShrub SkrubbySkrubInAShrub removed the deferred Defer to next cycle label May 31, 2026
@davo0411 davo0411 merged commit f62f4b1 into community-shaders:dev May 31, 2026
9 checks 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