Module Settings for Captivity

Setting for handcuffing own team, and allowing surrender.
This commit is contained in:
PabstMirror 2015-06-02 20:50:27 -05:00
parent 1777719f20
commit 5dc94487c5
8 changed files with 87 additions and 4 deletions

View File

@ -0,0 +1,14 @@
class ACE_Settings {
class GVAR(allowHandcuffOwnSide) {
displayName = "$STR_ACE_Captives_ModuleSettings_handcuffSide_name";
description = "$STR_ACE_Captives_ModuleSettings_handcuffSide_description";
typeName = "BOOL";
value = 1;
};
class GVAR(allowSurrender) {
displayName = "$STR_ACE_Captives_ModuleSettings_allowSurrender_name";
description = "$STR_ACE_Captives_ModuleSettings_allowSurrender_description";
typeName = "BOOL";
value = 1;
};
};

View File

@ -162,7 +162,7 @@ class CfgVehicles {
author = "$STR_ACE_Common_ACETeam";
category = "ACE";
displayName = "$STR_ACE_Captives_ModuleSurrender_DisplayName"; //Make Unit Surrender
function = QUOTE(DFUNC(moduleSurrender));
function = QFUNC(moduleSurrender);
scope = 2; //show in editor
isGlobal = 1; //run global
isTriggerActivated = 1; //Wait for triggers
@ -174,4 +174,33 @@ class CfgVehicles {
sync[] = {"AnyAI"};
};
};
class ACE_Module: Module_F {};
class GVAR(moduleSettings): ACE_Module {
author = "$STR_ACE_Common_ACETeam";
category = "ACE";
displayName = "$STR_ACE_Captives_ModuleSettings_DisplayName";
function = QFUNC(moduleSettings);
scope = 2;
icon = QUOTE(PATHTOF(UI\Icon_Module_Make_Unit_Surrender_ca.paa));
isGlobal = 1;
class Arguments {
class allowHandcuffOwnSide {
displayName = "$STR_ACE_Captives_ModuleSettings_handcuffSide_name";
description = "$STR_ACE_Captives_ModuleSettings_handcuffSide_description";
typeName = "BOOL";
defaultValue = 1;
};
class allowSurrender {
displayName = "$STR_ACE_Captives_ModuleSettings_allowSurrender_name";
description = "$STR_ACE_Captives_ModuleSettings_allowSurrender_description";
typeName = "BOOL";
defaultValue = 1;
};
};
class ModuleDescription: ModuleDescription {
description = "$STR_ACE_Captives_ModuleSettings_Description";
sync[] = {};
};
};
};

View File

@ -24,6 +24,7 @@ PREP(handlePlayerChanged);
PREP(handleRespawn);
PREP(handleUnitInitPost);
PREP(handleZeusDisplayChanged);
PREP(moduleSettings);
PREP(moduleSurrender);
PREP(setHandcuffed);
PREP(setSurrendered);

View File

@ -2,7 +2,7 @@
class CfgPatches {
class ADDON {
units[] = {QGVAR(ModuleSurrender)};
units[] = {QGVAR(ModuleSettings), QGVAR(ModuleSurrender)};
weapons[] = {"ACE_CableTie"};
requiredVersion = REQUIRED_VERSION;
requiredAddons[] = {"ACE_Interaction"};
@ -12,6 +12,7 @@ class CfgPatches {
};
};
#include "ACE_Settings.hpp"
#include "CfgEventHandlers.hpp"
#include "CfgMoves.hpp"
#include "CfgVehicles.hpp"

View File

@ -18,8 +18,9 @@
PARAMS_2(_unit,_target);
//Player has cableTie, target is alive and not already handcuffed
//Check sides, Player has cableTie, target is alive and not already handcuffed
(GVAR(allowHandcuffOwnSide) || {(side _unit) != (side _target)}) &&
("ACE_CableTie" in (items _unit)) &&
{alive _target} &&
{!(_target getVariable [QGVAR(isHandcuffed), false])}

View File

@ -22,7 +22,7 @@ private "_returnValue";
_returnValue = if (_newSurrenderState) then {
//no weapon equiped AND not currently surrendering and
(currentWeapon _unit == "") && {!(_unit getVariable [QGVAR(isSurrendering), false])}
GVAR(allowSurrender) && {(currentWeapon _unit) == ""} && {!(_unit getVariable [QGVAR(isSurrendering), false])}
} else {
//is Surrendering
(_unit getVariable [QGVAR(isSurrendering), false])

View File

@ -0,0 +1,19 @@
/*
* Author: PabstMirror
* Module for captivity settings
*
* Arguments:
* 0: The module logic <OBJECT>
*
* Return Value:
* None <NIL>
*
* Public: No
*/
#include "script_component.hpp"
PARAMS_1(_logic);
[_logic, QGVAR(allowHandcuffOwnSide), "allowHandcuffOwnSide"] call EFUNC(common,readSettingFromModule);
[_logic, QGVAR(allowSurrender), "allowSurrender"] call EFUNC(common,readSettingFromModule);

View File

@ -169,5 +169,23 @@
<Spanish>Sincroniza una unidad para hacer que se rinda.&lt;br /&gt;Fuente: ace_captives</Spanish>
<German>Einheit synchronisieren, um sie kapitulieren zu lassen.&lt;br /&gt;Quelle: ace_captives</German>
</Key>
<Key ID="STR_ACE_Captives_ModuleSettings_DisplayName">
<English>Captives Settings</English>
</Key>
<Key ID="STR_ACE_Captives_ModuleSettings_Description">
<English>Controls settings for surrender and cable ties</English>
</Key>
<Key ID="STR_ACE_Captives_ModuleSettings_handcuffSide_name">
<English>Can handcuff own side</English>
</Key>
<Key ID="STR_ACE_Captives_ModuleSettings_handcuffSide_description">
<English>Can players cabletie units on their own side</English>
</Key>
<Key ID="STR_ACE_Captives_ModuleSettings_allowSurrender_name">
<English>Allow surrendering</English>
</Key>
<Key ID="STR_ACE_Captives_ModuleSettings_allowSurrender_description">
<English>Players can surrender after holstering their weapon</English>
</Key>
</Package>
</Project>