Split Texture Category List - Fixes and Improvements#49
Split Texture Category List - Fixes and Improvements#49xoxor4d wants to merge 1 commit intoNVIDIAGameWorks:mainfrom
Conversation
sultim-t-nv
left a comment
There was a problem hiding this comment.
Great improvements to the UX, thanks for debugging and providing the solution :)
There are some minor change requests to the code, plus:
- Add yourself to the "Github Contributors" list in
ImGuiAbout::Credits::Credits(). Contributors are listed alphabetically by the last name - After your commits are ready:
- squash them into one in the same branch
- push (
force-with-lease) into this pull request
Then we will test it and try to merge
src/dxvk/imgui/dxvk_imgui.cpp
Outdated
| namespace texture_popup { | ||
| constexpr char POPUP_NAME[] = "rtx_texture_selection_popup"; | ||
|
|
||
| std::string lastOpenCategoryId; |
There was a problem hiding this comment.
Default initializer would be nice just for consistency ... = {};
src/dxvk/imgui/dxvk_imgui.cpp
Outdated
| } else { | ||
| clickedOnTextureButton = true; | ||
| } | ||
| // removed "toggleTextureSelection" logic as it was not working as intended even before |
There was a problem hiding this comment.
Maybe just remove this comment, so it would not be confusing in the future what was here before?
There was a problem hiding this comment.
I've restored the original logic here as I've fixed the root issue and removed the comment
src/dxvk/imgui/dxvk_imgui.cpp
Outdated
| } | ||
|
|
||
| if (legacyTextureGuiShowAssignedOnly()) { | ||
| if (std::string(uniqueId) != "textures") { |
There was a problem hiding this comment.
Changing std::string to strcmp(..) == 0 (or to std::string_view) is preferable to not create std::string instance.
(Optionally, might need to put assert(..) + return to ensure that uniqueId is not null at the beginning of the function, so it's more obvious when debugging)
There was a problem hiding this comment.
I didn't know about std::string_view. Really useful thank you!
src/dxvk/imgui/dxvk_imgui.cpp
Outdated
| const bool wasUIClick = clickedOnTextureButton; | ||
| const bool wasWorldClick = !clickedOnTextureButton && (ImGui::IsMouseClicked(ImGuiMouseButton_Left) || ImGui::IsMouseClicked(ImGuiMouseButton_Right)); | ||
|
|
||
| const bool wasWorldClick = !clickedOnTextureButton && !ImGui::GetIO().WantCaptureMouse && (ImGui::IsMouseClicked(ImGuiMouseButton_Left) || ImGui::IsMouseClicked(ImGuiMouseButton_Right)); |
There was a problem hiding this comment.
(Would be nice to split the long line into 2-3 lines for readability)
|
I've updated the PR post to reflect the latest changes. I've fixed the underlying popup issue and also restored the original legacy list functionality. Also fixes the same popup issue when selecting textures via the world (I did not in my initial PR). I've kinda messed up my squash by merging the latest changes tho ... Is that an issue? |
|
We have tested it, but now textures are being highlighted (in world and UI) only after a mouse click is done on a world / UI element. Before, the texture highlighting was activated immediately, without any click. Would you like to improve it? |
- Fix showing the category assignment popup when using legacy list mode - Add a new option to legacy mode that only shows assigned textures per category and adds a new texture list with unassigned textures - Variable child size for texture categories (only legacy mode with assigned textures)
267631f to
5c8ee64
Compare
|
Awww I somehow got so used to clicking once that I didn't even notice it wasn't there before. Sorry for causing so much work 😵💫 Fixing that issue took quite some time and caused a few headaches because of how the highlighting / texture popup logic is embedded within
I've updated the initial PR post + picture showing the variable child size in action. I've also managed to squash all of the pervious commits into one 👍🏻 |
No-no, it's all good! Thank you, that you are trying to debug and fix it
Great, we will retest, and from the code and overview it looks like a better UX. Thanks again :) |
|
Alright, we may have some improvements to the object selection algorithm (but not certainly); and this pull request will be tested as a part of it |
|
Thank you for merging! There are some really nice additional changes in there that greatly enhance the UX 🙌 |
This pull request fixes a few issues related to the legacy (split) texture list and also adds a new toggleable setting that only shows textures in a category that are assigned to that category.
Unassigned textures will be displayed in a new list called "Uncategorized".
Why?
Categorizing textures in games with a huge amount of loaded textures can get pretty painful. Especially if the list you are working with does not shrink in size.
It can also get really tedious to find textures you once assigned to a category if that category turned out to be wrong.
Having scrolled hundreds of textures to only get your scrolling position changed by accidentally moving your mouse over the world made me think about creating this :D
Issues with the legacy list prior to this pull request:
Changes to fix issue 1:
lastOpenCategoryIdto thetexture_popupnamespace. lastOpenCategoryId holds the uniqueId of the currently active category (either by opening it or by hovering a texture within it). lastOpenCategoryId is checked within functionshowTextureSelectionGridso that only the active category that called showTextureSelectionGrid is allowed to use its embedded texture highlighting / texture assignment popup logic.lastOpenCategoryActiveto thetexture_popupnamespace. It is used to check if the category saved in lastOpenCategoryId remained the active category (after all subsequent showTextureSelectionGrid function calls).Mainly used it to check if a category header was closed. It will then clear the
lastOpenCategoryIdstring and logic within eithershowSetupWindoworshowTextureSelectionGridassigns a new active category within the next frame.!WantCaptureMousecheck becausewasWorldClickis true when clicking anywhere within the GUI that is not a texture. (Not really related to any issue anymore)Changes to fix issue 2:
TL;DR
Add a new toggle called

Only Show Assigned Textures in Category ListsunderSplit Texture Category Listthat is only visible if split view is enabledCategories will now only show the textures that are assigned to it

Also adds a new list at the bottom of the existing categories called

Uncategorizedwhere all textures with no assignments can be found