DayZ
1.24
Loading...
Searching...
No Matches
ScriptConsoleAddPosition.c
Go to the documentation of this file.
1
class
ScriptConsoleAddLocation
extends
UIScriptedMenu
2
{
3
void
ScriptConsoleAddLocation
()
4
{
5
6
}
7
8
void
~ScriptConsoleAddLocation
()
9
{
10
}
11
12
void
SetPosition
(
vector
pos)
13
{
14
m_EditboxPos.SetText(pos.
ToString
());
15
}
16
17
override
Widget
Init
()
18
{
19
m_ConfigDebugProfile
=
PluginConfigDebugProfile
.Cast(
GetPlugin
(
PluginConfigDebugProfile
));
20
layoutRoot =
GetGame
().GetWorkspace().CreateWidgets(
"gui/layouts/script_console/script_console_add_location_dialogue.layout"
);
21
m_EditboxName =
EditBoxWidget
.Cast(layoutRoot.FindAnyWidget(
"LocationName"
));
22
m_EditboxPos =
EditBoxWidget
.Cast(layoutRoot.FindAnyWidget(
"Position"
));
23
m_Label =
TextWidget
.Cast(layoutRoot.FindAnyWidget(
"WindowLabel"
));
24
m_ClearButton =
ButtonWidget
.Cast(layoutRoot.FindAnyWidget(
"ButtonClear"
));
25
m_Label.SetText(
"ADD NEW LOCATION"
);
26
27
return
layoutRoot;
28
}
29
30
override
bool
OnClick
(
Widget
w
,
int
x
,
int
y
,
int
button
)
31
{
32
super
.OnClick(
w
,
x
,
y
,
button
);
33
34
if
(
w
.GetUserID() ==
IDC_OK
)
35
{
36
string
name
= m_EditboxName.GetText();
37
ScriptConsole
console
= ScriptConsole.Cast(
GetGame
().GetUIManager().FindMenu(
MENU_SCRIPTCONSOLE
));
38
ScriptConsoleGeneralTab
tab
=
ScriptConsoleGeneralTab
.Cast(
console
.GetTabHandler(
ScriptConsoleGeneralTab
));
39
if
(
tab
)
40
{
41
if
(!
tab
.IsLocationNameAvailable(
name
) ||
name
==
""
|| m_EditboxPos.GetText() ==
""
)
42
return
false
;
43
m_ConfigDebugProfile
.CustomLocationsAdd(
name
, m_EditboxPos.GetText().BeautifiedToVector());
44
Close
();
45
tab
.RefreshLocations();
46
return
true
;
47
}
48
}
49
else
if
(
w
.GetUserID() ==
IDC_CANCEL
)
50
{
51
Close
();
52
return
true
;
53
}
54
else
if
(
w
== m_ClearButton)
55
{
56
m_EditboxPos.SetText(
""
);
57
return
true
;
58
}
59
60
return
false
;
61
}
62
PluginConfigDebugProfile
m_ConfigDebugProfile
;
63
EditBoxWidget
m_EditboxName
;
64
EditBoxWidget
m_EditboxPos
;
65
TextWidget
m_Label
;
66
TextWidget
m_Message
;
67
ButtonWidget
m_ClearButton
;
68
}
name
PlayerSpawnPresetDiscreteItemSetSlotData name
one set for cargo
x
Icon x
y
Icon y
Close
void Close()
m_ConfigDebugProfile
PluginConfigDebugProfile m_ConfigDebugProfile
Definition
PluginItemDiagnostic.c:57
GetPlugin
PluginBase GetPlugin(typename plugin_type)
Definition
PluginManager.c:300
EditBoxWidget
Definition
EnWidgets.c:354
Param3
Definition
EntityAI.c:95
PluginConfigDebugProfile
Definition
PluginConfigDebugProfileFixed.c:2
ScriptConsoleGeneralTab
Definition
ScriptConsoleGeneralTab.c:2
TextWidget
Definition
EnWidgets.c:220
UIScriptedMenu
Definition
DayZGame.c:64
UIScriptedMenu::m_EditboxName
EditBoxWidget m_EditboxName
Definition
ScriptConsoleAddPosition.c:63
UIScriptedMenu::m_EditboxPos
EditBoxWidget m_EditboxPos
Definition
ScriptConsoleAddPosition.c:64
UIScriptedMenu::m_ConfigDebugProfile
PluginConfigDebugProfile m_ConfigDebugProfile
Definition
SceneEditorMenu.c:1076
UIScriptedMenu::m_Message
TextWidget m_Message
Definition
ScriptConsoleAddPosition.c:66
UIScriptedMenu::m_ClearButton
ButtonWidget m_ClearButton
Definition
ScriptConsoleAddPosition.c:67
UIScriptedMenu::m_Label
TextWidget m_Label
Definition
ScriptConsoleAddPosition.c:65
UIScriptedMenu::~ScriptConsoleAddLocation
void ~ScriptConsoleAddLocation()
Definition
ScriptConsoleAddPosition.c:8
UIScriptedMenu::ScriptConsoleAddLocation
void ScriptConsoleAddLocation()
Definition
ScriptConsoleAddPosition.c:3
UIScriptedMenu::SetPosition
void SetPosition(vector pos)
Definition
ScriptConsoleAddPosition.c:12
UIScriptedMenu::Init
override Widget Init()
Definition
ScriptConsoleAddPosition.c:17
UIScriptedMenu::OnClick
override bool OnClick(Widget w, int x, int y, int button)
Definition
ScriptConsoleAddPosition.c:30
Widget
Definition
EnWidgets.c:190
vector
Definition
EnConvert.c:106
vector::ToString
proto string ToString(bool beautify=true)
Vector to string.
GetGame
proto native CGame GetGame()
MENU_SCRIPTCONSOLE
const int MENU_SCRIPTCONSOLE
Definition
constants.c:175
IDC_CANCEL
const int IDC_CANCEL
Definition
constants.c:128
IDC_OK
const int IDC_OK
Definition
constants.c:127
scripts
5_Mission
GUI
ScriptConsole
ScriptConsoleAddPosition.c
Generated by
1.10.0