9 ImageWidget m_MicrophoneIcon;
16 ref LogoutMenu m_Logout;
21 protected ref GameplayEffectWidgets m_EffectWidgets;
23 ref
Timer m_ChatChannelHideTimer;
24 ref WidgetFadeTimer m_ChatChannelFadeTimer;
25 ref WidgetFadeTimer m_MicFadeTimer;
31 protected ref
Timer m_ToggleHudTimer;
32 protected const int HOLD_LIMIT_TIME = 300;
33 protected int m_ActionDownTime;
34 protected int m_ActionUpTime;
35 protected bool m_InitOnce;
36 protected bool m_ControlDisabled;
37 protected int m_ControlDisabledMode;
39 protected ref
array<int> m_ActiveInputRestrictions;
40 protected bool m_ProcessInputExcludes;
41 protected bool m_QuickbarHold;
42 protected bool m_PlayerRespawning;
43 protected int m_RespawnModeClient;
44 protected bool m_PauseQueued;
47 protected bool m_VoNActive;
48 protected Widget m_VoiceLevels;
52 void MissionGameplay()
56 m_EffectWidgets =
new GameplayEffectWidgets;
57 m_HudRootWidget =
null;
61 m_Hud =
new IngameHud;
63 m_PauseQueued =
false;
64 m_ChatChannelFadeTimer =
new WidgetFadeTimer;
65 m_MicFadeTimer =
new WidgetFadeTimer;
73 void ~MissionGameplay()
77 if (
g_Game.GetUIManager() &&
g_Game.GetUIManager().ScreenFadeVisible())
79 g_Game.GetUIManager().ScreenFadeOut(0);
87 return m_InventoryMenu;
100 if (!
GetGame().IsMultiplayer())
110 m_UIManager =
GetGame().GetUIManager();
115 if ( !m_HudRootWidget )
117 m_HudRootWidget =
GetGame().GetWorkspace().CreateWidgets(
"gui/layouts/day_z_hud.layout");
119 m_HudRootWidget.Show(
false);
121 m_Chat.Init(m_HudRootWidget.FindAnyWidget(
"ChatFrameWidget"));
123 m_ActionMenu.Init( m_HudRootWidget.FindAnyWidget(
"ActionsPanel"),
TextWidget.Cast( m_HudRootWidget.FindAnyWidget(
"DefaultActionWidget") ) );
125 m_Hud.Init( m_HudRootWidget.FindAnyWidget(
"HudPanel") );
128 m_MicrophoneIcon = ImageWidget.Cast( m_HudRootWidget.FindAnyWidget(
"mic") );
129 m_MicrophoneIcon.Show(
false);
132 m_VoiceLevels = m_HudRootWidget.FindAnyWidget(
"VoiceLevelsPanel");
138 m_VoiceLevelsWidgets.Set(VoiceLevelWhisper, ImageWidget.Cast( m_VoiceLevels.FindAnyWidget(
"Whisper") ));
139 m_VoiceLevelsWidgets.Set(VoiceLevelTalk, ImageWidget.Cast( m_VoiceLevels.FindAnyWidget(
"Talk") ));
140 m_VoiceLevelsWidgets.Set(VoiceLevelShout, ImageWidget.Cast( m_VoiceLevels.FindAnyWidget(
"Shout") ));
142 m_VoiceLevelTimers.Set(VoiceLevelWhisper,
new WidgetFadeTimer);
143 m_VoiceLevelTimers.Set(VoiceLevelTalk,
new WidgetFadeTimer);
144 m_VoiceLevelTimers.Set(VoiceLevelShout,
new WidgetFadeTimer);
147 HideVoiceLevelWidgets();
150 m_ChatChannelArea = m_HudRootWidget.FindAnyWidget(
"ChatChannelPanel");
151 m_ChatChannelText =
TextWidget.Cast( m_HudRootWidget.FindAnyWidget(
"ChatChannelText") );
158 if ( !m_HudDebug.IsInitialized() )
160 m_HudDebug.Init(
GetGame().GetWorkspace().CreateWidgets(
"gui/layouts/debug/day_z_hud_debug.layout") );
171 override void OnMissionStart()
173 g_Game.SetConnecting(
false);
175 #ifndef FEATURE_CURSOR
176 GetUIManager().ShowUICursor(
false);
180 g_Game.SetMissionState( DayZGame.MISSION_STATE_GAME );
186 if ( !m_InventoryMenu )
192 void TickScheduler(
float timeslice)
197 player.OnScheduledTick(timeslice);
202 if( mute_list && mute_list.Count() > 0 )
205 rpc.Write(mute_list);
206 rpc.Send(
null,
ERPCs.RPC_USER_SYNC_PERMISSIONS,
true,
null);
210 override void UpdateInputDevicesAvailability()
212 super.UpdateInputDevicesAvailability();
214 g_Game.GetInput().UpdateConnectedInputDeviceList();
215 g_Game.UpdateInputDeviceDisconnectWarning();
218 override void OnMissionFinish()
223 GetUIManager().HideDialog();
227 delete m_HudRootWidget;
230 m_DebugMonitor.Hide();
231 #ifndef FEATURE_CURSOR
232 g_Game.GetUIManager().ShowUICursor(
false);
236 g_Game.SetMissionState( DayZGame.MISSION_STATE_FINNISH );
239 override void OnUpdate(
float timeslice)
241 #ifdef DIAG_DEVELOPER
242 UpdateInputDeviceDiag();
245 #ifdef FEATURE_CURSOR
246 if (GetTimeStamp() == 0)
250 m_PauseQueued =
true;
255 GetUIManager().ShowUICursor(
false);
260 if (m_PauseQueued && !IsPaused())
265 Man player =
GetGame().GetPlayer();
267 TickScheduler(timeslice);
268 UpdateDummyScheduler();
271 NoteMenu note_menu = NoteMenu.Cast( m_UIManager.FindMenu(
MENU_NOTE) );
272 GesturesMenu gestures_menu = GesturesMenu.Cast(m_UIManager.FindMenu(
MENU_GESTURES));
273 RadialQuickbarMenu quickbar_menu = RadialQuickbarMenu.Cast(m_UIManager.FindMenu(
MENU_RADIAL_QUICKBAR));
274 InspectMenuNew inspect = InspectMenuNew.Cast( m_UIManager.FindMenu(
MENU_INSPECT) );
277 bool manualInputUnlockProcessed =
false;
281 #ifdef DIAG_DEVELOPER
284 DbgUI.Begin(
"Hologram Debug", 5, 5);
288 if ( playerPB.GetHologramLocal() )
290 playerPB.GetHologramLocal().UpdateHologram( timeslice );
292 #ifdef DIAG_DEVELOPER
295 DbgUI.Text(
"No active Hologram");
304 runningAction = playerPB.GetActionManager().GetRunningAction();
307 #ifdef PLATFORM_CONSOLE
309 if (
GetUApi().GetInputByID(UAVoiceModifierHelper).LocalValue() && !menu)
311 GetUApi().GetInputByID(UAUIQuickbarRadialOpen).Lock();
312 GetUApi().GetInputByID(UAZoomInToggle).Lock();
313 GetUApi().GetInputByID(UAPersonView).Lock();
314 GetUApi().GetInputByID(UALeanLeft).Lock();
315 GetUApi().GetInputByID(UALeanRight).Lock();
317 else if (
GetUApi().GetInputByID(UAVoiceModifierHelper).LocalRelease())
319 GetUApi().GetInputByID(UAUIQuickbarRadialOpen).Unlock();
320 GetUApi().GetInputByID(UAZoomInToggle).Unlock();
321 GetUApi().GetInputByID(UAPersonView).Unlock();
322 GetUApi().GetInputByID(UALeanLeft).Unlock();
323 GetUApi().GetInputByID(UALeanRight).Unlock();
325 manualInputUnlockProcessed =
true;
329 if (
GetUApi().GetInputByID(UAUIQuickbarRadialOpen).LocalPress() && playerPB)
332 if ( playerPB.IsAlive() && !playerPB.IsRaised() && !playerPB.IsUnconscious() && !playerPB.GetCommand_Vehicle() )
336 RadialQuickbarMenu.OpenMenu();
337 m_Hud.ShowHudUI(
false );
342 bool b1 = RadialQuickbarMenu.GetItemToAssign() !=
null;
344 if (GetUIManager().IsMenuOpen(
MENU_RADIAL_QUICKBAR ) && (!RadialQuickbarMenu.GetMenuInstance().GetParentMenu() || RadialQuickbarMenu.GetMenuInstance().GetParentMenu() != inventory) && (
GetUApi().GetInputByID(UAUIQuickbarRadialOpen).LocalRelease() || !
GetUApi().GetInputByID(UAUIQuickbarRadialOpen).LocalValue()))
346 RadialQuickbarMenu.CloseMenu();
347 m_Hud.ShowHudUI(
true );
351 if ((RadialQuickbarMenu.instance && RadialQuickbarMenu.GetMenuInstance().GetParentMenu() && RadialQuickbarMenu.GetMenuInstance().GetParentMenu() == inventory) &&
GetUApi().GetInputByID(UAUIQuickbarRadialInventoryOpen).LocalRelease())
356 RadialQuickbarMenu.CloseMenu();
357 RadialQuickbarMenu.SetItemToAssign( NULL );
358 AddActiveInputExcludes({
"inventory"});
359 AddActiveInputRestriction(EInputRestrictors.INVENTORY);
366 if (playerPB.IsRaised() || playerPB.IsInRasedProne())
368 GetUApi().GetInputByID(UALeanLeftGamepad).Unlock();
369 GetUApi().GetInputByID(UALeanRightGamepad).Unlock();
371 manualInputUnlockProcessed =
true;
375 GetUApi().GetInputByID(UALeanLeftGamepad).Lock();
376 GetUApi().GetInputByID(UALeanRightGamepad).Lock();
380 if (playerPB.IsRaised())
382 GetUApi().GetInputByID(UALookAround).Lock();
383 GetUApi().GetInputByID(UALookAroundToggle).Lock();
385 GetUApi().GetInputByID(UAZeroingUp).Unlock();
386 GetUApi().GetInputByID(UAZeroingDown).Unlock();
388 manualInputUnlockProcessed =
true;
392 GetUApi().GetInputByID(UALookAround).Unlock();
393 GetUApi().GetInputByID(UALookAroundToggle).Unlock();
395 GetUApi().GetInputByID(UAZeroingUp).Lock();
396 GetUApi().GetInputByID(UAZeroingDown).Lock();
398 manualInputUnlockProcessed =
true;
403 if (manualInputUnlockProcessed)
409 if (
GetUApi().GetInputByID(UAUIGesturesOpen).LocalPress() && playerPB)
412 if ( !playerPB.IsRaised() && (playerPB.GetActionManager().ActionPossibilityCheck(playerPB.m_MovementState.m_CommandTypeId) || playerPB.IsEmotePlaying()) && !playerPB.GetCommand_Vehicle() )
416 GesturesMenu.OpenMenu();
417 m_Hud.ShowHudUI(
false );
422 if (
GetUApi().GetInputByID(UAUIGesturesOpen).LocalRelease() ||
GetUApi().GetInputByID(UAUIGesturesOpen).LocalValue() == 0 )
427 GesturesMenu.CloseMenu();
428 m_Hud.ShowHudUI(
true );
432 if (player && m_LifeState ==
EPlayerStates.ALIVE && !player.IsUnconscious() )
437 m_HudRootWidget.Show(
true);
443 if ( GetUIManager().ScreenFadeVisible() )
445 GetUIManager().ScreenFadeOut(0.5);
450 if (
GetUApi().GetInputByID(UAGear).LocalPress())
452 if (!inventory && playerPB.CanManipulateInventory() && IsMapUnfoldActionRunning(runningAction))
455 menu = m_InventoryMenu;
457 else if (menu == inventory)
463 if (
GetUApi().GetInputByID(UAUIMenu).LocalPress() && menu && inventory && menu == inventory)
468 #ifndef PLATFORM_CONSOLE
469 if (
GetUApi().GetInputByID(UAChat).LocalPress() && input.IsEnabledMouseAndKeyboardEvenOnServer())
471 ChatInputMenu chat = ChatInputMenu.Cast( m_UIManager.FindMenu(
MENU_CHAT) );
482 if (
GetUApi().GetInputByID(UAUIQuickbarToggle).LocalHold())
486 m_QuickbarHold =
true;
491 if (
GetUApi().GetInputByID(UAUIQuickbarToggle).LocalRelease())
495 m_Hud.ShowQuickbarPlayer(
m_Hud.IsHideQuickbarPlayer());
497 m_QuickbarHold =
false;
500 if (
GetUApi().GetInputByID(UAZeroingUp).LocalPress() ||
GetUApi().GetInputByID(UAZeroingDown).LocalPress() ||
GetUApi().GetInputByID(UAToggleWeapons).LocalPress())
502 m_Hud.ZeroingKeyPress();
507 m_ActionMenu.Refresh();
509 if (
GetUApi().GetInputByID(UANextActionCategory).LocalPress())
511 m_ActionMenu.NextActionCategory();
513 else if (
GetUApi().GetInputByID(UAPrevActionCategory).LocalPress())
515 m_ActionMenu.PrevActionCategory();
517 else if (
GetUApi().GetInputByID(UANextAction).LocalPress())
519 m_ActionMenu.NextAction();
521 else if (
GetUApi().GetInputByID(UAPrevAction).LocalPress())
523 m_ActionMenu.PrevAction();
532 if (menu == NULL && playerPB.IsPlacingLocal() && playerPB.GetHologramLocal().GetParentEntity().PlacementCanBeRotated())
534 if (
GetUApi().GetInputByID(UANextAction).LocalRelease())
536 playerPB.GetHologramLocal().SubtractProjectionRotation(15);
539 if (
GetUApi().GetInputByID(UAPrevAction).LocalRelease())
541 playerPB.GetHologramLocal().AddProjectionRotation(15);
547 if (
GetUApi().GetInputByID(UAMapToggle).LocalPress() && !m_UIManager.GetMenu())
549 if (IsMapUnfoldActionRunning(runningAction))
551 HandleMapToggleByKeyboardShortcut(player);
560 int life_state = player.GetPlayerState();
563 if (m_LifeState != life_state)
565 m_LifeState = life_state;
567 if (m_LifeState !=
EPlayerStates.ALIVE && !player.IsUnconscious())
574 if (menu && !menu.UseKeyboard() && menu.UseMouse())
577 for (i = 0; i < 5; i++)
584 for (i = 0; i < 6; i++)
590 if (!m_UIManager.IsDialogVisible())
596 if (
GetUApi().GetInputByID(UAGear).LocalPress())
598 if (
ItemManager.GetInstance().GetSelectedItem() == NULL)
603 else if (
GetUApi().GetInputByID(UAUIBack).LocalPress())
605 if (
ItemManager.GetInstance().GetSelectedItem() == NULL)
611 else if (menu == note_menu && (!IsInputExcludeActive(
"inventory") || !IsInputRestrictionActive(EInputRestrictors.INVENTORY)))
613 AddActiveInputExcludes({
"inventory"});
614 AddActiveInputRestriction(EInputRestrictors.INVENTORY);
616 else if (menu == gestures_menu && !gestures_menu.IsMenuClosing() && !IsInputExcludeActive(
"radialmenu"))
618 AddActiveInputExcludes({
"radialmenu"});
619 GetUApi().GetInputByID(UAUIGesturesOpen).Unlock();
621 else if (menu == quickbar_menu && !quickbar_menu.IsMenuClosing() && !IsInputExcludeActive(
"radialmenu"))
623 AddActiveInputExcludes({
"radialmenu"});
624 GetUApi().GetInputByID(UAUIQuickbarRadialOpen).Unlock();
628 InGameMenuXbox menu_xb = InGameMenuXbox.Cast(
GetGame().GetUIManager().GetMenu());
629 if (!
g_Game.GetUIManager().ScreenFadeVisible() && (!menu_xb || !menu_xb.IsOnlineOpen()))
631 if (
GetUApi().GetInputByID(UAUIMenu).LocalPress())
635 else if (
GetUApi().GetInputByID(UAUIBack).LocalPress())
640 else if (
GetUApi().GetInputByID(UAUIBack).LocalPress())
642 if (menu_xb && menu_xb.IsOnlineOpen())
644 menu_xb.CloseOnline();
649 else if (
GetUApi().GetInputByID(UAUIMenu).LocalPress())
651 if (IsMapUnfoldActionRunning(runningAction))
658 UpdateDebugMonitor();
662 if (!
GetGame().IsMultiplayer())
663 m_WorldData.UpdateBaseEnvTemperature( timeslice );
665 #ifdef DIAG_DEVELOPER
668 if (m_ProcessInputExcludes)
670 PerformRefreshExcludes();
671 m_ProcessInputExcludes =
false;
674 super.OnUpdate( timeslice );
677 override void OnKeyPress(
int key)
679 super.OnKeyPress(key);
683 override void OnKeyRelease(
int key)
685 super.OnKeyRelease(key);
690 super.OnEvent(eventTypeId, params);
692 Man player =
GetGame().GetPlayer();
700 m_Chat.Add(chat_params);
706 ChatInputMenu chatMenu = ChatInputMenu.Cast( GetUIManager().FindMenu(
MENU_CHAT_INPUT) );
709 chatMenu.UpdateChannel();
713 m_ChatChannelText.SetText(ChatInputMenu.GetChannelName(cc_params.param1));
714 m_ChatChannelFadeTimer.FadeIn(m_ChatChannelArea, 0.5,
true);
719 case WindowsResizeEventTypeID:
721 m_Hud.OnResizeScreen();
727 PluginDeveloper plugin_developer = PluginDeveloper.Cast(
GetPlugin(PluginDeveloper) );
728 plugin_developer.OnSetFreeCameraEvent(
PlayerBase.Cast( player ), set_free_camera_event_params.param1 );
735 if (item && GetUIManager().GetMenu() == NULL)
737 if (item.IsInherited(ItemBook))
739 BookMenu bookMenu = BookMenu.Cast( GetUIManager().EnterScriptedMenu(
MENU_BOOK, NULL) );
742 bookMenu.ReadBook(item);
749 override void SetInputSuppression(
bool state)
751 m_SuppressNextFrame = state;
754 override bool GetInputSuppression()
756 return m_SuppressNextFrame;
761 override void PlayerControlEnable(
bool bForceSupress )
763 super.PlayerControlEnable(bForceSupress);
765 if (m_ControlDisabledMode != -1)
767 switch (m_ControlDisabledMode)
771 RemoveActiveInputExcludes({
"menu"},bForceSupress);
776 RemoveActiveInputExcludes({
"inventory"},bForceSupress);
777 RemoveActiveInputRestriction(EInputRestrictors.INVENTORY);
782 RemoveActiveInputExcludes({
"loopedactions"},bForceSupress);
783 RemoveActiveInputRestriction(EInputRestrictors.MAP);
788 RemoveActiveInputExcludes({
"radialmenu"},bForceSupress);
793 RemoveActiveInputExcludes({
"radialmenu"},bForceSupress);
798 m_ControlDisabledMode = -1;
804 hic.LimitsDisableSprint(
false);
810 override void PlayerControlDisable(
int mode)
812 super.PlayerControlDisable(mode);
818 AddActiveInputExcludes({
"menu"});
823 AddActiveInputExcludes({
"inventory"});
824 AddActiveInputRestriction(EInputRestrictors.INVENTORY);
829 AddActiveInputExcludes({
"loopedactions"});
830 AddActiveInputRestriction(EInputRestrictors.MAP);
835 AddActiveInputExcludes({
"radialmenu"});
840 AddActiveInputExcludes({
"radialmenu"});
845 Debug.Log(
"Unknown controls disable mode");
850 m_ControlDisabledMode = mode;
855 ItemBase item = player.GetItemInHands();
856 if (item && item.IsWeapon())
857 player.RequestResetADSSync();
862 override void RemoveActiveInputExcludes(
array<string> excludes,
bool bForceSupress =
false)
864 super.RemoveActiveInputExcludes(excludes,bForceSupress);
866 if (excludes.Count() != 0)
868 bool changed =
false;
870 if (m_ActiveInputExcludeGroups)
872 for (
int i = 0; i < excludes.Count(); i++)
874 if (m_ActiveInputExcludeGroups.Find(excludes[i]) != -1)
876 m_ActiveInputExcludeGroups.RemoveItem(excludes[i]);
888 GetUApi().SupressNextFrame(bForceSupress);
893 override void RemoveActiveInputRestriction(
int restrictor)
900 case EInputRestrictors.INVENTORY:
902 GetUApi().GetInputByID(UAWalkRunForced).ForceEnable(
false);
905 case EInputRestrictors.MAP:
907 GetUApi().GetInputByID(UAWalkRunForced).ForceEnable(
false);
912 if (m_ActiveInputRestrictions && m_ActiveInputRestrictions.Find(restrictor) != -1)
914 m_ActiveInputRestrictions.RemoveItem(restrictor);
922 super.AddActiveInputExcludes(excludes);
924 if (excludes.Count() != 0)
926 bool changed =
false;
927 if (!m_ActiveInputExcludeGroups)
932 for (
int i = 0; i < excludes.Count(); i++)
934 if (m_ActiveInputExcludeGroups.Find(excludes[i]) == -1)
936 m_ActiveInputExcludeGroups.Insert(excludes[i]);
945 GetUApi().SupressNextFrame(
true);
952 override void AddActiveInputRestriction(
int restrictor)
959 case EInputRestrictors.INVENTORY:
961 GetUApi().GetInputByID(UAWalkRunForced).ForceEnable(
true);
965 ItemBase item = player.GetItemInHands();
966 if (item && item.IsWeapon())
967 player.RequestResetADSSync();
971 case EInputRestrictors.MAP:
973 GetUApi().GetInputByID(UAWalkRunForced).ForceEnable(
true);
978 if (!m_ActiveInputRestrictions)
982 if (m_ActiveInputRestrictions.Find(restrictor) == -1)
984 m_ActiveInputRestrictions.Insert(restrictor);
990 override void RefreshExcludes()
992 m_ProcessInputExcludes =
true;
996 protected void PerformRefreshExcludes()
998 if (m_ActiveInputExcludeGroups)
1000 for (
int i = 0; i < m_ActiveInputExcludeGroups.Count(); i++)
1002 GetUApi().ActivateExclude(m_ActiveInputExcludeGroups[i]);
1010 override void EnableAllInputs(
bool bForceSupress =
false)
1012 m_ControlDisabledMode = -1;
1014 if (m_ActiveInputRestrictions)
1016 int count = m_ActiveInputRestrictions.Count();
1017 for (
int i = 0; i < count; i++)
1019 RemoveActiveInputRestriction(m_ActiveInputRestrictions[0]);
1021 m_ActiveInputRestrictions.Clear();
1023 if (m_ActiveInputExcludeGroups)
1025 m_ActiveInputExcludeGroups.Clear();
1029 GetUApi().SupressNextFrame(bForceSupress);
1033 override bool IsControlDisabled()
1035 bool active =
false;
1036 if (m_ActiveInputExcludeGroups)
1038 active |= m_ActiveInputExcludeGroups.Count() > 0;
1040 if (m_ActiveInputRestrictions)
1042 active |= m_ActiveInputRestrictions.Count() > 0;
1049 override bool IsInputExcludeActive(
string exclude)
1051 return m_ActiveInputExcludeGroups && m_ActiveInputExcludeGroups.Find(exclude) != -1;
1055 override bool IsInputRestrictionActive(
int restriction)
1057 return m_ActiveInputRestrictions && m_ActiveInputRestrictions.Find(restriction) != -1;
1061 override int GetControlDisabledMode()
1063 return m_ControlDisabledMode;
1066 void CloseAllMenus()
1068 GetUIManager().CloseAll();
1072 void DestroyAllMenus()
1074 if( GetUIManager() )
1076 GetUIManager().HideDialog();
1077 GetUIManager().CloseAll();
1086 void MoveHudForInventory(
bool inv_open )
1088 #ifdef PLATFORM_CONSOLE
1089 IngameHud hud = IngameHud.Cast( GetHud() );
1094 hud.GetHudPanelWidget().SetPos( 0, -0.055 );
1098 hud.GetHudPanelWidget().SetPos( 0, 0 );
1104 override void ShowInventory()
1110 if( !m_InventoryMenu )
1117 GetUIManager().ShowScriptedMenu(m_InventoryMenu,
null);
1120 AddActiveInputExcludes({
"inventory"});
1121 AddActiveInputRestriction(EInputRestrictors.INVENTORY);
1125 override void HideInventory()
1127 if ( m_InventoryMenu )
1129 GetUIManager().HideScriptedMenu(m_InventoryMenu);
1130 RemoveActiveInputExcludes({
"inventory"},
false);
1131 RemoveActiveInputRestriction(EInputRestrictors.INVENTORY);
1137 void DestroyInventory()
1139 if ( m_InventoryMenu )
1141 if (!m_InventoryMenu.GetParentMenu() && GetUIManager().GetMenu() != m_InventoryMenu)
1143 m_InventoryMenu.SetParentMenu(GetUIManager().GetMenu());
1145 m_InventoryMenu.Close();
1146 m_InventoryMenu = NULL;
1150 override void ResetGUI()
1156 override void ShowChat()
1158 m_ChatChannelHideTimer.Stop();
1159 m_ChatChannelFadeTimer.Stop();
1160 m_ChatChannelArea.Show(
false);
1163 int level =
GetGame().GetVoiceLevel();
1164 UpdateVoiceLevelWidgets(level);
1166 AddActiveInputExcludes({
"menu"});
1169 override void HideChat()
1171 RemoveActiveInputExcludes({
"menu"},
true);
1174 void ShowVehicleInfo()
1177 GetHud().ShowVehicleInfo();
1180 void HideVehicleInfo()
1183 GetHud().HideVehicleInfo();
1186 override Hud GetHud()
1199 GetHudDebug().RefreshCrosshairVisibility();
1205 GetHudDebug().HideCrosshairVisibility();
1208 override bool IsPaused()
1213 override void Pause()
1220 m_PauseQueued =
true;
1222 if (
g_Game.IsClient() &&
g_Game.GetGameState() != DayZGameState.IN_GAME )
1228 if ( player && !player.IsPlayerLoaded() || IsPlayerRespawning() )
1237 if (!menu || !menu.IsVisible())
1242 AddActiveInputExcludes({
"menu"});
1243 AddActiveInputRestriction(EInputRestrictors.INVENTORY);
1245 m_PauseQueued =
false;
1254 int menu_id = menu.GetID();
1260 RemoveActiveInputExcludes({
"menu"},
true);
1261 RemoveActiveInputRestriction(EInputRestrictors.INVENTORY);
1265 override bool IsMissionGameplay()
1270 override void AbortMission()
1279 override void CreateLogoutMenu(
UIMenuPanel parent)
1284 if (!player || player.IsDamageDestroyed())
1293 m_Logout = LogoutMenu.Cast(parent.EnterScriptedMenu(
MENU_LOGOUT));
1297 m_Logout.SetLogoutTime();
1302 override void StartLogoutMenu(
int time)
1309 m_Logout.SetTime(time);
1322 override void CreateDebugMonitor()
1324 if (!m_DebugMonitor)
1327 m_DebugMonitor.Init();
1330 m_DebugMonitor.Show();
1333 override void HideDebugMonitor()
1337 m_DebugMonitor.Hide();
1341 protected void HandleMapToggleByKeyboardShortcut(Man player)
1344 if (um && !um.IsMenuOpen(
MENU_MAP))
1349 um.EnterScriptedMenu(
MENU_MAP,
null);
1350 GetGame().GetMission().AddActiveInputExcludes({
"map"});
1351 GetGame().GetMission().AddActiveInputRestriction(EInputRestrictors.MAP);
1356 protected bool IsMapUnfoldActionRunning(
ActionBase pAction)
1374 void UpdateDebugMonitor()
1376 if (!m_DebugMonitor)
return;
1384 m_DebugMonitor.SetHealth(values.GetHealth());
1385 m_DebugMonitor.SetBlood(values.GetBlood());
1386 m_DebugMonitor.SetLastDamage(values.GetLastDamage());
1387 m_DebugMonitor.SetPosition(MiscGameplayFunctions.TruncateVec(player.GetPosition(),1));
1392 void SetActionDownTime(
int time_down )
1394 m_ActionDownTime = time_down;
1397 void SetActionUpTime(
int time_up )
1399 m_ActionUpTime = time_up;
1402 int LocalPressTime()
1404 return m_ActionDownTime;
1407 int LocalReleaseTime()
1409 return m_ActionUpTime;
1412 float GetHoldActionTime()
1414 float hold_action_time = LocalReleaseTime() - LocalPressTime();
1415 return hold_action_time;
1418 void DisplayHairDebug()
1425 void ShowHairDebugValues(
bool state)
1427 #ifdef DIAG_DEVELOPER
1433 bool bState = diagmenu.m_HairHidingStateMap.Get(i);
1434 string selectionState;
1436 selectionState =
"Hidden";
1438 selectionState =
"Shown";
1439 string selectionName = diagmenu.m_HairSelectionArray.Get(i);
1441 DbgUI.BeginCleanupScope();
1442 DbgUI.Begin(
"Hair Debug", 50, 150);
1443 DbgUI.Text(
"Current Hair Selection:" + selectionName);
1444 DbgUI.Text(
"State: " + selectionState);
1447 DbgUI.EndCleanupScope();
1451 DbgUI.BeginCleanupScope();
1452 DbgUI.Begin(
"Hair Debug", 50, 50);
1454 DbgUI.EndCleanupScope();
1459 override void UpdateVoiceLevelWidgets(
int level)
1461 for (
int n = 0; n < m_VoiceLevelsWidgets.Count(); n++ )
1463 int voiceKey = m_VoiceLevelsWidgets.GetKey(n);
1464 ImageWidget voiceWidget = m_VoiceLevelsWidgets.Get(n);
1467 WidgetFadeTimer timer = m_VoiceLevelTimers.Get(n);
1471 if ( voiceKey <= level )
1473 voiceWidget.SetAlpha(1.0);
1474 voiceWidget.Show(
true);
1477 timer.FadeOut(voiceWidget, 3.0);
1480 voiceWidget.Show(
false);
1488 m_MicrophoneIcon.SetAlpha(1.0);
1489 m_MicrophoneIcon.Show(
true);
1491 m_MicFadeTimer.FadeOut(m_MicrophoneIcon, 3.0);
1497 m_MicFadeTimer.Stop();
1501 override ImageWidget GetMicrophoneIcon()
1503 return m_MicrophoneIcon;
1506 override WidgetFadeTimer GetMicWidgetFadeTimer()
1508 return m_MicFadeTimer;
1513 return m_VoiceLevelsWidgets;
1518 return m_VoiceLevelTimers;
1521 override bool IsVoNActive()
1526 override void SetVoNActive(
bool active)
1528 m_VoNActive = active;
1531 override void HideVoiceLevelWidgets()
1533 for (
int n = 0; n < m_VoiceLevelsWidgets.Count(); n++ )
1535 ImageWidget voiceWidget = m_VoiceLevelsWidgets.Get( n );
1536 voiceWidget.Show(
false);
1547 m_Note = NoteMenu.Cast(menu);
1550 override void OnPlayerRespawned(Man player)
1552 #ifdef DIAG_DEVELOPER
1554 m_HudDebug.RefreshByLocalProfile();
1563 GetGame().GetSoundScene().SetSoundVolume(
g_Game.m_volume_sound,1);
1564 GetGame().GetSoundScene().SetSpeechExVolume(
g_Game.m_volume_speechEX,1);
1565 GetGame().GetSoundScene().SetMusicVolume(
g_Game.m_volume_music,1);
1566 GetGame().GetSoundScene().SetVOIPVolume(
g_Game.m_volume_VOIP,1);
1567 GetGame().GetSoundScene().SetRadioVolume(
g_Game.m_volume_radio,1);
1570 override void SetPlayerRespawning(
bool state)
1572 m_PlayerRespawning = state;
1575 override bool IsPlayerRespawning()
1577 return m_PlayerRespawning;
1582 return m_ActiveRefresherLocations;
1585 override void SetRespawnModeClient(
int mode)
1587 m_RespawnModeClient = mode;
1590 override int GetRespawnModeClient()
1592 return m_RespawnModeClient;
1595 override GameplayEffectWidgets GetEffectWidgets()
1597 return m_EffectWidgets;
1602 if (!m_OnConnectivityChanged)
1606 return m_OnConnectivityChanged;