Plasma Engine  2.0
Loading...
Searching...
No Matches
GameObjectDocumentActions.h
1#pragma once
2
3#include <EditorFramework/EditorFrameworkDLL.h>
4#include <GuiFoundation/Action/BaseActions.h>
5#include <GuiFoundation/GuiFoundationDLL.h>
6
7class plPreferences;
11class PL_EDITORFRAMEWORK_DLL plGameObjectDocumentActions
12{
13public:
14 static void RegisterActions();
15 static void UnregisterActions();
16
17 static void MapMenuActions(plStringView sMapping);
18 static void MapMenuSimulationSpeed(plStringView sMapping);
19
20 static void MapToolbarActions(plStringView sMapping);
21
22 static plActionDescriptorHandle s_hGameObjectCategory;
23 static plActionDescriptorHandle s_hRenderSelectionOverlay;
24 static plActionDescriptorHandle s_hRenderVisualizers;
25 static plActionDescriptorHandle s_hRenderShapeIcons;
26 static plActionDescriptorHandle s_hRenderGrid;
27 static plActionDescriptorHandle s_hAddAmbientLight;
28 static plActionDescriptorHandle s_hSimulationSpeedMenu;
29 static plActionDescriptorHandle s_hSimulationSpeed[10];
30 static plActionDescriptorHandle s_hCameraSpeed;
31 static plActionDescriptorHandle s_hPickTransparent;
32};
33
35class PL_EDITORFRAMEWORK_DLL plGameObjectDocumentAction : public plButtonAction
36{
37 PL_ADD_DYNAMIC_REFLECTION(plGameObjectDocumentAction, plButtonAction);
38
39public:
40 enum class ActionType
41 {
42 RenderSelectionOverlay,
43 RenderVisualizers,
44 RenderShapeIcons,
45 RenderGrid,
46 AddAmbientLight,
47 SimulationSpeed,
48 PickTransparent,
49 };
50
51 plGameObjectDocumentAction(const plActionContext& context, const char* szName, ActionType type, float fSimSpeed = 1.0f);
53
54 virtual void Execute(const plVariant& value) override;
55
56private:
57 void SceneEventHandler(const plGameObjectEvent& e);
58 void OnPreferenceChange(plPreferences* pref);
59
60 float m_fSimSpeed;
61 plGameObjectDocument* m_pGameObjectDocument;
62 ActionType m_Type;
63};
64
65
66class PL_EDITORFRAMEWORK_DLL plCameraSpeedSliderAction : public plSliderAction
67{
68 PL_ADD_DYNAMIC_REFLECTION(plCameraSpeedSliderAction, plSliderAction);
69
70public:
71 enum class ActionType
72 {
73 CameraSpeed,
74 };
75
76 plCameraSpeedSliderAction(const plActionContext& context, const char* szName, ActionType type);
78
79 virtual void Execute(const plVariant& value) override;
80
81private:
82 void OnPreferenceChange(plPreferences* pref);
83 void UpdateState();
84
85 plGameObjectDocument* m_pGameObjectDocument;
86 ActionType m_Type;
87};
Handle for a plAction.
Definition Action.h:27
Definition BaseActions.h:159
Definition GameObjectDocumentActions.h:67
Definition GameObjectDocumentActions.h:36
Definition GameObjectDocumentActions.h:12
Definition GameObjectDocument.h:95
Base class for all preferences.
Definition Preferences.h:17
Definition BaseActions.h:206
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 GameObjectDocument.h:28