Merge pull request #1488 from acemod/captiveModuleSettings

Captive module settings
This commit is contained in:
PabstMirror 2015-06-05 16:40:36 -05:00
commit 827c51c088
10 changed files with 89 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

@ -86,6 +86,7 @@ class CfgVehicles {
exceptions[] = {};
showDisabled = 0;
priority = 0;
icon = QUOTE(PATHTOF(UI\Surrender_ca.paa));
};
class ACE_StopSurrenderingSelf {
displayName = CSTRING(StopSurrendering);
@ -94,6 +95,7 @@ class CfgVehicles {
exceptions[] = {"isNotSurrendering"};
showDisabled = 0;
priority = 0;
icon = QUOTE(PATHTOF(UI\Surrender_ca.paa));
};
};
};
@ -162,7 +164,7 @@ class CfgVehicles {
author = ECSTRING(common,ACETeam);
category = "ACE";
displayName = CSTRING(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 +176,33 @@ class CfgVehicles {
sync[] = {"AnyAI"};
};
};
class ACE_Module: Module_F {};
class GVAR(moduleSettings): ACE_Module {
author = "$STR_ACE_Common_ACETeam";
category = "ACE";
displayName = CSTRING(ModuleSettings_DisplayName);
function = QFUNC(moduleSettings);
scope = 2;
icon = QUOTE(PATHTOF(UI\Icon_Module_settings_ca.paa));
isGlobal = 1;
class Arguments {
class allowHandcuffOwnSide {
displayName = CSTRING(ModuleSettings_handcuffSide_name);
description = CSTRING(ModuleSettings_handcuffSide_description);
typeName = "BOOL";
defaultValue = 1;
};
class allowSurrender {
displayName = CSTRING(ModuleSettings_allowSurrender_name);
description = CSTRING(ModuleSettings_allowSurrender_description);
typeName = "BOOL";
defaultValue = 1;
};
};
class ModuleDescription: ModuleDescription {
description = CSTRING(ModuleSettings_Description);
sync[] = {};
};
};
};

Binary file not shown.

Binary file not shown.

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>