mirror of
https://github.com/acemod/ACE3.git
synced 2024-08-30 18:23:18 +00:00
Add makeLoadable sync module
This commit is contained in:
parent
3d4fc66bb1
commit
1a98726716
@ -1,5 +1,9 @@
|
|||||||
class CfgVehicles {
|
class CfgVehicles {
|
||||||
class ACE_Module;
|
class Logic;
|
||||||
|
class Module_F: Logic {
|
||||||
|
class ModuleDescription;
|
||||||
|
};
|
||||||
|
class ACE_Module: Module_F {};
|
||||||
class ACE_moduleCargoSettings: ACE_Module {
|
class ACE_moduleCargoSettings: ACE_Module {
|
||||||
scope = 2;
|
scope = 2;
|
||||||
displayName = CSTRING(SettingsModule_DisplayName);
|
displayName = CSTRING(SettingsModule_DisplayName);
|
||||||
@ -26,6 +30,33 @@ class CfgVehicles {
|
|||||||
sync[] = {};
|
sync[] = {};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
class GVAR(makeLoadable): ACE_Module {
|
||||||
|
scope = 2;
|
||||||
|
displayName = CSTRING(makeLoadable_displayName);
|
||||||
|
icon = QUOTE(PATHTOF(UI\Icon_Module_makeLoadable_ca.paa));
|
||||||
|
category = "ACE_Logistics";
|
||||||
|
function = QFUNC(moduleMakeLoadable);
|
||||||
|
isGlobal = 1;
|
||||||
|
isTriggerActivated = 0;
|
||||||
|
author = ECSTRING(common,ACETeam);
|
||||||
|
class Arguments {
|
||||||
|
class canLoad {
|
||||||
|
displayName = CSTRING(makeLoadable_displayName);
|
||||||
|
description = CSTRING(MakeLoadable_description);
|
||||||
|
typeName = "BOOL";
|
||||||
|
defaultValue = 1;
|
||||||
|
};
|
||||||
|
class setSize {
|
||||||
|
displayName = CSTRING(makeLoadable_setSize_displayName);
|
||||||
|
typeName = "NUMBER";
|
||||||
|
defaultValue = 1;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
class ModuleDescription: ModuleDescription {
|
||||||
|
description = CSTRING(module_MakeLoadable_description);
|
||||||
|
sync[] = {"AnyStaticObject"};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
class LandVehicle;
|
class LandVehicle;
|
||||||
class Car: LandVehicle {
|
class Car: LandVehicle {
|
||||||
|
BIN
addons/cargo/UI/Icon_Module_makeLoadable_ca.paa
Normal file
BIN
addons/cargo/UI/Icon_Module_makeLoadable_ca.paa
Normal file
Binary file not shown.
@ -14,6 +14,7 @@ PREP(initObject);
|
|||||||
PREP(initVehicle);
|
PREP(initVehicle);
|
||||||
PREP(loadItem);
|
PREP(loadItem);
|
||||||
PREP(makeLoadable);
|
PREP(makeLoadable);
|
||||||
|
PREP(moduleMakeLoadable);
|
||||||
PREP(moduleSettings);
|
PREP(moduleSettings);
|
||||||
PREP(onMenuOpen);
|
PREP(onMenuOpen);
|
||||||
PREP(startLoadIn);
|
PREP(startLoadIn);
|
||||||
|
34
addons/cargo/functions/fnc_moduleMakeLoadable.sqf
Normal file
34
addons/cargo/functions/fnc_moduleMakeLoadable.sqf
Normal file
@ -0,0 +1,34 @@
|
|||||||
|
/*
|
||||||
|
* Author: PabstMirror
|
||||||
|
* Module to make an object loadable.
|
||||||
|
*
|
||||||
|
* Arguments:
|
||||||
|
* 0: The module logic <OBJECT>
|
||||||
|
* 1: Synchronized units <ARRAY>
|
||||||
|
* 2: Activated <BOOL>
|
||||||
|
*
|
||||||
|
* Return Value:
|
||||||
|
* None
|
||||||
|
*
|
||||||
|
* Example:
|
||||||
|
* [logic, [box], true] call ace_cargo_fnc_moduleMakeLoadable
|
||||||
|
*
|
||||||
|
* Public: No
|
||||||
|
*/
|
||||||
|
#include "script_component.hpp"
|
||||||
|
|
||||||
|
params ["_logic", "_objects", "_activated"];
|
||||||
|
TRACE_3("params",_logic,_objects,_activated);
|
||||||
|
|
||||||
|
if ((isNull _logic) || {!_activated}) exitWith {};
|
||||||
|
if (_objects isEqualTo []) exitWith {
|
||||||
|
ACE_LOGWARNING_1("ace_cargo_fnc_moduleMakeLoadable has no synced objects [%1]", _logic);
|
||||||
|
};
|
||||||
|
|
||||||
|
private _canLoad = _logic getVariable ["canLoad", true];
|
||||||
|
private _setSize = _logic getVariable ["setSize", 1];
|
||||||
|
TRACE_2("settings",_canLoad,_setSize);
|
||||||
|
|
||||||
|
{
|
||||||
|
[_x, _canLoad, _setSize] call FUNC(makeLoadable);
|
||||||
|
} forEach _objects;
|
@ -133,5 +133,14 @@
|
|||||||
<Czech>%1<br/>nemůže být vyloženo</Czech>
|
<Czech>%1<br/>nemůže být vyloženo</Czech>
|
||||||
<Russian>%1<br/>не может быть выгружен</Russian>
|
<Russian>%1<br/>не может быть выгружен</Russian>
|
||||||
</Key>
|
</Key>
|
||||||
|
<Key ID="STR_ACE_Cargo_makeLoadable_displayName">
|
||||||
|
<English>Make Object Loadable</English>
|
||||||
|
</Key>
|
||||||
|
<Key ID="STR_ACE_Cargo_makeLoadable_description">
|
||||||
|
<English>Sets the synced object as loadable by the cargo system.</English>
|
||||||
|
</Key>
|
||||||
|
<Key ID="STR_ACE_Cargo_makeLoadable_setSize_displayName">
|
||||||
|
<English>Object's Size</English>
|
||||||
|
</Key>
|
||||||
</Package>
|
</Package>
|
||||||
</Project>
|
</Project>
|
Binary file not shown.
After Width: | Height: | Size: 20 KiB |
Loading…
Reference in New Issue
Block a user