* Move the RootAliasPath class definition to the Prefab EOS. Introduce utility functions to enable using the path as an instance handler in UI.
Signed-off-by: Danilo Aimini <82231674+AMZN-daimini@users.noreply.github.com>
* Refactor the PrefabFocusHandler to use the utility functions that were introduced to the Prefab EOS. Remove the m_instanceFocusHierarchy from the Focus Handler, and simplify calls for performance.
Signed-off-by: Danilo Aimini <82231674+AMZN-daimini@users.noreply.github.com>
* Minor adjustments after PR discussion
Signed-off-by: Danilo Aimini <82231674+AMZN-daimini@users.noreply.github.com>
* Silly mistake in function simplification. Turns out == and != are different.
Signed-off-by: Danilo Aimini <82231674+AMZN-daimini@users.noreply.github.com>
* Fixed doxygen comments
Signed-off-by: Danilo Aimini <82231674+AMZN-daimini@users.noreply.github.com>
* Add numeric cast when storing result of AZStd::distance to int.
Signed-off-by: Danilo Aimini <82231674+AMZN-daimini@users.noreply.github.com>
* Restore additional checks in FocusOnparentOfFocusedPrefab that got removed during merge.
Signed-off-by: Danilo Aimini <82231674+AMZN-daimini@users.noreply.github.com>
* Add function to Prefab Instances allowing to get a reference to a nested instance by alias.
Signed-off-by: Danilo Aimini <82231674+AMZN-daimini@users.noreply.github.com>
* Refactor the Prefab Focus Handler to use RootAliasPaths to store the reference to the currently focused prefab instance instead of the previous method (entityId of the prefab container).
Signed-off-by: Danilo Aimini <82231674+AMZN-daimini@users.noreply.github.com>
* Use existing FindNestedInstance method instead of adding new one.
Signed-off-by: Danilo Aimini <82231674+AMZN-daimini@users.noreply.github.com>
* Minor fixes to style and comments
Signed-off-by: Danilo Aimini <82231674+AMZN-daimini@users.noreply.github.com>
* Removing indexing in GetInstanceReferenceFromRootAliasPath, turn variables into constants where possible.
Signed-off-by: Danilo Aimini <82231674+AMZN-daimini@users.noreply.github.com>
* Modified the Prefab Focus test fixture to ensure the entity hierarchy is generated under the Prefab EOS, allowing tests to work with the new implementation of the focus mode handler.
Signed-off-by: Danilo Aimini <82231674+AMZN-daimini@users.noreply.github.com>
* Ensure RootAliasPath is iterated by reference in GetInstanceReferenceFromRootAliasPath
Signed-off-by: Danilo Aimini <82231674+AMZN-daimini@users.noreply.github.com>
* First step of procedural prefab styling and read-only registration.
Signed-off-by: Danilo Aimini <82231674+AMZN-daimini@users.noreply.github.com>
* WIP - Introduce read-only handler for procedural prefabs (not hooked up)
Signed-off-by: Danilo Aimini <82231674+AMZN-daimini@users.noreply.github.com>
* Introduce read-only entity interface, handler and unit tests.
Signed-off-by: Danilo Aimini <82231674+AMZN-daimini@users.noreply.github.com>
* Introduce temp read-only icon, use new icon hierarchy in Outliner.
Signed-off-by: Danilo Aimini <82231674+AMZN-daimini@users.noreply.github.com>
* Switch from a push paradigm to a pull paradigm - handlers get to implement logic to determine if an entity should be read-only. This allows multiple systems to weigh into whether an entity is read-only.
Signed-off-by: Danilo Aimini <82231674+AMZN-daimini@users.noreply.github.com>
* Fixed to missing call in test
Signed-off-by: Danilo Aimini <82231674+AMZN-daimini@users.noreply.github.com>
* Post-rebase fixes to class name changes
Signed-off-by: Danilo Aimini <82231674+AMZN-daimini@users.noreply.github.com>
* Display a lock icon on top of the entity icon in the Entity Outliner. This icon is added programmatically, which prevents having to alter all Outliner icons and future-proofs this functionality.
Signed-off-by: Danilo Aimini <82231674+AMZN-daimini@users.noreply.github.com>
* Minor style changes to procedural prefabs in the Outliner (use white icon)
Signed-off-by: Danilo Aimini <82231674+AMZN-daimini@users.noreply.github.com>
* Ensure cache is refreshed when the handler is created, and also whenever the focus changes.
Signed-off-by: Danilo Aimini <82231674+AMZN-daimini@users.noreply.github.com>
* Remove Procedural Prefab setreg that was added in the wrong place
Signed-off-by: Danilo Aimini <82231674+AMZN-daimini@users.noreply.github.com>
* Remove redundant function
Signed-off-by: Danilo Aimini <82231674+AMZN-daimini@users.noreply.github.com>
* Fix spacing issue caused by rebase
Signed-off-by: Danilo Aimini <82231674+AMZN-daimini@users.noreply.github.com>
* Change tooltip so that it accurately says "inspect" instead of "edit" for procedural prefabs.
Signed-off-by: Danilo Aimini <82231674+AMZN-daimini@users.noreply.github.com>
* Address minor styling issues mentioned in PR.
Signed-off-by: Danilo Aimini <82231674+AMZN-daimini@users.noreply.github.com>
* Added tests for deleting entity under level and other prefabs
Signed-off-by: srikappa-amzn <82230713+srikappa-amzn@users.noreply.github.com>
* Added class comments and improved variable names
Signed-off-by: srikappa-amzn <82230713+srikappa-amzn@users.noreply.github.com>
* Called the reflect function of PrefabFocusHandler from PrefabSystemComponent
Signed-off-by: srikappa-amzn <82230713+srikappa-amzn@users.noreply.github.com>
* Added function comments and made an if statement to be one line
Signed-off-by: srikappa-amzn <82230713+srikappa-amzn@users.noreply.github.com>
* Cherry-pick 49e8f35858
Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com>
* Merging differences from development of other changes that need to be there for deb packaging
Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com>
* Picks a needed change for the installer
Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com>
* Fixes warning in mac
Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com>
* Takes version from environment if defined
Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com>
* Do not pick up version if it is empty string since that will also break version comparison
Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com>
* creating temp directories if they dont exist
Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com>
* removing a dependency to itself (Multiplayer.Builders is an alias of Multiplayer.Editor)
Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com>
* Filters which runtime dependencies are passed from private build dependencies to only those that are actual targets.
This avoids something like a "d3d12" private build dependency from being passed to the runtime dependencies
Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com>
* Fix oversight from recent change to PrefabFocusHandler internals.
Signed-off-by: Danilo Aimini <82231674+AMZN-daimini@users.noreply.github.com>
* Introduce check for null instance in case this is called before the Prefab Focus Handler is initialized.
Signed-off-by: Danilo Aimini <82231674+AMZN-daimini@users.noreply.github.com>
* Replace Instance References with EntityId of the Prefab Container (WIP)
Signed-off-by: Danilo Aimini <82231674+AMZN-daimini@users.noreply.github.com>
* Use the invalid entity id for the root instance and get the root instance every time to prevent weird Prefab EOS shenanigans.
Signed-off-by: Danilo Aimini <82231674+AMZN-daimini@users.noreply.github.com>
* Revert unnecessary changes, fix IsOwningPrefabBeingFocused to match previous behavior. Disable some tests that no longer apply correctly due to the testing environment not relying on the Prefab EOS.
Signed-off-by: Danilo Aimini <82231674+AMZN-daimini@users.noreply.github.com>
* Fix minor typo in test comment
Signed-off-by: Danilo Aimini <82231674+AMZN-daimini@users.noreply.github.com>
* Extend the level entity behavior to open prefab containers in focus mode. Disable manipulators for these entities too.
Signed-off-by: Danilo Aimini <82231674+AMZN-daimini@users.noreply.github.com>
* Minor adjustments
Signed-off-by: Danilo Aimini <82231674+AMZN-daimini@users.noreply.github.com>
* Fix enum casing in Entity Inspector.
Signed-off-by: Danilo Aimini <82231674+AMZN-daimini@users.noreply.github.com>
* Split views between for Level and FocusedContainer entities.
Signed-off-by: Danilo Aimini <82231674+AMZN-daimini@users.noreply.github.com>
* Slightly different fix to support components on focused containers.
Signed-off-by: Danilo Aimini <82231674+AMZN-daimini@users.noreply.github.com>
* Minor fixesto RefreshSelectedEntityIds.
Signed-off-by: Danilo Aimini <82231674+AMZN-daimini@users.noreply.github.com>
* Enable closing prefab by double-clicking it when it's in focus.
Signed-off-by: Danilo Aimini <82231674+AMZN-daimini@users.noreply.github.com>
* Enable double clicking on level prefab to close focus mode and return to editing the level.
Signed-off-by: Danilo Aimini <82231674+AMZN-daimini@users.noreply.github.com>
* Introduce API function to go up one level in the Prefab Focus Mode hierarchy.
Signed-off-by: Danilo Aimini <82231674+AMZN-daimini@users.noreply.github.com>
* Enable keyboard shortcuts to more easily navigate the prefab hierarchy.
Signed-off-by: Danilo Aimini <82231674+AMZN-daimini@users.noreply.github.com>
* Tie the "Open/Edit Prefab" action to the = key on top of +. This allows users with compact US keyboards to use either key, preventing them from having to press Shift and =.
Signed-off-by: Danilo Aimini <82231674+AMZN-daimini@users.noreply.github.com>
* Replace the behavior of the "Up one level" button in the breadcrumbs with the new function that serves the same purpose. Also show the - shortcut in the tooltip.
Signed-off-by: Danilo Aimini <82231674+AMZN-daimini@users.noreply.github.com>
* Fix FocusOnParentOfFocusedPrefab to require the entity context id (to conform with the other functions in the API that don't pass entityIds). Expand its usage to other functions that did the same operation manually.
Signed-off-by: Danilo Aimini <82231674+AMZN-daimini@users.noreply.github.com>
* Include fix for non-unity builds
Signed-off-by: Danilo Aimini <82231674+AMZN-daimini@users.noreply.github.com>
* Change Prefab Focus breadcrumb widget to display template filename instead of instance container entity name. Also display dirty state for the template (*) and refresh it in real time.
Signed-off-by: Danilo Aimini <82231674+AMZN-daimini@users.noreply.github.com>
* Streamline path creation code; fix stem retrieval to ensure extension is cut correctly; delay refresh one frame when path is clicked to correctly refresh it.
Signed-off-by: Danilo Aimini <82231674+AMZN-daimini@users.noreply.github.com>
* Remove test code.
Signed-off-by: Danilo Aimini <82231674+AMZN-daimini@users.noreply.github.com>
* Simplify code to use Native directly.
Signed-off-by: Danilo Aimini <82231674+AMZN-daimini@users.noreply.github.com>
* Minor variable renaming and comment adjustments to make them clearer.
Signed-off-by: Danilo Aimini <82231674+AMZN-daimini@users.noreply.github.com>
* Introduce Outliner button to simplify Prefab editing
Signed-off-by: Danilo Aimini <82231674+AMZN-daimini@users.noreply.github.com>
* Fix Focus Mode and disabled entities colors
Signed-off-by: Danilo Aimini <82231674+AMZN-daimini@users.noreply.github.com>
* Fix - propagate the event if the OnOutlinerItemClick function returns false.
This does not change current behavior but makes more sense in the context of future handlers.
Signed-off-by: Danilo Aimini <82231674+AMZN-daimini@users.noreply.github.com>
* Adjust disabled colors to match UX recommendations.
Signed-off-by: Danilo Aimini <82231674+AMZN-daimini@users.noreply.github.com>
* Display the edit button even if the prefab is disabled. Remove prefabWip check (it will be removed for focus mode by the time this goes in). Default to disabled capsule color for borders to save on checks.
Signed-off-by: Danilo Aimini <82231674+AMZN-daimini@users.noreply.github.com>
* Disable edit button on disabled prefabs as it caused conflicts in nested prefabs. May explore that possibility later.
Signed-off-by: Danilo Aimini <82231674+AMZN-daimini@users.noreply.github.com>
* Change disabled text color to be darker, as asked by UX.
Signed-off-by: Danilo Aimini <82231674+AMZN-daimini@users.noreply.github.com>
* Initialize the PrefabFocusHandler on context reset, to also cover the case of a new level being created on the welcome screen.
Relax checks/restrictions on refreshes to cover cases where an instance is reused by the Prefab EOS.
Refresh the breadcrumbs when a container is renamed and when a change is propagated to the instances to ensure the correct names are displayed.
Signed-off-by: Danilo Aimini <82231674+AMZN-daimini@users.noreply.github.com>
* Rename m_isInitialized to m_initialized in PrefabFocusHandler
Signed-off-by: Danilo Aimini <82231674+AMZN-daimini@users.noreply.github.com>
* Use find_if to detect when a container entity in the focus path has been renamed.
Signed-off-by: Danilo Aimini <82231674+AMZN-daimini@users.noreply.github.com>
* Renaming and commenting variables in PrefabFocusHandler.
Signed-off-by: Danilo Aimini <82231674+AMZN-daimini@users.noreply.github.com>
* Undo minor naming change
Signed-off-by: Danilo Aimini <82231674+AMZN-daimini@users.noreply.github.com>
* Replace lazy initialization and have the UI side initialize the Editor calls in PrefabFocusHandler.
This should prevent issues with focus mode trying to access these interfaces in non-editor applications.
Signed-off-by: Danilo Aimini <82231674+AMZN-daimini@users.noreply.github.com>
* Change SetContainerOpenState to SetContainerOpen.
Signed-off-by: Danilo Aimini <82231674+AMZN-daimini@users.noreply.github.com>
* Introduce Clear function to avoid retaining all lingering open states when switching contexts/loading a new level.
Signed-off-by: Danilo Aimini <82231674+AMZN-daimini@users.noreply.github.com>
* Minor FocusMode fixture refactors to support ContainerEntity tests
Signed-off-by: Danilo Aimini <82231674+AMZN-daimini@users.noreply.github.com>
* Introduce tests for the ContainerEntity API
Signed-off-by: Danilo Aimini <82231674+AMZN-daimini@users.noreply.github.com>
* Add include to fix issue with EntityContextId not being defined.
Signed-off-by: Danilo Aimini <82231674+AMZN-daimini@users.noreply.github.com>
* Minor comment fixes. Moved environment clear functions to TearDown function of test fixture.
Signed-off-by: Danilo Aimini <82231674+AMZN-daimini@users.noreply.github.com>
* Use default editor context id in ContainerEntitySystemComponent
Signed-off-by: Danilo Aimini <82231674+AMZN-daimini@users.noreply.github.com>
* Revert previous change as the EditorEntityContextId would not be initialized correctly on ContainerEntitySystemComponent Activate.
Signed-off-by: Danilo Aimini <82231674+AMZN-daimini@users.noreply.github.com>
* Setup work for the ContainerEntity SystemComponent and Interface.
Signed-off-by: Danilo Aimini <82231674+AMZN-daimini@users.noreply.github.com>
* Introduce Container Entity Notification Bus
Signed-off-by: Danilo Aimini <82231674+AMZN-daimini@users.noreply.github.com>
* Introduce a proxy model to control open/closed state of entity containers. Register prefab containers as entity containers. Profit.
Signed-off-by: Danilo Aimini <82231674+AMZN-daimini@users.noreply.github.com>
* Add open state to OnContainerEntityStatusChanged notification + improvements to comments.
Signed-off-by: Danilo Aimini <82231674+AMZN-daimini@users.noreply.github.com>
* Fix to notification trigger to include new arguments.
Signed-off-by: Danilo Aimini <82231674+AMZN-daimini@users.noreply.github.com>
* Fix issue where the Level container would not be expanded correctly. The Level container is now no longer a container entity (since we don't need to be able to close it).
Signed-off-by: Danilo Aimini <82231674+AMZN-daimini@users.noreply.github.com>
* Revert the addition of an extra proxy layer (which was causing issues) and just move the container logic to the existing filter.
Fix bug in the dataChanged signal.
Signed-off-by: Danilo Aimini <82231674+AMZN-daimini@users.noreply.github.com>
* Fix column count in dataChanged signal to correctly update all column and fix visual glitches.
Limit container registration to the prefab WIP flag so that the changes can be submitted with an opt-in mechanism.
Signed-off-by: Danilo Aimini <82231674+AMZN-daimini@users.noreply.github.com>
* Add doubleclick behavior on Outliner items - enters focus mode when double clicking on prefab containers.
Signed-off-by: Danilo Aimini <82231674+AMZN-daimini@users.noreply.github.com>
* override sourceModel() to store pointer to avoid dynamic casting at every filterAcceptsRow call.
Signed-off-by: Danilo Aimini <82231674+AMZN-daimini@users.noreply.github.com>
* Minor comment fixes and nits
Signed-off-by: Danilo Aimini <82231674+AMZN-daimini@users.noreply.github.com>
* Move container selection logic to a helper function in the ContainerEntityInterface to simplify reusing it in the near future.
Signed-off-by: Danilo Aimini <82231674+AMZN-daimini@users.noreply.github.com>
* Support lazy initialization for tests (since we do not load a level, the lazy initialization in OnEntityStreamLoadSuccess does not trigger)
Signed-off-by: Danilo Aimini <82231674+AMZN-daimini@users.noreply.github.com>