DayZ
1.29
DayZ Explorer by KGB
Загрузка...
Поиск...
Не найдено
MainMenuVideo.c
См. документацию.
1
class
MainMenuVideo
extends
UIScriptedMenu
2
{
3
protected
string
m_BackButtonTextID
;
4
5
protected
VideoWidget
m_Video
;
6
7
override
Widget
Init
()
8
{
9
layoutRoot =
g_Game
.GetWorkspace().CreateWidgets(
"gui/layouts/xbox/video_menu.layout"
);
10
m_Video
= VideoWidget.Cast(layoutRoot.FindAnyWidget(
"video"
));
11
12
g_Game
.GetMission().GetOnInputDeviceChanged().Insert(
OnInputDeviceChanged
);
13
14
m_Video
.Load(
"video\\DayZ_onboarding_MASTER.mp4"
);
15
16
m_Video
.Play();
17
18
m_Video
.SetCallback(
VideoCallback
.ON_END,
StopVideo
);
19
20
return
layoutRoot;
21
}
22
23
void
~MainMenuVideo
()
24
{
25
}
26
27
//after show
28
override
void
OnShow
()
29
{
30
super.OnShow();
31
g_Game
.GetUIManager().ShowUICursor(
false
);
32
g_Game
.GetSoundScene().SetSoundVolume(0.0,0.0);
33
34
UpdateControlsElements
();
35
}
36
37
//after hide
38
override
void
OnHide
()
39
{
40
super.OnHide();
41
g_Game
.GetUIManager().ShowUICursor(
true
);
42
g_Game
.GetSoundScene().SetSoundVolume(1.0,1.0);
43
}
44
45
protected
void
OnInputDeviceChanged
(
EInputDeviceType
pInputDeviceType)
46
{
47
UpdateControlsElements
();
48
}
49
50
void
StopVideo
()
51
{
52
if
(
m_Video
)
53
{
54
m_Video
.Unload();
55
g_Game
.GetUIManager().Back();
56
}
57
}
58
59
void
PlayPauseVideo
()
60
{
61
if
(
m_Video
)
62
{
63
if
(
m_Video
.IsPlaying())
64
{
65
m_Video
.Pause();
66
}
67
else
68
{
69
m_Video
.Play();
70
}
71
}
72
}
73
74
override
void
Update
(
float
timeslice)
75
{
76
if
(
GetUApi
().GetInputByID(UAUIBack).LocalPress())
77
{
78
StopVideo
();
79
}
80
}
81
82
override
void
OnVisibilityChanged
(
bool
isVisible)
83
{
84
if
(!isVisible)
85
{
86
m_Video
.Unload();
87
}
88
}
89
90
//Deprecated
91
protected
void
LoadFooterButtonTexts
()
92
{
93
}
94
95
//Deprecated
96
protected
void
LoadTextStrings
()
97
{
98
}
99
100
protected
void
UpdateControlsElements
()
101
{
102
RichTextWidget
toolbar_text =
RichTextWidget
.Cast(layoutRoot.FindAnyWidget(
"ContextToolbarText"
));
103
string
text;
104
105
if
(
g_Game
.GetInput().IsEnabledMouseAndKeyboard() &&
g_Game
.GetInput().GetCurrentInputDevice() ==
EInputDeviceType
.MOUSE_AND_KEYBOARD)
106
{
107
text =
"ESC "
+
"#menu_back"
;
108
}
109
else
110
{
111
text =
string
.
Format
(
" %1"
,
InputUtils
.
GetRichtextButtonIconFromInputAction
(
"UAUIBack"
,
"#menu_back"
, EUAINPUT_DEVICE_CONTROLLER,
InputUtils
.
ICON_SCALE_TOOLBAR
));
112
}
113
114
toolbar_text.SetText(text);
115
}
116
}
m_BackButtonTextID
class JsonControlMappingInfo m_BackButtonTextID
g_Game
DayZGame g_Game
Определения
DayZGame.c:3942
GetUApi
proto native UAInputAPI GetUApi()
InputUtils::GetRichtextButtonIconFromInputAction
static string GetRichtextButtonIconFromInputAction(notnull UAInput pInput, string pLocalizedDescription, int pInputDeviceType=EUAINPUT_DEVICE_CONTROLLER, float pScale=ICON_SCALE_NORMAL, bool pVertical=false)
Определения
InputUtils.c:167
InputUtils::ICON_SCALE_TOOLBAR
static const float ICON_SCALE_TOOLBAR
Определения
InputUtils.c:15
InputUtils
Определения
InputUtils.c:2
RichTextWidget
Определения
gameplay.c:317
UIScriptedMenu::LoadFooterButtonTexts
void LoadFooterButtonTexts()
Определения
MainMenuVideo.c:91
UIScriptedMenu::OnShow
override void OnShow()
Определения
MainMenuVideo.c:28
UIScriptedMenu::StopVideo
void StopVideo()
Определения
MainMenuVideo.c:50
UIScriptedMenu::Update
override void Update(float timeslice)
Определения
MainMenuVideo.c:74
UIScriptedMenu::LoadTextStrings
void LoadTextStrings()
Определения
MainMenuVideo.c:96
UIScriptedMenu::OnInputDeviceChanged
void OnInputDeviceChanged(EInputDeviceType pInputDeviceType)
Определения
ControlsXboxNew.c:71
UIScriptedMenu::OnHide
override void OnHide()
Определения
MainMenuVideo.c:38
UIScriptedMenu::~MainMenuVideo
void ~MainMenuVideo()
Определения
MainMenuVideo.c:23
UIScriptedMenu::UpdateControlsElements
void UpdateControlsElements()
Определения
ControlsXboxNew.c:535
UIScriptedMenu::PlayPauseVideo
void PlayPauseVideo()
Определения
MainMenuVideo.c:59
UIScriptedMenu::Init
override Widget Init()
Определения
MainMenuVideo.c:7
UIScriptedMenu::m_Video
ref MainMenuVideo m_Video
Определения
MainMenu.c:4
UIScriptedMenu::OnVisibilityChanged
override void OnVisibilityChanged(bool isVisible)
Определения
MainMenuVideo.c:82
UIScriptedMenu
Определения
DayZGame.c:64
Widget
Определения
EnWidgets.c:190
string::Format
static proto string Format(string fmt, void param1=NULL, void param2=NULL, void param3=NULL, void param4=NULL, void param5=NULL, void param6=NULL, void param7=NULL, void param8=NULL, void param9=NULL)
Gets n-th character from string.
VideoCallback
VideoCallback
Определения
EnWidgets.c:531
EInputDeviceType
EInputDeviceType
Определения
input.c:3
Ishodniki
scripts
5_Mission
DayZ
GUI
NewUI
MainMenu
MainMenuVideo.c
Создано системой
1.13.2