Skip to content

feat(ui): subheading icons, fixed icon scaling issues, feature subheading changes#1298

Merged
doodlum merged 15 commits into
community-shaders:devfrom
davo0411:subheading-fixes
Jul 24, 2025
Merged

feat(ui): subheading icons, fixed icon scaling issues, feature subheading changes#1298
doodlum merged 15 commits into
community-shaders:devfrom
davo0411:subheading-fixes

Conversation

@davo0411
Copy link
Copy Markdown
Collaborator

@davo0411 davo0411 commented Jul 23, 2025

2060C8~1

  • Made icon scaling match text scaling, now they are in sync perfectly.
  • Added icons by @dem6nd to subheadings.
  • Added "Materials" category for some features to move to.

Summary by CodeRabbit

  • New Features

    • Added category icons to the menu UI, enhancing visual navigation for categories such as Characters, Grass, Lighting, Sky, Landscape, Water, Debug, and Materials.
    • Introduced a new "Debug" category and reorganized the display order of categories in the settings menu.
    • Added a category label for the VR feature.
  • Improvements

    • Updated feature categories for Dynamic Cubemaps, Extended Materials, Extended Translucency, and Skylighting to ensure more consistent classification.
    • Enhanced resource management by ensuring all category icon textures are properly released when the menu is closed.

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Jul 23, 2025

"""

Walkthrough

This update standardizes and reorganizes feature category assignments by modifying the return values of GetCategory() methods across several feature classes. It introduces a new GetCategory() override in the VR feature, adds new category icon fields to the menu, and updates menu UI logic to load and display new category icons with headers.

Changes

Files / Groups Change Summary
src/Features/DynamicCubemaps.h
src/Features/ExtendedTranslucency.h
Changed GetCategory() return value from "Lighting" to "Materials".
src/Features/ExtendedMaterials.h Changed GetCategory() return value from "Landscape & Textures" to "Materials".
src/Features/Skylighting.h Changed GetCategory() return value from "Sky" to "Lighting".
src/Features/VR.h Added new GetCategory() override returning "Debug".
src/Menu.cpp Updated destructor to release new category icons; modified category display order in DrawSettings().
src/Menu.h Added new category icon fields to UIIcons struct in Menu class.
src/Utils/UI.cpp Extended icon loading logic and menu header rendering to support new category icons and dynamic layout.

Sequence Diagram(s)

sequenceDiagram
    participant User
    participant Menu
    participant UIUtils
    participant Features

    User->>Menu: Open settings menu
    Menu->>UIUtils: DrawSettings()
    loop For each category in new order
        UIUtils->>Features: GetCategory() for each feature
        Features-->>UIUtils: Return category string
        UIUtils->>Menu: Select category icon based on category
        UIUtils->>Menu: DrawCategoryHeader(categoryName, isExpanded, count)
        Menu-->>User: Rendered header with icon and text
    end
Loading

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~7 minutes

Possibly related PRs

Suggested reviewers

  • doodlum
  • alandtse

Poem

🐰✨
A hop and a skip, new icons appear,
Categories shuffled, their meanings now clear.
Materials and Debug, with icons in tow,
The menu’s refreshed with a radiant glow!
Bunnies rejoice as the headers align—
A UI update, simply divine!

"""

Note

⚡️ Unit Test Generation is now available in beta!

Learn more here, or try it out under "Finishing Touches" below.


📜 Recent review details

Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between f35d0a7 and 8b7eb8e.

📒 Files selected for processing (1)
  • src/Utils/UI.cpp (4 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • src/Utils/UI.cpp
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
  • GitHub Check: Build plugin and addons
✨ Finishing Touches
  • 📝 Generate Docstrings
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment

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
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Explain this complex logic.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai explain this code block.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and explain its main purpose.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Support

Need 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)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai generate unit tests to generate unit tests for this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@davo0411 davo0411 changed the title feat(ui): subheading icons & fixed icon scaling issues feat(ui): subheading icons, fixed icon scaling issues, feature subheading changes Jul 23, 2025
Automated formatting by clang-format, prettier, and other hooks.
See https://pre-commit.ci for details.
@github-actions
Copy link
Copy Markdown

github-actions Bot commented Jul 23, 2025

Using provided base ref: 89b32f7
Using base ref: 89b32f7
Base commit date: 2025-07-24T11:36:49+01:00 (Thursday, July 24, 2025 11:36 AM)
No actionable suggestions for changed features.

@davo0411 davo0411 marked this pull request as ready for review July 23, 2025 12:02
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: 3

📜 Review details

Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between be2ddc6 and 2bb3de4.

⛔ Files ignored due to path filters (7)
  • package/Interface/CommunityShaders/Icons/Categories/characters.png is excluded by !**/*.png
  • package/Interface/CommunityShaders/Icons/Categories/debug.png is excluded by !**/*.png
  • package/Interface/CommunityShaders/Icons/Categories/grass.png is excluded by !**/*.png
  • package/Interface/CommunityShaders/Icons/Categories/landscape.png is excluded by !**/*.png
  • package/Interface/CommunityShaders/Icons/Categories/lighting.png is excluded by !**/*.png
  • package/Interface/CommunityShaders/Icons/Categories/sky.png is excluded by !**/*.png
  • package/Interface/CommunityShaders/Icons/Categories/water.png is excluded by !**/*.png
📒 Files selected for processing (9)
  • package/Interface/CommunityShaders/Icons/Categories/LICENCE.txt (1 hunks)
  • src/Features/DynamicCubemaps.h (1 hunks)
  • src/Features/ExtendedMaterials.h (1 hunks)
  • src/Features/ExtendedTranslucency.h (1 hunks)
  • src/Features/Skylighting.h (1 hunks)
  • src/Features/VR.h (1 hunks)
  • src/Menu.cpp (2 hunks)
  • src/Menu.h (1 hunks)
  • src/Utils/UI.cpp (4 hunks)
🧠 Learnings (3)
src/Features/ExtendedTranslucency.h (1)

Learnt from: alandtse
PR: #577
File: features/Wetness Effects/Shaders/WetnessEffects/WetnessEffects.hlsli:57-61
Timestamp: 2025-06-17T05:40:22.785Z
Learning: Default parameter values are supported in the HLSL compiler used by the skyrim-community-shaders project, contrary to standard HLSL (FXC/DXC) limitations.

src/Features/DynamicCubemaps.h (1)

Learnt from: jiayev
PR: doodlum/skyrim-community-shaders#0
File: :0-0
Timestamp: 2025-07-18T15:21:03.641Z
Learning: In the skyrim-community-shaders rendering pipeline, materials with alpha < 1 or alpha blending enabled are rendered in non-deferred mode rather than deferred mode. This means issues with dynamic cubemaps on transparent materials are actually non-deferred rendering issues.

src/Utils/UI.cpp (1)

Learnt from: davo0411
PR: #1107
File: src/Menu.cpp:310-315
Timestamp: 2025-05-31T02:51:24.195Z
Learning: In the Community Shaders codebase, when validating UI icons, checking for texture presence (non-null pointer) is sufficient. Avoid adding dimension validation checks as icon sizes should vary based on user needs (4K+ resolution users may want higher resolution icons). Don't artificially limit icon dimensions.

🧰 Additional context used
🧠 Learnings (3)
src/Features/ExtendedTranslucency.h (1)

Learnt from: alandtse
PR: #577
File: features/Wetness Effects/Shaders/WetnessEffects/WetnessEffects.hlsli:57-61
Timestamp: 2025-06-17T05:40:22.785Z
Learning: Default parameter values are supported in the HLSL compiler used by the skyrim-community-shaders project, contrary to standard HLSL (FXC/DXC) limitations.

src/Features/DynamicCubemaps.h (1)

Learnt from: jiayev
PR: doodlum/skyrim-community-shaders#0
File: :0-0
Timestamp: 2025-07-18T15:21:03.641Z
Learning: In the skyrim-community-shaders rendering pipeline, materials with alpha < 1 or alpha blending enabled are rendered in non-deferred mode rather than deferred mode. This means issues with dynamic cubemaps on transparent materials are actually non-deferred rendering issues.

src/Utils/UI.cpp (1)

Learnt from: davo0411
PR: #1107
File: src/Menu.cpp:310-315
Timestamp: 2025-05-31T02:51:24.195Z
Learning: In the Community Shaders codebase, when validating UI icons, checking for texture presence (non-null pointer) is sufficient. Avoid adding dimension validation checks as icon sizes should vary based on user needs (4K+ resolution users may want higher resolution icons). Don't artificially limit icon dimensions.

⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
  • GitHub Check: Build plugin and addons
🔇 Additional comments (11)
src/Features/ExtendedTranslucency.h (1)

13-13: LGTM: Clean category reassignment

The category change from "Lighting" to "Materials" aligns with the PR's UI reorganization objectives and maintains consistent method signature.

package/Interface/CommunityShaders/Icons/Categories/LICENCE.txt (1)

1-21: LGTM: Standard MIT license for UI icons

The MIT license is properly formatted and appropriately placed for the new category icons. The copyright attribution and terms are clear and standard.

src/Features/VR.h (1)

49-49: LGTM: Consistent GetCategory() implementation

The new GetCategory() method follows the established pattern with proper const qualifier and string_view return type. The "Debug" category assignment is appropriate for the VR feature.

src/Features/ExtendedMaterials.h (1)

14-14: LGTM: Appropriate category reassignment

The change from "Landscape & Textures" to "Materials" better reflects the feature's focus on material effects and aligns with the broader UI reorganization effort.

src/Features/DynamicCubemaps.h (1)

105-105: LGTM: Logical category update

The reassignment from "Lighting" to "Materials" makes sense since dynamic cubemaps primarily serve material reflection purposes. This change maintains consistency with other features in the Materials category.

src/Features/Skylighting.h (1)

21-21: Category update looks good.

The change from "Sky" to "Lighting" is a logical categorization for the Skylighting feature, as it primarily deals with lighting calculations rather than sky rendering.

src/Menu.h (1)

78-89: UIIcon additions are well-structured.

The new category icon members follow the existing pattern and are clearly named. Good documentation with the placeholder comment for materials and the generic purpose of the "other" icon.

src/Menu.cpp (2)

216-224: Proper cleanup of new icon resources.

Good addition of release calls for all new category icons in the destructor, preventing resource leaks.


1049-1049: Logical category ordering.

The updated category order with "Debug" first and "Materials" positioned between "Lighting" and "Sky" provides a sensible grouping of related features.

src/Utils/UI.cpp (2)

458-521: Well-implemented icon rendering with dynamic scaling.

The icon rendering implementation properly scales with font size and applies consistent color tinting. The layout calculations correctly account for the icon dimensions.


166-305: Verify complete integration of the "other" category icon.

The "other" icon appears to be only partially implemented. It's declared in Menu.h but missing from:

  1. The texture pointer array for cleanup (line 166)
  2. The loading logic (lines 239-304)
  3. The destructor in Menu.cpp

Please ensure the "other" icon is fully integrated across all relevant files.

Comment thread src/Utils/UI.cpp Outdated
Comment thread src/Utils/UI.cpp Outdated
Comment thread src/Utils/UI.cpp
Comment on lines +431 to +447
if (strcmp(categoryName, "Characters") == 0) {
categoryIcon = menu.characters.texture;
} else if (strcmp(categoryName, "Grass") == 0) {
categoryIcon = menu.grass.texture;
} else if (strcmp(categoryName, "Lighting") == 0) {
categoryIcon = menu.lighting.texture;
} else if (strcmp(categoryName, "Sky") == 0) {
categoryIcon = menu.sky.texture;
} else if (strcmp(categoryName, "Landscape & Textures") == 0) {
categoryIcon = menu.landscape.texture;
} else if (strcmp(categoryName, "Water") == 0) {
categoryIcon = menu.water.texture;
} else if (strcmp(categoryName, "Debug") == 0) {
categoryIcon = menu.debug.texture;
} else if (strcmp(categoryName, "Materials") == 0) {
categoryIcon = menu.materials.texture;
}
Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot Jul 23, 2025

Choose a reason for hiding this comment

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

🛠️ Refactor suggestion

Add icon mapping for "Other" category.

The icon selection logic should include handling for the "Other" category to ensure all categories have proper icon display.

 } else if (strcmp(categoryName, "Materials") == 0) {
     categoryIcon = menu.materials.texture;
+} else if (strcmp(categoryName, "Other") == 0) {
+    categoryIcon = menu.other.texture;
 }
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
if (strcmp(categoryName, "Characters") == 0) {
categoryIcon = menu.characters.texture;
} else if (strcmp(categoryName, "Grass") == 0) {
categoryIcon = menu.grass.texture;
} else if (strcmp(categoryName, "Lighting") == 0) {
categoryIcon = menu.lighting.texture;
} else if (strcmp(categoryName, "Sky") == 0) {
categoryIcon = menu.sky.texture;
} else if (strcmp(categoryName, "Landscape & Textures") == 0) {
categoryIcon = menu.landscape.texture;
} else if (strcmp(categoryName, "Water") == 0) {
categoryIcon = menu.water.texture;
} else if (strcmp(categoryName, "Debug") == 0) {
categoryIcon = menu.debug.texture;
} else if (strcmp(categoryName, "Materials") == 0) {
categoryIcon = menu.materials.texture;
}
if (strcmp(categoryName, "Characters") == 0) {
categoryIcon = menu.characters.texture;
} else if (strcmp(categoryName, "Grass") == 0) {
categoryIcon = menu.grass.texture;
} else if (strcmp(categoryName, "Lighting") == 0) {
categoryIcon = menu.lighting.texture;
} else if (strcmp(categoryName, "Sky") == 0) {
categoryIcon = menu.sky.texture;
} else if (strcmp(categoryName, "Landscape & Textures") == 0) {
categoryIcon = menu.landscape.texture;
} else if (strcmp(categoryName, "Water") == 0) {
categoryIcon = menu.water.texture;
} else if (strcmp(categoryName, "Debug") == 0) {
categoryIcon = menu.debug.texture;
} else if (strcmp(categoryName, "Materials") == 0) {
categoryIcon = menu.materials.texture;
} else if (strcmp(categoryName, "Other") == 0) {
categoryIcon = menu.other.texture;
}
🤖 Prompt for AI Agents
In src/Utils/UI.cpp around lines 431 to 447, the icon selection logic lacks a
case for the "Other" category, causing it to miss an appropriate icon. Add an
else-if condition to check if categoryName equals "Other" and assign the
corresponding icon from menu.other.texture to categoryIcon to ensure all
categories have proper icon display.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Maybe a problem?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🧩 Analysis chain

Let me investigate whether the "Other" category is actually used in the codebase and if the missing mapping would cause issues.


🏁 Script executed:

# Search for "Other" category usage in the codebase
rg '"Other"' -A 2 -B 2

# Look for category definitions and usage patterns
rg 'GetCategory.*return' -A 1 -B 1

# Check what categories are defined in Menu.cpp predefined order
rg 'predefinedOrder.*=|predefinedOrder' -A 10 -B 2

Length of output: 9565


@doodlum You're right to question this! After investigating the codebase, this is actually a problem. Here's what I found:

The search results show that:

  1. "Other" is a real category - it's included in the predefined category order in Menu.cpp: "Debug", "Characters", "Grass", "Lighting", "Materials", "Sky", "Landscape & Textures", "Water", "Other"

  2. "Other" is the default fallback - in Feature.h, the base GetCategory() method returns "Other" by default for any features that don't override it

  3. The UI will display "Other" category headers - since it's in the category order, but without the icon mapping, these headers won't show an icon while all other categories will

This creates inconsistent UI behavior where some category headers have icons and others don't, even though the menu.other.texture icon exists (as mentioned in the AI summary).

The missing mapping means any features using the default "Other" category will have headers without icons, which breaks the visual consistency of the interface. My original suggestion to add the "Other" category mapping is indeed necessary for proper UI functionality.


🏁 Script executed:

# Check if "other" icon is loaded in InitializeMenuIcons
rg "other\." src/Utils/UI.cpp -A 2 -B 2

# Verify if there's an "other" icon file that should be loaded
fd "other.png" --type f

Length of output: 65


Let me check what's actually defined in the Menu.h structure and what category icon files exist:


🏁 Script executed:

# Check the UIIcons struct definition in Menu.h
rg "struct UIIcons|UIIcon.*other|UIIcon.*materials" src/Menu.h -A 10 -B 2

# List all icon files in the Categories directory
fd . "package/Interface/CommunityShaders/Icons/Categories" --type f

# Check if there are any icon files with "other" in the name
fd "other" --type f

Length of output: 1507


Perfect! Now I can see the full scope of the issue. You're absolutely right to be concerned - this is a problem, and it's actually bigger than just the missing mapping.

Here's what I found:

  1. The other icon IS defined in Menu.h: UIIcon other; // Generic icon for other/misc categories

  2. But the other.png file doesn't exist - the Categories directory has icons for all other categories (characters, debug, grass, landscape, lighting, materials, sky, water) but no other.png

  3. The loading code is also missing - InitializeMenuIcons doesn't attempt to load the other icon

  4. And the mapping is missing - which is what my original suggestion addressed

So there are actually three missing pieces:

  • The other.png icon file itself
  • Loading the icon in InitializeMenuIcons
  • Mapping the icon in DrawCategoryHeader

This means any features using the default "Other" category (which is the fallback for features that don't specify a category) will have inconsistent header display compared to other categories.

My original suggestion to add the mapping is still valid and necessary - even if the icon file doesn't exist yet, the mapping should be there so when the icon is eventually added, it will work properly. The code gracefully handles missing textures (nullptr), so adding the mapping won't break anything.

The issue affects UI consistency since "Other" is a real category that appears in the interface but won't display an icon like all the others do.


🧬 Code Graph Analysis Results

Relevant snippets from src/Utils/UI.h (lines 53-350 approx)

This header declares the classes and functions implemented in src/Utils/UI.cpp. It includes:

  • HoverTooltipWrapper class: RAII wrapper for ImGui tooltips on hovered items.
  • DisableGuard class: RAII wrapper for ImGui disabled state.
  • StyledButtonWrapper class: RAII wrapper for pushing/popping button style colors.
  • SectionWrapper class: RAII wrapper for drawing section headers with optional description and color.
  • Functions for UI elements:
    • PercentageSlider: slider for float values shown as percentages.
    • GetNativeViewportSizeScaled: returns scaled viewport size.
    • LoadTextureFromFile: loads a texture from file into a D3D11 shader resource view.
    • InitializeMenuIcons: loads multiple icons for the menu.
    • DrawSharpText: draws text aligned to pixel grid with optional scaling.
    • DrawAlignedTextWithLogo: draws text with a logo icon aligned vertically.
    • DrawCategoryHeader: draws a collapsible category header with icon and lines.
    • DrawSectionHeader: draws a styled section header, optionally collapsible.
    • ColorCodedValueConfig struct and related functions for color-coded value display.
    • DrawColorCodedValue: draws a label and a color-coded value with optional tooltip.
    • DrawMultiLineTooltip and DrawColoredMultiLineTooltip: draw multi-line tooltips with optional colors.
    • Table sorting and rendering helpers:
      • ShowSortedStringTableStrings: renders a sortable ImGui table for string data.
      • ShowSortedStringTableCustom: templated function to render sortable tables for custom row types.

These declarations provide context for the implementations in UI.cpp.


Relevant snippets from src/Menu.h (lines 16-20)

static Menu* GetSingleton()
{
	static Menu menu;
	return &menu;
}

This singleton accessor is used in UI.cpp to get the global menu instance for accessing UI icons and theme colors.


Relevant snippets from src/Menu.cpp (lines 721-732)

void operator()(const CategoryHeader& header)
{
	// Get expansion state from static map
	bool isExpanded = categoryExpansionStates[header.name];

	// Draw category header with custom styling using util:UI function
	int count = categoryCounts[std::string(header.name)];
	Util::DrawCategoryHeader(header.name.c_str(), isExpanded, count);

	// Update expansion state
	categoryExpansionStates[header.name] = isExpanded;
}

This snippet shows usage of Util::DrawCategoryHeader from UI.cpp to render category headers with expansion state.


Relevant snippets from src/Menu.cpp (lines 733-779)

void operator()(Feature* feat)
{
	const auto featureName = feat->GetShortName();
	bool isDisabled = globals::state->IsFeatureDisabled(featureName);
	bool isLoaded = feat->loaded;
	bool hasFailedMessage = !feat->failedLoadedMessage.empty();
	auto& themeSettings = globals::menu->settings.Theme;

	ImVec4 textColor;

	// Determine the text color based on the state
	if (isDisabled) {
		textColor = themeSettings.StatusPalette.Disable;
	} else if (isLoaded) {
		textColor = ImGui::GetStyleColorVec4(ImGuiCol_Text);
	} else if (hasFailedMessage) {
		textColor = feat->version.empty() ? themeSettings.StatusPalette.Disable : themeSettings.StatusPalette.Error;
	} else {
		// No failed message but not loaded - check if INI file exists
		if (!std::filesystem::exists(Util::PathHelpers::GetFeatureIniPath(feat->GetShortName()))) {
			// INI file missing - treat as missing feature (grey)
			textColor = themeSettings.StatusPalette.Disable;
		} else {
			// INI file exists but feature not loaded - truly pending restart (green)
			textColor = themeSettings.StatusPalette.RestartNeeded;
		}
	}

	// Set text color
	ImGui::PushStyleColor(ImGuiCol_Text, textColor);

	// Create selectable item
	if (ImGui::Selectable(fmt::format(" {} ", feat->GetName()).c_str(), selectedMenuRef == listId, ImGuiSelectableFlags_SpanAllColumns)) {
		selectedMenuRef = listId;
	}

	// Restore original text color
	ImGui::PopStyleColor();

	// Display version if loaded
	if (isLoaded) {
		ImGui::SameLine();
		std::string formattedVersion = feat->version;
		std::replace(formattedVersion.begin(), formattedVersion.end(), '-', '.');
		ImGui::TextDisabled(fmt::format("({})", formattedVersion).c_str());
	}
}

This snippet shows feature list rendering using ImGui, with color coding and selectable items. It uses Util::PathHelpers::GetFeatureIniPath and theme colors from the menu singleton.


Relevant snippets from src/Menu.cpp (lines 800-1007)

This large snippet shows detailed UI rendering for a feature's settings and about tabs, including:

  • Handling disabled, loaded, failed, and unloaded states.
  • Drawing feature settings or unloaded UI.
  • Showing error messages.
  • About tab with status and description.
  • Buttons for enabling/disabling at boot and restoring defaults.
  • Tooltips using Util::HoverTooltipWrapper.
  • Uses Util::PathHelpers::GetFeatureIniPath and theme colors.

Summary of relevance

  • The UI.cpp file implements many UI helper functions and wrappers used throughout the UI code.
  • The InitializeMenuIcons function loads icons used in category headers and elsewhere.
  • The DrawCategoryHeader and DrawSectionHeader functions provide styled headers with icons and lines.
  • The HoverTooltipWrapper is used for tooltips in multiple places.
  • The Menu singleton is accessed for icons and theme colors.
  • The Menu.cpp snippets show usage of these UI helpers for rendering feature lists and category headers.
  • The PathHelpers::GetFeatureIniPath function is referenced for checking feature INI files, relevant to feature UI states.

No other snippets from the provided list appear directly relevant to understanding or addressing the code in src/Utils/UI.cpp.


🧠 Learnings used
Learnt from: davo0411
PR: doodlum/skyrim-community-shaders#1107
File: src/Menu.cpp:310-315
Timestamp: 2025-05-31T02:51:24.195Z
Learning: In the Community Shaders codebase, when validating UI icons, checking for texture presence (non-null pointer) is sufficient. Avoid adding dimension validation checks as icon sizes should vary based on user needs (4K+ resolution users may want higher resolution icons). Don't artificially limit icon dimensions.

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.

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

🧹 Nitpick comments (2)
package/Interface/CommunityShaders/Icons/Categories/LICENCE.txt (2)

4-7: Pronoun/agreement nit – “it” → “them”

Plural subject “images” should take “them/they” to avoid legal ambiguity.

-These images are free software: you can redistribute it and/or modify
+These images are free software: you can redistribute them and/or modify

14-15: Terminate sentence with a period for legal completeness

The final sentence is missing a terminating period which is present in the canonical GPL header.

-along with this program.  If not, see <http://www.gnu.org/licenses/>
+along with this program.  If not, see <http://www.gnu.org/licenses/>.
📜 Review details

Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 2bb3de4 and 8709b59.

⛔ Files ignored due to path filters (1)
  • package/Interface/CommunityShaders/Icons/Categories/materials.png is excluded by !**/*.png
📒 Files selected for processing (2)
  • README.md (1 hunks)
  • package/Interface/CommunityShaders/Icons/Categories/LICENCE.txt (1 hunks)
🧠 Learnings (2)
📓 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.
package/Interface/CommunityShaders/Icons/Categories/LICENCE.txt (2)

Learnt from: davo0411
PR: #1107
File: src/Menu.cpp:310-315
Timestamp: 2025-05-31T02:51:24.195Z
Learning: In the Community Shaders codebase, when validating UI icons, checking for texture presence (non-null pointer) is sufficient. Avoid adding dimension validation checks as icon sizes should vary based on user needs (4K+ resolution users may want higher resolution icons). Don't artificially limit icon dimensions.

Learnt from: alandtse
PR: doodlum/skyrim-community-shaders#0
File: :0-0
Timestamp: 2025-07-05T05:20:45.823Z
Learning: In the skyrim-community-shaders repository, file deletion error handling improvements that replace existence checks and try-catch blocks with std::filesystem::remove error-code-based approaches are considered bug fixes rather than refactoring, as they address inadequate error handling and misleading log messages.

✅ Files skipped from review due to trivial changes (1)
  • README.md
🧰 Additional context used
🧠 Learnings (2)
📓 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.
package/Interface/CommunityShaders/Icons/Categories/LICENCE.txt (2)

Learnt from: davo0411
PR: #1107
File: src/Menu.cpp:310-315
Timestamp: 2025-05-31T02:51:24.195Z
Learning: In the Community Shaders codebase, when validating UI icons, checking for texture presence (non-null pointer) is sufficient. Avoid adding dimension validation checks as icon sizes should vary based on user needs (4K+ resolution users may want higher resolution icons). Don't artificially limit icon dimensions.

Learnt from: alandtse
PR: doodlum/skyrim-community-shaders#0
File: :0-0
Timestamp: 2025-07-05T05:20:45.823Z
Learning: In the skyrim-community-shaders repository, file deletion error handling improvements that replace existence checks and try-catch blocks with std::filesystem::remove error-code-based approaches are considered bug fixes rather than refactoring, as they address inadequate error handling and misleading log messages.

Comment on lines +1 to +15
Community Shaders Category Icons
Copyright (C) 2025 dem6nd

These images are free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.

These images are distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/> No newline at end of file
Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot Jul 23, 2025

Choose a reason for hiding this comment

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

⚠️ Potential issue

Missing the full GPL-3.0 text – risk of non-compliance

GPL requires that the “complete corresponding license text” accompany the work.
This stub only contains the boiler-plate notice; the ~5-page legal text is absent. Ship the full COPYING (or LICENSE) content or reference an existing root-level GPL file to stay compliant.

🤖 Prompt for AI Agents
In package/Interface/CommunityShaders/Icons/Categories/LICENCE.txt at lines 1 to
15, the file currently contains only a brief GPL notice but lacks the full
GPL-3.0 license text required for compliance. To fix this, replace the current
content with the complete GPL-3.0 license text or add a clear reference to a
root-level LICENSE or COPYING file that contains the full license text, ensuring
the full corresponding license is included with the work.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

This should be dealt with properly. Honestly just have the author make PR to your repo.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

No description provided.

@github-actions
Copy link
Copy Markdown

github-actions Bot commented Jul 23, 2025

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

Comment on lines +1 to +15
Community Shaders Category Icons
Copyright (C) 2025 dem6nd

These images are free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.

These images are distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/> No newline at end of file
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

This should be dealt with properly. Honestly just have the author make PR to your repo.

Comment thread src/Utils/UI.cpp Outdated
Comment thread src/Utils/UI.cpp
Comment on lines +431 to +447
if (strcmp(categoryName, "Characters") == 0) {
categoryIcon = menu.characters.texture;
} else if (strcmp(categoryName, "Grass") == 0) {
categoryIcon = menu.grass.texture;
} else if (strcmp(categoryName, "Lighting") == 0) {
categoryIcon = menu.lighting.texture;
} else if (strcmp(categoryName, "Sky") == 0) {
categoryIcon = menu.sky.texture;
} else if (strcmp(categoryName, "Landscape & Textures") == 0) {
categoryIcon = menu.landscape.texture;
} else if (strcmp(categoryName, "Water") == 0) {
categoryIcon = menu.water.texture;
} else if (strcmp(categoryName, "Debug") == 0) {
categoryIcon = menu.debug.texture;
} else if (strcmp(categoryName, "Materials") == 0) {
categoryIcon = menu.materials.texture;
}
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Maybe a problem?

@davo0411
Copy link
Copy Markdown
Collaborator Author

all fixes addressed, removed the line of other; code I missed, the "other" category should not really appear and does not need an icon.

Licence updated to dem6nd 's original they sent. I thought GPL3.0 would be easier but this matches other feature licences.

@davo0411 davo0411 requested a review from doodlum July 24, 2025 01:15
Copy link
Copy Markdown
Collaborator

@doodlum doodlum left a comment

Choose a reason for hiding this comment

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

Error: D:\a\skyrim-community-shaders\skyrim-community-shaders\src\Menu.cpp(224,10): error C2039: 'other': is not a member of 'Menu::UIIcons' [D:\a\skyrim-community-shaders\skyrim-community-shaders\build\ALL\CommunityShaders.vcxproj]
(compiling source file '../../src/Menu.cpp')
D:\a\skyrim-community-shaders\skyrim-community-shaders\src\Menu.h(72,9):
see declaration of 'Menu::UIIcons'

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

📜 Review details

Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 8ed52c5 and 62d32d9.

📒 Files selected for processing (1)
  • src/Utils/UI.cpp (4 hunks)
🧰 Additional context used
🧠 Learnings (2)
📓 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/Utils/UI.cpp (5)

Learnt from: davo0411
PR: #1107
File: src/Menu.cpp:310-315
Timestamp: 2025-05-31T02:51:24.195Z
Learning: In the Community Shaders codebase, when validating UI icons, checking for texture presence (non-null pointer) is sufficient. Avoid adding dimension validation checks as icon sizes should vary based on user needs (4K+ resolution users may want higher resolution icons). Don't artificially limit icon dimensions.

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.

Learnt from: alandtse
PR: doodlum/skyrim-community-shaders#0
File: :0-0
Timestamp: 2025-07-05T05:20:45.823Z
Learning: In the skyrim-community-shaders repository, file deletion error handling improvements that replace existence checks and try-catch blocks with std::filesystem::remove error-code-based approaches are considered bug fixes rather than refactoring, as they address inadequate error handling and misleading log messages.

Learnt from: alandtse
PR: #577
File: src/Features/WetnessEffects.h:36-36
Timestamp: 2025-06-08T11:25:14.536Z
Learning: In the skyrim-community-shaders project, boolean flags in C++ structs that interface with HLSL shaders use uint type instead of bool for compatibility reasons. This ensures consistent size, alignment, and cross-platform compatibility when passing data to shader constant buffers.

Learnt from: alandtse
PR: #577
File: src/Features/WetnessEffects.h:36-36
Timestamp: 2025-06-08T11:25:14.536Z
Learning: In the skyrim-community-shaders project, boolean flags in C++ structs that interface with HLSL shaders use uint type instead of bool for compatibility reasons. This ensures consistent 4-byte size, proper 16-byte alignment in constant buffers, and cross-platform compatibility when passing data between C++ and HLSL shaders.

🧬 Code Graph Analysis (1)
src/Utils/UI.cpp (1)
src/Menu.h (1)
  • GetSingleton (16-20)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
  • GitHub Check: Build plugin and addons
🔇 Additional comments (4)
src/Utils/UI.cpp (4)

166-179: LGTM - Icon array properly expanded for new category icons.

The texturePointers array has been correctly expanded from 4 to 12 elements to include the new category icons (characters, grass, lighting, sky, landscape, water, debug, materials). This aligns with the PR objective of adding category icons to subheadings.


229-294: Comprehensive category icon loading implementation looks good.

The individual icon loading blocks follow a consistent pattern with proper error handling and logging. Each category icon (characters, grass, lighting, sky, landscape, water, debug, materials) is loaded independently, allowing the system to gracefully handle missing icons while still loading available ones.


418-438: Category icon mapping implementation is well-structured.

The string-based category mapping logic covers all the major categories mentioned in the PR objectives. The approach using strcmp is appropriate for this use case and provides clear, readable category-to-icon mappings.

Note: Based on past review comments, there was discussion about an "other" category icon, but per the PR objectives, this was intentionally removed as the "other" category should not appear.


448-512: Excellent icon scaling implementation that addresses the PR objectives.

The icon rendering logic successfully addresses the main PR objective of "synchronizing icon scaling with text scaling." Key improvements:

  • Icons scale proportionally with font size (iconSize = currentFontSize * 1.2f)
  • Consistent spacing relative to text (iconSpacing = currentFontSize * 0.3f)
  • Proper content width calculation that includes icon dimensions
  • Vertical alignment centers icons with text
  • Color tinting matches the header text color

This ensures icons and text scale together perfectly, resolving the scaling issues mentioned in the PR description.

Comment thread src/Utils/UI.cpp Outdated
@doodlum doodlum merged commit 77d1004 into community-shaders:dev Jul 24, 2025
11 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