-
Notifications
You must be signed in to change notification settings - Fork 131
feat(ui): subheading icons, fixed icon scaling issues, feature subheading changes #1298
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
15 commits
Select commit
Hold shift + click to select a range
7e55813
rework
davo0411 1fc016a
added subheading icons, fixed scaling of icons
davo0411 2bb3de4
style: 🎨 apply pre-commit.ci formatting
pre-commit-ci[bot] 20d3285
materials icon, licence tweak
davo0411 8709b59
Merge branch 'subheading-fixes' of https://github.com/davo0411/skyrim…
davo0411 f567dee
fixes
davo0411 d6fa10d
Merge branch 'dev' into subheading-fixes
davo0411 8ed52c5
style: 🎨 apply pre-commit.ci formatting
pre-commit-ci[bot] 942d22a
deleted licences
davo0411 b575d2e
Merge branch 'subheading-fixes' of https://github.com/davo0411/skyrim…
davo0411 6a947ad
Update UI.cpp
davo0411 62d32d9
Merge branch 'doodlum:dev' into subheading-fixes
davo0411 c57413b
Update Menu.cpp
davo0411 f35d0a7
Merge branch 'subheading-fixes' of https://github.com/davo0411/skyrim…
davo0411 8b7eb8e
Update UI.cpp
davo0411 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
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
🤖 Prompt for AI Agents
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe a problem?
There was a problem hiding this comment.
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:
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:
"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""Other" is the default fallback - in Feature.h, the base
GetCategory()method returns"Other"by default for any features that don't override itThe 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.textureicon 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:
Length of output: 65
Let me check what's actually defined in the Menu.h structure and what category icon files exist:
🏁 Script executed:
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:
The
othericon IS defined in Menu.h:UIIcon other; // Generic icon for other/misc categoriesBut the
other.pngfile doesn't exist - the Categories directory has icons for all other categories (characters, debug, grass, landscape, lighting, materials, sky, water) but noother.pngThe loading code is also missing -
InitializeMenuIconsdoesn't attempt to load theothericonAnd the mapping is missing - which is what my original suggestion addressed
So there are actually three missing pieces:
other.pngicon file itselfInitializeMenuIconsDrawCategoryHeaderThis 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:HoverTooltipWrapperclass: RAII wrapper for ImGui tooltips on hovered items.DisableGuardclass: RAII wrapper for ImGui disabled state.StyledButtonWrapperclass: RAII wrapper for pushing/popping button style colors.SectionWrapperclass: RAII wrapper for drawing section headers with optional description and color.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.ColorCodedValueConfigstruct and related functions for color-coded value display.DrawColorCodedValue: draws a label and a color-coded value with optional tooltip.DrawMultiLineTooltipandDrawColoredMultiLineTooltip: draw multi-line tooltips with optional colors.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)This singleton accessor is used in
UI.cppto get the global menu instance for accessing UI icons and theme colors.Relevant snippets from
src/Menu.cpp(lines 721-732)This snippet shows usage of
Util::DrawCategoryHeaderfromUI.cppto render category headers with expansion state.Relevant snippets from
src/Menu.cpp(lines 733-779)This snippet shows feature list rendering using ImGui, with color coding and selectable items. It uses
Util::PathHelpers::GetFeatureIniPathand 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:
Util::HoverTooltipWrapper.Util::PathHelpers::GetFeatureIniPathand theme colors.Summary of relevance
UI.cppfile implements many UI helper functions and wrappers used throughout the UI code.InitializeMenuIconsfunction loads icons used in category headers and elsewhere.DrawCategoryHeaderandDrawSectionHeaderfunctions provide styled headers with icons and lines.HoverTooltipWrapperis used for tooltips in multiple places.Menusingleton is accessed for icons and theme colors.Menu.cppsnippets show usage of these UI helpers for rendering feature lists and category headers.PathHelpers::GetFeatureIniPathfunction 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