Allow admin customization of player_onPause #1340

Also disable abort and respawn immediately in pause menu onLoad. New
function fn_pauseMenuChecks allows admins to run unscheduled code in
pause menu onLoad.
This commit is contained in:
ebaydayz
2016-05-22 12:26:57 -04:00
parent fe8c5e7950
commit 8028efbb69
4 changed files with 13 additions and 2 deletions

View File

@@ -54,6 +54,8 @@
[CHANGED] Trader city objects are now spawned locally on each machine with simulation disabled for better performance. Admins can still override with custom cities in init.sqf. @ebaydayz
[CHANGED] Player zombies are no longer attacked by other zombies. The respawn button is now enabled for them if they wish to suicide. @ebaydayz
[CHANGED] With R3Fweight on overburdened players are now forced to move slowly instead of being knocked out. The scream was also removed. #1145 @icomrade @ebaydayz
[CHANGED] Abort and respawn are now disabled immediately in the pause menu onLoad to compensate for low fps delay. @ebaydayz
[CHANGED] Player_onPause is now customizable by admins along with the new unscheduled fn_pauseMenuChecks. #1340 @Rimblock @ebaydayz
[FIXED] Zombies now target and attack players correctly with 1.8.7 code
[FIXED] Server position sync bug after falling unconscious #1522 @ebaydayz

View File

@@ -310,7 +310,7 @@ class RscDisplayMPInterrupt : RscStandardDisplay {
movingEnable = 0;
enableSimulation = 1;
//onLoad = "_dummy = ['Init', _this] execVM '\ca\ui\scripts\pauseLoadinit.sqf'; [(_this select 0)] execVM '\z\addons\dayz_code\compile\player_onPause.sqf';"; _respawn = (_this select 0) displayCtrl 1010); _respawn ctrlEnable false; _abort = (_this select 0) displayCtrl 104); _abort ctrlEnable false;
onLoad = "uiNamespace setVariable ['RscDisplayMPInterrupt', _this select 0];[] execVM '\z\addons\dayz_code\compile\player_onPause.sqf'; _dummy = ['Init', _this] execVM '\ca\ui\scripts\pauseLoadinit.sqf';"; /*diag_log[diag_tickTime,'RscDisplayMPInterrupt'];*/
onLoad = "uiNamespace setVariable ['RscDisplayMPInterrupt', _this select 0]; _this call fn_pauseMenuChecks; [] spawn player_onPause; _dummy = ['Init', _this] execVM '\ca\ui\scripts\pauseLoadinit.sqf';"; /*diag_log[diag_tickTime,'RscDisplayMPInterrupt'];*/
onUnload = "uiNamespace setVariable ['RscDisplayMPInterrupt', nil];['Unload', _this] execVM '\ca\ui\scripts\pauseOnUnload.sqf';";
class controlsBackground {
@@ -397,7 +397,7 @@ class RscDisplayMPInterrupt : RscStandardDisplay {
class CA_B_Abort : CA_B_SAVE {
idc = 104;
y = 0.2537 + 0.101903 * 4;
onButtonClick = "[] execVM '\z\addons\dayz_code\compile\player_onPause.sqf'; call player_forceSave; with uiNameSpace do {RscDMSLoad=-2;};"; // request disconnection from server
onButtonClick = "[] spawn player_onPause; call player_forceSave; with uiNameSpace do {RscDMSLoad=-2;};"; // request disconnection from server
text = $STR_DISP_INT_ABORT;
default = 0;
};

View File

@@ -0,0 +1,7 @@
// This script is unscheduled so add code here sparingly
// Note description.ext onPauseScript is scheduled: https://community.bistudio.com/wiki/Description.ext#onPauseScript
disableSerialization;
// Disable abort and respawn immediately onLoad (player_onPause is delayed when FPS is low)
{ (_this select 0 displayCtrl _x) ctrlEnable false } count [1010,104];

View File

@@ -162,6 +162,8 @@ if (!isDedicated) then {
epoch_itemCost = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\epoch_itemCost.sqf";
epoch_returnChange = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\epoch_returnChange.sqf";
fn_gearMenuChecks = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\fn_gearMenuChecks.sqf";
fn_pauseMenuChecks = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\fn_pauseMenuChecks.sqf";
player_onPause = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\player_onPause.sqf";
player_addDuplicateTool = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\fn_addDuplicateTool.sqf";
player_antiWall = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\player_antiWall.sqf";
player_changeCombo = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\player_changeCombo.sqf";