DayZ 1.27
DayZ Explorer by KGB
 
Загрузка...
Поиск...
Не найдено
MainMenuVideo.c
См. документацию.
1class MainMenuVideo extends UIScriptedMenu
2{
3 protected string m_BackButtonTextID;
4
5 protected VideoWidget m_Video;
6
7 override Widget Init()
8 {
9 layoutRoot = GetGame().GetWorkspace().CreateWidgets("gui/layouts/xbox/video_menu.layout");
10 m_Video = VideoWidget.Cast(layoutRoot.FindAnyWidget("video"));
11
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
24 {
25 }
26
27 //after show
28 override void OnShow()
29 {
30 super.OnShow();
33
35 }
36
37 //after hide
38 override void OnHide()
39 {
40 super.OnHide();
43 }
44
45 protected void OnInputDeviceChanged(EInputDeviceType pInputDeviceType)
46 {
48 }
49
50 void StopVideo()
51 {
52 if (m_Video)
53 {
54 m_Video.Unload();
56 }
57 }
58
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 (GetGame().GetInput().IsEnabledMouseAndKeyboard() && GetGame().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}
class JsonControlMappingInfo m_BackButtonTextID
proto native UAInputAPI GetUApi()
proto native UIManager GetUIManager()
proto native AbstractSoundScene GetSoundScene()
proto native WorkspaceWidget GetWorkspace()
proto native Mission GetMission()
static string GetRichtextButtonIconFromInputAction(notnull UAInput pInput, string pLocalizedDescription, int pInputDeviceType=EUAINPUT_DEVICE_CONTROLLER, float pScale=ICON_SCALE_NORMAL, bool pVertical=false)
Определения InputUtils.c:167
static const float ICON_SCALE_TOOLBAR
Определения InputUtils.c:15
Определения InputUtils.c:2
ScriptInvoker GetOnInputDeviceChanged()
Определения gameplay.c:851
Определения gameplay.c:317
proto bool Insert(func fn, int flags=EScriptInvokerInsertFlags.IMMEDIATE)
insert method to list
void ShowUICursor(bool visible)
Определения UIManager.c:244
bool Back()
Close top window on windows stack, returns true when any window is closed.
Определения UIManager.c:62
void LoadFooterButtonTexts()
Определения MainMenuVideo.c:91
override void OnShow()
Определения MainMenuVideo.c:28
void StopVideo()
Определения MainMenuVideo.c:50
override void Update(float timeslice)
Определения MainMenuVideo.c:74
void LoadTextStrings()
Определения MainMenuVideo.c:96
void OnInputDeviceChanged(EInputDeviceType pInputDeviceType)
Определения ControlsXboxNew.c:71
override void OnHide()
Определения MainMenuVideo.c:38
void ~MainMenuVideo()
Определения MainMenuVideo.c:23
void UpdateControlsElements()
Определения ControlsXboxNew.c:527
void PlayPauseVideo()
Определения MainMenuVideo.c:59
override Widget Init()
Определения MainMenuVideo.c:7
ref MainMenuVideo m_Video
Определения MainMenu.c:4
override void OnVisibilityChanged(bool isVisible)
Определения MainMenuVideo.c:82
Определения DayZGame.c:64
Определения EnWidgets.c:190
proto native CGame GetGame()
proto native void SetSoundVolume(float vol, float time)
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.
proto native external Widget CreateWidgets(string layout, Widget parentWidget=NULL, bool immedUpdate=true)
Create widgets from *.layout file.
VideoCallback
Определения EnWidgets.c:531
EInputDeviceType
Определения input.c:3