DayZ 1.24
Loading...
Searching...
No Matches
UIPopupScriptEditorSettings.c
Go to the documentation of this file.
1class UIPopupScriptEditorSettings extends UIPopupScript
2{
6
8
9 private PluginSceneManager m_ModuleSceneManager;
10
11 //================================================
12 // UIPopupScriptEditorSettings
13 //================================================
15 {
16 m_ModuleSceneManager = PluginSceneManager.Cast(GetPlugin(PluginSceneManager));
17
18 m_WgtTglSeleHighlight = CheckBoxWidget.Cast(wgt.FindAnyWidget("cbx_ppp_est_flag_selection"));
19 m_WgtTglSavePlayerPos = CheckBoxWidget.Cast(wgt.FindAnyWidget("cbx_ppp_est_flag_load_player_pos"));
20 m_EdxRotationDelta = EditBoxWidget.Cast(wgt.FindAnyWidget("ebx_ppp_est_rotation_delta_value"));
21
22 m_BtnCancel = ButtonWidget.Cast(wgt.FindAnyWidget("btn_ppp_est_cancel"));
23 }
24
25 //================================================
26 // OnOpen
27 //================================================
28 override void OnOpen(Param param)
29 {
30 m_WgtTglSeleHighlight.SetChecked(m_ModuleSceneManager.GetDrawSelection());
31 m_WgtTglSavePlayerPos.SetChecked(m_ModuleSceneManager.GetLoadPlayerPos());
32 m_EdxRotationDelta.SetText(m_ModuleSceneManager.GetRotationAngle().ToString());
33 }
34
35 //================================================
36 // OnClick
37 //================================================
38 override bool OnClick(Widget w, int x, int y, int button)
39 {
40 super.OnClick(w, x, y, button);
41
42 if (w == m_WgtTglSeleHighlight)
43 m_ModuleSceneManager.SetDrawSelection(m_WgtTglSeleHighlight.IsChecked());
44 else if (w == m_WgtTglSavePlayerPos)
45 m_ModuleSceneManager.SetLoadPlayerPos(m_WgtTglSavePlayerPos.IsChecked());
46 else if (w == m_BtnCancel)
47 {
48 PopupBack();
49
50 return true;
51 }
52
53 return false;
54 }
55
56 //============================================
57 // OnChange
58 //============================================
59 override bool OnChange(Widget w, int x, int y, bool finished)
60 {
61 if (w == m_EdxRotationDelta)
62 {
63 int angle = m_EdxRotationDelta.GetText().ToInt();
64
65 if (angle > 0)
66 m_ModuleSceneManager.SetRotationAngle(angle);
67
68 return true;
69 }
70
71 return false;
72 }
73}
Icon x
Icon y
PluginBase GetPlugin(typename plugin_type)
Base Param Class with no parameters. Used as general purpose parameter overloaded with Param1 to Para...
Definition param.c:12
PluginSceneManager m_ModuleSceneManager
override bool OnClick(Widget w, int x, int y, int button)
UIPopupScript PopupBack()
ButtonWidget m_BtnCancel
void UIPopupScriptEditorSettings(Widget wgt)
override void OnOpen(Param param)
CheckBoxWidget m_WgtTglSeleHighlight
EditBoxWidget m_EdxRotationDelta
CheckBoxWidget m_WgtTglSavePlayerPos
override bool OnChange(Widget w, int x, int y, bool finished)