6 private ButtonWidget m_bLogoutNow;
7 private ButtonWidget m_bCancel;
8 private ButtonWidget m_bCancelConsole;
16 g_Game.SetKeyboardHandle(
this);
23 g_Game.SetKeyboardHandle(
null);
32 layoutRoot =
GetGame().GetWorkspace().CreateWidgets(
"gui/layouts/day_z_logout_dialog.layout");
34 m_LogoutTimeText =
TextWidget.Cast(layoutRoot.FindAnyWidget(
"txtLogoutTime"));
35 m_DescriptionText =
TextWidget.Cast(layoutRoot.FindAnyWidget(
"txtDescription"));
36 m_bLogoutNow = ButtonWidget.Cast(layoutRoot.FindAnyWidget(
"bLogoutNow"));
37 m_bCancel = ButtonWidget.Cast(layoutRoot.FindAnyWidget(
"bCancel"));
39 #ifdef PLATFORM_CONSOLE
40 m_bCancel.Show(
false);
41 m_bLogoutNow.Show(
false);
43 layoutRoot.FindAnyWidget(
"toolbar_bg").Show(
true);
45 toolbar_b.SetText(
InputUtils.GetRichtextButtonIconFromInputAction(
"UAUIBack",
"", EUAINPUT_DEVICE_CONTROLLER,
InputUtils.ICON_SCALE_TOOLBAR));
48 m_bLogoutNow.Show(
true);
49 layoutRoot.FindAnyWidget(
"toolbar_bg").Show(
false);
56 if (player.GetEmoteManager() && !player.IsRestrained() && !player.IsUnconscious())
58 player.GetEmoteManager().CreateEmoteCBFromMenu(
EmoteConstants.ID_EMOTE_SITA);
59 player.GetEmoteManager().GetEmoteLauncher().SetForced(
EmoteLauncher.FORCE_DIFFERENT);
68 layoutRoot.Show(
true);
74 layoutRoot.Show(
false);
79 super.OnClick(w,
x,
y, button);
81 if (w == m_bLogoutNow)
83 GetGame().GetMission().AbortMission();
87 else if (w == m_bCancel)
97 override void Update(
float timeslice)
99 if (
GetUApi().GetInputByID(UAUIBack).LocalPress())
108 m_LogoutTimeText.SetText(
" ");
114 string text =
"#layout_logout_dialog_until_logout_";
116 TimeConversions.ConvertSecondsToFullTime(time, m_FullTime);
118 if (m_FullTime.m_Days > 0)
120 else if (m_FullTime.m_Hours > 0)
122 else if (m_FullTime.m_Minutes > 0)
127 text =
Widget.TranslateString(text);
128 text =
string.Format(text, m_FullTime.m_Seconds, m_FullTime.m_Minutes, m_FullTime.m_Hours, m_FullTime.m_Days);
129 m_LogoutTimeText.SetText(text);
148 if (player.IsRestrained() || player.IsUnconscious())
151 m_DescriptionText.SetText(
"#layout_logout_dialog_note_killed");
156 m_DescriptionText.SetText(
"#layout_logout_dialog_note");
163 GetGame().GetMission().Continue();
169 GetGame().GetMission().AbortMission();
174 GetGame().GetMission().Continue();
178 GetGame().LogoutRequestCancel();