From 4a957d6253efcf4904e22e85139d08614025d057 Mon Sep 17 00:00:00 2001 From: Thatguy553 Date: Sun, 30 Oct 2022 02:19:23 -0400 Subject: [PATCH 1/4] Update setUnitLoadout to CBA_fnc_setLoadout - Updated open_arsenal.sqf and redeploy_manager.sqf to use CBA_fnc_setLoadout. - Created config file bool variable to allow easy change of CBA_fnc_setLoadout's third param to refill mags. --- Missionframework/kp_liberation_config.sqf | 1 + Missionframework/scripts/client/actions/open_arsenal.sqf | 2 +- Missionframework/scripts/client/spawn/redeploy_manager.sqf | 2 +- 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/Missionframework/kp_liberation_config.sqf b/Missionframework/kp_liberation_config.sqf index 0c993250b..3496d9b15 100644 --- a/Missionframework/kp_liberation_config.sqf +++ b/Missionframework/kp_liberation_config.sqf @@ -2,6 +2,7 @@ CONFIG FILE FOR KP LIBERATION https://github.com/KillahPotatoes/KP-Liberation */ +KP_liberation_fill_mags = true; // Vehicle classnames which also function as ACE medical vehicles. KP_liberation_medical_vehicles = [ diff --git a/Missionframework/scripts/client/actions/open_arsenal.sqf b/Missionframework/scripts/client/actions/open_arsenal.sqf index 225a5e43a..79a7d5f5c 100644 --- a/Missionframework/scripts/client/actions/open_arsenal.sqf +++ b/Missionframework/scripts/client/actions/open_arsenal.sqf @@ -83,7 +83,7 @@ while { dialog && (alive player) && edit_loadout == 0 } do { if ( load_loadout > 0 ) then { private _loaded_loadout = _loadouts_data select (lbCurSel 201); if (KP_liberation_ace && KP_liberation_arsenal_type) then { - player setUnitLoadout (_loaded_loadout select 1); + [player, _loaded_loadout select 1, KP_liberation_fill_mags] call CBA_fnc_setLoadout; } else { [player, [profileNamespace, _loaded_loadout]] call BIS_fnc_loadInventory; }; diff --git a/Missionframework/scripts/client/spawn/redeploy_manager.sqf b/Missionframework/scripts/client/spawn/redeploy_manager.sqf index 1a09817ce..26a6d24c7 100644 --- a/Missionframework/scripts/client/spawn/redeploy_manager.sqf +++ b/Missionframework/scripts/client/spawn/redeploy_manager.sqf @@ -192,7 +192,7 @@ while {true} do { if ((lbCurSel 203) > 0) then { private _selectedLoadout = _loadouts_data select ((lbCurSel 203) - 1); if (KP_liberation_ace && KP_liberation_arsenal_type) then { - player setUnitLoadout (_selectedLoadout select 1); + [player, _selectedLoadout select 1, KP_liberation_fill_mags] call CBA_fnc_setLoadout; } else { [player, [profileNamespace, _selectedLoadout]] call BIS_fnc_loadInventory; }; From a2fa9c4d92b202d8edcbe5c3bd995e4d18c53e6c Mon Sep 17 00:00:00 2001 From: some-evil-kitty <106408180+some-evil-kitty@users.noreply.github.com> Date: Sat, 21 Oct 2023 12:33:11 -0400 Subject: [PATCH 2/4] docblocked --- Missionframework/kp_liberation_config.sqf | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Missionframework/kp_liberation_config.sqf b/Missionframework/kp_liberation_config.sqf index 3496d9b15..83d7ec016 100644 --- a/Missionframework/kp_liberation_config.sqf +++ b/Missionframework/kp_liberation_config.sqf @@ -2,6 +2,8 @@ CONFIG FILE FOR KP LIBERATION https://github.com/KillahPotatoes/KP-Liberation */ + +// Fill magazines on loading loadout? KP_liberation_fill_mags = true; // Vehicle classnames which also function as ACE medical vehicles. From 560384adcbfbba2382f563e461194f1a9a78570c Mon Sep 17 00:00:00 2001 From: some-evil-kitty <106408180+some-evil-kitty@users.noreply.github.com> Date: Sun, 19 Nov 2023 14:42:51 -0500 Subject: [PATCH 3/4] Docblocked second time --- Missionframework/KPLIB_config.sqf | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Missionframework/KPLIB_config.sqf b/Missionframework/KPLIB_config.sqf index 009636e26..bae114c53 100644 --- a/Missionframework/KPLIB_config.sqf +++ b/Missionframework/KPLIB_config.sqf @@ -363,3 +363,6 @@ KPLIB_battlegroup_clearance = [ // Delay after death for wrecks and corpses to be deleted KPLIB_cleanup_delay = 1200; + +// Fill magazines on loading loadout? +KP_liberation_fill_mags = true; From 26ddd1ed6a14feb5d1135999214de4d27b4627f3 Mon Sep 17 00:00:00 2001 From: some-evil-kitty <106408180+some-evil-kitty@users.noreply.github.com> Date: Sun, 19 Nov 2023 15:09:47 -0500 Subject: [PATCH 4/4] Conflict resolving resolving conflictsu --- .../scripts/client/actions/open_arsenal.sqf | 20 +++---- .../scripts/client/spawn/redeploy_manager.sqf | 52 ++++++++++--------- 2 files changed, 38 insertions(+), 34 deletions(-) diff --git a/Missionframework/scripts/client/actions/open_arsenal.sqf b/Missionframework/scripts/client/actions/open_arsenal.sqf index 79a7d5f5c..afd3af105 100644 --- a/Missionframework/scripts/client/actions/open_arsenal.sqf +++ b/Missionframework/scripts/client/actions/open_arsenal.sqf @@ -1,4 +1,6 @@ -if (KPLIB_directArsenal) exitWith { +scriptName "open_arsenal"; + +if (KPLIB_param_directArsenal) exitWith { if (KP_liberation_ace && KP_liberation_arsenal_type) then { [player, player, false] call ace_arsenal_fnc_openBox; } else { @@ -17,7 +19,7 @@ private _backpack = backpack player; private ["_loadouts_data"]; // Get loadouts either from ACE or BI arsenals -if (KP_liberation_ace && KP_liberation_arsenal_type) then { +if (KPLIB_ace && KPLIB_param_arsenalType) then { _loadouts_data = +(profileNamespace getVariable ["ace_arsenal_saved_loadouts", []]); } else { private _saved_loadouts = +(profileNamespace getVariable "bis_fnc_saveInventory_data"); @@ -82,13 +84,13 @@ while { dialog && (alive player) && edit_loadout == 0 } do { if ( load_loadout > 0 ) then { private _loaded_loadout = _loadouts_data select (lbCurSel 201); - if (KP_liberation_ace && KP_liberation_arsenal_type) then { - [player, _loaded_loadout select 1, KP_liberation_fill_mags] call CBA_fnc_setLoadout; + if (KPLIB_ace && KPLIB_param_arsenalType) then { + [player, _loaded_loadout select 1, KP_liberation_fill_mags] call CBA_fnc_setLoadout; } else { [player, [profileNamespace, _loaded_loadout]] call BIS_fnc_loadInventory; }; - if (KP_liberation_arsenalUsePreset) then { + if (KPLIB_param_useArsenalPreset) then { if ([_backpack] call KPLIB_fnc_checkGear) then { hint format [ localize "STR_HINT_LOADOUT_LOADED", _loaded_loadout param [0]]; }; @@ -103,7 +105,7 @@ while { dialog && (alive player) && edit_loadout == 0 } do { }; if ( respawn_loadout > 0 ) then { - GRLIB_respawn_loadout = [ player, ["repetitive"] ] call KPLIB_fnc_getLoadout; + KPLIB_respawn_loadout = [ player, ["repetitive"] ] call KPLIB_fnc_getLoadout; hint localize "STR_MAKE_RESPAWN_LOADOUT_HINT"; respawn_loadout = 0; }; @@ -123,15 +125,15 @@ while { dialog && (alive player) && edit_loadout == 0 } do { if ( edit_loadout > 0 ) then { closeDialog 0; waitUntil { !dialog }; - if (KP_liberation_ace && KP_liberation_arsenal_type) then { + if (KPLIB_ace && KPLIB_param_arsenalType) then { [player, player, false] call ace_arsenal_fnc_openBox; } else { [ "Open", false ] spawn BIS_fnc_arsenal; }; - if (KP_liberation_arsenalUsePreset) then { + if (KPLIB_param_useArsenalPreset) then { uiSleep 5; - private _arsenalDisplay = ["RSCDisplayArsenal", "ace_arsenal_display"] select (KP_liberation_ace && KP_liberation_arsenal_type); + private _arsenalDisplay = ["RSCDisplayArsenal", "ace_arsenal_display"] select (KPLIB_ace && KPLIB_param_arsenalType); waitUntil {sleep 1; isNull (uinamespace getvariable [_arsenalDisplay, displayNull])}; [_backpack] call KPLIB_fnc_checkGear; }; diff --git a/Missionframework/scripts/client/spawn/redeploy_manager.sqf b/Missionframework/scripts/client/spawn/redeploy_manager.sqf index 26a6d24c7..346db2d3b 100644 --- a/Missionframework/scripts/client/spawn/redeploy_manager.sqf +++ b/Missionframework/scripts/client/spawn/redeploy_manager.sqf @@ -1,3 +1,5 @@ +scriptName "redeploy_manager"; + #define DEPLOY_DISPLAY (findDisplay 5201) #define DEPLOY_LIST_IDC 201 #define DEPLOY_BUTTON_IDC 202 @@ -9,12 +11,12 @@ private _oldsel = -999; private _standard_map_pos = []; private _frame_pos = []; -GRLIB_force_redeploy = false; +KPLIB_force_redeploy = false; -waitUntil {!isNil "GRLIB_all_fobs"}; -waitUntil {!isNil "blufor_sectors"}; -waitUntil {!isNil "save_is_loaded"}; -waitUntil {save_is_loaded}; +waitUntil {!isNil "KPLIB_sectors_fob"}; +waitUntil {!isNil "KPLIB_sectors_player"}; +waitUntil {!isNil "KPLIB_saveLoaded"}; +waitUntil {KPLIB_saveLoaded}; private _spawn_str = ""; @@ -25,13 +27,13 @@ waitUntil {cinematic_camera_stop}; private _basenamestr = "Operation Base"; -KP_liberation_respawn_time = time; -KP_liberation_respawn_mobile_done = false; +KPLIB_respawn_time = time; +KPLIB_respawn_mobile_done = false; while {true} do { waitUntil { sleep 0.2; - (GRLIB_force_redeploy || (player distance (markerPos GRLIB_respawn_marker) < 50)) && vehicle player == player && alive player && !dialog && howtoplay == 0 + (KPLIB_force_redeploy || (player distance (markerPos KPLIB_respawn_marker) < 50)) && vehicle player == player && alive player && !dialog && howtoplay == 0 }; private _backpack = backpack player; @@ -39,7 +41,7 @@ while {true} do { fullmap = 0; _old_fullmap = 0; - GRLIB_force_redeploy = false; + KPLIB_force_redeploy = false; createDialog "liberation_deploy"; deploy = 0; @@ -67,7 +69,7 @@ while {true} do { // Get loadouts either from ACE or BI arsenals private ["_loadouts_data"]; - if (KP_liberation_ace && KP_liberation_arsenal_type) then { + if (KPLIB_ace && KPLIB_param_arsenalType) then { _loadouts_data = +(profileNamespace getVariable ["ace_arsenal_saved_loadouts", []]); } else { private _saved_loadouts = +(profileNamespace getVariable "bis_fnc_saveInventory_data"); @@ -93,14 +95,14 @@ while {true} do { { KPLIB_respawnPositionsList pushBack [ - format ["FOB %1 - %2", (military_alphabet select _forEachIndex), mapGridPosition _x], + format ["FOB %1 - %2", (KPLIB_militaryAlphabet select _forEachIndex), mapGridPosition _x], _x ]; - } forEach GRLIB_all_fobs; + } forEach KPLIB_sectors_fob; - if (KP_liberation_mobilerespawn) then { - if (KP_liberation_respawn_time <= time) then { - private _mobileRespawns = [] call KPLIB_fnc_getMobileRespawns; + if (KPLIB_param_mobileRespawn) then { + if (KPLIB_respawn_time <= time) then { + private _respawn_trucks = [] call KPLIB_fnc_getMobileRespawns; { KPLIB_respawnPositionsList pushBack [ @@ -108,7 +110,7 @@ while {true} do { getPosATL _x, _x ]; - } forEach _mobileRespawns + } forEach _respawn_trucks }; }; @@ -138,7 +140,7 @@ while {true} do { _alti = 30; }; // Disable if sector is under attack - if (!KPLIB_respawnOnAttackedSectors && {_objectpos in KPLIB_sectorsUnderAttack}) then { + if (!KPLIB_param_attackedFobRespawn && {_objectpos in KPLIB_sectorsUnderAttack}) then { (DEPLOY_DISPLAY displayCtrl DEPLOY_BUTTON_IDC) ctrlSetText localize "STR_DEPLOY_UNDERATTACK"; (DEPLOY_DISPLAY displayCtrl DEPLOY_BUTTON_IDC) ctrlEnable false; } else { @@ -183,7 +185,7 @@ while {true} do { if (count (KPLIB_respawnPositionsList select _idxchoice) == 3) then { private _truck = (KPLIB_respawnPositionsList select _idxchoice) select 2; player setposATL (_truck getPos [5 + (random 3), random 360]); - KP_liberation_respawn_mobile_done = true; + KPLIB_respawn_mobile_done = true; } else { private _destpos = ((KPLIB_respawnPositionsList select _idxchoice) select 1); player setposATL [((_destpos select 0) + 5) - (random 10),((_destpos select 1) + 5) - (random 10),(_destpos select 2)]; @@ -191,7 +193,7 @@ while {true} do { if ((lbCurSel 203) > 0) then { private _selectedLoadout = _loadouts_data select ((lbCurSel 203) - 1); - if (KP_liberation_ace && KP_liberation_arsenal_type) then { + if (KPLIB_ace && KPLIB_param_arsenalType) then { [player, _selectedLoadout select 1, KP_liberation_fill_mags] call CBA_fnc_setLoadout; } else { [player, [profileNamespace, _selectedLoadout]] call BIS_fnc_loadInventory; @@ -211,18 +213,18 @@ while {true} do { if (alive player && deploy == 1) then { [_spawn_str] spawn spawn_camera; - if (KP_liberation_respawn_mobile_done) then { - KP_liberation_respawn_time = time + KP_liberation_respawn_cooldown; - KP_liberation_respawn_mobile_done = false; + if (KPLIB_respawn_mobile_done) then { + KPLIB_respawn_time = time + KPLIB_param_mobileRespawnCooldown; + KPLIB_respawn_mobile_done = false; }; }; - if (KP_liberation_arsenalUsePreset) then { + if (KPLIB_param_useArsenalPreset) then { [_backpack] call KPLIB_fnc_checkGear; }; - if (KP_liberation_mobilerespawn && (KP_liberation_respawn_time > time)) then { - hint format [localize "STR_RESPAWN_COOLDOWN_HINT", ceil ((KP_liberation_respawn_time - time) / 60)]; + if (KPLIB_param_mobileRespawn && (KPLIB_respawn_time > time)) then { + hint format [localize "STR_RESPAWN_COOLDOWN_HINT", ceil ((KPLIB_respawn_time - time) / 60)]; uiSleep 12; hint ""; };