DayZ 1.29
DayZ Explorer by KGB
 
Загрузка...
Поиск...
Не найдено

◆ Init()

override Widget GetText::Init ( )
protected

Launched from 'DayZGame.DeferredInit' to make earlier access, use, and updates impossible (downside of a non-static system)

whole body slots

upper body part slots

bottom body part slots

lower body part slots


heat comfort related slots

pre-init arrays

Temporary hotfix for EOnPostSimulate/EOnFrame methods not beeing called on static objects

См. определение в файле ItemDropWarningMenu.c строка 144

145{
146 protected ButtonWidget m_OkButton;
147 protected MultilineTextWidget m_Description;
148
149 void WarningMenuBase()
150 {
151 if (g_Game.GetMission())
152 {
153 g_Game.GetMission().AddActiveInputExcludes({"menu"});
154
155 g_Game.GetMission().GetHud().ShowHudUI(false);
156 g_Game.GetMission().GetHud().ShowQuickbarUI(false);
157 }
158 }
159
160 void ~WarningMenuBase()
161 {
162 if (g_Game && g_Game.GetMission())
163 {
164 g_Game.GetMission().RemoveActiveInputExcludes({"menu"},true);
165
166 g_Game.GetMission().GetHud().ShowHudUI(true);
167 g_Game.GetMission().GetHud().ShowQuickbarUI(true);
168
169 g_Game.GetMission().GetOnInputPresetChanged().Remove(OnInputPresetChanged);
170 g_Game.GetMission().GetOnInputDeviceChanged().Remove(OnInputDeviceChanged);
171 }
172 }
173
174 override Widget Init()
175 {
176 layoutRoot = g_Game.GetWorkspace().CreateWidgets("gui/layouts/day_z_dropped_items.layout");
177 m_OkButton = ButtonWidget.Cast(layoutRoot.FindAnyWidget("bOK"));
178 m_Description = MultilineTextWidget.Cast(layoutRoot.FindAnyWidget("txtDescription"));
179 m_Description.Show(true);
180
181 string text = Widget.TranslateString(GetText());
182 m_Description.SetText(text);
183
184 if (g_Game.GetMission())
185 {
186 g_Game.GetMission().GetOnInputPresetChanged().Insert(OnInputPresetChanged);
187 g_Game.GetMission().GetOnInputDeviceChanged().Insert(OnInputDeviceChanged);
188 }
189
190 OnInputDeviceChanged(g_Game.GetInput().GetCurrentInputDevice());
191
192 return layoutRoot;
193 }
194
195 string GetText()
196 {
197 return "";
198 }
199
200 override bool OnClick(Widget w, int x, int y, int button)
201 {
202 super.OnClick(w, x, y, button);
203
204 if (w.GetUserID() == IDC_OK)
205 {
206 Close();
207 return true;
208 }
209
210 return false;
211 }
212
213 override void Update(float timeslice)
214 {
215 super.Update(timeslice);
216
217 #ifdef PLATFORM_CONSOLE
218 if (GetUApi().GetInputByID(UAUISelect).LocalPress())
219 Close();
220 #endif
221 }
222
223 protected void OnInputPresetChanged()
224 {
225 #ifdef PLATFORM_CONSOLE
227 #endif
228 }
229
230 protected void OnInputDeviceChanged(EInputDeviceType pInputDeviceType)
231 {
234 }
235
236 protected void UpdateControlsElements()
237 {
238 RichTextWidget toolbarText = RichTextWidget.Cast(layoutRoot.FindAnyWidget("ContextToolbarText"));
239 string context = string.Format(" %1", InputUtils.GetRichtextButtonIconFromInputAction("UAUISelect", "#early_access_alpha_understand", EUAINPUT_DEVICE_CONTROLLER, InputUtils.ICON_SCALE_TOOLBAR));
240
241 toolbarText.SetText(context);
242 }
243
244 protected void UpdateControlsElementVisibility()
245 {
246 bool toolbarShow = false;
247 #ifdef PLATFORM_CONSOLE
248 toolbarShow = !g_Game.GetInput().IsEnabledMouseAndKeyboard() || g_Game.GetInput().GetCurrentInputDevice() == EInputDeviceType.CONTROLLER;
249 #endif
250
251 layoutRoot.FindAnyWidget("BottomConsoleToolbar").Show(toolbarShow);
252 m_OkButton.Show(!toolbarShow);
253 }
254}
255
256class ItemDropWarningMenu : WarningMenuBase
257{
258 override string GetText()
259 {
260 return "#str_item_drop_notification";
261 }
262}
263
265{
266 override string GetText()
267 {
268 return "#str_position_change_notification";
269 }
270}
void OnInputPresetChanged()
void OnInputDeviceChanged(EInputDeviceType pInputDeviceType)
DayZGame g_Game
Определения DayZGame.c:3942
Icon x
Icon y
void Close()
void ~WarningMenuBase()
Определения ItemDropWarningMenu.c:130
void UpdateControlsElementVisibility()
Определения ItemDropWarningMenu.c:214
void OnInputDeviceChanged(EInputDeviceType pInputDeviceType)
Определения ItemDropWarningMenu.c:200
void OnInputPresetChanged()
Определения ItemDropWarningMenu.c:193
ButtonWidget m_OkButton
Определения ItemDropWarningMenu.c:116
override bool OnClick(Widget w, int x, int y, int button)
Определения ItemDropWarningMenu.c:170
void UpdateControlsElements()
Определения ItemDropWarningMenu.c:206
WarningMenuBase UIScriptedMenu GetText()
Определения ItemDropWarningMenu.c:115
override Widget Init()
Launched from 'DayZGame.DeferredInit' to make earlier access, use, and updates impossible (downside o...
Определения ItemDropWarningMenu.c:144
void WarningMenuBase()
Определения ItemDropWarningMenu.c:119
proto native UAInputAPI GetUApi()
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
override string GetText()
Определения ItemDropWarningMenu.c:123
Определения gameplay.c:317
Определения DayZGame.c:64
string GetText()
Определения ItemDropWarningMenu.c:52
Определения EnWidgets.c:190
string m_Description
class purpose description
Определения EnEntity.c:847
const int IDC_OK
Определения 3_Game/DayZ/constants.c:135
proto native volatile void Update()
Определения PlayerSoundManager.c:125
EInputDeviceType
Определения input.c:3