mirror of
https://github.com/acemod/ACE3.git
synced 2024-08-30 18:23:18 +00:00
Add hostile sides filter
This commit is contained in:
parent
ac56702e33
commit
e406a794f2
@ -11,6 +11,6 @@ class ACE_Settings {
|
|||||||
class GVAR(filterSides) {
|
class GVAR(filterSides) {
|
||||||
typeName = "SCALAR";
|
typeName = "SCALAR";
|
||||||
value = 0;
|
value = 0;
|
||||||
values[] = {CSTRING(sides_player), CSTRING(sides_friendly), CSTRING(sides_all)};
|
values[] = {CSTRING(sides_player), CSTRING(sides_friendly), CSTRING(sides_hostile), CSTRING(sides_all)};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
@ -49,9 +49,13 @@ class CfgVehicles {
|
|||||||
name = CSTRING(sides_friendly);
|
name = CSTRING(sides_friendly);
|
||||||
value = 1;
|
value = 1;
|
||||||
};
|
};
|
||||||
|
class hostile {
|
||||||
|
name = CSTRING(sides_hostile);
|
||||||
|
value = 2;
|
||||||
|
};
|
||||||
class all {
|
class all {
|
||||||
name = CSTRING(sides_all);
|
name = CSTRING(sides_all);
|
||||||
value = 2;
|
value = 3;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
@ -33,25 +33,19 @@ if !(_newUnits isEqualTo []) exitWith {
|
|||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
private ["_playerSide","_sides","_filteredUnits"];
|
private ["_sides","_cond","_filteredUnits"];
|
||||||
|
|
||||||
// Unit setting filter
|
// Unit setting filter
|
||||||
_newUnits = [[],allPlayers,allUnits] select GVAR(filterUnits);
|
_newUnits = [[],allPlayers,allUnits] select GVAR(filterUnits);
|
||||||
|
|
||||||
// Side setting filter
|
// Side setting filter
|
||||||
_playerSide = side group player;
|
_sides = [];
|
||||||
if (GVAR(filterSides) == 0) then {
|
_cond = [{_this == playerSide},{(_this getFriend playerSide) >= 0.6},{(_this getFriend playerSide) < 0.6},{true}] select GVAR(filterSides);
|
||||||
_sides = [_playerSide];
|
{
|
||||||
} else {
|
if (_x call _cond) then {
|
||||||
_sides = [west,east,resistance,civilian];
|
_sides pushBack _x;
|
||||||
if (GVAR(filterSides) == 1) then {
|
|
||||||
{
|
|
||||||
if ((_x getFriend _playerSide) < 0.6) then {
|
|
||||||
_sides = _sides - [_x];
|
|
||||||
};
|
};
|
||||||
} forEach _sides;
|
} forEach [west,east,resistance,civilian];
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
// Filter units and append to list
|
// Filter units and append to list
|
||||||
_filteredUnits = [];
|
_filteredUnits = [];
|
||||||
@ -59,7 +53,7 @@ _filteredUnits = [];
|
|||||||
if (
|
if (
|
||||||
(alive _x) &&
|
(alive _x) &&
|
||||||
{(_x isKindOf "CAManBase")} &&
|
{(_x isKindOf "CAManBase")} &&
|
||||||
{(side _x) in _sides} && // Side filter
|
{(side group _x) in _sides} && // Side filter
|
||||||
{simulationEnabled _x} &&
|
{simulationEnabled _x} &&
|
||||||
{!(_x getVariable [QGVAR(isSpectator), false])} // Who watches the watchmen?
|
{!(_x getVariable [QGVAR(isSpectator), false])} // Who watches the watchmen?
|
||||||
) then {
|
) then {
|
||||||
|
@ -37,6 +37,9 @@
|
|||||||
<Key ID="STR_ACE_Spectator_sides_friendly">
|
<Key ID="STR_ACE_Spectator_sides_friendly">
|
||||||
<English>Friendly sides</English>
|
<English>Friendly sides</English>
|
||||||
</Key>
|
</Key>
|
||||||
|
<Key ID="STR_ACE_Spectator_sides_hostile">
|
||||||
|
<English>Hostile sides</English>
|
||||||
|
</Key>
|
||||||
<Key ID="STR_ACE_Spectator_sides_all">
|
<Key ID="STR_ACE_Spectator_sides_all">
|
||||||
<English>All sides</English>
|
<English>All sides</English>
|
||||||
</Key>
|
</Key>
|
||||||
|
Loading…
Reference in New Issue
Block a user