/
redgpu
/
ezEngine
Обзор
Документация
Войти
/
redgpu
/
ezEngine
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
Аналитика
Безопасность
dev
Code/EditorPlugins/Scene/EditorPluginScene/Actions/SelectionActions.h
97 строк
3 KB
Jan Krassnigg
Added action to undo selection changes (#1452)
12 дек 2024, 11:17
Не верифицирован
12 дек 2024, 11:17
e02856b
Код
Авторство
О чём код?
#pragma once #include <EditorPluginScene/EditorPluginSceneDLL.h> #include <EditorPluginScene/Scene/SceneDocument.h> #include <GuiFoundation/Action/BaseActions.h> #include <GuiFoundation/GuiFoundationDLL.h> /// class EZ_EDITORPLUGINSCENE_DLL ezSelectionActions { public: static void RegisterActions(); static void UnregisterActions(); static void MapActions(ezStringView sMapping); static void MapPrefabActions(ezStringView sMapping, float fPriority); static void MapContextMenuActions(ezStringView sMapping); static void MapViewContextMenuActions(ezStringView sMapping); static ezActionDescriptorHandle s_hGroupSelectedItems; static ezActionDescriptorHandle s_hCreateEmptyChildObject; static ezActionDescriptorHandle s_hCreateEmptyObjectAtPosition; static ezActionDescriptorHandle s_hHideSelectedObjects; static ezActionDescriptorHandle s_hHideUnselectedObjects; static ezActionDescriptorHandle s_hShowHiddenObjects; static ezActionDescriptorHandle s_hPrefabMenu; static ezActionDescriptorHandle s_hCreatePrefab; static ezActionDescriptorHandle s_hRevertPrefab; static ezActionDescriptorHandle s_hUnlinkFromPrefab; static ezActionDescriptorHandle s_hOpenPrefabDocument; static ezActionDescriptorHandle s_hDuplicateSpecial; static ezActionDescriptorHandle s_hDeltaTransform; static ezActionDescriptorHandle s_hSnapObjectToCamera; static ezActionDescriptorHandle s_hAttachToObject; static ezActionDescriptorHandle s_hDetachFromParent; static ezActionDescriptorHandle s_hConvertToEnginePrefab; static ezActionDescriptorHandle s_hConvertToEditorPrefab; static ezActionDescriptorHandle s_hCopyReference; static ezActionDescriptorHandle s_hSelectParent; static ezActionDescriptorHandle s_hSetActiveParent; static ezActionDescriptorHandle s_hClearActiveParent; static ezActionDescriptorHandle s_hUndoSelection; }; /// class EZ_EDITORPLUGINSCENE_DLL ezSelectionAction : public ezButtonAction { EZ_ADD_DYNAMIC_REFLECTION(ezSelectionAction, ezButtonAction); public: enum class ActionType { GroupSelectedItems, CreateEmptyChildObject, CreateEmptyObjectAtPosition, HideSelectedObjects, HideUnselectedObjects, ShowHiddenObjects, CreatePrefab, RevertPrefab, UnlinkFromPrefab, OpenPrefabDocument, ConvertToEnginePrefab, ConvertToEditorPrefab, DuplicateSpecial, DeltaTransform, SnapObjectToCamera, AttachToObject, DetachFromParent, CopyReference, SelectParent, SetActiveParent, ClearActiveParent, UndoSelection, }; ezSelectionAction(const ezActionContext& context, const char* szName, ActionType type); ~ezSelectionAction(); virtual void Execute(const ezVariant& value) override; void OpenPrefabDocument(); void CreatePrefab(); private: void SelectionEventHandler(const ezSelectionManagerEvent& e); void UpdateEnableState(); ezSceneDocument* m_pSceneDocument; ActionType m_Type; };