Adding PB Editors available in the GOcontext for the actions overlay#690
Adding PB Editors available in the GOcontext for the actions overlay#690lopezt-unity wants to merge 2 commits into
Conversation
|
|
||
| var hidden = action.hidden; | ||
| hidden |= (action.group == ToolbarGroup.Object) ? !isGOContext : isGOContext; | ||
| hidden |= shouldDisplayAsEditor || (action.group == ToolbarGroup.Object) ? !isGOContext : isGOContext; |
There was a problem hiding this comment.
shouldDisplayAsEditor is true for ToolbarGroup.Tool actions, and because ?: binds after || this line evaluates as (shouldDisplayAsEditor || action.group == ToolbarGroup.Object) ? !isGOContext : isGOContext. With the default Display Editors setting enabled, every editor action now gets hidden |= !isGOContext, so those buttons disappear as soon as the ProBuilder tool context is active. That is a regression from the previous behavior; the change adds GO-context visibility by removing PB-context visibility. Please treat tool-group actions as a separate case so they stay available in both contexts.
🤖 Helpful? 👍/👎
|
|
||
| var hidden = action.hidden; | ||
| hidden |= (action.group == ToolbarGroup.Object) ? !isGOContext : isGOContext; | ||
| hidden |= shouldDisplayAsEditor || (action.group == ToolbarGroup.Object) ? !isGOContext : isGOContext; |
There was a problem hiding this comment.
This only fixes the panel/grid path. When the overlay is used as a horizontal or vertical toolbar, UpdateToolbar() still delegates to ProBuilderActionButton.UpdateContentForToolbar(), and that method keeps the old hidden |= (m_Action.group == ToolbarGroup.Object) ? !isGOContext : isGOContext rule. In those layouts the editor actions are still hidden in GameObjectToolContext, so the feature silently fails for a supported overlay mode. Please share the visibility logic between RefreshAvailableActions() and UpdateContentForToolbar() so both layouts behave the same way.
🤖 Helpful? 👍/👎
Codecov ReportAttention: Patch coverage is
@@ Coverage Diff @@
## master #690 +/- ##
==========================================
+ Coverage 38.43% 38.51% +0.08%
==========================================
Files 279 279
Lines 39164 39178 +14
==========================================
+ Hits 15052 15089 +37
+ Misses 24112 24089 -23
Flags with carried forward coverage won't be shown. Click here to find out more.
|
Purpose of this PR
Making editors (Vertex color, UV editor....) available without having to enter the PB context.
Comments to Reviewers
[List known issues, planned work, provide any extra context for your code.]