DayZ
1.24
Loading...
Searching...
No Matches
ChatInputMenu.c
Go to the documentation of this file.
1
class
ChatInputMenu
extends
UIScriptedMenu
2
{
3
private
EditBoxWidget
m_edit_box
;
4
private
TextWidget
m_channel_text
;
5
private
UAIDWrapper
m_BackInputWrapper
;
6
private
ref
Timer
m_close_timer
;
7
8
void
ChatInputMenu
()
9
{
10
m_close_timer =
new
Timer
();
11
}
12
13
override
Widget
Init
()
14
{
15
m_BackInputWrapper
=
GetUApi
().GetInputByID(
UAUIBack
).GetPersistentWrapper();
16
layoutRoot =
GetGame
().GetWorkspace().CreateWidgets(
"gui/layouts/day_z_chat_input.layout"
);
17
m_edit_box =
EditBoxWidget
.Cast(layoutRoot.FindAnyWidget(
"InputEditBoxWidget"
));
18
m_channel_text =
TextWidget
.Cast(layoutRoot.FindAnyWidget(
"ChannelText"
));
19
20
UpdateChannel
();
21
return
layoutRoot;
22
}
23
24
override
bool
UseKeyboard
()
25
{
26
return
true
;
27
}
28
29
override
bool
OnChange
(
Widget
w
,
int
x
,
int
y
,
bool
finished
)
30
{
31
super
.OnChange(
w
,
x
,
y
,
finished
);
32
33
if
(!
finished
)
return
false
;
34
35
string
text
= m_edit_box.GetText();
36
37
if
(
text
!=
""
)
38
{
39
GetGame
().ChatPlayer(
text
);
40
if
(!
GetGame
().IsMultiplayer())
41
{
42
string
name
;
43
GetGame
().GetPlayerName(
name
);
44
ChatMessageEventParams
chat_params
=
new
ChatMessageEventParams
(
CCDirect
,
name
,
text
,
""
);
45
MissionGameplay.Cast(
GetGame
().GetMission()).m_Chat.Add(
chat_params
);
46
}
47
}
48
49
m_close_timer.Run(0.1,
this
,
"Close"
);
50
51
GetUApi
().GetInputByID(
UAPersonView
).Supress();
52
53
return
true
;
54
}
55
56
override
void
OnShow
()
57
{
58
SetFocus
(m_edit_box);
59
}
60
61
override
void
OnHide
()
62
{
63
super
.OnHide();
64
GetGame
().GetMission().HideChat();
65
66
if
(!
GetGame
().GetMission().IsVoNActive())
67
GetGame
().GetMission().HideVoiceLevelWidgets();
68
}
69
70
override
void
Refresh
()
71
{
72
}
73
74
override
void
Update
(
float
timeslice
)
75
{
76
if
(
m_BackInputWrapper
.
InputP
().LocalPress())
77
Close
();
78
}
79
80
void
UpdateChannel
()
81
{
82
m_channel_text.SetText(
GetChannelName
(
/*GetGame().ChatGetChannel()*/
0));
83
}
84
85
static
string
GetChannelName
(
ChatChannel
channel
)
86
{
87
switch
(
channel
)
88
{
89
case
CCSystem
:
90
return
"System"
;
91
case
CCAdmin
:
92
return
"Admin"
;
93
case
CCDirect
:
94
return
"Direct"
;
95
case
CCMegaphone
:
96
return
"Megaphone"
;
97
case
CCTransmitter
:
98
return
"Radio"
;
99
case
CCPublicAddressSystem
:
100
return
"PAS"
;
101
}
102
103
return
""
;
104
}
105
}
name
PlayerSpawnPresetDiscreteItemSetSlotData name
one set for cargo
x
Icon x
y
Icon y
Close
void Close()
m_BackInputWrapper
UAIDWrapper m_BackInputWrapper
Definition
RadialMenu.c:32
GetUApi
proto native UAInputAPI GetUApi()
EditBoxWidget
Definition
EnWidgets.c:354
Param3
Definition
EntityAI.c:95
TextWidget
Definition
EnWidgets.c:220
Timer
Definition
DayZPlayerImplement.c:61
UAIDWrapper
Definition
UAInput.c:15
UAIDWrapper::InputP
proto native UAInput InputP()
UIScriptedMenu
Definition
DayZGame.c:64
UIScriptedMenu::OnShow
override void OnShow()
Definition
ChatInputMenu.c:56
UIScriptedMenu::Update
override void Update(float timeslice)
Definition
ChatInputMenu.c:74
UIScriptedMenu::m_channel_text
TextWidget m_channel_text
Definition
ChatInputMenu.c:4
UIScriptedMenu::m_BackInputWrapper
UAIDWrapper m_BackInputWrapper
Definition
ChatInputMenu.c:5
UIScriptedMenu::Refresh
override void Refresh()
Definition
ChatInputMenu.c:70
UIScriptedMenu::UpdateChannel
void UpdateChannel()
Definition
ChatInputMenu.c:80
UIScriptedMenu::m_close_timer
ref Timer m_close_timer
Definition
ChatInputMenu.c:6
UIScriptedMenu::OnHide
override void OnHide()
Definition
ChatInputMenu.c:61
UIScriptedMenu::OnChange
override bool OnChange(Widget w, int x, int y, bool finished)
Definition
ChatInputMenu.c:29
UIScriptedMenu::ChatInputMenu
void ChatInputMenu()
Definition
ChatInputMenu.c:8
UIScriptedMenu::UseKeyboard
override bool UseKeyboard()
Definition
ChatInputMenu.c:24
UIScriptedMenu::Init
override Widget Init()
Definition
ChatInputMenu.c:13
UIScriptedMenu::m_edit_box
EditBoxWidget m_edit_box
Definition
ChatInputMenu.c:3
UIScriptedMenu::GetChannelName
static string GetChannelName(ChatChannel channel)
Definition
ChatInputMenu.c:85
Widget
Definition
EnWidgets.c:190
ChatMessageEventParams
Param4< int, string, string, string > ChatMessageEventParams
channel, from, text, color config class
Definition
gameplay.c:394
GetGame
proto native CGame GetGame()
SetFocus
proto native void SetFocus(Widget w)
scripts
5_Mission
GUI
Chat
ChatInputMenu.c
Generated by
1.10.0