19 proto native
Object GetSource();
20 proto native
vector GetPos();
21 proto native
vector GetInVelocity();
22 proto native
string GetAmmoType();
23 proto native
float GetProjectileDamage();
33 proto native
Object GetHitObj();
34 proto native
vector GetHitObjPos();
35 proto native
vector GetHitObjRot();
36 proto native
int GetComponentIndex();
39class TerrainCollisionInfo: CollisionInfoBase
48 static void RegisterSoundSet(
string sound_set)
50 m_Mappings.Set(sound_set.Hash(), sound_set);
53 static string GetSoundSetByHash(
int hash)
57 m_Mappings.Find(hash,sound_set);
69 override void Update(
float timeslice)
73 m_HintTimeAccu += timeslice;
81 if (
GetUApi().GetInputByID(UAUIBack).LocalPress())
89 g_Game.SetGameState(DayZGameState.MAIN_MENU);
90 g_Game.SetLoadState(DayZLoadState.MAIN_MENU_START);
119 g_Game.SetKeyboardHandle(
this);
124 g_Game.SetKeyboardHandle(NULL);
129 layoutRoot =
GetGame().GetWorkspace().CreateWidgets(
"gui/layouts/dialog_queue_position.layout");
130 m_HintPanel =
new UiHintPanelLoading(layoutRoot.FindAnyWidget(
"hint_frame0"));
131 m_txtPosition = TextWidget.Cast(layoutRoot.FindAnyWidget(
"txtPosition"));
132 m_txtNote = TextWidget.Cast(layoutRoot.FindAnyWidget(
"txtNote"));
133 m_btnLeave = ButtonWidget.Cast(layoutRoot.FindAnyWidget(
"btnLeave"));
135 layoutRoot.FindAnyWidget(
"notification_root").Show(
false);
137 #ifdef PLATFORM_CONSOLE
138 layoutRoot.FindAnyWidget(
"toolbar_bg").Show(
true);
142 #ifdef BUILD_EXPERIMENTAL
143 layoutRoot.FindAnyWidget(
"notification_root").Show(
true);
151 override bool OnClick(Widget w,
int x,
int y,
int button)
153 super.OnClick(w,
x,
y, button);
166 layoutRoot.Show(
true);
173 layoutRoot.Show(
false);
188 return timeAccu >=
GameConstants.LOADING_SCREEN_HINT_INTERVAL;
196 void LoginQueueStatic()
216 g_Game.SetKeyboardHandle(
this);
225 g_Game.SetKeyboardHandle(null);
229 override Widget
Init()
231 layoutRoot =
GetGame().GetWorkspace().CreateWidgets(
"gui/layouts/dialog_login_time.layout");
233 m_txtDescription = TextWidget.Cast(layoutRoot.FindAnyWidget(
"txtDescription"));
234 m_txtLabel = TextWidget.Cast(layoutRoot.FindAnyWidget(
"txtLabel"));
235 m_btnLeave = ButtonWidget.Cast(layoutRoot.FindAnyWidget(
"btnLeave"));
236 m_txtDescription.Show(
true);
237 layoutRoot.FindAnyWidget(
"notification_root").Show(
false);
239 #ifdef PLATFORM_CONSOLE
240 layoutRoot.FindAnyWidget(
"toolbar_bg").Show(
true);
244 #ifdef BUILD_EXPERIMENTAL
245 layoutRoot.FindAnyWidget(
"notification_root").Show(
true);
253 override bool OnClick(Widget w,
int x,
int y,
int button)
255 super.OnClick(w,
x,
y, button);
268 layoutRoot.Show(
true);
269 m_HintPanel =
new UiHintPanelLoading(layoutRoot.FindAnyWidget(
"hint_frame0"));
276 layoutRoot.Show(
false);
283 TimeConversions.ConvertSecondsToFullTime(time, m_FullTime);
285 text =
"#menu_loading_in_";
287 text =
"#dayz_game_spawning_in_";
289 if (m_FullTime.m_Days > 0)
291 else if (m_FullTime.m_Hours > 0)
293 else if (m_FullTime.m_Minutes > 0)
298 text = Widget.TranslateString(text);
299 text =
string.Format(text, m_FullTime.m_Seconds, m_FullTime.m_Minutes, m_FullTime.m_Hours, m_FullTime.m_Days);
300 m_txtLabel.SetText(text);
302 if (m_IsRespawn && time <= 1)
308 m_txtDescription.SetText(status);
311 void SetRespawn(
bool value)
323 return timeAccu >=
GameConstants.LOADING_SCREEN_HINT_INTERVAL && m_FullTime.m_Seconds >=
GameConstants.LOADING_SCREEN_HINT_INTERVAL_MIN;
330 void LoginTimeStatic()
337 void ~LoginTimeStatic()
346 private ref Widget m_WidgetRoot;
347 private TextWidget m_TextWidgetTitle;
348 private float m_duration;
352 m_WidgetRoot = game.GetWorkspace().CreateWidgets(
"gui/layouts/day_z_connection_lost.layout");
363 if (
g_Game.GetUIManager().IsDialogVisible())
365 g_Game.GetUIManager().HideDialog();
381 void SetText(
string text)
391 void SetDuration(
float duration)
419 void RegisterProfileOption(
EDayZProfilesOptions option,
string profileOptionName,
bool def =
true)
421 if (!m_DayZProfilesOptionsBool.Contains(option))
427 SetProfileOptionBool(option, profileVal);
431 void RegisterProfileOptionBool(
EDayZProfilesOptions option,
string profileOptionName,
bool defaultValue =
true)
433 RegisterProfileOption(option, profileOptionName, defaultValue);
436 void RegisterProfileOptionInt(
EDayZProfilesOptions option,
string profileOptionName,
int defaultValue = 0)
438 if (!m_DayZProfilesOptionsInt.Contains(option))
442 GetGame().GetProfileString(profileOptionName, outValue);
443 int value = outValue.ToInt();
445 m_DayZProfilesOptionsInt.Set(option,
new DayZProfilesOptionInt(profileOptionName, value, defaultValue));
446 SetProfileOptionInt(option, value);
450 void RegisterProfileOptionFloat(
EDayZProfilesOptions option,
string profileOptionName,
float defaultValue = 0.0)
452 if (!m_DayZProfilesOptionsFloat.Contains(option))
456 GetGame().GetProfileString(profileOptionName, outValue);
457 float value = outValue.ToFloat();
460 SetProfileOptionFloat(option, value);
464 void ResetOptionsBool()
466 if (!m_DayZProfilesOptionsBool)
474 SetProfileOptionBool(e_opt, profileVal);
483 void ResetOptionsInt()
485 if (!m_DayZProfilesOptionsInt)
493 GetGame().GetProfileString(r_opt.param1, outValue);
494 int value = outValue.ToInt();
495 SetProfileOptionInt(e_opt, value);
499 void ResetOptionsFloat()
501 if (!m_DayZProfilesOptionsFloat)
509 GetGame().GetProfileString(r_opt.param1, outValue);
510 float value = outValue.ToFloat();
511 SetProfileOptionFloat(e_opt, value);
517 if (m_DayZProfilesOptionsBool && m_DayZProfilesOptionsBool.Contains(option))
522 GetGame().SetProfileString(po.param1, value.ToString());
525 m_OnBoolOptionChanged.Invoke(po.param1, value);
531 SetProfileOption(option, value);
536 if (m_DayZProfilesOptionsInt && m_DayZProfilesOptionsInt.Contains(option))
541 GetGame().SetProfileString(po.param1, value.ToString());
544 m_OnIntOptionChanged.Invoke(option, value);
550 if (m_DayZProfilesOptionsFloat && m_DayZProfilesOptionsFloat.Contains(option))
555 GetGame().SetProfileString(po.param1, value.ToString());
558 m_OnFloatOptionChanged.Invoke(po.param1, value);
564 if (m_DayZProfilesOptionsBool && m_DayZProfilesOptionsBool.Contains(option))
575 return GetProfileOption(option);
580 if (m_DayZProfilesOptionsInt && m_DayZProfilesOptionsInt.Contains(option))
591 if (m_DayZProfilesOptionsFloat && m_DayZProfilesOptionsFloat.Contains(option))
602 return GetProfileOptionDefaultBool(option);
607 if (m_DayZProfilesOptionsBool && m_DayZProfilesOptionsBool.Contains(option))
619 if (m_DayZProfilesOptionsInt && m_DayZProfilesOptionsInt.Contains(option))
631 if (m_DayZProfilesOptionsFloat && m_DayZProfilesOptionsFloat.Contains(option))
643 if (m_DayZProfilesOptions)
644 return m_DayZProfilesOptions;
652 private DayZGame m_Game;
683 MISSION_CONTROLLER_SELECT
711 m_WidgetRoot = game.GetLoadingWorkspace().CreateWidgets(
"gui/layouts/loading.layout");
730 m_WidgetRoot.FindAnyWidget(
"notification_root").Show(
false);
732 #ifdef PLATFORM_CONSOLE
734 #ifdef BUILD_EXPERIMENTAL
735 Widget expNotification =
m_WidgetRoot.FindAnyWidget(
"notification_root");
738 expNotification.Show(
true);
752 game.GetBacklit().LoadingAnim();
813 void OnUpdate(
float timeslice)
839 if (
m_DayZGame.GetUIManager().IsDialogVisible())
844 if (
m_DayZGame.GetMissionState() == DayZGame.MISSION_STATE_MAINMENU)
893 const int MISSION_STATE_MAINMENU = 0;
894 const int MISSION_STATE_GAME = 1;
895 const int MISSION_STATE_FINNISH = 2;
900 private EConnectivityStatLevel m_ConnectivityStatsStates[STATS_COUNT];
902 private int m_MissionState;
908 protected bool m_FirstConnect =
true;
914 private int m_LoginTime;
921 private ref DragQueue m_dragQueue;
924 private bool m_early_access_dialog_accepted;
927 private string m_MissionPath;
928 private string m_MissionFolderPath;
929 private bool m_IsCtrlHolding;
930 private bool m_IsWinHolding;
931 private bool m_IsLeftAltHolding;
932 private bool m_IsRightAltHolding;
934 private bool m_IsWorldWetTempUpdateEnabled =
true;
935 private bool m_IsFoodDecayEnabled =
true;
936 private float m_FoodDecayModifier;
938 static bool m_ReportModded;
939 private bool m_IsStressTest;
940 private bool m_AimLoggingEnabled;
941 int m_OriginalCharactersCount;
942 private string m_PlayerName;
943 private bool m_IsNewCharacter;
944 private bool m_IsConnecting;
945 private bool m_ConnectFromJoin;
946 private bool m_ShouldShowControllerDisconnect;
947 private bool m_CursorDesiredVisibilityScript =
true;
948 private int m_PreviousGamepad;
949 private float m_UserFOV;
951 private float m_DeltaTime;
953 float m_volume_sound;
954 float m_volume_speechEX;
955 float m_volume_music;
957 float m_volume_radio;
959 float m_PreviousEVValue;
962 #ifdef DIAG_DEVELOPER
973 private ref
array<int> m_ConnectedInputDeviceList;
980 private const int MIN_ARTY_SOUND_RANGE = 300;
985 static bool m_IsPreviewSpawn;
987 #ifdef DIAG_DEVELOPER
988 ref CameraToolsMenuServer m_CameraToolsMenuServer;
996#ifdef PLATFORM_CONSOLE
1001 m_keyboard_handler = null;
1004 m_early_access_dialog_accepted =
true;
1016 m_dragQueue =
new DragQueue;
1021 if (CommandlineGetParam(
"stresstest", tmp))
1023 m_IsStressTest =
true;
1026 if (CommandlineGetParam(
"doAimLogs", tmp))
1028 m_AimLoggingEnabled =
true;
1033 m_Backlit.OnInit(
this);
1035 m_ReportModded = GetModToBeReported();
1038 if (m_loading == null)
1045 m_loading.ShowEx(
this);
1063 string path =
"cfgVehicles";
1064 string child_name =
"";
1065 int count = ConfigGetChildrenCount(
path);
1067 for (
int p = 0; p < count; ++p)
1069 ConfigGetChildName(
path, p, child_name);
1071 if (ConfigGetInt(
path +
" " + child_name +
" scope") == 2 &&
IsKindOf(child_name,
"SurvivorBase"))
1072 m_CharClassNames.Insert(child_name);
1075 m_IsConnecting =
false;
1076 m_ConnectFromJoin =
false;
1080 private void ~DayZGame()
1088 Print(
"~DayZGame()");
1097 GetInput().UpdateConnectedInputDeviceList();
1101 m_volume_sound = GetSoundScene().GetSoundVolume();
1102 m_volume_speechEX = GetSoundScene().GetSpeechExVolume();
1103 m_volume_music = GetSoundScene().GetMusicVolume();
1104 m_volume_VOIP = GetSoundScene().GetVOIPVolume();
1105 m_volume_radio = GetSoundScene().GetRadioVolume();
1116 m_IsWorldWetTempUpdateEnabled = (GetCEApi().GetCEGlobalInt(
"WorldWetTempUpdate") == 1);
1118 m_FoodDecayModifier = GetCEApi().GetCEGlobalFloat(
"FoodDecay");
1121 if (m_FoodDecayModifier ==
float.
MIN)
1123 m_FoodDecayModifier = GetCEApi().GetCEGlobalInt(
"FoodDecay");
1132 void RegisterProfilesOptions()
1153 void ResetProfileOptions()
1155 m_DayZProfileOptions.ResetOptionsBool();
1156 m_DayZProfileOptions.ResetOptionsInt();
1157 m_DayZProfileOptions.ResetOptionsFloat();
1161 void SetMissionPath(
string path)
1163 m_MissionPath =
path;
1168 while (pos_cur != -1)
1171 pos_cur =
path.IndexOfFrom(pos_cur + 1 ,
"\\");
1174 m_MissionFolderPath =
path.Substring(0, pos_end);
1177 string GetMissionPath()
1179 return m_MissionPath;
1182 string GetMissionFolderPath()
1184 return m_MissionFolderPath;
1189 return m_callQueue[call_category];
1194 return m_updateQueue[call_category];
1197 override ScriptInvoker GetPostUpdateQueue(
int call_category)
1199 return m_postUpdateQueue[call_category];
1204 if (!m_YieldDataInitInvoker)
1207 return m_YieldDataInitInvoker;
1210 override TimerQueue GetTimerQueue(
int call_category)
1215 override DragQueue GetDragQueue()
1221 void OnGameplayDataHandlerLoad()
1228 int GetMissionState()
1230 return m_MissionState;
1234 void SetMissionState(
int state)
1236 m_MissionState = state;
1242 return m_DayZProfileOptions.GetProfileOption(option);
1247 return GetProfileOption(option);
1252 return m_DayZProfileOptions.GetProfileOptionInt(option);
1257 return m_DayZProfileOptions.GetProfileOptionFloat(option);
1262 return m_DayZProfileOptions.GetProfileOptionDefaultBool(option);
1267 return GetProfileOptionDefault(option);
1272 return m_DayZProfileOptions.GetProfileOptionDefaultInt(option);
1277 return m_DayZProfileOptions.GetProfileOptionDefaultFloat(option);
1282 m_DayZProfileOptions.SetProfileOptionBool(option, value);
1287 SetProfileOption(option, value);
1292 m_DayZProfileOptions.SetProfileOptionInt(option, value);
1297 m_DayZProfileOptions.SetProfileOptionFloat(option, value);
1302 return m_DayZProfileOptions.GetProfileOptionMap();
1307 return m_IsStressTest;
1310 bool IsAimLogEnabled()
1312 return m_AimLoggingEnabled;
1315 void SetGameState(DayZGameState state)
1317 m_GameState = state;
1320 DayZGameState GetGameState()
1325 void SetLoadState(DayZLoadState state)
1327 m_LoadState = state;
1330 DayZLoadState GetLoadState()
1335 static bool ReportModded()
1337 return m_ReportModded;
1346 override bool IsInventoryOpen()
1360 if (!m_early_access_dialog_accepted)
1363 m_early_access_dialog_accepted =
true;
1375 return mission.CreateScriptedMenu(
id);
1382 void ReloadMission()
1384 #ifdef ENABLE_LOGGING
1385 Print(
"Reloading mission module!");
1391 void CancelLoginQueue()
1395 if (m_LoginQueue.IsStatic())
1397 m_LoginQueue.Hide();
1398 delete m_LoginQueue;
1402 m_LoginQueue.Close();
1407 void CancelLoginTimeCountdown()
1411 if (m_LoginTimeScreen)
1413 if (m_LoginTimeScreen.IsStatic())
1415 m_LoginTimeScreen.Hide();
1416 delete m_LoginTimeScreen;
1420 m_LoginTimeScreen.Close();
1425 private void ClearConnectivityStates()
1427 for (
int i = 0; i < STATS_COUNT; i++)
1428 m_ConnectivityStatsStates[i] = 0;
1439 switch (eventTypeId)
1452 ClearConnectivityStates();
1454 m_FirstConnect =
true;
1461 CancelLoginTimeCountdown();
1463 SetGameState(DayZGameState.MAIN_MENU);
1464 m_FirstConnect =
true;
1465 #ifdef PLATFORM_CONSOLE
1470 if (GetGameState() == DayZGameState.IN_GAME)
1472 SetLoadState(DayZLoadState.MAIN_MENU_START);
1475 m_Notifications.ClearVoiceNotifications();
1480 discData.m_CharacterId =
g_Game.GetDatabaseID();
1481 discData.m_Reason =
"quit";
1492 if (GetGameState() == DayZGameState.CONNECTING)
1494 SetGameState(DayZGameState.MAIN_MENU);
1504 SetGameState(DayZGameState.IN_GAME);
1508 spawnData.m_CharacterId =
g_Game.GetDatabaseID();
1509 spawnData.m_Lifetime = 0;
1510 spawnData.m_Position =
vector.Zero;
1513 spawnData.m_Position =
GetPlayer().GetPosition();
1515 spawnData.m_DaytimeHour = 0;
1516 spawnData.m_Population = 0;
1519 #ifdef PLATFORM_CONSOLE
1520 m_Notifications.ClearVoiceNotifications();
1525 m_FirstConnect =
false;
1526 if (GetHostAddress(address, port))
1531 #ifdef PLATFORM_CONSOLE
1532 #ifndef PLATFORM_WINDOWS
1549 if (
Class.CastTo(conLost_params, params))
1551 int duration = conLost_params.param1;
1569 if (
Class.CastTo(chat_params, params))
1578 if (
Class.CastTo(prog_params, params))
1585 if (
Class.CastTo(loginTimeParams, params))
1594 if (
Class.CastTo(respawnParams, params))
1603 if (
Class.CastTo(preloadParams, params))
1612 if (
Class.CastTo(logoutParams, params))
1614 GetCallQueue(
CALL_CATEGORY_GUI).Call(GetMission().StartLogoutMenu, logoutParams.param1);
1626 Class.CastTo(loginStatusParams, params);
1628 string msg1 = loginStatusParams.param1;
1629 string msg2 = loginStatusParams.param2;
1633 if (m_LoginTimeScreen)
1637 if (msg2.Length() > 0)
1638 finalMsg +=
"\n" + msg2;
1640 m_LoginTimeScreen.SetStatus(finalMsg);
1645 finalMsg = msg1 +
" " + msg2;
1646 m_loading.SetStatus(finalMsg);
1652 g_Game.SetGameState(DayZGameState.CONNECTING);
1658 g_Game.SetGameState(DayZGameState.MAIN_MENU);
1660 if (m_ConnectFromJoin)
1662 m_ConnectFromJoin =
false;
1670 if (
Class.CastTo(dlcParams, params))
1672 Print(
"### DLC Ownership failed !!! Map: " + dlcParams.param1);
1679 if (
Class.CastTo(connectivityStatsParams, params))
1683 int pingAvg = playerIdentity.GetPingAvg();
1684 if (pingAvg < GetWorld().GetPingWarningThreshold())
1688 else if (pingAvg < GetWorld().GetPingCriticalThreshold())
1702 if (
Class.CastTo(serverFpsStatsParams, params))
1704 #ifdef DIAG_DEVELOPER
1705 m_ServerFpsStatsParams = serverFpsStatsParams;
1707 float fps = serverFpsStatsParams.param1;
1708 if (fps > GetWorld().GetServerFpsWarningThreshold())
1712 else if (fps > GetWorld().GetServerFpsCriticalThreshold())
1725 VONManager.GetInstance().OnEvent(eventTypeId, params);
1730 mission.OnEvent(eventTypeId, params);
1735 emh.OnEvent(eventTypeId, params);
1740 if (level != m_ConnectivityStatsStates[type])
1744 m_ConnectivityStatsStates[type] = level;
1757 hud.SetConnectivityStatIcon(type, newLevel);
1761 #ifdef DIAG_DEVELOPER
1762 private void DrawPerformanceStats(
float pingAct,
float pingAvg,
float throttleInput,
float throttleOutput)
1764 DbgUI.Begin(
"Performance Stats", 720, 10);
1765 DbgUI.Text(
"pingAct:" + pingAct );
1767 if ( pingAvg >= GetWorld().GetPingCriticalThreshold())
1769 else if ( pingAvg >= GetWorld().GetPingWarningThreshold())
1772 DbgUI.ColoredText(color,
"pingAvg:" + pingAvg);
1773 DbgUI.Text(
"Ping Warning Threshold:" + GetWorld().GetPingWarningThreshold());
1774 DbgUI.Text(
"Ping Critical Threshold:" + GetWorld().GetPingCriticalThreshold());
1775 DbgUI.PlotLive(
"pingAvg history:", 300, 125, pingAvg, 100, 100 );
1776 DbgUI.Text(
"Server Fps Warning Threshold:" + GetWorld().GetServerFpsWarningThreshold());
1777 DbgUI.Text(
"Server Fps Critical Threshold:" + GetWorld().GetServerFpsCriticalThreshold());
1778 if (m_ServerFpsStatsParams)
1781 if ( m_ServerFpsStatsParams.param1 <= GetWorld().GetServerFpsCriticalThreshold())
1783 else if ( m_ServerFpsStatsParams.param1 <= GetWorld().GetServerFpsWarningThreshold())
1786 DbgUI.ColoredText(color,
"serverFPS:" + m_ServerFpsStatsParams.param1.ToString() );
1787 DbgUI.PlotLive(
"serverFPS history:", 300, 125, m_ServerFpsStatsParams.param1, 100, 100 );
1790 DbgUI.ColoredText(
COLOR_WHITE,
"serverFrameTime:" + m_ServerFpsStatsParams.param2.ToString() );
1791 DbgUI.PlotLive(
"serverFrameTime history:", 300, 75, m_ServerFpsStatsParams.param2, 100, 100 );
1794 if (m_ServerFpsStatsParams.param3 > 0)
1797 DbgUI.ColoredText(color,
"physStepsSkippedServer:" + m_ServerFpsStatsParams.param3.ToString() );
1798 DbgUI.PlotLive(
"physStepsSkippedServer history:", 300, 75, m_ServerFpsStatsParams.param3, 100, 100 );
1801 if (m_ServerFpsStatsParams.param4 > 0)
1803 DbgUI.ColoredText(color,
"physStepsSkippedClient:" + m_ServerFpsStatsParams.param4.ToString() );
1804 DbgUI.PlotLive(
"physStepsSkippedClient history:", 300, 75, m_ServerFpsStatsParams.param4, 100, 100 );
1807 DbgUI.Text(
"throttleInput:" + throttleInput);
1808 DbgUI.PlotLive(
"throttleInput history:", 300, 75, throttleInput, 100, 50 );
1809 DbgUI.Text(
"throttleOutput:" + throttleOutput);
1810 DbgUI.PlotLive(
"throttleOutput history:", 300, 75, throttleOutput, 100, 50 );
1817 m_Notifications.AddVoiceNotification(vonStartParams.param2, vonStartParams.param1);
1822 m_Notifications.RemoveVoiceNotification(vonStopParams.param2);
1828 int pos = GetUIManager().GetLoginQueuePosition();
1831 if (!m_LoginQueue && pos > 0)
1833 GetUIManager().CloseAll();
1842 m_LoginQueue =
new LoginQueueStatic();
1843 GetUIManager().ShowScriptedMenu(m_LoginQueue, null);
1848 m_LoginQueue.SetPosition(pos);
1851 LoginQueueStatic loginQueue;
1854 loginQueue.Update(timeslice);
1868 m_LoginTime = loginTime;
1871 if (m_LoginTime > 0)
1873 if (!m_LoginTimeScreen)
1875 GetUIManager().CloseAll();
1884 m_LoginTimeScreen =
new LoginTimeStatic();
1885 GetUIManager().ShowScriptedMenu(m_LoginTimeScreen, null);
1889 m_LoginTimeScreen.SetTime(m_LoginTime);
1890 m_LoginTimeScreen.Show();
1900 if (m_LoginTime > 0)
1902 if (m_LoginTimeScreen)
1903 m_LoginTimeScreen.SetTime(m_LoginTime);
1910 CancelLoginTimeCountdown();
1921 if (!m_LoginTimeScreen)
1923 GetUIManager().CloseAll();
1929 m_LoginTimeScreen.SetRespawn(
true);
1930 m_LoginTimeScreen.SetTime(m_LoginTime);
1931 m_LoginTimeScreen.Show();
1939 PPERequesterBank.GetRequester(PPERequester_DeathDarkening).Start(
new Param1<float>(1.0));
1946 if (m_LoginTimeScreen && !m_LoginTimeScreen.IsRespawn())
1947 CancelLoginTimeCountdown();
1961 StoreLoginData(ctx.GetWriteContext());
1986 if (duration < 0 && GetGameState() == DayZGameState.IN_GAME)
2001 switch (progressState)
2007 GetUIManager().ScreenFadeOut(0);
2010 m_loading.SetTitle(title);
2011 if (m_loading.m_HintPanel)
2012 m_loading.m_HintPanel.ShowRandomPage();
2025 m_loading.SetProgress(progress);
2032 m_loading.SetProgress(0);
2062 RegisterProfilesOptions();
2067 GetProfileStringList(
"SB_Visited", m_Visited);
2069 if (GetLoadState() == DayZLoadState.UNDEFINED)
2076 #ifndef PLATFORM_PS4
2124 protected const int MAX_VISITED = 50;
2135 if (GetUIManager().GetMenu())
2137 GetUIManager().GetMenu().Refresh();
2144 m_IntroMenu = GetWorkspace().CreateWidgets(
"gui/layouts/xbox/day_z_title_screen.layout");
2146 m_IntroMenu.FindAnyWidget(
"notification_root").Show(
false);
2149 string text = Widget.TranslateString(
"#console_start_game");
2150 #ifdef PLATFORM_XBOX
2152 if (user_manager && user_manager.GetSelectedUser())
2153 text_widget.SetText(
string.Format(text,
"<image set=\"xbox_buttons\" name=\"A\" />"));
2155 text_widget.SetText(
string.Format(text,
"<image set=\"xbox_buttons\" name=\"A\" />"));
2159 string confirm =
"cross";
2168 text_widget.SetText(
string.Format(text,
"<image set=\"playstation_buttons\" name=\"" + confirm +
"\" />"));
2172 #ifdef PLATFORM_CONSOLE
2173 #ifdef PLATFORM_XBOX
2174 #ifdef BUILD_EXPERIMENTAL
2175 m_IntroMenu.FindAnyWidget(
"notification_root").Show(
true);
2191 return m_ShouldShowControllerDisconnect;
2196 #ifdef PLATFORM_CONSOLE
2199 m_ShouldShowControllerDisconnect = !GetInput().AreAllAllowedInputDevicesActive();
2200 if (m_ShouldShowControllerDisconnect)
2210 SetGameState(DayZGameState.JOIN);
2211 SetLoadState(DayZLoadState.JOIN_START);
2213 #ifdef PLATFORM_CONSOLE
2218 user_manager.ParseJoinAsync(join_param);
2226 if (user_manager.GetTitleInitiator())
2228 user_manager.SelectUserEx(user_manager.GetTitleInitiator());
2231 SetGameState(DayZGameState.CONNECT);
2232 SetLoadState(DayZLoadState.CONNECT_START);
2234 #ifndef PLATFORM_WINDOWS
2235 #ifdef PLATFORM_CONSOLE
2246 SetGameState(DayZGameState.PARTY);
2247 SetLoadState(DayZLoadState.PARTY_START);
2253 user_manager.ParsePartyAsync(param);
2260#ifdef PLATFORM_WINDOWS
2264 if (user_manager.GetTitleInitiator())
2266 user_manager.SelectUserEx(user_manager.GetTitleInitiator());
2271 SetGameState(DayZGameState.MAIN_MENU);
2272 SetLoadState(DayZLoadState.MAIN_MENU_START);
2282 if (user_manager.GetTitleInitiator())
2284 user_manager.SelectUserEx(user_manager.GetTitleInitiator());
2288 SetGameState(DayZGameState.IN_GAME);
2289 SetLoadState(DayZLoadState.MISSION_START);
2291 #ifndef PLATFORM_WINDOWS
2292 #ifdef PLATFORM_CONSOLE
2309 AutoTestFixture.LogRPT(
"Failed to load autotest configuration, continue with mission load.");
2311 m_AutotestEnabled =
true;
2332 GetInput().GetGamepadUser(gamepad, selected_user);
2337 if (user_manager.SelectUserEx(selected_user))
2340 GetInput().SelectActiveGamepad(gamepad);
2344 selected_user = user_manager.GetSelectedUser();
2348 if (!selected_user.IsOnline())
2350 user_manager.LogOnUserAsync(selected_user);
2358 GetInput().ResetActiveGamepad();
2365 selected_user = user_manager.GetSelectedUser();
2369 user_manager.PickUserAsync();
2373 user_manager.SelectUserEx(selected_user);
2375 switch (GetLoadState())
2377 case DayZLoadState.JOIN_START:
2379 SetLoadState(DayZLoadState.JOIN_USER_SELECT);
2382 case DayZLoadState.PARTY_START:
2384 SetLoadState(DayZLoadState.PARTY_USER_SELECT);
2387 case DayZLoadState.MAIN_MENU_START:
2389 SetLoadState(DayZLoadState.MAIN_MENU_USER_SELECT);
2392 case DayZLoadState.CONNECT_START:
2394 SetLoadState(DayZLoadState.CONNECT_USER_SELECT);
2397 case DayZLoadState.MISSION_START:
2399 SetLoadState(DayZLoadState.MISSION_USER_SELECT);
2407 g_Game.SetHudBrightness(
g_Game.GetHUDBrightnessSetting());
2413 m_PreviousGamepad = gamepad;
2418 return m_PreviousGamepad;
2424 if (GetInput().IsActiveGamepadSelected())
2433 #ifdef PLATFORM_CONSOLE
2434 #ifndef PLATFORM_WINDOWS
2438 int gamepad = GetInput().GetUserGamepad(
GetUserManager().GetSelectedUser());
2447 GetGame().GetInput().IdentifyGamepad(
GetGame().GetInput().GetEnterButton());
2453 if (!m_IntroMenu && !(GetUIManager().GetMenu() && GetUIManager().GetMenu().
GetID() ==
MENU_TITLE_SCREEN))
2455 GetInput().IdentifyGamepad(GetInput().GetEnterButton());
2465 ResetProfileOptions();
2470 BiosUser selected_user = user_manager.GetSelectedUser();
2474 SetPlayerName(selected_user.GetName());
2476 #ifdef PLATFORM_CONSOLE
2478 user_manager.GetUserDatabaseIdAsync();
2482 if (GetUIManager().GetMenu())
2484 GetUIManager().GetMenu().Refresh();
2488 switch (GetLoadState())
2490 case DayZLoadState.JOIN_USER_SELECT:
2492 SetLoadState(DayZLoadState.JOIN_CONTROLLER_SELECT);
2496 case DayZLoadState.PARTY_USER_SELECT:
2498 SetLoadState(DayZLoadState.PARTY_CONTROLLER_SELECT);
2503 case DayZLoadState.CONNECT_USER_SELECT:
2505 SetLoadState(DayZLoadState.CONNECT_CONTROLLER_SELECT);
2509 case DayZLoadState.MAIN_MENU_USER_SELECT:
2511 SetLoadState(DayZLoadState.MAIN_MENU_CONTROLLER_SELECT);
2513 GetUIManager().EnterScriptedMenu(
MENU_MAIN, GetUIManager().GetMenu());
2516 case DayZLoadState.MISSION_USER_SELECT:
2518 SetLoadState(DayZLoadState.MISSION_CONTROLLER_SELECT);
2530 if (GetLoadState() == DayZLoadState.JOIN_CONTROLLER_SELECT)
2532 SetGameState(DayZGameState.CONNECTING);
2537 if (GetGameState() != DayZGameState.CONNECTING)
2539 switch (GetLoadState())
2541 case DayZLoadState.CONNECT_CONTROLLER_SELECT:
2543 SetGameState(DayZGameState.CONNECTING);
2547 case DayZLoadState.PARTY_CONTROLLER_SELECT:
2549 SetGameState(DayZGameState.CONNECTING);
2553 case DayZLoadState.MAIN_MENU_CONTROLLER_SELECT:
2555 SetGameState(DayZGameState.CONNECTING);
2565 if (GetHostAddress(address, port))
2567 if (m_ConnectAddress == address && m_ConnectPort == port)
2574 DisconnectSessionForce();
2586 if (m_Visited.Count() > 0)
2588 string uid = m_Visited.Get(m_Visited.Count() - 1);
2590 uid.Split(
":", output);
2592 port = output[1].ToInt();
2601 string uid = ip +
":" + port;
2604 int pos = m_Visited.Find(uid);
2608 if (m_Visited.Count() == MAX_VISITED)
2609 m_Visited.Remove(0);
2610 m_Visited.Insert(uid);
2615 if (pos != (m_Visited.Count() - 1))
2617 m_Visited.Remove(pos);
2618 m_Visited.Insert(uid);
2621 SetProfileStringList(
"SB_Visited", m_Visited);
2628 string uid = ip +
":" + port;
2629 int index = m_Visited.Find(uid);
2630 return (index >= 0);
2637 if (GetHostAddress(addr, port))
2639 m_ConnectAddress = addr;
2640 m_ConnectPort = port;
2652 if (GetHostAddress(addr, port))
2654 if (m_ConnectAddress == addr && m_ConnectPort == port)
2660 if (m_ConnectSteamQueryPort)
2661 connectAddress =
string.Format(
"%1:%2:%3", m_ConnectAddress, m_ConnectPort, m_ConnectSteamQueryPort);
2663 if (
Connect(GetUIManager().GetMenu(), connectAddress, m_ConnectPort, m_ConnectPassword) != 0)
2670 if (displayJoinError)
2701 GetGame().GetUIManager().CloseAllSubmenus();
2703 if (
GetGame().GetUIManager().IsDialogVisible() )
2705 GetGame().GetUIManager().CloseDialog();
2711 DisconnectSessionForce();
2716 if (
g_Game.GetGameState() != DayZGameState.MAIN_MENU)
2723 GetGame().GetMission().AbortMission();
2725 SetGameState(DayZGameState.MAIN_MENU);
2726 SetLoadState(DayZLoadState.MAIN_MENU_CONTROLLER_SELECT);
2740 m_ConnectAddress = ip;
2741 m_ConnectPort = port;
2742 m_ConnectPassword = password;
2743 m_ConnectFromJoin =
false;
2749 m_ConnectSteamQueryPort = steamQueryPort;
2755 m_ConnectAddress = ip;
2756 m_ConnectPort = port;
2757 m_ConnectFromJoin =
true;
2767 m_ConnectPort = port.ToInt();
2771 m_ConnectFromJoin =
false;
2778 return m_IsCtrlHolding;
2785 if (key ==
KeyCode.KC_LCONTROL)
2787 m_IsCtrlHolding =
true;
2792 m_IsLeftAltHolding =
true;
2797 m_IsRightAltHolding =
true;
2800 if (m_keyboard_handler)
2802 m_keyboard_handler.
OnKeyDown(NULL, 0, 0, key);
2812 if ((m_IsLeftAltHolding || m_IsLeftAltHolding) && key ==
KeyCode.KC_F4)
2823 if (key ==
KeyCode.KC_LCONTROL)
2825 m_IsCtrlHolding =
false;
2830 m_IsWinHolding =
false;
2835 m_IsLeftAltHolding =
false;
2840 m_IsRightAltHolding =
false;
2843 if (m_keyboard_handler)
2845 m_keyboard_handler.OnKeyUp(NULL, 0, 0, key);
2861 mission.OnMouseButtonPress(button);
2871 mission.OnMouseButtonRelease(button);
2878 m_IsCtrlHolding =
false;
2879 m_IsWinHolding =
false;
2880 m_IsLeftAltHolding =
false;
2881 m_IsRightAltHolding =
false;
2893 m_DeltaTime = timeslice;
2896 bool gameIsRunning =
false;
2900 gameIsRunning =
true;
2927 if (m_loading && m_loading.IsLoading())
2929 m_loading.OnUpdate(timeslice);
2931 else if (m_LoginTimeScreen && m_LoginTimeScreen.IsStatic())
2933 m_LoginTimeScreen.Update(timeslice);
2940 GetDragQueue().Tick();
2944 if (m_Notifications)
2946 m_Notifications.Update(timeslice);
2950 #ifdef DIAG_DEVELOPER
2957 int pingAct = playerIdentity.GetPingAct();
2958 int pingAvg = playerIdentity.GetPingAvg();
2960 float throttleInput = playerIdentity.GetInputThrottle();
2961 float throttleOutput = playerIdentity.GetOutputThrottle();
2963 DrawPerformanceStats(pingAct, pingAvg, throttleInput, throttleOutput);
2983 bool gameIsRunning =
false;
2987 gameIsRunning =
true;
2993 if (m_loading && m_loading.IsLoading())
2996 else if (m_LoginTimeScreen && m_LoginTimeScreen.IsStatic())
3014 super.OnRPC(sender, target, rpc_type, ctx);
3015 Event_OnRPC.Invoke(sender, target, rpc_type, ctx);
3022 target.OnRPC(sender, rpc_type, ctx);
3030 case ERPCs.RPC_CFG_GAMEPLAY_SYNC:
3035 case ERPCs.RPC_UNDERGROUND_SYNC:
3040 case ERPCs.RPC_PLAYERRESTRICTEDAREAS_SYNC:
3045 case ERPCs.RPC_SEND_NOTIFICATION:
3052 ctx.Read(show_time);
3053 ctx.Read(detail_text);
3058 case ERPCs.RPC_SEND_NOTIFICATION_EXTENDED:
3060 float show_time_ext;
3061 string title_text_ext;
3062 string detail_text_ext;
3065 ctx.Read(show_time_ext);
3066 ctx.Read(title_text_ext);
3067 ctx.Read(detail_text_ext);
3075 case ERPCs.RPC_SOUND_HELICRASH:
3083 if (ctx.Read(playCrashSound))
3085 playSound = playCrashSound.param1;
3086 pos = playCrashSound.param2;
3087 sound_set =
CrashSoundSets.GetSoundSetByHash(playCrashSound.param3);
3099 case ERPCs.RPC_SOUND_ARTILLERY:
3102 Param1<vector> playArtySound =
new Param1<vector>(
vector.Zero);
3103 if (ctx.Read(playArtySound))
3105 position = playArtySound.param1;
3106 if (position ==
vector.Zero)
3123 case ERPCs.RPC_SOUND_CONTAMINATION:
3127 Param1<vector> playContaminatedSound =
new Param1<vector>(
vector.Zero);
3128 if (ctx.Read(playContaminatedSound))
3130 soundPos = playContaminatedSound.param1;
3131 if (soundPos ==
vector.Zero)
3145 if (distance_to_player <=
GameConstants.CAMERA_SHAKE_ARTILLERY_DISTANCE2)
3147 float strength_factor =
Math.InverseLerp(
GameConstants.CAMERA_SHAKE_ARTILLERY_DISTANCE, 0,
Math.Sqrt(distance_to_player));
3150 camera.SpawnCameraShake(strength_factor * 4);
3157 case ERPCs.RPC_SOUND_ARTILLERY_SINGLE:
3164 if (ctx.Read(playArtyShotSound))
3166 soundPosition = playArtyShotSound.param1;
3167 delayedSoundPos = playArtyShotSound.param2;
3168 soundDelay = playArtyShotSound.param3;
3169 if (soundPosition ==
vector.Zero)
3185 GetCallQueue(
CALL_CATEGORY_GAMEPLAY).CallLater(DelayedMidAirDetonation, soundDelay,
false, delayedSoundPos[0], delayedSoundPos[1], delayedSoundPos[2]);
3188 case ERPCs.RPC_SET_BILLBOARDS:
3190 if (!m_BillboardSetHandler)
3193 Param1<int> indexP =
new Param1<int>(-1);
3194 if (ctx.Read(indexP))
3196 int index = indexP.param1;
3197 m_BillboardSetHandler.OnRPCIndex(index);
3204 case ERPCs.RPC_USER_SYNC_PERMISSIONS:
3207 if (ctx.Read(mute_list))
3209 for (
int i = 0; i < mute_list.Count(); i++)
3211 string uid = mute_list.GetKey(i);
3212 bool mute = mute_list.GetElement(i);
3213 MutePlayer(uid, sender.GetPlainId(), mute);
3231 case ERPCs.DEV_SET_WEATHER:
3233 Param1<DebugWeatherRPCData> p1data =
new Param1<DebugWeatherRPCData>(null);
3235 if ( ctx.Read(p1data) )
3239 if (data.m_FogValue >= 0)
3240 GetGame().
GetWeather().GetFog().Set(data.m_FogValue, data.m_FogInterpolation, data.m_FogDuration);
3242 if (data.m_OvercastValue >= 0)
3243 GetGame().
GetWeather().GetOvercast().Set(data.m_OvercastValue, data.m_OvercastInterpolation, data.m_OvercastDuration);
3245 if (data.m_RainValue >= 0)
3246 GetGame().
GetWeather().GetRain().Set(data.m_RainValue, data.m_RainInterpolation, data.m_RainDuration);
3248 if (data.m_SnowfallValue >= 0)
3249 GetGame().
GetWeather().GetSnowfall().Set(data.m_SnowfallValue, data.m_SnowfallInterpolation, data.m_SnowfallDuration);
3251 if (data.m_VolFogDistanceDensity >= 0)
3252 GetGame().
GetWeather().SetDynVolFogDistanceDensity(data.m_VolFogDistanceDensity, data.m_VolFogDistanceDensityTime);
3254 if (data.m_VolFogHeightDensity >= 0)
3255 GetGame().
GetWeather().SetDynVolFogHeightDensity(data.m_VolFogHeightDensity, data.m_VolFogHeightDensityTime);
3257 if (data.m_VolFogHeightBias >= -500)
3258 GetGame().
GetWeather().SetDynVolFogHeightBias(data.m_VolFogHeightBias, data.m_VolFogHeightBiasTime);
3260 if (data.m_WindMagnitudeValue >= 0)
3261 GetGame().
GetWeather().GetWindMagnitude().Set(data.m_WindMagnitudeValue, data.m_WindDInterpolation, data.m_WindDDuration);
3263 if (data.m_WindDirectionValue >= -3.14)
3264 GetGame().
GetWeather().GetWindDirection().Set(data.m_WindDirectionValue, data.m_WindDInterpolation, data.m_WindDDuration);
3268 ErrorEx(
"Failed to read weather debug data");
3275 #ifdef DIAG_DEVELOPER
3277 case ERPCs.DIAG_CAMERATOOLS_CAM_DATA:
3279 if (!m_CameraToolsMenuServer)
3281 m_CameraToolsMenuServer =
new CameraToolsMenuServer;
3283 m_CameraToolsMenuServer.OnRPC(rpc_type, ctx);
3287 case ERPCs.DIAG_CAMERATOOLS_CAM_SUBSCRIBE:
3289 if (!m_CameraToolsMenuServer)
3291 m_CameraToolsMenuServer =
new CameraToolsMenuServer;
3293 m_CameraToolsMenuServer.OnRPC(rpc_type, ctx);
3316 if (
mission && !m_loading.IsLoading() && GetUIManager().IsDialogQueued())
3319 GetUIManager().ShowQueuedDialog();
3327 m_IsConnecting = value;
3332 return m_IsConnecting;
3338 return m_loading && m_loading.IsLoading();
3344 m_keyboard_handler = handler;
3351 m_loading.ShowEx(
this);
3359 m_loading.Hide(force);
3362 #ifdef PLATFORM_CONSOLE
3365 if (m_LoadState != DayZLoadState.MAIN_MENU_START && m_LoadState != DayZLoadState.MAIN_MENU_USER_SELECT)
3377 if (m_CharClassNames.Count() > 0)
3378 return m_CharClassNames[0];
3386 return m_CharClassNames.GetRandomElement();
3392 return m_CharClassNames;
3398 vector pos = hitInfo.GetPosition();
3399 string ammoType = hitInfo.GetAmmoType();
3402 ExplosionEffects(source, directHit, componentIndex, hitInfo.GetSurface(), pos, hitInfo.GetSurfaceNormal(), energyFactor, explosionFactor, hitInfo.IsWater(), ammoType);
3408 m_NoiseParams.LoadFromPath(
string.Format(
"cfgAmmo %1 NoiseExplosion", ammoType));
3410 float multiplier = hitInfo.GetSurfaceNoiseMultiplier();
3411 if (multiplier == 0)
3420 float energyFactor,
float explosionFactor,
bool isWater,
string ammoType)
3427 source.OnExplosionEffects(source, directHit, componentIndex, surface, pos, surfNormal, energyFactor, explosionFactor, isWater, ammoType);
3429 if (source.ShootsExplosiveAmmo() )
3431 int particleID =
AmmoTypesAPI.GetExplosionParticleID(ammoType, surface);
3432 if (particleID > -1)
3440 m_AmmoShakeParams.Load(ammoType);
3442 if (distance_to_player < m_AmmoShakeParams.m_Radius)
3444 float dist01 =
Math.InverseLerp(0, m_AmmoShakeParams.m_Radius, distance_to_player);
3445 float modifier =
Math.Lerp(m_AmmoShakeParams.m_ModifierClose, m_AmmoShakeParams.m_ModifierFar,dist01);
3447 GetGame().GetPlayer().GetCurrentCamera().SpawnCameraShake(modifier * m_AmmoShakeParams.m_Strength);
3458 GetGame().ConfigGetText(
"cfgAmmo " + info.GetAmmoType() +
" simulation", simulation);
3460 if (simulation ==
"shotArrow")
3464 GetGame().ConfigGetText(
"cfgAmmo " + info.GetAmmoType() +
" spawnPileType", pile);
3467 arrow.PlaceOnSurface();
3468 arrow.SetFromProjectile(info);
3472 const float ARROW_PIERCE_DEPTH = 0.05;
3479 if (info.GetIsWater())
3482 GetGame().ConfigGetText(
"cfgAmmo " + info.GetAmmoType() +
" simulation", simulation);
3483 if (simulation ==
"shotArrow")
3486 GetGame().ConfigGetText(
"cfgAmmo " + info.GetAmmoType() +
" spawnPileType", pile);
3487 vector pos = info.GetPos();
3488 vector dir = -info.GetInVelocity();
3494 arrow.SetDirection(dir);
3495 arrow.SetFromProjectile(info);
3504 GetGame().ConfigGetText(
"cfgAmmo " + info.GetAmmoType() +
" simulation", simulation);
3505 if (simulation ==
"shotArrow")
3508 GetGame().ConfigGetText(
"cfgAmmo " + info.GetAmmoType() +
" spawnPileType", pile);
3514 EntityAI parent = ent.GetHierarchyParent();
3515 if (parent && parent.IsPlayer())
3518 arrow.PlaceOnSurface();
3519 arrow.SetFromProjectile(info);
3525 vector pos = info.GetPos();
3526 vector dir = -info.GetInVelocity();
3532 arrow.SetDirection(dir);
3533 arrow.SetFromProjectile(info);
3535 info.GetHitObj().AddArrow(arrow, info.GetComponentIndex(), info.GetHitObjPos(), info.GetHitObjRot());
3541 vector exitPos,
vector inSpeed,
vector outSpeed,
bool isWater,
bool deflected,
string ammoType)
3544 ImpactEffectsData impactEffectsData =
new ImpactEffectsData();
3545 impactEffectsData.m_DirectHit = directHit;
3546 impactEffectsData.m_ComponentIndex = componentIndex;
3547 impactEffectsData.m_Surface = surface;
3548 impactEffectsData.m_Position = pos;
3549 impactEffectsData.m_ImpactType =
ImpactTypes.UNKNOWN;
3550 impactEffectsData.m_SurfaceNormal = surfNormal;
3551 impactEffectsData.m_ExitPosition = exitPos;
3552 impactEffectsData.m_InSpeed = inSpeed;
3553 impactEffectsData.m_OutSpeed = outSpeed;
3554 impactEffectsData.m_IsDeflected = deflected;
3555 impactEffectsData.m_AmmoType = ammoType;
3556 impactEffectsData.m_IsWater = isWater;
3560 directHit.OnReceivedHit(impactEffectsData);
3569 if (source && source.ShootsExplosiveAmmo() && !deflected && outSpeed ==
vector.Zero)
3571 if (ammoType ==
"Bullet_40mm_ChemGas")
3573 GetGame().CreateObject(
"ContaminatedArea_Local", pos);
3575 else if (ammoType ==
"Bullet_40mm_Explosive")
3577 DamageSystem.ExplosionDamage(
EntityAI.Cast(source), null,
"Explosion_40mm_Ammo", pos,
DamageType.EXPLOSION);
3582 m_NoiseParams.LoadFromPath(
"cfgAmmo " + ammoType +
" NoiseHit");
3585 float coefAdjusted = surfaceCoef * inSpeed.Length() / ConfigGetFloat(
"cfgAmmo " + ammoType +
" initSpeed");
3586 if (coefAdjusted == 0)
3595 bool isWater,
string ammoType)
3598 ImpactEffectsData impactEffectsData =
new ImpactEffectsData();
3599 impactEffectsData.m_DirectHit = directHit;
3600 impactEffectsData.m_ComponentIndex = componentIndex;
3601 impactEffectsData.m_Surface = surface;
3602 impactEffectsData.m_Position = pos;
3603 impactEffectsData.m_ImpactType =
ImpactTypes.MELEE;
3604 impactEffectsData.m_SurfaceNormal =
Vector(
Math.RandomFloat(-1,1),
Math.RandomFloat(-1,1),
Math.RandomFloat(-1,1));
3605 impactEffectsData.m_ExitPosition =
"0 0 0";
3606 impactEffectsData.m_InSpeed =
"0 0 0";
3607 impactEffectsData.m_OutSpeed =
"0 0 0";
3608 impactEffectsData.m_IsDeflected =
false;
3609 impactEffectsData.m_AmmoType = ammoType;
3610 impactEffectsData.m_IsWater = isWater;
3613 directHit.OnReceivedHit(impactEffectsData);
3621 m_NoiseParams.LoadFromPath(
"cfgAmmo " + ammoType +
" NoiseHit");
3624 if (surfaceCoef == 0)
3633 GetMission().UpdateVoiceLevelWidgets(level);
3638 m_OriginalCharactersCount = menudata_count;
3643 m_PlayerName =
name;
3648 return m_PlayerName;
3653 m_IsNewCharacter = state;
3658 return m_IsNewCharacter;
3663 if (pFov < OPTIONS_FIELD_OF_VIEW_MIN)
3664 pFov = OPTIONS_FIELD_OF_VIEW_MIN;
3666 if (pFov > OPTIONS_FIELD_OF_VIEW_MAX)
3667 pFov = OPTIONS_FIELD_OF_VIEW_MAX;
3680 NumericOptionsAccess noa;
3681 if (gameOptions &&
Class.CastTo(noa,gameOptions.GetOptionByType(
OptionAccessType.AT_OPTIONS_FIELD_OF_VIEW)))
3683 return noa.ReadValue();
3706 Widget.SetLV(value);
3707 Widget.SetTextLV(value);
3720 string cfg_path =
"CfgWeapons " + weaponInHand.GetType() +
" chamberableFrom";
3721 GetGame().ConfigGetTextArray(cfg_path, ammo_names);
3723 foreach (
string ammo_name : ammo_names)
3725 if (ammo.GetType() == ammo_name)
3737 m_PreviousEVValue = m_EVValue;
3749 return m_PreviousEVValue;
3754 ListOptionsAccess language_option;
3756 language_option = ListOptionsAccess.Cast(options.GetOptionByType(
OptionAccessType.AT_OPTIONS_LANGUAGE));
3758 if (language_option)
3760 idx = language_option.GetIndex();
3768 return m_IsWorldWetTempUpdateEnabled;
3778 #ifdef DIAG_DEVELOPER
3780 if (FeatureTimeAccel.GetFeatureTimeAccelEnabled(ETimeAccelCategories.FOOD_DECAY))
3782 return m_FoodDecayModifier * FeatureTimeAccel.GetFeatureTimeAccelValue();
3785 return m_FoodDecayModifier;
3790 if (!m_ConnectedInputDeviceList)
3794 return m_ConnectedInputDeviceList;
3799 m_CursorDesiredVisibilityScript = visible;
3806 return m_CursorDesiredVisibilityScript;
3813#ifdef PLATFORM_CONSOLE
3816 return GetInput().IsMouseConnected();
3821#ifdef PLATFORM_CONSOLE
3831#ifdef FEATURE_CURSOR
3834 ShowCursorWidget(
true);
3845 ui.ShowCursor(showCursor);
3850 ShowCursorWidget(showCursor);
const int ECE_DYNAMIC_PERSISTENCY
PlayerSpawnPresetDiscreteItemSetSlotData name
one set for cargo
Static data of bleeding chance probabilities; currently used for melee only.
void SetConnecting(bool value)
Returns true when connecting to server.
void DisconnectSessionScript(bool displayJoinError=false)
override TStringArray ListAvailableCharacters()
override void OnUpdate(bool doSim, float timeslice)
void UpdateVoiceLevel(int level)
override void OnActivateMessage()
void AddVisitedServer(string ip, int port)
override void OnDeactivateMessage()
void UpdateLoginQueue(float timeslice)
override string CreateRandomPlayer()
void OnProjectileStoppedInTerrain(TerrainCollisionInfo info)
DayZGameState m_GameState
void SetPreviousGamepad(int gamepad)
float GetFoodDecayModifier()
void ConnectFromServerBrowserEx(string ip, int port, int steamQueryPort, string password="")
void StoreLoginDataPrepare()
void DelayedMidAirDetonation(float x, float y, float z)
override void OnPostUpdate(bool doSim, float timeslice)
int GetCurrentDisplayLanguageIdx()
array< int > GetConnectedInputDeviceList()
override void OnDeviceReset()
override void OnAfterCreate()
proto native bool IsMultiplayer()
void SetPlayerGameName(string name)
string GetPlayerGameName()
bool IsKindOf(string cfg_class_name, string cfg_parent_name)
Returns is class name inherited from parent class name.
void OnProjectileStopped(ProjectileStoppedInfo info)
void ExplosionEffectsEx(Object source, Object directHit, int componentIndex, float energyFactor, float explosionFactor, HitInfo hitInfo)
bool OnConnectivityStatChange(EConnectivityStatType type, EConnectivityStatLevel newLevel, EConnectivityStatLevel oldLevel)
void SetMouseCursorDesiredVisibility(bool visible)
void LoadingHide(bool force=false)
bool GetMouseCursorDesiredVisibility()
proto native BiosUserManager GetUserManager()
void OnLoginTimeEvent(int loginTime)
override void OnKeyPress(int key)
void OnMPConnectionLostEvent(int duration)
void CreateGamepadDisconnectMenu()
bool CanDisplayMouseCursor()
extend as needed, only game focus and M&K setting (consoles only!) are checked natively
void SetKeyboardHandle(UIScriptedMenu handler)
void OnRespawnEvent(int time)
float GetPreviousEVValue()
void LoginTimeCountdown()
proto native void SetMainMenuWorld(string world)
void AutoTestLaunch(string param)
ref BillboardSetHandler m_BillboardSetHandler
void OnPreloadEvent(vector pos)
proto native bool IsServer()
void EnterLoginTime(UIMenuPanel parent)
void RemoveVoiceNotification(VONStopSpeakingEventParams vonStopParams)
const int MISSION_STATE_GAME
ref TStringArray m_Visited
float GetCurrentEVValue()
static float GetUserFOVFromConfig()
override string CreateDefaultPlayer()
void EnterLoginQueue(UIMenuPanel parent)
void SetNewCharacter(bool state)
void RefreshCurrentServerInfo()
override void OnKeyRelease(int key)
static bool CheckAmmoCompability(EntityAI weaponInHand, EntityAI ammo)
bool ShouldShowControllerDisconnect()
void FirearmEffects(Object source, Object directHit, int componentIndex, string surface, vector pos, vector surfNormal, vector exitPos, vector inSpeed, vector outSpeed, bool isWater, bool deflected, string ammoType)
float GetFOVByZoomType(ECameraZoomType type)
void OnProjectileStoppedInObject(ObjectCollisionInfo info)
proto native owned string GetMainMenuWorld()
void ConnectFromServerBrowser(string ip, int port, string password="")
override void OnMouseButtonRelease(int button)
bool GetLastVisitedServer(out string ip, out int port)
override void OnMouseButtonPress(int button)
void SetDatabaseID(string id)
void InitCharacterMenuDataInfo(int menudata_count)
bool IsVisited(string ip, int port)
proto native Weather GetWeather()
Returns weather controller object.
void SelectUser(int gamepad=-1)
ref NotificationUI m_Notifications
void RefreshMouseCursorVisibility()
DayZLoadState m_LoadState
proto native bool IsClient()
int m_ConnectSteamQueryPort
bool IsFoodDecayEnabled()
float GetHUDBrightnessSetting()
native void CreateMission(string path)
Create only enforce script mission, used for mission script reloading.
override bool OnInitialize()
proto native float SurfaceGetNoiseMultiplier(Object directHit, vector pos, int componentIndex)
void SetUserFOV(float pFov)
void SetEVValue(float value)
const float ARROW_PIERCE_DEPTH
override void OnRPC(PlayerIdentity sender, Object target, int rpc_type, ParamsReadContext ctx)
void CloseCombatEffects(Object source, Object directHit, int componentIndex, string surface, vector pos, vector surfNormal, bool isWater, string ammoType)
proto native void SetLoginTimerFinished()
proto native void SetEVUser(float value)
Sets custom camera camera EV. range: -50.0..50.0? //TODO.
void SetHudBrightness(float value)
void DeleteGamepadDisconnectMenu()
proto native void AbortMission()
Returns to main menu, leave world empty for using last mission world.
BillboardSetHandler GetBillboardHandler()
MenuDefaultCharacterData GetMenuDefaultCharacterData(bool fill_data=true)
void ExplosionEffects(Object source, Object directHit, int componentIndex, string surface, vector pos, vector surfNormal, float energyFactor, float explosionFactor, bool isWater, string ammoType)
void UpdateInputDeviceDisconnectWarning()
void ConnectFromJoin(string ip, int port)
ref Widget m_GamepadDisconnectMenu
void DisconnectSessionEx(DisconnectSessionFlags flags)
void AddVoiceNotification(VONStopSpeakingEventParams vonStartParams)
void LoadProgressUpdate(int progressState, float progress, string title)
ref LoadingScreen m_loading
bool IsWorldWetTempUpdateEnabled()
Super root of all classes in Enforce script.
Wrapper class for managing sound through SEffectManager.
override void SetAutodestroy(bool auto_destroy)
Sets whether Effect automatically cleans up when it stops.
The error handler itself, for managing and distributing errors to modules Manages the ErrorHandlerMod...
struct that keeps Time relevant information for future formatting
LoginQueue position when using -connect since mission is not created yet.
TextWidget m_txtDescription
bool CanChangeHintPage(float timeAccu)
LoginTime when using -connect since mission is not created yet.
static void AddNotificationExtended(float show_time, string title_text, string detail_text="", string icon="")
Send custom notification from to local player.
static void InitInstance()
static void CleanupInstance()
static void AddNotification(NotificationType type, float show_time, string detail_text="")
Send notification from default types to local player.
static void Update(float timeslice)
static void OnGameplayDataHandlerLoad()
static void LoadVoicePrivilege()
static void LeaveGameplaySession()
static BiosUser GetBiosUser()
static void GetCurrentServerInfo(string ip, int port)
static void SetBiosUser(BiosUser user)
static void EnterGameplaySession()
static void SetMultiplayState(bool state)
static void LoadMPPrivilege()
static void ClearCurrentServerInfo()
Static component of PPE manager, used to hold the instance.
Base Param Class with no parameters. Used as general purpose parameter overloaded with Param1 to Para...
The class that will be instanced (moddable)
Manager class for managing Effect (EffectParticle, EffectSound)
static void OnUpdate(float timeslice)
static EffectSound PlaySound(string sound_set, vector position, float play_fade_in=0, float stop_fade_out=0, bool loop=false)
Create and play an EffectSound.
ScriptCallQueue Class provide "lazy" calls - when we don't want to execute function immediately but l...
ScriptInvoker Class provide list of callbacks usage:
Module containing compiled scripts.
Serialization general interface. Serializer API works with:
Keeps information about currently loaded world, like temperature.
void UpdateWeatherEffects(Weather weather, float timeslice)
Updates local weather effects.
Result for an object found in CGame.IsBoxCollidingGeometryProxy.
override void OnEvent(EventType eventTypeId, Param params)
Handles VON-related events.
override void DeferredInit()
DamageType
exposed from C++ (do not change)
class AttachmentSoundLookupTable extends SoundLookupTable m_NoiseParams
class DayZProfilesOptions PARTY_CONTROLLER_SELECT
class DayZProfilesOptions MISSION_USER_SELECT
ImageWidget m_ImageLogoCorner
ImageWidget m_ImageLoadingIcon
ImageWidget m_ImageWidgetBackground
enum DisconnectSessionFlags DISCONNECT_SESSION_FLAGS_FORCE
class DayZProfilesOptions PARTY_USER_SELECT
class DayZProfilesOptions JOIN_START
class DayZProfilesOptions MAIN_MENU_USER_SELECT
Param3< string, int, int > DayZProfilesOptionInt
class DayZProfilesOptions CONNECT_START
void SetProgress(float val)
TextWidget m_TextWidgetTitle
float m_LastProgressUpdate
class DayZProfilesOptions MISSION_START
const int DISCONNECT_SESSION_FLAGS_ALL
class DayZProfilesOptions PARTY
class DayZProfilesOptions MAIN_MENU_CONTROLLER_SELECT
ref UiHintPanelLoading m_HintPanel
@ DISCONNECT_ERROR_ENABLED
class DayZProfilesOptions UNDEFINED
TextWidget m_ModdedWarning
void ShowEx(DayZGame game)
Param3< string, float, float > DayZProfilesOptionFloat
ProgressBarWidget m_ProgressLoading
class DayZProfilesOptions JOIN_USER_SELECT
const int DISCONNECT_SESSION_FLAGS_JOIN
ImageWidget m_ImageLogoMid
DayZProfilesOption DayZProfilesOptionBool
class DayZProfilesOptions JOIN_CONTROLLER_SELECT
void SetTitle(string title)
class DayZProfilesOptions CONNECTING
class DayZProfilesOptions CONNECT_USER_SELECT
class DayZProfilesOptions MAIN_MENU_START
void LoadingScreen(DayZGame game)
TextWidget m_TextWidgetStatus
void SetStatus(string status)
class DayZProfilesOptions PARTY_START
float m_ImageLoadingIconRotation
ImageWidget m_ImageBackground
bool CanChangeHintPage(float timeAccu)
class LoginScreenBase extends UIScriptedMenu m_txtPosition
class DayZProfilesOptions m_WidgetRoot
class DayZProfilesOptions CONNECT
TextWidget m_ProgressText
class DayZProfilesOptions JOIN
class CrashSoundSets GetIsWater
Param3< string, bool, bool > DayZProfilesOption
void SetPosition(int position)
override bool OnClick(Widget w, int x, int y, int button)
buttons clicks
ProjectileStoppedInfo Managed GetSurfNormal()
class DayZProfilesOptions MAIN_MENU
class DayZProfilesOptions CONNECT_CONTROLLER_SELECT
class DayZPlayerCameraResult DayZPlayerCamera(DayZPlayer pPlayer, HumanInputController pInput)
void SetDispatcher(Dispatcher dispatcher)
int GetID()
Get the ID registered in SEffectManager.
ErrorCategory
ErrorCategory - To decide what ErrorHandlerModule needs to be called and easily identify where it cam...
const int PROGRESS_UPDATE
Param1< int > RespawnEventParams
RespawnTime.
Param1< int > MPConnectionLostEventParams
Duration.
Param1< int > LoginTimeEventParams
LoginTime.
const EventType MPSessionEndEventTypeID
no params
const EventType ConnectingStartEventTypeID
no params
PlayerIdentity PROGRESS_START
const EventType LoginStatusEventTypeID
params: LoginStatusEventParams
Param1< vector > PreloadEventParams
Position.
Param4< float, float, int, int > ServerFpsStatsUpdatedEventParams
average server fps, highest frame time, skipped physics simulation steps server/client
const EventType WorldCleaupEventTypeID
no params
Param1< string > DLCOwnerShipFailedParams
world name
Param1< int > LogoutEventParams
logoutTime
const EventType SelectedUserChangedEventTypeID
no params
const EventType RespawnEventTypeID
params: RespawnEventParams
const EventType MPSessionFailEventTypeID
no params
const int PROGRESS_PROGRESS
const EventType StartupEventTypeID
no params
const EventType DialogQueuedEventTypeID
no params
Param4< int, string, string, string > ChatMessageEventParams
channel, from, text, color config class
const EventType MPSessionStartEventTypeID
no params
const EventType PreloadEventTypeID
params: PreloadEventParams
const EventType LoginTimeEventTypeID
params: LoginTimeEventParams
Param1< PlayerIdentity > ConnectivityStatsUpdatedEventParams
PlayerIdentity.
const EventType ServerFpsStatsUpdatedEventTypeID
params: ServerFpsStatsUpdatedEventParams
const EventType ConnectivityStatsUpdatedEventTypeID
params: ConnectivityStatsUpdatedEventParams
const EventType MPConnectionLostEventTypeID
params: MPConnectionLostEventParams
const EventType LogoutEventTypeID
params: LogoutEventParams
const EventType MPSessionPlayerReadyEventTypeID
no params
const EventType DLCOwnerShipFailedEventTypeID
params: DLCOwnerShipFailedParams
const int PROGRESS_FINISH
proto native CGame GetGame()
const EventType ProgressEventTypeID
params: ProgressEventParams
OptionAccessType
C++ OptionAccessType.
const EventType ChatMessageEventTypeID
params: ChatMessageEventParams
const EventType ConnectingAbortEventTypeID
no params
const string GAME_CHAT_MSG
const string SYSTEM_CHAT_MSG
const string RADIO_CHAT_MSG
const string PLAYER_CHAT_MSG
const string DIRECT_CHAT_MSG
const string ADMIN_CHAT_MSG
proto void Print(void var)
Prints content of variable to console/log.
const string OPTIONS_SOUND_AMBIENT_SOUND_MODE
array< string > TStringArray
const string SHOW_QUICKBAR
const string SHOW_SERVERINFO
const string SHOW_HUD_VEHICLE
const string SHOW_CONNECTIVITYINFO
const string HUD_BRIGHTNESS
const string ENABLE_BLEEDINGINDICATION
const string SHOW_CROSSHAIR
proto native vector Vector(float x, float y, float z)
Vector constructor from components.
class JsonUndergroundAreaTriggerData GetPosition
proto bool GetCLIParam(string param, out string val)
Returns command line argument.
class NoiseSystem NoiseParams()
NotificationType
DEPRECATED (moved into NotificationSystem)
void SetTime(float time)
DEPRECATED.
void ParticleManager(ParticleManagerSettings settings)
Constructor (ctor)