From d7b8e5186e64b7e1c9d57a38d7c6e1b318d37f04 Mon Sep 17 00:00:00 2001 From: IndigoFox Date: Sat, 3 Feb 2024 22:55:21 -0800 Subject: [PATCH] tested local --- description.ext | 1 + .../vehicleFlags/fn_getActionsFlagCategories.sqf | 3 +++ functions/vehicleFlags/fn_initVehicleFlags.sqf | 16 ++-------------- functions/vehicleFlags/fn_isClassExcluded.sqf | 2 +- 4 files changed, 7 insertions(+), 15 deletions(-) diff --git a/description.ext b/description.ext index 9781ede..3bb5ba0 100644 --- a/description.ext +++ b/description.ext @@ -21,6 +21,7 @@ #include "defines\BattalionInfo.hpp" #include "defines\DisallowedEquipment.hpp" #include "defines\SupplyCrates.hpp" +#include "defines\VehicleFlags.hpp" //-------------------------------------------MISSION INFO-------------------------------------------------------------------- ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// diff --git a/functions/vehicleFlags/fn_getActionsFlagCategories.sqf b/functions/vehicleFlags/fn_getActionsFlagCategories.sqf index 640235d..1c9aabc 100644 --- a/functions/vehicleFlags/fn_getActionsFlagCategories.sqf +++ b/functions/vehicleFlags/fn_getActionsFlagCategories.sqf @@ -42,6 +42,9 @@ private _allCategoryActions = []; private _flagOptionTitle = getText(_flagOptionCfg >> "actionTitle"); private _flagOptionTexture = getText(_flagOptionCfg >> "texture"); + // if the texture doesn't exist at the config path, skip this flag option + if (not (fileExists _flagOptionTexture)) then {continue}; + // diag_log format ["NewFlagOption: %1 %2", _flagOptionID, _flagOptionData]; private _newFlagOption = [ diff --git a/functions/vehicleFlags/fn_initVehicleFlags.sqf b/functions/vehicleFlags/fn_initVehicleFlags.sqf index 2141de4..32f2952 100644 --- a/functions/vehicleFlags/fn_initVehicleFlags.sqf +++ b/functions/vehicleFlags/fn_initVehicleFlags.sqf @@ -6,18 +6,6 @@ if (!isClass _vehicleFlagsCfg) exitWith { ["WARNING: Vehicle Flags: Vehicle Flags config not found. Vehicle Flags will not be available."] call BIS_fnc_error; }; -// get texture pbo class -private _texturePboName = getText(_vehicleFlagsCfg >> "texturePBOName"); -if (_texturePboName == "") exitWith { - ["WARNING: Vehicle Flags: Texture PBO definition is missing or a blank string! Vehicle Flags will not be available."] call BIS_fnc_error; -}; -if (!isClass (configFile >> "CfgPatches" >> _texturePboName)) exitWith { - [ - "WARNING: Vehicle Flags: Texture PBO not found (%1). Vehicle Flags will not be available.", - _texturePboName - ] call BIS_fnc_error; -}; - private _baseClassesToApplyActionsFor = (_vehicleFlagsCfg >> "baseClassesToApplyActionsFor") call BIS_fnc_getCfgDataArray; private _flagCategoryCfgs = (_vehicleFlagsCfg >> "FlagCategories") call BIS_fnc_returnChildren; @@ -84,7 +72,7 @@ private _flagCategoryCfgs = (_vehicleFlagsCfg >> "FlagCategories") call BIS_fnc_ //////////////////////////////////////////////////////////////////////// // create action private _removeFlagAction = [ - _flagRootAction + "_removeflag", // id + _rootActionID + "_removeflag", // id "Remove Flag", // displayed title "\A3\ui_f\data\map\markers\flags\nato_ca.paa", // flag icon { @@ -103,7 +91,7 @@ private _flagCategoryCfgs = (_vehicleFlagsCfg >> "FlagCategories") call BIS_fnc_ [ (_this select 0), // object 0, // action 0 or self-action 1 - ["ACE_MainActions", _flagActionID], // parent + ["ACE_MainActions", _rootActionID], // parent _removeFlagAction // action ] call ace_interact_menu_fnc_addActionToObject; diff --git a/functions/vehicleFlags/fn_isClassExcluded.sqf b/functions/vehicleFlags/fn_isClassExcluded.sqf index 5d1b85d..223d6ae 100644 --- a/functions/vehicleFlags/fn_isClassExcluded.sqf +++ b/functions/vehicleFlags/fn_isClassExcluded.sqf @@ -10,7 +10,7 @@ if (!hasInterface) exitWith {}; -params ["_className", "", [""]]; +params [["_className", "", [""]]]; if (_className == "") exitWith {false}; private _vehicleFlagsCfg = call milsim_vehicleFlags_fnc_getVehicleFlagsCfg;