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

◆ UpdateControlsElementVisibility()

void GetText::UpdateControlsElementVisibility ( )
protected

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

215{
216 protected ButtonWidget m_OkButton;
217 protected MultilineTextWidget m_Description;
218
219 void WarningMenuBase()
220 {
221 if (g_Game.GetMission())
222 {
223 g_Game.GetMission().AddActiveInputExcludes({"menu"});
224
225 g_Game.GetMission().GetHud().ShowHudUI(false);
226 g_Game.GetMission().GetHud().ShowQuickbarUI(false);
227 }
228 }
229
230 void ~WarningMenuBase()
231 {
232 if (g_Game && g_Game.GetMission())
233 {
234 g_Game.GetMission().RemoveActiveInputExcludes({"menu"},true);
235
236 g_Game.GetMission().GetHud().ShowHudUI(true);
237 g_Game.GetMission().GetHud().ShowQuickbarUI(true);
238
239 g_Game.GetMission().GetOnInputPresetChanged().Remove(OnInputPresetChanged);
240 g_Game.GetMission().GetOnInputDeviceChanged().Remove(OnInputDeviceChanged);
241 }
242 }
243
244 override Widget Init()
245 {
246 layoutRoot = g_Game.GetWorkspace().CreateWidgets("gui/layouts/day_z_dropped_items.layout");
247 m_OkButton = ButtonWidget.Cast(layoutRoot.FindAnyWidget("bOK"));
248 m_Description = MultilineTextWidget.Cast(layoutRoot.FindAnyWidget("txtDescription"));
249 m_Description.Show(true);
250
251 string text = Widget.TranslateString(GetText());
252 m_Description.SetText(text);
253
254 if (g_Game.GetMission())
255 {
256 g_Game.GetMission().GetOnInputPresetChanged().Insert(OnInputPresetChanged);
257 g_Game.GetMission().GetOnInputDeviceChanged().Insert(OnInputDeviceChanged);
258 }
259
260 OnInputDeviceChanged(g_Game.GetInput().GetCurrentInputDevice());
261
262 return layoutRoot;
263 }
264
265 string GetText()
266 {
267 return "";
268 }
269
270 override bool OnClick(Widget w, int x, int y, int button)
271 {
272 super.OnClick(w, x, y, button);
273
274 if (w.GetUserID() == IDC_OK)
275 {
276 Close();
277 return true;
278 }
279
280 return false;
281 }
282
283 override void Update(float timeslice)
284 {
285 super.Update(timeslice);
286
287 #ifdef PLATFORM_CONSOLE
288 if (GetUApi().GetInputByID(UAUISelect).LocalPress())
289 Close();
290 #endif
291 }
292
293 protected void OnInputPresetChanged()
294 {
295 #ifdef PLATFORM_CONSOLE
297 #endif
298 }
299
300 protected void OnInputDeviceChanged(EInputDeviceType pInputDeviceType)
301 {
304 }
305
306 protected void UpdateControlsElements()
307 {
308 RichTextWidget toolbarText = RichTextWidget.Cast(layoutRoot.FindAnyWidget("ContextToolbarText"));
309 string context = string.Format(" %1", InputUtils.GetRichtextButtonIconFromInputAction("UAUISelect", "#early_access_alpha_understand", EUAINPUT_DEVICE_CONTROLLER, InputUtils.ICON_SCALE_TOOLBAR));
310
311 toolbarText.SetText(context);
312 }
313
314 protected void UpdateControlsElementVisibility()
315 {
316 bool toolbarShow = false;
317 #ifdef PLATFORM_CONSOLE
318 toolbarShow = !g_Game.GetInput().IsEnabledMouseAndKeyboard() || g_Game.GetInput().GetCurrentInputDevice() == EInputDeviceType.CONTROLLER;
319 #endif
320
321 layoutRoot.FindAnyWidget("BottomConsoleToolbar").Show(toolbarShow);
322 m_OkButton.Show(!toolbarShow);
323 }
324}
325
326class ItemDropWarningMenu : WarningMenuBase
327{
328 override string GetText()
329 {
330 return "#str_item_drop_notification";
331 }
332}
333
335{
336 override string GetText()
337 {
338 return "#str_position_change_notification";
339 }
340}
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