From 7c0ab485b81c2c6713e921bd5edab6e009b6527a Mon Sep 17 00:00:00 2001 From: AndreasBrostrom Date: Mon, 1 Jul 2024 12:15:36 +0200 Subject: [PATCH 1/2] Improved, removed and updated cScripts settings --- .../functions/gear/fn_gear_applyCosmetics.sqf | 28 +++++------ cScripts/initSettings.inc.sqf | 48 +++---------------- 2 files changed, 19 insertions(+), 57 deletions(-) diff --git a/cScripts/functions/gear/fn_gear_applyCosmetics.sqf b/cScripts/functions/gear/fn_gear_applyCosmetics.sqf index 0e08201f7..6aca89918 100644 --- a/cScripts/functions/gear/fn_gear_applyCosmetics.sqf +++ b/cScripts/functions/gear/fn_gear_applyCosmetics.sqf @@ -21,11 +21,9 @@ if (!isNil{GETVAR(player,EGVAR(Unit,Name),nil)}) then { }; // Player Rank to ingame rank -if (EGVAR(Settings,setPlayerRank)) then { - if (!isNil{GETVAR(player,EGVAR(Unit,Rank),nil)}) then { - private _rank = [player] call EFUNC(player,getRank); - SETVAR(player,EGVAR(Unit,Rank),_rank); - }; +if (!isNil{GETVAR(player,EGVAR(Unit,Rank),nil)}) then { + private _rank = [player] call EFUNC(player,getRank); + SETVAR(player,EGVAR(Unit,Rank),_rank); }; // Team Color @@ -34,14 +32,12 @@ if (!isNil{GETVAR(player,EGVAR(Unit,TeamColor),nil)}) then { }; // Apply squad insignia -if (EGVAR(Settings,allowInsigniaApplication)) then { - private _insignia = if (call EFUNC(profile,loadInsignia) != "") then { - call EFUNC(profile,loadInsignia); - } else { - call EFUNC(unit,getSquadInsignia); - }; - [{ - params ["_insignia"]; - [player, _insignia, false] call EFUNC(unit,setInsignia); - }, [_insignia], 2] call CBA_fnc_waitAndExecute; -}; \ No newline at end of file +private _insignia = if (QEGVAR(Settings,allowProfileSavedInsignia) && (call EFUNC(profile,loadInsignia) != "")) then { + call EFUNC(profile,loadInsignia); +} else { + call EFUNC(unit,getSquadInsignia); +}; +[{ + params ["_insignia"]; + [player, _insignia, false] call EFUNC(unit,setInsignia); +}, [_insignia], 2] call CBA_fnc_waitAndExecute; \ No newline at end of file diff --git a/cScripts/initSettings.inc.sqf b/cScripts/initSettings.inc.sqf index 240531abe..2cb96e956 100644 --- a/cScripts/initSettings.inc.sqf +++ b/cScripts/initSettings.inc.sqf @@ -1,16 +1,6 @@ private _cScriptSettings = "cScripts Mission Settings"; // 1; Mission -[ // Mission Type - QEGVAR(Settings,setMissionType), - "LIST", - ["Mission Type", "This will deside on what kind of startup hint you get on mission start."], - [_cScriptSettings, "1; Mission"], - [[0,1,2,3], ["Custom", "Operation", "Training", "Public"], 1], - true, - {}, - true -] call CBA_fnc_addSetting; [ // Ai setting QEGVAR(Settings,setAiSystemDifficulty), "LIST", @@ -76,16 +66,6 @@ private _cScriptSettings = "cScripts Mission Settings"; {}, true ] call CBA_fnc_addSetting; -[ // Rank - QEGVAR(Settings,setPlayerRank), - "CHECKBOX", - ["Rank","Allow mission to apply arma rank based on name rank prefixes."], - [_cScriptSettings, "3; Player"], - true, - true, - {}, - true -] call CBA_fnc_addSetting; [ // Tagging QEGVAR(Settings,allowCustomTagging), "CHECKBOX", @@ -97,27 +77,16 @@ private _cScriptSettings = "cScripts Mission Settings"; true ] call CBA_fnc_addSetting; [ // Insignia - QEGVAR(Settings,allowInsigniaApplication), - "CHECKBOX", - ["Insignia","Automaticly apply insignias based on squad name."], - [_cScriptSettings, "3; Player"], - true, - true, - {}, - true -] call CBA_fnc_addSetting; -[ // Apply Earplugs - QEGVAR(Settings,addEarplugs), + QEGVAR(Settings,allowProfileSavedInsignia), "CHECKBOX", - ["Apply Earplugs","Automaticly apply earplugs to players on spawn and respawn."], + ["Insignia","Automaticly apply insignia saved on your user profile."], [_cScriptSettings, "3; Player"], true, - true, + false, {}, - true + false ] call CBA_fnc_addSetting; - // 4; Staging [ // Enable QEGVAR(Settings,enableStagingSystem), @@ -127,7 +96,7 @@ private _cScriptSettings = "cScripts Mission Settings"; true, true, {}, - false + true ] call CBA_fnc_addSetting; [ // Show all loadouts QEGVAR(Settings,showAllLoadouts), @@ -136,10 +105,7 @@ private _cScriptSettings = "cScripts Mission Settings"; [_cScriptSettings, "4; Staging"], false, true, - { - params ["_value"]; - { EGVAR(Staging,showAllLoadouts) = _value; } remoteExecCall ["call"]; - }, + {}, false ] call CBA_fnc_addSetting; [ // Use Filtered Arsenal @@ -278,7 +244,7 @@ private _cScriptSettings = "cScripts Mission Settings"; [[0,1,2], ["None", "Basic", "Advanced"], 2], true, {}, - true + false ] call CBA_fnc_addSetting; [ // Include Night Vision Googles QEGVAR(Settings,jumpSimulationNVG), From ff1e12070842d41c4036a9fbf9df9c10e7ed139f Mon Sep 17 00:00:00 2001 From: AndreasBrostrom Date: Mon, 1 Jul 2024 12:22:13 +0200 Subject: [PATCH 2/2] Fixed saving --- cScripts/functions/gear/fn_gear_applyFunctions.sqf | 10 ++++------ cScripts/functions/players/fn_unit_setInsignia.sqf | 1 + 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/cScripts/functions/gear/fn_gear_applyFunctions.sqf b/cScripts/functions/gear/fn_gear_applyFunctions.sqf index 61725ceda..4e38dfc35 100644 --- a/cScripts/functions/gear/fn_gear_applyFunctions.sqf +++ b/cScripts/functions/gear/fn_gear_applyFunctions.sqf @@ -29,12 +29,10 @@ if (EGVAR(Settings,enableRadios)) then { // Earplugs -if (EGVAR(Settings,addEarplugs)) then { - if !([player] call ace_hearing_fnc_hasEarPlugsIn) then { - [{ - [_this select 0] call ace_hearing_fnc_putInEarplugs; - }, [player]] call CBA_fnc_execNextFrame; - }; +if !([player] call ace_hearing_fnc_hasEarPlugsIn) then { + [{ + [_this select 0] call ace_hearing_fnc_putInEarplugs; + }, [player]] call CBA_fnc_execNextFrame; }; diff --git a/cScripts/functions/players/fn_unit_setInsignia.sqf b/cScripts/functions/players/fn_unit_setInsignia.sqf index 058c0c7c2..b8b4c7e75 100644 --- a/cScripts/functions/players/fn_unit_setInsignia.sqf +++ b/cScripts/functions/players/fn_unit_setInsignia.sqf @@ -26,5 +26,6 @@ params [ if (!isPlayer _unit) exitWith {}; if (!_save) exitWith {}; +if (!QEGVAR(Settings,allowProfileSavedInsignia)) exitWith {}; [_insignia] call EFUNC(profile,saveInsignia); \ No newline at end of file