-
Notifications
You must be signed in to change notification settings - Fork 85
Split Texture Category List - Fixes and Improvements #49
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
Split Texture Category List - Fixes and Improvements #49
Conversation
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.
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
@@ -1540,6 +1540,8 @@ namespace dxvk { | |||
namespace texture_popup { | |||
constexpr char POPUP_NAME[] = "rtx_texture_selection_popup"; | |||
|
|||
std::string lastOpenCategoryId; |
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.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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
@@ -1667,6 +1669,16 @@ namespace dxvk { | |||
} | |||
} | |||
} | |||
|
|||
if (legacyTextureGuiShowAssignedOnly()) { | |||
if (std::string(uniqueId) != "textures") { |
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.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I didn't know about std::string_view
. Really useful thank you!
src/dxvk/imgui/dxvk_imgui.cpp
Outdated
@@ -1753,8 +1762,7 @@ namespace dxvk { | |||
// popup for texture selection from world / ui | |||
{ | |||
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(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:
lastOpenCategoryId
to thetexture_popup
namespace. lastOpenCategoryId holds the uniqueId of the currently active category (either by opening it or by hovering a texture within it). lastOpenCategoryId is checked within functionshowTextureSelectionGrid
so that only the active category that called showTextureSelectionGrid is allowed to use its embedded texture highlighting / texture assignment popup logic.lastOpenCategoryActive
to thetexture_popup
namespace. 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
lastOpenCategoryId
string and logic within eithershowSetupWindow
orshowTextureSelectionGrid
assigns a new active category within the next frame.!WantCaptureMouse
check becausewasWorldClick
is 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 Lists
underSplit Texture Category List
that 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

Uncategorized
where all textures with no assignments can be found