feat(ui): cleaned uninstalled feature missing ini message, added "required-version" based on cs version#1153
feat(ui): cleaned uninstalled feature missing ini message, added "required-version" based on cs version#1153davo0411 wants to merge 25 commits into
Conversation
## Walkthrough
This change refines feature version error handling by normalizing minimal required version strings for consistent messaging and adding detailed version info when feature INI files are missing. It alters UI behavior by changing the default of `DrawFailLoadMessage()` to false, updating `DrawUnloadedUI()` to show dynamic messages, and removing several feature-specific UI methods and failure message renderings.
## Changes
| File(s) | Change Summary |
|-------------------------------------------|----------------------------------------------------------------------------------------------------|
| src/Feature.cpp, src/Feature.h | Normalized minimal required version strings; changed default `DrawFailLoadMessage()` to false; updated error message construction and UI logic for unloaded features. |
| src/Features/TerrainHelper.cpp, .h | Removed `DrawUnloadedUI()` and `DrawFailLoadMessage()` methods and their declarations; updated feature summary with usage note. |
| src/Features/TerrainVariation.cpp, .h | Removed `DrawFailLoadMessage()` method and declaration; changed feature summary wording from "Reduces" to "Removes" terrain texture tiling. |
| src/Menu.cpp | Removed conditional UI rendering of feature failure messages in the feature configuration interface. |
| src/FeatureIssues.cpp | Applied version string cleaning utility to display version info in feature issue UI elements. |
| src/Utils/Format.cpp, .h | Added `Util::CleanVersionString()` function to remove trailing "-0" suffix from version strings. |
## Sequence Diagram(s)
```mermaid
sequenceDiagram
participant User
participant Menu
participant Feature
User->>Menu: Open feature configuration
Menu->>Feature: Check if feature is loaded
alt Feature not loaded
Feature->>Feature: Get minimal required version (normalize string)
Feature-->>Menu: Return required version or "Unknown"
Menu->>User: Display detailed error message with required version info
else Feature loaded
Menu->>Feature: Render feature settings UI
Feature-->>Menu: UI elements
Menu->>User: Show settings
endPossibly related PRs
Poem
|
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: 2
🧹 Nitpick comments (3)
src/Features/TerrainVariation.h (1)
26-32: Bullet wording contradicts the preceding descriptionLine 26 says the feature “reduces the repeating pattern”, while the new bullet (line 28) claims it “Removes terrain texture tiling”. “Removes” is a stronger statement than “reduces” and may set unrealistic expectations.
Consider making the wording consistent (e.g., “Reduces terrain texture tiling”) or adjusting the description above the bullet to match the stronger claim.
src/Feature.cpp (1)
110-114: Minor UX: “Version required: Unknown” may confuse usersIf the feature’s short-name is missing from
FEATURE_MINIMAL_VERSIONS,GetRequiredVersion()returns"Unknown", resulting in a message like
“… not installed! Version required: Unknown”.
That does not help users understand what they need to install.
- Detect the
"Unknown"sentinel and tailor the message, e.g.failedLoadedMessage = std::format( "The {} file is missing. This feature is not installed!", ini_filename);
- Alternatively, enrich
FEATURE_MINIMAL_VERSIONSso “unknown” never happens.src/Feature.h (1)
72-88: Guard UI calls when message/summary are empty
DrawUnloadedUI()now prints the description and key-feature list unconditionally when non-empty – good.
However,ImGui::Spacing()is always called after each block, which can leave trailing blank space if, say, there is no description but there are key features.Wrap each
ImGui::Spacing()inside the sameifthat prints the preceding block to avoid extra padding.
📜 Review details
Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (7)
src/Feature.cpp(2 hunks)src/Feature.h(1 hunks)src/Features/TerrainHelper.cpp(0 hunks)src/Features/TerrainHelper.h(0 hunks)src/Features/TerrainVariation.cpp(0 hunks)src/Features/TerrainVariation.h(1 hunks)src/Menu.cpp(0 hunks)
💤 Files with no reviewable changes (4)
- src/Features/TerrainVariation.cpp
- src/Features/TerrainHelper.cpp
- src/Features/TerrainHelper.h
- src/Menu.cpp
⏰ Context from checks skipped due to timeout of 90000ms (1)
- GitHub Check: Build plugin and addons
|
✅ A pre-release build is available for this PR: |
alandtse
left a comment
There was a problem hiding this comment.
Removing a virtual function from feature.h needs to be justified. It's used by every feature.
Automated formatting by clang-format, prettier, and other hooks. See https://pre-commit.ci for details.
Automated formatting by clang-format, prettier, and other hooks. See https://pre-commit.ci for details.
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/Utils/Format.h (1)
9-10: Preferstd::string_view(and add brief doc comment) for zero-copy inputThe new helper doesn’t need ownership of the input; taking a
std::string_viewavoids unnecessary allocations when the caller already has a view or a temporary.
While touching the declaration, add a one-liner comment (as done forFixFilePath) to keep the public API self-documenting.- std::string CleanVersionString(const std::string& versionString); + /** + * @brief Strips trailing “-0” from semantic version strings (e.g. “1-2-3-0” → “1-2-3”). + */ + std::string CleanVersionString(std::string_view versionString);(Implementation change is trivial: accept
std::string_viewand construct the returnstd::stringat the end.)Please confirm no call-sites rely on mutating the argument; a
ripgrepforCleanVersionString(will show all usages.
📜 Review details
Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (5)
src/Feature.cpp(7 hunks)src/Feature.h(3 hunks)src/FeatureIssues.cpp(4 hunks)src/Utils/Format.cpp(1 hunks)src/Utils/Format.h(1 hunks)
✅ Files skipped from review due to trivial changes (2)
- src/Utils/Format.cpp
- src/FeatureIssues.cpp
🚧 Files skipped from review as they are similar to previous changes (2)
- src/Feature.h
- src/Feature.cpp
⏰ Context from checks skipped due to timeout of 90000ms (1)
- GitHub Check: Build plugin and addons
Automated formatting by clang-format, prettier, and other hooks. See https://pre-commit.ci for details.
Automated formatting by clang-format, prettier, and other hooks. See https://pre-commit.ci for details.
|
Pushed the function to Format.cpp/h. I think its been shrunk as much as it can. |
There was a problem hiding this comment.
Please walk through all edge cases in the Advanced Ini test section. Your edits will break proper detection of bad inis and resurface cleaned up items. Until you understand what this code is doing for each edge case, this PR won't work.
Perhaps you should consider scoping down to a refactor of the messages so you focus on the stuff that won't break the main logic,
|
|
||
| if (rc < 0) { | ||
| if (!FeatureIssues::IsObsoleteFeature(GetShortName())) | ||
| if (FeatureIssues::IsObsoleteFeature(GetShortName())) { |
There was a problem hiding this comment.
No. This doesn't make sense. If the file is deleted we don't have to talk about it.
| FeatureIssues::FeatureIssueInfo::IssueType::OBSOLETE, fileInfo, ""); | ||
| } else { | ||
| logger::info("{} failed to load, feature disabled", ini_filename); | ||
|
|
There was a problem hiding this comment.
Same here. I don't think you understand the code. The ini is missing because they didn't install or deleted it. Why is that an issue to raise?
|
to simplify: Just use minimumVersionRequired in FeatureIssue.cpp and print that in the uninstall error. |
|
Perhaps. Honestly this must be redundant with feature issues. You can probably sync some language or something. |

Cleans up the duplicate error messages when features are uninstalled or not loaded.
Adds a statement "Version required 1-0-0" (or whatever version).
This indicates to users who might not have the latest base cs the specific version they should download to avoid conflicts.
Summary by CodeRabbit
New Features
Bug Fixes
Refactor
Style