Compare commits
No commits in common. "6282080cb46503dfa1ea92abd614b3c7d4b2a4b8" and "4f54edf467fad9c1a90ed5db9dbd4af7f472541f" have entirely different histories.
6282080cb4
...
4f54edf467
@ -42,16 +42,12 @@ class CfgStore {
|
|||||||
patches[] = {"rhs_main", "rhsusf_main"};
|
patches[] = {"rhs_main", "rhsusf_main"};
|
||||||
addons[] = {"rhs_", "rhsusf_", "rhsgref_", "rhsafrf_"};
|
addons[] = {"rhs_", "rhsusf_", "rhsgref_", "rhsafrf_"};
|
||||||
prefixes[] = {"rhs_", "rhsusf_", "rhsgref_", "rhsafrf_"};
|
prefixes[] = {"rhs_", "rhsusf_", "rhsgref_", "rhsafrf_"};
|
||||||
contains[] = {"rhs_", "rhsusf_", "rhsgref_", "rhsafrf_"};
|
|
||||||
dlcs[] = {};
|
|
||||||
};
|
};
|
||||||
|
|
||||||
class ace3 {
|
class ace3 {
|
||||||
patches[] = {"ace_main"};
|
patches[] = {"ace_main"};
|
||||||
addons[] = {"ace_"};
|
addons[] = {"ace_"};
|
||||||
prefixes[] = {"ace_"};
|
prefixes[] = {"ace_"};
|
||||||
contains[] = {"ace_"};
|
|
||||||
dlcs[] = {};
|
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -80,11 +76,9 @@ uses the same prices and descriptions the UI displays.
|
|||||||
filtering. `allowlist` only keeps generated entries that match one of the
|
filtering. `allowlist` only keeps generated entries that match one of the
|
||||||
configured `mods[]`; `denylist` removes matching entries. Each `ModSources`
|
configured `mods[]`; `denylist` removes matching entries. Each `ModSources`
|
||||||
child can define `patches[]` to detect whether the mod is loaded, `addons[]`
|
child can define `patches[]` to detect whether the mod is loaded, `addons[]`
|
||||||
for exact config source addon/source mod names, `prefixes[]` for classname,
|
for exact config source addon/source mod names, and `prefixes[]` for classname,
|
||||||
source addon, or source mod prefixes, `contains[]` for classname/source
|
source addon, or source mod prefixes. If a mod source defines no patches, it is
|
||||||
metadata tokens that can appear anywhere, and `dlcs[]` for DLC/source/author
|
treated as available and only the source/prefix checks are used.
|
||||||
labels used by Creator DLC content. If a mod source defines no patches, it is
|
|
||||||
treated as available and only the source/prefix/contains/DLC checks are used.
|
|
||||||
|
|
||||||
`units[]` follows the same `dynamic`, `allowlist`, and `denylist` behavior as
|
`units[]` follows the same `dynamic`, `allowlist`, and `denylist` behavior as
|
||||||
item and vehicle categories. Unit purchases are immediate spawn grants, not
|
item and vehicle categories. Unit purchases are immediate spawn grants, not
|
||||||
|
|||||||
@ -87,30 +87,6 @@ GVAR(StoreCatalogServiceBaseClass) = compileFinal createHashMapFromArray [
|
|||||||
|
|
||||||
_loaded
|
_loaded
|
||||||
}],
|
}],
|
||||||
["describeMissionStoreModSources", compileFinal {
|
|
||||||
params [["_mods", [], [[]]]];
|
|
||||||
|
|
||||||
_mods apply {
|
|
||||||
private _modID = _x;
|
|
||||||
private _patches = _self call ["getMissionStoreModSourceValues", [_modID, "patches"]];
|
|
||||||
private _addons = _self call ["getMissionStoreModSourceValues", [_modID, "addons"]];
|
|
||||||
private _prefixes = _self call ["getMissionStoreModSourceValues", [_modID, "prefixes"]];
|
|
||||||
private _contains = _self call ["getMissionStoreModSourceValues", [_modID, "contains"]];
|
|
||||||
private _dlcs = _self call ["getMissionStoreModSourceValues", [_modID, "dlcs"]];
|
|
||||||
private _loaded = _self call ["isMissionStoreModLoaded", [_modID]];
|
|
||||||
|
|
||||||
format [
|
|
||||||
"%1 loaded=%2 patches=%3 addons=%4 prefixes=%5 contains=%6 dlcs=%7",
|
|
||||||
_modID,
|
|
||||||
_loaded,
|
|
||||||
_patches,
|
|
||||||
_addons,
|
|
||||||
_prefixes,
|
|
||||||
_contains,
|
|
||||||
_dlcs
|
|
||||||
]
|
|
||||||
}
|
|
||||||
}],
|
|
||||||
["doesValueMatchAnyPrefix", compileFinal {
|
["doesValueMatchAnyPrefix", compileFinal {
|
||||||
params [["_value", "", [""]], ["_prefixes", [], [[]]]];
|
params [["_value", "", [""]], ["_prefixes", [], [[]]]];
|
||||||
|
|
||||||
@ -124,19 +100,6 @@ GVAR(StoreCatalogServiceBaseClass) = compileFinal createHashMapFromArray [
|
|||||||
|
|
||||||
_matches
|
_matches
|
||||||
}],
|
}],
|
||||||
["doesValueContainAnyToken", compileFinal {
|
|
||||||
params [["_value", "", [""]], ["_tokens", [], [[]]]];
|
|
||||||
|
|
||||||
private _normalizedValue = toLowerANSI _value;
|
|
||||||
private _matches = false;
|
|
||||||
{
|
|
||||||
private _token = toLowerANSI _x;
|
|
||||||
if (_token isEqualTo "") then { continue; };
|
|
||||||
if ((_normalizedValue find _token) >= 0) exitWith { _matches = true; };
|
|
||||||
} forEach _tokens;
|
|
||||||
|
|
||||||
_matches
|
|
||||||
}],
|
|
||||||
["doesItemMatchMissionStoreMod", compileFinal {
|
["doesItemMatchMissionStoreMod", compileFinal {
|
||||||
params [["_item", createHashMap, [createHashMap]], ["_modID", "", [""]]];
|
params [["_item", createHashMap, [createHashMap]], ["_modID", "", [""]]];
|
||||||
|
|
||||||
@ -146,35 +109,20 @@ GVAR(StoreCatalogServiceBaseClass) = compileFinal createHashMapFromArray [
|
|||||||
private _className = _item getOrDefault ["className", ""];
|
private _className = _item getOrDefault ["className", ""];
|
||||||
private _sourceAddons = (_item getOrDefault ["sourceAddons", []]) apply { toLowerANSI _x };
|
private _sourceAddons = (_item getOrDefault ["sourceAddons", []]) apply { toLowerANSI _x };
|
||||||
private _sourceMod = _item getOrDefault ["sourceMod", ""];
|
private _sourceMod = _item getOrDefault ["sourceMod", ""];
|
||||||
private _sourceDLC = _item getOrDefault ["sourceDLC", ""];
|
|
||||||
private _sourceAuthor = _item getOrDefault ["sourceAuthor", ""];
|
|
||||||
private _addons = (_self call ["getMissionStoreModSourceValues", [_modID, "addons"]]) apply { toLowerANSI _x };
|
private _addons = (_self call ["getMissionStoreModSourceValues", [_modID, "addons"]]) apply { toLowerANSI _x };
|
||||||
private _prefixes = (_self call ["getMissionStoreModSourceValues", [_modID, "prefixes"]]) apply { toLowerANSI _x };
|
private _prefixes = (_self call ["getMissionStoreModSourceValues", [_modID, "prefixes"]]) apply { toLowerANSI _x };
|
||||||
private _contains = (_self call ["getMissionStoreModSourceValues", [_modID, "contains"]]) apply { toLowerANSI _x };
|
|
||||||
private _dlcs = (_self call ["getMissionStoreModSourceValues", [_modID, "dlcs"]]) apply { toLowerANSI _x };
|
|
||||||
private _matchPrefixes = _addons + _prefixes;
|
private _matchPrefixes = _addons + _prefixes;
|
||||||
private _sourceModLower = toLowerANSI _sourceMod;
|
private _sourceModLower = toLowerANSI _sourceMod;
|
||||||
private _sourceDLCLower = toLowerANSI _sourceDLC;
|
|
||||||
private _sourceAuthorLower = toLowerANSI _sourceAuthor;
|
|
||||||
|
|
||||||
if (_sourceModLower in _addons) exitWith { true };
|
if (_sourceModLower in _addons) exitWith { true };
|
||||||
if (_sourceDLCLower in _dlcs) exitWith { true };
|
|
||||||
if (_sourceAuthorLower in _dlcs) exitWith { true };
|
|
||||||
private _sourceAddonMatched = false;
|
private _sourceAddonMatched = false;
|
||||||
{
|
{
|
||||||
if (_x in _addons) exitWith { _sourceAddonMatched = true; };
|
if (_x in _addons) exitWith { _sourceAddonMatched = true; };
|
||||||
if (_self call ["doesValueMatchAnyPrefix", [_x, _matchPrefixes]]) exitWith { _sourceAddonMatched = true; };
|
if (_self call ["doesValueMatchAnyPrefix", [_x, _matchPrefixes]]) exitWith { _sourceAddonMatched = true; };
|
||||||
if (_self call ["doesValueContainAnyToken", [_x, _contains]]) exitWith { _sourceAddonMatched = true; };
|
|
||||||
} forEach _sourceAddons;
|
} forEach _sourceAddons;
|
||||||
if (_sourceAddonMatched) exitWith { true };
|
if (_sourceAddonMatched) exitWith { true };
|
||||||
if (_self call ["doesValueMatchAnyPrefix", [_className, _matchPrefixes]]) exitWith { true };
|
if (_self call ["doesValueMatchAnyPrefix", [_className, _matchPrefixes]]) exitWith { true };
|
||||||
if (_self call ["doesValueContainAnyToken", [_className, _contains]]) exitWith { true };
|
|
||||||
if (_self call ["doesValueMatchAnyPrefix", [_sourceMod, _matchPrefixes]]) exitWith { true };
|
if (_self call ["doesValueMatchAnyPrefix", [_sourceMod, _matchPrefixes]]) exitWith { true };
|
||||||
if (_self call ["doesValueContainAnyToken", [_sourceMod, _contains]]) exitWith { true };
|
|
||||||
if (_self call ["doesValueMatchAnyPrefix", [_sourceDLC, _dlcs]]) exitWith { true };
|
|
||||||
if (_self call ["doesValueContainAnyToken", [_sourceDLC, _contains]]) exitWith { true };
|
|
||||||
if (_self call ["doesValueMatchAnyPrefix", [_sourceAuthor, _dlcs]]) exitWith { true };
|
|
||||||
if (_self call ["doesValueContainAnyToken", [_sourceAuthor, _contains]]) exitWith { true };
|
|
||||||
|
|
||||||
false
|
false
|
||||||
}],
|
}],
|
||||||
@ -193,18 +141,9 @@ GVAR(StoreCatalogServiceBaseClass) = compileFinal createHashMapFromArray [
|
|||||||
|
|
||||||
private _mode = _self call ["getMissionStoreModMode", []];
|
private _mode = _self call ["getMissionStoreModMode", []];
|
||||||
private _mods = _self call ["getMissionStoreModList", []];
|
private _mods = _self call ["getMissionStoreModList", []];
|
||||||
private _beforeCount = count _items;
|
if (_mode isEqualTo "dynamic" || { _mods isEqualTo [] }) exitWith { +_items };
|
||||||
if (_mode isEqualTo "dynamic" || { _mods isEqualTo [] }) exitWith {
|
|
||||||
["INFO", format [
|
|
||||||
"Store mod filter skipped. Mode=%1 Mods=%2 Items=%3",
|
|
||||||
_mode,
|
|
||||||
_mods,
|
|
||||||
_beforeCount
|
|
||||||
]] call EFUNC(common,log);
|
|
||||||
+_items
|
|
||||||
};
|
|
||||||
|
|
||||||
private _filteredItems = switch (_mode) do {
|
switch (_mode) do {
|
||||||
case "allowlist": {
|
case "allowlist": {
|
||||||
_items select { _self call ["doesItemMatchMissionStoreMods", [_x, _mods]] }
|
_items select { _self call ["doesItemMatchMissionStoreMods", [_x, _mods]] }
|
||||||
};
|
};
|
||||||
@ -214,18 +153,7 @@ GVAR(StoreCatalogServiceBaseClass) = compileFinal createHashMapFromArray [
|
|||||||
default {
|
default {
|
||||||
+_items
|
+_items
|
||||||
};
|
};
|
||||||
};
|
}
|
||||||
|
|
||||||
["INFO", format [
|
|
||||||
"Store mod filter applied. Mode=%1 Mods=%2 Items=%3 -> %4 Sources=[%5]",
|
|
||||||
_mode,
|
|
||||||
_mods,
|
|
||||||
_beforeCount,
|
|
||||||
count _filteredItems,
|
|
||||||
(_self call ["describeMissionStoreModSources", [_mods]]) joinString "; "
|
|
||||||
]] call EFUNC(common,log);
|
|
||||||
|
|
||||||
_filteredItems
|
|
||||||
}],
|
}],
|
||||||
["getMissionStoreCategoryList", compileFinal {
|
["getMissionStoreCategoryList", compileFinal {
|
||||||
params [["_category", "", [""]]];
|
params [["_category", "", [""]]];
|
||||||
@ -376,8 +304,6 @@ GVAR(StoreCatalogServiceBaseClass) = compileFinal createHashMapFromArray [
|
|||||||
private _displayName = getText (_cfg >> "displayName");
|
private _displayName = getText (_cfg >> "displayName");
|
||||||
private _sourceAddons = configSourceAddonList _cfg;
|
private _sourceAddons = configSourceAddonList _cfg;
|
||||||
private _sourceMod = configSourceMod _cfg;
|
private _sourceMod = configSourceMod _cfg;
|
||||||
private _sourceDLC = getText (_cfg >> "DLC");
|
|
||||||
private _sourceAuthor = getText (_cfg >> "author");
|
|
||||||
private _picture = getText (_cfg >> _imageField);
|
private _picture = getText (_cfg >> _imageField);
|
||||||
if (_picture isEqualTo "" && { _imageField isNotEqualTo "picture" }) then {
|
if (_picture isEqualTo "" && { _imageField isNotEqualTo "picture" }) then {
|
||||||
_picture = getText (_cfg >> "picture");
|
_picture = getText (_cfg >> "picture");
|
||||||
@ -395,25 +321,17 @@ GVAR(StoreCatalogServiceBaseClass) = compileFinal createHashMapFromArray [
|
|||||||
["image", _picture],
|
["image", _picture],
|
||||||
["type", _typeLabel],
|
["type", _typeLabel],
|
||||||
["sourceAddons", _sourceAddons],
|
["sourceAddons", _sourceAddons],
|
||||||
["sourceMod", _sourceMod],
|
["sourceMod", _sourceMod]
|
||||||
["sourceDLC", _sourceDLC],
|
|
||||||
["sourceAuthor", _sourceAuthor]
|
|
||||||
]
|
]
|
||||||
}],
|
}],
|
||||||
["appendCfgWeaponsByItemInfoType", compileFinal {
|
["appendCfgWeaponsByItemInfoType", compileFinal {
|
||||||
params [["_items", [], [[]]], ["_itemInfoType", -1, [0]], ["_itemKind", "", [""]], ["_typeLabel", "", [""]], ["_fallbackDescription", "", [""]]];
|
params [["_items", [], [[]]], ["_itemInfoType", -1, [0]], ["_typeLabel", "", [""]], ["_fallbackDescription", "", [""]]];
|
||||||
|
|
||||||
{
|
{
|
||||||
private _cfg = _x;
|
private _cfg = _x;
|
||||||
private _className = configName _cfg;
|
|
||||||
private _itemType = [_className] call BIS_fnc_itemType;
|
|
||||||
private _kind = _itemType param [1, ""];
|
|
||||||
if (
|
if (
|
||||||
_self call ["isVisibleConfig", [_cfg]]
|
_self call ["isVisibleConfig", [_cfg]]
|
||||||
&& {
|
&& { getNumber (_cfg >> "ItemInfo" >> "type") isEqualTo _itemInfoType }
|
||||||
(getNumber (_cfg >> "ItemInfo" >> "type") isEqualTo _itemInfoType)
|
|
||||||
|| { _kind isEqualTo _itemKind }
|
|
||||||
}
|
|
||||||
) then {
|
) then {
|
||||||
_items pushBack (_self call ["buildCatalogItem", [_cfg, _typeLabel, _fallbackDescription]]);
|
_items pushBack (_self call ["buildCatalogItem", [_cfg, _typeLabel, _fallbackDescription]]);
|
||||||
};
|
};
|
||||||
@ -548,9 +466,9 @@ GVAR(StoreCatalogServiceBaseClass) = compileFinal createHashMapFromArray [
|
|||||||
private _items = [];
|
private _items = [];
|
||||||
|
|
||||||
switch (_categoryKey) do {
|
switch (_categoryKey) do {
|
||||||
case "uniforms": { _items = _self call ["appendCfgWeaponsByItemInfoType", [_items, TYPE_UNIFORM, "Uniform", "Uniform", "Live uniform entry generated from the game inventory."]]; };
|
case "uniforms": { _items = _self call ["appendCfgWeaponsByItemInfoType", [_items, TYPE_UNIFORM, "Uniform", "Live uniform entry generated from the game inventory."]]; };
|
||||||
case "headgear": { _items = _self call ["appendCfgWeaponsByItemInfoType", [_items, TYPE_HEADGEAR, "Headgear", "Headgear", "Live headgear entry generated from the game inventory."]]; };
|
case "headgear": { _items = _self call ["appendCfgWeaponsByItemInfoType", [_items, TYPE_HEADGEAR, "Headgear", "Live headgear entry generated from the game inventory."]]; };
|
||||||
case "vests": { _items = _self call ["appendCfgWeaponsByItemInfoType", [_items, TYPE_VEST, "Vest", "Vest", "Live vest entry generated from the game inventory."]]; };
|
case "vests": { _items = _self call ["appendCfgWeaponsByItemInfoType", [_items, TYPE_VEST, "Vest", "Live vest entry generated from the game inventory."]]; };
|
||||||
case "backpacks": { _items = _self call ["appendCfgBackpacks", [_items, "Backpack", "Live backpack entry generated from the game inventory."]]; };
|
case "backpacks": { _items = _self call ["appendCfgBackpacks", [_items, "Backpack", "Live backpack entry generated from the game inventory."]]; };
|
||||||
case "attachments": {
|
case "attachments": {
|
||||||
_items = _self call ["appendCfgAttachments", [_items, "Live attachment entry generated from the game inventory."]];
|
_items = _self call ["appendCfgAttachments", [_items, "Live attachment entry generated from the game inventory."]];
|
||||||
|
|||||||
@ -42,16 +42,12 @@ class CfgStore {
|
|||||||
patches[] = {"rhs_main", "rhsusf_main"};
|
patches[] = {"rhs_main", "rhsusf_main"};
|
||||||
addons[] = {"rhs_", "rhsusf_", "rhsgref_", "rhsafrf_"};
|
addons[] = {"rhs_", "rhsusf_", "rhsgref_", "rhsafrf_"};
|
||||||
prefixes[] = {"rhs_", "rhsusf_", "rhsgref_", "rhsafrf_"};
|
prefixes[] = {"rhs_", "rhsusf_", "rhsgref_", "rhsafrf_"};
|
||||||
contains[] = {"rhs_", "rhsusf_", "rhsgref_", "rhsafrf_"};
|
|
||||||
dlcs[] = {};
|
|
||||||
};
|
};
|
||||||
|
|
||||||
class ace3 {
|
class ace3 {
|
||||||
patches[] = {"ace_main"};
|
patches[] = {"ace_main"};
|
||||||
addons[] = {"ace_"};
|
addons[] = {"ace_"};
|
||||||
prefixes[] = {"ace_"};
|
prefixes[] = {"ace_"};
|
||||||
contains[] = {"ace_"};
|
|
||||||
dlcs[] = {};
|
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -80,11 +76,9 @@ server-side and are used by both the UI payload and checkout validation.
|
|||||||
filtering. `allowlist` only keeps generated entries that match one of the
|
filtering. `allowlist` only keeps generated entries that match one of the
|
||||||
configured `mods[]`; `denylist` removes matching entries. Each `ModSources`
|
configured `mods[]`; `denylist` removes matching entries. Each `ModSources`
|
||||||
child can define `patches[]` to detect whether the mod is loaded, `addons[]`
|
child can define `patches[]` to detect whether the mod is loaded, `addons[]`
|
||||||
for exact config source addon/source mod names, `prefixes[]` for classname,
|
for exact config source addon/source mod names, and `prefixes[]` for classname,
|
||||||
source addon, or source mod prefixes, `contains[]` for classname/source
|
source addon, or source mod prefixes. If a mod source defines no patches, it is
|
||||||
metadata tokens that can appear anywhere, and `dlcs[]` for DLC/source/author
|
treated as available and only the source/prefix checks are used.
|
||||||
labels used by Creator DLC content. If a mod source defines no patches, it is
|
|
||||||
treated as available and only the source/prefix/contains/DLC checks are used.
|
|
||||||
|
|
||||||
For example, to show only RHS-sourced generated inventory:
|
For example, to show only RHS-sourced generated inventory:
|
||||||
|
|
||||||
@ -97,18 +91,6 @@ The matching `class rhs` must exist under `ModSources`. Category `mode` is still
|
|||||||
applied afterward, so leave `mode = "dynamic"` if the mod filter should be the
|
applied afterward, so leave `mode = "dynamic"` if the mod filter should be the
|
||||||
only inventory filter.
|
only inventory filter.
|
||||||
|
|
||||||
For Creator DLCs such as RF or WS, prefer both prefixes and DLC labels:
|
|
||||||
|
|
||||||
```cpp
|
|
||||||
class rf {
|
|
||||||
patches[] = {};
|
|
||||||
addons[] = {"lxrf_", "rf_"};
|
|
||||||
prefixes[] = {"lxrf_", "rf_"};
|
|
||||||
contains[] = {"lxrf", "_rf_", "_rf", "rf_"};
|
|
||||||
dlcs[] = {"rf", "reactionforces", "reaction forces"};
|
|
||||||
};
|
|
||||||
```
|
|
||||||
|
|
||||||
The current filter is global for the mission. Revisit per-store profile support
|
The current filter is global for the mission. Revisit per-store profile support
|
||||||
if individual vendors need different inventories.
|
if individual vendors need different inventories.
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user