DayZ 1.27
DayZ Explorer by KGB
 
Загрузка...
Поиск...
Не найдено
ItemDropWarningMenu.c
См. документацию.
2{
3 protected ButtonWidget m_OkButton;
4 protected MultilineTextWidget m_Description;
5
7 {
8 if (GetGame().GetMission())
9 {
11
14 }
15 }
16
30
31 override Widget Init()
32 {
33 layoutRoot = GetGame().GetWorkspace().CreateWidgets("gui/layouts/day_z_dropped_items.layout");
34 m_OkButton = ButtonWidget.Cast(layoutRoot.FindAnyWidget("bOK"));
35 m_Description = MultilineTextWidget.Cast(layoutRoot.FindAnyWidget("txtDescription"));
36 m_Description.Show(true);
37
38 string text = Widget.TranslateString(GetText());
39 m_Description.SetText(text);
40
41 if (GetGame().GetMission())
42 {
45 }
46
47 OnInputDeviceChanged(GetGame().GetInput().GetCurrentInputDevice());
48
49 return layoutRoot;
50 }
51
52 string GetText()
53 {
54 return "";
55 }
56
57 override bool OnClick(Widget w, int x, int y, int button)
58 {
59 super.OnClick(w, x, y, button);
60
61 if (w.GetUserID() == IDC_OK)
62 {
63 Close();
64 return true;
65 }
66
67 return false;
68 }
69
70 override void Update(float timeslice)
71 {
72 super.Update(timeslice);
73
74 #ifdef PLATFORM_CONSOLE
75 if (GetUApi().GetInputByID(UAUISelect).LocalPress())
76 Close();
77 #endif
78 }
79
80 protected void OnInputPresetChanged()
81 {
82 #ifdef PLATFORM_CONSOLE
84 #endif
85 }
86
92
93 protected void UpdateControlsElements()
94 {
95 RichTextWidget toolbarText = RichTextWidget.Cast(layoutRoot.FindAnyWidget("ContextToolbarText"));
96 string context = string.Format(" %1", InputUtils.GetRichtextButtonIconFromInputAction("UAUISelect", "#early_access_alpha_understand", EUAINPUT_DEVICE_CONTROLLER, InputUtils.ICON_SCALE_TOOLBAR));
97
98 toolbarText.SetText(context);
99 }
100
102 {
103 bool toolbarShow = false;
104 #ifdef PLATFORM_CONSOLE
106 #endif
107
108 layoutRoot.FindAnyWidget("BottomConsoleToolbar").Show(toolbarShow);
109 m_OkButton.Show(!toolbarShow);
110 }
111}
112
113class ItemDropWarningMenu : WarningMenuBase
114{
115 override string GetText()
117 return "#str_item_drop_notification";
118 }
120
122{
123 override string GetText()
124 {
125 return "#str_position_change_notification";
126 }
127}
Icon x
Icon y
void Close()
proto native UAInputAPI GetUApi()
proto native WorkspaceWidget GetWorkspace()
proto native Input GetInput()
proto native Mission GetMission()
void ShowHudUI(bool show)
void ShowQuickbarUI(bool show)
proto native EInputDeviceType GetCurrentInputDevice()
proto native bool IsEnabledMouseAndKeyboard()
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
ScriptInvoker GetOnInputPresetChanged()
Определения gameplay.c:859
void AddActiveInputExcludes(array< string > excludes)
Hud GetHud()
Определения gameplay.c:721
void RemoveActiveInputExcludes(array< string > excludes, bool bForceSupress=false)
deprecated
override string GetText()
Определения ItemDropWarningMenu.c:123
Определения gameplay.c:317
proto bool Remove(func fn, int flags=EScriptInvokerRemoveFlags.ALL)
remove specific call from list
proto bool Insert(func fn, int flags=EScriptInvokerInsertFlags.IMMEDIATE)
insert method to list
Определения DayZGame.c:64
override bool OnClick(Widget w, int x, int y, int button)
Определения ItemDropWarningMenu.c:57
void OnInputPresetChanged()
Определения ItemDropWarningMenu.c:80
override Widget Init()
Определения ItemDropWarningMenu.c:31
MultilineTextWidget m_Description
Определения ItemDropWarningMenu.c:4
void OnInputDeviceChanged(EInputDeviceType pInputDeviceType)
Определения ItemDropWarningMenu.c:87
void ~WarningMenuBase()
Определения ItemDropWarningMenu.c:17
override void Update(float timeslice)
Определения ItemDropWarningMenu.c:70
string GetText()
Определения ItemDropWarningMenu.c:52
ButtonWidget m_OkButton
Определения ItemDropWarningMenu.c:3
void UpdateControlsElements()
Определения ItemDropWarningMenu.c:93
void WarningMenuBase()
Определения ItemDropWarningMenu.c:6
void UpdateControlsElementVisibility()
Определения ItemDropWarningMenu.c:101
Определения EnWidgets.c:190
proto native CGame GetGame()
const int IDC_OK
Определения constants.c:135
proto native external Widget CreateWidgets(string layout, Widget parentWidget=NULL, bool immedUpdate=true)
Create widgets from *.layout file.
EInputDeviceType
Определения input.c:3