Plasma Engine  2.0
Loading...
Searching...
No Matches
LayerActions.h
1#pragma once
2
3#include <EditorPluginScene/EditorPluginSceneDLL.h>
4#include <GuiFoundation/Action/BaseActions.h>
5#include <GuiFoundation/GuiFoundationDLL.h>
6
9
11class PL_EDITORPLUGINSCENE_DLL plLayerActions
12{
13public:
14 static void RegisterActions();
15 static void UnregisterActions();
16
17 static void MapContextMenuActions(plStringView sMapping);
18
19 static plActionDescriptorHandle s_hLayerCategory;
20 static plActionDescriptorHandle s_hCreateLayer;
21 static plActionDescriptorHandle s_hDeleteLayer;
22 static plActionDescriptorHandle s_hSaveLayer;
23 static plActionDescriptorHandle s_hSaveActiveLayer;
24 static plActionDescriptorHandle s_hLayerLoaded;
25 static plActionDescriptorHandle s_hLayerVisible;
26};
27
29class PL_EDITORPLUGINSCENE_DLL plLayerAction : public plButtonAction
30{
31 PL_ADD_DYNAMIC_REFLECTION(plLayerAction, plButtonAction);
32
33public:
34 enum class ActionType
35 {
36 CreateLayer,
37 DeleteLayer,
38 SaveLayer,
39 SaveActiveLayer,
40 LayerLoaded,
41 LayerVisible,
42 };
43
44 plLayerAction(const plActionContext& context, const char* szName, ActionType type);
46
47 static void ToggleLayerLoaded(plScene2Document* pM_pSceneDocument, plUuid layerGuid);
48 virtual void Execute(const plVariant& value) override;
49
50private:
51 void LayerEventHandler(const plScene2LayerEvent& e);
52 void DocumentEventHandler(const plDocumentEvent& e);
53 void UpdateEnableState();
54 plUuid GetCurrentSelectedLayer() const;
55
56private:
57 plScene2Document* m_pSceneDocument;
58 ActionType m_Type;
59};
Handle for a plAction.
Definition Action.h:27
Definition BaseActions.h:159
Definition LayerActions.h:30
Definition LayerActions.h:12
Definition Scene2Document.h:66
plStringView represent a read-only sub-string of a larger string, as it can store a dedicated string ...
Definition StringView.h:34
This data type is the abstraction for 128-bit Uuid (also known as GUID) instances.
Definition Uuid.h:11
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 Declarations.h:54
Definition Scene2Document.h:49