Skip to content

Commit

Permalink
send updated pretty, use ace dlc check
Browse files Browse the repository at this point in the history
  • Loading branch information
BrettMayson committed Jan 5, 2025
1 parent dece0c2 commit 51f02d8
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 86 deletions.
74 changes: 1 addition & 73 deletions arma/client/addons/common/functions/fnc_isDLCOwned.sqf
Original file line number Diff line number Diff line change
@@ -1,80 +1,8 @@
// Original from https://steamcommunity.com/sharedfiles/filedetails/?id=1978434625
// Used under APL-SA License
// Thanks POLPOX <3

#include "script_component.hpp"

params ["_class"];

private _dlcList = [
["_f_contact\","Enoch"],
["_f_enoch\","Enoch"],
["_f_exp\","Expansion"],
["_f_heli\","Heli"],
["_f_jets\","Jets"],
["_f_kart\","Kart"],
["_f_mark\","Mark"],
["_f_orange\","Orange"],
["_f_tacops\","Tacops"],
["_f_tank\","Tank"]
];
private _whitelist = [
"weapons_f_tank",
"suitpack_scientist_02"
];
private _config = configNull;
{
_config = configFile >> _x >> _class;
if (isClass _config) exitWith {};
} forEach ["CfgWeapons","CfgVehicles","CfgGlasses"];
if (isNull _config) exitWith {
INFO_1("DLC CHECK: %1 not found",_class);
true
};

if (getNumber (_config >> "itemInfo" >> "type") == 801) then {
_config = configFile >> "CfgVehicles" >> getText (_config >> "itemInfo" >> "uniformClass")
};

private _return = call {
private _addon = (configSourceAddonList (_config));
private _mod = configSourceMODList (configFile >> "CfgPatches" >> _addon select 0);
if (count _mod > 0) then {
_mod = _mod select 0;
if (modParams [_mod,["defaultMod"]] select 0) exitWith {
_mod = ""
};
} else {
_mod = ""
};
_mod
};
{
if ((_x select 0) in toLower getText (_config >> "model")) exitWith {
_return = _x select 1;
{
if (_x in toLower getText (_config >> "model")) exitWith {
_return = "";
};
} forEach _whiteList;
};
} forEach _dlcList;

private _id = switch (_return) do {
case "Enoch": { 1021790 };
case "Expansion": { 3951810 };
case "Heli": { 304380 };
case "Jets": { 601670 };
case "Kart": { 288520 };
case "Mark": { 332350 };
case "Orange": { 288520 };
case "Tacops": { 744950 };
case "Tank": { 798390 };
case "WS": { 1681170 };
case "RF": { 2647760 };
case "EF": { 2647830 };
default { 0 };
};
([_class] call ace_common_fnc_getDLC) params ["", "_id"];

if (_id == 0) exitWith {true};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ if (_company != 0) then {
};

private _tooltip = if (GVAR(readOnly)) then {
format ["%1\nPrice: %2\nCompany: %3", _raw_class, _personal, _company]
format ["%1\n%2", _cost]
} else {
private _owned = [_raw_class] call FUNC(shop_item_owned);
if (_owned > 0) then {
Expand Down
22 changes: 11 additions & 11 deletions arma/client/addons/gear/functions/fnc_shop_ext.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -9,17 +9,17 @@ switch (_func) do {
case "items:set": {
(parseSimpleArray _data) params ["_class", "_entry", "_pretty"];
GVAR(shop_items_importing) set [_class, _entry];
if (isNil "_pretty") then {
private _pretty = getText (configFile >> "CfgWeapons" >> _class >> "displayName");
if (_pretty == "") then {
_pretty = getText (configFile >> "CfgVehicles" >> _class >> "displayName");
};
if (_pretty == "") then {
_pretty = getText (configFile >> "CfgMagazines" >> _class >> "displayName");
};
if (_pretty != "") then {
EXTCALL("gear:shop:pretty",[ARR_2(_class,_pretty)]);
};

private _newPretty = getText (configFile >> "CfgWeapons" >> _class >> "displayName");
if (_newPretty == "") then {
_newPretty = getText (configFile >> "CfgVehicles" >> _class >> "displayName");
};
if (_newPretty == "") then {
_newPretty = getText (configFile >> "CfgMagazines" >> _class >> "displayName");
};
if (_newPretty != "") then {
if (_pretty == _newPretty) exitWith {};
EXTCALL("gear:shop:pretty",[ARR_2(_class,_newPretty)]);
};
};
case "items:publish": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ private _invalid = [];
{
private _need = _y - ([_x] call FUNC(shop_item_owned));
if (_need > 0) then {
if (([_x] call FUNC(shop_item_price))#0 == -1) exitWith {
if (([_x] call FUNC(shop_item_price))#0 < 0) exitWith {
_invalid pushBack _x;
};
};
Expand Down

0 comments on commit 51f02d8

Please sign in to comment.