DayZ
1.24
Loading...
Searching...
No Matches
UIPopupScriptInitScript.c
Go to the documentation of this file.
1
class
UIPopupScriptInitScript
extends
UIPopupScript
2
{
3
private
MultilineEditBoxWidget
m_MedxInitScript
;
4
5
private
ButtonWidget
m_BtnRun
;
6
private
ButtonWidget
m_BtnSave
;
7
private
ButtonWidget
m_BtnCancel
;
8
9
private
int
m_SceneObjectIndex
;
10
private
SceneObject
m_SceneObject
;
11
12
private
PluginSceneManager
m_ModuleSceneManager
;
13
14
//================================================
15
// UIPopupScriptInitScript
16
//================================================
17
void
UIPopupScriptInitScript
(
Widget
wgt
)
18
{
19
m_ModuleSceneManager = PluginSceneManager.Cast(
GetPlugin
(PluginSceneManager));
20
21
m_MedxInitScript =
MultilineEditBoxWidget
.Cast(
wgt
.FindAnyWidget(
"pnl_ppp_is_init_script_value"
));
22
23
m_BtnRun =
ButtonWidget
.Cast(
wgt
.FindAnyWidget(
"btn_ppp_is_run"
));
24
m_BtnSave =
ButtonWidget
.Cast(
wgt
.FindAnyWidget(
"btn_ppp_is_save"
));
25
m_BtnCancel =
ButtonWidget
.Cast(
wgt
.FindAnyWidget(
"btn_ppp_is_cancel"
));
26
}
27
28
//================================================
29
// OnOpen
30
//================================================
31
override
void
OnOpen
(
Param
param
)
32
{
33
m_MedxInitScript.SetText(
""
);
34
35
if
(
param
!=
NULL
)
36
{
37
Param2<int, SceneObject>
param_scene_object
=
Param2<int, SceneObject>
.Cast(
param
);
38
int
index
=
param_scene_object
.param1;
39
SceneObject
scene_object
=
param_scene_object
.param2;
40
41
if
(
index
> -1 &&
scene_object
!=
NULL
)
42
{
43
m_SceneObjectIndex =
index
;
44
m_SceneObject =
scene_object
;
45
m_MedxInitScript.SetText(m_SceneObject.
GetInitScript
());
46
}
47
}
48
}
49
50
//================================================
51
// OnClick
52
//================================================
53
override
bool
OnClick
(
Widget
w
,
int
x
,
int
y
,
int
button
)
54
{
55
super
.OnClick(
w
,
x
,
y
,
button
);
56
57
if
(
w
== m_BtnRun)
58
{
59
if
(m_SceneObject !=
NULL
)
60
{
61
string
text_run
;
62
m_MedxInitScript.GetText(
text_run
);
63
m_ModuleSceneManager.ExecuteEnforceScript(m_SceneObjectIndex, m_SceneObject,
text_run
);
64
}
65
}
66
else
if
(
w
== m_BtnSave)
67
{
68
if
(m_SceneObject !=
NULL
)
69
{
70
string
text_script
;
71
m_MedxInitScript.GetText(
text_script
);
72
m_SceneObject.
SetInitScript
(
text_script
);
73
}
74
75
PopupBack
();
76
77
return
true
;
78
}
79
else
if
(
w
== m_BtnCancel)
80
{
81
PopupBack
();
82
83
return
true
;
84
}
85
86
return
false
;
87
}
88
}
x
Icon x
y
Icon y
GetPlugin
PluginBase GetPlugin(typename plugin_type)
Definition
PluginManager.c:300
Param3
Definition
EntityAI.c:95
Param
Base Param Class with no parameters. Used as general purpose parameter overloaded with Param1 to Para...
Definition
param.c:12
SceneObject
Definition
SceneObject.c:2
SceneObject::SetInitScript
void SetInitScript(string init_script)
Definition
SceneObject.c:89
SceneObject::GetInitScript
string GetInitScript()
Definition
SceneObject.c:81
UIPopupScript
Definition
UIPopupScript.c:2
UIPopupScript::m_ModuleSceneManager
PluginSceneManager m_ModuleSceneManager
Definition
UIPopupScriptEditorSettings.c:9
UIPopupScript::OnClick
override bool OnClick(Widget w, int x, int y, int button)
Definition
UIPopupScriptInitScript.c:53
UIPopupScript::PopupBack
UIPopupScript PopupBack()
Definition
UIPopupScript.c:37
UIPopupScript::m_BtnRun
ButtonWidget m_BtnRun
Definition
UIPopupScriptInitScript.c:5
UIPopupScript::m_BtnCancel
ButtonWidget m_BtnCancel
Definition
UIPopupScriptConfigs.c:4
UIPopupScript::OnOpen
override void OnOpen(Param param)
Definition
UIPopupScriptInitScript.c:31
UIPopupScript::UIPopupScriptInitScript
void UIPopupScriptInitScript(Widget wgt)
Definition
UIPopupScriptInitScript.c:17
UIPopupScript::m_MedxInitScript
MultilineEditBoxWidget m_MedxInitScript
Definition
UIPopupScriptInitScript.c:3
UIPopupScript::m_BtnSave
ButtonWidget m_BtnSave
Definition
UIPopupScriptInitScript.c:6
UIPopupScript::m_SceneObject
SceneObject m_SceneObject
Definition
UIPopupScriptInitScript.c:10
UIPopupScript::m_SceneObjectIndex
int m_SceneObjectIndex
Definition
UIPopupScriptInitScript.c:9
Widget
Definition
EnWidgets.c:190
scripts
5_Mission
GUI
SceneEditorMenu
UIPopupScript
UIPopupScriptInitScript.c
Generated by
1.10.0