Added cargo settings and settings module.

This commit is contained in:
Glowbal 2015-08-15 09:50:00 +02:00
parent 2062f5dcb6
commit d8084e20d7
10 changed files with 75 additions and 2 deletions

View File

@ -0,0 +1,9 @@
class ACE_Settings {
class GVAR(enable) {
displayName = CSTRING(ModuleSettings_enable);
description = CSTRING(ModuleSettings_enable_desc);
typeName = "BOOL";
value = 1;
category = CSTRING(settingsCategory);
};
};

View File

@ -1,5 +1,32 @@
class CfgVehicles { class CfgVehicles {
class ACE_Module;
class ACE_moduleCargoSettings: ACE_Module {
scope = 2;
displayName = CSTRING(SettingsModule_DisplayName);
icon = QUOTE(PATHTOF(UI\Icon_Module_Medical_ca.paa));
category = "ACE";
function = QUOTE(DFUNC(moduleSettings));
functionPriority = 1;
isGlobal = 1;
isTriggerActivated = 0;
author = ECSTRING(common,ACETeam);
class Arguments {
class enable {
displayName = CSTRING(ModuleSettings_enable);
description = CSTRING(ModuleSettings_enable_desc);
typeName = "BOOL";
defaultValue = 1;
};
};
class ModuleDescription {
description = CSTRING(SettingsModule_Desc);
sync[] = {};
};
};
class LandVehicle; class LandVehicle;
class Car: LandVehicle { class Car: LandVehicle {
GVAR(space) = 4; GVAR(space) = 4;

Binary file not shown.

Binary file not shown.

View File

@ -11,6 +11,7 @@ PREP(GetSizeItem);
PREP(initObject); PREP(initObject);
PREP(initVehicle); PREP(initVehicle);
PREP(handleDestroyed); PREP(handleDestroyed);
PREP(moduleSettings);
PREP(loadItem); PREP(loadItem);
PREP(onMenuOpen); PREP(onMenuOpen);
PREP(unloadItem); PREP(unloadItem);

View File

@ -24,5 +24,5 @@ _type = typeOf _object;
if (_type in GVAR(initializedItemClasses)) exitWith {}; if (_type in GVAR(initializedItemClasses)) exitWith {};
GVAR(initializedItemClasses) pushBack _type; GVAR(initializedItemClasses) pushBack _type;
_action = [QGVAR(load), localize LSTRING(loadObject), "", {[_player, _target] call FUNC(startLoadIn)}, {[_player, _target] call FUNC(canLoad)}] call EFUNC(interact_menu,createAction); _action = [QGVAR(load), localize LSTRING(loadObject), QUOTE(PATHTOF(UI\Icon_load.paa)), {[_player, _target] call FUNC(startLoadIn)}, {GVAR(enable) && {[_player, _target] call FUNC(canLoad)}] call EFUNC(interact_menu,createAction);
[_type, 0, ["ACE_MainActions"], _action] call EFUNC(interact_menu,addActionToClass); [_type, 0, ["ACE_MainActions"], _action] call EFUNC(interact_menu,addActionToClass);

View File

@ -50,7 +50,7 @@ if (getNumber (configFile >> "CfgVehicles" >> _type >> QGVAR(hasCargo)) != 1) ex
private ["_text", "_condition", "_statement", "_icon", "_action"]; private ["_text", "_condition", "_statement", "_icon", "_action"];
_text = localize "STR_ACE_Cargo_openMenu"; _text = localize "STR_ACE_Cargo_openMenu";
_condition = {true}; _condition = {GVAR(enable)};
_statement = {GVAR(interactionVehicle) = _target; createDialog QGVAR(menu);}; _statement = {GVAR(interactionVehicle) = _target; createDialog QGVAR(menu);};
_icon = ""; _icon = "";

View File

@ -0,0 +1,21 @@
/*
* Author: Glowbal
* Module for adjusting the cargo settings
*
* Arguments:
* 0: The module logic <LOGIC>
* 1: units <ARRAY>
* 2: activated <BOOL>
*
* Return Value:
* None
*
* Public: No
*/
#include "script_component.hpp"
params ["_logic", "_units", "_activated"];
if !(_activated) exitWith {};
[_logic, QGVAR(enable), "enable"] call EFUNC(common,readSettingFromModule);

View File

@ -16,5 +16,20 @@
<Key ID="STR_ACE_Cargo_labelSpace"> <Key ID="STR_ACE_Cargo_labelSpace">
<English>Cargo space left: %1</English> <English>Cargo space left: %1</English>
</Key> </Key>
<Key ID="STR_ACE_Cargo_settingsCategory">
<English>Cargo</English>
</Key>
<Key ID="STR_ACE_Cargo_ModuleSettings_enable">
<English>Enable Cargo</English>
</Key>
<Key ID="STR_ACE_Cargo_setting_ModuleSettings_descr">
<English>Enable the load in cargo module</English>
</Key>
<Key ID="STR_ACE_Cargo_SettingsModule_DisplayName">
<English>Cargo Settings</English>
</Key>
<Key ID="STR_ACE_Cargo_SettingsModule_DisplayName_descr">
<English>Configure the cargo module settings</English>
</Key>
</Package> </Package>
</Project> </Project>

Binary file not shown.

After

Width:  |  Height:  |  Size: 703 B