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

◆ OnInputDeviceChanged()

void GetText::OnInputDeviceChanged ( EInputDeviceType pInputDeviceType)
protected

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

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