Plasma Engine  2.0
Loading...
Searching...
No Matches
SelectionActions.h
1#pragma once
2
3#include <EditorPluginScene/EditorPluginSceneDLL.h>
4#include <EditorPluginScene/Scene/SceneDocument.h>
5#include <GuiFoundation/Action/BaseActions.h>
6#include <GuiFoundation/GuiFoundationDLL.h>
7
9class PL_EDITORPLUGINSCENE_DLL plSelectionActions
10{
11public:
12 static void RegisterActions();
13 static void UnregisterActions();
14
15 static void MapActions(plStringView sMapping);
16 static void MapPrefabActions(plStringView sMapping, float fPriority);
17 static void MapContextMenuActions(plStringView sMapping);
18 static void MapViewContextMenuActions(plStringView sMapping);
19
20 static plActionDescriptorHandle s_hGroupSelectedItems;
21 static plActionDescriptorHandle s_hCreateEmptyChildObject;
22 static plActionDescriptorHandle s_hCreateEmptyObjectAtPosition;
23 static plActionDescriptorHandle s_hHideSelectedObjects;
24 static plActionDescriptorHandle s_hHideUnselectedObjects;
25 static plActionDescriptorHandle s_hShowHiddenObjects;
26 static plActionDescriptorHandle s_hPrefabMenu;
27 static plActionDescriptorHandle s_hCreatePrefab;
28 static plActionDescriptorHandle s_hRevertPrefab;
29 static plActionDescriptorHandle s_hUnlinkFromPrefab;
30 static plActionDescriptorHandle s_hOpenPrefabDocument;
31 static plActionDescriptorHandle s_hDuplicateSpecial;
32 static plActionDescriptorHandle s_hDeltaTransform;
33 static plActionDescriptorHandle s_hSnapObjectToCamera;
34 static plActionDescriptorHandle s_hAttachToObject;
35 static plActionDescriptorHandle s_hDetachFromParent;
36 static plActionDescriptorHandle s_hConvertToEnginePrefab;
37 static plActionDescriptorHandle s_hConvertToEditorPrefab;
38 static plActionDescriptorHandle s_hCopyReference;
39};
40
42class PL_EDITORPLUGINSCENE_DLL plSelectionAction : public plButtonAction
43{
44 PL_ADD_DYNAMIC_REFLECTION(plSelectionAction, plButtonAction);
45
46public:
47 enum class ActionType
48 {
49 GroupSelectedItems,
50 CreateEmptyChildObject,
51 CreateEmptyObjectAtPosition,
52 HideSelectedObjects,
53 HideUnselectedObjects,
54 ShowHiddenObjects,
55
56 CreatePrefab,
57 RevertPrefab,
58 UnlinkFromPrefab,
59 OpenPrefabDocument,
60 ConvertToEnginePrefab,
61 ConvertToEditorPrefab,
62
63 DuplicateSpecial,
64 DeltaTransform,
65 SnapObjectToCamera,
66 AttachToObject,
67 DetachFromParent,
68 CopyReference,
69 };
70
71 plSelectionAction(const plActionContext& context, const char* szName, ActionType type);
73
74 virtual void Execute(const plVariant& value) override;
75
76 void OpenPrefabDocument();
77
78 void CreatePrefab();
79
80private:
81 void SelectionEventHandler(const plSelectionManagerEvent& e);
82
83 void UpdateEnableState();
84
85 plSceneDocument* m_pSceneDocument;
86 ActionType m_Type;
87};
Handle for a plAction.
Definition Action.h:27
Definition BaseActions.h:159
Definition SceneDocument.h:22
Definition SelectionActions.h:43
Definition SelectionActions.h:10
plStringView represent a read-only sub-string of a larger string, as it can store a dedicated string ...
Definition StringView.h:34
plVariant is a class that can store different types of variables, which is useful in situations where...
Definition Variant.h:44
Definition Action.h:67
Definition SelectionManager.h:10