DayZ
1.24
Loading...
Searching...
No Matches
UIPopupScriptPositionManager.c
Go to the documentation of this file.
1
class
UIPopupScriptPositionManager
extends
UIPopupScript
2
{
3
private
TextListboxWidget
m_LstPositionList
;
4
private
EditBoxWidget
m_TxtSelectedX
;
5
private
EditBoxWidget
m_TxtSelectedY
;
6
private
EditBoxWidget
m_TxtCurrentX
;
7
private
EditBoxWidget
m_TxtCurrentY
;
8
private
PluginConfigDebugProfileFixed
m_ConfigDebugProfileFixed
;
9
private
ButtonWidget
m_TeleportButton
;
10
private
ButtonWidget
m_CancelButton
;
11
12
//================================================
13
// UIPopupScriptPositionManager
14
//================================================
15
void
UIPopupScriptPositionManager
(
Widget
wgt
)
16
{
17
m_ConfigDebugProfileFixed = PluginConfigDebugProfileFixed.Cast(
GetPlugin
(PluginConfigDebugProfileFixed));
18
m_LstPositionList =
TextListboxWidget
.Cast(
wgt
.FindAnyWidget(
"tls_ppp_pm_positions_list"
));
19
m_TxtSelectedX =
EditBoxWidget
.Cast(
wgt
.FindAnyWidget(
"pnl_ppp_pm_selected_x_value"
));
20
m_TxtSelectedY =
EditBoxWidget
.Cast(
wgt
.FindAnyWidget(
"pnl_ppp_pm_selected_y_value"
));
21
m_TxtCurrentX =
EditBoxWidget
.Cast(
wgt
.FindAnyWidget(
"pnl_ppp_pm_current_x_value"
));
22
m_TxtCurrentY =
EditBoxWidget
.Cast(
wgt
.FindAnyWidget(
"pnl_ppp_pm_current_y_value"
));
23
m_TeleportButton =
ButtonWidget
.Cast(
wgt
.FindAnyWidget(
"btn_ppp_pm_teleport"
));
24
m_CancelButton =
ButtonWidget
.Cast(
wgt
.FindAnyWidget(
"btn_ppp_pm_cancel"
));
25
/*
26
TStringArray positions_array = new TStringArray;
27
m_ConfigDebugProfileFixed.GetAllPositionsNames( positions_array );
28
29
for ( int i = 0; i < positions_array.Count(); i++ )
30
{
31
m_LstPositionList.AddItem( positions_array.Get(i), new LocationParams ( positions_array.Get(i), false, vector.Zero), 0);
32
}*/
33
}
34
35
//================================================
36
// OnOpen
37
//================================================
38
override
void
OnOpen
(
Param
param
)
39
{
40
if
(PluginSceneManager.GetInstance())
41
{
42
if
(PluginSceneManager.GetInstance().GetSelectedSceneObject())
43
{
44
vector
player_pos
= PluginSceneManager.GetInstance().GetSelectedSceneObject().GetPosition();
45
46
m_TxtCurrentX.SetText(
player_pos
[0].
ToString
());
47
m_TxtCurrentY.SetText(
player_pos
[2].
ToString
());
48
}
49
}
50
}
51
52
//================================================
53
// OnClick
54
//================================================
55
override
bool
OnClick
(
Widget
w
,
int
x
,
int
y
,
int
button
)
56
{
57
if
(
w
== m_TeleportButton)
58
{
59
float
pos_x
= m_TxtSelectedX.GetText().ToFloat();
60
float
pos_z
= m_TxtSelectedY.GetText().ToFloat();
61
62
PluginSceneManager.GetInstance().SelectedObjectSetPosX(
pos_x
);
63
PluginSceneManager.GetInstance().SelectedObjectSetPosZ(
pos_z
);
64
PopupBack
();
65
return
true
;
66
}
67
else
if
(
w
== m_CancelButton)
68
{
69
PopupBack
();
70
return
true
;
71
}
72
return
false
;
73
}
74
75
void
OnItemSelected
(
Widget
w
,
int
x
,
int
y
,
int
row
,
int
column
,
int
oldRow
,
int
oldColumn
)
76
{
77
/*
78
vector position = m_ConfigDebugProfileFixed.GetPositionByNameEx( GetCurrentLocationName() );
79
m_TxtSelectedX.SetText( position[0].ToString() );
80
m_TxtSelectedY.SetText( position[2].ToString() );
81
*/
82
}
83
84
string
GetCurrentLocationName
()
85
{
86
if
(m_LstPositionList.GetSelectedRow() != -1)
87
{
88
string
position_name
;
89
m_LstPositionList.GetItemText(m_LstPositionList.GetSelectedRow(), 0,
position_name
);
90
return
position_name
;
91
}
92
return
""
;
93
}
94
}
ToString
proto string ToString()
x
Icon x
y
Icon y
GetPlugin
PluginBase GetPlugin(typename plugin_type)
Definition
PluginManager.c:300
EditBoxWidget
Definition
EnWidgets.c:354
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
UIPopupScript
Definition
UIPopupScript.c:2
UIPopupScript::m_TeleportButton
ButtonWidget m_TeleportButton
Definition
UIPopupScriptPositionManager.c:9
UIPopupScript::OnClick
override bool OnClick(Widget w, int x, int y, int button)
Definition
UIPopupScriptPositionManager.c:55
UIPopupScript::m_TxtSelectedY
EditBoxWidget m_TxtSelectedY
Definition
UIPopupScriptPositionManager.c:5
UIPopupScript::PopupBack
UIPopupScript PopupBack()
Definition
UIPopupScript.c:37
UIPopupScript::m_TxtCurrentX
EditBoxWidget m_TxtCurrentX
Definition
UIPopupScriptPositionManager.c:6
UIPopupScript::m_ConfigDebugProfileFixed
PluginConfigDebugProfileFixed m_ConfigDebugProfileFixed
Definition
UIPopupScriptPositionManager.c:8
UIPopupScript::OnOpen
override void OnOpen(Param param)
Definition
UIPopupScriptPositionManager.c:38
UIPopupScript::UIPopupScriptPositionManager
void UIPopupScriptPositionManager(Widget wgt)
Definition
UIPopupScriptPositionManager.c:15
UIPopupScript::GetCurrentLocationName
string GetCurrentLocationName()
Definition
UIPopupScriptPositionManager.c:84
UIPopupScript::m_TxtSelectedX
EditBoxWidget m_TxtSelectedX
Definition
UIPopupScriptPositionManager.c:4
UIPopupScript::OnItemSelected
void OnItemSelected(Widget w, int x, int y, int row, int column, int oldRow, int oldColumn)
Definition
UIPopupScriptPositionManager.c:75
UIPopupScript::m_LstPositionList
TextListboxWidget m_LstPositionList
Definition
UIPopupScriptPositionManager.c:3
UIPopupScript::m_TxtCurrentY
EditBoxWidget m_TxtCurrentY
Definition
UIPopupScriptPositionManager.c:7
UIPopupScript::m_CancelButton
ButtonWidget m_CancelButton
Definition
UIPopupScriptPositionManager.c:10
Widget
Definition
EnWidgets.c:190
vector
Definition
EnConvert.c:106
scripts
5_Mission
GUI
SceneEditorMenu
UIPopupScript
UIPopupScriptPositionManager.c
Generated by
1.10.0