diff --git a/KP-Cratefiller/KPCF/fnc/fn_createSubList.sqf b/KP-Cratefiller/KPCF/fnc/fn_createSubList.sqf index c5cc96b..0d18697 100644 --- a/KP-Cratefiller/KPCF/fnc/fn_createSubList.sqf +++ b/KP-Cratefiller/KPCF/fnc/fn_createSubList.sqf @@ -2,6 +2,8 @@ Killah Potatoes Cratefiller v1.1.0 Author: Dubjunk - https://github.com/KillahPotatoes + Edited by Mildly_Interested - https://github.com/MildlyInterested + License: GNU General Public License v3.0 - https://www.gnu.org/licenses/gpl-3.0.html Description: @@ -46,7 +48,15 @@ switch (_catIndex) do { private _glType = (getArray (configfile >> "CfgWeapons" >> _weaponType >> "muzzles")) select 1; private _magazines = [_weaponType] call CBA_fnc_compatibleMagazines; _magazines append ([configfile >> "CfgWeapons" >> _weaponType >> _glType] call CBA_fnc_compatibleMagazines); - private _sortedMagazines = [_magazines] call KPCF_fnc_sortList; + _magazines = _magazines - KPCF_blacklistedItems; + private "_filteredMagazines"; + if (!KPCF_generateLists) then { + _filteredMagazines = _magazines arrayIntersect KPCF_magazines; + } + else { + _filteredMagazines = _magazines; + }; + private _sortedMagazines = [_filteredMagazines] call KPCF_fnc_sortList; private _index = 0; @@ -63,7 +73,15 @@ switch (_catIndex) do { case 2 : { // Get compatible attachments private _attachments = [_weaponType] call BIS_fnc_compatibleItems; - private _sortedAttachments = [_attachments] call KPCF_fnc_sortList; + _attachments = _attachments - KPCF_blacklistedItems; + private "_filteredAttachments"; + if (!KPCF_generateLists) then { + _filteredAttachments = _attachments arrayIntersect KPCF_attachments; + } + else { + _filteredAttachments = _attachments; + }; + private _sortedAttachments = [_filteredAttachments] call KPCF_fnc_sortList; private _index = 0; @@ -76,3 +94,6 @@ switch (_catIndex) do { } forEach _sortedAttachments; }; }; + +// Select first entry +_ctrlEquipment lbSetCurSel 0; diff --git a/KP-Cratefiller/KPCF_config.sqf b/KP-Cratefiller/KPCF_config.sqf index 49e87b6..22a78a6 100644 --- a/KP-Cratefiller/KPCF_config.sqf +++ b/KP-Cratefiller/KPCF_config.sqf @@ -20,6 +20,7 @@ KPCF_cratefillerSpawn = "Land_HelipadCivil_F"; KPCF_canSpawnAndDelete = true; // If set to "true" the item lists will be generated from the config +// If set to "false" only items defined in KPCF_weapons and the folliwng lists will be available KPCF_generateLists = true; // These variable defines the range where inventories can be edited @@ -51,7 +52,7 @@ KPCF_whitelistedItems = [ "" ]; -// ----- These Variables will be replaced with activated generatedLists ----- +// ----- The following Variables will be replaced with activated generatedLists ----- // Defines the available weapons KPCF_weapons = [ @@ -59,6 +60,18 @@ KPCF_weapons = [ "MMG_01_tan_F" ]; +// Defines the available magazines +KPCF_magazines = [ + "Placeholder", + "Placeholder" +]; + +// Defines the available attachments +KPCF_attachments = [ + "Placeholder", + "Placeholder" +]; + // Defines the available grenades KPCF_grenades = [ "HandGrenade",