Skip to content

Commit

Permalink
Cargo - Add config value to block renaming (#8610)
Browse files Browse the repository at this point in the history
  • Loading branch information
PabstMirror authored Oct 25, 2021
1 parent 2ff27d8 commit 5468f18
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 2 deletions.
5 changes: 5 additions & 0 deletions addons/cargo/CfgVehicles.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -426,6 +426,7 @@ class CfgVehicles {
class Land_CanisterFuel_F: Items_base_F {
GVAR(size) = 1;
GVAR(canLoad) = 1;
EGVAR(cargo,noRename) = 1;
};

// Flexible Fuel tanks, 300L
Expand All @@ -438,6 +439,7 @@ class CfgVehicles {
class RoadCone_F: ThingX {
GVAR(size) = 1;
GVAR(canLoad) = 1;
EGVAR(cargo,noRename) = 1;
};
class RoadBarrier_F: RoadCone_F {
GVAR(size) = 2;
Expand All @@ -447,15 +449,18 @@ class CfgVehicles {
class Land_PortableLight_single_F: Lamps_base_F {
GVAR(size) = 2;
GVAR(canLoad) = 1;
EGVAR(cargo,noRename) = 1;
};
class FloatingStructure_F;
class Land_Camping_Light_F: FloatingStructure_F {
GVAR(size) = 0.2;
GVAR(canLoad) = 1;
EGVAR(cargo,noRename) = 1;
};
class Land_Camping_Light_off_F: ThingX {
GVAR(size) = 0.2;
GVAR(canLoad) = 1;
EGVAR(cargo,noRename) = 1;
};


Expand Down
3 changes: 1 addition & 2 deletions addons/cargo/XEH_postInit.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -101,8 +101,7 @@ GVAR(objectActions) = [
{(_target getVariable [QGVAR(canLoad), getNumber (configOf _target >> QGVAR(canLoad))]) in [true, 1]} &&
{alive _target} &&
{[_player, _target, ["isNotSwimming"]] call EFUNC(common,canInteractWith)} &&
{!((typeOf _target) in ["ACE_Wheel", "ACE_Track"])} && // Exclude Wheel and Track
{!(_target iskindOf "Land_CanisterFuel_F")} // Exclude Fuel Canisters
{(getNumber ((configOf _target) >> QGVAR(noRename))) == 0}
}
] call EFUNC(interact_menu,createAction),
[QGVAR(load), localize LSTRING(loadObject), "a3\ui_f\data\IGUI\Cfg\Actions\loadVehicle_ca.paa",
Expand Down
1 change: 1 addition & 0 deletions addons/medical_treatment/CfgVehicles.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ class CfgVehicles {
EGVAR(dragging,dragDirection) = 0;
EGVAR(cargo,size) = 1;
EGVAR(cargo,canLoad) = 1;
EGVAR(cargo,noRename) = 1;
hiddenSelections[] = {"camo"};
hiddenSelectionsTextures[] = {QPATHTOEF(apl,data\bodybag_co.paa)};
class ACE_Actions {
Expand Down
2 changes: 2 additions & 0 deletions addons/repair/CfgVehicles.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -328,6 +328,7 @@ class CfgVehicles {
class ACE_Track: ACE_RepairItem_Base {
EGVAR(cargo,size) = 2;
EGVAR(cargo,canLoad) = 1;
EGVAR(cargo,noRename) = 1;
author = "Hawkins";
scope = 2;
model = QPATHTOF(data\ace_track.p3d);
Expand Down Expand Up @@ -358,6 +359,7 @@ class CfgVehicles {
class ACE_Wheel: ACE_RepairItem_Base {
EGVAR(cargo,size) = 1;
EGVAR(cargo,canLoad) = 1;
EGVAR(cargo,noRename) = 1;
author = "Hawkins";
scope = 2;
model = QPATHTOF(data\ace_wheel.p3d);
Expand Down
1 change: 1 addition & 0 deletions docs/wiki/framework/cargo-framework.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ class staticBananaLauncher {
class yourVehicleBaseClass {
ace_cargo_size = 4; // Cargo space the object takes
ace_cargo_canLoad = 1; // Enables the object to be loaded (1-yes, 0-no)
ace_cargo_noRename = 1; // Blocks renaming object (1-blocked, 0-allowed)
};
};
```
Expand Down

0 comments on commit 5468f18

Please sign in to comment.