Add option to toggle status icons

Vanilla commit:

44bb49e326
This commit is contained in:
ebayShopper
2017-12-04 18:14:48 -05:00
parent da7ea3bb4e
commit 5e9a7271e9
11 changed files with 68 additions and 100 deletions

View File

@@ -68,6 +68,12 @@ if (isNil "keyboard_keys") then {
call player_toggleSoundMute;
_handled = true;
};
_statusUI = {
profileNamespace setVariable ["statusUI",(if (profileNamespace getVariable ["statusUI",1] == 1) then {0} else {1})];
saveProfileNamespace;
call ui_changeDisplay;
_handled = true;
};
_rifle = {
2 call dz_fn_switchWeapon;
_handled = true;
@@ -302,6 +308,7 @@ if (isNil "keyboard_keys") then {
[actionKeys "Diary", _journal] call _addArray;
[actionKeys "NetworkStats", _journal] call _addArray;
[[DIK_F1], _muteSound] call _addArray;
[[DIK_F3], _statusUI] call _addArray;
[[DIK_F4], {if (diag_tickTime - dayz_lastSave > 10) then {call player_forceSave;};_handled = true;}] call _addArray;
[[DIK_TAB,DIK_DELETE], _forcesave] call _addArray;
//[[DIK_F4, DIK_RMENU, DIK_LMENU,DIK_LSHIFT,DIK_RSHIFT,DIK_ESCAPE], _forcesave2] call _addArray;
@@ -314,7 +321,7 @@ if (isNil "keyboard_keys") then {
[actionKeys "ForceCommandingMode", {DZE_5 = true;_handled = true;}] call _addArray;
[[ DIK_F9,DIK_F10,DIK_F11,DIK_F12,
DIK_F8,DIK_F7,DIK_F6,DIK_F5,
DIK_F3,DIK_F2,DIK_9,
DIK_F2,DIK_9,
DIK_8,DIK_7,DIK_6,DIK_5,DIK_4], _block] call _addArray;
if (dayz_groupSystem) then {
[[DIK_F5], _openGroups] call _addArray;

View File

@@ -1,5 +1,4 @@
private ["_array","_combatVal","_ctrlCombatBorder","_ctrlCombat","_uiNumber","_bloodText","_blood","_bloodType","_rhFactor","_thirstLvl","_foodLvl","_tempImg","_tempText","_visual","_audible","_id","_rID","_color","_string","_humanity","_size","_friendlies","_rfriendlies","_rfriendlyTo","_distance","_targetControl","_flash","_foodVal","_thirstVal","_tempVal","_display","_ctrlBloodOuter","_ctrlFoodBorder","_ctrlThirstBorder","_ctrlTempBorder","_ctrlBlood","_ctrlBloodType","_ctrlBleed","_bloodVal","_ctrlFood","_ctrlThirst","_ctrlTemp","_ctrlEar","_ctrlEye","_ctrlFracture","_ctrlMuteBackground","_ctrlMuteIcon","_thirst","_food","_temp","_bloodLvl","_tempLvl","_bloodTestdone","_humanityTarget"];
disableSerialization;
private ["_combatVal","_ctrlCombatBorder","_ctrlCombat","_uiNumber","_bloodText","_blood","_bloodType","_rhFactor","_thirstLvl","_foodLvl","_tempImg","_tempText","_visual","_audible","_id","_rID","_color","_string","_humanity","_size","_friendlies","_rfriendlies","_rfriendlyTo","_distance","_targetControl","_flash","_foodVal","_thirstVal","_tempVal","_display","_ctrlBloodOuter","_ctrlFoodBorder","_ctrlThirstBorder","_ctrlTempBorder","_ctrlBlood","_ctrlBloodType","_ctrlBleed","_bloodVal","_ctrlFood","_ctrlThirst","_ctrlTemp","_ctrlEar","_ctrlEye","_ctrlFracture","_ctrlMuteBackground","_ctrlMuteIcon","_thirst","_food","_temp","_bloodLvl","_tempLvl","_bloodTestdone","_humanityTarget"];
_flash = {
if (ctrlShown _this) then {
@@ -9,17 +8,14 @@ _flash = {
};
};
disableSerialization;
_foodVal = 1 - (dayz_hunger / SleepFood);
_thirstVal = 1 - (dayz_thirst / SleepWater);
_tempVal = 1 - ((dayz_temperatur - dayz_temperaturmin)/(dayz_temperaturmax - dayz_temperaturmin)); // Normalise to [0,1]
if (uiNamespace getVariable ['DZ_displayUI', 0] == 1) exitWith {
_array = [_foodVal,_thirstVal];
_array
};
_display = uiNamespace getVariable 'DAYZ_GUI_display';
if (isNil "_display") exitWith { [_foodVal,_thirstVal] }; // not ready
if (isNil "_display") exitWith {}; // not ready
_ctrlBloodOuter = _display displayCtrl 1200;
_ctrlFoodBorder = _display displayCtrl 1201;
@@ -55,7 +51,10 @@ _ctrlFracture = _display displayCtrl 1203;
_ctrlMuteBackground = _display displayCtrl 1904;
_ctrlMuteIcon = _display displayCtrl 1204;
if (!dayz_soundMuted) then {
if (dayz_soundMuted) then {
_ctrlMuteBackground ctrlShow true;
_ctrlMuteIcon ctrlShow true;
} else {
_ctrlMuteBackground ctrlShow false;
_ctrlMuteIcon ctrlShow false;
};
@@ -302,7 +301,4 @@ if (dayz_humanitytarget != _string) then {
_targetControl = _display displayCtrl 1199;
_targetControl ctrlSetStructuredText (parseText _string);
dayz_humanitytarget = _string;
};
_array = [_foodVal,_thirstVal];
_array
};

View File

@@ -1,6 +1,4 @@
private ["_flash","_display","_ctrlBlood","_ctrlBleed","_bloodVal","_humanityName","_ctrlFood","_ctrlThirst","_thirstVal","_foodVal","_ctrlTemp","_tempVal","_combatVal","_array","_ctrlEar","_ctrlEye","_ctrlCombat","_ctrlFracture","_visualText","_visual","_audibleText","_audible","_blood","_thirstLvl","_foodLvl","_tempImg","_thirst","_food","_temp","_bloodLvl","_tempLvl","_color","_string","_humanity","_size","_friendlies","_id","_rID","_rfriendlies","_rfriendlyTo","_distance","_targetControl","_combattimeout","_timeleft"];
private ["_flash","_display","_ctrlBlood","_ctrlBleed","_bloodVal","_humanityName","_ctrlFood","_ctrlThirst","_thirstVal","_foodVal","_ctrlTemp","_tempVal","_combatVal","_ctrlEar","_ctrlEye","_ctrlCombat","_ctrlFracture","_visualText","_visual","_audibleText","_audible","_blood","_thirstLvl","_foodLvl","_tempImg","_thirst","_food","_temp","_bloodLvl","_tempLvl","_color","_string","_humanity","_size","_friendlies","_id","_rID","_rfriendlies","_rfriendlyTo","_distance","_targetControl","_combattimeout","_timeleft"];
_flash = {
if (ctrlShown _this) then {
@@ -16,11 +14,6 @@ _foodVal = 1 - (dayz_hunger / SleepFood);
_thirstVal = 1 - (dayz_thirst / SleepWater);
_tempVal = ((dayz_temperatur - dayz_temperaturmin)/(dayz_temperaturmax - dayz_temperaturmin)); // Normalise to [0,1]
if (uiNamespace getVariable ["DZ_displayUI", 0] == 1) exitWith {
_array = [_foodVal,_thirstVal];
_array
};
_combatVal = 0;
_combattimeout = player getVariable["combattimeout",0];
if (_combattimeout > 0) then {
@@ -33,7 +26,7 @@ _visual = (dayz_disVisual / 100);
_bloodVal = r_player_blood / r_player_bloodTotal;
_display = uiNamespace getVariable 'DAYZ_GUI_display';
if (isNil "_display") exitWith { [_foodVal,_thirstVal] }; // not ready
if (isNil "_display") exitWith {}; // not ready
_ctrlBlood = _display displayCtrl 1300;
_ctrlBleed = _display displayCtrl 1303;
@@ -48,7 +41,10 @@ _ctrlFracture = _display displayCtrl 1203;
_ctrlMuteBackground = _display displayCtrl 1904;
_ctrlMuteIcon = _display displayCtrl 1204;
if (!dayz_soundMuted) then {
if (dayz_soundMuted) then {
_ctrlMuteBackground ctrlShow true;
_ctrlMuteIcon ctrlShow true;
} else {
_ctrlMuteBackground ctrlShow false;
_ctrlMuteIcon ctrlShow false;
};
@@ -209,7 +205,4 @@ if (dayz_humanitytarget != _string) then {
_targetControl = _display displayCtrl 1199;
_targetControl ctrlSetStructuredText (parseText _string);
dayz_humanitytarget = _string;
};
_array = [_foodVal,_thirstVal];
_array
};

View File

@@ -1,6 +1,4 @@
private ["_flash","_display","_ctrlBlood","_ctrlBleed","_bloodVal","_humanityName","_ctrlFood","_ctrlThirst","_thirstVal","_foodVal","_ctrlTemp","_tempVal","_combatVal","_array","_ctrlEar","_ctrlEye","_ctrlCombat","_ctrlFracture","_visualText","_visual","_audibleText","_audible","_blood","_thirstLvl","_foodLvl","_tempImg","_thirst","_food","_temp","_bloodLvl","_tempLvl","_color","_string","_humanity","_size","_friendlies","_id","_rID","_rfriendlies","_rfriendlyTo","_distance","_targetControl"];
private ["_flash","_display","_ctrlBlood","_ctrlBleed","_bloodVal","_humanityName","_ctrlFood","_ctrlThirst","_thirstVal","_foodVal","_ctrlTemp","_tempVal","_combatVal","_ctrlEar","_ctrlEye","_ctrlCombat","_ctrlFracture","_visualText","_visual","_audibleText","_audible","_blood","_thirstLvl","_foodLvl","_tempImg","_thirst","_food","_temp","_bloodLvl","_tempLvl","_color","_string","_humanity","_size","_friendlies","_id","_rID","_rfriendlies","_rfriendlyTo","_distance","_targetControl"];
_flash = {
if (ctrlShown _this) then {
@@ -17,13 +15,8 @@ _thirstVal = 1 - (dayz_thirst / SleepWater);
_tempVal = 1 - ((dayz_temperatur - dayz_temperaturmin)/(dayz_temperaturmax - dayz_temperaturmin)); // Normalise to [0,1]
_combatVal = if (player getVariable["combattimeout",0] >= diag_tickTime) then {0} else {1};
if (uiNamespace getVariable ["DZ_displayUI", 0] == 1) exitWith {
_array = [_foodVal,_thirstVal];
_array
};
_display = uiNamespace getVariable 'DAYZ_GUI_display';
if (isNil "_display") exitWith { [_foodVal,_thirstVal] }; // not ready
if (isNil "_display") exitWith {}; // not ready
_ctrlBlood = _display displayCtrl 1300;
_ctrlBleed = _display displayCtrl 1303;
@@ -39,7 +32,10 @@ _ctrlFracture = _display displayCtrl 1203;
_ctrlMuteBackground = _display displayCtrl 1904;
_ctrlMuteIcon = _display displayCtrl 1204;
if (!dayz_soundMuted) then {
if (dayz_soundMuted) then {
_ctrlMuteBackground ctrlShow true;
_ctrlMuteIcon ctrlShow true;
} else {
_ctrlMuteBackground ctrlShow false;
_ctrlMuteIcon ctrlShow false;
};
@@ -233,7 +229,4 @@ if (dayz_humanitytarget != _string) then {
_targetControl = _display displayCtrl 1199;
_targetControl ctrlSetStructuredText (parseText _string);
dayz_humanitytarget = _string;
};
_array = [_foodVal,_thirstVal];
_array
};

View File

@@ -1,48 +1,11 @@
disableSerialization;
//_state = uiNamespace getVariable ['DZ_displayUI', 0];
// Hard code the GUI on and the Debug Monitor off
if (dayzState != 0) then {
if (toLower DZE_UI == "vanilla") then {
3 cutRsc ["playerStatusGUI", "PLAIN",0];
} else {
3 cutRsc ["playerStatusGUI_epoch", "PLAIN",0];
};
//Update GUI
if (profileNamespace getVariable ["statusUI",1] == 1) then {
3 cutRsc [if (toLower DZE_UI == "vanilla") then {"playerStatusGUI"} else {"playerStatusGUI_epoch"},"PLAIN",0];
call player_updateGui;
call ui_initDisplay;
hintSilent "";
};
dayzDebug = false;
/*
switch (_state) do {
case 0: {
if (dayzState != 0) then {
3 cutRsc ["playerStatusGUI", "PLAIN",0];
//Update GUI
call player_updateGui;
call ui_initDisplay;
hintSilent "";
};
dayzDebug = false;
};
case 1: {
if (dayzState != 1) then {
3 cutRsc ["playerStatusGUI", "PLAIN",0];
//Update GUI
call player_updateGui;
call ui_initDisplay;
};
dayzDebug = true;
};
case 2: {
if (dayzState != 2) then {
3 cutRsc ["default", "PLAIN",0];
hintSilent "";
};
dayzDebug = false;
};
};
dayzState = _state;
*/
} else {
3 cutRsc ["default","PLAIN",0];
hintSilent "";
};