feat(wetness): add wetness overriding for debug and screen archery#1339
Conversation
WalkthroughA new Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~15 minutes Poem
✨ Finishing Touches
🧪 Generate unit tests
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. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
Documentation and Community
|
Automated formatting by clang-format, prettier, and other hooks. See https://pre-commit.ci for details.
There was a problem hiding this comment.
Actionable comments posted: 0
🧹 Nitpick comments (1)
src/Features/WetnessEffects.h (1)
73-82: Well-designed debug settings structure.The
DebugSettingsstruct is well-structured with clear boolean flags and efficientfloat2usage for interior/exterior value pairs. The naming convention is consistent and descriptive.Consider renaming
EnableIntExOverridetoEnableInteriorExteriorOverridefor improved clarity:- bool EnableIntExOverride = false; + bool EnableInteriorExteriorOverride = false;
📜 Review details
Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (2)
src/Features/WetnessEffects.cpp(4 hunks)src/Features/WetnessEffects.h(1 hunks)
🧰 Additional context used
🧠 Learnings (3)
📓 Common learnings
Learnt from: alandtse
PR: doodlum/skyrim-community-shaders#0
File: :0-0
Timestamp: 2025-06-24T07:17:36.604Z
Learning: When reviewing PRs, always clarify the scope if there are multiple related features or dependencies. WeatherPicker was a separate PR that was already merged, while this PR focuses specifically on WetnessEffects climate preset system enhancements.
src/Features/WetnessEffects.h (1)
Learnt from: alandtse
PR: doodlum/skyrim-community-shaders#0
File: :0-0
Timestamp: 2025-06-24T07:17:36.604Z
Learning: When reviewing PRs, always clarify the scope if there are multiple related features or dependencies. WeatherPicker was a separate PR that was already merged, while this PR focuses specifically on WetnessEffects climate preset system enhancements.
src/Features/WetnessEffects.cpp (1)
Learnt from: alandtse
PR: doodlum/skyrim-community-shaders#0
File: :0-0
Timestamp: 2025-06-24T07:17:36.604Z
Learning: When reviewing PRs, always clarify the scope if there are multiple related features or dependencies. WeatherPicker was a separate PR that was already merged, while this PR focuses specifically on WetnessEffects climate preset system enhancements.
🔇 Additional comments (5)
src/Features/WetnessEffects.cpp (5)
35-43: LGTM! Complete and consistent serialization.The JSON serialization for
DebugSettingsincludes all struct members and follows the established pattern used elsewhere in the codebase.
491-513: Excellent debug UI implementation.The debug settings UI is well-designed with proper conditional rendering, appropriate value ranges, and helpful tooltips. The use of
SliderFloat2for interior/exterior pairs is intuitive and efficient.
749-767: Correct debug override implementation.The override logic properly handles interior/exterior conditions and correctly applies debug values after normal calculations. The fallback behavior when
EnableIntExOverrideis false (using exterior values for interior) is appropriate.
806-808: Safe and backward-compatible settings loading.The conditional loading of debug settings prevents issues with older configuration files while properly deserializing the new debug settings when present.
815-815: Simple and correct settings persistence.The debug settings are properly saved to the JSON configuration, ensuring persistence across application sessions.
|
✅ A pre-release build is available for this PR: |
This pull request introduces a new
DebugSettingsfeature to theWetnessEffectssystem, allowing developers to override and customize wetness, puddle, and rain effects for debugging purposes. Key changes include the addition of theDebugSettingsstructure, integration into the settings system, and updates to the rendering logic to respect these overrides.Addition of
DebugSettings:src/Features/WetnessEffects.h: Added aDebugSettingsstruct with boolean flags for enabling overrides andfloat2values for specifying wetness, puddle wetness, and rain overrides. Integrated this struct into theWetnessEffectsclass.Integration into settings system:
src/Features/WetnessEffects.cpp: UpdatedLoadSettingsandSaveSettingsmethods to handle the serialization and deserialization ofDebugSettings.UI updates for debugging:
src/Features/WetnessEffects.cpp: Enhanced theDrawSettingsmethod to include a new "Debug" section in the UI, allowing users to toggle overrides and adjust their values interactively.Rendering logic adjustments:
src/Features/WetnessEffects.cpp: Modified theGetCommonBufferDatamethod to applyDebugSettingsoverrides to wetness, puddle wetness, and rain values, with support for interior/exterior differentiation.Serialization support:
src/Features/WetnessEffects.cpp: Added aNLOHMANN_DEFINE_TYPE_NON_INTRUSIVE_WITH_DEFAULTmacro forDebugSettingsto enable JSON serialization and deserialization.Summary by CodeRabbit