Merge branch 'master' into 10digitGrids2

This commit is contained in:
PabstMirror 2015-07-16 17:26:19 -05:00
commit b47a17230b
194 changed files with 5613 additions and 709 deletions

1
.gitignore vendored
View File

@ -5,3 +5,4 @@ texHeaders.bin
*.swp
*.swo
*.biprivatekey
Thumbs.db

BIN
ace_parse_imagepath.dll Normal file

Binary file not shown.

View File

@ -210,7 +210,6 @@
<Portuguese>Define o raio ao redor do jogador (em metros) onde a balística avançada será aplicada aos projéteis</Portuguese>
</Key>
<Key ID="STR_ACE_Advanced_Ballistics_Description">
<English></English>
<Polish>Moduł ten pozwala aktywować zaawansowaną balistykę biorącą przy obliczeniach trajektorii lotu pocisku pod uwagę takie rzeczy jak temperatura powietrza, ciśnienie atmosferyczne, wilgotność powietrza, siły Coriolisa i Eotvosa, grawitację a także broń z jakiej wykonywany jest strzał oraz rodzaj amunicji. Wszystko to sprowadza się na bardzo dokładne odwzorowanie balistyki.</Polish>
<Czech>Tento modul umožňuje aktivovat pokročilou balistiku, která vypočítává trajektorii kulky a bere do úvahy věci jako je teplota vzduchu, atmosférický tlak, vlhkost vzduchu, gravitaci, typ munice a zbraň, ze které je náboj vystřelen. To vše přispívá k velmi přesné balistice.</Czech>
<Portuguese>Este módulo permite que você ative cálculos de balística avançada, fazendo a trajetória do projétil levar em consideração coisas como temperatura do ar, pressão atmosférica, umidade, força de Coriolis, a gravidade, o modelo da arma no qual o disparo é realizado e o tipo de munição. Tudo isso acrescenta-se a um balística muito precisa.</Portuguese>

View File

@ -1,8 +1,7 @@
ace_lockbackpacks
ace_backpacks
=================
Introduces the ability to lock one's backpack.
Adds indication when someone else opens your backpack (soundeffect / camShake).
## Maintainers

View File

@ -6,7 +6,7 @@
//Singe PFEH to handle execNextFrame and waitAndExec:
[{
private ["_entry"];
//Handle the waitAndExec array:
while {((count GVAR(waitAndExecArray)) > 0) && {((GVAR(waitAndExecArray) select 0) select 0) <= ACE_Time}} do {
_entry = GVAR(waitAndExecArray) deleteAt 0;
@ -64,6 +64,10 @@
["setFuel", {(_this select 0) setFuel (_this select 1)}] call FUNC(addEventhandler);
["setSpeaker", {(_this select 0) setSpeaker (_this select 1)}] call FUNC(addEventhandler);
if (isServer) then {
["hideObjectGlobal", {(_this select 0) hideObjectGlobal (_this select 1)}] call FUNC(addEventHandler);
};
// hack to get PFH to work in briefing
[QGVAR(onBriefingPFH), "onEachFrame", {
if (ACE_time > 0) exitWith {

View File

@ -106,6 +106,7 @@ PREP(goKneeling);
PREP(hadamardProduct);
PREP(hasItem);
PREP(hasMagazine);
PREP(hideUnit);
PREP(inheritsFrom);
PREP(insertionSort);
PREP(interpolateFromArray);
@ -183,6 +184,7 @@ PREP(toBin);
PREP(toBitmask);
PREP(toHex);
PREP(toNumber);
PREP(unhideUnit);
PREP(uniqueElementsOnly);
PREP(unloadPerson);
PREP(unloadPersonLocal);

View File

@ -56,20 +56,23 @@ _addons = [_addons, {_this find "ace_" == 0}] call FUNC(filter);
} forEach getArray (configFile >> "ACE_Extensions" >> "extensions");
///////////////
// check server version
// check server version/addons
///////////////
if (isMultiplayer) then {
if (isServer) then {
// send servers version of ACE to all clients
GVAR(ServerVersion) = _version;
GVAR(ServerAddons) = _addons;
publicVariable QGVAR(ServerVersion);
publicVariable QGVAR(ServerAddons);
} else {
// clients have to wait for the variable
// clients have to wait for the variables
[{
if (isNil QGVAR(ServerVersion)) exitWith {};
if (isNil QGVAR(ServerVersion) || isNil QGVAR(ServerAddons)) exitWith {};
private "_version";
_version = _this select 0;
private ["_version","_addons"];
_version = (_this select 0) select 0;
_addons = (_this select 0) select 1;
if (_version != GVAR(ServerVersion)) then {
private "_errorMsg";
@ -82,7 +85,18 @@ if (isMultiplayer) then {
};
};
_addons = _addons - GVAR(ServerAddons);
if !(_addons isEqualTo []) then {
_errorMsg = format ["Client/Server Addon Mismatch. Client has extra addons: %1.",_addons];
diag_log text format ["[ACE] ERROR: %1", _errorMsg];
if (hasInterface) then {diag_log str "1";
["[ACE] ERROR", _errorMsg, {findDisplay 46 closeDisplay 0}] call FUNC(errorMessage);
};
};
[_this select 1] call CBA_fnc_removePerFrameHandler;
}, 1, _version] call CBA_fnc_addPerFrameHandler;
}, 1, [_version,_addons]] call CBA_fnc_addPerFrameHandler;
};
};

View File

@ -8,8 +8,8 @@
* 0: Warn once
* 1: Warn permanently
* 2: Kick
* 1: Check all PBOs? <BOOL> (Optional - default: "[]")
* 2: Whitelist <STRING> (Optinal - default: false)
* 1: Check all PBOs? <BOOL> (Optional - default: false)
* 2: Whitelist <STRING> (Optinal - default: "[]")
*
* Return value:
* None

View File

@ -0,0 +1,34 @@
/*
* Author: SilentSpike (based on muteUnit)
* Globally hides a unit. This allows the handling of more than one reason to hide an object globally.
*
* Arguments:
* 0: Unit <OBJECT>
* 1: Reason to hide the unit <STRING>
*
* Return Value:
* nil
*
* Example:
* [ACE_Player, "SpectatorMode"] call ace_common_fnc_hideUnit
*
* Public: No
*/
#include "script_component.hpp"
PARAMS_2(_unit,_reason);
if (isNull _unit) exitWith {};
private "_setHiddenReasons";
_setHiddenReasons = _unit getVariable [QGVAR(setHiddenReasons), []];
if !(_reason in _setHiddenReasons) then {
_setHiddenReasons pushBack _reason;
_unit setVariable [QGVAR(setHiddenReasons), _setHiddenReasons, true];
};
//if !(isObjectHidden _unit) then { (Uncomment when isObjectHidden hits stable branch)
["hideObjectGlobal",[_unit,true]] call FUNC(serverEvent);
//};

View File

@ -3,7 +3,9 @@
* Initializes the check-PBOs module.
*
* Arguments:
* Whatever the module provides. (I dunno.)
* 0: The module logic <LOGIC>
* 1: units <ARRAY>
* 2: activated <BOOL>
*
* Return Value:
* None

View File

@ -0,0 +1,34 @@
/*
* Author: SilentSpike (based on unmuteUnit)
* Globally unhides a unit. Only unhides if the last reason was removed.
*
* Arguments:
* 0: Unit <OBJECT>
* 1: Reason to unhide the unit <STRING>
*
* Return Value:
* nil
*
* Example:
* [ACE_Player, "SpectatorMode"] call ace_common_fnc_unhideUnit
*
* Public: No
*/
#include "script_component.hpp"
PARAMS_2(_unit,_reason);
if (isNull _unit) exitWith {};
private "_setHiddenReasons";
_setHiddenReasons = _unit getVariable [QGVAR(setHiddenReasons), []];
if (_reason in _setHiddenReasons) then {
_setHiddenReasons deleteAt (_setHiddenReasons find _reason);
_unit setVariable [QGVAR(setHiddenReasons), _setHiddenReasons, true];
};
if (_setHiddenReasons isEqualTo []) then {
["hideObjectGlobal",[_unit,false]] call FUNC(serverEvent);
};

View File

@ -578,16 +578,22 @@
<English>Toggle Handheld Device</English>
<Spanish>Seleccionar dispositivo de mano</Spanish>
<Portuguese>Ativa dispositivo de mão</Portuguese>
<Polish>Przełącz urządzenie podręczne</Polish>
<Czech>Přepnout ruční zařízení</Czech>
</Key>
<Key ID="STR_ACE_Common_closeHandheldDevice">
<English>Close Handheld Device</English>
<Spanish>Cerrar dispositivo de mano</Spanish>
<Portuguese>Fecha dispositivo de mão</Portuguese>
<Polish>Zamknij urządzenie podręczne</Polish>
<Czech>Zavřít ruční zařízení</Czech>
</Key>
<Key ID="STR_ACE_Common_cycleHandheldDevices">
<English>Cycle Handheld Devices</English>
<Spanish>Cambiar dispositivos de mano</Spanish>
<Portuguese>Troca dispositivos de mão</Portuguese>
<Polish>Następne urządzenie podręczne</Polish>
<Czech>Procházet ruční zařízení</Czech>
</Key>
</Package>
</Project>

View File

@ -6,7 +6,7 @@
<German>NATO-Draht</German>
<Russian>Проволочная спираль</Russian>
<Polish>Drut kolczasty</Polish>
<Spanish>Concertina wire</Spanish>
<Spanish>Alambre de espino</Spanish>
<French>Concertina wire</French>
<Czech>Ostnatý drát</Czech>
<Italian>Concertina wire</Italian>
@ -18,7 +18,7 @@
<German>NATO-Draht Rolle</German>
<Russian>Проволочная спираль (моток)</Russian>
<Polish>Zwój drutu kolczastego</Polish>
<Spanish>Concertina wire coil</Spanish>
<Spanish>Bobina de alambre de espino</Spanish>
<French>Concertina wire coil</French>
<Czech>Smyčka ostnatého drátu</Czech>
<Italian>Concertina wire coil</Italian>
@ -30,7 +30,7 @@
<German>NATO-Draht abbauen</German>
<Russian>Демонтировать проволочную спираль</Russian>
<Polish>Zwiń drut kolczasty</Polish>
<Spanish>Dismount Concertina wire</Spanish>
<Spanish>Desmontar alambre de espino</Spanish>
<French>Dismount Concertina wire</French>
<Czech>Svinout ostnatý drát</Czech>
<Italian>Dismount Concertina wire</Italian>
@ -42,7 +42,7 @@
<German>NATO-Draht verlegen</German>
<Russian>Монтировать проволочную спираль</Russian>
<Polish>Rozwiń drut kolczasty</Polish>
<Spanish>Deploy Concertina wire</Spanish>
<Spanish>Desplegar alambre de espino</Spanish>
<French>Deploy Concertina wire</French>
<Czech>Rozvinout ostnatý drát</Czech>
<Italian>Deploy Concertina wire</Italian>

View File

@ -548,13 +548,18 @@
<Key ID="STR_ACE_Explosives_ExplodeOnDefuse_DisplayName">
<English>Explode on defusal?</English>
<Portuguese>Explosão no desarmamento?</Portuguese>
<Polish>Eksplozja przy rozbrajaniu?</Polish>
<Czech>Explodovat při zneškodňování?</Czech>
<Spanish>Explotar al desactivar?</Spanish>
</Key>
<Key ID="STR_ACE_Explosives_ExplodeOnDefuse_Description">
<English>Enable certain explosives to explode on defusal? Default: Yes</English>
<Portuguese>Ativa certos explosivos para detonar no desarmamento? Padrão: Sim</Portuguese>
<Polish>Spraw, aby niektóre ładunki wybuchowe eksplodowały przy próbie ich rozbrojenia? Domyślnie:Tak</Polish>
<Czech>Umožnit u některých výbušnin explozi při pokusu je zneškodnit? Výchozí: Ano</Czech>
<Spanish>¿Habilitar ciertos explosivos para estallar al desactivar? Por defecto: Sí</Spanish>
</Key>
<Key ID="STR_ACE_Explosives_Module_Description">
<English></English>
<Polish>Moduł ten pozwala dostosować opcje związane z ładunkami wybuchowymi, ich podkładaniem oraz rozbrajaniem.</Polish>
<German>Dieses Modul erlaubt die Einstellungen für Sprengstoffe zu verändern.</German>
<Czech>Tento modul umoňuje přizpůsobit nastavení týkajících se výbušnin.</Czech>

View File

@ -12,4 +12,39 @@ class CfgWeapons {
mass = 1;
};
};
class H_HelmetB;
class H_HelmetCrew_B: H_HelmetB {
GVAR(protection) = 1;
GVAR(lowerVolume) = 0.80;
};
class H_HelmetCrew_0: H_HelmetCrew_B {};
class H_HelmetCrew_I: H_HelmetCrew_B {};
class H_CrewHelmetHeli_B: H_HelmetB {
GVAR(protection) = 0.75;
GVAR(lowerVolume) = 0.70;
};
class H_CrewHelmetHeli_O: H_CrewHelmetHeli_B {};
class H_CrewHelmetHeli_I: H_CrewHelmetHeli_B {};
class H_PilotHelmetHeli_B: H_HelmetB {
GVAR(protection) = 0.75;
GVAR(lowerVolume) = 0.70;
};
class H_PilotHelmetHeli_O: H_PilotHelmetHeli_B {};
class H_PilotHelmetHeli_I: H_PilotHelmetHeli_B {};
class H_PilotHelmetFighter_B: H_HelmetB {
GVAR(protection) = 1;
GVAR(lowerVolume) = 0.80;
};
class H_PilotHelmetFighter_O: H_PilotHelmetFighter_B {};
class H_PilotHelmetFighter_I: H_PilotHelmetFighter_B {};
class H_Cap_headphones: H_HelmetB {
GVAR(protection) = 0.5;
GVAR(lowerVolume) = 0.60;
};
class H_Cap_marshal: H_Cap_headphones {};
};

View File

@ -5,7 +5,7 @@ class CfgPatches {
units[] = {};
weapons[] = {"ACE_EarPlugs"};
requiredVersion = REQUIRED_VERSION;
requiredAddons[] = {"ace_interaction"};
requiredAddons[] = {"ace_interaction", "A3_Characters_F", "A3_Characters_F_Kart"};
author[] = {"KoffeinFlummi", "esteldunedain", "HopeJ", "commy2", "Rocko", "Rommel", "Ruthberg"};
authorUrl = "https://github.com/KoffeinFlummi/";
VERSION_CONFIG;

View File

@ -15,9 +15,12 @@
*/
#include "script_component.hpp"
private ["_unit", "_launcher"];
PARAMS_1(_unit);
_unit = _this select 0;
// Exit if hearing is disabled or soldier has earplugs already in (persistence scenarios)
if (!GVAR(enableCombatDeafness) || {[_unit] call FUNC(hasEarPlugsIn)}) exitWith {};
private ["_launcher"];
// add earplugs if the soldier has a rocket launcher
_launcher = secondaryWeapon _unit;

View File

@ -27,6 +27,15 @@ if (_unit getVariable ["ACE_hasEarPlugsin", false]) then {
_strength = _strength / 4;
};
//headgear hearing protection
if(headgear _unit != "") then {
private ["_protection"];
_protection = (getNumber (configFile >> "CfgWeapons" >> (headgear _unit) >> QGVAR(protection))) min 1;
if(_protection > 0) then {
_strength = _strength * (1 - _protection);
};
};
_unit setVariable [QGVAR(dv), (_unit getVariable [QGVAR(dv), 0]) + _strength];
if (GVAR(earRingingPFH) != -1) exitWith {};
@ -35,8 +44,8 @@ GVAR(earRingingPFH) = [{
EXPLODE_1_PVT(_this select 0,_unit);
private ["_prior"];
_prior = (_unit getvariable [QGVAR(dv), 0]) min 20;
if (!alive _unit || _prior <= 0) exitWith {
if (!alive _unit || _prior <= 0 || GVAR(DisableEarRinging)) exitWith {
_unit setVariable [QGVAR(dv), 0];
_unit setVariable [QGVAR(prior), 0];
GVAR(beep) = false;
@ -47,7 +56,7 @@ GVAR(earRingingPFH) = [{
GVAR(earRingingPFH) = -1;
[_this select 1] call cba_fnc_removePerFrameHandler;
};
if (((_unit getvariable [QGVAR(dv), 0]) - (_unit getvariable [QGVAR(prior), 0])) > 2) then {
if (ACE_time > GVAR(time3)) then {
GVAR(beep2) = false;
@ -58,16 +67,16 @@ GVAR(earRingingPFH) = [{
GVAR(time3) = ACE_time + 5;
};
};
_unit setvariable [QGVAR(prior), _prior];
GVAR(volume) = (1 - (_prior / 20)) max 0;
if (_prior > 19.75) then {
_unit setvariable [QGVAR(deaf), true];
} else {
_unit setvariable [QGVAR(deaf), false];
};
if ((_unit getvariable [QGVAR(deaf), false]) && {ACE_time > GVAR(time4)}) then {
playSound "ACE_Combat_Deafness";
GVAR(beep2) = true;
@ -77,7 +86,7 @@ GVAR(earRingingPFH) = [{
// Hearing takes longer to return to normal after it hits rock bottom
_unit setvariable [QGVAR(dv), _prior - (0.5 * (GVAR(volume) max 0.1))];
if (_prior > 10) then {
//check if the ringing is already being played
if (ACE_time > GVAR(time2)) then {

View File

@ -46,6 +46,15 @@ if ([ACE_player] call FUNC(hasEarPlugsIn)) then {
_volume = _volume min GVAR(EarplugsVolume);
};
// Headgear can reduce hearing
if(headgear ACE_player != "") then {
private ["_lowerVolume"];
_lowerVolume = (getNumber (configFile >> "CfgWeapons" >> (headgear ACE_player) >> QGVAR(lowerVolume))) min 1;
if(_lowerVolume > 0) then {
_volume = _volume min (1 - _lowerVolume);
};
};
// Reduce volume if player is unconscious
if (ACE_player getVariable ["ACE_isUnconscious", false]) then {
_volume = _volume min GVAR(UnconsciousnessVolume);

View File

@ -4,7 +4,7 @@
<Key ID="STR_DN_ACE_HUNTIRBOX">
<English>HuntIR Transport Box</English>
<German>HuntIR Transportkiste</German>
<Spanish>HuntIR Transport Box</Spanish>
<Spanish>Caja de transporte de HuntIR</Spanish>
<Czech>Trasnportní bedna HuntIR</Czech>
<Russian>Ящик с HuntIR</Russian>
<Italian>HuntIR Transport Box</Italian>
@ -16,7 +16,7 @@
<Key ID="STR_ACE_HUNTIR_magazine_displayName">
<English>HuntIR Round</English>
<German>HuntIR Granate</German>
<Spanish>HuntIR Round</Spanish>
<Spanish>Proyectil HuntIR</Spanish>
<Czech>HuntIR Round</Czech>
<Russian>HuntIR снаряд</Russian>
<Italian>HuntIR Round</Italian>
@ -28,7 +28,7 @@
<Key ID="STR_ACE_HUNTIR_monitor_displayName">
<English>HuntIR monitor</English>
<German>HuntIR Monitor</German>
<Spanish>HuntIR monitor</Spanish>
<Spanish>Monitor HuntIR</Spanish>
<Czech>HuntIR monitor</Czech>
<Russian>HuntIR монитор</Russian>
<Italian>HuntIR monitor</Italian>
@ -40,7 +40,7 @@
<Key ID="STR_ACE_HUNTIR_activateMonitor">
<English>Activate HuntIR monitor</English>
<German>HuntIR Monitor aktivieren</German>
<Spanish>Activate HuntIR monitor</Spanish>
<Spanish>Activar monitor HuntIR</Spanish>
<Czech>Zapnout HuntIR monitor</Czech>
<Russian>Включить HuntIR монитор</Russian>
<Italian>Activate HuntIR monitor</Italian>
@ -52,7 +52,7 @@
<Key ID="STR_ACE_HUNTIR_CAM">
<English>Camera:</English>
<German>Kamera:</German>
<Spanish>Camera:</Spanish>
<Spanish>Camara:</Spanish>
<Czech>Kamera:</Czech>
<Russian>Камера:</Russian>
<Italian>Camera:</Italian>
@ -64,7 +64,7 @@
<Key ID="STR_ACE_HUNTIR_ALT">
<English>Altitude:</English>
<German>Höhe:</German>
<Spanish>Altitude:</Spanish>
<Spanish>Altitud:</Spanish>
<Czech>Výška:</Czech>
<Russian>Высота:</Russian>
<Italian>Altitude:</Italian>
@ -76,7 +76,7 @@
<Key ID="STR_ACE_HUNTIR_TIME">
<English>Recording Time:</English>
<German>Aufnahmezeit:</German>
<Spanish>Recording Time:</Spanish>
<Spanish>Tiempo de grabación:</Spanish>
<Czech>Čas nahrávání:</Czech>
<Russian>Время записи:</Russian>
<Italian>Recording Time:</Italian>
@ -88,7 +88,7 @@
<Key ID="STR_ACE_HUNTIR_ESC">
<English>Press ESC to quit camera</English>
<German>Zum Verlassen ESC drücken</German>
<Spanish>Press ESC to quit camera</Spanish>
<Spanish>Pulsar ESC para salir de la camara</Spanish>
<Czech>Stiskni ESC pro opustění kamery</Czech>
<Russian>Нажмите ESC чтобы выйти из режима камеры</Russian>
<Italian>Press ESC to quit camera</Italian>
@ -100,7 +100,7 @@
<Key ID="STR_ACE_HUNTIR_HELP">
<English>Help</English>
<German>Hilfe</German>
<Spanish>Help</Spanish>
<Spanish>Ayuda</Spanish>
<Czech>Pomoc</Czech>
<Russian>Помощь</Russian>
<Italian>Help</Italian>
@ -112,7 +112,7 @@
<Key ID="STR_ACE_HUNTIR_HELP_ZOOM">
<English>A/D - Cycle zoom</English>
<German>A/D - Zoom</German>
<Spanish>A/D - Cycle zoom</Spanish>
<Spanish>A/D - Cambiar zoom</Spanish>
<Czech>A/D - Změna přiblížení</Czech>
<Russian>A/D - Приближение</Russian>
<Italian>A/D - Cycle zoom</Italian>
@ -124,7 +124,7 @@
<Key ID="STR_ACE_HUNTIR_HELP_CAM">
<English>W/S - Select camera</English>
<German>W/S - Wähle Kamera</German>
<Spanish>W/S - Select camera</Spanish>
<Spanish>W/S - Seleccionar camara</Spanish>
<Czech>W/S - Výběr kamery</Czech>
<Russian>W/S - Выбрать камеру</Russian>
<Italian>W/S - Select camera</Italian>
@ -136,7 +136,7 @@
<Key ID="STR_ACE_HUNTIR_HELP_ROT">
<English>Left/Right - Rotate camera</English>
<German>Links/Rechts - Rotiere Kamera</German>
<Spanish>Left/Right - Rotate camera</Spanish>
<Spanish>Left/Right - Rotar camara</Spanish>
<Czech>Levá/Pravá - Rotace kamery</Czech>
<Russian>Влево/Вправо - Вращать камеру</Russian>
<Italian>Left/Right - Rotate camera</Italian>
@ -148,7 +148,7 @@
<Key ID="STR_ACE_HUNTIR_HELP_ELV">
<English>Up/Down - Elevate/lower camera</English>
<German>Hoch/Runter - Neige Kamera</German>
<Spanish>Up/Down - Elevate/lower camera</Spanish>
<Spanish>Up/Down - Subir/bajar camara</Spanish>
<Czech>Nahoru/Dolu - Zvýšít/snížit úhel pohledu kamery</Czech>
<Russian>Вверх/Вниз - Поднять/Опустить камеру</Russian>
<Italian>Up/Down - Elevate/lower camera</Italian>
@ -160,7 +160,7 @@
<Key ID="STR_ACE_HUNTIR_HELP_MOD">
<English>N - Cycle IT modes</English>
<German>N - Sichtmodi</German>
<Spanish>N - Cycle IT modes</Spanish>
<Spanish>N - Cambiar modos de IT</Spanish>
<Czech>N - Změna režimů kamery</Czech>
<Russian>N - Режимы камеры</Russian>
<Italian>N - Cycle IT modes</Italian>
@ -172,7 +172,7 @@
<Key ID="STR_ACE_HUNTIR_HELP_RES">
<English>R - Reset camera</English>
<German>R - Reset</German>
<Spanish>R - Reset camera</Spanish>
<Spanish>R - Reiniciar camara</Spanish>
<Czech>R - Reset kamery</Czech>
<Russian>R - Сбросить настройки камеры</Russian>
<Italian>R - Reset camera</Italian>
@ -184,7 +184,7 @@
<Key ID="STR_ACE_HUNTIR_HELP_EXIT">
<English>Esc - Exit help</English>
<German>ESC - Hilfe verlassen</German>
<Spanish>Esc - Exit help</Spanish>
<Spanish>Esc - Salit de ayuda</Spanish>
<Czech>Esc - Ukončit pomoc </Czech>
<Russian>Esc - Выйти из помощи</Russian>
<Italian>Esc - Exit help</Italian>

View File

@ -76,4 +76,11 @@ class ACE_Settings {
displayName = CSTRING(background);
values[] = {"$STR_A3_OPTIONS_DISABLED", CSTRING(backgroundBlur), CSTRING(backgroundBlack)};
};
class GVAR(addBuildingActions) {
value = 0;
typeName = "BOOL";
isClientSettable = 1;
displayName = CSTRING(addBuildingActions);
description = CSTRING(addBuildingActionsDescription);
};
};

View File

@ -3,6 +3,9 @@
if (!hasInterface) exitWith {};
GVAR(cachedBuildingTypes) = [];
GVAR(cachedBuildingActionPairs) = [];
GVAR(ParsedTextCached) = [];
//Setup text/shadow/size/color settings matrix
@ -17,6 +20,9 @@ GVAR(ParsedTextCached) = [];
// Install the render EH on the main display
addMissionEventHandler ["Draw3D", DFUNC(render)];
//Add Actions to Houses:
["interactMenuOpened", {_this call FUNC(userActions_addHouseActions)}] call EFUNC(common,addEventHandler);
// This spawn is probably worth keeping, as pfh don't work natively on the briefing screen and IDK how reliable the hack we implemented for them is.
// The thread dies as soon as the mission start, so it's not really compiting for scheduler space.
[] spawn {

View File

@ -25,6 +25,8 @@ PREP(renderMenu);
PREP(renderSelector);
PREP(setupTextColors);
PREP(splitPath);
PREP(userActions_addHouseActions);
PREP(userActions_getHouseActions);
// Event handlers for all interact menu controls
DFUNC(handleMouseMovement) = {

View File

@ -21,5 +21,5 @@ class CfgPatches {
#include "ACE_Settings.hpp"
class ACE_Extensions {
extensions[] += {"ace_break_line"};
extensions[] += {"ace_break_line", "ace_parse_imagepath"};
};

View File

@ -90,7 +90,7 @@ _recurseFnc = {
[],
_position,
_distance,
[_showDisabled,_enableInside,_canCollapse,_runOnHover],
[_showDisabled,_enableInside,_canCollapse,_runOnHover, false],
_modifierFunction
],
_children

View File

@ -74,7 +74,7 @@ _recurseFnc = {
{},
[0,0,0],
10, //distace
[_showDisabled,_enableInside,_canCollapse,_runOnHover],
[_showDisabled,_enableInside,_canCollapse,_runOnHover, true],
_modifierFunction
],
_children

View File

@ -68,7 +68,7 @@ _distance = if (count _this > 8) then {
_params = if (count _this > 9) then {
_this select 9
} else {
[false,false,false,false]
[false,false,false,false,false]
};
_modifierFunction = if (count _this > 10) then {

View File

@ -44,7 +44,7 @@ if (GVAR(openedMenuType) == 0 && (vehicle ACE_player == ACE_player) && (isNull c
if (_actualDistance > _distance) exitWith {true};
if (_actualDistance > 1.5) exitWith {
if ((_actualDistance > 1.5) && {!((_actionData select 9) select 4)}) exitWith {
// If distance to action is greater than 1.5 m, check LOS
_line = [_headPos call EFUNC(common,positionToASL), _pos call EFUNC(common,positionToASL), _object, ACE_player];
lineIntersects _line

View File

@ -0,0 +1,97 @@
/*
* Author: PabstMirror
* Scans for nearby "Static" objects (buildings) and adds the UserActions to them.
* Called when interact_menu starts rendering (from "interact_keyDown" event)
*
* Arguments:
* 0: Interact Menu Type (0 - world, 1 - self) <NUMBER>
*
* Return Value:
* Nothing
*
* Example:
* [0] call ace_interact_menu_fnc_addHouseActions
*
* Public: Yes
*/
#include "script_component.hpp"
PARAMS_1(_interactionType);
//Ignore if not enabled:
if (!GVAR(addBuildingActions)) exitWith {};
//Ignore self-interaction menu:
if (_interactionType != 0) exitWith {};
//Ignore when mounted:
if ((vehicle ACE_player) != ACE_player) exitWith {};
[{
private ["_nearBuidlings", "_typeOfHouse", "_houseBeingScaned", "_actionSet", "_memPoints", "_memPointsActions", "_helperPos", "_helperObject"];
PARAMS_2(_args,_pfID);
EXPLODE_4_PVT(_args,_setPosition,_addedHelpers,_housesScaned,_housesToScanForActions);
if (!EGVAR(interact_menu,keyDown)) then {
{deleteVehicle _x;} forEach _addedHelpers;
[_pfID] call CBA_fnc_removePerFrameHandler;
} else {
// Prevent Rare Error when ending mission with interact key down:
if (isNull ace_player) exitWith {};
//Make the common case fast (cursorTarget is looking at a door):
if ((!isNull cursorTarget) && {cursorTarget isKindOf "Static"} && {!(cursorTarget in _housesScaned)}) then {
if (((count (configFile >> "CfgVehicles" >> (typeOf cursorTarget) >> "UserActions")) > 0) || {(count (getArray (configFile >> "CfgVehicles" >> (typeOf cursorTarget) >> "ladders"))) > 0}) then {
_housesToScanForActions = [cursorTarget];
} else {
_housesScaned pushBack cursorTarget;
};
};
//For performance, we only do 1 thing per frame,
//-either do a wide scan and search for houses with actions
//-or scan one house at a time and add the actions for that house
if (_housesToScanForActions isEqualTo []) then {
//If player moved >2 meters from last pos, then rescan
if (((getPosASL ace_player) distance _setPosition) < 2) exitWith {};
_nearBuidlings = nearestObjects [ace_player, ["Static"], 30];
{
_typeOfHouse = typeOf _x;
if (((count (configFile >> "CfgVehicles" >> _typeOfHouse >> "UserActions")) == 0) && {(count (getArray (configFile >> "CfgVehicles" >> _typeOfHouse >> "ladders"))) == 0}) then {
_housesScaned pushBack _x;
} else {
_housesToScanForActions pushBack _x;
};
} forEach (_nearBuidlings - _housesScaned);
_args set [0, (getPosASL ace_player)];
} else {
_houseBeingScaned = _housesToScanForActions deleteAt 0;
_typeOfHouse = typeOf _houseBeingScaned;
//Skip this house for now if we are outside of it's radius
//(we have to scan far out for the big houses, but we don't want to waste time adding actions on every little shack)
if ((_houseBeingScaned != cursorTarget) && {((ACE_player distance _houseBeingScaned) - ((sizeOf _typeOfHouse) / 2)) > 4}) exitWith {};
_housesScaned pushBack _houseBeingScaned;
_actionSet = [_typeOfHouse] call FUNC(userActions_getHouseActions);
EXPLODE_2_PVT(_actionSet,_memPoints,_memPointsActions);
// systemChat format ["Add Actions for [%1] (count %2) @ %3", _typeOfHouse, (count _memPoints), diag_tickTime];
{
_helperPos = (_houseBeingScaned modelToWorld (_houseBeingScaned selectionPosition _x)) call EFUNC(common,positionToASL);
_helperObject = "Sign_Sphere25cm_F" createVehicleLocal _helperPos;
_addedHelpers pushBack _helperObject;
_helperObject setVariable [QGVAR(building), _houseBeingScaned];
_helperObject setPosASL _helperPos;
_helperObject hideObject true;
TRACE_3("Making New Helper",_helperObject,_x,_houseBeingScaned);
{
[_helperObject, 0, [], _x] call EFUNC(interact_menu,addActionToObject);
} forEach (_memPointsActions select _forEachIndex);
} forEach _memPoints;
};
};
}, 0, [((getPosASL ace_player) vectorAdd [-100,0,0]), [], [], []]] call CBA_fnc_addPerFrameHandler;

View File

@ -0,0 +1,137 @@
/*
* Author: PabstMirror
* Scans the buidling type for UserActions and Ladder mount points.
*
* Arguments:
* 0: Building Classname <STRING>
*
* Return Value:
* [[Array of MemPoints], [Array Of Actions]]
*
* Public: Yes
*/
#include "script_component.hpp"
PARAMS_1(_typeOfBuilding);
private["_action", "_actionDisplayName", "_actionDisplayNameDefault", "_actionMaxDistance", "_actionOffset", "_actionPath", "_actionPosition", "_building", "_configPath", "_endIndex", "_iconImage", "_index", "_ladders", "_memPointIndex", "_memPoints", "_memPointsActions", "_startIndex"];
_searchIndex = GVAR(cachedBuildingTypes) find _typeOfBuilding;
if (_searchIndex != -1) exitWith {GVAR(cachedBuildingActionPairs) select _searchIndex};
_memPoints = [];
_memPointsActions = [];
//Get the offset for a memory point:
_fnc_getMemPointOffset = {
PARAMS_1(_memoryPoint);
_memPointIndex = _memPoints find _memoryPoint;
_actionOffset = [0,0,0];
if (_memPointIndex == -1) then {
_memPoints pushBack _memoryPoint;
_memPointsActions pushBack [];
} else {
_actionOffset set [2, 0.0254 * (count (_memPointsActions select _memPointIndex))];
};
_actionOffset
};
// Add UserActions for the building:
_fnc_userAction_Statement = {
PARAMS_3(_target,_player,_variable);
EXPLODE_2_PVT(_variable,_actionStatement,_actionCondition);
this = _target getVariable [QGVAR(building), objNull];
call _actionStatement;
};
_fnc_userAction_Condition = {
PARAMS_3(_target,_player,_variable);
EXPLODE_2_PVT(_variable,_actionStatement,_actionCondition);
this = _target getVariable [QGVAR(building), objNull];
if (isNull this) exitWith {false};
call _actionCondition;
};
_configPath = configFile >> "CfgVehicles" >> _typeOfBuilding >> "UserActions";
for "_index" from 0 to ((count _configPath) - 1) do {
_actionPath = _configPath select _index;
_actionDisplayName = getText (_actionPath >> "displayName");
_actionDisplayNameDefault = getText (_actionPath >> "displayNameDefault");
_actionPosition = getText (_actionPath >> "position");
_actionCondition = getText (_actionPath >> "condition");
_actionStatement = getText (_actionPath >> "statement");
_actionMaxDistance = getNumber (_actionPath >> "radius");
if (_actionDisplayName == "") then {_actionDisplayName = (configName _x);};
if (_actionPosition == "") then {ERROR("Bad Position");};
if (_actionCondition == "") then {_actionCondition = "true";};
if (_actionStatement == "") then {ERROR("No Statement");};
_actionStatement = compile _actionStatement;
_actionCondition = compile _actionCondition;
_actionMaxDistance = _actionMaxDistance + 0.1; //increase range slightly
_iconImage = "";
//extension ~4x as fast:
_iconImage = "ace_parse_imagepath" callExtension _actionDisplayNameDefault;
_actionOffset = [_actionPosition] call _fnc_getMemPointOffset;
_memPointIndex = _memPoints find _actionPosition;
_action = [(configName _actionPath), _actionDisplayName, _iconImage, _fnc_userAction_Statement, _fnc_userAction_Condition, {}, [_actionStatement, _actionCondition], _actionOffset, _actionMaxDistance, [false,false,false,false,true]] call EFUNC(interact_menu,createAction);
(_memPointsActions select _memPointIndex) pushBack _action;
};
// Add Ladder Actions for the building:
_fnc_ladder_ladderUp = {
PARAMS_3(_target,_player,_variable);
EXPLODE_1_PVT(_variable,_ladderIndex);
_building = _target getVariable [QGVAR(building), objNull];
TRACE_3("Ladder Action - UP",_player,_building,_ladderIndex);
_player action ["LadderUp", _building, _ladderIndex, 0];
};
_fnc_ladder_ladderDown = {
PARAMS_3(_target,_player,_variable);
EXPLODE_1_PVT(_variable,_ladderIndex);
_building = _target getVariable [QGVAR(building), objNull];
TRACE_3("Ladder Action - Down",_player,_building,_ladderIndex);
_player action ["LadderDown", _building, _ladderIndex, 1];
};
_fnc_ladder_conditional = {
PARAMS_2(_target,_player);
//(Check distance < 2) and (Don't show actions if on a ladder)
((_target distance _player) < 2) && {((getNumber (configFile >> "CfgMovesMaleSdr" >> "States" >> (animationState _player) >> "onLadder")) == 0)}
};
_ladders = getArray (configFile >> "CfgVehicles" >> _typeOfBuilding >> "ladders");
{
EXPLODE_2_PVT(_x,_ladderBottomMemPoint,_ladderTopMemPoint);
_actionMaxDistance = 3; //interact_menu will check head -> target's offset; leave this high and do a precice distance check in condition
_actionDisplayName = localize "str_action_ladderup";
_iconImage = "\A3\ui_f\data\igui\cfg\actions\ladderup_ca.paa";
//Ladder Up Action:
_actionOffset = [_ladderBottomMemPoint] call _fnc_getMemPointOffset;
_actionOffset = _actionOffset vectorAdd [0,0,1];
_memPointIndex = _memPoints find _ladderBottomMemPoint;
_action = [format ["LadderUp_%1", _forEachIndex], _actionDisplayName, _iconImage, _fnc_ladder_ladderUp, _fnc_ladder_conditional, {}, [_forEachIndex], _actionOffset, _actionMaxDistance, [false,false,false,false,true]] call EFUNC(interact_menu,createAction);
(_memPointsActions select _memPointIndex) pushBack _action;
_actionDisplayName = localize "str_action_ladderdown";
_iconImage = "\A3\ui_f\data\igui\cfg\actions\ladderdown_ca.paa";
//Ladder Down Action:
_actionOffset = [_ladderTopMemPoint] call _fnc_getMemPointOffset;
_actionOffset = _actionOffset vectorAdd [0,0,0.25];
_memPointIndex = _memPoints find _ladderTopMemPoint;
_action = [format ["LadderDown_%1", _forEachIndex], _actionDisplayName, _iconImage, _fnc_ladder_ladderDown, _fnc_ladder_conditional, {}, [_forEachIndex], _actionOffset, _actionMaxDistance, [false,false,false,false,true]] call EFUNC(interact_menu,createAction);
(_memPointsActions select _memPointIndex) pushBack _action;
} forEach _ladders;
GVAR(cachedBuildingTypes) pushBack _typeOfBuilding;
GVAR(cachedBuildingActionPairs) pushBack [_memPoints, _memPointsActions];
[_memPoints, _memPointsActions]

View File

@ -87,6 +87,9 @@
</Key>
<Key ID="STR_ACE_Interact_Menu_ZeusActionsRoot">
<English>Zeus Actions</English>
<Polish>Akcje Zeusa</Polish>
<Czech>Akce Zeuse</Czech>
<Spanish>Acciones Zeus</Spanish>
</Key>
<Key ID="STR_ACE_Interact_Menu_ColorTextMax">
<English>Interaction - Text Max</English>
@ -244,9 +247,21 @@
<Key ID="STR_ACE_Interact_Menu_backgroundBlack">
<English>Black</English>
<Polish>Przyciemnienie ekranu</Polish>
<Spanish>Negra</Spanish>
<Spanish>Negro</Spanish>
<Czech>Černý obraz</Czech>
<Portuguese>Preto</Portuguese>
</Key>
<Key ID="STR_ACE_Interact_Menu_addBuildingActions">
<English>Show actions for buildings</English>
<Polish>Pokazuj akcje dla budynków</Polish>
<Czech>Zobrazit akci pro budovy</Czech>
<Spanish>Mostrar acciones para edificios</Spanish>
</Key>
<Key ID="STR_ACE_Interact_Menu_addBuildingActionsDescription">
<English>Adds interaction actions for opening doors and mounting ladders on buildings. (Note: There is a performance cost when opening interaction menu, especially in towns)</English>
<Polish>Dodaje opcje interakcji dla otwierania drzwi oraz wchodzenia po drabinach do budynków. Uwaga: Użycie tej opcji może spowodować spadek wydajności menu interakcji, szczególnie w dużych miastach.</Polish>
<Czech>Přidá možnost interakce pro otevření dvěří a umistňovat žebříky na budovy. (Poznámka: Použití této možnosti snižuje výkon při otevírání pomocí interakčního menu, zejména ve velkých městech.) </Czech>
<Spanish>Añade las acciones de interacción para la apertura de puertas y montaje de escaleras en los edificios. (Nota: Hay un coste de rendimiento al abrir el menú de interacción, especialmente en las ciudades)</Spanish>
</Key>
</Package>
</Project>
</Project>

View File

@ -8,23 +8,23 @@ class ACE_ZeusActions {
class stance {
displayName = "$STR_A3_RscAttributeUnitPos_Title";
class limited {
displayName = "$STR_A3_RscAttributeUnitPos_Down_tooltip";
class prone {
displayName = "$STR_Pos_Down";
icon = "\A3\UI_F\Data\IGUI\RscIngameUI\RscUnitInfo\SI_prone_ca.paa";
statement = "{_x setUnitPos 'DOWN';} forEach (curatorSelected select 0);";
};
class normal {
displayName = "$STR_A3_RscAttributeUnitPos_Crouch_tooltip";
class crouch {
displayName = "$STR_Pos_Crouch";
icon = "\A3\UI_F\Data\IGUI\RscIngameUI\RscUnitInfo\SI_crouch_ca.paa";
statement = "{_x setUnitPos 'MIDDLE';} forEach (curatorSelected select 0);";
};
class full {
displayName = "$STR_A3_RscAttributeUnitPos_Up_tooltip";
class stand {
displayName = "$STR_Pos_Up";
icon = "\A3\UI_F\Data\IGUI\RscIngameUI\RscUnitInfo\SI_stand_ca.paa";
statement = "{_x setUnitPos 'UP';} forEach (curatorSelected select 0);";
};
class auto {
displayName = "$STR_A3_RscAttributeUnitPos_Auto_tooltip";
displayName = "$STR_Pos_Automatic";
icon = "\A3\UI_F_Curator\Data\default_ca.paa";
statement = "{_x setUnitPos 'AUTO';} forEach (curatorSelected select 0);";
};
@ -40,121 +40,97 @@ class ACE_ZeusActions {
icon = "\A3\UI_F_Curator\Data\Displays\RscDisplayCurator\modeGroups_ca.paa";
class behaviour {
displayName = CSTRING(Zeus_Behaviour);
displayName = "$STR_Combat_Mode";
class careless {
displayName = CSTRING(Zeus_Behaviour_careless);
displayName = "$STR_Combat_Careless";
statement = "{ _x setBehaviour 'CARELESS'; } forEach (curatorSelected select 1);";
};
class safe {
displayName = "$STR_safe";
displayName = "$STR_Combat_Safe";
icon = "\A3\UI_F_Curator\Data\RscCommon\RscAttributeBehaviour\safe_ca.paa";
statement = "{ _x setBehaviour 'SAFE'; } forEach (curatorSelected select 1);";
};
class aware {
displayName = "$STR_aware";
displayName = "$STR_Combat_Aware";
icon = "\A3\UI_F_Curator\Data\RscCommon\RscAttributeBehaviour\aware_ca.paa";
statement = "{ _x setBehaviour 'AWARE'; } forEach (curatorSelected select 1);";
};
class combat {
displayName = "$STR_combat";
displayName = "$STR_Combat_Combat";
icon = "\A3\UI_F_Curator\Data\RscCommon\RscAttributeBehaviour\combat_ca.paa";
statement = "{ _x setBehaviour 'COMBAT'; } forEach (curatorSelected select 1);";
};
class stealth {
displayName = "$STR_stealth";
displayName = "$STR_Combat_Stealth";
icon = "\A3\UI_F_Curator\Data\RscCommon\RscAttributeBehaviour\stealth_ca.paa";
statement = "{ _x setBehaviour 'STEALTH'; } forEach (curatorSelected select 1);";
};
};
class speed {
displayName = CSTRING(Zeus_Speed);
displayName = "$STR_HC_Menu_Speed";
class limited {
displayName = "$STR_speed_limited";
displayName = "$STR_Speed_Limited";
icon = "\A3\UI_F_Curator\Data\RscCommon\RscAttributeSpeedMode\limited_ca.paa";
statement = "{_x setSpeedMode 'LIMITED';} forEach (curatorSelected select 1);";
};
class normal {
displayName = "$STR_speed_normal";
displayName = "$STR_Speed_Normal";
icon = "\A3\UI_F_Curator\Data\RscCommon\RscAttributeSpeedMode\normal_ca.paa";
statement = "{_x setSpeedMode 'NORMAL';} forEach (curatorSelected select 1);";
};
class full {
displayName = "$STR_speed_full";
displayName = "$STR_Speed_Full";
icon = "\A3\UI_F_Curator\Data\RscCommon\RscAttributeSpeedMode\full_ca.paa";
statement = "{_x setSpeedMode 'FULL';} forEach (curatorSelected select 1);";
};
};
class stance {
displayName = "$STR_A3_RscAttributeUnitPos_Title";
class limited {
displayName = "$STR_A3_RscAttributeUnitPos_Down_tooltip";
icon = "\A3\UI_F\Data\IGUI\RscIngameUI\RscUnitInfo\SI_prone_ca.paa";
statement = "{ {_x setUnitPos 'DOWN'} forEach (units _x); } forEach (curatorSelected select 1);";
};
class normal {
displayName = "$STR_A3_RscAttributeUnitPos_Crouch_tooltip";
icon = "\A3\UI_F\Data\IGUI\RscIngameUI\RscUnitInfo\SI_crouch_ca.paa";
statement = "{ {_x setUnitPos 'MIDDLE'} forEach (units _x); } forEach (curatorSelected select 1);";
};
class full {
displayName = "$STR_A3_RscAttributeUnitPos_Up_tooltip";
icon = "\A3\UI_F\Data\IGUI\RscIngameUI\RscUnitInfo\SI_stand_ca.paa";
statement = "{ {_x setUnitPos 'UP'} forEach (units _x); } forEach (curatorSelected select 1);";
};
class auto {
displayName = "$STR_A3_RscAttributeUnitPos_Auto_tooltip";
icon = "\A3\UI_F_Curator\Data\default_ca.paa";
statement = "{ {_x setUnitPos 'AUTO'} forEach (units _x); } forEach (curatorSelected select 1);";
};
};
class formation {
displayName = CSTRING(Zeus_Formation);
displayName = "$STR_Formation";
class wedge {
displayName = "$STR_wedge";
displayName = "$STR_Wedge";
icon="\A3\UI_F_Curator\Data\RscCommon\RscAttributeFormation\wedge_ca.paa";
statement = "{_x setFormation 'WEDGE';} forEach (curatorSelected select 1);";
};
class vee {
displayName = "$STR_vee";
displayName = "$STR_Vee";
icon="\A3\UI_F_Curator\Data\RscCommon\RscAttributeFormation\vee_ca.paa";
statement = "{_x setFormation 'VEE';} forEach (curatorSelected select 1);";
};
class line {
displayName = "$STR_line";
displayName = "$STR_Line";
icon="\A3\UI_F_Curator\Data\RscCommon\RscAttributeFormation\line_ca.paa";
statement = "{_x setFormation 'LINE';} forEach (curatorSelected select 1);";
};
class column {
displayName = "$STR_column";
displayName = "$STR_Column";
icon="\A3\UI_F_Curator\Data\RscCommon\RscAttributeFormation\column_ca.paa";
statement = "{_x setFormation 'COLUMN';} forEach (curatorSelected select 1);";
};
class file {
displayName = "$STR_file";
displayName = "$STR_File";
icon = "\A3\UI_F_Curator\Data\RscCommon\RscAttributeFormation\file_ca.paa";
statement = "{_x setFormation 'FILE';} forEach (curatorSelected select 1);";
};
class stag_column {
displayName = "$STR_staggered";
displayName = "$STR_Staggered";
icon="\A3\UI_F_Curator\Data\RscCommon\RscAttributeFormation\stag_column_ca.paa";
statement = "{_x setFormation 'STAG COLUMN';} forEach (curatorSelected select 1);";
};
class ech_left {
displayName = "$STR_echl";
displayName = "$STR_EchL";
icon="\A3\UI_F_Curator\Data\RscCommon\RscAttributeFormation\ech_left_ca.paa";
statement = "{_x setFormation 'ECH LEFT';} forEach (curatorSelected select 1);";
};
class ech_right {
displayName = "$STR_echr";
displayName = "$STR_EchR";
icon="\A3\UI_F_Curator\Data\RscCommon\RscAttributeFormation\ech_right_ca.paa";
statement = "{_x setFormation 'ECH RIGHT';} forEach (curatorSelected select 1);";
};
class diamond {
displayName = "$STR_diamond";
displayName = "$STR_Diamond";
icon="\A3\UI_F_Curator\Data\RscCommon\RscAttributeFormation\diamond_ca.paa";
statement = "{_x setFormation 'DIAMOND';} forEach (curatorSelected select 1);";
};
@ -165,97 +141,97 @@ class ACE_ZeusActions {
icon = "\A3\UI_F_Curator\Data\CfgCurator\waypoint_ca.paa";
class behaviour {
displayName = CSTRING(Zeus_Behaviour);
displayName = "$STR_Combat_Mode";
class careless {
displayName = CSTRING(Zeus_Behaviour_careless);
displayName = "$STR_Combat_Careless";
statement = "{ _x setWaypointBehaviour 'CARELESS'; } forEach (curatorSelected select 2);";
};
class safe {
displayName = "$STR_safe";
displayName = "$STR_Combat_Safe";
icon = "\A3\UI_F_Curator\Data\RscCommon\RscAttributeBehaviour\safe_ca.paa";
statement = "{ _x setWaypointBehaviour 'SAFE'; } forEach (curatorSelected select 2);";
};
class aware {
displayName = "$STR_aware";
displayName = "$STR_Combat_Aware";
icon = "\A3\UI_F_Curator\Data\RscCommon\RscAttributeBehaviour\aware_ca.paa";
statement = "{ _x setWaypointBehaviour 'AWARE'; } forEach (curatorSelected select 2);";
};
class combat {
displayName = "$STR_combat";
displayName = "$STR_Combat_Combat";
icon = "\A3\UI_F_Curator\Data\RscCommon\RscAttributeBehaviour\combat_ca.paa";
statement = "{ _x setWaypointBehaviour 'COMBAT'; } forEach (curatorSelected select 2);";
};
class stealth {
displayName = "$STR_stealth";
displayName = "$STR_Combat_Stealth";
icon = "\A3\UI_F_Curator\Data\RscCommon\RscAttributeBehaviour\stealth_ca.paa";
statement = "{ _x setWaypointBehaviour 'STEALTH'; } forEach (curatorSelected select 2);";
};
};
class speed {
displayName = CSTRING(Zeus_Speed);
displayName = "$STR_HC_Menu_Speed";
class limited {
displayName = "$STR_speed_limited";
displayName = "$STR_Speed_Limited";
icon = "\A3\UI_F_Curator\Data\RscCommon\RscAttributeSpeedMode\limited_ca.paa";
statement = "{ _x setWaypointSpeed 'LIMITED'; } forEach (curatorSelected select 2);";
};
class normal {
displayName = "$STR_speed_normal";
displayName = "$STR_Speed_Normal";
icon = "\A3\UI_F_Curator\Data\RscCommon\RscAttributeSpeedMode\normal_ca.paa";
statement = "{ _x setWaypointSpeed 'NORMAL'; } forEach (curatorSelected select 2);";
};
class full {
displayName = "$STR_speed_full";
displayName = "$STR_Speed_Full";
icon = "\A3\UI_F_Curator\Data\RscCommon\RscAttributeSpeedMode\full_ca.paa";
statement = "{ _x setWaypointSpeed 'FULL'; } forEach (curatorSelected select 2);";
};
};
class formation {
displayName = CSTRING(Zeus_Formation);
displayName = "$STR_Formation";
class wedge {
displayName = "$STR_wedge";
displayName = "$STR_Wedge";
icon="\A3\UI_F_Curator\Data\RscCommon\RscAttributeFormation\wedge_ca.paa";
statement = "{_x setWaypointFormation 'WEDGE';} forEach (curatorSelected select 1);";
};
class vee {
displayName = "$STR_vee";
displayName = "$STR_Vee";
icon="\A3\UI_F_Curator\Data\RscCommon\RscAttributeFormation\vee_ca.paa";
statement = "{_x setWaypointFormation 'VEE';} forEach (curatorSelected select 1);";
};
class line {
displayName = "$STR_line";
displayName = "$STR_Line";
icon="\A3\UI_F_Curator\Data\RscCommon\RscAttributeFormation\line_ca.paa";
statement = "{_x setWaypointFormation 'LINE';} forEach (curatorSelected select 1);";
};
class column {
displayName = "$STR_column";
displayName = "$STR_Column";
icon="\A3\UI_F_Curator\Data\RscCommon\RscAttributeFormation\column_ca.paa";
statement = "{_x setWaypointFormation 'COLUMN';} forEach (curatorSelected select 1);";
};
class file {
displayName = "$STR_file";
displayName = "$STR_File";
icon = "\A3\UI_F_Curator\Data\RscCommon\RscAttributeFormation\file_ca.paa";
statement = "{_x setWaypointFormation 'FILE';} forEach (curatorSelected select 1);";
};
class stag_column {
displayName = "$STR_staggered";
displayName = "$STR_Staggered";
icon="\A3\UI_F_Curator\Data\RscCommon\RscAttributeFormation\stag_column_ca.paa";
statement = "{_x setWaypointFormation 'STAG COLUMN';} forEach (curatorSelected select 1);";
};
class ech_left {
displayName = "$STR_echl";
displayName = "$STR_EchL";
icon="\A3\UI_F_Curator\Data\RscCommon\RscAttributeFormation\ech_left_ca.paa";
statement = "{_x setWaypointFormation 'ECH LEFT';} forEach (curatorSelected select 1);";
};
class ech_right {
displayName = "$STR_echr";
displayName = "$STR_EchR";
icon="\A3\UI_F_Curator\Data\RscCommon\RscAttributeFormation\ech_right_ca.paa";
statement = "{_x setWaypointFormation 'ECH RIGHT';} forEach (curatorSelected select 1);";
};
class diamond {
displayName = "$STR_diamond";
displayName = "$STR_Diamond";
icon="\A3\UI_F_Curator\Data\RscCommon\RscAttributeFormation\diamond_ca.paa";
statement = "{_x setWaypointFormation 'DIAMOND';} forEach (curatorSelected select 1);";
};

View File

@ -581,6 +581,13 @@ class CfgVehicles {
selection = "";
distance = 2;
condition = "true";
class ACE_OpenBox {
displayName = CSTRING(OpenBox);
condition = QUOTE(alive _target);
statement = QUOTE(_player action [ARR_2(QUOTE(QUOTE(Gear)), _target)]);
showDisabled = 0;
priority = -1;
};
};
};
class ACE_SelfActions {};

View File

@ -793,6 +793,12 @@
<Italian>Passeggeri</Italian>
<Portuguese>Passageiros</Portuguese>
</Key>
<Key ID="STR_ACE_Interaction_OpenBox">
<English>Open</English>
<Polish>Otwórz</Polish>
<Czech>Otevřít</Czech>
<Spanish>Abrir</Spanish>
</Key>
<Key ID="STR_ACE_Interaction_Module_DisplayName">
<English>Interaction System</English>
<Polish>System interakcji</Polish>
@ -823,18 +829,7 @@
<German>Die Gruppenverwaltung erlaubt die Zuweisung von Farben für Einheiten, die Kommandierung und das Beitreten/Verlassen einer Gruppe.</German>
<Czech>Správa týmu se skládá z: přidělení barev pro členy týmu, převzetí velení, připojení/odpojení. </Czech>
<Russian>O módulo de gestão de equipe é composto por: a atribuição de cores para os membros da equipe, comando das equipes, juntando-se / deixando equipes.</Russian>
</Key>
<Key ID="STR_ACE_Interaction_Zeus_Behaviour">
<English>Behaviour</English>
</Key>
<Key ID="STR_ACE_Interaction_Zeus_Behaviour_careless">
<English>Careless</English>
</Key>
<Key ID="STR_ACE_Interaction_Zeus_Formation">
<English>Formation</English>
</Key>
<Key ID="STR_ACE_Interaction_Zeus_Speed">
<English>Speed Mode</English>
<Spanish>La gestión del equipo permite la asignación de colores para los miembros del equipo, tomando el mando del equipo y uniendo/dejando equipos.</Spanish>
</Key>
</Package>
</Project>
</Project>

View File

@ -25,7 +25,7 @@
#ifndef STRING_MACROS_GUARD
#define STRING_MACROS_GUARD
#define LSTRING(var1) QUOTE(TRIPLES(STR,ADDON,var1))
#define LESTRING(var1,var2) QUOTE(TRIPLES(STR,DOUBLES(PREFIX,var1),var2))
#define ELSTRING(var1,var2) QUOTE(TRIPLES(STR,DOUBLES(PREFIX,var1),var2))
#define CSTRING(var1) QUOTE(TRIPLES($STR,ADDON,var1))
#define ECSTRING(var1,var2) QUOTE(TRIPLES($STR,DOUBLES(PREFIX,var1),var2))
#endif

View File

@ -18,7 +18,30 @@ call FUNC(determineZoom);
GVAR(lastStillTime) = ACE_time;
GVAR(isShaking) = false;
//Allow panning the lastStillPosition while mapShake is active
GVAR(rightMouseButtonLastPos) = [];
((findDisplay 12) displayCtrl 51) ctrlAddEventHandler ["Draw", {[] call FUNC(updateMapEffects);}];
((findDisplay 12) displayCtrl 51) ctrlAddEventHandler ["MouseMoving", {
if (GVAR(isShaking) && {(count GVAR(rightMouseButtonLastPos)) == 2}) then {
private["_lastPos", "_newPos"];
_lastPos = (_this select 0) ctrlMapScreenToWorld GVAR(rightMouseButtonLastPos);
_newPos = (_this select 0) ctrlMapScreenToWorld (_this select [1,2]);
GVAR(lastStillPosition) set [0, (GVAR(lastStillPosition) select 0) + (_lastPos select 0) - (_newPos select 0)];
GVAR(lastStillPosition) set [1, (GVAR(lastStillPosition) select 1) + (_lastPos select 1) - (_newPos select 1)];
GVAR(rightMouseButtonLastPos) = _this select [1,2];
TRACE_3("Mouse Move",_lastPos,_newPos,GVAR(rightMouseButtonLastPos));
};
}];
((findDisplay 12) displayCtrl 51) ctrlAddEventHandler ["MouseButtonDown", {
if ((_this select 1) == 1) then {
GVAR(rightMouseButtonLastPos) = _this select [2,2];
};
}];
((findDisplay 12) displayCtrl 51) ctrlAddEventHandler ["MouseButtonUp", {
if ((_this select 1) == 1) then {
GVAR(rightMouseButtonLastPos) = [];
};
}];
};
["SettingsInitialized", {

View File

@ -74,7 +74,6 @@
<Portuguese>Mostrar as coordenadas de grade no ponteiro do mouse?</Portuguese>
</Key>
<Key ID="STR_ACE_Map_Module_Description">
<English></English>
<Polish>Moduł ten pozwala dostosować opcje widoku ekranu mapy.</Polish>
<German>Dieses Modul erweitert die Kartenfunktionen.</German>
<Czech>Tento modul umožňuje přizpůsobit mapu s obrazem.</Czech>
@ -83,7 +82,7 @@
<Key ID="STR_ACE_Map_BFT_Module_DisplayName">
<English>Blue Force Tracking</English>
<Polish>Blue Force Tracking</Polish>
<Spanish>Seguimiento de fuerzas amigas</Spanish>
<Spanish>Blue Force Tracking</Spanish>
<German>Blue Force Tracking</German>
<Czech>Blue Force Tracking</Czech>
<Portuguese>Rastreio de forças azuis</Portuguese>
@ -91,10 +90,16 @@
<Key ID="STR_ACE_Map_BFT_Enabled_DisplayName">
<English>BFT Enable</English>
<Portuguese>RFA ativo</Portuguese>
<Polish>Aktywuj BFT</Polish>
<Czech>Povolit BFT</Czech>
<Spanish>Activar BFT</Spanish>
</Key>
<Key ID="STR_ACE_Map_BFT_Enabled_Description">
<English>Enable Blue Force Tracking. Default: No</English>
<Portuguese>Ativa Rastreio de Forças Azuis. Padrão: Não</Portuguese>
<Polish>Aktywuj Blue Force Tracking. Domyślnie: Nie</Polish>
<Czech>Povolit Blue Force Tracking. Výchozí: Ne</Czech>
<Spanish>Activar Blue Force Tracking. Por defecto: No</Spanish>
</Key>
<Key ID="STR_ACE_Map_BFT_Interval_DisplayName">
<English>Interval</English>
@ -129,7 +134,6 @@
<Portuguese>Esconder marcadores que pertencem ao grupo de IA?</Portuguese>
</Key>
<Key ID="STR_ACE_Map_BFT_Module_Description">
<English></English>
<Polish>Pozwala śledzić na mapie pozycje sojuszniczych jednostek za pomocą markerów BFT.</Polish>
<German>Dieses Modul ermöglicht es verbündete Einheiten mit dem BFT auf der Karte zu verfolgen.</German>
<Czech>Umožňuje sledovat přátelské jednokty na mapě v rámci BFT.</Czech>

View File

@ -11,6 +11,7 @@ class ACE_Medical_Actions {
treatmentTimeSelfCoef = 1;
items[] = {{"ACE_fieldDressing", "ACE_packingBandage", "ACE_elasticBandage", "ACE_quikclot"}};
condition = "";
patientStateCondition = 0;
itemConsumed = 1;
callbackSuccess = QUOTE(DFUNC(treatmentBasic_bandage));
@ -107,6 +108,7 @@ class ACE_Medical_Actions {
// Item required for the action. Leave empty for no item required.
items[] = {"ACE_fieldDressing"};
condition = "";
patientStateCondition = 0;
// Callbacks
callbackSuccess = QUOTE(DFUNC(treatmentAdvanced_bandage));
callbackFailure = "";
@ -206,6 +208,7 @@ class ACE_Medical_Actions {
items[] = {"ACE_surgicalKit"};
treatmentLocations[] = {QGVAR(useLocation_SurgicalKit)};
requiredMedic = QGVAR(medicSetting_SurgicalKit);
patientStateCondition = QGVAR(useCondition_SurgicalKit);
treatmentTime = "(count ((_this select 1) getVariable ['ACE_Medical_bandagedWounds', []]) * 5)";
callbackSuccess = "";
callbackProgress = QUOTE(DFUNC(treatmentAdvanced_surgicalKit_onProgress));
@ -219,6 +222,7 @@ class ACE_Medical_Actions {
items[] = {"ACE_personalAidKit"};
treatmentLocations[] = {QGVAR(useLocation_PAK)};
requiredMedic = QGVAR(medicSetting_PAK);
patientStateCondition = QGVAR(useCondition_PAK);
treatmentTime = QUOTE((_this select 1) call FUNC(treatmentAdvanced_fullHealTreatmentTime));
callbackSuccess = QUOTE(DFUNC(treatmentAdvanced_fullHeal));
itemConsumed = QGVAR(consumeItem_PAK);
@ -266,10 +270,10 @@ class ACE_Medical_Actions {
requiredMedic = 0;
treatmentTime = 15;
items[] = {};
condition = "((_this select 1) getvariable ['ACE_medical_inCardiacArrest', false])";
condition = "!([(_this select 1)] call ace_common_fnc_isAwake)";
callbackSuccess = QUOTE(DFUNC(treatmentAdvanced_CPR));
callbackFailure = "";
callbackProgress = "(((_this select 0) select 1) getvariable ['ACE_medical_inCardiacArrest', false])";
callbackProgress = "!([((_this select 0) select 1)] call ace_common_fnc_isAwake)";
animationPatient = "";
animationPatientUnconscious = "AinjPpneMstpSnonWrflDnon_rolltoback";
animationCaller = "AinvPknlMstpSlayWnonDnon_medic";

View File

@ -133,6 +133,20 @@ class ACE_Settings {
value = 2;
values[] = {"Anywhere", "Medical vehicles", "Medical facility", "vehicle & facility", "Disabled"};
};
class GVAR(useCondition_PAK) {
displayName = CSTRING(AdvancedMedicalSettings_useCondition_PAK_DisplayName);
description = CSTRING(AdvancedMedicalSettings_useCondition_PAK_Description);
typeName = "SCALAR";
value = 0;
values[] = {"Anytime", "Stable"};
};
class GVAR(useCondition_SurgicalKit) {
displayName = CSTRING(AdvancedMedicalSettings_useCondition_SurgicalKit_DisplayName);
description = CSTRING(AdvancedMedicalSettings_useCondition_SurgicalKit_Description);
typeName = "SCALAR";
value = 0;
values[] = {"Anytime", "Stable"};
};
class GVAR(keepLocalSettingsSynced) {
typeName = "BOOL";
value = 1;

View File

@ -196,13 +196,21 @@ class CfgVehicles {
class consumeItem_PAK {
displayName = CSTRING(AdvancedMedicalSettings_consumeItem_PAK_DisplayName);
description = CSTRING(AdvancedMedicalSettings_consumeItem_PAK_Description);
typeName = "NUMBER";
class values {
class keep { name = CSTRING(No); value = 0; };
class remove { name = CSTRING(Yes); value = 1; default = 1; };
};
};
class useCondition_PAK {
displayName = CSTRING(AdvancedMedicalSettings_useCondition_PAK_DisplayName);
description = CSTRING(AdvancedMedicalSettings_useCondition_PAK_Description);
typeName = "NUMBER";
class values {
class AnyTime { name = CSTRING(AnyTime); value = 0; };
class Stable { name = CSTRING(Stable); value = 1; default = 1; };
};
};
class useLocation_PAK {
displayName = CSTRING(AdvancedMedicalSettings_useLocation_PAK_DisplayName);
description = CSTRING(AdvancedMedicalSettings_useLocation_PAK_Description);
@ -227,15 +235,23 @@ class CfgVehicles {
displayName = CSTRING(AdvancedMedicalSettings_useLocation_SurgicalKit_DisplayName);
description = CSTRING(AdvancedMedicalSettings_useLocation_SurgicalKit_Description);
};
class useCondition_SurgicalKit: useCondition_PAK {
displayName = CSTRING(AdvancedMedicalSettings_useCondition_SurgicalKit_DisplayName);
description = CSTRING(AdvancedMedicalSettings_useCondition_SurgicalKit_Description);
class values {
class AnyTime { name = CSTRING(AnyTime); value = 0; default = 1; };
class Stable { name = CSTRING(Stable); value = 1; };
};
};
class healHitPointAfterAdvBandage {
displayName = CSTRING(AdvancedMedicalSettings_healHitPointAfterAdvBandage_DisplayName);
description = CSTRING(AdvancedMedicalSettings_healHitPointAfterAdvBandage_Description);
description = CSTRING(AdvancedMedicalSettings_healHitPointAfterAdvBandage_Description);
typeName = "BOOL";
defaultValue = 0;
};
class painIsOnlySuppressed {
displayName = CSTRING(AdvancedMedicalSettings_painIsOnlySuppressed_DisplayName);
description = CSTRING(AdvancedMedicalSettings_painIsOnlySuppressed_Description);
description = CSTRING(AdvancedMedicalSettings_painIsOnlySuppressed_Description);
typeName = "BOOL";
defaultValue = 1;
};

View File

@ -92,7 +92,7 @@ GVAR(effectTimeBlood) = ACE_time;
[{
private["_bleeding", "_blood"];
// Zeus interface is open or player is dead; disable everything
if (!(isNull (findDisplay 312)) or !(alive ACE_player)) exitWith {
if (!(isNull curatorCamera) or !(alive ACE_player)) exitWith {
GVAR(effectUnconsciousCC) ppEffectEnable false;
GVAR(effectUnconsciousRB) ppEffectEnable false;
GVAR(effectBlindingCC) ppEffectEnable false;
@ -174,52 +174,54 @@ GVAR(lastHeartBeatSound) = ACE_time;
if ((ACE_time > GVAR(lastHeartBeat) + _interval)) then {
GVAR(lastHeartBeat) = ACE_time;
// Pain effect
_strength = (_pain - (ACE_player getvariable [QGVAR(painSuppress), 0])) max 0;
_strength = _strength * (ACE_player getVariable [QGVAR(painCoefficient), GVAR(painCoefficient)]);
if (GVAR(painEffectType) == 1) then {
GVAR(effectPainCC) ppEffectEnable false;
if (_pain > (ACE_player getvariable [QGVAR(painSuppress), 0]) && {alive ACE_player}) then {
_strength = _strength * 0.15;
GVAR(effectPainCA) ppEffectEnable true;
GVAR(effectPainCA) ppEffectAdjust [_strength, _strength, false];
GVAR(effectPainCA) ppEffectCommit 0.01;
[{
GVAR(effectPainCA) ppEffectAdjust [(_this select 0), (_this select 0), false];
GVAR(effectPainCA) ppEffectCommit (_this select 1);
}, [_strength * 0.1, _interval * 0.2], _interval * 0.05, 0] call EFUNC(common,waitAndExecute);
[{
GVAR(effectPainCA) ppEffectAdjust [(_this select 0), (_this select 0), false];
// Pain effect, no pain effect in zeus camera
if (isNull curatorCamera) then {
_strength = (_pain - (ACE_player getvariable [QGVAR(painSuppress), 0])) max 0;
_strength = _strength * (ACE_player getVariable [QGVAR(painCoefficient), GVAR(painCoefficient)]);
if (GVAR(painEffectType) == 1) then {
GVAR(effectPainCC) ppEffectEnable false;
if (_pain > (ACE_player getvariable [QGVAR(painSuppress), 0]) && {alive ACE_player}) then {
_strength = _strength * 0.15;
GVAR(effectPainCA) ppEffectEnable true;
GVAR(effectPainCA) ppEffectAdjust [_strength, _strength, false];
GVAR(effectPainCA) ppEffectCommit 0.01;
}, [_strength * 0.7], _interval * 0.3, 0] call EFUNC(common,waitAndExecute);
[{
GVAR(effectPainCA) ppEffectAdjust [(_this select 0), (_this select 0), false];
GVAR(effectPainCA) ppEffectCommit (_this select 1);
}, [_strength * 0.1, _interval * 0.55], _interval * 0.4, 0] call EFUNC(common,waitAndExecute);
[{
GVAR(effectPainCA) ppEffectAdjust [(_this select 0), (_this select 0), false];
GVAR(effectPainCA) ppEffectCommit (_this select 1);
}, [_strength * 0.1, _interval * 0.2], _interval * 0.05, 0] call EFUNC(common,waitAndExecute);
[{
GVAR(effectPainCA) ppEffectAdjust [(_this select 0), (_this select 0), false];
GVAR(effectPainCA) ppEffectCommit 0.01;
}, [_strength * 0.7], _interval * 0.3, 0] call EFUNC(common,waitAndExecute);
[{
GVAR(effectPainCA) ppEffectAdjust [(_this select 0), (_this select 0), false];
GVAR(effectPainCA) ppEffectCommit (_this select 1);
}, [_strength * 0.1, _interval * 0.55], _interval * 0.4, 0] call EFUNC(common,waitAndExecute);
} else {
GVAR(effectPainCA) ppEffectEnable false;
};
} else {
GVAR(effectPainCA) ppEffectEnable false;
};
} else {
GVAR(effectPainCA) ppEffectEnable false;
if (_pain > (ACE_player getvariable [QGVAR(painSuppress), 0]) && {alive ACE_player}) then {
_strength = _strength * 0.9;
GVAR(effectPainCC) ppEffectEnable true;
GVAR(effectPainCC) ppEffectAdjust [1,1,0, [1,1,1,1], [0,0,0,0], [1,1,1,1], [1 - _strength,1 - _strength,0,0,0,0.2,2]];
GVAR(effectPainCC) ppEffectCommit 0.01;
[{
GVAR(effectPainCC) ppEffectAdjust [1,1,0, [1,1,1,1], [0,0,0,0], [1,1,1,1], [1 - (_this select 0),1 - (_this select 0),0,0,0,0.2,2]];
GVAR(effectPainCC) ppEffectCommit (_this select 1);
}, [_strength * 0.1, _interval * 0.2], _interval * 0.05, 0] call EFUNC(common,waitAndExecute);
[{
GVAR(effectPainCC) ppEffectAdjust [1,1,0, [1,1,1,1], [0,0,0,0], [1,1,1,1], [1 - (_this select 0),1 - (_this select 0),0,0,0,0.2,2]];
if (_pain > (ACE_player getvariable [QGVAR(painSuppress), 0]) && {alive ACE_player}) then {
_strength = _strength * 0.9;
GVAR(effectPainCC) ppEffectEnable true;
GVAR(effectPainCC) ppEffectAdjust [1,1,0, [1,1,1,1], [0,0,0,0], [1,1,1,1], [1 - _strength,1 - _strength,0,0,0,0.2,2]];
GVAR(effectPainCC) ppEffectCommit 0.01;
}, [_strength * 0.7], _interval * 0.3, 0] call EFUNC(common,waitAndExecute);
[{
GVAR(effectPainCC) ppEffectAdjust [1,1,0, [1,1,1,1], [0,0,0,0], [1,1,1,1], [1 - (_this select 0),1 - (_this select 0),0,0,0,0.2,2]];
GVAR(effectPainCC) ppEffectCommit (_this select 1);
}, [_strength * 0.1, _interval * 0.55], _interval * 0.4, 0] call EFUNC(common,waitAndExecute);
} else {
GVAR(effectPainCC) ppEffectEnable false;
[{
GVAR(effectPainCC) ppEffectAdjust [1,1,0, [1,1,1,1], [0,0,0,0], [1,1,1,1], [1 - (_this select 0),1 - (_this select 0),0,0,0,0.2,2]];
GVAR(effectPainCC) ppEffectCommit (_this select 1);
}, [_strength * 0.1, _interval * 0.2], _interval * 0.05, 0] call EFUNC(common,waitAndExecute);
[{
GVAR(effectPainCC) ppEffectAdjust [1,1,0, [1,1,1,1], [0,0,0,0], [1,1,1,1], [1 - (_this select 0),1 - (_this select 0),0,0,0,0.2,2]];
GVAR(effectPainCC) ppEffectCommit 0.01;
}, [_strength * 0.7], _interval * 0.3, 0] call EFUNC(common,waitAndExecute);
[{
GVAR(effectPainCC) ppEffectAdjust [1,1,0, [1,1,1,1], [0,0,0,0], [1,1,1,1], [1 - (_this select 0),1 - (_this select 0),0,0,0,0.2,2]];
GVAR(effectPainCC) ppEffectCommit (_this select 1);
}, [_strength * 0.1, _interval * 0.55], _interval * 0.4, 0] call EFUNC(common,waitAndExecute);
} else {
GVAR(effectPainCC) ppEffectEnable false;
};
};
};
};

View File

@ -56,6 +56,7 @@ PREP(isInMedicalFacility);
PREP(isInMedicalVehicle);
PREP(isMedic);
PREP(isMedicalVehicle);
PREP(isInStableCondition);
PREP(itemCheck);
PREP(modifyMedicalAction);
PREP(onMedicationUsage);

View File

@ -16,7 +16,7 @@
#include "script_component.hpp"
private ["_caller", "_target", "_selectionName", "_className", "_config", "_medicRequired", "_items", "_locations", "_return", "_condition"];
private ["_caller", "_target", "_selectionName", "_className", "_config", "_medicRequired", "_items", "_locations", "_return", "_condition", "_patientStateCondition"];
_caller = _this select 0;
_target = _this select 1;
_selectionName = _this select 2;
@ -44,7 +44,6 @@ if !([_caller, _medicRequired] call FUNC(isMedic)) exitwith {false};
_items = getArray (_config >> "items");
if (count _items > 0 && {!([_caller, _target, _items] call FUNC(hasItems))}) exitwith {false};
_locations = getArray (_config >> "treatmentLocations");
_return = true;
if (getText (_config >> "condition") != "") then {
@ -62,6 +61,14 @@ if (getText (_config >> "condition") != "") then {
};
if (!_return) exitwith {false};
_patientStateCondition = if (isText(_config >> "patientStateCondition")) then {
missionNamespace getvariable [getText(_config >> "patientStateCondition"), 0]
} else {
getNumber(_config >> "patientStateCondition")
};
if (_patientStateCondition == 1 && {!([_target] call FUNC(isInStableCondition))}) exitwith {false};
_locations = getArray (_config >> "treatmentLocations");
if ("All" in _locations) exitwith {true};
private [ "_medFacility", "_medVeh"];

View File

@ -16,7 +16,6 @@
private ["_unit","_return"];
_unit = _this select 0;
if (GVAR(level) == 1) exitwith {true};
if (isnil QGVAR(unconsciousConditions)) then {
GVAR(unconsciousConditions) = [];
};

View File

@ -58,10 +58,10 @@ if (isClass (_config >> _className)) then {
_bandagedWounds = _target getvariable [QGVAR(bandagedWounds), []];
_exist = false;
_injuryId = _injury select 0;
_injuryType = _injury select 1;
_bandagedInjury = [];
{
if ((_x select 0) == _injuryId) exitwith {
if ((_x select 1) == _injuryType && (_x select 2) == (_injury select 2)) exitwith {
_exist = true;
_existingInjury = _x;
_existingInjury set [3, (_existingInjury select 3) + _impact];
@ -73,16 +73,11 @@ _bandagedInjury = [];
if !(_exist) then {
// [ID, classID, bodypart, percentage treated, bloodloss rate]
_bandagedInjury = [_injuryId, _injury select 1, _injury select 2, _impact, _injury select 4];
_bandagedInjury = [_injury select 0, _injury select 1, _injury select 2, _impact, _injury select 4];
_bandagedWounds pushback _bandagedInjury;
};
_target setvariable [QGVAR(bandagedWounds), _bandagedWounds, !USE_WOUND_EVENT_SYNC];
if (USE_WOUND_EVENT_SYNC) then {
// sync _bandagedInjury
};
_target setvariable [QGVAR(bandagedWounds), _bandagedWounds, true];
// Check if we are ever going to reopen this
if (random(1) <= _reopeningChance) then {
@ -95,22 +90,19 @@ if (random(1) <= _reopeningChance) then {
_injuryIndex = _this select 3;
_injury = _this select 4;
if (alive _target) then {
//if (alive _target) then {
_openWounds = _target getvariable [QGVAR(openWounds), []];
if ((count _openWounds)-1 < _injuryIndex) exitwith {};
_selectedInjury = _openWounds select _injuryIndex;
if (_selectedInjury select 0 == _injury select 0) then { // matching the IDs
if (_selectedInjury select 1 == _injury select 1 && (_selectedInjury select 2) == (_injury select 2)) then { // matching the IDs
_selectedInjury set [3, (_selectedInjury select 3) + _impact];
_openWounds set [_injuryIndex, _selectedInjury];
_target setvariable [QGVAR(openWounds), _openWounds, !USE_WOUND_EVENT_SYNC];
if (USE_WOUND_EVENT_SYNC) then {
["medical_propagateWound", [_target, _selectedInjury]] call EFUNC(common,globalEvent);
};
_bandagedWounds = _target getvariable [QGVAR(bandagedWounds), []];
_exist = false;
_injuryId = _injury select 0;
_injuryId = _injury select 1;
{
if ((_x select 0) == _injuryId) exitwith {
if ((_x select 1) == _injuryId && (_x select 2) == (_injury select 2)) exitwith {
_exist = true;
_existingInjury = _x;
_existingInjury set [3, ((_existingInjury select 3) - _impact) max 0];
@ -119,10 +111,11 @@ if (random(1) <= _reopeningChance) then {
}foreach _bandagedWounds;
if (_exist) then {
_target setvariable [QGVAR(bandagedWounds), _bandagedWounds, !USE_WOUND_EVENT_SYNC];
_target setvariable [QGVAR(bandagedWounds), _bandagedWounds, true];
_target setvariable [QGVAR(openWounds), _openWounds, true];
};
};
// Otherwise something went wrong, we we don't reopen them..
};
}, [_target, _impact, _part, _injuryIndex, _injury], _delay, 0] call EFUNC(common,waitAndExecute);
//};
}, [_target, _impact, _part, _injuryIndex, +_injury], _delay, 0] call EFUNC(common,waitAndExecute);
};

View File

@ -80,10 +80,10 @@ if (GVAR(level) < 2) then {
} else {
_damageReturn = _damageReturn min 0.89;
};
};
[_unit] call FUNC(addToInjuredCollection);
if (_unit getVariable [QGVAR(preventInstaDeath), GVAR(preventInstaDeath)]) exitWith {
if (vehicle _unit != _unit and {damage (vehicle _unit) >= 1}) then {
[_unit] call EFUNC(common,unloadPerson);
@ -99,7 +99,7 @@ if (_unit getVariable [QGVAR(preventInstaDeath), GVAR(preventInstaDeath)]) exitW
if (_damageReturn >= 0.9 && {_selection in ["", "head", "body"]}) exitWith {
if (_unit getvariable ["ACE_isUnconscious", false]) exitwith {
[_unit] call FUNC(setDead);
0.89
0.89;
};
if (_delayedUnconsicous) then {
[{
@ -110,9 +110,9 @@ if (_unit getVariable [QGVAR(preventInstaDeath), GVAR(preventInstaDeath)]) exitW
[_this select 0, true] call FUNC(setUnconscious);
}, [_unit]] call EFUNC(common,execNextFrame);
};
0.89
0.89;
};
_damageReturn min 0.89;
0.89;
};
if (((_unit getVariable [QGVAR(enableRevive), GVAR(enableRevive)]) > 0) && {_damageReturn >= 0.9} && {_selection in ["", "head", "body"]}) exitWith {
@ -120,8 +120,7 @@ if (((_unit getVariable [QGVAR(enableRevive), GVAR(enableRevive)]) > 0) && {_dam
[_unit] call EFUNC(common,unloadPerson);
};
[_unit] call FUNC(setDead);
0.89
0.89;
};
_damageReturn
_damageReturn;

View File

@ -39,8 +39,6 @@ _damageBodyParts = _unit getvariable [QGVAR(bodyPartStatus), [0,0,0,0,0,0]];
_damageBodyParts set [_part, (_damageBodyParts select _part) + _newDamage];
_unit setvariable [QGVAR(bodyPartStatus), _damageBodyParts, true];
[_unit] call FUNC(handleDamage_advancedSetDamage);
_typeOfDamage = [_typeOfProjectile] call FUNC(getTypeOfDamage);
[_unit, _selectionName, _newDamage, _typeOfProjectile, _typeOfDamage] call FUNC(handleDamage_assignWounds);

View File

@ -81,12 +81,17 @@ if (diag_frameno > (_unit getVariable [QGVAR(frameNo_damageCaching), -3]) + 2) t
_args = _this select 0;
if (diag_frameno > (_args select 1) + 2) then {
(_args select 0) setDamage 0;
_cache_params = (_args select 0) getVariable [QGVAR(cachedHandleDamageParams), []];
_cache_damages = (_args select 0) getVariable QGVAR(cachedDamages);
{
_params = _x + [_cache_damages select _foreachIndex];
_params call FUNC(handleDamage_advanced);
}foreach _cache_params;
[(_args select 0)] call FUNC(handleDamage_advancedSetDamage);
[(_this select 1)] call cba_fnc_removePerFrameHandler;
};
}, 0, [_unit, diag_frameno] ] call CBA_fnc_addPerFrameHandler;

View File

@ -0,0 +1,30 @@
/*
* Author: Glowbal
* Check if a unit is in a stable condition
*
* Arguments:
* 0: The patient <OBJECT>
*
* Return Value:
* Is in stable condition <BOOL>
*
* Public: No
*/
#include "script_component.hpp"
private ["_unit"];
_unit = _this select 0;
if (GVAR(level) <= 1) exitwith {
([_unit] call FUNC(getBloodloss)) == 0;
};
_totalBloodLoss = 0;
_openWounds = _unit getvariable [QGVAR(openWounds), []];
{
// total bleeding ratio * percentage of injury left
_totalBloodLoss = _totalBloodLoss + ((_x select 4) * (_x select 3));
}foreach _openWounds;
(_totalBloodLoss == 0);

View File

@ -33,5 +33,7 @@ if !(_activated) exitWith {};
[_logic, QGVAR(consumeItem_SurgicalKit), "consumeItem_SurgicalKit"] call EFUNC(common,readSettingFromModule);
[_logic, QGVAR(useLocation_PAK), "useLocation_PAK"] call EFUNC(common,readSettingFromModule);
[_logic, QGVAR(useLocation_SurgicalKit), "useLocation_SurgicalKit"] call EFUNC(common,readSettingFromModule);
[_logic, QGVAR(useCondition_PAK), "useCondition_PAK"] call EFUNC(common,readSettingFromModule);
[_logic, QGVAR(useCondition_SurgicalKit), "useCondition_SurgicalKit"] call EFUNC(common,readSettingFromModule);
[_logic, QGVAR(healHitPointAfterAdvBandage), "healHitPointAfterAdvBandage"] call EFUNC(common,readSettingFromModule);
[_logic, QGVAR(painIsOnlySuppressed), "painIsOnlySuppressed"] call EFUNC(common,readSettingFromModule);

View File

@ -49,7 +49,7 @@ if (((_reviveVal == 1 && {[_unit] call EFUNC(common,isPlayer)} || _reviveVal ==
_unit = _args select 0;
_startTime = _unit getvariable [QGVAR(reviveStartTime), 0];
if (ACE_time - _startTime > GVAR(maxReviveTime)) exitwith {
if (GVAR(maxReviveTime) > 0 && {ACE_time - _startTime > GVAR(maxReviveTime)}) exitwith {
[(_this select 1)] call cba_fnc_removePerFrameHandler;
_unit setvariable [QGVAR(inReviveState), nil, true];
_unit setvariable [QGVAR(reviveStartTime), nil];
@ -66,6 +66,11 @@ if (((_reviveVal == 1 && {[_unit] call EFUNC(common,isPlayer)} || _reviveVal ==
_unit setvariable [QGVAR(reviveStartTime), nil];
[(_this select 1)] call cba_fnc_removePerFrameHandler;
};
if (GVAR(level) >= 2) then {
if (_unit getvariable [QGVAR(heartRate), 60] > 0) then {
_unit setvariable [QGVAR(heartRate), 0];
};
};
}, 1, [_unit] ] call CBA_fnc_addPerFrameHandler;
false;
};

View File

@ -6,10 +6,14 @@
* 0: The unit that will be put in an unconscious state <OBJECT>
* 1: Set unconsciouns <BOOL> <OPTIONAL>
* 2: Minimum unconscious ACE_time <NUMBER> <OPTIONAL>
* 3: Force AI Unconscious (skip random death chance) <BOOL> <OPTIONAL>
*
* ReturnValue:
* nil
*
* Example:
* [bob, true] call ace_medical_fnc_setUnconscious;
*
* Public: yes
*/

View File

@ -16,7 +16,7 @@
#include "script_component.hpp"
private ["_caller", "_target", "_selectionName", "_className", "_config", "_medicRequired", "_items", "_locations", "_return", "_callbackProgress", "_treatmentTime", "_callerAnim", "_patientAnim", "_iconDisplayed", "_return", "_usersOfItems", "_consumeItems", "_condition", "_displayText", "_wpn", "_treatmentTimeConfig"];
private ["_caller", "_target", "_selectionName", "_className", "_config", "_medicRequired", "_items", "_locations", "_return", "_callbackProgress", "_treatmentTime", "_callerAnim", "_patientAnim", "_iconDisplayed", "_return", "_usersOfItems", "_consumeItems", "_condition", "_displayText", "_wpn", "_treatmentTimeConfig", "_patientStateCondition"];
_caller = _this select 0;
_target = _this select 1;
_selectionName = _this select 2;
@ -53,9 +53,6 @@ if !([_caller, _medicRequired] call FUNC(isMedic)) exitwith {false};
_items = getArray (_config >> "items");
if (count _items > 0 && {!([_caller, _target, _items] call FUNC(hasItems))}) exitwith {false};
// Check allowed locations
_locations = getArray (_config >> "treatmentLocations");
_return = true;
if (isText (_config >> "Condition")) then {
_condition = getText(_config >> "condition");
@ -74,6 +71,16 @@ if (isText (_config >> "Condition")) then {
};
if (!_return) exitwith {false};
_patientStateCondition = if (isText(_config >> "patientStateCondition")) then {
missionNamespace getvariable [getText(_config >> "patientStateCondition"), 0]
} else {
getNumber(_config >> "patientStateCondition")
};
if (_patientStateCondition == 1 && {!([_target] call FUNC(isInStableCondition))}) exitwith {false};
// Check allowed locations
_locations = getArray (_config >> "treatmentLocations");
if ("All" in _locations) then {
_return = true;
} else {

View File

@ -23,7 +23,7 @@ _selectionName = _this select 2;
_className = _this select 3;
_items = _this select 4;
// TODO replace by event system instead
[[_caller, _target], QUOTE(DFUNC(treatmentAdvanced_CPRLocal)), _target] call EFUNC(common,execRemoteFnc); /* TODO Replace by event system */
if (alive _target && {(_target getvariable [QGVAR(inCardiacArrest), false] || _target getvariable [QGVAR(inReviveState), false])}) then {
[[_caller, _target], QUOTE(DFUNC(treatmentAdvanced_CPRLocal)), _target] call EFUNC(common,execRemoteFnc); /* TODO Replace by event system */
};
true;

View File

@ -14,17 +14,15 @@
#include "script_component.hpp"
private ["_caller","_target", "_n"];
private ["_caller","_target", "_reviveStartTime"];
_caller = _this select 0;
_target = _this select 1;
_n = _target getvariable [QEGVAR(common,ENABLE_REVIVE_COUNTER),0];
if (_n > 0) then {
_n = _n - random(20);
if (_n < 0) then {
_n = 0;
if (_target getvariable [QGVAR(inReviveState), false]) exitwith {
_reviveStartTime = _target getvariable [QGVAR(reviveStartTime),0];
if (_reviveStartTime > 0) then {
_target setvariable [QGVAR(reviveStartTime), (_reviveStartTime + random(20)) min ACE_time];
};
_target setvariable [QEGVAR(common,ENABLE_REVIVE_COUNTER), _n];
};
if (random(1)>= 0.6) exitwith {

View File

@ -60,4 +60,4 @@ if (isNil _callback) then {
_args call _callback;
_args call FUNC(createLitter);
// _args call FUNC(createLitter);

View File

@ -2918,11 +2918,15 @@
<English>Remote Controlled AI</English>
<Spanish>IA controlada remotamente</Spanish>
<Portuguese>IA controlada remotamente</Portuguese>
<Polish>Zdalnie sterowane AI</Polish>
<Czech>Vzdáleně ovládané AI</Czech>
</Key>
<Key ID="STR_ACE_Medical_MedicalSettings_remoteControlledAI_Description">
<English>Treat remote controlled units as AI not players?</English>
<Spanish>¿Tratar unidades remotamente controladas como IA?</Spanish>
<Portuguese>Tratar unidades remotamente controladas como IA?</Portuguese>
<Polish>Traktuj jednostki zdalnie sterowane (przez Zeusa) jako AI, nie jako graczy?</Polish>
<Czech>Ošetřit vzdáleně ovládané jednotky jako AI, ne jako hráče?</Czech>
</Key>
<Key ID="STR_ACE_Medical_disabled">
<English>Disabled</English>
@ -3177,14 +3181,24 @@
<Portuguese>Localizações do KPS</Portuguese>
</Key>
<Key ID="STR_ACE_Medical_AdvancedMedicalSettings_useLocation_PAK_Description">
<English>Where can the personal aid kit be used?</English>
<English>Where can the Personal Aid Kit be used?</English>
<Russian>Где может использоваться аптечка?</Russian>
<Polish>Gdzie można korzystać z apteczek osobistych?</Polish>
<Spanish>¿Dónde se puede utilizar el equipo de primeros auxilios?</Spanish>
<German>Wo kann der Erstehilfekasten verwendet werden?</German>
<Czech>Kde může být osobní lékárnička použita?</Czech>
<Czech>Kde může být použita osobní lékárnička?</Czech>
<Portuguese>Onde o kit de primeiros socorros pode ser utilizado?</Portuguese>
</Key>
<Key ID="STR_ACE_Medical_AdvancedMedicalSettings_useCondition_PAK_DisplayName">
<English>Condition PAK</English>
<Czech>Podmínka osobní lékárničky</Czech>
<Spanish>Condición EPA</Spanish>
</Key>
<Key ID="STR_ACE_Medical_AdvancedMedicalSettings_useCondition_PAK_Description">
<English>When can the Personal Aid Kit be used?</English>
<Czech>Kde může být použita osobní lékárnička?</Czech>
<Spanish>¿Cuando se puede utilizar el Equipo de primeros auxilios?</Spanish>
</Key>
<Key ID="STR_ACE_Medical_AdvancedMedicalSettings_anywhere">
<English>Anywhere</English>
<Russian>Где угодно</Russian>
@ -3284,6 +3298,16 @@
<Czech>Kde může být použita chirurgická souprava?</Czech>
<Portuguese>Onde o kit cirúrgico pode ser utilizado?</Portuguese>
</Key>
<Key ID="STR_ACE_Medical_AdvancedMedicalSettings_useCondition_SurgicalKit_DisplayName">
<English>Condition Surgical kit (Adv)</English>
<Czech>Podmínka chirurgické soupravy (Pokr.)</Czech>
<Spanish>Condición de equipo quirúrgico (Av)</Spanish>
</Key>
<Key ID="STR_ACE_Medical_AdvancedMedicalSettings_useCondition_SurgicalKit_Description">
<English>When can the Surgical kit be used?</English>
<Czech>Kde může být použita chirurgická souprava?</Czech>
<Spanish>¿Cuando se puede utilizar el equipo quirúrgico?</Spanish>
</Key>
<Key ID="STR_ACE_Medical_AdvancedMedicalSettings_healHitPointAfterAdvBandage_DisplayName">
<English>Bloodstains</English>
<German>Blutflecken</German>
@ -3434,9 +3458,7 @@
<Portuguese>É médico</Portuguese>
</Key>
<Key ID="STR_ACE_Medical_AssignMedicRoles_role_Description">
<English></English>
<Russian></Russian>
<Polish></Polish>
<Polish>Moduł ten pozwala przypisać klasę medyczną wybranym jednostkom.</Polish>
<German>Dieses Modul legt fest welche Einheit ein Sanitäter ist.</German>
<Czech>Tento modul určuje, která jednotka je zdravotník.</Czech>
<Portuguese>Este módulo determina qual unidade é um paramédico.</Portuguese>
@ -3609,5 +3631,15 @@
<Portuguese>Não</Portuguese>
<Italian>No</Italian>
</Key>
<Key ID="STR_ACE_Medical_AnyTime">
<English>Anytime</English>
<Czech>Kdykoli</Czech>
<Spanish>Siempre</Spanish>
</Key>
<Key ID="STR_ACE_Medical_Stable">
<English>Stable</English>
<Czech>Stabilní</Czech>
<Spanish>Estable</Spanish>
</Key>
</Package>
</Project>

View File

@ -26,12 +26,8 @@
_function = missionNamespace getvariable _function;
};
if (_isGlobal) then {
[_logic, [], true] call _function;
} else {
if (isServer) then {
[_logic, [], true] call _function;
};
if (_isGlobal || isServer) then {
[_logic, (synchronizedObjects _logic), true] call _function;
};
if !(_isPersistent) then {

View File

@ -35,7 +35,7 @@ if ((_iconType == ICON_NAME_SPEAK) || (_iconType == ICON_SPEAK)) then {
_alpha = _alpha max 0.6;//Boost alpha when speaking
} else {
if (_iconType == ICON_NAME_RANK) then {
_icon = TEXTURES_RANKS select ((["PRIVATE", "CORPORAL", "SERGEANT", "LIEUTENANT", "CAPTAIN", "MAJOR", "COLONEL"] find (rank _target)) + 1);
_icon = format["\A3\Ui_f\data\GUI\Cfg\Ranks\%1_gs.paa",(toLower(rank _target))];
_size = 1;
};
};

View File

@ -16,15 +16,3 @@
#define ICON_NAME_RANK 2
#define ICON_NAME_SPEAK 3
#define ICON_SPEAK 4
//todo?: custom rank icons??
#define TEXTURES_RANKS [ \
"", \
"\A3\Ui_f\data\GUI\Cfg\Ranks\private_gs.paa", \
"\A3\Ui_f\data\GUI\Cfg\Ranks\corporal_gs.paa", \
"\A3\Ui_f\data\GUI\Cfg\Ranks\sergeant_gs.paa", \
"\A3\Ui_f\data\GUI\Cfg\Ranks\lieutenant_gs.paa", \
"\A3\Ui_f\data\GUI\Cfg\Ranks\captain_gs.paa", \
"\A3\Ui_f\data\GUI\Cfg\Ranks\major_gs.paa", \
"\A3\Ui_f\data\GUI\Cfg\Ranks\colonel_gs.paa" \
]

View File

@ -347,11 +347,15 @@
<English>ACE News</English>
<Spanish>Noticias ACE</Spanish>
<Portuguese>Notícias do ACE</Portuguese>
<Polish>Wiadomości ACE</Polish>
<Czech>ACE Novinky</Czech>
</Key>
<Key ID="STR_ACE_OptionsMenu_showNewsOnMainMenu_name">
<English>Show News on Main Menu</English>
<Spanish>Mostrar noticias en el menú principal</Spanish>
<Portuguese>Mostrar notícias no menu principal</Portuguese>
<Polish>Pokazuj wiadomości ACE w menu głównym</Polish>
<Czech>Zobrazit novinky v hlavním menu</Czech>
</Key>
</Package>
</Project>

View File

@ -38,7 +38,7 @@ _onSuccess = {
};
_onFailure = {
[localize LESTRING(common,ActionAborted)] call DEFUNC(common,displayTextStructured);
[localize ELSTRING(common,ActionAborted)] call DEFUNC(common,displayTextStructured);
};
_condition = {

View File

@ -1,5 +1,5 @@
class CfgAddons {
class GVAR(Rallypoints) {
list[] = { "ACE_Rallypoint_West", "ACE_Rallypoint_East", "ACE_Rallypoint_Independent", "ACE_RallypointExit_West", "ACE_RallypointExit_East", "ACE_RallypointExit_Independent" };
list[] = {"ACE_Rallypoint_West", "ACE_Rallypoint_East", "ACE_Rallypoint_Independent", "ACE_Rallypoint_West_Base", "ACE_Rallypoint_East_Base", "ACE_Rallypoint_Independent_Base"};
};
};

View File

@ -3,7 +3,7 @@
class CfgPatches {
class ADDON {
units[] = {};
weapons[] = { "ACE_Rallypoint_West", "ACE_Rallypoint_East", "ACE_Rallypoint_Independent", "ACE_RallypointExit_West", "ACE_RallypointExit_East", "ACE_RallypointExit_Independent" };
weapons[] = {"ACE_Rallypoint_West", "ACE_Rallypoint_East", "ACE_Rallypoint_Independent", "ACE_Rallypoint_West_Base", "ACE_Rallypoint_East_Base", "ACE_Rallypoint_Independent_Base"};
requiredVersion = REQUIRED_VERSION;
requiredAddons[] = { "ace_common" };
author[] = { "bux578", "commy2" };

View File

@ -26,10 +26,12 @@ private ["_rallypoint", "_position"];
_rallypoint = [
objNull,
missionNamespace getVariable ["ACE_Rallypoint_West", objNull],
missionNamespace getVariable ["ACE_RallypointExit_East", objNull],
missionNamespace getVariable ["ACE_RallypointExit_Independent", objNull]
missionNamespace getVariable ["ACE_Rallypoint_East", objNull],
missionNamespace getVariable ["ACE_Rallypoint_Independent", objNull]
] select ([west, east, independent] find _side) + 1;
TRACE_3("moving rally",_unit, _rallypoint, (typeOf _rallypoint));
if (isNull _rallypoint) exitWith {};
_position = getPosATL _unit;

View File

@ -14,7 +14,7 @@ if (!hasInterface) exitWith {};
// Conditions: canInteract
if !([ACE_player, objNull, ["isNotEscorting"]] call EFUNC(common,canInteractWith)) exitWith {false};
// Conditions: specific
if !([ACE_player] call EFUNC(common,canUseWeapon)) exitWith {false};
if !([ACE_player] call EFUNC(common,canUseWeapon) && {currentWeapon ACE_player != binocular ACE_player}) exitWith {false};
// Statement
[ACE_player, currentWeapon ACE_player, currentMuzzle ACE_player] call FUNC(lockSafety);

View File

@ -6,7 +6,7 @@
<German>Sandsack</German>
<Russian>Мешок с песком</Russian>
<Polish>Worek z piaskiem</Polish>
<Spanish>Sandbag</Spanish>
<Spanish>Saco de arena</Spanish>
<French>Sac de sable</French>
<Czech>Pytel s pískem</Czech>
<Italian>Sacco di Sabbia</Italian>
@ -18,7 +18,7 @@
<German>Sandsack (leer)</German>
<Russian>Мешок с песком (пустой)</Russian>
<Polish>Worek na piasek</Polish>
<Spanish>Sandbag (empty)</Spanish>
<Spanish>Saco de arena (vacio)</Spanish>
<French>Sac de sable (vide)</French>
<Czech>Pytel na písek (prázdný)</Czech>
<Italian>Sacco di Sabbia (Vuoto)</Italian>
@ -30,7 +30,7 @@
<German>Nicht möglich</German>
<Russian>Установка на этом месте невозможна</Russian>
<Polish>Nie można tu budować</Polish>
<Spanish>Cannot build here</Spanish>
<Spanish>No se puede construir aqui</Spanish>
<French>Impossible de construire ici</French>
<Czech>Zde nelze postavit</Czech>
<Italian>Impossibile costruire qui</Italian>
@ -42,7 +42,7 @@
<German>Sandsack abbauen</German>
<Russian>Взять мешок с песком</Russian>
<Polish>Zabierz worek</Polish>
<Spanish>Pick up sandbag</Spanish>
<Spanish>Coger saco de arena</Spanish>
<French>Prendre sac de sable</French>
<Czech>Zvednout pytel</Czech>
<Italian>Prendi Sacco di Sabbia</Italian>
@ -54,7 +54,7 @@
<German>Sandsack tragen</German>
<Russian>Нести мешок с песком</Russian>
<Polish>Przenieś worek</Polish>
<Spanish>Carry sandbag</Spanish>
<Spanish>Portar saco de arena</Spanish>
<French>Porter sac de sable</French>
<Czech>Nést pytel</Czech>
<Italian>Trasporta Sacco di Sabbia</Italian>
@ -66,7 +66,7 @@
<German>Tragen beenden</German>
<Russian>Завершить переноску</Russian>
<Polish>Zostaw worek</Polish>
<Spanish>End carrying</Spanish>
<Spanish>Dejar de portar</Spanish>
<French>Arreter de porter</French>
<Czech>Položit</Czech>
<Italian>Fine Trasporto</Italian>
@ -78,7 +78,7 @@
<German>Sandsack ablegen</German>
<Russian>Положить мешок</Russian>
<Polish>Upuść worek</Polish>
<Spanish>Drop sandbag</Spanish>
<Spanish>Soltar saco de arena</Spanish>
<French>Lacher sac de sable</French>
<Czech>Odložit pytel</Czech>
<Italian>Lascia Sacco di Sabbia</Italian>
@ -90,7 +90,7 @@
<German>Aufbauen</German>
<Russian>Подтвердить установку</Russian>
<Polish>Potwierdź rozłożenie</Polish>
<Spanish>Confirm Deployment</Spanish>
<Spanish>Confirmar despliegue</Spanish>
<French>Confirmer Déploiement</French>
<Czech>Potvrdit Položení</Czech>
<Italian>Conferma Posizionamento</Italian>
@ -102,7 +102,7 @@
<German>Abbrechen</German>
<Russian>Отменить установку</Russian>
<Polish>Anuluj rozłożenie</Polish>
<Spanish>Cancel Deployment</Spanish>
<Spanish>Cancelar despliegue</Spanish>
<French>Annuler Déploiement</French>
<Czech>Zrušit Položení</Czech>
<Italian>Cancella Posizionamento</Italian>
@ -114,7 +114,7 @@
<German>Sandsack aufbauen</German>
<Russian>Установить мешок с песком</Russian>
<Polish>Rozłóż worek z piaskiem</Polish>
<Spanish>Deploy sandbag</Spanish>
<Spanish>Desplegar saco de arena</Spanish>
<French>Deployer sac de sable</French>
<Czech>Umístit pytel</Czech>
<Italian>Posiziona Sacco di Sabbia</Italian>
@ -126,7 +126,7 @@
<German>Sandsack Kiste</German>
<Russian>Ящик мешков с песком</Russian>
<Polish>Skrzynia worków na piasek</Polish>
<Spanish>Sandbag box</Spanish>
<Spanish>Caja de sacos de arena</Spanish>
<French>Caisse de sacs de sable</French>
<Czech>Bedna na pytle s pískem</Czech>
<Italian>Contenitore Sacchi di Sabbia</Italian>
@ -138,7 +138,7 @@
<German>Hier gibt es keinen Sand</German>
<Russian>Здесь нет песка</Russian>
<Polish>Tu nie ma piasku</Polish>
<Spanish>Here is no sand</Spanish>
<Spanish>Aqui no hay arena</Spanish>
<French>Pas de sable ici</French>
<Czech>Tady není písek</Czech>
<Italian>Qui non cè Sabbia</Italian>

View File

@ -63,7 +63,7 @@ class CfgVehicles {
GVAR(sitRotation) = 10;
};
// Camping Chair
class Land_CampingChair_V2_F: ThingX {
class Land_CampingChair_V2_F: ThingX {
XEH_ENABLED;
MACRO_SEAT_ACTION
GVAR(canSit) = 1;
@ -71,44 +71,8 @@ class CfgVehicles {
GVAR(sitPosition[]) = {0, -0.1, -0.45};
GVAR(sitRotation) = 45;
};
// Chair (Plastic)
class Land_ChairPlastic_F: ThingX {
XEH_ENABLED;
MACRO_SEAT_ACTION
GVAR(canSit) = 1;
GVAR(sitDirection) = 90;
GVAR(sitPosition[]) = {0, 0, -0.5};
GVAR(sitRotation) = 5;
};
// Chair (Wooden)
class Land_ChairWood_F: ThingX {
XEH_ENABLED;
MACRO_SEAT_ACTION
GVAR(canSit) = 1;
GVAR(sitDirection) = 180;
GVAR(sitPosition[]) = {0, -0.05, 0};
GVAR(sitRotation) = 75;
};
// Office Chair
class Land_OfficeChair_01_F: ThingX {
XEH_ENABLED;
MACRO_SEAT_ACTION
GVAR(canSit) = 1;
GVAR(sitDirection) = 180;
GVAR(sitPosition[]) = {0, 0, -0.6};
GVAR(sitRotation) = 15;
};
// Rattan Chair
class Land_RattanChair_01_F: ThingX {
XEH_ENABLED;
MACRO_SEAT_ACTION
GVAR(canSit) = 1;
GVAR(sitDirection) = 180;
GVAR(sitPosition[]) = {0, -0.1, -1}; // Z must be -1 due to chair's geometry (magic floating seat point)
GVAR(sitRotation) = 2;
};
// Field Toilet
class Land_FieldToilet_F: ThingX {
class Land_FieldToilet_F: ThingX {
XEH_ENABLED;
MACRO_SEAT_ACTION
GVAR(canSit) = 1;
@ -117,7 +81,7 @@ class CfgVehicles {
GVAR(sitRotation) = 10;
};
// Toiletbox
class Land_ToiletBox_F: ThingX {
class Land_ToiletBox_F: ThingX {
XEH_ENABLED;
MACRO_SEAT_ACTION
GVAR(canSit) = 1;
@ -125,4 +89,42 @@ class CfgVehicles {
GVAR(sitPosition[]) = {0, 0.75, -1.1};
GVAR(sitRotation) = 10;
};
class Furniture_base_F;
// Chair (Plastic)
class Land_ChairPlastic_F: Furniture_base_F {
XEH_ENABLED;
MACRO_SEAT_ACTION
GVAR(canSit) = 1;
GVAR(sitDirection) = 90;
GVAR(sitPosition[]) = {0, 0, -0.5};
GVAR(sitRotation) = 5;
};
// Chair (Wooden)
class Land_ChairWood_F: Furniture_base_F {
XEH_ENABLED;
MACRO_SEAT_ACTION
GVAR(canSit) = 1;
GVAR(sitDirection) = 180;
GVAR(sitPosition[]) = {0, -0.05, 0};
GVAR(sitRotation) = 75;
};
// Office Chair
class Land_OfficeChair_01_F: Furniture_base_F {
XEH_ENABLED;
MACRO_SEAT_ACTION
GVAR(canSit) = 1;
GVAR(sitDirection) = 180;
GVAR(sitPosition[]) = {0, 0, -0.6};
GVAR(sitRotation) = 15;
};
// Rattan Chair
class Land_RattanChair_01_F: Furniture_base_F {
XEH_ENABLED;
MACRO_SEAT_ACTION
GVAR(canSit) = 1;
GVAR(sitDirection) = 180;
GVAR(sitPosition[]) = {0, -0.1, -1}; // Z must be -1 due to chair's geometry (magic floating seat point)
GVAR(sitRotation) = 2;
};
};

View File

@ -5,23 +5,36 @@
<English>Sit Down</English>
<Polish>Usiądź</Polish>
<Portuguese>Sentar</Portuguese>
<Czech>Sednout si</Czech>
<Spanish>Sentarse</Spanish>
</Key>
<Key ID="STR_ACE_Sitting_Stand">
<English>Stand Up</English>
<Polish>Wstań</Polish>
<Portuguese>Levantar</Portuguese>
<Czech>Vstát</Czech>
<Spanish>Levantarse</Spanish>
</Key>
<Key ID="STR_ACE_Sitting_Enable">
<English>Enable Sitting</English>
<Portuguese>Habilitar opção para sentar</Portuguese>
<Polish>Aktywuj siadanie</Polish>
<Czech>Povolit sezení</Czech>
<Spanish>Acivar asiento</Spanish>
</Key>
<Key ID="STR_ACE_Sitting_ModuleDisplayName">
<English>Sitting</English>
<Portuguese>Sentado</Portuguese>
<Polish>Siadanie</Polish>
<Czech>Sedící</Czech>
<Spanish>Sentarse</Spanish>
</Key>
<Key ID="STR_ACE_Sitting_ModuleDescription">
<English>This module allows you to disable the ability to sit on chairs and toilets.</English>
<Portuguese>Este módulo permite que você desabilite a capacidade de sentar-se em cadeiras e banheiros.</Portuguese>
<Polish>Moduł ten pozwala na włączenie lub wyłączenie możliwości siadania na krzesłach i toaletach.</Polish>
<Czech>Tento modul dovoluje zakázat možnost sedět na židlých a toaletách.</Czech>
<Spanish>Este módulo te permite desactivar la capacidad de sentarte en sillas y aseos.</Spanish>
</Key>
</Package>
</Project>

View File

@ -0,0 +1 @@
z\ace\addons\spectator

View File

@ -0,0 +1,26 @@
class ACE_Settings {
class GVAR(enabled) {
value = 0;
typeName = "BOOL";
};
class GVAR(limitSide) {
value = 0;
typeName = "BOOL";
};
class GVAR(AI) {
value = 0;
typeName = "BOOL";
};
class GVAR(tracking) {
value = 0;
typeName = "BOOL";
};
class GVAR(modulePos) {
value = 0;
typeName = "BOOL";
};
class GVAR(endMission) {
value = 0;
typeName = "BOOL";
};
};

View File

@ -0,0 +1,11 @@
class Extended_PreInit_EventHandlers {
class ADDON {
init = QUOTE(call COMPILE_FILE(XEH_preInit));
};
};
class Extended_PostInit_EventHandlers {
class ADDON {
init = QUOTE(call COMPILE_FILE(XEH_postInit));
};
};

View File

@ -0,0 +1,53 @@
class CfgVehicles {
class ACE_Module;
class ACE_ModuleSpectator: ACE_Module {
author = ECSTRING(common,ACETeam);
category = "ACE";
displayName = CSTRING(Module_DisplayName);
function = QFUNC(moduleSpectator);
scope = 2;
isGlobal = 1;
icon = PATHTOF(UI\Icon_Module_Spectator_ca.paa);
class Arguments {
class SpectatorEnabled {
displayName = CSTRING(Enabled_DisplayName);
description = CSTRING(Enabled_Description);
typeName = "BOOL";
defaultValue = 0;
};
class SpectatorPlayerSide {
displayName = CSTRING(PlayerSide_DisplayName);
description = CSTRING(PlayerSide_Description);
typeName = "BOOL";
defaultValue = 0;
};
class SpectatorAI {
displayName = CSTRING(AI_DisplayName);
description = CSTRING(AI_Description);
typeName = "BOOL";
defaultValue = 0;
};
class SpectatorTracking {
displayName = CSTRING(Tracking_DisplayName);
description = CSTRING(Tracking_Description);
typeName = "BOOL";
defaultValue = 0;
};
class SpectatorPos {
displayName = CSTRING(Pos_DisplayName);
description = CSTRING(Pos_Description);
typeName = "BOOL";
defaultValue = 0;
};
class SpectatorEnd {
displayName = CSTRING(End_DisplayName);
description = CSTRING(End_Description);
typeName = "BOOL";
defaultValue = 0;
};
};
class ModuleDescription {
description = CSTRING(Module_Description);
};
};
};

View File

@ -0,0 +1,10 @@
ace_spectator
=======
Spectator. Includes features from Splendid Cam, and much more.
## Maintainers
The people responsible for merging changes to this component or answering potential questions.
- [voiper](https://github.com/voiperr)

640
addons/spectator/UI.hpp Normal file
View File

@ -0,0 +1,640 @@
#define PIXEL_X (safeZoneWAbs / (getResolution select 0))
#define PIXEL_Y (safeZoneH / (getResolution select 1))
#define XHAIR RESUNITS_X * 4
#define COMPASS_W RESUNITS_X * 20
#define COMPASS_H COMPASS_W / 15
#define COMPASS_X RESCENTRE_X - COMPASS_W / 2
#define HELP_W RESUNITS_X * 75
#define HELP_H RESUNITS_Y * 75
class ace_spectator_overlay {
idd = 12200;
enableSimulation = 1;
movingEnable = 1;
enableDisplay = 1;
onLoad = "uiNamespace setVariable ['ace_spectator_overlay', _this select 0]; ['Init', _this] call ace_spectator_fnc_overlay";
class controls {
class Unitlist {
access = 0;
idc = 0;
type = CT_TREE;
style = ST_LEFT;
default = 0;
blinkingPeriod = 0;
x = QUOTE(safeZoneX);
y = QUOTE(safeZoneY + RESUNITS_X * 4/3);
w = QUOTE(RESUNITS_X * 30);
h = QUOTE(RESUNITS_Y * 50);
colorBorder[] = {1,1,1,1};
colorBackground[] = {0.1,0.1,0.1,1};
colorSelect[] = {1,0.5,0,1};
colorMarked[] = {1,0.5,0,0.5};
colorMarkedSelected[] = {1,0.5,0,1};
sizeEx = QUOTE(RESUNITS_Y * 2);
font = GUI_FONT_NORMAL;
shadow = 1;
colorText[] = {1,1,1,1};
colorSelectText[] = {1,1,1,1};
colorMarkedText[] = {1,1,1,1};
tooltip = "";
tooltipColorShade[] = {0,0,0,1};
tooltipColorText[] = {1,1,1,1};
tooltipColorBox[] = {1,1,1,1};
multiselectEnabled = 0;
expandOnDoubleclick = 0;
hiddenTexture = "A3\ui_f\data\gui\rsccommon\rsctree\hiddenTexture_ca.paa";
expandedTexture = "A3\ui_f\data\gui\rsccommon\rsctree\expandedTexture_ca.paa";
maxHistoryDelay = 1;
class ScrollBar {
width = 0;
height = 0;
scrollSpeed = 0.01;
arrowEmpty = "\A3\ui_f\data\gui\cfg\scrollbar\arrowEmpty_ca.paa";
arrowFull = "\A3\ui_f\data\gui\cfg\scrollbar\arrowFull_ca.paa";
border = "\A3\ui_f\data\gui\cfg\scrollbar\border_ca.paa";
thumb = "\A3\ui_f\data\gui\cfg\scrollbar\thumb_ca.paa";
color[] = {1,1,1,1};
};
colorDisabled[] = {0,0,0,0};
colorArrow[] = {0,0,0,0};
onDestroy = QUOTE(GVAR(mouseBusy) = false; false);
onMouseEnter = QUOTE(GVAR(mouseBusy) = true; false);
onMouseExit = QUOTE(GVAR(mouseBusy) = false; false);
onTreeDblClick = "['Select', _this] call ace_spectator_fnc_overlay; false";
};
};
};
class ace_spectator_vd {
idd = 12201;
enableSimulation = 1;
enableDisplay = 0;
movingEnable = 0;
onLoad = "uiNamespace setVariable ['ace_spectator_vd', _this select 0]; ['Init', _this] call ace_spectator_fnc_viewDistance";
class Controls {
class BG: vip_rsc_box {
x = QUOTE(safeZoneX + safeZoneW - RESUNITS_X * 30);
y = QUOTE(safeZoneY + COMPASS_H);
w = QUOTE(RESUNITS_X * 30);
h = QUOTE(COMPASS_H);
colorBackground[] = {0.1,0.1,0.1,1};
onDestroy = QUOTE(GVAR(mouseBusy) = false; false);
};
class TitleFrame: vip_rsc_frame {
x = QUOTE(safeZoneX + safeZoneW - RESUNITS_X * 30);
y = QUOTE(safeZoneY + COMPASS_H);
w = QUOTE(RESUNITS_X * 8);
h = QUOTE(COMPASS_H);
shadow = 2;
colorText[]={1,1,1,1};
};
class Title: vip_rsc_text {
style = ST_CENTER;
x = QUOTE(safeZoneX + safeZoneW - RESUNITS_X * 30);
y = QUOTE(safeZoneY + COMPASS_H);
w = QUOTE(RESUNITS_X * 8);
h = QUOTE(COMPASS_H);
sizeEx = QUOTE(RESUNITS_Y * 2);
font = GUI_FONT_NORMAL;
shadow = 2;
colorText[]={1,1,1,1};
text = CSTRING(VD_Title);
};
class DistanceFrame: TitleFrame {
x = QUOTE(safeZoneX + safeZoneW - RESUNITS_X * 10.5);
w = QUOTE(RESUNITS_X * 5);
};
class Distance: Title {
idc = 1;
x = QUOTE(safeZoneX + safeZoneW - RESUNITS_X * 10.5);
w = QUOTE(RESUNITS_X * 5);
text = "";
};
class ButtonExit: vip_rsc_button {
idc = 0;
style = ST_CENTER;
x = QUOTE(safeZoneX + safeZoneW - RESUNITS_X * 5);
y = QUOTE(safeZoneY + COMPASS_H);
w = QUOTE(RESUNITS_X * 5);
h = QUOTE(COMPASS_H);
colorBackground[] = {1,1,1,1};
sizeEx = QUOTE(RESUNITS_Y * 2);
font = GUI_FONT_NORMAL;
text = CSTRING(VD_Button);
onButtonClick = "closeDialog 0; false";
onMouseButtonDown = QUOTE(GVAR(mouseBusy) = true; false);
onMouseButtonUp = QUOTE(GVAR(mouseBusy) = false; false);
};
class Slider {
idc = 2;
type = CT_XSLIDER;
style = SL_HORZ;
shadow = 2;
x = QUOTE(safeZoneX + safeZoneW - RESUNITS_X * 21.5);
y = QUOTE(safeZoneY + COMPASS_H);
w = QUOTE(RESUNITS_X * 9.5);
h = QUOTE(COMPASS_H);
color[] = {1,1,1,1};
colorActive[] = {1,1,1,1};
colorDisabled[] = {1,1,1,0.2};
arrowEmpty = "\A3\ui_f\data\gui\cfg\slider\arrowEmpty_ca.paa";
arrowFull = "\A3\ui_f\data\gui\cfg\slider\arrowFull_ca.paa";
border = "\A3\ui_f\data\gui\cfg\slider\border_ca.paa";
thumb = "\A3\ui_f\data\gui\cfg\slider\thumb_ca.paa";
text = "";
onSliderPosChanged = "['Slider', _this] call ace_spectator_fnc_viewDistance";
onMouseButtonDown = QUOTE(GVAR(mouseBusy) = true; false);
onMouseButtonUp = QUOTE(GVAR(mouseBusy) = false; false);
};
};
};
class ace_spectator_map {
idd = 12202;
enableSimulation = 1;
enableDisplay = 0;
onLoad = "uiNameSpace setVariable ['ace_spectator_map', _this select 0]; ['Init', _this select 0] call ace_spectator_fnc_map";
onUnload = "['Close', _this select 0] call ace_spectator_fnc_map";
onKeyDown = "['KeyDown', _this] call ace_spectator_fnc_map";
class controls {
//changes stolen from ACE_map
class Map {
access = 0;
idc = 1;
type = CT_MAP_MAIN;
style = ST_PICTURE;
default = 0;
blinkingPeriod = 0;
x = safeZoneXAbs;
y = safeZoneY;
w = safeZoneWAbs;
h = safeZoneH;
sizeEx = GUI_GRID_CENTER_H;
font = GUI_FONT_NORMAL;
colorText[] = {0,0,0,1};
text = "#(argb,8,8,3)color(1,1,1,1)";
moveOnEdges = 1;
ptsPerSquareSea = 5;
ptsPerSquareTxt = 20;
ptsPerSquareCLn = 10;
ptsPerSquareExp = 10;
ptsPerSquareCost = 10;
ptsPerSquareFor = 9;
ptsPerSquareForEdge = 9;
ptsPerSquareRoad = 6;
ptsPerSquareObj = 9;
scaleMin = 0.001;
scaleMax = 1.0;
scaleDefault = 0.16;
alphaFadeStartScale = 2;
alphaFadeEndScale = 2;
maxSatelliteAlpha = 0.5;
colorBackground[] = {0.929412, 0.929412, 0.929412, 1.0};
colorOutside[] = {0.929412, 0.929412, 0.929412, 1.0};
colorSea[] = {0.4,0.6,0.8,0.5};
colorForest[] = {0.6, 0.8, 0.2, 0.25};
colorForestBorder[] = {0.6,0.8,0.4,1};
colorRocks[] = {0.50, 0.50, 0.50, 0.50};
colorRocksBorder[] = {0,0,0,1};
colorLevels[] = {0.0, 0.0, 0.0, 1.0};
colorMainCountlines[] = {0.858824, 0, 0,1};
colorCountlines[] = {0.647059, 0.533333, 0.286275, 1};
colorMainCountlinesWater[] = {0.5,0.6,0.7,0.6};
colorCountlinesWater[] = {0.5,0.6,0.7,0.3};
colorPowerLines[] = {0.1,0.1,0.1,1};
colorRailWay[] = {0.8,0.2,0,1};
colorNames[] = {1.1,0.1,1.1,0.9};
colorInactive[] = {1,1,0,0.5};
colorTracks[] = {0.2,0.13,0,1};
colorTracksFill[] = {1,0.88,0.65,0.3};
colorRoads[] = {0.2,0.13,0,1};
colorRoadsFill[] = {1,0.88,0.65,1};
colorMainRoads[] = {0.0,0.0,0.0,1};
colorMainRoadsFill[] = {0.94,0.69,0.2,1};
colorGrid[] = {0.05,0.1,0,0.6};
colorGridMap[] = {0.05,0.1,0,0.4};
fontLabel="PuristaMedium";
sizeExLabel="( ( ( ((safezoneW / safezoneH) min 1.2) / 1.2) / 25) * 0.8)";
fontGrid="TahomaB";
sizeExGrid = 0.032;
fontUnits="TahomaB";
sizeExUnits="( ( ( ((safezoneW / safezoneH) min 1.2) / 1.2) / 25) * 0.8)";
fontNames="EtelkaNarrowMediumPro";
sizeExNames="( ( ( ((safezoneW / safezoneH) min 1.2) / 1.2) / 25) * 0.8) * 2";
fontInfo="PuristaMedium";
sizeExInfo="( ( ( ((safezoneW / safezoneH) min 1.2) / 1.2) / 25) * 0.8)";
fontLevel="TahomaB";
sizeExLevel=0.03;
showCountourInterval = 1;
class Task {
icon = "#(argb,8,8,3)color(1,1,1,1)";
color[] = {1,1,0,1};
iconCreated = "#(argb,8,8,3)color(1,1,1,1)";
colorCreated[] = {0,0,0,1};
iconCanceled = "#(argb,8,8,3)color(1,1,1,1)";
colorCanceled[] = {0,0,0,0.5};
iconDone = "#(argb,8,8,3)color(1,1,1,1)";
colorDone[] = {0,1,0,1};
iconFailed = "#(argb,8,8,3)color(1,1,1,1)";
colorFailed[] = {1,0,0,1};
size = 8;
importance = 1;
coefMin = 1;
coefMax = 1;
};
class ActiveMarker { //includes icons spawned by drawIcon
color[] = {0,0,0,1};
size = 2;
coefMin = 1; //make sure icon doesnt scale
};
class Waypoint {
coefMax = 1;
coefMin = 4;
color[] = {0,0,0,1};
icon = "#(argb,8,8,3)color(0,0,0,1)";
importance = 1;
size = 2;
};
class WaypointCompleted: Waypoint{};
class CustomMark: Waypoint{};
class Command: Waypoint{};
class Bush {
icon = "";
color[] = {0.450000, 0.640000, 0.330000, 0.0};
size = 14;
importance = "0.2 * 14 * 0.05";
coefMin = 0.250000;
coefMax = 4;
};
class Rock: Waypoint{color[]={0.45,0.64,0.33,0.4}; importance="0.5 * 12 * 0.05";};
class SmallTree {
icon = "";
color[] = {0.450000, 0.640000, 0.330000, 0.0};
size = 12;
importance = "0.6 * 12 * 0.05";
coefMin = 0.250000;
coefMax = 4;
};
class Tree {
icon = "";
color[] = {0.450000, 0.640000, 0.330000, 0.0};
size = 12;
importance = "0.9 * 16 * 0.05";
coefMin = 0.250000;
coefMax = 4;
};
class Legend {
x = SafeZoneX+SafeZoneW-.340;
y = SafeZoneY+SafeZoneH-.152;
font = "PuristaMedium";
w = .340;
h = .152;
sizeEx = 0.039210;
colorBackground[] = {0.906000, 0.901000, 0.880000, 0.5};
color[] = {0, 0, 0, 0.75};
};
class BusStop: Waypoint{};
class FuelStation: Waypoint{};
class Hospital: Waypoint{};
class Church: Waypoint{};
class Lighthouse: Waypoint{};
class Power: Waypoint{};
class PowerSolar: Waypoint{};
class PowerWave: Waypoint{};
class PowerWind: Waypoint{};
class Quay: Waypoint{};
class Transmitter: Waypoint{};
class Watertower: Waypoint{};
class Cross: Waypoint{};
class Chapel: Waypoint{};
class Shipwreck: Waypoint{};
class Bunker: Waypoint{};
class Fortress: Waypoint{};
class Fountain: Waypoint{};
class Ruin: Waypoint{};
class Stack: Waypoint{};
class Tourism: Waypoint{};
class ViewTower: Waypoint{};
};
};
};
class RscTitles {
class ace_spectator_crosshair {
onLoad = "uiNamespace setVariable ['ace_spectator_crosshair', _this select 0]";
idd=-1;
movingEnable=0;
fadein=0;
fadeout=0;
duration=1e+011;
class controls {
class X: vip_rsc_picture {
idc = 0;
x = QUOTE(RESCENTRE_X - XHAIR / 2);
y = QUOTE(RESCENTRE_Y - XHAIR * 4/3 / 2);
w = QUOTE(XHAIR);
h = QUOTE(XHAIR * 4/3);
text = "\a3\ui_f\data\IGUI\Cfg\Cursors\select_target_ca.paa";
colorText[] = {1,1,1,0.8};
};
};
};
class ace_spectator_status {
onLoad = "uiNamespace setVariable ['ace_spectator_status', _this select 0]; [_this select 0] call ace_spectator_fnc_status";
idd = -1;
movingEnable=0;
fadein=0;
fadeout=0;
duration=1e+011;
class controls {
class BGRight: vip_rsc_box {
x = QUOTE(safeZoneX + safeZoneW - RESUNITS_X * 30);
y = QUOTE(safeZoneY);
w = QUOTE(RESUNITS_X * 30);
h = QUOTE(COMPASS_H);
colorBackground[] = {0.1,0.1,0.1,1};
};
class BGLeft: BGRight {
x = QUOTE(safeZoneX);
};
class SpeedFrame: vip_rsc_frame {
x = QUOTE(safeZoneX + safeZoneW - RESUNITS_X * 5);
y = QUOTE(safeZoneY);
w = QUOTE(RESUNITS_X * 5);
h = QUOTE(COMPASS_H);
shadow = 2;
colorText[]={1,1,1,1};
};
class Speed: vip_rsc_text {
idc = 0;
style = ST_CENTER;
x = QUOTE(safeZoneX + safeZoneW - RESUNITS_X * 5);
y = QUOTE(safeZoneY);
w = QUOTE(RESUNITS_X * 5);
h = QUOTE(COMPASS_H);
colorText[]={1,1,1,1};
sizeEx = QUOTE(RESUNITS_Y * 2);
font = GUI_FONT_NORMAL;
text = "";
};
class FovFrame: SpeedFrame {
x = QUOTE(safeZoneX + safeZoneW - RESUNITS_X * 10.5);
};
class Fov: Speed {
idc = 4;
x = QUOTE(safeZoneX + safeZoneW - RESUNITS_X * 10.5);
};
class TimeAccFrame: SpeedFrame {
x = QUOTE(safeZoneX + safeZoneW - RESUNITS_X * 21.5);
};
class TimeAcc: Speed {
idc = 5;
x = QUOTE(safeZoneX + safeZoneW - RESUNITS_X * 21.5);
};
class FocusFrame: SpeedFrame {
x = QUOTE(safeZoneX + safeZoneW - RESUNITS_X * 16);
};
class Focus: Speed {
idc = 6;
x = QUOTE(safeZoneX + safeZoneW - RESUNITS_X * 16);
};
class NameFrame: SpeedFrame {
x = QUOTE(safeZoneX);
w = QUOTE(RESUNITS_X * 24.5);
};
class Name: Speed {
idc = 1;
x = QUOTE(safeZoneX);
w = QUOTE(RESUNITS_X * 24.5);
};
class ModeFrame: SpeedFrame {
x = QUOTE(safeZoneX + RESUNITS_X * 25);
};
class Mode: Speed {
idc = 2;
x = QUOTE(safeZoneX + RESUNITS_X * 25);
};
class TimeFrame: SpeedFrame {
x = QUOTE(safeZoneX + safeZoneW - RESUNITS_X * 30);
w = QUOTE(RESUNITS_X * 8);
};
class Time: Speed {
idc = 3;
x = QUOTE(safeZoneX + safeZoneW - RESUNITS_X * 30);
w = QUOTE(RESUNITS_X * 8);
};
};
};
class ace_spectator_compass {
onLoad = "uiNamespace setVariable ['ace_spectator_compass', _this select 0]";
onUnload = "";
idd=-1;
movingEnable=0;
fadein=0;
fadeout=0;
duration=1e+011;
class controls {
class BG: vip_rsc_box {
x = QUOTE(COMPASS_X);
y = QUOTE(safeZoneY);
w = QUOTE(COMPASS_W);
h = QUOTE(COMPASS_H);
colorBackground[] = {0.1,0.1,0.1,1};
};
class 0_90: vip_rsc_picture {
idc = 1;
x = QUOTE(RESCENTRE_X);
y = QUOTE(safeZoneY);
w = QUOTE(COMPASS_W / 2);
h = QUOTE(COMPASS_H);
text = "A3\ui_f_curator\data\cfgIngameUI\compass\texture180_ca.paa";
};
class 90_180: 0_90 {
idc = 2;
x = QUOTE(RESCENTRE_X + COMPASS_W / 2);
text = "A3\ui_f_curator\data\cfgIngameUI\compass\texture270_ca.paa";
};
class 180_270: 0_90 {
idc = 3;
x = QUOTE(RESCENTRE_X + COMPASS_W);
text = "A3\ui_f_curator\data\cfgIngameUI\compass\texture0_ca.paa";
};
class 270_0: 0_90 {
idc = 4;
x = QUOTE(RESCENTRE_X + COMPASS_W * 1.5);
text = "A3\ui_f_curator\data\cfgIngameUI\compass\texture90_ca.paa";
};
class Post: vip_rsc_box {
x = QUOTE(COMPASS_X + COMPASS_W / 2);
y = QUOTE(safeZoneY);
w = QUOTE(PIXEL_X * 2);
h = QUOTE(COMPASS_H);
colorBackground[]={1,0,0,1};
};
class LeftBlocker: vip_rsc_box {
x = QUOTE(COMPASS_X - COMPASS_W / 2);
y = QUOTE(safeZoneY);
w = QUOTE(COMPASS_W / 2);
h = QUOTE(COMPASS_H);
colorBackground[] = {0.1,0.1,0.1,1};
};
class RightBlocker: LeftBlocker {
x = QUOTE(COMPASS_X + COMPASS_W);
};
class Frame: vip_rsc_frame {
x = QUOTE(COMPASS_X);
y = QUOTE(safeZoneY);
w = QUOTE(COMPASS_W);
h = QUOTE(COMPASS_H);
shadow=2;
colorText[]={1,1,1,1};
};
};
};
class ace_spectator_help {
onLoad = "uiNamespace setVariable ['ace_spectator_help', _this select 0]; ['Help', _this select 0] call ace_spectator_fnc_camera";
idd = -1;
movingEnable=0;
fadein=0;
fadeout=0;
duration=1e+011;
class controls {
class BG: vip_rsc_box {
idc = -1;
x = QUOTE(RESCENTRE_X - HELP_W / 2);
y = QUOTE(RESCENTRE_Y - HELP_H / 2);
w = QUOTE(HELP_W);
h = QUOTE(HELP_H);
colorBackground[] = {0.1,0.1,0.1,1};
};
class Title: vip_rsc_text {
idc = 0;
style = ST_CENTER;
x = QUOTE(RESCENTRE_X - RESUNITS_X * 25);
y = QUOTE(RESCENTRE_Y - (HELP_H / 2) + RESUNITS_Y * 3);
w = QUOTE(RESUNITS_X * 50);
h = QUOTE(RESUNITS_Y * 4);
colorText[]={1,1,1,1};
sizeEx = QUOTE(RESUNITS_Y * 4);
font = GUI_FONT_NORMAL;
text = "ACE Spectator Controls";
};
class LeftColumn1 {
idc = 1;
type = CT_STRUCTURED_TEXT;
style = ST_LEFT;
x = QUOTE(RESCENTRE_X - HELP_W / 2 + RESUNITS_X * 3);
y = QUOTE(RESCENTRE_Y - (HELP_H / 2) + RESUNITS_Y * 10);
w = QUOTE(RESUNITS_X * 16.75);
h = QUOTE(RESUNITS_Y * 63);
text = "";
size = QUOTE(RESUNITS_Y * 2.5);
colorBackground[] = {0,0,0,0};
};
class LeftColumn2: LeftColumn1 {
idc = 2;
x = QUOTE(RESCENTRE_X - HELP_W / 2 + RESUNITS_X * 19.75);
};
class RightColumn1: LeftColumn1 {
idc = 3;
x = QUOTE(RESCENTRE_X + HELP_W / 2 - RESUNITS_X * 3 - RESUNITS_X * 29.5);
};
class RightColumn2: LeftColumn1 {
idc = 4;
x = QUOTE(RESCENTRE_X + HELP_W / 2 - RESUNITS_X * 3 - RESUNITS_X * 11.75);
};
};
};
};

Binary file not shown.

View File

@ -0,0 +1,96 @@
/*
Author:
voiper
*/
#include "script_component.hpp"
["SettingsInitialized", {
if !GVAR(enabled) exitWith {};
//check if respawn is set up properly
_fail = if (getNumber (missionConfigFile >> "respawn") != 3 && getText (missionConfigFile >> "respawn") != "Base") then {true} else {false};
if (_fail) exitWith {
_text = "[ACE_Spectator] ERROR: This mission does not have respawn set up properly. Add 'respawn=3' or 'respawn=""BASE""' to description.ext.";
systemChat _text;
diag_log text _text;
};
if GVAR(endMission) then {
[{
if (player distance GVAR(penPos) < 200) then {
if ({isPlayer _x && alive _x && (_x distance GVAR(penPos)) > 200} count allUnits == 0) then {
[["endDeath", false], "BIS_fnc_endMission"] call BIS_fnc_MP;
[_this select 1] call CBA_fnc_removePerFrameHandler;
};
};
}, 2] call CBA_fnc_addPerFrameHandler;
};
if (isDedicated) exitWith {};
call FUNC(penPos);
{
if (getMarkerPos _x isEqualTo [0,0,0]) then {
_marker = createMarkerLocal [_x, [0,0]];
_marker setMarkerShapeLocal "ICON";
};
_x setMarkerPosLocal GVAR(penPos);
} forEach ["respawn_west", "respawn_east", "respawn_guerrila", "respawn_civilian"];
GVAR(playerSide) = side (group player);
if GVAR(tracking) then {
[FUNC(checkUnits), 2] call CBA_fnc_addPerFrameHandler;
[FUNC(trackUnits), 20] call CBA_fnc_addPerFrameHandler;
};
player addEventHandler ["Killed", {
[player] joinSilent grpNull;
if (isClass (configFile >> "CfgPatches" >> "ace_hearing")) then {EGVAR(hearing,disableVolumeUpdate) = true};
_delay = getNumber (missionConfigFile >> "respawnDelay");
_delay fadeSound 0;
999999 cutText ["", "BLACK", _delay];
}];
player addEventHandler ["Respawn", {
if (!isNil QGVAR(cam)) then {["Exit"] call FUNC(camera)};
if (isClass (configFile >> "CfgPatches" >> "ace_hearing")) then {EGVAR(hearing,disableVolumeUpdate) = true};
if (isClass (configFile >> "CfgPatches" >> "acre_sys_radio")) then {[true] call acre_api_fnc_setSpectator};
if (isClass (configFile >> "CfgPatches" >> "task_force_radio")) then {[player, true] call TFAR_fnc_forceSpectator};
if !GVAR(modulePos) then {
_corpse = _this select 1;
if (!isNil "_corpse") then {
if (!isNull _corpse) then {
GVAR(startingPos) = getPosATL _corpse;
};
};
};
player addEventHandler ["HandleDamage", {0}];
[player] joinSilent grpNull;
removeAllWeapons player;
removeAllItems player;
removeAllAssignedItems player;
removeUniform player;
removeVest player;
player linkItem "ItemMap";
player linkItem "ItemRadio";
hideObjectGlobal player;
if (surfaceisWater GVAR(penPos)) then {
player forceAddUniform "U_B_Wetsuit";
player addVest "V_RebreatherB";
};
player setPosATL GVAR(penPos);
0 fadeSound 0;
999999 cutText ["", "BLACK FADED", 0];
["Init", [true]] call FUNC(camera);
}];
}] call EFUNC(common,addEventHandler);

View File

@ -0,0 +1,31 @@
#include "script_component.hpp"
ADDON = false;
PREP(camera);
PREP(cameraIntro);
PREP(canSpectateUnit);
PREP(checkUnits);
PREP(compass);
PREP(crosshair);
PREP(draw3D);
PREP(drawMines2D);
PREP(drawMines3D);
PREP(drawTracks2D);
PREP(drawUnits2D);
PREP(drawUnits3D);
PREP(killed);
PREP(map);
PREP(moduleSpectator);
PREP(overlay);
PREP(penPos);
PREP(respawn);
PREP(sideColour);
PREP(status);
PREP(trackUnits);
PREP(unitInfo);
PREP(unitSide);
PREP(unitVar);
PREP(viewDistance);
ADDON = true;

View File

@ -0,0 +1,19 @@
#include "script_component.hpp"
class CfgPatches {
class ADDON {
units[] = {};
weapons[] = {};
requiredVersion = REQUIRED_VERSION;
requiredAddons[] = {"ace_common"};
author[] = {"voiper"};
authorUrl = "https://github.com/voiperr/";
VERSION_CONFIG;
};
};
#include "ACE_Settings.hpp"
#include "CfgEventHandlers.hpp"
#include "CfgVehicles.hpp"
#include "rsc_defines.hpp"
#include "UI.hpp"

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,28 @@
/*
Author:
voiper
Description:
Curtain, sound, and text intro when camera starts.
Arguments:
None
Example:
call ace_spectator_fnc_camIntro;
Return Value:
None
Public:
No
*/
#include "script_component.hpp"
999999 cutText ["", "BLACK IN", 2];
2 fadeSound 1;
["Press H for spectator controls", 2] call EFUNC(common,displaytextstructured);
[_this select 1] call CBA_fnc_removePerFrameHandler;

View File

@ -0,0 +1,30 @@
/*
Author:
voiper
Description:
Check if a unit is suitable to spectate.
Arguments:
0: Unit to check <Object>
Example:
[unit] call ace_spectator_canSpectateUnit;
Return Value:
Whether is suitable to spectate <Bool>
Public:
No
*/
#include "script_component.hpp"
_unit = _this select 0;
if (_unit distance GVAR(penPos) < 200) exitWith {false};
if (_unit distance [0,0,0] < 100) exitWith {false};
if (!GVAR(AI) && !isPlayer _unit) exitWith {false};
if (GVAR(limitSide) && (([_unit] call FUNC(unitSide)) != GVAR(playerSide))) exitWith {false};
true

View File

@ -0,0 +1,37 @@
/*
Author:
voiper
Description:
Compile array of units to spectate.
Arguments:
None.
Example:
call ace_spectator_fnc_checkUnits;
Return Value:
None
Public:
No
*/
#include "script_component.hpp"
_units = allUnits;
_units append allDead;
GVAR(units) = [];
{
_listed = _x getVariable [QGVAR(listed), false];
if (!_listed) then {
[_x] call FUNC(unitVar);
_x addEventHandler ["Killed", {_this call FUNC(killed)}];
_x addEventHandler ["Respawn", {_this call FUNC(respawn)}];
_x setVariable [QGVAR(listed), true];
};
if ([_x] call FUNC(canSpectateUnit)) then {GVAR(units) pushback _x};
} forEach _units;

View File

@ -0,0 +1,59 @@
/*
Author:
voiper
Description:
Orient and set compass.
Arguments:
0: Compass <Display>
Example:
[display] call ace_spectator_fnc_compass;
Return Value:
None
Public:
No
*/
#include "script_component.hpp"
#define RESUNITS_X safeZoneW / 100
#define CENTRE safeZoneX + safeZoneW / 2
#define COMPASS_W RESUNITS_X * 20
#define COMPASS_X CENTRE - COMPASS_W / 2
#define ARC_W COMPASS_W / 2
#define DEGUNIT COMPASS_W / 180
_dialog = _this select 0;
_Q1 = _dialog displayCtrl 1;
_Q2 = _dialog displayCtrl 2;
_Q3 = _dialog displayCtrl 3;
_Q4 = _dialog displayCtrl 4;
_qOrder = [];
_dir = if GVAR(cameraOn) then {getDir GVAR(cam)} else {getDir GVAR(unit)};
_angleFromCentre = _dir - floor(_dir / 90) * 90;
_leftEdgePos = _angleFromCentre * DEGUNIT;
_positions = [
[CENTRE - _leftEdgePos - ARC_W, safeZoneY],
[CENTRE - _leftEdgePos, safeZoneY],
[CENTRE - _leftEdgePos + ARC_W, safeZoneY],
[0, safeZoneY - 1]
];
_qOrder = switch (true) do {
case ((_dir >= 0) && (_dir < 90)): {[_Q4, _Q1, _Q2, _Q3]};
case ((_dir >= 90) && (_dir < 180)): {[_Q1, _Q2, _Q3, _Q4]};
case ((_dir >= 180) && (_dir < 270)): {[_Q2, _Q3, _Q4, _Q1]};
case (_dir >= 270): {[_Q3, _Q4, _Q1, _Q2]};
};
{
_x ctrlSetPosition (_positions select _forEachIndex);
_x ctrlCommit 0;
} forEach _qOrder;

View File

@ -0,0 +1,29 @@
/*
Author:
voiper
Description:
Automatically set crosshair colour.
Arguments:
None
Example:
call ace_spectator_fnc_crosshair;
Return Value:
None
Public:
No
*/
#include "script_component.hpp"
_xhair = uiNamespace getVariable QGVAR(crosshair);
if (!isNull _xhair) then {
_colour = if ((GVAR(lock) select 0) > -1) then {[1,0,0,0.8]} else {
if (!isNull GVAR(attach)) then {[1,1,0,0.8]} else {[1,1,1,0.8]};
};
(_xhair displayCtrl 0) ctrlSetTextColor _colour;
};

View File

@ -0,0 +1,34 @@
/*
Author:
voiper
Description:
Draw3D EH for spectator.
Arguments:
None
Example:
call ace_spectator_fnc_draw3D;
Return Value:
None
Public:
No
*/
#include "script_component.hpp"
_map = uiNameSpace getVariable QGVAR(map);
if (!isNull _map) exitWith {};
_compass = uiNamespace getVariable QGVAR(compass);
_status = uiNamespace getVariable QGVAR(status);
if (!isNull _compass) then {[_compass] call FUNC(compass)};
if (!isNull _status) then {[_status] call FUNC(status)};
if (GVAR(markers) > 0) then {
call FUNC(drawMines3D);
call FUNC(drawUnits3D);
};

View File

@ -0,0 +1,43 @@
/*
Author:
voiper
Description:
Draw mines on spectator map.
Arguments:
0: Map control <Control>
1: Zoom level <Scalar>
Example:
[map, zoomlevel] call ace_spectator_fnc_drawMines2D;
Return Value:
None
Public:
No
*/
#include "script_component.hpp"
#define SCALE 5 * safeZoneH / 100
#define MIN 300 * SCALE
#define TEXTURE "\A3\ui_f\data\map\markers\military\triangle_CA.paa"
_map = _this select 0;
_zoom = _this select 1;
_size = SCALE / _zoom;
_textSize = ((1/4 * _size) max (SCALE / 2) min (SCALE / 1.5)) / 2;
_iconSize = (20 * _size) max SCALE min MIN;
_showText = (GVAR(markers) > 1);
{
_name = "";
if (_showText) then {
_magName = getText (configFile >> "CfgAmmo" >> (typeOf _x) >> "defaultMagazine");
_name = getText (configFile >> "CfgMagazines" >> _magName >> "displayName");
};
_map drawIcon [TEXTURE, [1,0.5,0,1], getPos _x, _iconSize, _iconSize, getDir _x, _name, 1, _textSize, "PuristaMedium"];
} forEach allMines;

View File

@ -0,0 +1,55 @@
/*
Author:
voiper
Description:
Draw mines in 3D.
Arguments:
None
Example:
call ace_spectator_fnc_drawMines3D;
Return Value:
None
Public:
No
*/
#include "script_component.hpp"
#define SCALE safeZoneH / 100
#define TEXTMAX (1.5 * SCALE)
#define TEXTMIN 6 * SCALE
#define ICONMAX (30 * SCALE)
#define ICONMIN (120 * SCALE)
#define TEXTURE "\A3\ui_f\data\map\markers\military\triangle_CA.paa"
_cam = GVAR(cam);
_showText = (GVAR(markers) > 1);
{
_pos = getPos _x;
_dist = (_cam distance _pos) + 0.1;
if (_dist < 2000) then {
_distScaled = SCALE / sqrt(_dist);
_iconScale = 300 * _distScaled;
//_iconSize = (20 * _size) max _scale min _min;
_iconSize = _iconScale max ICONMAX min ICONMIN;
_textSize = 0;
if (_showText) then {
_textScale = 10 * _distScaled;
_textSize = _textScale max TEXTMAX min TEXTMIN;
};
_magName = getText (configFile >> "CfgAmmo" >> (typeOf _x) >> "defaultMagazine");
_name = getText (configFile >> "CfgMagazines" >> _magName >> "displayName");
drawIcon3D [TEXTURE, [1,0.5,0,1], _pos, _iconSize, _iconSize, 0, _name, 1, _textSize, "PuristaMedium"];
};
} forEach allMines;

View File

@ -0,0 +1,56 @@
/*
Author:
voiper
Description:
Draw unit tracks in spectator map.
Arguments:
0: Map control <Control>
1: Zoom level <Scalar>
Example:
[map, zoomlevel] call ace_spectator_fnc_drawTracks2D;
Return Value:
None
Public:
No
*/
#include "script_component.hpp"
_map = _this select 0;
_zoom = _this select 1;
{
_unit = _x select 0;
_info = [_unit] call FUNC(unitInfo);
_colour = _info select 2;
if (_unit == GVAR(unit)) then {_colour = [1,1,0,_colour select 3]};
_positions = _x select 1;
_count = count _positions;
_step = floor (10 * _zoom) min 3 max 1;
_lastIndex = 0;
if (_count > 1) then {
for "_i" from 0 to (_count - 1) step _step do {;
if (_i > 0 && _i < _count) then {
_pos1 = _positions select _i;
_pos2 = _positions select (_i - _step);
_lastIndex = _i;
_map drawLine [_pos1, _pos2, _colour];
};
};
};
//((_count - _step + _count mod _step) max 0)
if (alive _unit) then {
_map drawLine [_positions select _lastIndex, getPosVisual _unit, _colour];
};
} forEach GVAR(trackingArray);

View File

@ -0,0 +1,81 @@
/*
Author:
voiper
Description:
Draw unit icons on spectator map.
Arguments:
0: Map control <Control>
1: Zoom level <Scalar>
Example:
[map, zoomlevel] call ace_spectator_fnc_drawUnits2D;
Return Value:
None
Public:
No
*/
#include "script_component.hpp"
#define SCALE 5 * safeZoneH / 100
#define MIN 300 * SCALE
_map = _this select 0;
_zoom = _this select 1;
_topIcon = [];
_size = SCALE / _zoom;
_showText = (GVAR(markers) > 1);
_textSize = (0.25 * _size) max (SCALE / 2) min (SCALE / 1.5);
{
_unit = _x;
_isTarget = (_unit == GVAR(unit));
if (true) then {
_veh = vehicle _unit;
_inVeh = (_veh != _unit);
if (!_isTarget && _inVeh && !(_unit == ((crew _veh) select 0))) exitWith {};
if (!_isTarget && _inVeh && (GVAR(unit) in (crew _veh))) exitWith {};
_obj = if (_inVeh) then {_veh} else {_unit};
_pos = getPosVisual _obj;
_dir = getDir _obj;
_info = [_unit] call FUNC(unitInfo);
_name = _info select 0;
_colour = _info select 2;
_icon = getText (configFile >> "CfgVehicles" >> (typeOf _veh) >> "Icon");
_iconSize = 0;
_iconText = "";
if (_inVeh) then {
_iconSize = (50 * _size) max SCALE min (MIN * 2);
if (_showText) then {
_iconText = "[" + (getText (configFile >> "CfgVehicles" >> (typeOf _veh) >> "displayName")) + "] " + _name;
};
} else {
_iconSize = (50 * _size) max SCALE min MIN;
if (_showText) then {
_iconText = _name;
};
};
if (_isTarget) exitWith {
_topIcon = [_icon, [1,1,0,1], _pos, _iconSize, _iconSize, _dir, _iconText, 1, _textSize, "PuristaBold", "RIGHT"];
};
_map drawIcon [_icon, _colour, _pos, _iconSize, _iconSize, _dir, _iconText, 1, _textSize, "PuristaMedium", "RIGHT"]
};
} forEach GVAR(units);
if (count _topIcon > 0) then {
_map drawIcon _topIcon;
};

View File

@ -0,0 +1,97 @@
/*
Author:
voiper
Description:
Draw unit icons in 3D.
Arguments:
None
Example:
call ace_spectator_fnc_drawUnits3D;
Return Value:
None
Public:
No
*/
#include "script_component.hpp"
#define SCALE safeZoneH / 100
#define TEXTMAX (1.5 * SCALE)
#define TEXTMIN 6 * SCALE
#define ICONMAX (30 * SCALE)
#define ICONMIN (120 * SCALE)
_cam = GVAR(cam);
_showText = (GVAR(markers) > 1);
_topIcon = [];
{
_unit = _x;
if (true) then {
_veh = vehicle _unit;
_inVeh = (_veh != _unit);
_cmdr = if (_inVeh && (_unit == ((crew _veh) select 0))) then {true} else {false};
_obj = if (_inVeh && _cmdr) then {_veh} else {_unit};
_pos = if (surfaceIsWater getPos _obj) then {getPosASLVisual _obj} else {getPosATLVisual _obj};
_dist = (_cam distance _pos) + 0.1;
_isTarget = (_unit == GVAR(unit));
//exit if too far
if (_dist > 2000 && !_isTarget) exitWith {};
//exit if target not on screen
if ((count (worldToScreen _pos) < 1) && !_isTarget) exitWith {};
_info = [_unit] call FUNC(unitInfo);
_name = _info select 0;
_colour = _info select 2;
_pos set [2, (_pos select 2) + 3];
_distScaled = SCALE / sqrt(_dist);
_icon = "";
_iconScale = 300 * _distScaled;
_iconSize = _iconScale max ICONMAX min ICONMIN;
_text = if (_showText) then {_name} else {""};
_textScale = 10 * _distScaled;
_textSize = _textScale max TEXTMAX min TEXTMIN;
if (_inVeh) then {
if (_cmdr) then {
_icon = getText (configFile >> "CfgVehicles" >> (typeOf _veh) >> "Icon");
_text = if (_showText) then {
"[" + (getText (configFile >> "CfgVehicles" >> (typeOf _veh) >> "displayName")) + "] " + _text
} else {""};
_pos set [2, (_pos select 2) + 3];
} else {
_iconSize = 0;
_textSize = if (_dist < 25) then {_textSize / 1.5} else {0};
};
} else {
_icon = getText (configFile >> "CfgVehicles" >> (typeOf _unit) >> "Icon");
};
if (GVAR(markers) > 2) then {
_text = _text + " [" + str ceil(_dist) + "]";
};
if (_isTarget) exitWith {
_topIcon = [_icon, [1,1,0,1], _pos, _iconSize, _iconSize, 0, _text, 2, _textSize, "PuristaBold", "CENTER", true];
};
drawIcon3D [_icon, _colour, _pos, _iconSize, _iconSize, 0, _text, 2, _textSize, "PuristaMedium"];
};
} forEach GVAR(units);
if ((count _topIcon > 0) && GVAR(cameraOn)) then {
drawIcon3D _topIcon;
};

View File

@ -0,0 +1,65 @@
/*
Author:
voiper
Description:
Killed EH for remote units.
Arguments:
0: Unit <Object>
1: Killer <Object>
Example:
[unit, killer] call ace_spectator_fnc_killed;
Return Value:
None
Public:
No
*/
#include "script_component.hpp"
_unit = _this select 0;
_killer = _this select 1;
if (isNil "_unit") exitWith {};
if (isNil QGVAR(cam)) exitWith {};
if (isNull _unit) exitWith {};
if (!isNull _killer) then {
if (GVAR(markers) > 2 && !difficultyEnabled "deathMessages") then {
_nameUnit = name _unit;
_nameKiller = name _killer;
_text = if (_killer == _unit) then {
format ["%1 died", _nameUnit]
} else {
format ["%2 killed by %1", _nameUnit, _nameKiller]
};
systemChat _text;
};
};
if (_unit == GVAR(unit) && !GVAR(cameraOn)) then {
["Camera", ["Free"]] call FUNC(camera);
GVAR(unit) = objNull;
};
_savedUnit = GVAR(savedUnits) find _unit;
if (_savedUnit > -1) then {
GVAR(savedUnits) set [_savedUnit, objNull];
};
if (!isNil QGVAR(trackingArray)) then {
_pos = getPos _unit;
_pos resize 2;
_index = -1;
{if ((_x select 0) == _unit) then {_index = _forEachIndex}} forEach GVAR(trackingArray);
_unitArray = GVAR(trackingArray) select _index;
_tracks = _unitArray select 1;
_tracks pushBack _pos;
_unitArray set [1, _tracks];
GVAR(trackingArray) set [_index, _unitArray];
};

View File

@ -0,0 +1,156 @@
/*
Author:
voiper
Description:
Manage spectator map.
Arguments:
0: Mode <String>
1: Elements (depending on situation) <Array>
Example:
["Init", [map]] call ace_spectator_fnc_map;
Return Value:
None
Public:
No
*/
#include "script_component.hpp"
#include "\a3\editor_f\Data\Scripts\dikCodes.h"
_mode = _this select 0;
_this = _this select 1;
switch _mode do {
case "Init": {
_map = _this displayCtrl 1;
if (isNil QGVAR(mapPos)) then {
GVAR(mapPos) = [(GVAR(penPos) select 0) / 4, (GVAR(penPos) select 1) / 4];
};
if (isNil QGVAR(mapZoom)) then {
GVAR(mapZoom) = 0.75;
};
_map ctrlMapAnimAdd [0, GVAR(mapZoom), GVAR(mapPos)];
ctrlMapAnimCommit _map;
setMousePosition [0.5, 0.5];
_map ctrlAddEventHandler ["Draw", {['Draw', _this] call FUNC(map)}];
_map ctrlAddEventHandler ["MouseButtonDblClick", {['Click', _this] call FUNC(map)}];
};
case "Close": {
_map = _this displayCtrl 1;
GVAR(mapPos) = _map ctrlMapScreenToWorld [0.5,0.5];
GVAR(mapZoom) = ctrlMapScale _map;
};
case "Draw": {
_map = _this select 0;
_zoom = ctrlMapScale _map;
if (GVAR(markers) > 0) then {
if ((GVAR(markers) > 2) && GVAR(tracking)) then {
[_map, _zoom] call FUNC(drawTracks2D);
};
[_map, _zoom] call FUNC(drawMines2D);
[_map, _zoom] call FUNC(drawUnits2D);
};
if (GVAR(cameraOn)) then {
_scale = 5 * safeZoneH / 100;
_map drawIcon ["\A3\ui_f\data\gui\Rsc\RscDisplayMissionEditor\iconcamera_ca.paa", [1,1,1,1], getPos GVAR(cam), 500 * _scale, 500 * _scale, getDir GVAR(cam), "", 0, 0, "PuristaMedium"];
};
};
case "Click": {
_map = _this select 0;
_button = _this select 1;
_shift = _this select 4;
_mapPos = _map ctrlMapScreenToWorld [_this select 2, _this select 3];
if (_shift) then {
if (GVAR(cameraOn)) then {
_dir = [getPos GVAR(cam), _mapPos] call BIS_fnc_dirTo;
GVAR(vector) set [0, _dir];
[GVAR(cam), GVAR(vector)] call BIS_fnc_setObjectRotation;
};
} else {
_newUnit = objNull;
_scale = ctrlMapScale _map;
_radius = _scale * 250;
_units = [];
//find units near spot, ignoring height (necessary since nearestObjects takes height into account)
{
if (alive _x) then {
_pos = getPos _x;
_pos set [2, 0];
if (_pos distance _mapPos <= _radius) then {
_units pushBack _x;
};
};
} forEach GVAR(units);
//find closest unit to spot
if (count _units > 0) then {
_nearest = 0;
for "_i" from 1 to (count _units - 1) do {
if (((_units select _i) distance _mapPos) < ((_units select _nearest) distance _mapPos)) then {
_nearest = _i;
};
};
_newUnit = _units select _nearest;
};
if (!isNull _newUnit) then {
if (vehicle _newUnit != _newUnit) then {
_crew = crew (vehicle _newUnit);
_newUnit = _crew select 0;
};
GVAR(unit) = _newUnit;
if (GVAR(cameraOn)) then {
["Camera", ["Third"]] call FUNC(camera);
} else {
if (GVAR(third)) then {
["Camera", ["Third"]] call FUNC(camera);
} else {
["Camera", ["First"]] call FUNC(camera);
};
};
} else {
if (!GVAR(cameraOn)) then {
["Camera", ["Free"]] call FUNC(camera);
};
_mapPos set [2, 10];
GVAR(cam) setPosATL _mapPos;
};
};
};
case "KeyDown": {
_key = _this select 1;
_shift = _this select 2;
_ctrl = _this select 3;
_alt = _this select 4;
_return = false;
switch (_key) do {
case (DIK_DELETE): {_return = true};
};
_return
};
};

View File

@ -0,0 +1,28 @@
/*
* Author: esteldunedain
* Initializes the addon module.
*
* Arguments:
* Whatever the module provides.
*
* Return Value:
* None
*/
#include "script_component.hpp"
PARAMS_3(_logic,_units,_activated);
if !(_activated) exitWith {};
[_logic, QGVAR(enabled), "SpectatorEnabled"] call EFUNC(common,readSettingFromModule);
[_logic, QGVAR(limitSide), "SpectatorPlayerSide"] call EFUNC(common,readSettingFromModule);
[_logic, QGVAR(AI), "SpectatorAI"] call EFUNC(common,readSettingFromModule);
[_logic, QGVAR(tracking), "SpectatorTracking"] call EFUNC(common,readSettingFromModule);
[_logic, QGVAR(modulePos), "SpectatorPos"] call EFUNC(common,readSettingFromModule);
[_logic, QGVAR(endMission), "SpectatorEnd"] call EFUNC(common,readSettingFromModule);
if GVAR(modulePos) then {
GVAR(startingPos) = getPosATL _logic;
GVAR(startingDir) = getDir _logic;
};

View File

@ -0,0 +1,106 @@
/*
Author:
voiper
Description:
Spectator unit list.
Arguments:
0: Specific function to use <String>
1: Function params <Array>
Example:
["Init", [display]] call ace_spectator_fnc_overlay;
Return Value:
None
Public:
No
*/
#include "script_component.hpp"
_mode = _this select 0;
_this = _this select 1;
switch _mode do {
case "Init": {
_display = _this select 0;
_ctrl = _display displayCtrl 0;
_count = _ctrl tvCount [];
for "_i" from 0 to _count do {
_ctrl tvDelete [_x];
};
_ctrl tvAdd [[], "Blufor"];
_ctrl tvAdd [[], "Opfor"];
_ctrl tvAdd [[], "Independent"];
_ctrl tvAdd [[], "Civilian"];
_unitList = [];
{
_units = units _x;
private ["_groupNum"];
{
if ((GVAR(units) find _x > -1) && alive _x) then {
_info = [_x] call FUNC(unitInfo);
_text = _info select 0;
_team = _info select 1;
_side = switch (_team) do {
case BLUFOR: {0};
case OPFOR: {1};
case INDEPENDENT: {2};
case CIVILIAN: {3};
};
_icon = getText (configFile >> "CfgVehicles" >> (typeOf _x) >> "Icon");
_picture = "\a3\ui_f\data\map\VehicleIcons\" + _icon + "_ca.paa";
_treeIndex = [];
_unitList pushBack _x;
_savedUnit = GVAR(savedUnits) find _x;
if (_savedUnit > -1) then {_text = _text + " (#" + str (_savedUnit + 1) + ")"};
if (_forEachIndex == 0) then {
_groupNum = _ctrl tvAdd [[_side], _text];
_treeIndex = [_side, _groupNum];
} else {
_num = _ctrl tvAdd [[_side, _groupNum], _text];
_treeIndex = [_side, _groupNum, _num];
};
_ctrl tvSetPicture [_treeIndex, _picture];
_ctrl tvSetData [_treeIndex, [_x] call FUNC(unitVar)];
_unitList pushBack _treeIndex;
};
} forEach _units;
} forEach allGroups;
if (!isNull GVAR(unit)) then {
if (alive GVAR(unit)) then {
_treeIndex = _unitList select ((_unitList find GVAR(unit)) + 1);
_ctrl tvSetCurSel _treeIndex;
};
};
};
case "Select": {
_ctrl = _this select 0;
_selection = _this select 1;
if (count _selection < 2) exitWith {};
_str = _ctrl tvData _selection;
_unit = missionNamespace getVariable _str;
GVAR(unit) = _unit;
if (GVAR(cameraOn)) then {
["Camera", ["Third"]] call FUNC(camera);
} else {
["Camera", ["SwitchUnit"]] call FUNC(camera);
};
};
};

View File

@ -0,0 +1,33 @@
/*
Author:
voiper
Description:
Determine spec pen position.
Arguments:
None
Example:
call ace_spectator_fnc_penPos;
Return Value:
None
Public:
No
*/
#include "script_component.hpp"
_mapSize = (configFile >> "CfgWorlds" >> worldName >> "mapSize");
_worldEdge = if (isNumber _mapSize) then {getNumber _mapSize} else {32768};
_pos = [_worldEdge * 2, _worldEdge * 2];
if (surfaceisWater _pos) then {
_pos set [2, -1.4];
GVAR(penPos) = ASLtoATL _pos;
} else {
_pos set [2, 0];
GVAR(penPos) = _pos;
};

View File

@ -0,0 +1,25 @@
/*
Author:
voiper
Description:
Respawn EH for remote clients.
Arguments:
0: Unit <Object>
Example:
["Init", [false]] call ace_spectator_fnc_camera;
Return Value:
None
Public:
No
*/
#include "script_component.hpp"
_unit = _this select 0;
_unit setVariable [QGVAR(name), name _unit, true];
//_unit setVariable [QGVAR(listed), false];

View File

@ -0,0 +1,66 @@
/*
Author:
voiper
Description:
Determine side colour for spectator GUI.
Arguments:
0: Side <Scalar>
Example:
[0 call ace_spectator_fnc_sideColour;
Return Value:
Colour <Array>
Public:
No
*/
#include "script_component.hpp"
#define FACTOR 1.3
#define GETCOLOUR(a,b) (profileNameSpace getVariable [QUOTE(a), b])
PARAMS_1(_side);
_colour = switch _side do {
case BLUFOR: {
[
GETCOLOUR('Map_BLUFOR_R', 0),
GETCOLOUR('Map_BLUFOR_G', 0.3),
GETCOLOUR('Map_BLUFOR_B', 0.6)
]
};
case OPFOR: {
[
GETCOLOUR('Map_OPFOR_R', 0.5),
GETCOLOUR('Map_OPFOR_G', 0),
GETCOLOUR('Map_OPFOR_B', 0)
]
};
case INDEPENDENT: {
[
GETCOLOUR('Map_Independent_R', 0),
GETCOLOUR('Map_Independent_G', 0.5),
GETCOLOUR('Map_Independent_B', 0)
]
};
case CIVILIAN: {
[
GETCOLOUR('Map_Civilian_R', 0.4),
GETCOLOUR('Map_Civilian_G', 0),
GETCOLOUR('Map_Civilian_B', 0.5)
]
};
};
_colour set [0, (_colour select 0) * FACTOR];
_colour set [1, (_colour select 1) * FACTOR];
_colour set [2, (_colour select 2) * FACTOR];
_colour set [3, 1];
_colour

View File

@ -0,0 +1,60 @@
/*
Author:
voiper
Description:
Render status.
Arguments:
0: Status element <Display>
Example:
[display] call ace_spectator_fnc_status;
Return Value:
None
Public:
No
*/
#include "script_component.hpp"
_display = _this select 0;
_speedText = (str ([GVAR(moveScale), 4] call BIS_fnc_cutDecimals)) + "v";
(_display displayCtrl 0) ctrlSetText _speedText;
_name = "";
_colour = [1,1,1,1];
if (!isNull GVAR(unit)) then {
_info = [GVAR(unit)] call FUNC(unitInfo);
_name = _info select 0;
_side = _info select 1;
_colour = _info select 2;
_colour set [3, 1];
};
(_display displayCtrl 1) ctrlSetText _name;
(_display displayCtrl 1) ctrlSetTextColor _colour;
_mode = if (GVAR(cameraOn)) then {
if (isNull GVAR(attach)) then {"FREE"} else {"ATTACH"};
} else {
if (GVAR(third)) then {"THIRD"} else {"FIRST"};
};
(_display displayCtrl 2) ctrlSetText _mode;
_timeText = [dayTime] call BIS_fnc_timeToString;
(_display displayCtrl 3) ctrlSetText _timeText;
_fovText = (str ([GVAR(fov), 3] call BIS_fnc_cutDecimals)) + "a";
(_display displayCtrl 4) ctrlSetText _fovText;
_timeAccText = (str ([GVAR(accTime), 4] call BIS_fnc_cutDecimals)) + "x";
(_display displayCtrl 5) ctrlSetText _timeAccText;
_focusDist = [GVAR(focus) select 0, 1] call BIS_fnc_cutDecimals;
_focusBlur = GVAR(focus) select 1;
_focusText = if (_focusDist == -1 && _focusBlur == 1) then {"Auto"} else {if (_focusDist < 0) then {toString [8734]} else {str _focusDist + "m"}};
(_display displayCtrl 6) ctrlSetText _focusText;

View File

@ -0,0 +1,54 @@
/*
Author:
voiper
Description:
Check and record tracking for all units.
Arguments:
None
Example:
call ace_spectator_fnc_trackUnits;
Return Value:
None
Public:
No
*/
#include "script_component.hpp"
if (isNil QGVAR(trackingArray)) then {
GVAR(trackingArray) = [];
};
if (count GVAR(units) < 1) exitWith {};
{
_unit = _x;
_pos = getPos _unit;
_pos resize 2;
_index = -1;
{if ((_x select 0) == _unit) then {_index = _forEachIndex}} forEach GVAR(trackingArray);
if (_index == -1) then {
GVAR(trackingArray) pushBack [_unit, [_pos]]
} else {
_unitArray = GVAR(trackingArray) select _index;
_trackingArray = _unitArray select 1;
_latestIndex = (count _trackingArray) - 1;
_latestPos = _trackingArray select _latestIndex;
_diffX = abs((_latestPos select 0) - (_pos select 0));
_diffY = abs((_latestPos select 1) - (_pos select 1));
if !((_diffX < 20) && (_diffY < 20)) then {
_trackingArray pushBack _pos;
_unitArray set [1, _trackingArray];
GVAR(trackingArray) set [_index, _unitArray];
};
};
} forEach GVAR(units);

Some files were not shown because too many files have changed in this diff Show More