First try at some module control

This commit is contained in:
VKing 2015-12-17 11:00:46 +01:00
parent a0fdc58ed7
commit 27890a8dab
7 changed files with 29 additions and 15 deletions

View File

@ -15,4 +15,9 @@ class ACE_Settings {
typeName = "BOOL";
isClientSetable = 0;
};
class GVAR(useAmmoHandling) {
value = 0;
typeName = "BOOL";
isClientSetable = 0;
};
};

View File

@ -20,15 +20,12 @@ class CfgVehicles {
class Turrets {
class MainTurret;
};
class ACE_Actions;
};
class StaticMortar: StaticWeapon {
class Turrets: Turrets {
class MainTurret: MainTurret {};
};
class ACE_Actions: ACE_Actions {
class ACE_MainActions;
};
class ACE_Actions;
};
class Mortar_01_base_F: StaticMortar {
class Turrets: Turrets {
@ -41,7 +38,7 @@ class CfgVehicles {
class ACE_Actions: ACE_Actions {
class GVAR(unloadMagazine) {
displayName = CSTRING(unloadMortar);
distance = 4;
distance = 2;
condition = QUOTE(_this call FUNC(canUnloadMagazine));
statement = QUOTE([ARR_3(_target,_player,5)] call FUNC(unloadMagazineTimer));
icon = "";
@ -49,42 +46,42 @@ class CfgVehicles {
};
class GVAR(LoadActions) {
displayName = CSTRING(loadMortar);
distance = 4;
distance = 2;
condition = QUOTE([ARR_2(_target,_player)] call FUNC(canLoadMagazine));
statement = "";
icon = "";
selection = "usti hlavne";
class GVAR(loadMagazine_HE_Guided) {
displayName = CSTRING(loadMagazine_HE_Guided);
distance = 4;
distance = 2;
condition = QUOTE([ARR_3(_target,_player,'ACE_1Rnd_82mm_Mo_HE_Guided')] call FUNC(canLoadMagazine));
statement = QUOTE([ARR_4(_target,_player,5,'ACE_1Rnd_82mm_Mo_HE_Guided')] call FUNC(loadMagazineTimer));
icon = "";
};
class GVAR(loadMagazine_HE_LaserGuided) {
displayName = CSTRING(loadMagazine_HE_LaserGuided);
distance = 4;
distance = 2;
condition = QUOTE([ARR_3(_target,_player,'ACE_1Rnd_82mm_Mo_HE_LaserGuided')] call FUNC(canLoadMagazine));
statement = QUOTE([ARR_4(_target,_player,5,'ACE_1Rnd_82mm_Mo_HE_LaserGuided')] call FUNC(loadMagazineTimer));
icon = "";
};
class GVAR(loadMagazine_Illum) {
displayName = CSTRING(loadMagazine_Illum);
distance = 4;
distance = 2;
condition = QUOTE([ARR_3(_target,_player,'ACE_1Rnd_82mm_Mo_Illum')] call FUNC(canLoadMagazine));
statement = QUOTE([ARR_4(_target,_player,5,'ACE_1Rnd_82mm_Mo_Illum')] call FUNC(loadMagazineTimer));
icon = "";
};
class GVAR(loadMagazine_Smoke) {
displayName = CSTRING(loadMagazine_Smoke);
distance = 4;
distance = 2;
condition = QUOTE([ARR_3(_target,_player,'ACE_1Rnd_82mm_Mo_Smoke')] call FUNC(canLoadMagazine));
statement = QUOTE([ARR_4(_target,_player,3,'ACE_1Rnd_82mm_Mo_Smoke')] call FUNC(loadMagazineTimer));
icon = "";
};
class GVAR(loadMagazine_HE) {
displayName = CSTRING(loadMagazine_HE);
distance = 4;
distance = 2;
condition = QUOTE([ARR_3(_target,_player,'ACE_1Rnd_82mm_Mo_HE')] call FUNC(canLoadMagazine));
statement = QUOTE([ARR_4(_target,_player,3,'ACE_1Rnd_82mm_Mo_HE')] call FUNC(loadMagazineTimer));
icon = "";
@ -131,6 +128,12 @@ class CfgVehicles {
typeName = "BOOL";
defaultValue = 1;
};
class useAmmoHandling {
displayName = CSTRING(useAmmoHandling_DisplayName);
description = CSTRING(useAmmoHandling_Description);
typeName = "BOOL";
defaultValue = 0;
};
};
class ModuleDescription {
description = CSTRING(Module_Description);

View File

@ -22,7 +22,7 @@ params ["_static","_unit",["_magazineClassOptional","",[""]]];
private ["_canLoadMagazine","_currentMagazine","_weapon","_listOfMagNames",
"_hasCompatibleMagazine","_count"];
if !(alive _static) exitWith {false};
if !(alive _static && {GVAR(useAmmoHandling)}) exitWith {false};
_canLoadMagazine = false;

View File

@ -19,7 +19,7 @@
params ["_static","_unit"];
private ["_canUnloadMagazine","_ammoCount"];
if !(alive _static) exitWith {false};
if !(alive _static && {GVAR(useAmmoHandling)}) exitWith {false};
_canUnloadMagazine = false;
_ammoCount = ((magazinesAllTurrets _static) select 1) select 2;

View File

@ -19,7 +19,7 @@
params ["_static","_unit",["_magazineClassOptional","",[""]]];
private ["_weapon","_currentMagazine","_count","_magazines","_magazineDetails","_listOfMagNames",
"_magazineClass","_magazineClassDetails","_parsed","_roundsLeft","_configMortar"];
"_magazineClass","_magazineClassDetails","_parsed","_roundsLeft"];
//Get weapon & magazine information of static weapon
_weapon = (_static weaponsTurret [0]) select 0;
@ -54,7 +54,6 @@ if (_magazineClassDetails != "") then{
_magType = _type;
};
//_configMortar = getNumber (configFile >> "CfgMagazines" >> _magazineClass >> QGVAR(isMortarRound));
//If function has been called with an optional classname hten add that magazine to the static weapon. Otherwise add the compatible magazine
if(_magazineClassOptional !="") then{
_unit removeMagazine _magazineClassOptional;

View File

@ -25,3 +25,4 @@ if (!isServer) exitWith {};
[_logic, QGVAR(airResistanceEnabled), "airResistanceEnabled"] call EFUNC(common,readSettingFromModule);
[_logic, QGVAR(allowComputerRangefinder), "allowComputerRangefinder"] call EFUNC(common,readSettingFromModule);
[_logic, QGVAR(allowCompass), "allowCompass"] call EFUNC(common,readSettingFromModule);
[_logic, QGVAR(useAmmoHandling), "useAmmoHandling"] call EFUNC(common,readSettingFromModule);

View File

@ -192,5 +192,11 @@
<Key ID="STR_ACE_Mk6Mortar_magazine_HE_LaserGuided_descriptionShort">
<English>Used in Mk6 mortar</English>
</Key>
<Key ID="STR_ACE_Mk6Mortar_useAmmoHandling_DisplayName">
<English>Ammunition handling</English>
</Key>
<Key ID="STR_ACE_Mk6Mortar_useAmmoHandling_Description">
<English>Removes mortar magazines, requiring individual rounds to be loaded by the gunner or loader</English>
</Key>
</Package>
</Project>