Cargo - Add config value to block renaming (#8610)

This commit is contained in:
PabstMirror 2021-10-25 18:27:56 -05:00 committed by GitHub
parent 2ff27d86fb
commit 5468f180f0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 10 additions and 2 deletions

View File

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

View File

@ -101,8 +101,7 @@ GVAR(objectActions) = [
{(_target getVariable [QGVAR(canLoad), getNumber (configOf _target >> QGVAR(canLoad))]) in [true, 1]} && {(_target getVariable [QGVAR(canLoad), getNumber (configOf _target >> QGVAR(canLoad))]) in [true, 1]} &&
{alive _target} && {alive _target} &&
{[_player, _target, ["isNotSwimming"]] call EFUNC(common,canInteractWith)} && {[_player, _target, ["isNotSwimming"]] call EFUNC(common,canInteractWith)} &&
{!((typeOf _target) in ["ACE_Wheel", "ACE_Track"])} && // Exclude Wheel and Track {(getNumber ((configOf _target) >> QGVAR(noRename))) == 0}
{!(_target iskindOf "Land_CanisterFuel_F")} // Exclude Fuel Canisters
} }
] call EFUNC(interact_menu,createAction), ] call EFUNC(interact_menu,createAction),
[QGVAR(load), localize LSTRING(loadObject), "a3\ui_f\data\IGUI\Cfg\Actions\loadVehicle_ca.paa", [QGVAR(load), localize LSTRING(loadObject), "a3\ui_f\data\IGUI\Cfg\Actions\loadVehicle_ca.paa",

View File

@ -18,6 +18,7 @@ class CfgVehicles {
EGVAR(dragging,dragDirection) = 0; EGVAR(dragging,dragDirection) = 0;
EGVAR(cargo,size) = 1; EGVAR(cargo,size) = 1;
EGVAR(cargo,canLoad) = 1; EGVAR(cargo,canLoad) = 1;
EGVAR(cargo,noRename) = 1;
hiddenSelections[] = {"camo"}; hiddenSelections[] = {"camo"};
hiddenSelectionsTextures[] = {QPATHTOEF(apl,data\bodybag_co.paa)}; hiddenSelectionsTextures[] = {QPATHTOEF(apl,data\bodybag_co.paa)};
class ACE_Actions { class ACE_Actions {

View File

@ -328,6 +328,7 @@ class CfgVehicles {
class ACE_Track: ACE_RepairItem_Base { class ACE_Track: ACE_RepairItem_Base {
EGVAR(cargo,size) = 2; EGVAR(cargo,size) = 2;
EGVAR(cargo,canLoad) = 1; EGVAR(cargo,canLoad) = 1;
EGVAR(cargo,noRename) = 1;
author = "Hawkins"; author = "Hawkins";
scope = 2; scope = 2;
model = QPATHTOF(data\ace_track.p3d); model = QPATHTOF(data\ace_track.p3d);
@ -358,6 +359,7 @@ class CfgVehicles {
class ACE_Wheel: ACE_RepairItem_Base { class ACE_Wheel: ACE_RepairItem_Base {
EGVAR(cargo,size) = 1; EGVAR(cargo,size) = 1;
EGVAR(cargo,canLoad) = 1; EGVAR(cargo,canLoad) = 1;
EGVAR(cargo,noRename) = 1;
author = "Hawkins"; author = "Hawkins";
scope = 2; scope = 2;
model = QPATHTOF(data\ace_wheel.p3d); model = QPATHTOF(data\ace_wheel.p3d);

View File

@ -32,6 +32,7 @@ class staticBananaLauncher {
class yourVehicleBaseClass { class yourVehicleBaseClass {
ace_cargo_size = 4; // Cargo space the object takes 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_canLoad = 1; // Enables the object to be loaded (1-yes, 0-no)
ace_cargo_noRename = 1; // Blocks renaming object (1-blocked, 0-allowed)
}; };
}; };
``` ```