Dayz
Build 1.29.163047, Scripts Rev. 123548
Dayz Code Explorer by Zeroy
Toggle main menu visibility
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 =
g_Game
.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
g_Game
.ChatPlayer(text);
40
if
(!
g_Game
.IsMultiplayer())
41
{
42
string
name
;
43
g_Game
.GetPlayerName(
name
);
44
ChatMessageEventParams
chat_params =
new
ChatMessageEventParams
(CCDirect,
name
, text,
""
);
45
MissionGameplay.Cast(
g_Game
.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
g_Game
.GetMission().HideChat();
65
66
if
(!
g_Game
.GetMission().IsVoNActive())
67
g_Game
.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
{
78
Close
();
79
}
80
}
81
82
void
UpdateChannel
()
83
{
84
m_channel_text
.SetText(
GetChannelName
(
/*g_Game.ChatGetChannel()*/
0));
85
}
86
87
static
string
GetChannelName
(
ChatChannel
channel)
88
{
89
switch
(channel)
90
{
91
case
CCSystem:
92
return
"System"
;
93
case
CCAdmin:
94
return
"Admin"
;
95
case
CCDirect:
96
return
"Direct"
;
97
case
CCMegaphone:
98
return
"Megaphone"
;
99
case
CCTransmitter:
100
return
"Radio"
;
101
case
CCPublicAddressSystem:
102
return
"PAS"
;
103
}
104
105
return
""
;
106
}
107
}
name
PlayerSpawnPresetDiscreteItemSetSlotData name
one set for cargo
EditBoxWidget
Definition
enwidgets.c:354
TextWidget
Definition
enwidgets.c:220
Timer
Definition
dayzplayerimplement.c:39
UAIDWrapper
Definition
uainput.c:15
UAInputAPI::GetInputByID
proto native UAInput GetInputByID(int iID)
returns list of all bindable (i.e. visible) inputs from the active group ('core' by default)
UAInput::GetPersistentWrapper
proto native UAIDWrapper GetPersistentWrapper()
UAInput::Supress
proto native void Supress()
UIScriptedMenu
Xbox menu.
Definition
dayzgame.c:64
UIScriptedMenu::m_BackInputWrapper
UAIDWrapper m_BackInputWrapper
Definition
chatinputmenu.c:5
UIScriptedMenu::OnChange
override bool OnChange(Widget w, int x, int y, bool finished)
Definition
chatinputmenu.c:29
UIScriptedMenu::GetChannelName
static string GetChannelName(ChatChannel channel)
Definition
chatinputmenu.c:87
UIScriptedMenu::Update
override void Update(float timeslice)
Definition
chatinputmenu.c:74
UIScriptedMenu::UseKeyboard
override bool UseKeyboard()
Definition
chatinputmenu.c:24
UIScriptedMenu::Refresh
override void Refresh()
Definition
chatinputmenu.c:70
UIScriptedMenu::OnShow
override void OnShow()
Definition
chatinputmenu.c:56
UIScriptedMenu::m_close_timer
ref Timer m_close_timer
Definition
chatinputmenu.c:6
UIScriptedMenu::ChatInputMenu
void ChatInputMenu()
Definition
chatinputmenu.c:8
UIScriptedMenu::UpdateChannel
void UpdateChannel()
Definition
chatinputmenu.c:82
UIScriptedMenu::m_edit_box
EditBoxWidget m_edit_box
Definition
chatinputmenu.c:3
UIScriptedMenu::m_channel_text
TextWidget m_channel_text
Definition
chatinputmenu.c:4
UIScriptedMenu::OnHide
override void OnHide()
Definition
chatinputmenu.c:61
UIScriptedMenu::Init
override Widget Init()
Definition
chatinputmenu.c:13
Widget
Definition
enwidgets.c:190
g_Game
DayZGame g_Game
Definition
dayzgame.c:3942
ChatChannel
int ChatChannel
Definition
gameplay.c:400
ChatMessageEventParams
Param4< int, string, string, string > ChatMessageEventParams
channel, from, text, color config class
Definition
gameplay.c:407
SetFocus
proto native void SetFocus(Widget w)
x
Icon x
y
Icon y
Close
void Close()
GetUApi
proto native UAInputAPI GetUApi()
Games
Dayz
scripts
5_mission
gui
chat
chatinputmenu.c
Generated by
1.17.0