feat(ui): add Sky Sync tooltips; fix overlay resizing#2045
Conversation
📝 WalkthroughWalkthroughThis PR modifies UI overlay behavior in two files: it removes the Changes
Possibly related PRs
Suggested reviewers
Poem
Estimated code review effort: 🎯 2 (Simple) | ⏱️ ~12 minutes 🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
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. Comment |
|
No actionable suggestions for changed features. |
There was a problem hiding this comment.
🧹 Nitpick comments (1)
src/Features/SkySync.cpp (1)
19-72: Consider consolidating repeated tooltip blocks with a local helper.This section repeats the same
HoverTooltipWrapperpattern many times; a tiny local helper would reduce copy/paste drift.♻️ Optional cleanup example
void SkySync::DrawSettings() { + auto drawTooltip = [](const char* text) { + if (auto _tt = Util::HoverTooltipWrapper()) + ImGui::TextUnformatted(text); + }; + ImGui::Checkbox("Enabled", &settings.Enabled); - if (auto _tt = Util::HoverTooltipWrapper()) { - ImGui::TextUnformatted("Enable or disable Sky Sync features."); - } + drawTooltip("Enable or disable Sky Sync features."); ImGui::Checkbox("Use alternate sun path", &settings.UseAlternateSunPath); - if (auto _tt = Util::HoverTooltipWrapper()) { - ImGui::TextUnformatted("Calculate sun position based on time of day and season instead of vanilla movement."); - } + drawTooltip("Calculate sun position based on time of day and season instead of vanilla movement.");🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@src/Features/SkySync.cpp` around lines 19 - 72, The UI code repeatedly calls Util::HoverTooltipWrapper followed by ImGui::TextUnformatted/Text, so introduce a small local helper (lambda or static inline function) inside the function that renders this panel—e.g., a helper named ShowTooltip(const char* msg) that wraps the pattern (if (auto _tt = Util::HoverTooltipWrapper()) ImGui::TextUnformatted(msg);) and then replace each direct Util::HoverTooltipWrapper block (the occurrences around "Enable or disable Sky Sync features.", "Calculate sun position...", "Choose the trajectory...", "Set a custom angle...", "Select which moon...", and all sunrise/sunset tooltip strings) with calls to ShowTooltip; keep special-case ImGui::Text calls by using the same helper or adding an overload for formatted text if needed, and leave SetSunAngle(), settings.* and ImGui widgets unchanged.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Nitpick comments:
In `@src/Features/SkySync.cpp`:
- Around line 19-72: The UI code repeatedly calls Util::HoverTooltipWrapper
followed by ImGui::TextUnformatted/Text, so introduce a small local helper
(lambda or static inline function) inside the function that renders this
panel—e.g., a helper named ShowTooltip(const char* msg) that wraps the pattern
(if (auto _tt = Util::HoverTooltipWrapper()) ImGui::TextUnformatted(msg);) and
then replace each direct Util::HoverTooltipWrapper block (the occurrences around
"Enable or disable Sky Sync features.", "Calculate sun position...", "Choose the
trajectory...", "Set a custom angle...", "Select which moon...", and all
sunrise/sunset tooltip strings) with calls to ShowTooltip; keep special-case
ImGui::Text calls by using the same helper or adding an overload for formatted
text if needed, and leave SetSunAngle(), settings.* and ImGui widgets unchanged.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Run ID: b1e98e07-1608-45d4-adcf-63d960ab9dd0
📒 Files selected for processing (2)
src/Features/PerformanceOverlay.cppsrc/Features/SkySync.cpp
|
✅ A pre-release build is available for this PR: |
alandtse
left a comment
There was a problem hiding this comment.
Please make atomic prs.
Summary by CodeRabbit