diff --git a/cScripts/CfgFunctions.hpp b/cScripts/CfgFunctions.hpp index 9d82a07d4..29e4b0378 100644 --- a/cScripts/CfgFunctions.hpp +++ b/cScripts/CfgFunctions.hpp @@ -147,6 +147,7 @@ class cScripts { class vehicle_addRegearAction {}; class vehicle_addRepairAction {}; + class vehicle_addCosmeticSelection {}; class vehicle_addPylonSelection {}; class vehicle_setupPylonCategories {}; diff --git a/cScripts/functions/vehicle/fn_vehicle_addCosmeticSelection.sqf b/cScripts/functions/vehicle/fn_vehicle_addCosmeticSelection.sqf new file mode 100644 index 000000000..1ecbaabdb --- /dev/null +++ b/cScripts/functions/vehicle/fn_vehicle_addCosmeticSelection.sqf @@ -0,0 +1,112 @@ +#include "..\script_component.hpp"; +/* + * Author: CPL.Brostrom.A + * This function add cosmetic options to vehicles + * + * Arguments: + * 0: Vehicle + * + * Return Value: + * Nothing + * + * Example: + * ["truckMcTruckLoad"] call cScripts_fnc_vehicle_addCosmeticSelection + * + * Public: No + */ + +params [["_vehicle", objNull, [objNull]]]; + +private _textures = [ + ["rhsusf_m1a1tank_base", "Saber-1 (120mm IV)", [ + "\z\cav\addons\textures\data\vehicles\abrams\BarrelArt_120mmIV_ca.paa", + { + _vehicle setObjectTextureGlobal [11, "\rhsusf\addons\RHSUSF_Decals\Data\Labels\ArmyPlt_Abrams_D\1_ca.paa"]; + _vehicle setObjectTextureGlobal [12, "\z\cav\addons\textures\data\vehicles\abrams\BarrelArt_120mmIV_ca.paa"]; + _vehicle setVariable [QEGVAR(Vehicle,Callsign), 1]; + } + ]], + ["rhsusf_m1a1tank_base", "Saber-2 (Bounty Hunters)", [ + "\z\cav\addons\textures\data\vehicles\abrams\BarrelArt_BountyHunters_ca.paa", + { + _vehicle setObjectTextureGlobal [11, "\rhsusf\addons\RHSUSF_Decals\Data\Labels\ArmyPlt_Abrams_D\2_ca.paa"]; + _vehicle setObjectTextureGlobal [12, "\z\cav\addons\textures\data\vehicles\abrams\BarrelArt_BountyHunters_ca.paa"]; + _vehicle setVariable [QEGVAR(Vehicle,Callsign), 2]; + } + ]], + ["rhsusf_m1a1tank_base", "Saber-3 (Iron Clad Lads)", [ + "\z\cav\addons\textures\data\vehicles\abrams\BarrelArt_IronCladLads_ca.paa", + { + _vehicle setObjectTextureGlobal [11, "\rhsusf\addons\RHSUSF_Decals\Data\Labels\ArmyPlt_Abrams_D\3_ca.paa"]; + _vehicle setObjectTextureGlobal [12, "\z\cav\addons\textures\data\vehicles\abrams\BarrelArt_IronCladLads_ca.paa"]; + _vehicle setVariable [QEGVAR(Vehicle,Callsign), 3]; + } + ]], + ["rhsusf_m1a1tank_base", "Saber-4 (War Saw)", [ + "\z\cav\addons\textures\data\vehicles\abrams\BarrelArt_WarSaw_ca.paa", + { + _vehicle setObjectTextureGlobal [11, "\rhsusf\addons\RHSUSF_Decals\Data\Labels\ArmyPlt_Abrams_D\4_ca.paa"]; + _vehicle setObjectTextureGlobal [12, "\z\cav\addons\textures\data\vehicles\abrams\BarrelArt_WarSaw_ca.paa"]; + _vehicle setVariable [QEGVAR(Vehicle,Callsign), 4]; + } + ]], + ["rhsusf_m1a1tank_base", "Saber-1", [ + "\rhsusf\addons\RHSUSF_Decals\Data\Labels\ArmyPlt_Abrams_D\1_ca.paa", + { + _vehicle setObjectTextureGlobal [11, "\rhsusf\addons\RHSUSF_Decals\Data\Labels\ArmyPlt_Abrams_D\1_ca.paa"]; + _vehicle setObjectTextureGlobal [12, ""]; + _vehicle setVariable [QEGVAR(Vehicle,Callsign), -1]; + } + ]], + ["rhsusf_m1a1tank_base", "Saber-2", [ + "\rhsusf\addons\RHSUSF_Decals\Data\Labels\ArmyPlt_Abrams_D\2_ca.paa", + { + _vehicle setObjectTextureGlobal [11, "\rhsusf\addons\RHSUSF_Decals\Data\Labels\ArmyPlt_Abrams_D\2_ca.paa"]; + _vehicle setObjectTextureGlobal [12, ""]; + _vehicle setVariable [QEGVAR(Vehicle,Callsign), -2]; + } + ]], + ["rhsusf_m1a1tank_base", "Saber-3", [ + "\rhsusf\addons\RHSUSF_Decals\Data\Labels\ArmyPlt_Abrams_D\3_ca.paa", + { + _vehicle setObjectTextureGlobal [11, "\rhsusf\addons\RHSUSF_Decals\Data\Labels\ArmyPlt_Abrams_D\3_ca.paa"]; + _vehicle setObjectTextureGlobal [12, ""]; + _vehicle setVariable [QEGVAR(Vehicle,Callsign), -3]; + } + ]], + ["rhsusf_m1a1tank_base", "Saber-4", [ + "\rhsusf\addons\RHSUSF_Decals\Data\Labels\ArmyPlt_Abrams_D\4_ca.paa", + { + _vehicle setObjectTextureGlobal [11, "\rhsusf\addons\RHSUSF_Decals\Data\Labels\ArmyPlt_Abrams_D\4_ca.paa"]; + _vehicle setObjectTextureGlobal [12, ""]; + _vehicle setVariable [QEGVAR(Vehicle,Callsign), -4]; + } + ]] +]; + +{ + _x params ["_classname", "_displayName", "_textureCode"]; + if (_vehicle isKindOf _classname) then { + + private _statement = { + params ["_vehicle", "_player", "_params"]; + _params params [["_texture", "", [""]], ["_code", {}, [{}]]]; + + call _code; + [ + [], + ["Vehicle art have been changed"], + [_texture, 10], + [""] + ] call CBA_fnc_notify; + }; + + private _category = ["ACE_SelfActions", QEGVAR(Actions_Vehicle,Main_Cat), QEGVAR(Actions_Vehicle,Cosmetic_Cat)]; + private _action = [format ["cScripts_Cosmetic_%1_%2", _classname, _forEachIndex], _displayName, "", _statement, {true}, nil, _textureCode] call ace_interact_menu_fnc_createAction; + [_vehicle, 1, _category, _action] call ace_interact_menu_fnc_addActionToObject; + + #ifdef DEBUG_MODE + [format["Selector for classname '%1' named '%2' added to %3 (%4)", typeOf _vehicle, _displayName, _vehicle, typeOf _vehicle], "Vehicle Cosmetic Selector"] call FUNC(info); + #endif + }; +} foreach _textures; diff --git a/cScripts/functions/vehicle/fn_vehicle_addStagingActions.sqf b/cScripts/functions/vehicle/fn_vehicle_addStagingActions.sqf index 2ce76af4d..afd5dec0a 100644 --- a/cScripts/functions/vehicle/fn_vehicle_addStagingActions.sqf +++ b/cScripts/functions/vehicle/fn_vehicle_addStagingActions.sqf @@ -26,7 +26,10 @@ private _condition = { call FUNC(checkStagingZone) }; private _stagingCat = [QEGVAR(Actions_Vehicle,Main_Cat), "Vehicle Staging Zone", "cScripts\Data\Icon\icon_00.paa", {true}, _condition] call ace_interact_menu_fnc_createAction; [_vehicle, 1, ["ACE_SelfActions"], _stagingCat] call ace_interact_menu_fnc_addActionToObject; +private _stagingCat = [QEGVAR(Actions_Vehicle,Cosmetic_Cat), "Vehicle Cosmetics", "cScripts\Data\Icon\icon_00.paa", {true}, {true}] call ace_interact_menu_fnc_createAction; +[_vehicle, 1, ["ACE_SelfActions", QEGVAR(Actions_Vehicle,Main_Cat)], _stagingCat] call ace_interact_menu_fnc_addActionToObject; + [_vehicle] call EFUNC(vehicle,addRegearAction); [_vehicle] call EFUNC(vehicle,addRepairAction); - +[_vehicle] call EFUNC(vehicle,addCosmeticSelection); //_vehicle call EFUNC(vehicle,setupPylonSelection); \ No newline at end of file diff --git a/tools/config.json b/tools/config.json index 755ff6327..fc900313e 100644 --- a/tools/config.json +++ b/tools/config.json @@ -4,4 +4,4 @@ "version": "DevBuild", "notlist": ["doc", "tools", "release", "resourses", "Compositions", "mission.sqm"] } -} \ No newline at end of file +}