manual merge

This commit is contained in:
commy2 2016-01-06 15:57:09 +01:00
commit abf516aeb1
190 changed files with 2080 additions and 1339 deletions

View File

@ -1,6 +1,7 @@
branches:
only:
- master
- master
- release
language: python
python:
- '3.4'
@ -19,12 +20,10 @@ env:
- secure: KcJQbknBOdC5lA4nFGKPXVRVIGLDXDRzC8XkHuXJCE9pIR/wbxbkvx8fHKcC6SC9eHgzneC3+o4m4+CjIbVvIwDgslRbJ8Y59i90ncONmdoRx1HUYHwuYWVZm9HJFjCsIbrEqhSyyKS+PB3WZVOLbErtNHsgS8f43PTh5Ujg7Vg=
notifications:
slack:
secure: aWYF/YX7vxEdXJ5w1jhYJQ2TtTP2NRdnXzJDMYXTv2dlXYhO9qp2qjxDGW3dezuPY7B1mPBgebfSKRx3Robkt1rAfEwPWivOiEztL30rwzOy+5Q1wpORv1JkvTC/q2wqQzxQCU/FPVjD2GkF1wtq1Rnx3ESWD8gbvzYoMNdIw1g=
on_success: change
on_failure: always
on_start: never
rooms:
secure: MvxmqL1NGwiGTVv6uIVTM7jeNLQH95KYtTgSWlXaSw4jdjnf4cmrb/ofHQ3FHhhNVdhRN6W8n0cJfTC3DBZ90bionVh+528qw2mDnDbKljVdIwmoFSexBcH7H1uTLF3gsEz0tbrHtLcnAyTMxdjsdIXDLZ5hwxABNmW5/03jOgs=
- secure: byZMNBl8PMlgjT9NA1WmhgCdGfX4b3g1kA0vEiwfm+IFNlx7BiM4J/5rp6zV/jV470xl/epAejx2tsa5SdTyFbO87NH63ILJSt5QnjUZjRuGKSutFs9WE671DtZkPRSJXHS4N6x802PRkyBz/84/lsc34FWvHvjwOuYAtOcJRFk=
- secure: V22TNaLWV+yUNWqR7c6HVvIxkRDz7Dyz9xqa43FY8iFgvNL4Q/X69h5DYHU/ILNFM00tx8OBjtPRbcjWQ+F6eY8Sje/A2axJAU+qNurAvoyiTahXUprdUUpPdkgXWuSRTZ9kALxOq5e11RC8XUietghoMcl8zPcqdrZCOOKgoEM=
on_success: change
email:
on_success: never
on_failure: change

View File

@ -54,7 +54,7 @@ Crusty
Dharma Bellamkonda <dharma.bellamkonda@gmail.com>
Dimaslg <dimaslg@telecable.es>
Drill <drill87@gmail.com>
Dudakov <dudakov.s@gmail.com>
Dudakov aka [OMCB]Kaban <dudakov.s@gmail.com>
Dslyecxi <dslyecxi@gmail.com>
eRazeri
evromalarkey <evromalarkey@gmail.com>

View File

@ -4,9 +4,9 @@
<p align="center">
<a href="https://github.com/acemod/ACE3/releases">
<img src="https://img.shields.io/badge/Version-3.4.1-blue.svg?style=flat-square" alt="ACE3 Version">
<img src="https://img.shields.io/badge/Version-3.4.2-blue.svg?style=flat-square" alt="ACE3 Version">
</a>
<a href="https://github.com/acemod/ACE3/releases/download/v3.4.1/ace3_3.4.1.zip">
<a href="https://github.com/acemod/ACE3/releases/download/v3.4.2/ace3_3.4.2.zip">
<img src="https://img.shields.io/badge/Download-72.6_MB-green.svg?style=flat-square" alt="ACE3 Download">
</a>
<a href="https://github.com/acemod/ACE3/issues">

View File

@ -12,11 +12,7 @@
*/
#include "script_component.hpp"
private "_deleted";
_deleted = 0;
_aceTimeSecond = floor ACE_time;
private _aceTimeSecond = floor ACE_time;
{
private ["_bulletVelocity", "_bulletPosition", "_bulletSpeed"];

View File

@ -61,7 +61,6 @@ class CfgVehicles {
showDisabled = 0;
priority = 5;
icon = PATHTOF(UI\attach_ca.paa);
// hotkey = "T";
};
class GVAR(Detach) {
displayName = CSTRING(Detach);
@ -71,7 +70,6 @@ class CfgVehicles {
showDisabled = 0;
priority = 5;
icon = PATHTOF(UI\detach_ca.paa);
hotkey = "T";
};
};
};

View File

@ -32,7 +32,6 @@ class CfgVehicles {
showDisabled = 0;
icon = QUOTE(PATHTOF(UI\captive_ca.paa));
priority = 2.3;
hotkey = "E";
};
class ACE_StopEscorting {
displayName = CSTRING(StopEscorting);
@ -43,7 +42,6 @@ class CfgVehicles {
showDisabled = 0;
icon = QUOTE(PATHTOF(UI\captive_ca.paa));
priority = 2.3;
hotkey = "E";
};
class ACE_LoadCaptive {
displayName = CSTRING(LoadCaptive);
@ -54,7 +52,6 @@ class CfgVehicles {
showDisabled = 0;
icon = QUOTE(PATHTOF(UI\captive_ca.paa));
priority = 2.2;
hotkey = "L";
};
class GVAR(UnloadCaptive) {
displayName = CSTRING(UnloadCaptive);
@ -74,7 +71,6 @@ class CfgVehicles {
exceptions[] = {"isNotEscorting"};
showDisabled = 0;
priority = 2.3;
hotkey = "C";
};
class ACE_StartSurrenderingSelf {
displayName = CSTRING(StartSurrendering);
@ -165,7 +161,7 @@ class CfgVehicles {
description = CSTRING(ModuleSurrender_Description);
sync[] = {"AnyAI"};
};
};
};
class GVAR(ModuleHandcuffed): Module_F {
author = ECSTRING(common,ACETeam);
category = "ACE";

View File

@ -110,24 +110,28 @@
<Portuguese>Carregando carga</Portuguese>
<Polish>Ładowanie cargo</Polish>
<Czech>Nakládám</Czech>
<Russian>Погрузка</Russian>
</Key>
<Key ID="STR_ACE_Cargo_UnloadingItem">
<English>Unloading Cargo</English>
<Portuguese>Descarregando carga</Portuguese>
<Polish>Rozładowywanie cargo</Polish>
<Czech>Vykládám</Czech>
<Russian>Выгрузка</Russian>
</Key>
<Key ID="STR_ACE_Cargo_LoadingFailed">
<English>%1&lt;br/&gt;could not be loaded</English>
<Portuguese>%1&lt;br/&gt;não pode ser carregado</Portuguese>
<Polish>%1&lt;br/&gt;nie mógł zostać załadowany</Polish>
<Czech>%1&lt;br/&gt;nemůže být naloženo</Czech>
<Russian>%1&lt;br/&gt;не может быть погружен</Russian>
</Key>
<Key ID="STR_ACE_Cargo_UnloadingFailed">
<English>%1&lt;br/&gt;could not be unloaded</English>
<Portuguese>%1&lt;br/&gt;não pode ser descarregado</Portuguese>
<Polish>%1&lt;br/&gt;nie mógł zostać rozładowany</Polish>
<Czech>%1&lt;br/&gt;nemůže být vyloženo</Czech>
<Russian>%1&lt;br/&gt;не может быть выгружен</Russian>
</Key>
</Package>
</Project>

View File

@ -107,6 +107,10 @@ class RscInGameUI {
class RscOptics_LaserDesignator_02 {
onLoad = QUOTE([ARR_2('infoDisplayChanged', [ARR_2(_this select 0, 'Any')])] call FUNC(localEvent););
};
class RscStaminaBar {
onLoad = QUOTE([ARR_4(""onLoad"",_this,""RscStaminaBar"",'IGUI')] call (uinamespace getvariable 'BIS_fnc_initDisplay'); uiNamespace setVariable [ARR_2(QUOTE(QGVAR(dlgStaminaBar)),_this select 0)]);
};
};
class RscDisplayInventory {

View File

@ -1,7 +1,7 @@
// ACE - Common
// #define ENABLE_PERFORMANCE_COUNTERS
#include "script_component.hpp"
// #define ENABLE_PERFORMANCE_COUNTERS
//////////////////////////////////////////////////
// PFHs
@ -57,6 +57,24 @@
// Eventhandlers
//////////////////////////////////////////////////
//Add a fix for BIS's zeus remoteControl module not reseting variables on DC when RC a unit
//This variable is used for isPlayer checks
if (isServer) then {
addMissionEventHandler ["HandleDisconnect", {
params ["_dcPlayer"];
private _zeusLogic = getAssignedCuratorLogic _dcPlayer;
if ((!isNil "_zeusLogic") && {!isNull _zeusLogic}) then {
{
if ((_x getvariable ["bis_fnc_moduleRemoteControl_owner", objnull]) isEqualTo _dcPlayer) exitWith {
ACE_LOGINFO_3("[%1] DC - Was Zeus [%2] while controlling unit [%3] - manually clearing `bis_fnc_moduleRemoteControl_owner`", [_x] call FUNC(getName), _dcPlayer, _x);
_x setVariable ["bis_fnc_moduleRemoteControl_owner", nil, true];
};
nil
} count (curatorEditableObjects _zeusLogic);
};
}];
};
// Listens for global "SettingChanged" events, to update the force status locally
["SettingChanged", {
params ["_name", "_value", "_force"];
@ -289,6 +307,17 @@ enableCamShake true;
// Set up numerous eventhanders for player controlled units
//////////////////////////////////////////////////
//CBA has events for zeus's display onLoad and onUnload (Need to delay a frame for display to be ready)
private _zeusDisplayChangedFNC = {
[{
private _data = !(isNull findDisplay 312);
["zeusDisplayChanged", [ACE_player, _data]] call FUNC(localEvent);
}, []] call FUNC(execNextFrame);
};
["CBA_curatorOpened", _zeusDisplayChangedFNC] call CBA_fnc_addEventHandler;
["CBA_curatorClosed", _zeusDisplayChangedFNC] call CBA_fnc_addEventHandler;
// default variables
GVAR(OldPlayerVehicle) = vehicle objNull;
GVAR(OldPlayerTurret) = [objNull] call FUNC(getTurretIndex);
@ -298,7 +327,6 @@ GVAR(OldPlayerVisionMode) = currentVisionMode objNull;
GVAR(OldCameraView) = "";
GVAR(OldVisibleMap) = false;
GVAR(OldInventoryDisplayIsOpen) = nil; //@todo check this
GVAR(OldZeusDisplayIsOpen) = false;
GVAR(OldIsCamera) = false;
// clean up playerChanged eventhandler from preinit and put it in the same PFH as the other events to reduce overhead and guarantee advantageous execution order
@ -387,14 +415,6 @@ if (!isNil QGVAR(PreInit_playerChanged_PFHID)) then {
["inventoryDisplayChanged", [ACE_player, _data]] call FUNC(localEvent);
};
// "zeusDisplayChanged" event
_data = !(isNull findDisplay 312);
if !(_data isEqualTo GVAR(OldZeusDisplayIsOpen)) then {
// Raise ACE event locally
GVAR(OldZeusDisplayIsOpen) = _data;
["zeusDisplayChanged", [ACE_player, _data]] call FUNC(localEvent);
};
// "activeCameraChanged" event
_data = call FUNC(isfeatureCameraActive);
if !(_data isEqualTo GVAR(OldIsCamera)) then {
@ -443,6 +463,7 @@ if (!isNil QGVAR(PreInit_playerChanged_PFHID)) then {
{_unit != _target && {vehicle _unit == vehicle _target}}
}] call FUNC(addCanInteractWithCondition);
["isNotInZeus", {isNull curatorCamera}] call FUNC(addCanInteractWithCondition);
//////////////////////////////////////////////////
// Set up PlayerJIP eventhandler

View File

@ -74,6 +74,7 @@ PREP(getNumberFromMissionSQM);
PREP(getNumberMagazinesIn);
PREP(getPitchBankYaw);
PREP(getSettingData);
PREP(getStaminaBarControl);
PREP(getStringFromMissionSQM);
PREP(getTargetAzimuthAndInclination);
PREP(getTargetDistance);

View File

@ -22,7 +22,7 @@ private _hitPointDamages = getAllHitPointsDamage _object;
// get correct format for objects without hitpoints
if (_hitPointDamages isEqualTo []) then {
_hitPointDamages = [[],[],[]];
_hitPointDamages = [[],[],[]];
};
// this prevents physx objects from floating when near other physx objects with allowDamage false

View File

@ -5,23 +5,27 @@
* Arguments:
* 0: Object <OBJECT>
* 1: Use effective commander name when used on vehicles (default: false) <BOOL>
* 2: Get Raw Name (Don't sanatize HTML tags `</>`) (default: false) <BOOL>
*
* Return Value:
* Object Name <STRING>
*
* Example:
* [player, false, true] call ace_common_fnc_getName;
*
* Public: Yes
*/
#include "script_component.hpp"
params ["_unit", ["_showEffective", false]];
params ["_unit", ["_showEffective", false], ["_useRaw", false]];
private _name = "";
if (_unit isKindOf "CAManBase") then {
_name = _unit getVariable ["ACE_Name", localize QUOTE(DOUBLES(STR,GVAR(Unknown)))];
_name = _unit getVariable [(["ACE_Name", "ACE_NameRaw"] select _useRaw), localize QUOTE(DOUBLES(STR,GVAR(Unknown)))];
} else {
if (_showEffective) then {
_name = [effectiveCommander _unit] call FUNC(getName);
_name = [effectiveCommander _unit, false, _useRaw] call FUNC(getName);
} else {
_name = getText (configFile >> "CfgVehicles" >> typeOf _unit >> "displayName");
};

View File

@ -0,0 +1,15 @@
/*
* Author: commy2
* Returns the control of the Stamina Bar from Arma 1.54.
*
* Arguments:
* None
*
* Return Value:
* Stamina Bar control <CONTROL>
*
* Public: No
*/
#include "script_component.hpp"
(uiNamespace getVariable [QGVAR(dlgStaminaBar), displayNull]) displayCtrl IDC_STAMINA_BAR

View File

@ -1,7 +1,7 @@
/*
* Author: bux578, commy2, akalegman
* Checks if a unit is a player / curator controlled unit.
* Currently returns false for non-local remote controlled zeus units. (Remotes from another zeus machine)
* This now includes both local and non-local remote controlled zeus units. (Remotes from another zeus machine)
*
* Arguments:
* 0: unit to be checked <OBJECT>
@ -10,10 +10,13 @@
* Return Value:
* Is unit a player? <BOOL>
*
* Example:
* [cursorTarget, false] call ace_common_fnc_isPlayer;
*
* Public: Yes
*/
#include "script_component.hpp"
params ["_unit", ["_excludeRemoteControlled", false]];
isPlayer _unit || (!_excludeRemoteControlled && {_unit == call FUNC(player)}) // return
(isPlayer _unit) || {(!_excludeRemoteControlled) && {!isNull (_unit getVariable ["bis_fnc_moduleRemoteControl_owner", objNull])}}

View File

@ -19,9 +19,9 @@ _requestID = ("ace_recieveRequest_f_id_"+_requestID);
_target setVariable [_requestID, _this];
if (isLocalized _requestMessage) then {
_requestMessage = format [localize _requestMessage, [_caller] call FUNC(getName)];
_requestMessage = format [localize _requestMessage, [_caller, false, true] call FUNC(getName)];
} else {
_requestMessage = format [_requestMessage, [_caller] call FUNC(getName)];
_requestMessage = format [_requestMessage, [_caller, false, true] call FUNC(getName)];
};
hint format ["%1", _requestMessage]; // @todo ?

View File

@ -23,5 +23,5 @@ private _selectBinocular = currentWeapon _unit == _binocular;
_unit addWeapon _binocular;
if (_selectBinocular) then {
_unit selectWeapon _binocular;
_unit selectWeapon _binocular;
};

View File

@ -7,7 +7,10 @@
* 1: Remove html tags (default: false) <BOOL>
*
* Return Value:
* Sanitized string
* Sanitized string <STRING>
*
* Example:
* ["<CoolGroup>CoolGuy", true] call ace_common_fnc_sanitizeString;
*
* Public: Yes
*/
@ -19,14 +22,14 @@ private _array = [];
{
switch _x do {
case 60 : {
case 60 : { // less than symbol: `<`
if (_removeTags) then {
_array append toArray "&lt;";
} else {
_array pushBack _x;
};
};
case 62 : {
case 62 : { // greater than symbol: `>`
if (_removeTags) then {
_array append toArray "&gt;";
} else {

View File

@ -1,19 +1,24 @@
/*
* Author: esteldunedain
* ?
* Log a RPT messaged on just the server
*
* Arguments:
* ?
* 0: Text to display <STRING>
*
* Return Value:
* None
*
* Example:
* ["x happened"] call ace_common_fnc_serverLog;
*
* Public: no
*/
#include "script_component.hpp"
params [["_msg", "", [""]]];
if (isServer) then {
diag_log _this;
diag_log text _msg;
} else {
[_this, QFUNC(serverLog), 1] call FUNC(execRemoteFnc);
};

View File

@ -17,9 +17,15 @@ params ["_unit"];
if (isNull _unit || {!alive _unit}) exitWith {};
if (_unit isKindOf "CAManBase") then {
_name = [name _unit, true] call FUNC(sanitizeString);
private _sanitizedName = [name _unit, true] call FUNC(sanitizeString);
private _rawName = [name _unit, false] call FUNC(sanitizeString);
//Debug Testing Code (with html tags):
// private _sanitizedName = ["<TAG>Name", true] call FUNC(sanitizeString);
// private _rawName = ["<TAG>Name", false] call FUNC(sanitizeString);
//if (_name != _unit getVariable ["ACE_Name", ""]) then {
_unit setVariable ["ACE_Name", _name, true];
_unit setVariable ["ACE_Name", _sanitizedName, true];
_unit setVariable ["ACE_NameRaw", _rawName, true];
//};
};

View File

@ -705,7 +705,6 @@
<German>Nicht erzwingen</German>
<Polish>Nie wymuszaj</Polish>
<Spanish>No forzar</Spanish>
<German>Nicht erzwingen</German>
<Czech>Nevynucovat</Czech>
<Portuguese>Não forçar</Portuguese>
<Russian>Не обязывать</Russian>

View File

@ -1,7 +1,7 @@
class CfgVehicles {
class Fence;
class thingX;
class ThingX;
class NonStrategic;
class ACE_ConcertinaWireNoGeo: Fence {
@ -94,7 +94,7 @@ class CfgVehicles {
};
};
};
class ACE_ConcertinaWireCoil: thingX {
class ACE_ConcertinaWireCoil: ThingX {
XEH_ENABLED;
scope = 2;
displayName = $STR_ACE_CONCERTINA_WIRECOIL;

View File

@ -52,10 +52,10 @@ if (_mode == 0) then {
];
{
_found = false;
_no = nearestObjects [_x, [typeOf _wire], 3]; //diag_log _no; diag_log ".....";
_no = _no - [_wire]; //diag_log _no;
_no = nearestObjects [_x, [typeOf _wire], 3]; //diag_log _no; diag_log ".....";
_no = _no - [_wire]; //diag_log _no;
if (count _no > 0) exitWith {
_found = true; //diag_log "found";
_found = true; //diag_log "found";
};
} forEach _wireCheckPosAr;
// Double coil found!

View File

@ -3,6 +3,7 @@
<Package name="DAGR">
<Key ID="STR_ACE_DAGR_Name">
<English>DAGR</English>
<German>DAGR</German>
<Polish>DAGR</Polish>
<Spanish>DAGR</Spanish>
<Russian>DAGR</Russian>
@ -11,6 +12,7 @@
</Key>
<Key ID="STR_ACE_DAGR_ConfigureDAGR">
<English>Configure DAGR</English>
<German>DAGR konfigurien</German>
<Polish>Konfiguruj DAGR</Polish>
<Spanish>Configurar DAGR</Spanish>
<Russian>Настроить DAGR</Russian>
@ -19,6 +21,7 @@
</Key>
<Key ID="STR_ACE_DAGR_ToggleDAGR">
<English>Toggle DAGR</English>
<German>DAGR umschalten</German>
<Polish>Przełącz DAGR</Polish>
<Spanish>Mostrar DAGR</Spanish>
<Russian>Вкл./выкл. DAGR</Russian>
@ -27,6 +30,7 @@
</Key>
<Key ID="STR_ACE_DAGR_Description">
<English>Defense Advanced GPS Receiver</English>
<German>Defense Advanced GPS Receiver</German>
<Polish>Defense Advanced GPS Receiver</Polish>
<Spanish>Defense Advanced GPS Receiver</Spanish>
<Russian>Военный многофункциональный GPS-приёмник</Russian>
@ -34,4 +38,4 @@
<Czech>Defense Advanced GPS Receiver</Czech>
</Key>
</Package>
</Project>
</Project>

View File

@ -72,7 +72,7 @@ GVAR(disarmTarget) = _target;
_icon = format [DEFUALTPATH, toLower (rank _target)];
if (_icon isEqualTo DEFUALTPATH) then {_icon = ""};
_rankPicture ctrlSetText _icon;
_playerName ctrlSetText ([GVAR(disarmTarget)] call EFUNC(common,getName));
_playerName ctrlSetText ([GVAR(disarmTarget), false, true] call EFUNC(common,getName));
//Clear both inventory lists:
lbClear _groundContainer;

View File

@ -85,7 +85,7 @@ class CfgVehicles {
};
// Barrier
class RoadCone_F: thingX {
class RoadCone_F: ThingX {
XEH_ENABLED;
GVAR(canCarry) = 1;
GVAR(carryPosition[]) = {0,1,1};

View File

@ -23,8 +23,8 @@ private "_inBuilding";
_inBuilding = [_unit] call FUNC(isObjectOnObject);
if !(_unit getVariable ["ACE_isUnconscious", false]) then {
// play release animation
_unit playAction "released";
// play release animation
_unit playAction "released";
};
// prevent collision damage

View File

@ -21,7 +21,6 @@ class CfgAmmo {
class DirectionalBombCore: TimeBombCore;
class DirectionalBombBase: DirectionalBombCore;
class APERSTripMine_Wire_Ammo: DirectionalBombBase;
class SLAMDirectionalMine_Wire_Ammo: DirectionalBombBase;
@ -31,11 +30,16 @@ class CfgAmmo {
class DirectionalBombBase;
class ClaymoreDirectionalMine_Remote_Ammo: DirectionalBombBase {
ACE_Explosive = "ClaymoreDirectionalMine_Remote_Ammo_Scripted";
GVAR(defuseObjectPosition[]) = {0, 0, 0.038};
soundActivation[] = {"", 0, 0, 0};
soundDeactivation[] = {"", 0, 0, 0};
};
//class ClaymoreDirectionalMine_Remote_Ammo_Scripted: ClaymoreDirectionalMine_Remote_Ammo;
class APERSTripMine_Wire_Ammo: DirectionalBombBase {
GVAR(defuseObjectPosition[]) = {-1.415, 0, 0.12};
};
class SLAMDirectionalMine_Wire_Ammo: DirectionalBombBase {
indirectHitRange = 20;
ACE_explodeOnDefuse = 1;
@ -55,6 +59,7 @@ class CfgAmmo {
class PipeBombBase;
class DemoCharge_Remote_Ammo: PipeBombBase {
ACE_Explosive = "DemoCharge_Remote_Ammo_Scripted";
GVAR(defuseObjectPosition[]) = {0.07, 0, 0.055};
soundActivation[] = {"", 0, 0, 0};
soundDeactivation[] = {"", 0, 0, 0};
hit = 500;
@ -63,17 +68,18 @@ class CfgAmmo {
};
class SatchelCharge_Remote_Ammo: PipeBombBase {
ACE_Explosive = "SatchelCharge_Remote_Ammo_Scripted";
GVAR(defuseObjectPosition[]) = {0.1, 0.1, 0.05};
soundActivation[] = {"", 0, 0, 0};
soundDeactivation[] = {"", 0, 0, 0};
};
/*class DemoCharge_Remote_Ammo_Scripted: DemoCharge_Remote_Ammo;
class SatchelCharge_Remote_Ammo_Scripted: SatchelCharge_Remote_Ammo;*/
class IEDUrbanBig_Remote_Ammo: PipeBombBase {
triggerWhenDestroyed = 1;
ACE_explodeOnDefuse = 0.02;
soundTrigger[] = {"A3\Sounds_F\weapons\mines\mech_trigger_1", 0.8, 1, 40};
soundTrigger[] = {"A3\Sounds_F\weapons\mines\mech_trigger_1", 0.8, 1, 40};
};
class IEDUrbanBig_Command_Ammo: IEDUrbanBig_Remote_Ammo {
mineTrigger = "RemoteTrigger";
@ -81,19 +87,19 @@ class CfgAmmo {
class IEDUrbanBig_Range_Ammo: IEDUrbanBig_Remote_Ammo {
mineTrigger = "RangeTrigger";
};
class IEDUrbanSmall_Remote_Ammo: PipeBombBase {
triggerWhenDestroyed = 1;
ACE_explodeOnDefuse = 0.02;
soundTrigger[] = {"A3\Sounds_F\weapons\mines\mech_trigger_1", 0.8, 1, 40};
};
class IEDUrbanSmall_Command_Ammo: IEDUrbanSmall_Remote_Ammo {
};
class IEDUrbanSmall_Command_Ammo: IEDUrbanSmall_Remote_Ammo {
mineTrigger = "RemoteTrigger";
};
class IEDUrbanSmall_Range_Ammo: IEDUrbanSmall_Remote_Ammo {
mineTrigger = "RangeTrigger";
};
class IEDLandBig_Remote_Ammo: PipeBombBase {
triggerWhenDestroyed = 1;
ACE_explodeOnDefuse = 0.02;
@ -105,7 +111,7 @@ class CfgAmmo {
class IEDLandBig_Range_Ammo: IEDLandBig_Remote_Ammo {
mineTrigger = "RangeTrigger";
};
class IEDLandSmall_Remote_Ammo: PipeBombBase {
triggerWhenDestroyed = 1;
ACE_explodeOnDefuse = 0.02;

View File

@ -10,7 +10,6 @@ class CfgVehicles {
showDisabled = 1;
priority = 4;
icon = PATHTOF(UI\Explosives_Menu_ca.paa);
hotkey = "X";
//Sub-menu items
class ACE_Detonate {
displayName = CSTRING(Detonate);
@ -21,7 +20,6 @@ class CfgVehicles {
showDisabled = 1;
icon = PATHTOF(UI\Explosives_Menu_ca.paa);
priority = 2;
hotkey = "T";
};
class ACE_Place {
displayName = CSTRING(Place);
@ -32,7 +30,6 @@ class CfgVehicles {
showDisabled = 1;
icon = PATHTOF(UI\Place_Explosive_ca.paa);
priority = 1;
hotkey = "P";
};
class ACE_Cellphone {
displayName = CSTRING(cellphone_displayName);
@ -62,7 +59,7 @@ class CfgVehicles {
class ACE_Actions {
class ACE_MainActions {
selection = "";
distance = 5;
distance = 1;
condition = "true";
class ACE_Defuse {
displayName = CSTRING(Defuse);
@ -72,8 +69,7 @@ class CfgVehicles {
showDisabled = 0;
icon = PATHTOF(UI\Defuse_ca.paa);
priority = 0.8;
hotkey = "F";
distance = 5;
distance = 1;
};
};
};
@ -89,16 +85,15 @@ class CfgVehicles {
scope = 2;
scopeCurator = 1;
vehicleClass = "Cargo";
ACE_offset[] = {0,0,0};
class ACE_Actions {
class ACE_MainActions {
selection = "";
distance = 5;
distance = 1;
condition = "true";
class ACE_SetTrigger {
selection = "";
displayName = CSTRING(TriggerMenu);
distance = 4;
distance = 1;
condition = "true";
statement = "";
insertChildren = QUOTE([ARR_3(_target getVariable QUOTE(QGVAR(class)),_target,_player)] call FUNC(addTriggerActions););
@ -110,7 +105,7 @@ class CfgVehicles {
class ACE_PickUp {
selection = "";
displayName = CSTRING(Pickup);
distance = 4;
distance = 1;
condition = "true";
statement = QUOTE([ARR_2(_player,_target getVariable QUOTE(QGVAR(class)))] call EFUNC(common,addToInventory);deleteVehicle _target;);
showDisabled = 0;
@ -125,6 +120,11 @@ class CfgVehicles {
class ACE_Explosives_Place_DemoCharge:ACE_Explosives_Place {
displayName = "Demo Charge";
model = "\A3\Weapons_F\explosives\c4_charge_small_d";
class ACE_Actions: ACE_Actions {
class ACE_MainActions: ACE_MainActions {
position = "[-0.07,0,0.055]";
};
};
};
class ACE_Explosives_Place_APERSBoundingMine:ACE_Explosives_Place {
displayName = "APERS Bounding Mine";
@ -137,7 +137,11 @@ class CfgVehicles {
class ACE_Explosives_Place_APERSTripwireMine:ACE_Explosives_Place {
displayName = "APERS Tripwire Mine";
model = "\A3\Weapons_F\explosives\mine_AP_tripwire";
ACE_offset[] = {1,0,0};
class ACE_Actions: ACE_Actions {
class ACE_MainActions: ACE_MainActions {
position = "[1.415,0,0.12]";
};
};
};
class ACE_Explosives_Place_ATMine:ACE_Explosives_Place {
@ -148,11 +152,21 @@ class CfgVehicles {
class ACE_Explosives_Place_Claymore:ACE_Explosives_Place {
displayName = "Claymore";
model = "\A3\Weapons_F\explosives\mine_AP_miniclaymore";
class ACE_Actions: ACE_Actions {
class ACE_MainActions: ACE_MainActions {
position = "[0,0,0.038]";
};
};
};
class ACE_Explosives_Place_SatchelCharge:ACE_Explosives_Place {
displayName = "Satchel Charge";
model = "\A3\Weapons_F\Explosives\satchel";
class ACE_Actions: ACE_Actions {
class ACE_MainActions: ACE_MainActions {
position = "[-0.1,-0.1,0.05]";
};
};
};
class ACE_Explosives_Place_SLAM:ACE_Explosives_Place {

View File

@ -45,7 +45,17 @@ if (!("ACE_DefusalKit" in (items ACE_player))) exitWith {};
if (((_x distance ACE_player) < 15) && {!(_x in _minesHelped)}) then {
TRACE_2("Making Defuse Helper",(_x),(typeOf _x));
_defuseHelper = "ACE_DefuseObject" createVehicleLocal (getPos _x);
_defuseHelper attachTo [_x, [0,0,0]];
private _config = configFile >> "CfgAmmo" >> typeOf _x;
private _defuseObjectPosition = getArray (_config >> QGVAR(defuseObjectPosition));
if (_defuseObjectPosition isEqualTo []) then {
_defuseObjectPosition = [0,0,0];
};
TRACE_1("DefuseObjectPosition",(_defuseObjectPosition));
_defuseHelper attachTo [_x, _defuseObjectPosition];
_defuseHelper setVariable [QGVAR(Explosive),_x];
_addedDefuseHelpers pushBack _defuseHelper;
_minesHelped pushBack _x;

View File

@ -582,6 +582,7 @@
</Key>
<Key ID="STR_ACE_Explosives_ExplodeOnDefuse_DisplayName">
<English>Explode on defusal?</English>
<German>Explodieren beim Entschärfen?</German>
<Portuguese>Explosão no desarmamento?</Portuguese>
<Polish>Eksplozja przy rozbrajaniu?</Polish>
<Czech>Explodovat při zneškodňování?</Czech>
@ -592,6 +593,7 @@
</Key>
<Key ID="STR_ACE_Explosives_ExplodeOnDefuse_Description">
<English>Enable certain explosives to explode on defusal? Default: Yes</English>
<German>Sollen bestimmte Sprengladungen beim Entschärfen explodieren? Standard: Ja</German>
<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>

View File

@ -1,3 +1,4 @@
class Extended_PreInit_EventHandlers {
class ADDON {
init = QUOTE(call COMPILE_FILE(XEH_preInit));
@ -6,7 +7,7 @@ class Extended_PreInit_EventHandlers {
class Extended_PostInit_EventHandlers {
class ADDON {
clientInit = QUOTE(call COMPILE_FILE(XEH_clientInit));
init = QUOTE(call COMPILE_FILE(XEH_postInit));
};
};

View File

@ -26,7 +26,7 @@ class CfgVehicles {
class ACE_SelfActions {
class ResetFCS {
displayName = CSTRING(ResetFCS);
condition = QUOTE(call FUNC(canResetFCS));
condition = QUOTE(_player call FUNC(canResetFCS));
statement = QUOTE([ARR_2(vehicle _player,[_player] call DEFUNC(common,getTurretIndex))] call DFUNC(reset););
showDisabled = 0;
priority = 1;
@ -39,7 +39,7 @@ class CfgVehicles {
class ACE_SelfActions {
class ResetFCS {
displayName = CSTRING(ResetFCS);
condition = QUOTE(call FUNC(canResetFCS));
condition = QUOTE(_player call FUNC(canResetFCS));
statement = QUOTE([ARR_2(vehicle _player,[_player] call DEFUNC(common,getTurretIndex))] call DFUNC(reset););
showDisabled = 0;
priority = 1;
@ -321,9 +321,13 @@ class CfgVehicles {
discreteDistance[] = {};
discreteDistanceInitIndex = 0;
/*class Turrets: Turrets {
class CommanderOptics: CommanderOptics {};
};*/
class Turrets: Turrets {
class CommanderOptics: CommanderOptics {
GVAR(Enabled) = 1;
discreteDistance[] = {};
discreteDistanceInitIndex = 0;
};
};
};
};
};
@ -346,9 +350,13 @@ class CfgVehicles {
discreteDistance[] = {};
discreteDistanceInitIndex = 0;
/*class Turrets: Turrets {
class CommanderOptics: CommanderOptics {};
};*/
class Turrets: Turrets {
class CommanderOptics: CommanderOptics {
GVAR(Enabled) = 1;
discreteDistance[] = {};
discreteDistanceInitIndex = 0;
};
};
};
};
};
@ -362,6 +370,8 @@ class CfgVehicles {
class Turrets: Turrets {
class CommanderOptics: CommanderOptics {
GVAR(Enabled) = 1;
discreteDistance[] = {};
discreteDistanceInitIndex = 0;
};
};
};

View File

@ -16,4 +16,4 @@ if (!hasInterface) exitWith {};
}] call EFUNC(common,addEventHandler);
// Register event for global updates
[QGVAR(forceUpdate), FUNC(onForceUpdate)] call EFUNC(common,addEventHandler);
[QGVAR(forceUpdate), {ACE_player call FUNC(onForceUpdate)}] call EFUNC(common,addEventHandler);

View File

@ -14,6 +14,7 @@ PREP(onForceUpdate);
PREP(keyDown);
PREP(keyUp);
PREP(reset);
PREP(updateRangeHUD);
PREP(vehicleInit);
ADDON = true;

View File

@ -1,29 +1,27 @@
/*
* Author: KoffeinFlummi
*
* Adjusts the currently zeroed distance.
*
* Arguments:
* 0: The vehicle in question
* 1: The amount to add to the distance (can be negative)
* 0: The vehicle in question <OBJECT>
* 1: The Turrets that the Vehicle has <ARRAY>
* 2: The amount to add to the distance (can be negative) <NUMMBER>
*
* Return Value:
* None
*
* Public: No
*/
#include "script_component.hpp"
private ["_vehicle", "_turret", "_delta", "_turretConfig", "_min", "_max", "_distance"];
params ["_vehicle", "_turret", "_delta"];
_vehicle = _this select 0;
_turret = _this select 1;
_delta = _this select 2;
private _turretConfig = [configFile >> "CfgVehicles" >> typeOf _vehicle, _turret] call EFUNC(common,getTurretConfigPath);
_turretConfig = [configFile >> "CfgVehicles" >> typeOf _vehicle, _turret] call EFUNC(common,getTurretConfigPath);
private _min = getNumber (_turretConfig >> QGVAR(MinDistance));
private _max = getNumber (_turretConfig >> QGVAR(MaxDistance));
_min = getNumber (_turretConfig >> QGVAR(MinDistance));
_max = getNumber (_turretConfig >> QGVAR(MaxDistance));
_distance = _vehicle getVariable [format ["%1_%2", QGVAR(Distance), _turret], _min];
private _distance = _vehicle getVariable [format ["%1_%2", QGVAR(Distance), _turret], _min];
_distance = _distance + _delta;
_distance = _distance min _max;

View File

@ -1,15 +1,17 @@
/*
* Author: KoffeinFlummi
*
* Called from config. Can player reset FCS?
*
* Argument:
* Nothing
*
* Return value:
* Boolean (Bool)
* Return Value:
* Boolean <BOOL>
*
* Public: No
*/
#include "script_component.hpp"
count ((vehicle ACE_player) getVariable [format ["%1_%2", QGVAR(Magazines), [ACE_player] call EFUNC(common,getTurretIndex)], []]) > 1
params ["_unit"];
count ((vehicle _unit) getVariable [format ["%1_%2", QGVAR(Magazines), [_unit] call EFUNC(common,getTurretIndex)], []]) > 1 // return

View File

@ -1,16 +1,16 @@
/*
* Author: commy2
*
* Called from config. Returns true if the player is a gunner and the players current vehicle has a FCS.
*
* Argument:
* Nothing
* Arguments:
* None
*
* Return value:
* Boolean (Bool)
* Return Value:
* Boolean <BOOL>
*
* Public: No
*/
#include "script_component.hpp"
getNumber ([configFile >> "CfgVehicles" >> typeOf vehicle ACE_player, [ACE_player] call EFUNC(common,getTurretIndex)] call EFUNC(common,getTurretConfigPath) >> QGVAR(Enabled)) == 1
&& {cameraView == "GUNNER"}
&& {cameraView == "GUNNER"} // return

View File

@ -1,16 +1,16 @@
/*
* Author: commy2
*
* Returns true if the laser distance measurement can be read from the engine.
*
* Argument:
* Nothing
* Arguments:
* None
*
* Return value:
* Boolean (Bool)
* Return Value:
* Boolean <BOOL>
*
* Public: No
*/
#include "script_component.hpp"
!isNull ((uiNamespace getVariable ["ACE_dlgRangefinder", displayNull]) displayCtrl 1713151)
&& {cameraView == "GUNNER"}
&& {cameraView == "GUNNER"} // return

View File

@ -1,6 +1,5 @@
/*
* Author: KoffeinFlummi
*
* Adjusts the direction of a shell.
*
* Arguments:
@ -8,58 +7,48 @@
*
* Return Value:
* None
*
* Public: No
*/
#include "script_component.hpp"
private ["_vehicle", "_weapon", "_ammo", "_magazine", "_projectile", "_sumVelocity"];
params ["_vehicle", "_weapon", "", "", "_ammo", "_magazine", "_projectile"];
_vehicle = _this select 0;
_weapon = _this select 1;
_ammo = _this select 4;
_magazine = _this select 5;
_projectile = _this select 6;
private ["_gunner", "_turret"];
_gunner = [_vehicle, _weapon] call EFUNC(common,getGunner);
_turret = [_gunner] call EFUNC(common,getTurretIndex);
private _gunner = [_vehicle, _weapon] call EFUNC(common,getGunner);
private _turret = _gunner call EFUNC(common,getTurretIndex);
// Exit if the unit isn't a player
if !([_gunner] call EFUNC(common,isPlayer)) exitWith {};
private ["_FCSMagazines", "_FCSElevation", "_offset"];
_FCSMagazines = _vehicle getVariable [(format ["%1_%2", QGVAR(Magazines), _turret]), []];
_FCSElevation = _vehicle getVariable format ["%1_%2", QGVAR(Elevation), _turret];
private _FCSMagazines = _vehicle getVariable [format ["%1_%2", QGVAR(Magazines), _turret], []];
private _FCSElevation = _vehicle getVariable format ["%1_%2", QGVAR(Elevation), _turret];
if !(_magazine in _FCSMagazines) exitWith {};
// GET ELEVATION OFFSET OF CURRENT MAGAZINE
_offset = 0;
private _offset = 0;
{
if (_x == _magazine) exitWith {
_offset = _FCSElevation select _forEachIndex;
};
} forEach _FCSMagazines;
[_projectile, (_vehicle getVariable format ["%1_%2", QGVAR(Azimuth), _turret]), _offset, 0] call EFUNC(common,changeProjectileDirection);
// Remove the platform velocity
if( (vectorMagnitude velocity _vehicle) > 2) then {
_sumVelocity = (velocity _projectile) vectorDiff (velocity _vehicle);
if (vectorMagnitude velocity _vehicle > 2) then {
private _sumVelocity = (velocity _projectile) vectorDiff (velocity _vehicle);
_projectile setVelocity _sumVelocity;
};
// Air burst missile
// handle locally only
if (!local _gunner) exitWith {};
if (getNumber (configFile >> "CfgAmmo" >> _ammo >> QGVAR(Airburst)) == 1) then {
private "_zeroing";
_zeroing = _vehicle getVariable [format ["%1_%2", QGVAR(Distance), _turret], currentZeroing _vehicle];
private _zeroing = _vehicle getVariable [format ["%1_%2", QGVAR(Distance), _turret], currentZeroing _vehicle];
if (_zeroing < 50) exitWith {};
if (_zeroing > 1500) exitWith {};

View File

@ -1,91 +1,82 @@
/*
* Author: KoffeinFlummi
*
* Calculates the angle offset necessary to hit the current target.
*
* Arguments:
* 0: distance to target in meters
* 1: current angle of the turret
* 2: maximum elevation of the turret
* 3: initSpeed of the projectile
* 4: airFriction of the projectile
* 5: maximum timeToLive of the projectile
* 6: simulationStep of the projectile
* 0: distance to target in meters <NUMBER>
* 1: current angle of the turret <NUMBER>
* 2: maximum elevation of the turret <NUMBER>
* 3: initSpeed of the projectile <NUMBER>
* 4: airFriction of the projectile <NUMBER>
* 5: maximum timeToLive of the projectile <NUMBER>
* 6: simulationStep of the projectile <NUMBER>
*
* Return Value:
* offset from the current angle necessary to hit the target
* offset from the current angle necessary to hit the target <NUMBER>
*
* Public: No
*/
#include "script_component.hpp"
#define PRECISION 0.1
private ["_distance", "_angleTarget", "_maxElev", "_initSpeed", "_airFriction", "_timeToLive", "_simulationStep", "_angle1", "_angle2", "_it2", "_f1", "_f2", "_temp", "_it1", "_angle"];
_distance = _this select 0;
_angleTarget = _this select 1;
_maxElev = _this select 2;
_initSpeed = _this select 3;
_airFriction = _this select 4;
_timeToLive = _this select 5;
_simulationStep = _this select 6;
params ["_distance", "_angleTarget", "_maxElev", "_initSpeed", "_airFriction", "_timeToLive", "_simulationStep"];
if (_simulationStep == 0) exitWith {_angleTarget};
FUNC(traceBullet) = {
private ["_distance", "_angleTarget", "_maxElev", "_initSpeed", "_airFriction", "_timeToLive", "_simulationStep", "_angle", "_posTargetX", "_posTargetY", "_posX", "_posY", "_velocityX", "_velocityY", "_velocityMagnitude", "_i"];
_distance = _this select 0;
_angleTarget = _this select 1;
_maxElev = _this select 2;
_initSpeed = _this select 3;
_airFriction = _this select 4;
_timeToLive = _this select 5;
_simulationStep = _this select 6;
_angle = _this select 7;
private _fnc_traceBullet = {
params ["_distance", "_angleTarget", "_maxElev", "_initSpeed", "_airFriction", "_timeToLive", "_simulationStep", "_angle"];
_angle = _angle - _angleTarget;
_angleTarget = 0;
_posTargetX = (cos _angleTarget) * _distance;
_posTargetY = (sin _angleTarget) * _distance;
private _posTargetX = (cos _angleTarget) * _distance;
private _posTargetY = (sin _angleTarget) * _distance;
_posX = 0;
_posY = 0;
private _posX = 0;
private _posY = 0;
_velocityX = (cos _angle) * _initSpeed;
_velocityY = (sin _angle) * _initSpeed;
private _velocityX = (cos _angle) * _initSpeed;
private _velocityY = (sin _angle) * _initSpeed;
// trace the path of the bullet
for "_i" from 1 to ((floor (_timeToLive / _simulationStep)) + 1) do {
_velocityMagnitude = sqrt (_velocityX^2 + _velocityY^2);
private _velocityMagnitude = sqrt (_velocityX^2 + _velocityY^2);
_velocityX = _velocityX + _simulationStep * (_velocityX * _velocityMagnitude * _airFriction);
_velocityY = _velocityY + _simulationStep * (_velocityY * _velocityMagnitude * _airFriction - 9.81);
_posX = _posX + _velocityX * _simulationStep;
_posY = _posY + _velocityY * _simulationStep;
if (_posX >= _posTargetX) exitWith {}; // bullet passed the target
};
_posY - _posTargetY
};
if ((_this + [_maxElev]) call FUNC(traceBullet) < 0) exitWith {_maxElev - _angleTarget};
private _data = [_distance, _angleTarget, _maxElev, _initSpeed, _airFriction, _timeToLive, _simulationStep, _maxElev];
if (_data call _fnc_traceBullet < 0) exitWith {_maxElev - _angleTarget};
// Newton Method / Secand Method
_angle1 = _angleTarget;
_angle2 = _maxElev;
_it2 = 0;
_f1 = (_this + [_angle1]) call FUNC(traceBullet);
private _angle1 = _angleTarget;
private _angle2 = _maxElev;
private _it2 = 0;
_data set [7, _maxElev];
private _f1 = _data call _fnc_traceBullet;
if (abs _f1 <= PRECISION) exitWith {0};
while {abs _f1 > PRECISION} do {
_data set [7, _angle2];
private _f2 = _data call _fnc_traceBullet;
if ((abs _f1) <= PRECISION) exitWith {0};
while {(abs _f1) > PRECISION} do {
_f2 = (_this + [_angle2]) call FUNC(traceBullet);
_temp = _angle2-_f2*(_angle2-_angle1)/(_f2-_f1);
_angle1 = _angle2;
_angle2 = _temp;
_f1 = _f2;
_it2 = _it2+1;
};
//player globalChat format ["it1: %1 | _angle1: %2 | it2: %3 | _angle2: %4",_it1, _angle-_angleTarget, _it2, _angle2-_angleTarget];
_angle2 = _angle2 - _f2 * (_angle2 - _angle1) / (_f2 - _f1);
_angle=_angle2;
_angle - _angleTarget
_f1 = _f2;
_it2 = _it2 + 1;
};
_angle2 - _angleTarget

View File

@ -1,23 +1,18 @@
/*
* Author: commy2
*
* Read laser distance measurement from engine and update compatible info elements.
* Read laser distance measurement from engine.
*
* Argument:
* Nothing
* None
*
* Return value:
* Measured distance (Number)
* Measured distance <NUMBER>
*
* Public: No
*/
#include "script_component.hpp"
private ["_dlgRangefinder", "_range"];
disableSerialization;
_dlgRangefinder = uiNamespace getVariable ["ACE_dlgRangefinder", displayNull];
private _dlgRangefinder = uiNamespace getVariable ["ACE_dlgRangefinder", displayNull];
_range = ctrlText (_dlgRangefinder displayCtrl 151);
(_dlgRangefinder displayCtrl 1713151) ctrlSetText _range;
parseNumber _range
parseNumber ctrlText (_dlgRangefinder displayCtrl 151);

View File

@ -1,21 +1,32 @@
// by commy2
/*
* Author: commy2
* Handle Air burst ammunition. Called from per frame handler.
*
* Arguments:
* -
*
* Return Value:
* None
*
* Public: No
*/
#include "script_component.hpp"
private ["_vehicle", "_projectile", "_zeroing", "_position", "_subMunition"];
_vehicle = _this select 0 select 0;
_projectile = _this select 0 select 1;
_zeroing = _this select 0 select 2;
(_this select 0) params ["_vehicle", "_projectile", "_zeroing"];
// remove pfh if the projectile died before arriving
if (isNull _projectile || {!alive _projectile}) exitWith {
[_this select 1] call CBA_fnc_removePerFrameHandler;
};
// wait if not there
if (_projectile distance _vehicle < _zeroing) exitWith {};
_position = getPosATL _projectile;
// explode
private _position = getPosATL _projectile;
private _subMunition = createVehicle ["ACE_B_35mm_ABM_Helper", _position, [], 0, "FLY"];
_subMunition = createVehicle ["ACE_B_35mm_ABM_Helper", _position, [], 0, "FLY"];
_subMunition setPosATL _position;
_subMunition setVelocity [0, 0, -10];

View File

@ -1,23 +1,22 @@
/*
* Author: KoffeinFlummi
*
* Starts watching the target for sideways correction.
*
* Arguments:
* 0: Vehicle
* 0: Vehicle <OBJECT>
* 1: Turret <ARRAY>
*
* Return Value:
* none
* None
*
* Public: No
*/
#include "script_component.hpp"
private ["_vehicle", "_turret", "_distance", "_weaponDirection"];
params ["_vehicle", "_turret"];
_vehicle = _this select 0;
_turret = _this select 1;
_distance = call FUNC(getRange);
private _distance = call FUNC(getRange);
call (updateRangeHUD);
if !(!GVAR(enabled) && FUNC(canUseFCS)) exitWith {};
@ -28,7 +27,7 @@ if (_distance == 0) then {
_distance = [5, 5000, 0] call EFUNC(common,getTargetDistance); // maximum distance: 5000m, 5m precision
};
_weaponDirection = _vehicle weaponDirection (_vehicle currentWeaponTurret _turret); // @todo doesn't work for sub turrets
private _weaponDirection = _vehicle weaponDirection (_vehicle currentWeaponTurret _turret); // @todo doesn't work for sub turrets
if (_turret isEqualTo ([_vehicle] call EFUNC(common,getTurretCommander))) then {
_weaponDirection = eyeDirection _vehicle;
@ -38,8 +37,4 @@ if (_weaponDirection isEqualTo [0,0,0]) then { // dummy value for non main turr
_weaponDirection = [1,0,0];
};
GVAR(Position) = [
(getPos _vehicle select 0) + _distance * (_weaponDirection select 0),
(getPos _vehicle select 1) + _distance * (_weaponDirection select 1),
(getPos _vehicle select 2) + _distance * (_weaponDirection select 2)
];
GVAR(Position) = (getPosASL _vehicle) vectorAdd (_weaponDirection vectorMultiply _distance);

View File

@ -1,40 +1,38 @@
/*
* Author: KoffeinFlummi
*
* Calculates the offsets for all weapons needed to hit the current target.
*
* Arguments:
* 0: The vehicle
* 0: Vehicle <OBJECT>
* 1: Turret <ARRAY>
*
* Return Value:
* none
* None
*
* Public: No
*/
#include "script_component.hpp"
private ["_vehicle", "_turret", "_turretConfig", "_distance", "_weapons", "_magazines", "_showHint", "_playSound", "_i"];
params ["_vehicle", "_turret", "_distance", ["_showHint", false], ["_playSound", true]];
_vehicle = _this select 0;
_turret = _this select 1;
private _turretConfig = [configFile >> "CfgVehicles" >> typeOf _vehicle, _turret] call EFUNC(common,getTurretConfigPath);
_turretConfig = [configFile >> "CfgVehicles" >> typeOf _vehicle, _turret] call EFUNC(common,getTurretConfigPath);
call (updateRangeHUD);
_distance = call FUNC(getRange);
if (isNil "_distance") then {
_distance = call FUNC(getRange);
_weapons = _vehicle weaponsTurret _turret;
_magazines = _vehicle magazinesTurret _turret;
if (_distance == 0) then {
_distance = [
getNumber (_turretConfig >> QGVAR(DistanceInterval)),
getNumber (_turretConfig >> QGVAR(MaxDistance)),
getNumber (_turretConfig >> QGVAR(MinDistance))
] call EFUNC(common,getTargetDistance); // maximum distance: 5000m, 5m precision
if (_distance == 0) then {
_distance = [
getNumber (_turretConfig >> QGVAR(DistanceInterval)),
getNumber (_turretConfig >> QGVAR(MaxDistance)),
getNumber (_turretConfig >> QGVAR(MinDistance))
] call EFUNC(common,getTargetDistance); // maximum distance: 5000m, 5m precision
};
};
private ["_weapon", "_weaponDirection", "_angleTarget"];
_weapon = _vehicle currentWeaponTurret _turret;
_weaponDirection = _vehicle weaponDirection _weapon; // @todo doesn't work for sub turrets
private _weapon = _vehicle currentWeaponTurret _turret;
private _weaponDirection = _vehicle weaponDirection _weapon; // @todo doesn't work for sub turrets
if (_turret isEqualTo ([_vehicle] call EFUNC(common,getTurretCommander))) then {
_weaponDirection = eyeDirection _vehicle;
@ -44,176 +42,139 @@ if (_weaponDirection isEqualTo [0,0,0]) then { // dummy value for non main turr
_weaponDirection = [1,0,0];
};
_angleTarget = asin (_weaponDirection select 2);
if (count _this > 2) then {
if((_this select 2) > -1) then {
_distance = _this select 2;
};
};
if (!(isNil QGVAR(backgroundCalculation)) and {!(scriptDone GVAR(backgroundCalculation))}) then {
terminate GVAR(backgroundCalculation);
};
private ["_movingAzimuth", "_posTarget", "_velocityTarget"];
private _angleTarget = asin (_weaponDirection select 2);
// MOVING TARGETS
_movingAzimuth = 0;
if (ACE_time - GVAR(time) > 1 and GVAR(time) != -1 and count _this < 3) then {
// calculate speed of target
_posTarget = [
(getPos _vehicle select 0) + _distance * (_weaponDirection select 0),
(getPos _vehicle select 1) + _distance * (_weaponDirection select 1),
(getPos _vehicle select 2) + _distance * (_weaponDirection select 2)
];
_velocityTarget = [
((_posTarget select 0) - (GVAR(position) select 0)) / (ACE_time - GVAR(time)),
((_posTarget select 1) - (GVAR(position) select 1)) / (ACE_time - GVAR(time)),
((_posTarget select 2) - (GVAR(position) select 2)) / (ACE_time - GVAR(time))
];
private _movingAzimuth = 0;
private ["_magazineType", "_ammoType", "_initSpeed", "_airFriction", "_timeToLive", "_simulationStep", "_initSpeedCoef", "_velocityMagnitude"];
if (ACE_time - GVAR(time) > 1 && GVAR(time) != -1 && isNil {_this select 2}) then {
// calculate speed of target
private _posTarget = (getPosASL _vehicle) vectorAdd (_weaponDirection vectorMultiply _distance);
private _velocityTarget = (_posTarget vectorDiff GVAR(position)) vectorMultiply (1 / (ACE_time - GVAR(time)));
// estimate time to target
_magazineType = _vehicle currentMagazineTurret _turret;
_ammoType = getText (configFile >> "CfgMagazines" >> _magazineType >> "ammo");
_initSpeed = getNumber (configFile >> "CfgMagazines" >> _magazineType >> "initSpeed");
_airFriction = getNumber (configFile >> "CfgAmmo" >> _ammoType >> "airFriction");
_timeToLive = getNumber (configFile >> "CfgAmmo" >> _ammoType >> "timeToLive");
_simulationStep = getNumber (configFile >> "CfgAmmo" >> _ammoType >> "simulationStep");
private _magazine = _vehicle currentMagazineTurret _turret;
private _ammo = getText (configFile >> "CfgMagazines" >> _magazine >> "ammo");
private _initSpeed = getNumber (configFile >> "CfgMagazines" >> _magazine >> "initSpeed");
private _airFriction = getNumber (configFile >> "CfgAmmo" >> _ammo >> "airFriction");
private _timeToLive = getNumber (configFile >> "CfgAmmo" >> _ammo >> "timeToLive");
private _simulationStep = getNumber (configFile >> "CfgAmmo" >> _ammo >> "simulationStep");
private _initSpeedCoef = getNumber (configFile >> "CfgWeapons" >> _weapon >> "initSpeed");
_initSpeedCoef = getNumber(configFile >> "CfgWeapons" >> _weapon >> "initSpeed");
if (_initSpeedCoef < 0) then {
_initSpeed = _initSpeed * -_initSpeedCoef;
_initSpeed = _initSpeed * - _initSpeedCoef;
};
if (_initSpeedCoef > 0) then {
_initSpeed = _initSpeedCoef;
};
if (_simulationStep != 0) then {
private ["_posX", "_velocityX", "_velocityY", "_timeToTarget"];
private _posX = 0;
private _velocityX = _initSpeed;
private _velocityY = 0;
private _timeToTarget = 0;
_posX = 0;
_velocityX = _initSpeed;
_velocityY = 0;
_timeToTarget = 0;
for "_i" from 1 to ((floor (_timeToLive / _simulationStep)) + 1) do {
for "_i" from 1 to (floor (_timeToLive / _simulationStep) + 1) do {
_posX = _posX + _velocityX * _simulationStep;
if (_posX >= _distance) exitWith { // bullet passed the target
_timeToTarget = _i * _simulationStep;
};
_velocityMagnitude = sqrt (_velocityX^2 + _velocityY^2);
private _velocityMagnitude = sqrt (_velocityX ^ 2 + _velocityY ^ 2);
_velocityX = _velocityX + _velocityX * _velocityMagnitude * _airFriction * _simulationStep;
_velocityY = _velocityY + _velocityY * _velocityMagnitude * _airFriction * _simulationStep - 9.81 * _simulationStep;
};
private ["_posArrival", "_dirArrival"];
// calculate offsets
_posArrival = [
(_posTarget select 0) + (_velocityTarget select 0) * _timeToTarget,
(_posTarget select 1) + (_velocityTarget select 1) * _timeToTarget,
(_posTarget select 2) + (_velocityTarget select 2) * _timeToTarget
];
_dirArrival = [
((_posArrival select 0) - (getPos _vehicle select 0)) / (_posArrival distance (getPos _vehicle)),
((_posArrival select 1) - (getPos _vehicle select 1)) / (_posArrival distance (getPos _vehicle)),
((_posArrival select 2) - (getPos _vehicle select 2)) / (_posArrival distance (getPos _vehicle))
];
private _posArrival = _posTarget vectorAdd (_velocityTarget vectorMultiply _timeToTarget);
private _dirArrival = (_posArrival vectorDiff getPosASL _vehicle) vectorMultiply (1 / (_posArrival vectorDistance getPosASL _vehicle));
_movingAzimuth = ((_dirArrival select 0) atan2 (_dirArrival select 1)) - ((_weaponDirection select 0) atan2 (_weaponDirection select 1));
_angleTarget = asin (_dirArrival select 2);
_distance = floor (_posArrival distance (getPos _vehicle));
_distance = floor (_posArrival distance (getPosASL _vehicle));
};
};
GVAR(enabled) = false;
GVAR(time) = -1;
private ["_viewDiff", "_FCSAzimuth", "_FCSMagazines", "_FCSElevation"];
// CALCULATE AZIMUTH CORRECTION
_viewDiff = _vehicle getVariable format ["%1_%2", QGVAR(ViewDiff), _turret];
_FCSAzimuth = _movingAzimuth;
private _viewDiff = _vehicle getVariable format ["%1_%2", QGVAR(ViewDiff), _turret];
private _FCSAzimuth = _movingAzimuth;
if (_viewDiff != 0) then {
_FCSAzimuth = (atan (_distance / _viewDiff) - (abs _viewDiff / _viewDiff) * 90) + _movingAzimuth;
};
// CALCULATE OFFSET
_FCSMagazines = [];
_FCSElevation = [];
private _FCSMagazines = [];
private _FCSElevation = [];
{
private ["_magazine", "_ammoType"];
_magazine = _x;
_ammoType = getText (configFile >> "CfgMagazines" >> _magazine >> "ammo");
private _magazine = _x;
private _ammo = getText (configFile >> "CfgMagazines" >> _magazine >> "ammo");
if !(getText (configFile >> "CfgAmmo" >> _ammoType >> "simulation") == "shotMissile") then {
private ["_maxElev", "_initSpeed", "_airFriction", "_offset"];
_maxElev = getNumber (_turretConfig >> "maxElev");
_initSpeed = getNumber (configFile >> "CfgMagazines" >> _magazine >> "initSpeed");
_airFriction = getNumber (configFile >> "CfgAmmo" >> _ammoType >> "airFriction");
if !(getText (configFile >> "CfgAmmo" >> _ammo >> "simulation") == "shotMissile") then {
private _maxElev = getNumber (_turretConfig >> "maxElev");
private _initSpeed = getNumber (configFile >> "CfgMagazines" >> _magazine >> "initSpeed");
private _airFriction = getNumber (configFile >> "CfgAmmo" >> _ammo >> "airFriction");
{
private ["_weapon", "_muzzles", "_weaponMagazines", "_muzzleMagazines"];
_weapon = _x;
_muzzles = getArray (configFile >> "CfgWeapons" >> _weapon >> "muzzles");
_weaponMagazines = getArray (configFile >> "CfgWeapons" >> _weapon >> "magazines");
{
if (_x != "this") then {
_muzzleMagazines = getArray (configFile >> "CfgWeapons" >> _weapon >> _x >> "magazines");
_weaponMagazines append _muzzleMagazines;
};
} forEach _muzzles;
false
} count _muzzles;
if (_magazine in _weaponMagazines) exitWith {
_initSpeedCoef = getNumber(configFile >> "CfgWeapons" >> _weapon >> "initSpeed");
if (_initSpeedCoef < 0) then {
_initSpeed = _initSpeed * -_initSpeedCoef;
};
if (_initSpeedCoef > 0) then {
_initSpeed = _initSpeedCoef;
};
};
} forEach _weapons;
false
} count (_vehicle weaponsTurret _turret);
_offset = "ace_fcs" callExtension format ["%1,%2,%3,%4", _initSpeed, _airFriction, _angleTarget, _distance];
private _offset = "ace_fcs" callExtension format ["%1,%2,%3,%4", _initSpeed, _airFriction, _angleTarget, _distance];
_offset = parseNumber _offset;
_FCSMagazines = _FCSMagazines + [_magazine];
_FCSElevation = _FCSElevation + [_offset];
_FCSMagazines pushBack _magazine;
_FCSElevation pushBack _offset;
};
} forEach _magazines;
false
} count (_vehicle magazinesTurret _turret);
[_vehicle, format ["%1_%2", QGVAR(Distance), _turret], _distance] call EFUNC(common,setVariablePublic);
[_vehicle, format ["%1_%2", QGVAR(Distance), _turret], _distance] call EFUNC(common,setVariablePublic);
[_vehicle, format ["%1_%2", QGVAR(Magazines), _turret], _FCSMagazines] call EFUNC(common,setVariablePublic);
[_vehicle, format ["%1_%2", QGVAR(Elevation), _turret], _FCSElevation] call EFUNC(common,setVariablePublic);
[_vehicle, format ["%1_%2", QGVAR(Azimuth), _turret], _FCSAzimuth] call EFUNC(common,setVariablePublic);
[_vehicle, format ["%1_%2", QGVAR(Azimuth), _turret], _FCSAzimuth] call EFUNC(common,setVariablePublic);
_showHint = false;
if( (count _this) > 3) then {
_showHint = _this select 3;
};
_playSound = true;
if( (count _this) > 3) then {
_playSound = _this select 4;
};
if(_playSound) then {
if (_playSound) then {
playSound "ACE_Sound_Click";
};
if(_showHint) then {
if (_showHint) then {
[format ["%1: %2", localize LSTRING(ZeroedTo), _distance]] call EFUNC(common,displayTextStructured);
};
//Update the hud's distance display to the new value or "----" if out of range
//(10m fudge because of EFUNC(common,getTargetDistance))
if ((_distance + 10) >= (getNumber (_turretConfig >> QGVAR(MaxDistance)))) then {
if (_distance + 10 >= getNumber (_turretConfig >> QGVAR(MaxDistance))) then {
((uiNamespace getVariable ["ACE_dlgRangefinder", displayNull]) displayCtrl 1713151) ctrlSetText "----";
} else {
((uiNamespace getVariable ["ACE_dlgRangefinder", displayNull]) displayCtrl 1713151) ctrlSetText ([_distance, 4, 0] call CBA_fnc_formatNumber);

View File

@ -1,7 +1,13 @@
#include "script_component.hpp"
if !([ACE_player, vehicle ACE_player, []] call EFUNC(common,canInteractWith)) exitWith {false};
params ["_unit"];
private _vehicle = vehicle _unit;
if !([_unit, _vehicle, []] call EFUNC(common,canInteractWith)) exitWith {false};
if !((!GVAR(enabled) && FUNC(canUseFCS)) || FUNC(canUseRangefinder)) exitWith {false};
[vehicle ACE_player, [ACE_player] call EFUNC(common,getTurretIndex), -1, false] call FUNC(keyDown);
[vehicle ACE_player, [ACE_player] call EFUNC(common,getTurretIndex), -1, false, false] call FUNC(keyUp);
private _turret = _unit call EFUNC(common,getTurretIndex);
[_vehicle, _turret, -1, false] call FUNC(keyDown);
[_vehicle, _turret, -1, false, false] call FUNC(keyUp);

View File

@ -1,21 +1,19 @@
/*
* Author: KoffeinFlummi
*
* Resets the FCS to default.
*
* Arguments:
* 0: Vehicle
* 0: Vehicle <OBJECT>
* 1: Turret <ARRAY>
*
* Return Value:
* none
*
* Public: No
*/
#include "script_component.hpp"
private ["_vehicle", "_turret"];
_vehicle = _this select 0;
_turret = _this select 1;
params ["_vehicle", "_turret"];
[_vehicle, format ["%1_%2", QGVAR(Distance), _turret], 0] call EFUNC(common,setVariablePublic);
[_vehicle, format ["%1_%2", QGVAR(Magazines), _turret], []] call EFUNC(common,setVariablePublic);

View File

@ -0,0 +1,18 @@
/*
* Author: commy2
* Update compatible info elements.
*
* Argument:
* None
*
* Return value:
* None
*
* Public: No
*/
#include "script_component.hpp"
disableSerialization;
private _dlgRangefinder = uiNamespace getVariable ["ACE_dlgRangefinder", displayNull];
(_dlgRangefinder displayCtrl 1713151) ctrlSetText ctrlText (_dlgRangefinder displayCtrl 151);

View File

@ -1,6 +1,5 @@
/*
* Author: KoffeinFlummi, commy2
*
* Checks if a vehicle is equipped with an FCS and if so, adds the fired event handler. Execute on server.
*
* Arguments:
@ -8,17 +7,15 @@
*
* Return Value:
* none
*
* Public: No
*/
#include "script_component.hpp"
private "_vehicle";
_vehicle = _this select 0;
params ["_vehicle"];
{
private "_turretConfig";
_turretConfig = [configFile >> "CfgVehicles" >> typeOf _vehicle, _x] call EFUNC(common,getTurretConfigPath);
private _turretConfig = [configFile >> "CfgVehicles" >> typeOf _vehicle, _x] call EFUNC(common,getTurretConfigPath);
if (getNumber (_turretConfig >> QGVAR(Enabled)) == 1) then {
_vehicle setVariable [format ["%1_%2", QGVAR(Distance), _x], 0, true];
@ -42,4 +39,5 @@ _vehicle = _this select 0;
_vehicle setVariable [format ["%1_%2", QGVAR(ViewDiff), _x], 0, true];
};
};
} forEach allTurrets _vehicle;
false
} count allTurrets _vehicle;

View File

@ -27,7 +27,7 @@ _fingerPos = if (_sourceUnit == ACE_player) then {
_fingerPosPrecise vectorAdd [random (2*FP_RANDOMIZATION_X) - FP_RANDOMIZATION_X, random (2*FP_RANDOMIZATION_X) - FP_RANDOMIZATION_X, random (2*FP_RANDOMIZATION_Y) - FP_RANDOMIZATION_Y]
};
_data = [ACE_diagTime, _fingerPos, ([_sourceUnit] call EFUNC(common,getName))];
_data = [ACE_diagTime, _fingerPos, ([_sourceUnit, false, true] call EFUNC(common,getName))];
HASH_SET(GVAR(fingersHash), _sourceUnit, _data);
if (GVAR(pfeh_id) == -1) then {

View File

@ -0,0 +1,11 @@
class ACE_Settings {
class GVAR(showOnInteractionMenu) {
value = 2;
typeName = "SCALAR";
isClientSettable = 1;
category = ECSTRING(interact_menu,Category_InteractionMenu);
displayName = CSTRING(showOnInteractionMenu_displayName);
description = CSTRING(showOnInteractionMenu_description);
values[] = {"$STR_A3_OPTIONS_DISABLED", CSTRING(justKeybinds), CSTRING(keysAndInteractionMenu)};
};
};

View File

@ -5,12 +5,12 @@ class CfgVehicles {
class ACE_SelfActions {
class ADDON {
displayName = CSTRING(Gestures);
condition = QUOTE(canStand _target && GVAR(ReloadMutex));
condition = QUOTE((canStand _target) && GVAR(ReloadMutex) && {GVAR(showOnInteractionMenu) == 2});
statement = "";
showDisabled = 1;
priority = 3.5;
icon = PATHTOF(UI\gestures_ca.paa);
class GVAR(Advance) {
displayName = CSTRING(BIgestureAdvance);
condition = QUOTE(canStand _target);
@ -116,7 +116,6 @@ class CfgVehicles {
statement = QUOTE(_target playActionNow ([ARR_2('gestureYes','gestureNod')] select floor random 2););
showDisabled = 1;
priority = 1.1;
hotkey = "8";
};
class class GVAR(No) {
@ -125,7 +124,6 @@ class CfgVehicles {
statement = QUOTE(_target playActionNow 'gestureNo';);
showDisabled = 1;
priority = 1.0;
hotkey = "9";
};
class class GVAR(Hi) {
@ -134,7 +132,6 @@ class CfgVehicles {
statement = QUOTE(_target playActionNow ([ARR_3('gestureHi','gestureHiB','gestureHiC')] select floor random 3););
showDisabled = 1;
priority = 0.9;
hotkey = "0";
};
*/

View File

@ -12,6 +12,7 @@ class CfgPatches {
};
};
#include "ACE_Settings.hpp"
#include "CfgMovesBasic.hpp"
#include "CfgEventHandlers.hpp"
#include "CfgVehicles.hpp"

View File

@ -18,10 +18,14 @@
TRACE_1("params",_this);
if (!GVAR(ReloadMutex)) exitWith {false};
if (GVAR(showOnInteractionMenu) == 0) exitWith {false};
if !([ACE_player, objNull, []] call EFUNC(common,canInteractWith)) exitWith {false};
private _gesture = if (_this select [0,2] == "BI") then {
private _gesture = if ((_this select [0,2]) == "BI") then {
//If it starts with BI, just strip off the leading BI and use it directly
_this select [2]
} else {
//Adjust gesture based on stance:
if (((animationState ACE_player) select [0, 12]) in ["amovpercmstp", "amovpercmwlk", "amovpercmtac"] && weaponLowered ACE_player) then {
format ["%1StandLowered", _this]
} else {
@ -29,5 +33,6 @@ private _gesture = if (_this select [0,2] == "BI") then {
};
};
TRACE_1("playing gesture",_gesture);
ACE_player playAction _gesture;
true

View File

@ -3,11 +3,15 @@
{
_x params ["_currentName","_key"];
if (_currentName select [0,1] == "BI") then {
_currentName = _currentName select [2];
private _signalName = format [QGVAR(%1), _currentName];
if (_currentName select [0,2] == "BI") then {
//Don't add "ace_gestures_" prefix to BI gestures
_signalName = _currentName;
};
private _code = (compile format [QUOTE(QUOTE(QGVAR(%1)) call FUNC(playSignal);), _currentName]);
private _code = (compile format [QUOTE('%1' call FUNC(playSignal);), _signalName]);
TRACE_4("Adding KeyBind",_currentName,_signalName,_code,_key);
[
"ACE3 Gestures",

View File

@ -92,7 +92,7 @@
<Polish>Wskazać</Polish>
<Czech>Ukázat</Czech>
<French>Pointer</French>
<Russian>Точка</Russian>
<Russian>Показать направление</Russian>
<Hungarian>Mutat</Hungarian>
<Portuguese>Apontar</Portuguese>
<Italian>Puntare a</Italian>
@ -115,6 +115,8 @@
<French>Stop</French>
<German>Stop</German>
<Polish>Stop</Polish>
<Russian>Стоп</Russian>
<Portuguese>Parar</Portuguese>
</Key>
<!-- COVER -->
<Key ID="STR_ACE_Gestures_cover">
@ -135,6 +137,8 @@
<French>Regroupement</French>
<German>Sammeln</German>
<Polish>Zbiórka</Polish>
<Russian>Собраться</Russian>
<Portuguese>Reagrupar</Portuguese>
</Key>
<!-- FORWARD -->
<Key ID="STR_ACE_Gestures_forward">
@ -142,12 +146,16 @@
<French>En avant</French>
<German>Vorwärts Bewegen</German>
<Polish>Naprzód</Polish>
<Russian>Вперед</Russian>
<Portuguese>Mover em frente</Portuguese>
</Key>
<!-- ENGAGE -->
<Key ID="STR_ACE_Gestures_engage">
<English>Engage</English>
<French>Engager</French>
<Polish>Atak</Polish>
<Russian>Открыть огонь</Russian>
<Portuguese>Engajar</Portuguese>
</Key>
<!-- POINT -->
<Key ID="STR_ACE_Gestures_point">
@ -155,6 +163,8 @@
<French>Pointer</French>
<German>Zeigen</German>
<Polish>Wskaż</Polish>
<Russian>Показать направление</Russian>
<Portuguese>Ponta</Portuguese>
</Key>
<!-- HOLD -->
<Key ID="STR_ACE_Gestures_hold">
@ -162,6 +172,8 @@
<French>Tenir</French>
<German>Anhalten</German>
<Polish>Wstrzymać</Polish>
<Russian>Ждать</Russian>
<Portuguese>Esperar</Portuguese>
</Key>
<!-- WARNING -->
<Key ID="STR_ACE_Gestures_warning">
@ -169,6 +181,8 @@
<French>Attention</French>
<German>Achtung</German>
<Polish>Uwaga</Polish>
<Russian>Внимание</Russian>
<Portuguese>Aviso</Portuguese>
</Key>
<Key ID="STR_ACE_Gestures_Hi">
<English>Hi</English>
@ -194,5 +208,17 @@
<Portuguese>Atacar</Portuguese>
<Italian>Attaccare</Italian>
</Key>
<Key ID="STR_ACE_Gestures_showOnInteractionMenu_displayName">
<English>Show Gestures On Interaction Menu</English>
</Key>
<Key ID="STR_ACE_Gestures_showOnInteractionMenu_description">
<English>Show gestures on the self interaction menu, or just use keybinds, or disable completely</English>
</Key>
<Key ID="STR_ACE_Gestures_justKeybinds">
<English>Just Keybinds</English>
</Key>
<Key ID="STR_ACE_Gestures_keysAndInteractionMenu">
<English>Keybinds + Interaction Menu</English>
</Key>
</Package>
</Project>

View File

@ -14,15 +14,15 @@ class Extended_PostInit_EventHandlers {
class Extended_Killed_EventHandlers {
class CAManBase {
class ADDON {
killed = QUOTE(_this call FUNC(handleKilled));
clientKilled = QUOTE(_this call FUNC(handleKilled));
};
};
};
class Extended_Fired_EventHandlers {
class Extended_FiredBIS_EventHandlers {
class CAManBase {
class ADDON {
fired = QUOTE(if (local (_this select 0)) then {_this call FUNC(handleFired)});
clientFiredBIS = QUOTE(if (local (_this select 0)) then {_this call FUNC(handleFired)});
};
};
};
@ -30,7 +30,7 @@ class Extended_Fired_EventHandlers {
class Extended_Explosion_EventHandlers {
class CAManBase {
class ADDON {
explosion = QUOTE(if (local (_this select 0)) then {_this call FUNC(handleExplosion)});
clientExplosion = QUOTE(if (local (_this select 0)) then {_this call FUNC(handleExplosion)});
};
};
};

View File

@ -114,16 +114,20 @@ private _fnc_checkGoggles = {
// goggles effects main PFH
[{
BEGIN_COUNTER(goggles);
// rain
call FUNC(applyRainEffect);
// auto remove effects under water
if (GVAR(EffectsActive) && {[goggles ACE_player] call FUNC(isDivingGoggles) && {underwater ACE_player}}) then {
if (GVAR(EffectsActive) && {underwater ACE_player} && {[goggles ACE_player] call FUNC(isDivingGoggles)}) then {
call FUNC(removeRainEffect);
call FUNC(removeDirtEffect);
call FUNC(removeDustEffect);
};
// rotor wash effect
call FUNC(applyRotorWashEffect)
}, 0.5, _fnc_checkGoggles] call CBA_fnc_addPerFrameHandler;
call FUNC(applyRotorWashEffect);
END_COUNTER(goggles);
}, 0.5, []] call CBA_fnc_addPerFrameHandler;

View File

@ -15,7 +15,6 @@
*/
#include "script_component.hpp"
if (GVAR(showInThirdPerson)) exitWith {false};
if (call FUNC(externalCamera)) exitWith {false};
private ["_unit", "_effects"];

View File

@ -15,7 +15,6 @@
*/
#include "script_component.hpp"
if (GVAR(showInThirdPerson)) exitWith {};
if (call FUNC(ExternalCamera)) exitWith {};
private ["_unit", "_amount"];

View File

@ -15,4 +15,8 @@
*/
#include "script_component.hpp"
cameraView in ["EXTERNAL", "GROUP"] || EFUNC(common,isFeatureCameraActive) // return
if (GVAR(showInThirdPerson)) then {
cameraView in ["GROUP"] || EFUNC(common,isFeatureCameraActive)
} else {
cameraView in ["EXTERNAL", "GROUP"] || EFUNC(common,isFeatureCameraActive)
};

View File

@ -37,7 +37,6 @@ _effects set [BROKEN, true];
SETGLASSES(_unit,_effects);
if (getText (_config >> "ACE_OverlayCracked") != "") then {
if (GVAR(showInThirdPerson)) exitWith {};
if (call FUNC(ExternalCamera)) exitWith {};
if (isNull (GLASSDISPLAY)) then {

View File

@ -11,7 +11,6 @@ class CfgVehicles {
showDisabled = 0;
priority = 2.5;
icon = PATHTOF(UI\ACE_earplugs_x_ca.paa);
hotkey = "E";
};
class ACE_RemoveEarplugs {
displayName = CSTRING(EarPlugs_Off);
@ -21,7 +20,6 @@ class CfgVehicles {
showDisabled = 0;
priority = 2.5;
icon = PATHTOF(UI\ACE_earplugs_x_ca.paa);
hotkey = "E";
};
};
};

View File

@ -172,10 +172,14 @@
<Key ID="STR_ACE_Hearing_autoAddEarplugsToUnits_DisplayName">
<English>Add earplugs to units</English>
<Polish>Dodaj stopery dla jednostek</Polish>
<Russian>Добавлять юнитам беруши</Russian>
<Portuguese>Adiciona protetores de ouvido as unidades</Portuguese>
</Key>
<Key ID="STR_ACE_Hearing_autoAddEarplugsToUnits_Description">
<English>Add the `ACE_EarPlugs` item to all units that have loud weapons. Can disable if using custom loadouts.</English>
<Polish>Dodaje `ACE_EarPlugs` - stopery - do wszystkich jednostek, które posiadają głośną broń. Można wyłaczyć w przypadku korzystania z niestandardowych loadoutów.</Polish>
<Russian>Добавляет предмет `ACE_EarPlugs` всем юнитам, которые имеют громкое оружие. Можно отключить при ручной настройке снаряжения.</Russian>
<Portuguese>Adicionar o item `ACE_EarPlugs` a todas as unidades que tenham armas barulhentas. Pode ser desabilitado com carregamentos customizados.</Portuguese>
</Key>
</Package>
</Project>

View File

@ -77,37 +77,6 @@ GVAR(ParsedTextCached) = [];
if (GVAR(menuBackground)==2) then {(uiNamespace getVariable [QGVAR(menuBackground), displayNull]) closeDisplay 0;};
}] call EFUNC(common,addEventHandler);
// Let key work with zeus open (not perfect, contains workaround to prevent other CBA keybindings)
["zeusDisplayChanged",{
if (_this select 1) then {
(finddisplay 312) displayAddEventHandler ["KeyUp", {
_key = ["ACE3 Common","ace_interact_menu_InteractKey"] call CBA_fnc_getKeybind;
_key = _key select 5;
_dik = _key select 0;
_mods = _key select 1;
if ((_this select 1) == _dik) then {
if ((_this select [2,3]) isEqualTo _mods) then {
[_this,'keyup'] call CBA_events_fnc_keyHandler
};
};
}];
(finddisplay 312) displayAddEventHandler ["KeyDown", {
_key = ["ACE3 Common","ace_interact_menu_InteractKey"] call CBA_fnc_getKeybind;
_key = _key select 5;
_dik = _key select 0;
_mods = _key select 1;
if ((_this select 1) == _dik) then {
if ((_this select [2,3]) isEqualTo _mods) then {
[_this,'keydown'] call CBA_events_fnc_keyHandler
};
};
}];
};
}] call EFUNC(common,addEventHandler);
//Debug to help end users identify mods that break CBA's XEH
[{
private ["_badClassnames"];

View File

@ -6,6 +6,6 @@ params ["_ctrl", "_index", "_text"];
//systemChat str (_text != ARR_SELECT(GVAR(ParsedTextCached),_index,"-1"));
if (_text != ARR_SELECT(GVAR(ParsedTextCached),_index,"-1")) then {
GVAR(ParsedTextCached) set [_index, _text];
_ctrl ctrlSetStructuredText parseText _text;
GVAR(ParsedTextCached) set [_index, _text];
_ctrl ctrlSetStructuredText parseText _text;
};

View File

@ -80,11 +80,10 @@ if ((vehicle ACE_player) != ACE_player) exitWith {};
// 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;
_helperObject = "ACE_LogicDummy" createVehicleLocal _helperPos;
_addedHelpers pushBack _helperObject;
_helperObject setVariable [QGVAR(building), _houseBeingScaned];
_helperObject setPosASL _helperPos;
_helperObject hideObject true;
TRACE_3("Making New Helper",_helperObject,_x,_houseBeingScaned);
{

View File

@ -302,10 +302,14 @@
<Key ID="STR_ACE_Interact_Menu_menuAnimationSpeed">
<English>Interaction Animation Speed</English>
<Polish>Szybkość animacji interakcji</Polish>
<Russian>Скорость анимации меню взаимодействия</Russian>
<Portuguese>Velocidade da animação de interação</Portuguese>
</Key>
<Key ID="STR_ACE_Interact_Menu_menuAnimationSpeed_Description">
<English>Makes menu animations faster and decreases the time needed to hover to show sub actions</English>
<Polish>Przyśpiesza animacje menu interakcji oraz czas wymagany do pokazania podmenu</Polish>
<Russian>Ускоряет анимацию меню и уменьшает задержку при наведении мыши для раскрытия подменю</Russian>
<Portuguese>Faz com que as animações do menu de interação sejam mais rápidas, dimiuindo a necessidade de esperar para mostrar as ações</Portuguese>
</Key>
</Package>
</Project>

View File

@ -69,7 +69,6 @@ class CfgVehicles {
showDisabled = 0;
priority = 3.2;
icon = PATHTOF(UI\team\team_management_ca.paa);
hotkey = "M";
class ACE_AssignTeamRed {
displayName = CSTRING(AssignTeamRed);
@ -78,7 +77,6 @@ class CfgVehicles {
showDisabled = 1;
icon = PATHTOF(UI\team\team_red_ca.paa);
priority = 2.4;
hotkey = "R";
};
class ACE_AssignTeamGreen {
displayName = CSTRING(AssignTeamGreen);
@ -87,7 +85,6 @@ class CfgVehicles {
showDisabled = 1;
icon = PATHTOF(UI\team\team_green_ca.paa);
priority = 2.3;
hotkey = "G";
};
class ACE_AssignTeamBlue {
displayName = CSTRING(AssignTeamBlue);
@ -96,7 +93,6 @@ class CfgVehicles {
showDisabled = 1;
icon = PATHTOF(UI\team\team_blue_ca.paa);
priority = 2.2;
hotkey = "B";
};
class ACE_AssignTeamYellow {
displayName = CSTRING(AssignTeamYellow);
@ -105,7 +101,6 @@ class CfgVehicles {
showDisabled = 1;
icon = PATHTOF(UI\team\team_yellow_ca.paa);
priority = 2.1;
hotkey = "Y";
};
class ACE_UnassignTeam {
displayName = CSTRING(LeaveTeam);
@ -114,7 +109,6 @@ class CfgVehicles {
showDisabled = 1;
icon = PATHTOF(UI\team\team_white_ca.paa);
priority = 2.5;
hotkey = "N";
};
};
@ -125,7 +119,6 @@ class CfgVehicles {
showDisabled = 0;
priority = 2.6;
icon = PATHTOF(UI\team\team_management_ca.paa);
hotkey = "J";
};
class ACE_GetDown {
displayName = CSTRING(GetDown);
@ -224,7 +217,6 @@ class CfgVehicles {
showDisabled = 1;
priority = 3.2;
icon = PATHTOF(UI\team\team_management_ca.paa);
hotkey = "M";
class ACE_JoinTeamRed {
displayName = CSTRING(JoinTeamRed);
@ -234,7 +226,6 @@ class CfgVehicles {
showDisabled = 1;
priority = 2.4;
icon = PATHTOF(UI\team\team_red_ca.paa);
hotkey = "R";
};
class ACE_JoinTeamGreen {
displayName = CSTRING(JoinTeamGreen);
@ -244,7 +235,6 @@ class CfgVehicles {
showDisabled = 1;
priority = 2.3;
icon = PATHTOF(UI\team\team_green_ca.paa);
hotkey = "G";
};
class ACE_JoinTeamBlue {
displayName = CSTRING(JoinTeamBlue);
@ -254,7 +244,6 @@ class CfgVehicles {
showDisabled = 1;
priority = 2.2;
icon = PATHTOF(UI\team\team_blue_ca.paa);
hotkey = "B";
};
class ACE_JoinTeamYellow {
displayName = CSTRING(JoinTeamYellow);
@ -264,7 +253,6 @@ class CfgVehicles {
showDisabled = 1;
priority = 2.1;
icon = PATHTOF(UI\team\team_yellow_ca.paa);
hotkey = "Y";
};
class ACE_LeaveTeam {
displayName = CSTRING(LeaveTeam);
@ -274,7 +262,6 @@ class CfgVehicles {
showDisabled = 1;
priority = 2.5;
icon = PATHTOF(UI\team\team_white_ca.paa);
hotkey = "N";
};
class ACE_BecomeLeader {
displayName = CSTRING(BecomeLeader);
@ -284,7 +271,6 @@ class CfgVehicles {
showDisabled = 1;
priority = 1.0;
icon = PATHTOF(UI\team\team_white_ca.paa);
hotkey = "L";
};
class ACE_LeaveGroup {
displayName = CSTRING(LeaveGroup);
@ -294,7 +280,6 @@ class CfgVehicles {
showDisabled = 1;
priority = 1.2;
icon = PATHTOF(UI\team\team_management_ca.paa);
hotkey = "M";
};
};
class ACE_Equipment {
@ -305,7 +290,6 @@ class CfgVehicles {
showDisabled = 1;
priority = 4.5;
icon = ""; // @todo
hotkey = "E";
};
};
};
@ -485,7 +469,7 @@ class CfgVehicles {
};
};
};
class StaticMGWeapon: StaticWeapon {};
class HMG_01_base_F: StaticMGWeapon {};
@ -513,8 +497,8 @@ class CfgVehicles {
};
};
class thingX;
class ReammoBox_F: thingX {
class ThingX;
class ReammoBox_F: ThingX {
class ACE_Actions {
class ACE_MainActions {
displayName = CSTRING(MainAction);
@ -535,7 +519,7 @@ class CfgVehicles {
class ACE_SelfActions {};
};
class ACE_RepairItem_Base: thingX {
class ACE_RepairItem_Base: ThingX {
class ACE_Actions {
class ACE_MainActions {
displayName = CSTRING(MainAction);
@ -548,7 +532,7 @@ class CfgVehicles {
class ACE_SelfActions {};
};
class RoadCone_F: thingX {
class RoadCone_F: ThingX {
class ACE_Actions {
class ACE_MainActions {
displayName = CSTRING(MainAction);

View File

@ -22,7 +22,7 @@ params ["_unit", "_team"];
// display message
if (_unit == ACE_player) then {
private "_message";
private "_message";
if (_team == "MAIN") then {
_message = localize LSTRING(LeftTeam);

View File

@ -695,26 +695,36 @@
<English>Pass magazine</English>
<German>Magazin geben</German>
<Polish>Podaj magazynek</Polish>
<Russian>Передать магазин</Russian>
<Portuguese>Passar carregador</Portuguese>
</Key>
<Key ID="STR_ACE_Interaction_PassMagazinePrimary">
<English>Primary magazine</English>
<German>Gewehrmagazin</German>
<Polish>Magazynek karabinowy</Polish>
<Russian>Основной магазин</Russian>
<Portuguese>Carregador primário</Portuguese>
</Key>
<Key ID="STR_ACE_Interaction_PassMagazineHandgun">
<English>Pistol magazine</English>
<German>Pistolenmagazin</German>
<Polish>Magazynek pistoletowy</Polish>
<Russian>Магазин к пистолету</Russian>
<Portuguese>Carregador da pistola</Portuguese>
</Key>
<Key ID="STR_ACE_Interaction_PassMagazineHint">
<English>%1 passed you a %2 magazine.</English>
<German>%1 hat dir ein %2 Magazin gegeben.</German>
<Polish>%1 podał Ci magazynek %2.</Polish>
<Russian>%1 передал вам магазин %2.</Russian>
<Portuguese>%1 passou a você um carregador %2.</Portuguese>
</Key>
<Key ID="STR_ACE_Interaction_PassMagazineSetting">
<English>Show "pass magazine" interaction</English>
<German>Zeige "Magazine geben" Interaktion</German>
<Polish>Pokaż interakcję "podaj magazynek"</Polish>
<Russian>Показывать действие "передать магазин"</Russian>
<Portuguese>Mostrar a interação "Passar carregador"</Portuguese>
</Key>
</Package>
</Project>

View File

@ -0,0 +1,12 @@
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,50 @@
#include "script_component.hpp"
if (!hasInterface) exitWith {};
GVAR(customFilters) = [];
GVAR(selectedFilterIndex) = -1;
["inventoryDisplayLoaded", {_this call FUNC(inventoryDisplayLoaded)}] call EFUNC(common,addEventHandler);
// add custom filters
// generate list of grenades
GVAR(Grenades_ItemList) = [];
{
GVAR(Grenades_ItemList) append getArray (configFile >> "CfgWeapons" >> "Throw" >> _x >> "magazines");
false
} count getArray (configFile >> "CfgWeapons" >> "Throw" >> "muzzles");
// make list case insensitive
GVAR(Grenades_ItemList) = [GVAR(Grenades_ItemList), {toLower _this}] call EFUNC(common,map);
// filter duplicates
GVAR(Grenades_ItemList) = GVAR(Grenades_ItemList) arrayIntersect GVAR(Grenades_ItemList);
[localize LSTRING(Grenades), QFUNC(filterGrenades)] call FUNC(addCustomFilter);
[localize LSTRING(Backpacks), QFUNC(filterBackpacks)] call FUNC(addCustomFilter);
[localize LSTRING(Uniforms), QFUNC(filterUniforms)] call FUNC(addCustomFilter);
[localize LSTRING(Vests), QFUNC(filterVests)] call FUNC(addCustomFilter);
[localize LSTRING(Headgear), QFUNC(filterHeadgear)] call FUNC(addCustomFilter);
// generate list of medical items
GVAR(Medical_ItemList) = [];
{
GVAR(Medical_ItemList) append getArray (_x >> "items");
false
} count (
("true" configClasses (configFile >> QEGVAR(Medical,Actions) >> "Basic")) +
("true" configClasses (configFile >> QEGVAR(Medical,Actions) >> "Advanced"))
);
// make list case insensitive
GVAR(Medical_ItemList) = [GVAR(Medical_ItemList), {if (_this isEqualType "") then {toLower _this}}] call EFUNC(common,map);
// filter duplicates
GVAR(Medical_ItemList) = GVAR(Medical_ItemList) arrayIntersect GVAR(Medical_ItemList);
[localize LSTRING(Medical), QFUNC(filterMedical)] call FUNC(addCustomFilter);

View File

@ -0,0 +1,64 @@
#include "script_component.hpp"
ADDON = false;
PREP(addCustomFilter);
PREP(currentItemListBox);
PREP(forceItemListUpdate);
PREP(inventoryDisplayLoaded);
PREP(onLBSelChanged);
// cache config
// items in the inventory display can only be distinguished by their lb names and pictures
// this can cause collisions (mainly weapons with attachments),
// but if the item has the same name and picture it at least shouldn't change the filter anyway
// luckily we don't need private items, so dummy and parent classes are out of the picture
if !(uiNamespace getVariable [QGVAR(configCached), false]) then {
private _fnc_addToCache = {
private _displayName = getText (_this >> "displayName");
private _picture = getText (_this >> "picture");
// list box seems to delete the leading backslash
if (_picture select [0,1] == "\") then {
_picture = _picture select [1];
};
uiNamespace setVariable [format [QGVAR(ItemKey:%1:%2), _displayName, _picture], _this];
};
// weapons and items
{
if (getNumber (_x >> "scope") > 0) then {_x call _fnc_addToCache};
false
} count (
("true" configClasses (configFile >> "CfgWeapons")) +
("true" configClasses (configFile >> "CfgGlasses"))
);
// magazines
{
if (getNumber (_x >> "scope") == 2) then {_x call _fnc_addToCache};
false
} count ("true" configClasses (configFile >> "CfgMagazines"));
// backpacks
{
if (getNumber (_x >> "scope") > 0 && {getNumber (_x >> "isBackpack") == 1}) then {_x call _fnc_addToCache};
false
} count ("true" configClasses (configFile >> "CfgVehicles"));
uiNamespace setVariable [QGVAR(configCached), true];
};
PREP(filterWeapons);
PREP(filterMagazines);
PREP(filterItems);
PREP(filterHeadgear);
PREP(filterUniforms);
PREP(filterVests);
PREP(filterBackpacks);
PREP(filterGrenades);
PREP(filterMedical);
ADDON = true;

View File

@ -6,11 +6,13 @@ class CfgPatches {
weapons[] = {};
requiredVersion = REQUIRED_VERSION;
requiredAddons[] = {"ace_common"};
author[] = {"Pabst Mirror"};
author[] = {"Pabst Mirror, commy2"};
authorUrl = "https://github.com/PabstMirror/";
VERSION_CONFIG;
};
};
#include "CfgEventHandlers.hpp"
#include "RscDisplayInventory.hpp"
#include "ACE_Settings.hpp"

View File

@ -0,0 +1,19 @@
/*
* Author: commy2
* Adds a custom filter list to the inventory display.
* Functions are here as strings, because list boxes can only store numbers and strings.
*
* Arguments:
* 0: Localized filter display name <STRING>
* 1: Filter function name <STRING>
*
* Return Value:
* None
*
* Public: No
*/
#include "script_component.hpp"
params [["_filterName", "ERROR: No Name", [""]], ["_fncName", "", [""]]];
GVAR(customFilters) pushBack [_filterName, _fncName];

View File

@ -0,0 +1,30 @@
/*
* Author: commy2
* Returns the current item list box of given inventory display.
* These can be Ground, Soldier, Uniform, Backpack or Vest.
* Can also be Weapon since 1.52, but that apparently uses one of the above.
*
* Arguments:
* 0: Inventory display <DISPLAY>
*
* Return Value:
* Currently selected item list box <CONTROL>
*
* Public: No
*/
#include "script_component.hpp"
params ["_display"];
scopeName "main";
{
private _control = _display displayCtrl _x;
if (ctrlShown _control) then {
_control breakOut "main";
};
false
} count [IDC_ITEMLIST_GROUND, IDC_ITEMLIST_SOLDIER, IDC_ITEMLIST_UNIFORM, IDC_ITEMLIST_VEST, IDC_ITEMLIST_BACKPACK];
-1

View File

@ -0,0 +1,17 @@
/*
* Author: commy2
* Filter condition for the Backpacks filter list
*
* Arguments:
* 0: Item config entry <CONFIG>
*
* Return Value:
* Item should appear in this list? <BOOL>
*
* Public: No
*/
#include "script_component.hpp"
params ["_config"];
getNumber (_config >> "isBackpack") == 1

View File

@ -0,0 +1,17 @@
/*
* Author: commy2
* Filter condition for the Grenades filter list
*
* Arguments:
* 0: Item config entry <CONFIG>
*
* Return Value:
* Item should appear in this list? <BOOL>
*
* Public: No
*/
#include "script_component.hpp"
params ["_config"];
toLower configName _config in GVAR(Grenades_ItemList)

View File

@ -0,0 +1,17 @@
/*
* Author: commy2
* Filter condition for the Headgear filter list
*
* Arguments:
* 0: Item config entry <CONFIG>
*
* Return Value:
* Item should appear in this list? <BOOL>
*
* Public: No
*/
#include "script_component.hpp"
params ["_config"];
getNumber (_config >> "ItemInfo" >> "type") in [TYPE_HEADGEAR, TYPE_HMD] || {isClass (configFile >> "CfgGlasses" >> configName _config)}

View File

@ -0,0 +1,17 @@
/*
* Author: commy2
* Remove uniforms, vests and backpacks from Items filter.
*
* Arguments:
* 0: Item config entry <CONFIG>
*
* Return Value:
* Item should appear in this list? <BOOL>
*
* Public: No
*/
#include "script_component.hpp"
params ["_config"];
!(getNumber (_config >> "ItemInfo" >> "type") in [TYPE_UNIFORM, TYPE_VESTS, TYPE_HEADGEAR]) && {!(_this call FUNC(filterBackpacks))}

View File

@ -0,0 +1,15 @@
/*
* Author: commy2
* Remove backpacks and grenades from Magazines filter.
*
* Arguments:
* 0: Item config entry <CONFIG>
*
* Return Value:
* Item should appear in this list? <BOOL>
*
* Public: No
*/
#include "script_component.hpp"
!(_this call FUNC(filterBackpacks)) && {!(_this call FUNC(filterGrenades))}

View File

@ -0,0 +1,17 @@
/*
* Author: commy2
* Filter condition for the Medical filter list
*
* Arguments:
* 0: Item config entry <CONFIG>
*
* Return Value:
* Item should appear in this list? <BOOL>
*
* Public: No
*/
#include "script_component.hpp"
params ["_config"];
toLower configName _config in GVAR(Medical_ItemList)

View File

@ -0,0 +1,17 @@
/*
* Author: commy2
* Filter condition for the Uniforms filter list
*
* Arguments:
* 0: Item config entry <CONFIG>
*
* Return Value:
* Item should appear in this list? <BOOL>
*
* Public: No
*/
#include "script_component.hpp"
params ["_config"];
getNumber (_config >> "ItemInfo" >> "type") == TYPE_UNIFORM

View File

@ -0,0 +1,17 @@
/*
* Author: commy2
* Filter condition for the Vests filter list
*
* Arguments:
* 0: Item config entry <CONFIG>
*
* Return Value:
* Item should appear in this list? <BOOL>
*
* Public: No
*/
#include "script_component.hpp"
params ["_config"];
getNumber (_config >> "ItemInfo" >> "type") == TYPE_VEST

View File

@ -0,0 +1,15 @@
/*
* Author: commy2
* Remove backpacks from Weapons filter.
*
* Arguments:
* 0: Item config entry <CONFIG>
*
* Return Value:
* Item should appear in this list? <BOOL>
*
* Public: No
*/
#include "script_component.hpp"
!(_this call FUNC(filterBackpacks))

View File

@ -0,0 +1,40 @@
/*
* Author: commy2
* Updates item list and removes every entry that does not fit in the currently selected filter list.
*
* Arguments:
* 0: Inventory display <DISPLAY>
*
* Return Value:
* None
*
* Public: No
*/
#include "script_component.hpp"
disableSerialization;
params ["_display"];
private _index = GVAR(selectedFilterIndex);
private _itemList = _display call FUNC(currentItemListBox);
private _filterFunction = missionNamespace getVariable ((_display displayCtrl IDC_FILTERLISTS) lbData _index);
if (_filterFunction isEqualType {}) then {
private _i = 0;
while {_i < lbSize _itemList} do {
private _config = uiNamespace getVariable [
format [QGVAR(ItemKey:%1:%2), _itemList lbText _i, _itemList lbPicture _i],
configNull
];
if (!isNull _config && {!(_config call _filterFunction)}) then {
_itemList lbDelete _i;
// in case the filter function returns nil. Otherwise could lock up the game.
_i = _i - 1;
};
_i = _i + 1;
};
};

View File

@ -0,0 +1,77 @@
/*
* Author: commy2
* Executed every time an inventory display is opened.
*
* Arguments:
* 0: Inventory display <DISPLAY>
*
* Return Value:
* None
*
* Public: No
*/
#include "script_component.hpp"
disableSerialization;
params ["_display"];
private _filter = _display displayCtrl IDC_FILTERLISTS;
// engine defined behaviour is the following:
// lb value, data and text don't matter, only the index.
// the first three indecies are hard coded: 0 - weapons , 1 - magazines, 2 - items
// all of them show backpacks, because BI
// all other indecies show everything, so all we have to do is delete stuff we dont like
_filter ctrlAddEventHandler ["LBSelChanged", {_this call FUNC(onLBSelChanged)}];
// have to add these a frame later, because this event happens before the engine adds the default filters
[{
disableSerialization;
params ["_filter"];
// remove "All", so we can push it to the back later.
// to keep localization we can keep the lbText (displayed name).
private _index = lbSize _filter - 1;
private _nameAll = _filter lbText _index;
_filter lbDelete _index;
// add additional filter functions to the default filters. These remove backpacks etc.
_filter lbSetData [0, QFUNC(filterWeapons)];
_filter lbSetData [1, QFUNC(filterMagazines)];
_filter lbSetData [2, QFUNC(filterItems)];
// add our custom filters
{
_x params ["_name", "_fncName"];
_index = _filter lbAdd _name;
_filter lbSetData [_index, _fncName];
false
} count GVAR(customFilters);
// readd "All" filter to last position and select it
_index = _filter lbAdd _nameAll;
_filter lbSetCurSel _index;
}, [_filter]] call EFUNC(common,execNextFrame);
// monitor changes that can happen and force our update
private _dummyControl = _display ctrlCreate ["RscMapControl", -1];
_dummyControl ctrlSetPosition [0,0,0,0];
_dummyControl ctrlCommit 0;
_dummyControl ctrlAddEventHandler ["Draw", {
disableSerialization;
params ["_dummyControl"];
private _display = ctrlParent _dummyControl;
private _itemList = _display call FUNC(currentItemListBox);
// monitoring is done by setting a lb value. These are unused here and are reset every time the list box updates.
if (_itemList lbValue 0 != DUMMY_VALUE) then {
_display call FUNC(forceItemListUpdate);
_itemList lbSetValue [0, DUMMY_VALUE];
};
}];

View File

@ -0,0 +1,27 @@
/*
* Author: commy2
* Executed when the filter list box is changed.
* Sets new filter list index.
*
* Arguments:
* 0: Filter list box <CONTROL>
* 1: Filter list index <NUMBER>
*
* Return Value:
* None
*
* Public: No
*/
#include "script_component.hpp"
disableSerialization;
params ["_filter", "_index"];
GVAR(selectedFilterIndex) = _index;
[{
disableSerialization;
params ["_display"];
[_display] call FUNC(forceItemListUpdate);
}, [ctrlParent _filter]] call EFUNC(common,execNextFrame);

View File

@ -0,0 +1 @@
#include "\z\ace\addons\inventory\script_component.hpp"

View File

@ -2,11 +2,20 @@
#include "\z\ace\addons\main\script_mod.hpp"
#ifdef DEBUG_ENABLED_INVENTORY
#define DEBUG_MODE_FULL
#define DEBUG_MODE_FULL
#endif
#ifdef DEBUG_SETTINGS_INVENTORY
#define DEBUG_SETTINGS DEBUG_SETTINGS_INVENTORY
#define DEBUG_SETTINGS DEBUG_SETTINGS_INVENTORY
#endif
#include "\z\ace\addons\main\script_macros.hpp"
#define IDC_FILTERLISTS 6554
#define IDC_ITEMLIST_GROUND 632
#define IDC_ITEMLIST_SOLDIER 640
#define IDC_ITEMLIST_UNIFORM 633
#define IDC_ITEMLIST_VEST 638
#define IDC_ITEMLIST_BACKPACK 619
#define DUMMY_VALUE 127

View File

@ -25,5 +25,33 @@
<Italian>Normalmente il menù inventario è scalato in base alle dimensioni interfaccia. Questa opzione di permette di ingrandirlo ulteriormente ma senza aumentare la dimensione del testo.</Italian>
<Portuguese>Normalmente o tamanho da tela do inventário é ditada pelo tamanho da UI. Isso permite aumentar o tamanho da tela de inventário, mas não aumenta o tamanho da fonte, permitindo que mais linhas sejam visualizadas.</Portuguese>
</Key>
<Key ID="STR_ACE_Inventory_Backpacks">
<English>Backpacks</English>
<German>Rucksäcke</German>
</Key>
<Key ID="STR_ACE_Inventory_Headgear">
<English>Headgear</English>
<German>Kopfbedeckungen</German>
</Key>
<Key ID="STR_ACE_Inventory_Glasses">
<English>Glasses</English>
<German>Brillen</German>
</Key>
<Key ID="STR_ACE_Inventory_Uniforms">
<English>Uniforms</English>
<German>Uniformen</German>
</Key>
<Key ID="STR_ACE_Inventory_Vests">
<English>Vests</English>
<German>Westen</German>
</Key>
<Key ID="STR_ACE_Inventory_Grenades">
<English>Grenades</English>
<German>Granaten</German>
</Key>
<Key ID="STR_ACE_Inventory_Medical">
<English>Medical</English>
<German>Sanimaterial</German>
</Key>
</Package>
</Project>

View File

@ -1,3 +1,2 @@
#include "script_component.hpp"
NO_DEDICATED;

View File

@ -81,7 +81,7 @@ _camPos = AGLToASL _camPos;
if (terrainIntersectASL [_camPos, _pL2]) exitWith {};
if (lineIntersects [_camPos, _pL2]) exitWith {};
private _size = 2 * (_range - (positionCameraToWorld [0,0,0] vectorDistance _pL)) / _range;
private _size = 2 * sqrt (1 / _distance) * (call EFUNC(common,getZoom));
drawIcon3D [
format ["\a3\weapons_f\acc\data\collimdot_%1_ca.paa", ["red", "green"] select _isGreen],

View File

@ -38,25 +38,48 @@
#define MACRO_ADDWEAPON(WEAPON,COUNT) class _xx_##WEAPON { \
weapon = #WEAPON; \
count = COUNT; \
weapon = #WEAPON; \
count = COUNT; \
}
#define MACRO_ADDITEM(ITEM,COUNT) class _xx_##ITEM { \
name = #ITEM; \
count = COUNT; \
name = #ITEM; \
count = COUNT; \
}
#define MACRO_ADDMAGAZINE(MAGAZINE,COUNT) class _xx_##MAGAZINE { \
magazine = #MAGAZINE; \
count = COUNT; \
magazine = #MAGAZINE; \
count = COUNT; \
}
#define MACRO_ADDBACKPACK(BACKPACK,COUNT) class _xx_##BACKPACK { \
backpack = #BACKPACK; \
count = COUNT; \
backpack = #BACKPACK; \
count = COUNT; \
}
// item types
#define TYPE_DEFAULT 0
#define TYPE_MUZZLE 101
#define TYPE_OPTICS 201
#define TYPE_FLASHLIGHT 301
#define TYPE_BIPOD 302
#define TYPE_FIRST_AID_KIT 401
#define TYPE_FINS 501 // not implemented
#define TYPE_BREATHING_BOMB 601 // not implemented
#define TYPE_NVG 602
#define TYPE_GOGGLE 603
#define TYPE_SCUBA 604 // not implemented
#define TYPE_HEADGEAR 605
#define TYPE_FACTOR 607
#define TYPE_RADIO 611
#define TYPE_HMD 616
#define TYPE_BINOCULAR 617
#define TYPE_MEDIKIT 619
#define TYPE_TOOLKIT 620
#define TYPE_UAV_TERMINAL 621
#define TYPE_VEST 701
#define TYPE_UNIFORM 801
#define TYPE_BACKPACK 901
#ifdef DISABLE_COMPILE_CACHE
#define PREP(fncName) DFUNC(fncName) = compile preprocessFileLineNumbers QUOTE(PATHTOF(functions\DOUBLES(fnc,fncName).sqf))
@ -83,6 +106,8 @@
#define ACE_isHC (!hasInterface && !isDedicated)
#define IDC_STAMINA_BAR 193
//By default CBA's TRACE/LOG/WARNING spawn a buffer, which can cause messages to be logged out of order:
#ifdef CBA_DEBUG_SYNCHRONOUS
#define CBA_fnc_log { params ["_file","_lineNum","_message"]; diag_log [diag_frameNo, diag_tickTime, time, _file + ":"+str(_lineNum + 1), _message]; }

View File

@ -5,7 +5,7 @@
#define MAJOR 3
#define MINOR 4
#define PATCHLVL 1
#define PATCHLVL 2
#define BUILD 0
#define VERSION MAJOR.MINOR.PATCHLVL.BUILD

View File

@ -73,7 +73,7 @@ _vehicle = vehicle _unit;
// Do not obscure the map if the player is on a enclosed vehicle (assume internal illumination)
if (_vehicle != _unit) then {
// Player is in a vehicle
if (isTurnedOut _unit && { _vehicle isKindOf "Tank" || { ( _vehicle isKindOf "Helicopter" || _vehicle isKindOf "Plane" ) && { (driver _vehicle) == _unit || { (gunner _vehicle) == _unit } } } || {_vehicle isKindOf "Wheeled_APC"}}) then {
if (!isTurnedOut _unit && { _vehicle isKindOf "Tank" || { ( _vehicle isKindOf "Helicopter" || _vehicle isKindOf "Plane" ) && { (driver _vehicle) == _unit || { (gunner _vehicle) == _unit } } } || {_vehicle isKindOf "Wheeled_APC"}}) then {
_isEnclosed = true;
};
};

View File

@ -14,9 +14,9 @@
</Key>
<Key ID="STR_ACE_Map_MapIllumination_DisplayName">
<English>Map illumination?</English>
<German>Kartenbeleuchtung</German>
<Polish>Oświetlenie mapy</Polish>
<Spanish>¿Iluminación de mapa?</Spanish>
<German>Kartenausleuchtung</German>
<Czech>Osvětlení mapy</Czech>
<Portuguese>Iluminação do mapa?</Portuguese>
<French>Luminosité</French>
@ -25,6 +25,7 @@
</Key>
<Key ID="STR_ACE_Map_MapIllumination_Description">
<English>Simulate map lighting based on ambient lighting and player's items?</English>
<German>Simuliere Kartenbeleuchtung auf Basis des Umgebungslichts sowie der mitgeführten Gegenstände?</German>
<Polish>Symuluj oświetlenie mapy bazujące na oświetleniu otoczenia oraz przedmiotach gracza?</Polish>
<French>Calcul la luminosité de la carte en fonction des conditions de lumière</French>
<Russian>Симулировать освещение карты на основе окружающего света и приборов игрока?</Russian>
@ -33,6 +34,7 @@
</Key>
<Key ID="STR_ACE_Map_MapGlow_DisplayName">
<English>Map flashlight glow?</English>
<German>Kartenbeleuchtung durch Dritte erkennbar</German>
<Polish>Poświata latarki</Polish>
<Russian>Свет фонаря на карте?</Russian>
<Portuguese>Brilho de lanterna no mapa?</Portuguese>
@ -40,6 +42,7 @@
</Key>
<Key ID="STR_ACE_Map_MapGlow_Description">
<English>Add external glow to players who use flashlight on map?</English>
<German>Kartenbeleuchtung mittels Taschenlampe durch Dritte erkennbar?</German>
<Polish>Pokaż poświatę światła latarki na graczu, który używa latarki na widoku mapy?</Polish>
<Russian>Добавить свет при использовании фонаря на карте?</Russian>
<Portuguese>Adicionar brilho externo para jogadores que usam lanterna no mapa?</Portuguese>
@ -71,7 +74,7 @@
<English>Limit map zoom?</English>
<Polish>Ograniczony zoom</Polish>
<Spanish>¿Limitar el zoom de mapa?</Spanish>
<German>Kartenzoom einschränken</German>
<German>Kartenvergrößerung einschränken</German>
<Czech>Omezit přiblížení mapy?</Czech>
<Portuguese>Limitar zoom do mapa?</Portuguese>
<French>Limiter le zoom de la carte?</French>
@ -82,7 +85,7 @@
<English>Limit the amount of zoom available for the map?</English>
<Polish>Ogranicza maksymalny stopień przybliżenia mapy</Polish>
<Spanish>Limita la cantidad de zoom disponible para el mapa</Spanish>
<German>Zoomstufe der Karte einschränken?</German>
<German>Schränkt die maximale Kartenvergrößerung ein.</German>
<Czech>Omezit stupeň přiblížení pro mapu?</Czech>
<Portuguese>Limitar a quantidade de zoom disponível para o mapa?</Portuguese>
<French>Limite le zoom maximum pour la carte?</French>
@ -93,7 +96,7 @@
<English>Show cursor coordinates?</English>
<Polish>Koordynaty pod kursorem</Polish>
<Spanish>¿Mostrar coordenadas de cursor?</Spanish>
<German>Zeige Cursor-Koordinaten?</German>
<German>Zeige Mauszeiger-Koordinaten?</German>
<Czech>Zobrazit souřadnice u kurzoru?</Czech>
<Portuguese>Mostrar coordenadas no cursor?</Portuguese>
<French>Afficher les coordonnées sur le curseur?</French>
@ -135,6 +138,7 @@
</Key>
<Key ID="STR_ACE_Map_BFT_Enabled_DisplayName">
<English>BFT Enable</English>
<German>BFT aktivieren</German>
<Portuguese>RFA ativo</Portuguese>
<Polish>Aktywuj BFT</Polish>
<Czech>Povolit BFT</Czech>
@ -145,6 +149,7 @@
</Key>
<Key ID="STR_ACE_Map_BFT_Enabled_Description">
<English>Enable Blue Force Tracking. Default: No</English>
<German>Aktiviert Blue Force Tracking. Standard: Nein</German>
<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>
@ -210,6 +215,7 @@
</Key>
<Key ID="STR_ACE_Map_Action_Flashlights">
<English>Flashlights</English>
<German>Taschenlampen</German>
<Polish>Latarki</Polish>
<Portuguese>Lanternas</Portuguese>
<Russian>Фонари</Russian>
@ -218,6 +224,7 @@
</Key>
<Key ID="STR_ACE_Map_Action_NVG">
<English>NVG</English>
<German>NSG</German>
<Polish>Noktowizja</Polish>
<Portuguese>Óculos de Visão Noturna</Portuguese>
<Russian>ПНВ</Russian>
@ -226,6 +233,7 @@
</Key>
<Key ID="STR_ACE_Map_Action_NVGOn">
<English>On</English>
<German>Ein</German>
<Polish>Włącz</Polish>
<Portuguese>Ligado</Portuguese>
<Russian>Вкл.</Russian>
@ -234,6 +242,7 @@
</Key>
<Key ID="STR_ACE_Map_Action_NVGOff">
<English>Off</English>
<German>Aus</German>
<Polish>Wyłącz</Polish>
<Portuguese>Desligado</Portuguese>
<Russian>Выкл.</Russian>
@ -242,6 +251,7 @@
</Key>
<Key ID="STR_ACE_Map_Action_NVGUp">
<English>Increase Brightness</English>
<German>Erhöhe Helligkeit</German>
<Polish>Zwiększ czułość</Polish>
<Portuguese>Aumentar brilho</Portuguese>
<Russian>Увеличить яркость</Russian>
@ -250,6 +260,7 @@
</Key>
<Key ID="STR_ACE_Map_Action_NVGDown">
<English>Decrease Brightness</English>
<German>Veringere Helligkeit</German>
<Polish>Zmniejsz czułość</Polish>
<Portuguese>Diminuir brilho</Portuguese>
<Russian>Уменьшить яркость</Russian>
@ -282,15 +293,17 @@
</Key>
<Key ID="STR_ACE_Map_DefaultChannel_DisplayName">
<English>Set Channel At Start</English>
<German>Setzt Kanal am Spielstart</German>
<Polish>Ust. domyślny kanał</Polish>
<Portuguese>Definir canal no início</Portuguese>
<Russian>Установить канал на старте</Russian>
</Key>
<Key ID="STR_ACE_Map_DefaultChannel_Description">
<English>Change the starting marker channel at mission start</English>
<German>Setzt den Chat/Markierungskanal am Missionsstart</German>
<Polish>Ustaw domyślny kanał dla markerów przy starcie misji</Polish>
<Portuguese>Muda o canal do marcador no início da missão</Portuguese>
<Russian>Изменить начальный канал для установки маркеров при запуске миссии</Russian>
</Key>
</Package>
</Project>
</Project>

View File

@ -44,7 +44,7 @@ if (_dir != 1) then {
deleteMarkerLocal (GVAR(drawing_tempLineMarker) select 0);
["drawing_addLineMarker", GVAR(drawing_tempLineMarker)] call EFUNC(common,globalEvent);
// Log who drew on the briefing screen
(text format ["[ACE] Server: Player %1 drew on the briefing screen", profileName]) call EFUNC(common,serverLog);
[ACE_INFOFORMAT_1("Player %1 drew on the briefing screen", profileName)] call EFUNC(common,serverLog);
} else {
GVAR(drawing_tempLineMarker) call FUNC(updateLineMarker);
GVAR(drawing_lineMarkers) pushBack (+GVAR(drawing_tempLineMarker));

View File

@ -1,3 +1,4 @@
class Extended_PreInit_EventHandlers {
class ADDON {
init = QUOTE(call COMPILE_FILE(XEH_preInit));

View File

@ -1,3 +1,4 @@
class RscPicture;
class RscText;
class RscStructuredText;
@ -12,21 +13,9 @@ class RscXSliderH;
class RscDisplayInsertMarker {
onLoad = QUOTE(_this call DFUNC(initInsertMarker););
onUnload = QUOTE(_this call DFUNC(placeMarker););
// idd = 54;
movingEnable = 1;
class controlsBackground {
// class RscText_1000: RscText {idc = 1000;};
};
class controls {
// class ButtonMenuOK: RscButtonMenuOK {idc = 1;};
// class ButtonMenuCancel: RscButtonMenuCancel {idc = 2;};
// class Title: RscText {idc = 1001;};
// class Description: RscStructuredText {idc = 1100;};
// class DescriptionChannel: RscStructuredText {idc = 1101;};
// class MarkerPicture: RscPicture {idc = 102;};
// class MarkerText: RscEdit {idc = 101;};
// class MarkerChannel: RscCombo {idc = 103;};
class controls {
class MarkerShape: RscCombo {
idc = 1210;
};
@ -39,22 +28,5 @@ class RscDisplayInsertMarker {
class MarkerAngleText: RscText {
idc = 1221;
};
/*class SizeX: RscEdit {
idc = 1200;
text = "10";
x = "14 * ( ((safezoneW / safezoneH) min 1.2) / 40) + (safezoneX)";
y = "12.5 * ( ( ((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY + safezoneH - ( ((safezoneW / safezoneH) min 1.2) / 1.2))";
w = "5 * ( ((safezoneW / safezoneH) min 1.2) / 40)";
h = "1 * ( ( ((safezoneW / safezoneH) min 1.2) / 1.2) / 25)";
};
class SizeY: RscEdit {
idc = 1201;
text = "10";
x = "19 * ( ((safezoneW / safezoneH) min 1.2) / 40) + (safezoneX)";
y = "12.5 * ( ( ((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY + safezoneH - ( ((safezoneW / safezoneH) min 1.2) / 1.2))";
w = "5 * ( ((safezoneW / safezoneH) min 1.2) / 40)";
h = "1 * ( ( ((safezoneW / safezoneH) min 1.2) / 1.2) / 25)";
};*/
};
};

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