Add makeLoadable sync module

This commit is contained in:
PabstMirror 2016-01-21 22:12:54 -06:00
parent 3d4fc66bb1
commit 1a98726716
6 changed files with 76 additions and 1 deletions

View File

@ -1,5 +1,9 @@
class CfgVehicles {
class ACE_Module;
class Logic;
class Module_F: Logic {
class ModuleDescription;
};
class ACE_Module: Module_F {};
class ACE_moduleCargoSettings: ACE_Module {
scope = 2;
displayName = CSTRING(SettingsModule_DisplayName);
@ -26,6 +30,33 @@ class CfgVehicles {
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 Car: LandVehicle {

Binary file not shown.

View File

@ -14,6 +14,7 @@ PREP(initObject);
PREP(initVehicle);
PREP(loadItem);
PREP(makeLoadable);
PREP(moduleMakeLoadable);
PREP(moduleSettings);
PREP(onMenuOpen);
PREP(startLoadIn);

View 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;

View File

@ -133,5 +133,14 @@
<Czech>%1&lt;br/&gt;nemůže být vyloženo</Czech>
<Russian>%1&lt;br/&gt;не может быть выгружен</Russian>
</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>
</Project>

Binary file not shown.

After

Width:  |  Height:  |  Size: 20 KiB