Cargo - Add ability to disabled rename on object level (#8740)

* Rename can be disabled on object level

- Added ability to stop renaming on object level

_Needs testing_

* Fixed extra ()

* Forgot one of the )

* Update cargo-framework.md

Co-authored-by: PabstMirror <pabstmirror@gmail.com>
This commit is contained in:
Broström.A | Evul 2022-01-30 19:04:39 +01:00 committed by GitHub
parent f21a5e49d7
commit 00f35a3dae
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 9 additions and 3 deletions

View File

@ -101,7 +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)} &&
{(getNumber ((configOf _target) >> QGVAR(noRename))) == 0} {(_target getVariable [QGVAR(noRename), getNumber (configOf _target >> QGVAR(noRename))]) in [false, 0]}
} }
] 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

@ -28,8 +28,8 @@ class CfgVehicles {
### 1.2 Making an object loadable ### 1.2 Making an object loadable
```cpp ```cpp
class staticBananaLauncher { class CfgVehicles {
class yourVehicleBaseClass { class staticBananaLauncher {
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) ace_cargo_noRename = 1; // Blocks renaming object (1-blocked, 0-allowed)
@ -162,3 +162,9 @@ Note first arg can be a in-game object or a classname of an object type.
* ["ACE_Wheel", vehicle, 2] call ace_cargo_fnc_removeCargoItem * ["ACE_Wheel", vehicle, 2] call ace_cargo_fnc_removeCargoItem
* [crate_7, truck] call ace_cargo_fnc_removeCargoItem * [crate_7, truck] call ace_cargo_fnc_removeCargoItem
``` ```
### 4.7 Disable cargo renaming via script
```sqf
cargoBox setVariable ["ace_cargo_noRename", true]
```