Skip to content

Commit

Permalink
Merge pull request #801 from ColdEvul/saber-art-seletion
Browse files Browse the repository at this point in the history
Added ability to select barrel art and number
  • Loading branch information
AndreasBrostrom authored Oct 27, 2021
2 parents ca3c6f9 + d8811d4 commit 5456a04
Show file tree
Hide file tree
Showing 4 changed files with 118 additions and 2 deletions.
1 change: 1 addition & 0 deletions cScripts/CfgFunctions.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,7 @@ class cScripts {
class vehicle_addRegearAction {};
class vehicle_addRepairAction {};

class vehicle_addCosmeticSelection {};
class vehicle_addPylonSelection {};
class vehicle_setupPylonCategories {};

Expand Down
112 changes: 112 additions & 0 deletions cScripts/functions/vehicle/fn_vehicle_addCosmeticSelection.sqf
Original file line number Diff line number Diff line change
@@ -0,0 +1,112 @@
#include "..\script_component.hpp";
/*
* Author: CPL.Brostrom.A
* This function add cosmetic options to vehicles
*
* Arguments:
* 0: Vehicle <OBJECT>
*
* 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;
5 changes: 4 additions & 1 deletion cScripts/functions/vehicle/fn_vehicle_addStagingActions.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -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);
2 changes: 1 addition & 1 deletion tools/config.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@
"version": "DevBuild",
"notlist": ["doc", "tools", "release", "resourses", "Compositions", "mission.sqm"]
}
}
}

0 comments on commit 5456a04

Please sign in to comment.