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

◆ UpdateControlsElements()

void GetText::UpdateControlsElements ( )
protected

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

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

Используется в UIScriptedMenu::ChangeCurrentCategory(), UIScriptedMenu::Init(), UIScriptedMenu::OnInputPresetChanged() и UIScriptedMenu::RefreshGestures().