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

◆ OnClick()

override bool GetText::OnClick ( Widget w,
int x,
int y,
int button )
protected

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

171{
172 protected ButtonWidget m_OkButton;
173 protected MultilineTextWidget m_Description;
174
175 void WarningMenuBase()
176 {
177 if (g_Game.GetMission())
178 {
179 g_Game.GetMission().AddActiveInputExcludes({"menu"});
180
181 g_Game.GetMission().GetHud().ShowHudUI(false);
182 g_Game.GetMission().GetHud().ShowQuickbarUI(false);
183 }
184 }
185
186 void ~WarningMenuBase()
187 {
188 if (g_Game && g_Game.GetMission())
189 {
190 g_Game.GetMission().RemoveActiveInputExcludes({"menu"},true);
191
192 g_Game.GetMission().GetHud().ShowHudUI(true);
193 g_Game.GetMission().GetHud().ShowQuickbarUI(true);
194
195 g_Game.GetMission().GetOnInputPresetChanged().Remove(OnInputPresetChanged);
196 g_Game.GetMission().GetOnInputDeviceChanged().Remove(OnInputDeviceChanged);
197 }
198 }
199
200 override Widget Init()
201 {
202 layoutRoot = g_Game.GetWorkspace().CreateWidgets("gui/layouts/day_z_dropped_items.layout");
203 m_OkButton = ButtonWidget.Cast(layoutRoot.FindAnyWidget("bOK"));
204 m_Description = MultilineTextWidget.Cast(layoutRoot.FindAnyWidget("txtDescription"));
205 m_Description.Show(true);
206
207 string text = Widget.TranslateString(GetText());
208 m_Description.SetText(text);
209
210 if (g_Game.GetMission())
211 {
212 g_Game.GetMission().GetOnInputPresetChanged().Insert(OnInputPresetChanged);
213 g_Game.GetMission().GetOnInputDeviceChanged().Insert(OnInputDeviceChanged);
214 }
215
216 OnInputDeviceChanged(g_Game.GetInput().GetCurrentInputDevice());
217
218 return layoutRoot;
219 }
220
221 string GetText()
222 {
223 return "";
224 }
225
226 override bool OnClick(Widget w, int x, int y, int button)
227 {
228 super.OnClick(w, x, y, button);
229
230 if (w.GetUserID() == IDC_OK)
231 {
232 Close();
233 return true;
234 }
235
236 return false;
237 }
238
239 override void Update(float timeslice)
240 {
241 super.Update(timeslice);
242
243 #ifdef PLATFORM_CONSOLE
244 if (GetUApi().GetInputByID(UAUISelect).LocalPress())
245 Close();
246 #endif
247 }
248
249 protected void OnInputPresetChanged()
250 {
251 #ifdef PLATFORM_CONSOLE
253 #endif
254 }
255
256 protected void OnInputDeviceChanged(EInputDeviceType pInputDeviceType)
257 {
260 }
261
262 protected void UpdateControlsElements()
263 {
264 RichTextWidget toolbarText = RichTextWidget.Cast(layoutRoot.FindAnyWidget("ContextToolbarText"));
265 string context = string.Format(" %1", InputUtils.GetRichtextButtonIconFromInputAction("UAUISelect", "#early_access_alpha_understand", EUAINPUT_DEVICE_CONTROLLER, InputUtils.ICON_SCALE_TOOLBAR));
266
267 toolbarText.SetText(context);
268 }
269
270 protected void UpdateControlsElementVisibility()
271 {
272 bool toolbarShow = false;
273 #ifdef PLATFORM_CONSOLE
274 toolbarShow = !g_Game.GetInput().IsEnabledMouseAndKeyboard() || g_Game.GetInput().GetCurrentInputDevice() == EInputDeviceType.CONTROLLER;
275 #endif
276
277 layoutRoot.FindAnyWidget("BottomConsoleToolbar").Show(toolbarShow);
278 m_OkButton.Show(!toolbarShow);
279 }
280}
281
282class ItemDropWarningMenu : WarningMenuBase
283{
284 override string GetText()
285 {
286 return "#str_item_drop_notification";
287 }
288}
289
291{
292 override string GetText()
293 {
294 return "#str_position_change_notification";
295 }
296}
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