Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cargo - Add config value to block renaming #8610

Merged
merged 1 commit into from
Oct 25, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions addons/cargo/CfgVehicles.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -426,12 +426,14 @@ class CfgVehicles {
class Land_CanisterFuel_F: Items_base_F {
GVAR(size) = 1;
GVAR(canLoad) = 1;
EGVAR(cargo,noRename) = 1;
};

// objects
class RoadCone_F: ThingX {
GVAR(size) = 1;
GVAR(canLoad) = 1;
EGVAR(cargo,noRename) = 1;
};
class RoadBarrier_F: RoadCone_F {
GVAR(size) = 2;
Expand All @@ -441,15 +443,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