OROCHI
 
Loading...
Searching...
No Matches
GxToolScript.h
Go to the documentation of this file.
1//===========================================================================
9//===========================================================================
10#pragma once
11
12#if GX_DEVELOP
13GX_CORE_NAMESPACE_BEGIN()
14
15//===========================================================================
17//===========================================================================
18class GxToolScript : public GxToolResourceEditBase
19{
20 //-------------------------------------------------------------
22 //-------------------------------------------------------------
24public:
25 // RTTI定義
26 GX_RTTI_CLASS_NAME_ICON( GxToolScript, GxToolResourceEditBase, "スクリプト編集", GxRtti::ICON_TYPE::CORE)
27 // ClassBaseReference継承クラス用禁止宣言
29
30
31 enum class BLOCK_TEXTURE
32 {
33 START,
34 END,
35 LEFT,
36 WIDTH,
37 RIGHT,
38 BRANCH_UP,
39 BRANCH_CENTER,
40 BRANCH_DOWN,
41 BRANCH_HEIGHT,
42 PARAMETER_LEFT,
43 PARAMETER_WIDTH,
44 PARAMETER_RIGHT,
45 MAX,
46 };
47
49 struct GxFunctionCreate : public GxStructBase
50 {
51 //-------------------------------------------------------------
53 //-------------------------------------------------------------
55 public:
56 GX_RTTI_STRUCT(GxFunctionCreate)
57
58
59 //-------------------------------------------------------------
61 //-------------------------------------------------------------
63
65 GxFunctionCreate(void) : _pName(nullptr), _pHelp(nullptr)
66 {
67 for (u32 i = 0; i < GxFunction::ARGUMENT_MAX; i++)
68 {
69 _pArgumentNames[i] = nullptr;
70 _pArgumentHelps[i] = nullptr;
71 }
72 }
73
75 //-----------------------------------------------------------
77 //-----------------------------------------------------------
79
80#if GX_DEVELOP
82 static GxGuiBase* createGui(GxProperty& property, GxTypedObject* pOwner, const GxRtti& rtti, u32 index);
83#endif // GX_DEVELOP
84
86 //-------------------------------------------------------------
88 //-------------------------------------------------------------
90
91 GxString* _pName;
92 GxString* _pHelp;
93 GxFunction::GxType _returnType;
94 GxString* _pArgumentNames[GxFunction::ARGUMENT_MAX];
95 GxString* _pArgumentHelps[GxFunction::ARGUMENT_MAX];
97
99 };
100
101private:
102 static const u32 SPLITTER_VERTICAL_COUNT = 4;
103 class GxGuiPropertyTableEventFunction;
104 class GxGuiPropertyTableDynamicFunction;
105 class GxGuiPropertyTableDynamicVariable;
106 class GxGuiPropertyTableBlock;
107
109 //-------------------------------------------------------------
111 //-------------------------------------------------------------
113public:
115 GxToolScript( void );
116
118 b32 initialize( void ) override;
120 void cleanup(void) override;
122 void setResource(GxResBase* pResource) override;
123private:
125 void initializeScript(void);
127 void resetFormPropertyScript(void);
128
130 //-------------------------------------------------------------
132 //-------------------------------------------------------------
134public:
136 b32 close(void) override;
138 void changeTab(u32 scriptIndex, b32 isCreateTab);
140 void focusBlock(GxScript::GxBlock& block, GxScript* pScript);
141protected:
143 void update( void ) override;
144private:
145 // タブの閉じるボタンイベント
146 void eventCloseTab(void* pOneTab);
148 void openGuiAddFunction(void);
150 void addFunction(void);
152 void cancelAddFunction(void);
154 void addVariable(void);
156 void checkRemoveFunction(u32 index);
158 constexpr void cancelRemoveFunction(void) {}
160 void removeFunction(u32 index);
162 void checkRemoveVariable(u32 index);
164 constexpr void cancelRemoveVariable(void) {}
166 void removeVariable(u32 index);
167
169 //-------------------------------------------------------------
171 //-------------------------------------------------------------
173public:
175 GX_FORCE_INLINE static GxResTexture* getBlockTexture(BLOCK_TEXTURE blockTexture) { return _pBlockTextures[static_cast<u32>(blockTexture)]; }
177 constexpr void setUnit(GxUnitBase* pUnit) { _pUnit = pUnit; }
179 constexpr void setStage(GxStageBase* pStage) { _pStage = pStage; }
180
182 //-------------------------------------------------------------
184 //-------------------------------------------------------------
186private:
187 static GxResTexture* _pBlockTextures[static_cast<u32>(BLOCK_TEXTURE::MAX)];
188 GxGuiSplitter* _pSplitterVertical[SPLITTER_VERTICAL_COUNT];
189 GxGuiSplitter* _pSplitterHorizontal;
190 GxGuiTab* _pTabScript;
191 GxGuiFormProperty* _pFormPropertyScript;
192 GxGuiPropertyTableEventFunction* _pPropertyTableEventFunction;
193 GxGuiPropertyTableDynamicFunction* _pPropertyTableDynamicFunction;
194 GxGuiPropertyTableDynamicVariable* _pPropertyTableDynamicVariable;
195 GxGuiPropertyTableBlock* _pFormPropertyBlock;
196 GxArrayClassBase _formScripts;
197 GxScript::GxBlock* _pSelectedBlock;
198 GxFunctionCreate _functionCreate;
199 GxResScript::GxDynamicFunction* _pAddDynamicFunction;
200 GxUnitBase* _pUnit;
201 GxStageBase* _pStage;
202
204};
205
206//===========================================================================
208//===========================================================================
209class GxToolScript::GxGuiPropertyTableEventFunction : public GxGuiPropertyTable
210{
211 //-----------------------------------------------------------
213 //-----------------------------------------------------------
215public:
216 GX_RTTI_CLASS(GxGuiPropertyTableEventFunction, GxGuiPropertyTable)
217 // GxGuiPropertyTable継承クラス用禁止宣言
218 GX_PROHIBIT_CLASS_BASE_REFERENCE(GxGuiPropertyTableEventFunction)
219
220
221 //-----------------------------------------------------------
223 //-----------------------------------------------------------
225public:
227 GxGuiPropertyTableEventFunction( const GxProperty& property, GxTypedObject* pObject, u32 index = 0, b32 useFilter = false, TYPE type = TYPE::HORIZON, b32 useIndex = false )
228 : Super(property, pObject, index, useFilter, type, useIndex) {}
229private:
231 GxGuiPropertyTableEventFunction(void) {}
232
234 //-----------------------------------------------------------
236 //-----------------------------------------------------------
238public:
240 void onClick(const GxPoint2& /*position*/, u32 /*button*/) override;
241
243};
244
245//===========================================================================
247//===========================================================================
248class GxToolScript::GxGuiPropertyTableDynamicFunction : public GxGuiPropertyTable
249{
250 //-----------------------------------------------------------
252 //-----------------------------------------------------------
254public:
255 GX_RTTI_CLASS(GxGuiPropertyTableDynamicFunction, GxGuiPropertyTable)
256 // GxGuiPropertyTable継承クラス用禁止宣言
257 GX_PROHIBIT_CLASS_BASE_REFERENCE(GxGuiPropertyTableDynamicFunction)
258
259
260 //-----------------------------------------------------------
262 //-----------------------------------------------------------
264public:
266 GxGuiPropertyTableDynamicFunction( const GxProperty& property, GxTypedObject* pObject, u32 index = 0, b32 useFilter = false, TYPE type = TYPE::HORIZON, b32 useIndex = false )
267 : Super(property, pObject, index, useFilter, type, useIndex) {}
268private:
270 GxGuiPropertyTableDynamicFunction(void) {}
271
273 //-----------------------------------------------------------
275 //-----------------------------------------------------------
277public:
279 void update(void) override;
281 void onClick(const GxPoint2& /*position*/, u32 /*button*/) override;
283 void onMouseUp(const GxPoint2& position, u32 button) override;
284
286};
287
288//===========================================================================
290//===========================================================================
291class GxToolScript::GxGuiPropertyTableDynamicVariable : public GxGuiPropertyTable
292{
293 //-----------------------------------------------------------
295 //-----------------------------------------------------------
297public:
298 GX_RTTI_CLASS(GxGuiPropertyTableDynamicVariable, GxGuiPropertyTable)
299 // GxGuiPropertyTable継承クラス用禁止宣言
300 GX_PROHIBIT_CLASS_BASE_REFERENCE(GxGuiPropertyTableDynamicVariable)
301
302
303 //-----------------------------------------------------------
305 //-----------------------------------------------------------
307public:
309 GxGuiPropertyTableDynamicVariable( const GxProperty& property, GxTypedObject* pObject, u32 index = 0, b32 useFilter = false, TYPE type = TYPE::HORIZON, b32 useIndex = false )
310 : Super(property, pObject, index, useFilter, type, useIndex) {}
311private:
313 GxGuiPropertyTableDynamicVariable(void) {}
314
316 //-----------------------------------------------------------
318 //-----------------------------------------------------------
320public:
322 void update(void) override;
324 void onMouseUp(const GxPoint2& position, u32 button) override;
325
327};
328
329//===========================================================================
331//===========================================================================
332class GxToolScript::GxGuiPropertyTableBlock : public GxGuiPropertyTable
333{
334 //-----------------------------------------------------------
336 //-----------------------------------------------------------
338public:
339 GX_RTTI_CLASS(GxGuiPropertyTableBlock, GxGuiPropertyTable)
340 // GxGuiPropertyTable継承クラス用禁止宣言
341 GX_PROHIBIT_CLASS_BASE_REFERENCE(GxGuiPropertyTableBlock)
342
343
344 //-----------------------------------------------------------
346 //-----------------------------------------------------------
348public:
350 GxGuiPropertyTableBlock( const GxProperty& property, GxTypedObject* pObject, u32 index = 0, b32 useFilter = false, TYPE type = TYPE::HORIZON, b32 useIndex = false )
351 : Super(property, pObject, index, useFilter, type, useIndex) {}
352private:
354 GxGuiPropertyTableBlock(void) {}
355
357 //-----------------------------------------------------------
359 //-----------------------------------------------------------
361public:
363 void update(void) override;
364
366};
367
368GX_CORE_NAMESPACE_END()
369
370#endif //GX_DEVELOP
#define GX_PROHIBIT_CLASS_BASE_REFERENCE(__CLASS__)
GxClassBaseReference継承の禁止宣言(new以外の生成禁止 + コピー禁止)
Definition GxBase.h:244
@ MAX
定義数
void GxTypedObject
その他
Definition GxDefine.h:213
配列クラス
Definition GxArrayClassBase.h:18
型情報
Definition GxFunction.h:48
static const u32 ARGUMENT_MAX
引数の最大数
Definition GxFunction.h:234
プロパティクラス
Definition GxProperty.h:48
リソース基底クラス
Definition GxResBase.h:23
動的関数クラス
Definition GxResScript.h:49
テクスチャリソース
Definition GxResTexture.h:23
実行時型情報クラス
Definition GxRtti.h:154
標準ブロッククラス
Definition GxScript.h:231
スクリプトクラス
Definition GxScript.h:19
Definition GxStageBase.h:20
ユニット基礎クラス
Definition GxUnitBase.h:45
座標
Definition GxStruct.h:867
文字列型クラス
Definition GxString.h:18
Definition GxBase.h:24
32bitブーリアン
Definition GxDefine.h:173