Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 23 additions & 2 deletions KP-Cratefiller/KPCF/fnc/fn_createSubList.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -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;

Expand All @@ -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;

Expand All @@ -76,3 +94,6 @@ switch (_catIndex) do {
} forEach _sortedAttachments;
};
};

// Select first entry
_ctrlEquipment lbSetCurSel 0;
15 changes: 14 additions & 1 deletion KP-Cratefiller/KPCF_config.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -51,14 +52,26 @@ 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 = [
"arifle_SPAR_01_snd_F",
"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",
Expand Down