mirror of
https://github.com/acemod/ACE3.git
synced 2024-08-30 18:23:18 +00:00
Added cargo settings and settings module.
This commit is contained in:
parent
2062f5dcb6
commit
d8084e20d7
9
addons/cargo/ACE_Settings.hpp
Normal file
9
addons/cargo/ACE_Settings.hpp
Normal 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);
|
||||||
|
};
|
||||||
|
};
|
@ -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;
|
||||||
|
BIN
addons/cargo/UI/Icon_Module_Cargo_ca.paa
Normal file
BIN
addons/cargo/UI/Icon_Module_Cargo_ca.paa
Normal file
Binary file not shown.
BIN
addons/cargo/UI/Icon_load.paa
Normal file
BIN
addons/cargo/UI/Icon_load.paa
Normal file
Binary file not shown.
@ -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);
|
||||||
|
@ -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);
|
||||||
|
@ -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 = "";
|
||||||
|
|
||||||
|
21
addons/cargo/functions/fnc_moduleSettings.sqf
Normal file
21
addons/cargo/functions/fnc_moduleSettings.sqf
Normal 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);
|
@ -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>
|
||||||
|
BIN
extras/assets/icons/Icon_Module_png/Icon_Module_Cargo_ca.png
Normal file
BIN
extras/assets/icons/Icon_Module_png/Icon_Module_Cargo_ca.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 703 B |
Loading…
Reference in New Issue
Block a user