32 protected const int HOLD_LIMIT_TIME = 300;
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;
77 if (
g_Game.GetUIManager() &&
g_Game.GetUIManager().ScreenFadeVisible())
78 g_Game.GetUIManager().ScreenFadeOut(0);
106 m_UIManager =
GetGame().GetUIManager();
111 if (!m_HudRootWidget)
113 m_HudRootWidget =
GetGame().GetWorkspace().CreateWidgets(
"gui/layouts/day_z_hud.layout");
115 m_HudRootWidget.Show(
false);
117 m_Chat.Init(m_HudRootWidget.FindAnyWidget(
"ChatFrameWidget"));
119 m_ActionMenu.Init(m_HudRootWidget.FindAnyWidget(
"ActionsPanel"),
TextWidget.Cast(m_HudRootWidget.FindAnyWidget(
"DefaultActionWidget")));
121 m_Hud.
Init(m_HudRootWidget.FindAnyWidget(
"HudPanel"));
124 m_MicrophoneIcon =
ImageWidget.Cast(m_HudRootWidget.FindAnyWidget(
"mic"));
125 m_MicrophoneIcon.Show(
false);
128 m_VoiceLevels = m_HudRootWidget.FindAnyWidget(
"VoiceLevelsPanel");
146 m_ChatChannelArea = m_HudRootWidget.FindAnyWidget(
"ChatChannelPanel");
147 m_ChatChannelText =
TextWidget.Cast(m_HudRootWidget.FindAnyWidget(
"ChatChannelText"));
154 if (!m_HudDebug.IsInitialized())
156 m_HudDebug.Init(
GetGame().GetWorkspace().CreateWidgets(
"gui/layouts/debug/day_z_hud_debug.layout"));
169 g_Game.SetConnecting(
false);
171#ifndef FEATURE_CURSOR
176 g_Game.SetMissionState(DayZGame.MISSION_STATE_GAME);
182 if (!m_InventoryMenu)
206 super.UpdateInputDevicesAvailability();
208 g_Game.GetInput().UpdateConnectedInputDeviceList();
209 g_Game.UpdateInputDeviceDisconnectWarning();
224 m_DebugMonitor.Hide();
225#ifndef FEATURE_CURSOR
226 g_Game.GetUIManager().ShowUICursor(
false);
230 g_Game.SetMissionState(DayZGame.MISSION_STATE_FINNISH);
243 m_PauseQueued =
true;
258 UpdateDummyScheduler();
289#ifdef PLATFORM_CONSOLE
318 RadialQuickbarMenu.OpenMenu();
324 bool b1 = RadialQuickbarMenu.GetItemToAssign() !=
null;
328 RadialQuickbarMenu.CloseMenu();
333 if ((RadialQuickbarMenu.instance && RadialQuickbarMenu.GetMenuInstance().GetParentMenu() && RadialQuickbarMenu.GetMenuInstance().GetParentMenu() ==
inventory) &&
GetUApi().GetInputByID(
UAUIQuickbarRadialInventoryOpen).LocalRelease())
338 RadialQuickbarMenu.CloseMenu();
339 RadialQuickbarMenu.SetItemToAssign(
NULL);
396 GesturesMenu.OpenMenu();
407 GesturesMenu.CloseMenu();
416 m_HudRootWidget.Show(
true);
440#ifndef PLATFORM_CONSOLE
441 if (
GetUApi().GetInputByID(
UAChat).LocalPress() &&
input.IsEnabledMouseAndKeyboardEvenOnServer())
456 m_QuickbarHold =
true;
465 m_QuickbarHold =
false;
473 m_ActionMenu.Refresh();
476 m_ActionMenu.NextActionCategory();
478 m_ActionMenu.PrevActionCategory();
480 m_ActionMenu.NextAction();
482 m_ActionMenu.PrevAction();
488 if (
menu ==
NULL &&
playerPB.IsPlacingLocal() &&
playerPB.GetHologramLocal().GetParentEntity().PlacementCanBeRotated())
491 playerPB.GetHologramLocal().SubtractProjectionRotation(15);
494 playerPB.GetHologramLocal().AddProjectionRotation(15);
525 for (
i = 0;
i < 5;
i++)
532 for (
i = 0;
i < 6;
i++)
596 if (!
GetGame().IsMultiplayer())
597 m_WorldData.UpdateBaseEnvTemperature(
timeslice);
602 if (m_ProcessInputExcludes)
605 m_ProcessInputExcludes =
false;
643 m_ChatChannelText.SetText(ChatInputMenu.GetChannelName(
cc_params.param1));
644 m_ChatChannelFadeTimer.FadeIn(m_ChatChannelArea, 0.5,
true);
693 if (m_ControlDisabledMode != -1)
695 switch (m_ControlDisabledMode)
726 m_ControlDisabledMode = -1;
732 hic.LimitsDisableSprint(
false);
773 Debug.
Log(
"Unknown controls disable mode");
778 m_ControlDisabledMode =
mode;
785 player.RequestResetADSSync();
798 if (m_ActiveInputExcludeGroups)
802 if (m_ActiveInputExcludeGroups.Find(
excludes[
i]) != -1)
804 m_ActiveInputExcludeGroups.RemoveItem(
excludes[
i]);
838 if (m_ActiveInputRestrictions && m_ActiveInputRestrictions.Find(
restrictor) != -1)
839 m_ActiveInputRestrictions.RemoveItem(
restrictor);
851 if (!m_ActiveInputExcludeGroups)
856 if (m_ActiveInputExcludeGroups.Find(
excludes[
i]) == -1)
858 m_ActiveInputExcludeGroups.Insert(
excludes[
i]);
867 GetUApi().SupressNextFrame(
true);
889 player.RequestResetADSSync();
900 if (!m_ActiveInputRestrictions)
902 if (m_ActiveInputRestrictions.Find(
restrictor) == -1)
910 m_ProcessInputExcludes =
true;
916 if (m_ActiveInputExcludeGroups)
918 for (
int i = 0;
i < m_ActiveInputExcludeGroups.Count();
i++)
919 GetUApi().ActivateExclude(m_ActiveInputExcludeGroups[
i]);
928 m_ControlDisabledMode = -1;
930 if (m_ActiveInputRestrictions)
932 int count = m_ActiveInputRestrictions.Count();
935 m_ActiveInputRestrictions.Clear();
937 if (m_ActiveInputExcludeGroups)
938 m_ActiveInputExcludeGroups.Clear();
948 if (m_ActiveInputExcludeGroups)
949 active |= m_ActiveInputExcludeGroups.Count() > 0;
950 if (m_ActiveInputRestrictions)
951 active |= m_ActiveInputRestrictions.Count() > 0;
959 return m_ActiveInputExcludeGroups && m_ActiveInputExcludeGroups.Find(
exclude) != -1;
965 return m_ActiveInputRestrictions && m_ActiveInputRestrictions.Find(
restriction) != -1;
996#ifdef PLATFORM_CONSOLE
997 IngameHud
hud = IngameHud.Cast(
GetHud());
1001 hud.GetHudPanelWidget().SetPos(0, -0.055);
1003 hud.GetHudPanelWidget().SetPos(0, 0);
1014 if (!m_InventoryMenu)
1029 if (m_InventoryMenu)
1041 if (m_InventoryMenu)
1043 if (!m_InventoryMenu.GetParentMenu() && GetUIManager().GetMenu() != m_InventoryMenu)
1045 m_InventoryMenu.SetParentMenu(
GetUIManager().GetMenu());
1047 m_InventoryMenu.Close();
1048 m_InventoryMenu =
NULL;
1060 m_ChatChannelHideTimer.Stop();
1061 m_ChatChannelFadeTimer.Stop();
1062 m_ChatChannelArea.Show(
false);
1079 GetHud().ShowVehicleInfo();
1085 GetHud().HideVehicleInfo();
1120 m_PauseQueued =
true;
1126 if (
player && !
player.IsPlayerLoaded() || IsPlayerRespawning())
1139 m_PauseQueued =
false;
1188 m_Logout.SetLogoutTime();
1199 m_Logout.SetTime(
time);
1214 if (!m_DebugMonitor)
1217 m_DebugMonitor.Init();
1220 m_DebugMonitor.Show();
1226 m_DebugMonitor.Hide();
1238 GetGame().GetMission().AddActiveInputExcludes({
"map"});
1264 if (!m_DebugMonitor)
return;
1272 m_DebugMonitor.SetHealth(
values.GetHealth());
1273 m_DebugMonitor.SetBlood(
values.GetBlood());
1274 m_DebugMonitor.SetLastDamage(
values.GetLastDamage());
1315#ifdef DIAG_DEVELOPER
1349 for (
int n = 0;
n < m_VoiceLevelsWidgets.Count();
n++)
1351 int voiceKey = m_VoiceLevelsWidgets.GetKey(
n);
1355 WidgetFadeTimer
timer = m_VoiceLevelTimers.Get(
n);
1376 m_MicrophoneIcon.SetAlpha(1.0);
1377 m_MicrophoneIcon.Show(
true);
1379 m_MicFadeTimer.FadeOut(m_MicrophoneIcon, 3.0);
1385 m_MicFadeTimer.Stop();
1421 for (
int n = 0;
n < m_VoiceLevelsWidgets.Count();
n++)
1435 m_Note = NoteMenu.Cast(
menu);
1440#ifdef DIAG_DEVELOPER
1442 m_HudDebug.RefreshByLocalProfile();
1449 GetGame().GetSoundScene().SetSoundVolume(
g_Game.m_volume_sound, 1);
1450 GetGame().GetSoundScene().SetSpeechExVolume(
g_Game.m_volume_speechEX, 1);
1451 GetGame().GetSoundScene().SetMusicVolume(
g_Game.m_volume_music, 1);
1452 GetGame().GetSoundScene().SetVOIPVolume(
g_Game.m_volume_VOIP, 1);
1453 GetGame().GetSoundScene().SetRadioVolume(
g_Game.m_volume_radio, 1);
1458 m_PlayerRespawning =
state;
1468 return m_ActiveRefresherLocations;
1473 m_RespawnModeClient =
mode;
1488 if (!m_OnConnectivityChanged)
ActionUnfoldMapCB ActionBaseCB ActionUnfoldMap()
int GetID()
Get the ID registered in SEffectManager.
PluginBase GetPlugin(typename plugin_type)
static bool GetUse3DMap()
static bool GetMapIgnoreMapOwnership()
static void Log(string message=LOG_DEFAULT, string plugin=LOG_DEFAULT, string author=LOG_DEFAULT, string label=LOG_DEFAULT, string entity=LOG_DEFAULT)
Prints debug message with normal prio.
void ShowQuickbarPlayer(bool show)
void ShowHudUI(bool show)
void ShowHudPlayer(bool show)
bool IsHideQuickbarPlayer()
void Init(Widget hud_panel_widget)
static ItemManager GetInstance()
static bool IsLogsEnable()
override void EnableAllInputs(bool bForceSupress=false)
Removes all active input excludes and restrictions.
override void CreateDebugMonitor()
override void PlayerControlEnable(bool bForceSupress)
Deprecated; removes last input exclude and associated controls restrictions.
ref array< int > m_ActiveInputRestrictions
float GetHoldActionTime()
override UIScriptedMenu GetNoteMenu()
void SendMuteListToServer(map< string, bool > mute_list)
override void AddActiveInputExcludes(array< string > excludes)
Adds one or more exclude groups to disable and refreshes excludes.
int m_ControlDisabledMode
ref ActionMenu m_ActionMenu
override void OnUpdate(float timeslice)
override void RemoveActiveInputExcludes(array< string > excludes, bool bForceSupress=false)
Removes one or more exclude groups and refreshes excludes.
void SetActionUpTime(int time_up)
override map< int, ref WidgetFadeTimer > GetVoiceLevelTimers()
override void OnPlayerRespawned(Man player)
override void ShowInventory()
override void PlayerControlDisable(int mode)
Deprecated; simple input restrictions.
override bool IsInputExcludeActive(string exclude)
Returns true if the particular input exclude group had been activated via script and is active.
override void StartLogoutMenu(int time)
ImageWidget m_MicrophoneIcon
override bool IsControlDisabled()
returns if ANY exclude groups, restriction (or deprecated disable, if applicable) is active
override map< int, ImageWidget > GetVoiceLevelWidgets()
override ImageWidget GetMicrophoneIcon()
ref map< int, ref WidgetFadeTimer > m_VoiceLevelTimers
override void SetNoteMenu(UIScriptedMenu menu)
void TickScheduler(float timeslice)
override void HideDebugMonitor()
override void OnKeyRelease(int key)
void HandleMapToggleByKeyboardShortcut(Man player)
override void HideCrosshairVisibility()
override void RefreshCrosshairVisibility()
ref ScriptInvoker m_OnConnectivityChanged
override bool IsInputRestrictionActive(int restriction)
Returns true if the particular 'restriction' (those govern special behaviour outside regular input ex...
override void SetVoNActive(bool active)
ref DebugMonitor m_DebugMonitor
override bool IsMissionGameplay()
ref map< int, ImageWidget > m_VoiceLevelsWidgets
override void OnEvent(EventType eventTypeId, Param params)
void ShowHairDebugValues(bool state)
ref WidgetFadeTimer m_ChatChannelFadeTimer
override int GetControlDisabledMode()
(mostly)DEPRECATED; only set on the old 'PlayerControlDisable' method
override bool IsPlayerRespawning()
override void AbortMission()
ref WidgetFadeTimer m_MicFadeTimer
void SetActionDownTime(int time_down)
override void HideVoiceLevelWidgets()
override bool IsVoNActive()
ref Timer m_ChatChannelHideTimer
InventoryMenu GetInventory()
override void OnKeyPress(int key)
TextWidget m_ChatChannelText
override void RefreshExcludes()
queues refresh of input excludes
ScriptInvoker GetConnectivityInvoker()
ref array< string > m_ActiveInputExcludeGroups
override int GetRespawnModeClient()
override void AddActiveInputRestriction(int restrictor)
Adds one input restriction (specific behaviour oudside regular excludes, defined below)
override void HideInventory()
override void CreateLogoutMenu(UIMenuPanel parent)
override GameplayEffectWidgets GetEffectWidgets()
void MoveHudForInventory(bool inv_open)
void UpdateDebugMonitor()
override void OnMissionFinish()
bool m_ProcessInputExcludes
override void SetPlayerRespawning(bool state)
void PerformRefreshExcludes()
applies queued excludes (0 == clear excludes)
ref GameplayEffectWidgets m_EffectWidgets
override void RemoveActiveInputRestriction(int restrictor)
Removes one restriction (specific behaviour oudside regular excludes, defined below)
override void OnMissionStart()
bool IsMapUnfoldActionRunning(ActionBase pAction)
ref Timer m_ToggleHudTimer
override void SetRespawnModeClient(int mode)
override WidgetFadeTimer GetMicWidgetFadeTimer()
override void UpdateVoiceLevelWidgets(int level)
override void UpdateInputDevicesAvailability()
ref InventoryMenu m_InventoryMenu
override void OnItemUsed(InventoryItem item, Man owner)
override array< vector > GetActiveRefresherLocations()
Static component of PPE manager, used to hold the instance.
static PPEManager GetPPEManager()
Returns the manager instance singleton.
Deprecated; 'PPEManager' used instead.
Base Param Class with no parameters. Used as general purpose parameter overloaded with Param1 to Para...
Manager class for managing Effect (EffectParticle, EffectSound)
static ref ScriptInvoker Event_OnFrameUpdate
Static invoker for the SEffectManager.Event_OnFrameUpdate called form MissionGameplay....
ScriptInvoker Class provide list of callbacks usage:
static void RegisterEvents()
proto native UIScriptedMenu GetMenu()
Returns most-top open menu.
proto native bool IsDialogVisible()
proto native void ScreenFadeOut(float duration)
bool CloseMenu(int id)
Close menu with specific ID (see MenuID)
proto native UIScriptedMenu EnterScriptedMenu(int id, UIMenuPanel parent)
Create & open menu with specific id (see MenuID) and set its parent.
void ShowUICursor(bool visible)
UIScriptedMenu FindMenu(int id)
Returns menu with specific ID if it is open (see MenuID)
bool CloseAll()
Close all opened menus.
proto native void HideDialog()
proto native UIScriptedMenu ShowScriptedMenu(UIScriptedMenu menu, UIMenuPanel parent)
proto native void HideScriptedMenu(UIScriptedMenu menu)
static void SpawnAllTriggerCarriers()
Manager class which handles Voice-over-network functionality while player is connected to a server.
static VONManagerBase GetInstance()
Main way to access VONManager functionality from script.
static VicinityItemManager GetInstance()
const EventType SetFreeCameraEventTypeID
params: SetFreeCameraEventParams
const EventType ChatChannelEventTypeID
params: ChatChannelEventParams
proto native CGame GetGame()
const EventType ChatMessageEventTypeID
params: ChatMessageEventParams
static proto native void End()
static proto native void Begin(string windowTitle, float x=0, float y=0)
static proto native void Text(string label)
static proto void BeginCleanupScope()
static proto native void EndCleanupScope()
const int INPUT_EXCLUDE_MOUSE_RADIAL
const int INPUT_EXCLUDE_ALL
const int INPUT_EXCLUDE_INVENTORY
const int INPUT_EXCLUDE_MAP
const int INPUT_EXCLUDE_MOUSE_ALL
proto native bool IsCLIParam(string param)
Returns if command line argument is present.