TDME2  1.9.200
DecalEditorTabController.h
Go to the documentation of this file.
1 #pragma once
2 
3 #include <array>
4 #include <memory>
5 #include <string>
6 
7 #include <tdme/tdme.h>
20 
21 using std::array;
22 using std::string;
23 using std::unique_ptr;
24 
44 
45 /**
46  * Decal editor tab controller
47  * @author Andreas Drewke
48  */
50  : public TabController
51 {
52 
53 private:
54  unique_ptr<BasePropertiesSubController> basePropertiesSubController;
55  unique_ptr<PrototypePhysicsSubController> prototypePhysicsSubController;
56  unique_ptr<PrototypeDisplaySubController> prototypeDisplaySubController;
57  unique_ptr<PrototypeScriptSubController> prototypeScriptSubController;
58  DecalEditorTabView* view { nullptr };
59  GUIScreenNode* screenNode { nullptr };
60  PopUps* popUps { nullptr };
61 
62  array<string, 3> applyDecalNodes {
63  "decal_texture_horizontal_sprites",
64  "decal_texture_vertical_sprites",
65  "decal_texture_fps",
66  };
67 
68 public:
69  // forbid class copy
71 
72  /**
73  * Public constructor
74  * @param view view
75  */
77 
78  /**
79  * Destructor
80  */
81  virtual ~DecalEditorTabController();
82 
83  /**
84  * Get view
85  * @return view
86  */
88  return view;
89  }
90 
91  // overridden method
92  inline GUIScreenNode* getScreenNode() override {
93  return screenNode;
94  }
95 
96  /**
97  * @return prototype display sub screen controller
98  */
100  return prototypeDisplaySubController.get();
101  }
102 
103  /**
104  * @return prototype physics sub screen controller
105  */
107  return prototypePhysicsSubController.get();
108  }
109 
110  // overridden methods
111  void initialize(GUIScreenNode* screenNode) override;
112  void dispose() override;
113  void onChange(GUIElementNode* node) override;
114  void onAction(GUIActionListenerType type, GUIElementNode* node) override;
115  void onFocus(GUIElementNode* node) override;
116  void onUnfocus(GUIElementNode* node) override;
117  void onContextMenuRequest(GUIElementNode* node, int mouseX, int mouseY) override;
118  void onTooltipShowRequest(GUINode* node, int mouseX, int mouseY) override;
119  void onTooltipCloseRequest() override;
120  void onCommand(TabControllerCommand command) override;
121  void onDrop(const string& payload, int mouseX, int mouseY) override;
122 
123  /**
124  * Set decal texture
125  * @param fileName file name
126  */
127  void setDecalTexture(const string& fileName);
128 
129  /**
130  * Set outliner content
131  */
132  void setOutlinerContent();
133 
134  /**
135  * Set outliner add drop down content
136  */
138 
139  /**
140  * Set decal details
141  */
142  void setDecalDetails();
143 
144  /**
145  * Update details panel
146  * @param outlinerNode outliner node
147  */
148  void updateDetails(const string& outlinerNode);
149 
150  /**
151  * Apply decal details
152  */
153  void applyDecalDetails();
154 
155  /**
156  * Update info text line
157  * @param text text
158  */
159  void updateInfoText(const MutableString& text);
160 
161  /**
162  * Show the information pop up / modal
163  * @param caption caption
164  * @param message message
165  */
166  void showInfoPopUp(const string& caption, const string& message);
167 
168 };
GUI node base class.
Definition: GUINode.h:64
GUI parent node base class thats supporting child nodes.
Definition: GUIParentNode.h:42
GUI screen node that represents a screen that can be rendered via GUI system.
Definition: GUIScreenNode.h:72
Pop ups controller accessor class.
Definition: PopUps.h:29
void onContextMenuRequest(GUIElementNode *node, int mouseX, int mouseY) override
On context menu request.
void onDrop(const string &payload, int mouseX, int mouseY) override
On drop.
void updateInfoText(const MutableString &text)
Update info text line.
void setOutlinerAddDropDownContent()
Set outliner add drop down content.
void onCommand(TabControllerCommand command) override
On command.
void updateDetails(const string &outlinerNode)
Update details panel.
unique_ptr< PrototypeScriptSubController > prototypeScriptSubController
DecalEditorTabController(DecalEditorTabView *view)
Public constructor.
void setDecalTexture(const string &fileName)
Set decal texture.
unique_ptr< PrototypePhysicsSubController > prototypePhysicsSubController
unique_ptr< PrototypeDisplaySubController > prototypeDisplaySubController
void showInfoPopUp(const string &caption, const string &message)
Show the information pop up / modal.
void onAction(GUIActionListenerType type, GUIElementNode *node) override
unique_ptr< BasePropertiesSubController > basePropertiesSubController
void onTooltipShowRequest(GUINode *node, int mouseX, int mouseY) override
On tooltip show request.
Mutable utf8 aware string class.
Definition: MutableString.h:23
GUI action listener interface.
GUI change listener interface.
GUI focus listener interface.
Tab controller, which connects UI with logic.
Definition: TabController.h:34
#define FORBID_CLASS_COPY(CLASS)
Definition: tdme.h:6