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

◆ ~WarningMenuBase()

void GetText::~WarningMenuBase ( )
protected

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

131{
132 protected ButtonWidget m_OkButton;
133 protected MultilineTextWidget m_Description;
134
135 void WarningMenuBase()
136 {
137 if (g_Game.GetMission())
138 {
139 g_Game.GetMission().AddActiveInputExcludes({"menu"});
140
141 g_Game.GetMission().GetHud().ShowHudUI(false);
142 g_Game.GetMission().GetHud().ShowQuickbarUI(false);
143 }
144 }
145
146 void ~WarningMenuBase()
147 {
148 if (g_Game && g_Game.GetMission())
149 {
150 g_Game.GetMission().RemoveActiveInputExcludes({"menu"},true);
151
152 g_Game.GetMission().GetHud().ShowHudUI(true);
153 g_Game.GetMission().GetHud().ShowQuickbarUI(true);
154
155 g_Game.GetMission().GetOnInputPresetChanged().Remove(OnInputPresetChanged);
156 g_Game.GetMission().GetOnInputDeviceChanged().Remove(OnInputDeviceChanged);
157 }
158 }
159
160 override Widget Init()
161 {
162 layoutRoot = g_Game.GetWorkspace().CreateWidgets("gui/layouts/day_z_dropped_items.layout");
163 m_OkButton = ButtonWidget.Cast(layoutRoot.FindAnyWidget("bOK"));
164 m_Description = MultilineTextWidget.Cast(layoutRoot.FindAnyWidget("txtDescription"));
165 m_Description.Show(true);
166
167 string text = Widget.TranslateString(GetText());
168 m_Description.SetText(text);
169
170 if (g_Game.GetMission())
171 {
172 g_Game.GetMission().GetOnInputPresetChanged().Insert(OnInputPresetChanged);
173 g_Game.GetMission().GetOnInputDeviceChanged().Insert(OnInputDeviceChanged);
174 }
175
176 OnInputDeviceChanged(g_Game.GetInput().GetCurrentInputDevice());
177
178 return layoutRoot;
179 }
180
181 string GetText()
182 {
183 return "";
184 }
185
186 override bool OnClick(Widget w, int x, int y, int button)
187 {
188 super.OnClick(w, x, y, button);
189
190 if (w.GetUserID() == IDC_OK)
191 {
192 Close();
193 return true;
194 }
195
196 return false;
197 }
198
199 override void Update(float timeslice)
200 {
201 super.Update(timeslice);
202
203 #ifdef PLATFORM_CONSOLE
204 if (GetUApi().GetInputByID(UAUISelect).LocalPress())
205 Close();
206 #endif
207 }
208
209 protected void OnInputPresetChanged()
210 {
211 #ifdef PLATFORM_CONSOLE
213 #endif
214 }
215
216 protected void OnInputDeviceChanged(EInputDeviceType pInputDeviceType)
217 {
220 }
221
222 protected void UpdateControlsElements()
223 {
224 RichTextWidget toolbarText = RichTextWidget.Cast(layoutRoot.FindAnyWidget("ContextToolbarText"));
225 string context = string.Format(" %1", InputUtils.GetRichtextButtonIconFromInputAction("UAUISelect", "#early_access_alpha_understand", EUAINPUT_DEVICE_CONTROLLER, InputUtils.ICON_SCALE_TOOLBAR));
226
227 toolbarText.SetText(context);
228 }
229
230 protected void UpdateControlsElementVisibility()
231 {
232 bool toolbarShow = false;
233 #ifdef PLATFORM_CONSOLE
234 toolbarShow = !g_Game.GetInput().IsEnabledMouseAndKeyboard() || g_Game.GetInput().GetCurrentInputDevice() == EInputDeviceType.CONTROLLER;
235 #endif
236
237 layoutRoot.FindAnyWidget("BottomConsoleToolbar").Show(toolbarShow);
238 m_OkButton.Show(!toolbarShow);
239 }
240}
241
242class ItemDropWarningMenu : WarningMenuBase
243{
244 override string GetText()
245 {
246 return "#str_item_drop_notification";
247 }
248}
249
251{
252 override string GetText()
253 {
254 return "#str_position_change_notification";
255 }
256}
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