diff --git a/AUTHORS.txt b/AUTHORS.txt index 8c22096033..f4ebd317eb 100644 --- a/AUTHORS.txt +++ b/AUTHORS.txt @@ -44,6 +44,7 @@ BlackPixxel BlackQwar Brakoviejo Brisse +Brostrom.A | Evul BullHorn Clon1998 Codingboy diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 6b7f1006fa..ed17a41e67 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -14,7 +14,7 @@ Indicate if the issue appears on stable or development version. In case it is th ## Reporting the issue -Head over to the ACE3 GitHub issue tracker and press the "New issue" button in the top right corner. Add a descriptive title and copy the following issue template in to the text area: +Head over to the [ACE3 GitHub issue tracker](https://github.com/acemod/ACE3/issues) and press the [New issue](https://github.com/acemod/ACE3/issues/new) button in the top right corner. Add a descriptive title and copy the following issue template in to the text area: ``` ACE3 Version: 3.x.x @@ -43,8 +43,8 @@ ACE3 Version: 3.x.x A video of the issue might be helpful in resolving it faster. +GitHub uses [Markdown](http://daringfireball.net/projects/markdown/syntax) to style the output. If you want to know more about it (e.g. how to [turn text bold](https://help.github.com/articles/markdown-basics/#styling-text), how to denote [code blocks](https://help.github.com/articles/markdown-basics/#inline-formats) or [inline code](https://help.github.com/articles/markdown-basics/#multiple-lines)) have a look at the [GitHub Markdown Documentation](https://help.github.com/articles/github-flavored-markdown). -Github uses "Markdown" to style the output. If you want to know more about it (e.g. how to turn text bold, how to denote code blocks or inline code) have a look at the GitHub markdown documentation. # Feature Requests @@ -54,11 +54,11 @@ ACE2, AGM and CSE had a lot of features implemented or planned. All of them are Please refrain from making requests for any planned or existing features from either ACE2, AGM or CSE. Most of them are already being or have been considered for porting or a rewrite. ## Requesting a feature -In order to avoid duplicates and keep the issue tracker organized, we have created a common issue for ACE 3 Feature requests. Any and all relevant requests should be submitted there, where they will also get discussed and evaluated. Before adding a new one, make sure to check the previous entries from the thread and do a quick search for similar suggestions; please don't reiterate requests for features that had already been accepted for inclusion, or those which were disregarded earlier. +In order to avoid duplicates and keep the issue tracker organized, we have created a common issue for [ACE3 Feature requests](https://github.com/acemod/ACE3/issues/414). Any and all relevant requests should be submitted there, where they will also get discussed and evaluated. Before adding a new one, make sure to check the previous entries from the thread and do a quick search for similar suggestions; please don't reiterate requests for features that had already been accepted for inclusion, or those which were disregarded earlier. Following their approval, feature requests may be moved by moderators to a separate issue for further discussion. # Regarding Pull Requests (PRs) -- You want to help but don't know where to start ? Check the wiki entry for [setting up the development environment](http://ace3mod.com/wiki/development/setting-up-the-development-environment.html) +- You want to help but don't know where to start? Check the wiki entry for [setting up the development environment](http://ace3mod.com/wiki/development/setting-up-the-development-environment.html) - [Make sure to respect the file structure](http://ace3mod.com/wiki/development/modularity-and-pbo-structure.html) - [Make sure to respect the coding guidelines](http://ace3mod.com/wiki/development/coding-guidelines.html) diff --git a/README.md b/README.md index ecbc0dd01d..a407f5a299 100644 --- a/README.md +++ b/README.md @@ -1,30 +1,35 @@

+

- ACE3 Version + ACE3 Version - ACE3 Download + ACE3 Download - ACE3 Issues + ACE3 Issues - BIF Thread + BIF Thread - ACE3 License + ACE3 License - ACE3 Slack + ACE3 Slack - ACE3 Build Status + ACE3 Build Status

-

Requires the latest version of CBA A3. Visit us on Facebook | YouTube | Twitter | Reddit

+ +

+ Requires the latest version of CBA A3.
+ Visit us on Twitter | Facebook | YouTube | Reddit
+

**ACE3** is a joint effort by the teams behind **ACE2**, **AGM** and **CSE** to improve the realism and authenticity of Arma 3. @@ -43,6 +48,7 @@ The mod is **built modularly**, so almost any included PBO can be easily removed - Captivity system - Explosives system, including different trigger types - Map screen improvements – marker placement and map tools +- Logistics - Advanced missile guidance and laser designation #### Additional features diff --git a/addons/advanced_ballistics/functions/fnc_calculateAmmoTemperatureVelocityShift.sqf b/addons/advanced_ballistics/functions/fnc_calculateAmmoTemperatureVelocityShift.sqf index 8b0c78e86c..fefdbb16e4 100644 --- a/addons/advanced_ballistics/functions/fnc_calculateAmmoTemperatureVelocityShift.sqf +++ b/addons/advanced_ballistics/functions/fnc_calculateAmmoTemperatureVelocityShift.sqf @@ -18,7 +18,8 @@ private ["_muzzleVelocityShiftTableUpperLimit", "_temperatureIndexFunction", "_temperatureIndexA", "_temperatureIndexB", "_interpolationRatio"]; params["_muzzleVelocityShiftTable", "_temperature"]; -// Check if muzzleVelocityShiftTable is Larger Than 11 Entrys +// Check if muzzleVelocityShiftTable is Less Than 11 Entrys +if ((count _muzzleVelocityShiftTable) < 11) exitWith {0}; _muzzleVelocityShiftTableUpperLimit = _muzzleVelocityShiftTable select 10; if (isNil "_muzzleVelocityShiftTableUpperLimit") exitWith { 0 }; diff --git a/addons/advanced_ballistics/functions/fnc_handleFired.sqf b/addons/advanced_ballistics/functions/fnc_handleFired.sqf index d97c9b952a..8d9cb73509 100644 --- a/addons/advanced_ballistics/functions/fnc_handleFired.sqf +++ b/addons/advanced_ballistics/functions/fnc_handleFired.sqf @@ -24,12 +24,12 @@ if (!hasInterface) exitWith {}; if (!GVAR(enabled)) exitWith {}; // Parameterization -private ["_abort", "_AmmoCacheEntry", "_WeaponCacheEntry", "_opticsName", "_opticType", "_bulletTraceVisible", "_temperature", "_barometricPressure", "_bulletMass", "_bulletLength", "_muzzleVelocity", "_muzzleVelocityShift", "_bulletVelocity", "_bulletSpeed", "_bulletLength", "_barrelTwist", "_stabilityFactor"]; +private ["_abort", "_AmmoCacheEntry", "_WeaponCacheEntry", "_opticsName", "_opticType", "_bulletTraceVisible", "_temperature", "_barometricPressure", "_bulletMass", "_bulletLength", "_muzzleVelocity", "_muzzleVelocityShift", "_bulletVelocity", "_bulletLength", "_barrelTwist", "_stabilityFactor", "_aceTimeSecond", "_barrelVelocityShift", "_ammoTemperatureVelocityShift"]; + params ["_unit", "_weapon", "", "_mode", "_ammo", "_magazine", "_bullet"]; _abort = false; - if (!(_ammo isKindOf "BulletBase")) exitWith {}; if (!alive _bullet) exitWith {}; if (!([_unit] call EFUNC(common,isPlayer))) exitWith {}; @@ -75,22 +75,22 @@ _WeaponCacheEntry params ["_barrelTwist", "_twistDirection", "_barrelLength"]; _bulletVelocity = velocity _bullet; _muzzleVelocity = vectorMagnitude _bulletVelocity; +_barrelVelocityShift = 0; if (GVAR(barrelLengthInfluenceEnabled)) then { - _barrelVelocityShift = uiNamespace getVariable [format [QGVAR(%1_muzzleVelocityShift),_weapon],nil]; - if (isNil "_barrelVelocityShift") then { - _barrelVelocityShift = [_barrelLength, _muzzleVelocityTable, _barrelLengthTable, _muzzleVelocity] call FUNC(calculateBarrelLengthVelocityShift); - uiNamespace setVariable [format [QGVAR(%1_muzzleVelocityShift),_weapon],_muzzleVelocityShift]; - }; + _barrelVelocityShift = [_barrelLength, _muzzleVelocityTable, _barrelLengthTable, _muzzleVelocity] call FUNC(calculateBarrelLengthVelocityShift); }; +_ammoTemperatureVelocityShift = 0; if (GVAR(ammoTemperatureEnabled)) then { _temperature = ((getPosASL _unit) select 2) call EFUNC(weather,calculateTemperatureAtHeight); - _temperatureVelocityShift = ([_ammoTempMuzzleVelocityShifts, _temperature] call FUNC(calculateAmmoTemperatureVelocityShift)); + _ammoTemperatureVelocityShift = ([_ammoTempMuzzleVelocityShifts, _temperature] call FUNC(calculateAmmoTemperatureVelocityShift)); }; if (GVAR(ammoTemperatureEnabled) || GVAR(barrelLengthInfluenceEnabled)) then { + _muzzleVelocityShift = _barrelVelocityShift + _ammoTemperatureVelocityShift; + TRACE_4("shift",_muzzleVelocity,_muzzleVelocityShift, _barrelVelocityShift, _ammoTemperatureVelocityShift); if (_muzzleVelocityShift != 0) then { - _muzzleVelocity = _muzzleVelocity + (_barrelVelocityShift + _ammoTemperatureVelocityShift); + _muzzleVelocity = _muzzleVelocity + _muzzleVelocityShift; _bulletVelocity = _bulletVelocity vectorAdd ((vectorNormalized _bulletVelocity) vectorMultiply (_muzzleVelocityShift)); _bullet setVelocity _bulletVelocity; }; diff --git a/addons/advanced_ballistics/functions/fnc_readWeaponDataFromConfig.sqf b/addons/advanced_ballistics/functions/fnc_readWeaponDataFromConfig.sqf index 8e13dc04dc..ec6f3a6212 100644 --- a/addons/advanced_ballistics/functions/fnc_readWeaponDataFromConfig.sqf +++ b/addons/advanced_ballistics/functions/fnc_readWeaponDataFromConfig.sqf @@ -20,9 +20,11 @@ _weaponConfig = (configFile >> "CfgWeapons" >> _this); _barrelTwist = getNumber(_weaponConfig >> "ACE_barrelTwist"); _twistDirection = 1; -_twistDirection = getNumber(_weaponConfig >> "ACE_twistDirection"); -if !(_twistDirection in [-1, 0, 1]) then { - _twistDirection = 1; +if (isNumber (_weaponConfig >> "ACE_twistDirection")) then { + _twistDirection = getNumber (_weaponConfig >> "ACE_twistDirection"); + if !(_twistDirection in [-1, 0, 1]) then { + _twistDirection = 1; + }; }; _barrelLength = getNumber(_weaponConfig >> "ACE_barrelLength"); diff --git a/addons/captives/CfgVehicles.hpp b/addons/captives/CfgVehicles.hpp index afda86cfda..0cfda46128 100644 --- a/addons/captives/CfgVehicles.hpp +++ b/addons/captives/CfgVehicles.hpp @@ -153,16 +153,32 @@ class CfgVehicles { class GVAR(ModuleSurrender): Module_F { author = ECSTRING(common,ACETeam); category = "ACE"; - displayName = CSTRING(ModuleSurrender_DisplayName); //Make Unit Surrender + displayName = CSTRING(ModuleSurrender_DisplayName); function = QFUNC(moduleSurrender); scope = 2; //show in editor - isGlobal = 1; //run global + isGlobal = 0; //run on server isTriggerActivated = 1; //Wait for triggers icon = QUOTE(PATHTOF(UI\Icon_Module_Make_Unit_Surrender_ca.paa)); functionPriority = 0; class Arguments {}; class ModuleDescription: ModuleDescription { - description = CSTRING(ModuleSurrender_Description); //Sync a unit to make them surrender.
Source: ace_captives + description = CSTRING(ModuleSurrender_Description); + sync[] = {"AnyAI"}; + }; + }; + class GVAR(ModuleHandcuffed): Module_F { + author = ECSTRING(common,ACETeam); + category = "ACE"; + displayName = CSTRING(ModuleHandcuffed_DisplayName); + function = QFUNC(moduleHandcuffed); + scope = 2; //show in editor + isGlobal = 0; //run on server + isTriggerActivated = 1; //Wait for triggers + icon = QUOTE(PATHTOF(UI\Icon_Module_Make_Unit_Handcuffed_ca.paa)); + functionPriority = 0; + class Arguments {}; + class ModuleDescription: ModuleDescription { + description = CSTRING(ModuleHandcuffed_Description); sync[] = {"AnyAI"}; }; }; @@ -176,6 +192,7 @@ class CfgVehicles { scope = 2; icon = QUOTE(PATHTOF(UI\Icon_Module_settings_ca.paa)); isGlobal = 1; + isSingular = 1; class Arguments { class allowHandcuffOwnSide { displayName = CSTRING(ModuleSettings_handcuffSide_name); diff --git a/addons/captives/UI/Icon_Module_Make_Unit_Handcuffed_ca.paa b/addons/captives/UI/Icon_Module_Make_Unit_Handcuffed_ca.paa new file mode 100644 index 0000000000..85c556cb2a Binary files /dev/null and b/addons/captives/UI/Icon_Module_Make_Unit_Handcuffed_ca.paa differ diff --git a/addons/captives/XEH_preInit.sqf b/addons/captives/XEH_preInit.sqf index b59249b937..dcc585ef8e 100644 --- a/addons/captives/XEH_preInit.sqf +++ b/addons/captives/XEH_preInit.sqf @@ -24,6 +24,7 @@ PREP(handlePlayerChanged); PREP(handleRespawn); PREP(handleUnitInitPost); PREP(handleZeusDisplayChanged); +PREP(moduleHandcuffed); PREP(moduleSettings); PREP(moduleSurrender); PREP(setHandcuffed); diff --git a/addons/captives/config.cpp b/addons/captives/config.cpp index cdaf6dc4e4..a9ec2950ee 100644 --- a/addons/captives/config.cpp +++ b/addons/captives/config.cpp @@ -2,7 +2,7 @@ class CfgPatches { class ADDON { - units[] = {QGVAR(ModuleSettings), QGVAR(ModuleSurrender)}; + units[] = {QGVAR(ModuleSettings), QGVAR(ModuleSurrender), QGVAR(ModuleHandcuffed)}; weapons[] = {"ACE_CableTie"}; requiredVersion = REQUIRED_VERSION; requiredAddons[] = {"ACE_Interaction"}; diff --git a/addons/captives/functions/fnc_canApplyHandcuffs.sqf b/addons/captives/functions/fnc_canApplyHandcuffs.sqf index 368ce3cb7a..f5fa666652 100644 --- a/addons/captives/functions/fnc_canApplyHandcuffs.sqf +++ b/addons/captives/functions/fnc_canApplyHandcuffs.sqf @@ -20,11 +20,12 @@ params ["_unit", "_target"]; //Check sides, Player has cableTie, target is alive and not already handcuffed (GVAR(allowHandcuffOwnSide) || {(side _unit) != (side _target)}) && -("ACE_CableTie" in (items _unit)) && +{"ACE_CableTie" in (items _unit)} && {alive _target} && {!(_target getVariable [QGVAR(isHandcuffed), false])} && { (_target getVariable ["ACE_isUnconscious", false]) || //isUnconscious + {!([_target] call EFUNC(common,isPlayer))} || //is an AI (not a player) {GVAR(requireSurrender) == 0} || //or don't require surrendering {_target getVariable [QGVAR(isSurrendering), false]} || //or is surrendering {(GVAR(requireSurrender) == 2) && {(currentWeapon _target) == ""}} //or "SurrenderOrNoWeapon" and no weapon diff --git a/addons/captives/functions/fnc_moduleHandcuffed.sqf b/addons/captives/functions/fnc_moduleHandcuffed.sqf new file mode 100644 index 0000000000..4c6cc4c6fc --- /dev/null +++ b/addons/captives/functions/fnc_moduleHandcuffed.sqf @@ -0,0 +1,35 @@ +/* + * Author: PabstMirror + * Module Function to make a unit handcuffed (can be called from editor) + * + * Arguments: + * 0: The Module Logic + * 1: synced objects + * 2: Activated + * + * Return Value: + * Nothing + * + * Example: + * Called from module + * + * Public: No + */ +#include "script_component.hpp" + +params ["_logic", "_units", "_activated"]; + +TRACE_3("params",_logic,_units,_activated); + +if (!_activated) exitWith {}; +if (!isServer) exitWith {}; + +//Modules run before postInit can instal the event handler, so we need to wait a little bit +[{ + params ["_units"]; + { + ["SetHandcuffed", [_x], [_x, true]] call EFUNC(common,targetEvent); + } forEach _units; +}, [_units], 0.05] call EFUNC(common,waitAndExecute); + +deleteVehicle _logic; diff --git a/addons/captives/functions/fnc_moduleSurrender.sqf b/addons/captives/functions/fnc_moduleSurrender.sqf index bdb0f7c1b5..f5c091a78a 100644 --- a/addons/captives/functions/fnc_moduleSurrender.sqf +++ b/addons/captives/functions/fnc_moduleSurrender.sqf @@ -1,9 +1,9 @@ /* * Author: PabstMirror - * Module Function to make a unit surrender (can be called from editor, or placed with zeus) + * Module Function to make a unit surrender (can be called from editor) * * Arguments: - * 0: The Module Logic Object + * 0: The Module Logic * 1: synced objects * 2: Activated * @@ -17,20 +17,19 @@ */ #include "script_component.hpp" -private ["_bisMouseOver", "_mouseOverObject"]; - params ["_logic", "_units", "_activated"]; +TRACE_3("params",_logic,_units,_activated); + if (!_activated) exitWith {}; +if (!isServer) exitWith {}; -if (local _logic) then { - //Modules run before postInit can instal the event handler, so we need to wait a little bit - [{ - params ["_units"]; - { - ["SetSurrendered", [_x], [_x, true]] call EFUNC(common,targetEvent); - } forEach _units; - }, [_units], 0.05]call EFUNC(common,waitAndExecute); +//Modules run before postInit can instal the event handler, so we need to wait a little bit +[{ + params ["_units"]; + { + ["SetSurrendered", [_x], [_x, true]] call EFUNC(common,targetEvent); + } forEach _units; +}, [_units], 0.05] call EFUNC(common,waitAndExecute); - deleteVehicle _logic; -}; +deleteVehicle _logic; diff --git a/addons/captives/functions/fnc_setHandcuffed.sqf b/addons/captives/functions/fnc_setHandcuffed.sqf index 00122862eb..a4788db057 100644 --- a/addons/captives/functions/fnc_setHandcuffed.sqf +++ b/addons/captives/functions/fnc_setHandcuffed.sqf @@ -56,8 +56,11 @@ if (_state) then { //Adds an animation changed eh //If we get a change in animation then redo the animation (handles people vaulting to break the animation chain) - private "_animChangedEHID"; - + private _animChangedEHID = _unit getVariable [QGVAR(handcuffAnimEHID), -1]; + if (_animChangedEHID != -1) then { + TRACE_1("removing animChanged EH",_animChangedEHID); + _unit removeEventHandler ["AnimChanged", _animChangedEHID]; + }; _animChangedEHID = _unit addEventHandler ["AnimChanged", { params ["_unit", "_newAnimation"]; TRACE_2("AnimChanged",_unit,_newAnimation); @@ -67,7 +70,6 @@ if (_state) then { [_unit, "ACE_AmovPercMstpScapWnonDnon", 1] call EFUNC(common,doAnimation); }; } else { - _turretPath = []; { _x params ["_xUnit", "", "", "_xTurretPath"]; @@ -90,8 +92,7 @@ if (_state) then { [_unit, QGVAR(Handcuffed), false] call EFUNC(common,setCaptivityStatus); //remove AnimChanged EH - private "_animChangedEHID"; - _animChangedEHID = _unit getVariable [QGVAR(handcuffAnimEHID), -1]; + private _animChangedEHID = _unit getVariable [QGVAR(handcuffAnimEHID), -1]; TRACE_1("removing animChanged EH",_animChangedEHID); _unit removeEventHandler ["AnimChanged", _animChangedEHID]; _unit setVariable [QGVAR(handcuffAnimEHID), -1]; diff --git a/addons/captives/functions/fnc_setSurrendered.sqf b/addons/captives/functions/fnc_setSurrendered.sqf index cdba47a406..5af4454472 100644 --- a/addons/captives/functions/fnc_setSurrendered.sqf +++ b/addons/captives/functions/fnc_setSurrendered.sqf @@ -48,7 +48,11 @@ if (_state) then { if (_unit getVariable [QGVAR(isSurrendering), false] && {(vehicle _unit) == _unit}) then { //Adds an animation changed eh //If we get a change in animation then redo the animation (handles people vaulting to break the animation chain) - private "_animChangedEHID"; + private _animChangedEHID = _unit getVariable [QGVAR(surrenderAnimEHID), -1]; + if (_animChangedEHID != -1) then { + TRACE_1("removing animChanged EH",_animChangedEHID); + _unit removeEventHandler ["AnimChanged", _animChangedEHID]; + }; _animChangedEHID = _unit addEventHandler ["AnimChanged", { params ["_unit", "_newAnimation"]; if ((_newAnimation != "ACE_AmovPercMstpSsurWnonDnon") && {!(_unit getVariable ["ACE_isUnconscious", false])}) then { @@ -64,8 +68,7 @@ if (_state) then { [_unit, QGVAR(Surrendered), false] call EFUNC(common,setCaptivityStatus); //remove AnimChanged EH - private "_animChangedEHID"; - _animChangedEHID = _unit getVariable [QGVAR(surrenderAnimEHID), -1]; + private _animChangedEHID = _unit getVariable [QGVAR(surrenderAnimEHID), -1]; _unit removeEventHandler ["AnimChanged", _animChangedEHID]; _unit setVariable [QGVAR(surrenderAnimEHID), -1]; diff --git a/addons/captives/stringtable.xml b/addons/captives/stringtable.xml index 864fa7c437..8465588fb5 100644 --- a/addons/captives/stringtable.xml +++ b/addons/captives/stringtable.xml @@ -99,7 +99,7 @@ Cable ties that allow you to restrain prisoners. - Kabelbinder ermöglichen es, Gefangene zu fesseln. + Mit Kabelbindern können Gefangene gefesselt werden. Opaska zaciskowa pozwala na skrępowanie dłoni u więźnia. Los precintos permiten maniatar prisioneros Les Serflex permettent de menotter les prisonniers. @@ -166,7 +166,7 @@ Fazer unidade se render Faire capituler l'unité Egység kapitulálása - Сделать юнита пленным + Заставить юнита сдаться Sync a unit to make them surrender.<br />Source: ace_captives @@ -177,7 +177,17 @@ Sincroniza uma unidade para fazer com que ela se renda. <br/>Fonte: ace_captives Synchronise une unité pour la rendre captive. <br/>Source: ace_captives Egység szinkronizálása, hogy kapituláljon.<br />Forrás: ace_captives - Синхронизируйте с юнитами, чтобы сделать их пленными.<br />Источник: ace_captives + Синхронизируйте с юнитами, чтобы заставить их сдаться в плен.<br />Источник: ace_captives + + + Make Unit Handcuffed + Fazer unidade algemada + Связать юнита + + + Sync a unit to make them handcuffed.<br />Source: ace_captives + Sincronizar uma unidade para deixá-la algemada.<br/>Source: ace_captives + Синхронизируйте с юнитами, чтобы сделать их связанными.<br />Источник: ace_captives Captives Settings @@ -206,7 +216,7 @@ Skuwanie sojuszników Se puede esposar el bando propio Může spoutat spolubojovníky - Kann Teamkollegen fesseln + Kann Kameraden fesseln Pode algemar o próprio lado Peut libérer sa propre faction Saját oldal megbilincselhető @@ -217,7 +227,7 @@ Czy gracze mogą skuwać sojuszników? Pueden los jugadores esposar unidades en su propio bando Mohou hráči spoutat jednotky na své straně - Können Spieler eigene Einheiten fesseln + Spieler können eigene Einheiten fesseln. Os jogadores podem algemar unidades do seu lado Les joueurs peuvent utiliser les Serflex sur leur propre camp A játékosok megkötözhetik-e a saját oldalukon lévő egységeket @@ -239,7 +249,7 @@ Gracze mogą skapitulować po schowaniu swojej broni do kabury Los jugadores pueden rendirse después de enfundar su arma Hráč se může vzdát poté, co si skryje zbraň - Spieler können kapitulieren, nachdem sie ihre Waffe geholstert haben + Spieler können kapitulieren, nachdem sie ihre Waffe geholstert haben. Jogadores podem se render depois de guardar sua arma Les joueurs peuvent se rendre après avoir rangé leur arme A játékosok megadhatják magukat a fegyverük elrakása után @@ -247,6 +257,7 @@ Require surrendering + Benötigt Kapitulation Wymagaj kapitulacji Requer rendição Требовать пленения @@ -254,6 +265,7 @@ Require Players to surrender before they can be arrested + Spieler müssen sich erst ergeben, bevor sie gefangen genommen werden können Wymagaj od graczy kapitulacji zanim będzie można ich zaaresztować Requer que jogadores se rendam antes de poderem ser presos Требуется, чтобы игрок сдался в плен прежде, чем его можно будет связать @@ -261,6 +273,7 @@ Surrendering only + Nur Ergeben Tylko kapitulacja Somente rendição Только сдавшийся в плен @@ -268,10 +281,11 @@ Surrendering or No weapon + Ergeben oder keine Waffe Kapitulacja lub brak broni Rendição ou desarmado Сдавшийся или безоружный Rendición o desarme - + \ No newline at end of file diff --git a/addons/cargo/CfgVehicles.hpp b/addons/cargo/CfgVehicles.hpp index 111c4d9956..1204c35496 100644 --- a/addons/cargo/CfgVehicles.hpp +++ b/addons/cargo/CfgVehicles.hpp @@ -8,6 +8,7 @@ class CfgVehicles { function = QFUNC(moduleSettings); functionPriority = 1; isGlobal = 1; + isSingular = 1; isTriggerActivated = 0; author = ECSTRING(common,ACETeam); @@ -171,6 +172,13 @@ class CfgVehicles { GVAR(hasCargo) = 0; }; + // autonomus + class Helicopter_Base_F; + class UAV_01_base_F: Helicopter_Base_F { + GVAR(space) = 0; + GVAR(hasCargo) = 0; + }; + // boats class Ship; class Ship_F: Ship { diff --git a/addons/cargo/XEH_postInit.sqf b/addons/cargo/XEH_postInit.sqf index 6501044c9d..2aeb3ab630 100644 --- a/addons/cargo/XEH_postInit.sqf +++ b/addons/cargo/XEH_postInit.sqf @@ -1,5 +1,45 @@ #include "script_component.hpp" -["LoadCargo", {_this call FUNC(loadItem)}] call EFUNC(common,addEventHandler); -["UnloadCargo", {_this call FUNC(unloadItem)}] call EFUNC(common,addEventHandler); ["AddCargoByClass", {_this call FUNC(addCargoItem)}] call EFUNC(common,addEventHandler); + +["LoadCargo", { + (_this select 0) params ["_item","_vehicle"]; + private ["_loaded", "_hint", "_itemName", "_vehicleName"]; + + _loaded = [_item, _vehicle] call FUNC(loadItem); + + // Show hint as feedback + _hint = [LSTRING(LoadingFailed), LSTRING(LoadedItem)] select _loaded; + _itemName = getText (configFile >> "CfgVehicles" >> typeOf _item >> "displayName"); + _vehicleName = getText (configFile >> "CfgVehicles" >> typeOf _vehicle >> "displayName"); + + ["displayTextStructured", [[_hint, _itemName, _vehicleName], 3.0]] call EFUNC(common,localEvent); + + if (_loaded) then { + // Invoke listenable event + ["cargoLoaded", [_item, _vehicle]] call EFUNC(common,globalEvent); + }; +}] call EFUNC(common,addEventHandler); + +["UnloadCargo", { + (_this select 0) params ["_item","_vehicle"]; + private ["_unloaded", "_itemClass", "_hint", "_itemName", "_vehicleName"]; + + _unloaded = [_item, _vehicle] call FUNC(unloadItem); + + _itemClass = if (typeName _item == "STRING") then {_item} else {typeOf _item}; + + // Show hint as feedback + _hint = [LSTRING(UnloadingFailed), LSTRING(UnloadedItem)] select _unloaded; + _itemName = getText (configFile >> "CfgVehicles" >> _itemClass >> "displayName"); + _vehicleName = getText (configFile >> "CfgVehicles" >> typeOf _vehicle >> "displayName"); + + ["displayTextStructured", [[_hint, _itemName, _vehicleName], 3.0]] call EFUNC(common,localEvent); + + if (_unloaded) then { + // Invoke listenable event + ["cargoUnloaded", [_item, _vehicle]] call EFUNC(common,globalEvent); + }; + + // TOOO maybe drag/carry the unloaded item? +}] call EFUNC(common,addEventHandler); diff --git a/addons/cargo/functions/fnc_addCargoItem.sqf b/addons/cargo/functions/fnc_addCargoItem.sqf index 9f349153c0..a44cd0ebcf 100644 --- a/addons/cargo/functions/fnc_addCargoItem.sqf +++ b/addons/cargo/functions/fnc_addCargoItem.sqf @@ -18,24 +18,12 @@ */ #include "script_component.hpp" -private ["_position", "_item", "_i"]; params ["_itemClass", "_vehicle", ["_amount", 1], ["_showHint", false, [false]] ]; TRACE_3("params",_itemClass,_vehicle,_amount); -_position = getPos _vehicle; -_position set [1, (_position select 1) + 1]; -_position set [2, (_position select 2) + 7.5]; - for "_i" from 1 to _amount do { - _item = createVehicle [_itemClass, _position, [], 0, "CAN_COLLIDE"]; - - // Load item or delete it if no space left - if !([_item, _vehicle, _showHint] call FUNC(loadItem)) exitWith { - TRACE_1("no room to load item - deleting",_item); - deleteVehicle _item; - }; - TRACE_1("Item Loaded",_item); - - // Invoke listenable event - ["cargoAddedByClass", [_itemClass, _vehicle, _amount]] call EFUNC(common,globalEvent); + [_itemClass, _vehicle] call FUNC(loadItem); }; + +// Invoke listenable event +["cargoAddedByClass", [_itemClass, _vehicle, _amount]] call EFUNC(common,globalEvent); diff --git a/addons/cargo/functions/fnc_canLoadItemIn.sqf b/addons/cargo/functions/fnc_canLoadItemIn.sqf index 8cfe9e194b..fda60aaf65 100644 --- a/addons/cargo/functions/fnc_canLoadItemIn.sqf +++ b/addons/cargo/functions/fnc_canLoadItemIn.sqf @@ -3,7 +3,7 @@ * Check if item can be loaded into other Object. * * Arguments: - * 0: Item Object + * 0: Item * 1: Holder Object (Vehicle) * * Return value: @@ -16,14 +16,24 @@ */ #include "script_component.hpp" -params ["_item", "_vehicle"]; +params [["_item", "", [objNull,""]], "_vehicle"]; if (speed _vehicle > 1 || (((getPos _vehicle) select 2) > 3)) exitWith {false}; -private "_itemSize"; -_itemSize = ([_item] call FUNC(getSizeItem)); +private ["_itemSize", "_validItem"]; +_itemSize = [_item] call FUNC(getSizeItem); -(_itemSize > 0) && -{alive _item && alive _vehicle} && -{(_item distance _vehicle <= MAX_LOAD_DISTANCE)} && +if (typeName _item == "STRING") then { + _validItem = + isClass (configFile >> "CfgVehicles" >> _item) && + {getNumber (configFile >> "CfgVehicles" >> _item >> QGVAR(canLoad)) == 1}; +} else { + _validItem = + (alive _item) && + {(_item distance _vehicle) <= MAX_LOAD_DISTANCE}; +}; + +_validItem && +{_itemSize > 0} && +{alive _vehicle} && {_itemSize <= ([_vehicle] call FUNC(getCargoSpaceLeft))} diff --git a/addons/cargo/functions/fnc_canUnloadItem.sqf b/addons/cargo/functions/fnc_canUnloadItem.sqf index 779a7533a9..8c741a5448 100644 --- a/addons/cargo/functions/fnc_canUnloadItem.sqf +++ b/addons/cargo/functions/fnc_canUnloadItem.sqf @@ -16,18 +16,19 @@ */ #include "script_component.hpp" -private ["_loaded", "_validVehiclestate", "_emptyPos"]; - params ["_item", "_vehicle"]; +private ["_loaded", "_itemClass", "_validVehiclestate", "_emptyPos"]; _loaded = _vehicle getVariable [QGVAR(loaded), []]; if !(_item in _loaded) exitWith {false}; +_itemClass = if (typeName _item == "STRING") then {_item} else {typeOf _item}; + _validVehiclestate = true; _emptyPos = []; if (_vehicle isKindOf "Ship" ) then { if !(speed _vehicle <1 && {(((getPosATL _vehicle) select 2) < 2)}) then {_validVehiclestate = false}; - _emptyPos = ((getPosASL _vehicle) call EFUNC(common,ASLtoPosition) findEmptyPosition [0, 15, typeOf _item]); // TODO: if spot is underwater pick another spot. + _emptyPos = ((getPosASL _vehicle) call EFUNC(common,ASLtoPosition) findEmptyPosition [0, 15, _itemClass]); // TODO: if spot is underwater pick another spot. } else { if (_vehicle isKindOf "Air" ) then { if !(speed _vehicle <1 && {isTouchingGround _vehicle}) then {_validVehiclestate = false}; @@ -35,7 +36,7 @@ if (_vehicle isKindOf "Ship" ) then { _emptyPos = [(_emptyPos select 0) + random(5), (_emptyPos select 1) + random(5), _emptyPos select 2 ]; } else { if !(speed _vehicle <1 && {(((getPosATL _vehicle) select 2) < 2)}) then {_validVehiclestate = false}; - _emptyPos = ((getPosASL _vehicle) call EFUNC(common,ASLtoPosition) findEmptyPosition [0, 15, typeOf _item]); + _emptyPos = ((getPosASL _vehicle) call EFUNC(common,ASLtoPosition) findEmptyPosition [0, 15, _itemClass]); }; }; diff --git a/addons/cargo/functions/fnc_getSizeItem.sqf b/addons/cargo/functions/fnc_getSizeItem.sqf index dacd6a4982..807251365c 100644 --- a/addons/cargo/functions/fnc_getSizeItem.sqf +++ b/addons/cargo/functions/fnc_getSizeItem.sqf @@ -3,7 +3,7 @@ * Get the cargo size of an object. * * Arguments: - * 0: Object + * 0: Item * * Return value: * Cargo size (default: -1) @@ -15,14 +15,24 @@ */ #include "script_component.hpp" -private "_config"; - params ["_item"]; +private ["_isVirtual","_itemClass","_config"]; +scopeName "return"; -_config = (configFile >> "CfgVehicles" >> typeOf _item >> QGVAR(size)); +_isVirtual = (typeName _item == "STRING"); +_itemClass = if (_isVirtual) then {_item} else {typeOf _item}; +_config = (configFile >> "CfgVehicles" >> _itemClass >> QGVAR(size)); -if (isNumber (_config)) exitWith { - _item getVariable [QGVAR(size), getNumber (_config)] +if (_isVirtual) then { + if (isNumber _config) then { + (getNumber _config) breakOut "return"; + }; +} else { + _config = (configFile >> "CfgVehicles" >> typeOf _item >> QGVAR(size)); + + if (isNumber _config) then { + (_item getVariable [QGVAR(size), getNumber _config]) breakOut "return"; + }; }; -1 diff --git a/addons/cargo/functions/fnc_handleDestroyed.sqf b/addons/cargo/functions/fnc_handleDestroyed.sqf index c11dd3bfad..1022497719 100644 --- a/addons/cargo/functions/fnc_handleDestroyed.sqf +++ b/addons/cargo/functions/fnc_handleDestroyed.sqf @@ -20,12 +20,13 @@ params ["_vehicle"]; private["_loaded"]; _loaded = _vehicle getVariable [QGVAR(loaded), []]; -if (count _loaded == 0) exitWith {}; +if (_loaded isEqualTo []) exitWith {}; { - // TODO deleteVehicle or just delete vehicle? Do we want to be able to recover destroyed equipment? - deleteVehicle _x; - //_x setDamage 1; + // TODO Do we want to be able to recover destroyed equipment? + if (typeName _x == "OBJECT") then { + deleteVehicle _x; + }; } count _loaded; [_vehicle] call FUNC(validateCargoSpace); diff --git a/addons/cargo/functions/fnc_loadItem.sqf b/addons/cargo/functions/fnc_loadItem.sqf index 11e7638f1b..45746a93fd 100644 --- a/addons/cargo/functions/fnc_loadItem.sqf +++ b/addons/cargo/functions/fnc_loadItem.sqf @@ -1,9 +1,10 @@ /* * Author: Glowbal * Load object into vehicle. + * Objects loaded via classname remain virtual until unloaded. * * Arguments: - * 0: Object + * 0: Item * 1: Vehicle * 2: Show Hint (default: true) * @@ -17,15 +18,10 @@ */ #include "script_component.hpp" +params [["_item","",[objNull,""]], ["_vehicle",objNull,[objNull]]]; private ["_loaded", "_space", "_itemSize"]; -params ["_item", "_vehicle", ["_showHint", true, [true]] ]; -TRACE_2("params",_item,_vehicle); - -if !([_item, _vehicle] call FUNC(canLoadItemIn)) exitWith { - TRACE_2("canLoadItemIn failed",_item,_vehicle); - false -}; +if !([_item, _vehicle] call FUNC(canLoadItemIn)) exitWith {false}; _loaded = _vehicle getVariable [QGVAR(loaded), []]; _loaded pushback _item; @@ -37,21 +33,10 @@ _space = [_vehicle] call FUNC(getCargoSpaceLeft); _itemSize = [_item] call FUNC(getSizeItem); _vehicle setVariable [QGVAR(space), _space - _itemSize, true]; -detach _item; -_item attachTo [_vehicle,[0,0,100]]; -["hideObjectGlobal", [_item, true]] call EFUNC(common,serverEvent); - -// show hint -private ["_itemName", "_vehicleName"]; - -_itemName = getText (configFile >> "CfgVehicles" >> typeOf _item >> "displayName"); -_vehicleName = getText (configFile >> "CfgVehicles" >> typeOf _vehicle >> "displayName"); - -if (_showHint) then { - ["displayTextStructured", [[localize LSTRING(LoadedItem), _itemName, _vehicleName], 3.0]] call EFUNC(common,localEvent); +if (typeName _item == "OBJECT") then { + detach _item; + _item attachTo [_vehicle,[0,0,-100]]; + ["hideObjectGlobal", [_item, true]] call EFUNC(common,serverEvent); }; -// Invoke listenable event -["cargoLoaded", [_item, _vehicle]] call EFUNC(common,globalEvent); - true diff --git a/addons/cargo/functions/fnc_onMenuOpen.sqf b/addons/cargo/functions/fnc_onMenuOpen.sqf index 031bea01cc..85557835bf 100644 --- a/addons/cargo/functions/fnc_onMenuOpen.sqf +++ b/addons/cargo/functions/fnc_onMenuOpen.sqf @@ -22,7 +22,7 @@ params ["_display"]; uiNamespace setVariable [QGVAR(menuDisplay), _display]; [{ - private ["_display","_loaded", "_ctrl", "_label"]; + private ["_display","_loaded", "_ctrl", "_class", "_label"]; disableSerialization; _display = uiNamespace getVariable QGVAR(menuDisplay); if (isnil "_display") exitWith { @@ -40,7 +40,8 @@ uiNamespace setVariable [QGVAR(menuDisplay), _display]; lbClear _ctrl; { - _ctrl lbAdd (getText(configfile >> "CfgVehicles" >> typeOf _x >> "displayName")); + _class = if (typeName _x == "STRING") then {_x} else {typeOf _x}; + _ctrl lbAdd (getText(configfile >> "CfgVehicles" >> _class >> "displayName")); true } count _loaded; diff --git a/addons/cargo/functions/fnc_startLoadIn.sqf b/addons/cargo/functions/fnc_startLoadIn.sqf index b4ba50fbb6..1ce5d62407 100644 --- a/addons/cargo/functions/fnc_startLoadIn.sqf +++ b/addons/cargo/functions/fnc_startLoadIn.sqf @@ -16,16 +16,25 @@ #include "script_component.hpp" params ["_player", "_object"]; +private ["_vehicle", "_size", "_displayName"]; -private ["_nearestVehicle"]; -_nearestVehicle = [_player] call FUNC(findNearestVehicle); +_vehicle = [_player] call FUNC(findNearestVehicle); -if (isNull _nearestVehicle || _nearestVehicle isKindOf "Cargo_Base_F") then { +if (isNull _vehicle || _vehicle isKindOf "Cargo_Base_F") then { { - if ([_object, _x] call FUNC(canLoadItemIn)) exitWith {_nearestVehicle = _x}; + if ([_object, _x] call FUNC(canLoadItemIn)) exitWith {_vehicle = _x}; } foreach (nearestObjects [_player, ["Cargo_base_F", "Land_PaperBox_closed_F"], MAX_LOAD_DISTANCE]); }; -if (isNull _nearestVehicle) exitWith {false}; +if (isNull _vehicle) exitWith {false}; -[_object, _nearestVehicle] call FUNC(loadItem) +// Start progress bar +if ([_object, _vehicle] call FUNC(canLoadItemIn)) then { + _size = [_object] call FUNC(getSizeItem); + + [5 * _size, [_object,_vehicle], "LoadCargo", {}, localize LSTRING(LoadingItem)] call EFUNC(common,progressBar); +} else { + _displayName = getText (configFile >> "CfgVehicles" >> typeOf _object >> "displayName"); + + ["displayTextStructured", [[LSTRING(LoadingFailed), _displayName], 3.0]] call EFUNC(common,localEvent); +}; diff --git a/addons/cargo/functions/fnc_startUnload.sqf b/addons/cargo/functions/fnc_startUnload.sqf index 28ae034167..013de1dc64 100644 --- a/addons/cargo/functions/fnc_startUnload.sqf +++ b/addons/cargo/functions/fnc_startUnload.sqf @@ -20,7 +20,7 @@ private ["_display", "_loaded", "_ctrl", "_selected", "_item"]; disableSerialization; _display = uiNamespace getVariable QGVAR(menuDisplay); -if (isnil "_display") exitWith {}; +if (isNil "_display") exitWith {}; _loaded = GVAR(interactionVehicle) getVariable [QGVAR(loaded), []]; if (count _loaded == 0) exitWith {}; @@ -32,4 +32,17 @@ _selected = (lbCurSel _ctrl) max 0; if (count _loaded <= _selected) exitWith {}; _item = _loaded select _selected; -[_item, GVAR(interactionVehicle)] call FUNC(unloadItem); + +// Start progress bar +private ["_size", "_itemClass", "_displayName"]; + +if ([_item, GVAR(interactionVehicle)] call FUNC(canUnloadItem)) then { + _size = [_item] call FUNC(getSizeItem); + + [5 * _size, [_item, GVAR(interactionVehicle)], "UnloadCargo", {}, localize LSTRING(UnloadingItem)] call EFUNC(common,progressBar); +} else { + _itemClass = if (typeName _item == "STRING") then {_item} else {typeOf _item}; + _displayName = getText (configFile >> "CfgVehicles" >> _itemClass >> "displayName"); + + ["displayTextStructured", [[LSTRING(UnloadingFailed), _displayName], 3.0]] call EFUNC(common,localEvent); +}; diff --git a/addons/cargo/functions/fnc_unloadItem.sqf b/addons/cargo/functions/fnc_unloadItem.sqf index 2630f2104a..81cca7154b 100644 --- a/addons/cargo/functions/fnc_unloadItem.sqf +++ b/addons/cargo/functions/fnc_unloadItem.sqf @@ -3,7 +3,7 @@ * Unload object from vehicle. * * Arguments: - * 0: Object + * 0: Item * 1: Vehicle * * Return value: @@ -16,20 +16,21 @@ */ #include "script_component.hpp" -private ["_loaded", "_space", "_itemSize", "_emptyPos", "_validVehiclestate"]; - params ["_item", "_vehicle"]; +private ["_loaded", "_space", "_itemSize", "_emptyPos", "_validVehiclestate"]; if !([_item, _vehicle] call FUNC(canUnloadItem)) exitWith { false }; +_itemClass = if (typeName _item == "STRING") then {_item} else {typeOf _item}; + _validVehiclestate = true; _emptyPos = []; if (_vehicle isKindOf "Ship" ) then { if !(speed _vehicle <1 && {(((getPosATL _vehicle) select 2) < 2)}) then {_validVehiclestate = false}; TRACE_1("SHIP Ground Check", getPosATL _vehicle ); - _emptyPos = ((getPosASL _vehicle) call EFUNC(common,ASLtoPosition) findEmptyPosition [0, 15, typeOf _item]); // TODO: if spot is underwater pick another spot. + _emptyPos = ((getPosASL _vehicle) call EFUNC(common,ASLtoPosition) findEmptyPosition [0, 15, _itemClass]); // TODO: if spot is underwater pick another spot. } else { if (_vehicle isKindOf "Air" ) then { if !(speed _vehicle <1 && {isTouchingGround _vehicle}) then {_validVehiclestate = false}; @@ -39,38 +40,29 @@ if (_vehicle isKindOf "Ship" ) then { } else { if !(speed _vehicle <1 && {(((getPosATL _vehicle) select 2) < 2)}) then {_validVehiclestate = false}; TRACE_1("Vehicle Ground Check", isTouchingGround _vehicle); - _emptyPos = ((getPosASL _vehicle) call EFUNC(common,ASLtoPosition) findEmptyPosition [0, 13, typeOf _item]); + _emptyPos = ((getPosASL _vehicle) call EFUNC(common,ASLtoPosition) findEmptyPosition [0, 13, _itemClass]); }; }; TRACE_1("getPosASL Vehicle Check", getPosASL _vehicle); if (!_validVehiclestate) exitWith {false}; -if (count _emptyPos == 0) exitWith {false}; //consider displaying text saying there are no safe places to exit the vehicle +if (count _emptyPos == 0) exitWith {false}; _loaded = _vehicle getVariable [QGVAR(loaded), []]; -_loaded = _loaded - [_item]; +_loaded deleteAt (_loaded find _item); _vehicle setVariable [QGVAR(loaded), _loaded, true]; _space = [_vehicle] call FUNC(getCargoSpaceLeft); _itemSize = [_item] call FUNC(getSizeItem); _vehicle setVariable [QGVAR(space), (_space + _itemSize), true]; -detach _item; -_item setPosASL (_emptyPos call EFUNC(common,PositiontoASL)); -["hideObjectGlobal", [_item, false]] call EFUNC(common,serverEvent); - -// show hint -private ["_itemName", "_vehicleName"]; - -_itemName = getText (configFile >> "CfgVehicles" >> typeOf _item >> "displayName"); -_vehicleName = getText (configFile >> "CfgVehicles" >> typeOf _vehicle >> "displayName"); - -["displayTextStructured", [[localize LSTRING(UnloadedItem), _itemName, _vehicleName], 3.0]] call EFUNC(common,localEvent); - -// TOOO maybe drag/carry the unloaded item? - -// Invoke listenable event -["cargoUnloaded", [_item, _vehicle]] call EFUNC(common,globalEvent); +if (typeName _item == "OBJECT") then { + detach _item; + _item setPosASL (_emptyPos call EFUNC(common,PositiontoASL)); + ["hideObjectGlobal", [_item, false]] call EFUNC(common,serverEvent); +} else { + createVehicle [_item, _emptyPos, [], 0, ""]; +}; true diff --git a/addons/cargo/functions/fnc_validateCargoSpace.sqf b/addons/cargo/functions/fnc_validateCargoSpace.sqf index 6caf664ca5..7634b131e6 100644 --- a/addons/cargo/functions/fnc_validateCargoSpace.sqf +++ b/addons/cargo/functions/fnc_validateCargoSpace.sqf @@ -24,7 +24,7 @@ _loaded = _vehicle getVariable [QGVAR(loaded), []]; _newLoaded = []; _totalSpaceOccupied = 0; { - if !(isNull _x) then { + if ((typeName _x == "STRING") || {!isNull _x}) then { _newLoaded pushback _x; _totalSpaceOccupied = _totalSpaceOccupied + ([_x] call FUNC(getSizeItem)); }; @@ -35,4 +35,4 @@ if (count _loaded != count _newLoaded) then { _vehicle setVariable [QGVAR(loaded), _newLoaded, true]; }; -_vehicle setVariable [QGVAR(space), getNumber (configFile >> "CfgVehicles" >> typeof _vehicle >> QGVAR(space)) - _totalSpaceOccupied, true]; +_vehicle setVariable [QGVAR(space), getNumber (configFile >> "CfgVehicles" >> typeOf _vehicle >> QGVAR(space)) - _totalSpaceOccupied, true]; diff --git a/addons/cargo/stringtable.xml b/addons/cargo/stringtable.xml index 7f9ac40a15..4b33f9826b 100644 --- a/addons/cargo/stringtable.xml +++ b/addons/cargo/stringtable.xml @@ -95,5 +95,21 @@ 1%<br/>kirakodva ebből:<br/>%2 %1<br/>разгружен из<br/>%2 + + Loading Cargo + Carregando carga + + + Unloading Cargo + Descarregando carga + + + %1<br/>could not be loaded + %1<br/>não pode ser carregado + + + %1<br/>could not be unloaded + %1<br/>não pode ser descarregado + - + \ No newline at end of file diff --git a/addons/common/CfgVehicles.hpp b/addons/common/CfgVehicles.hpp index 7c5c9295f9..de1f7f7cf4 100644 --- a/addons/common/CfgVehicles.hpp +++ b/addons/common/CfgVehicles.hpp @@ -35,6 +35,7 @@ class CfgVehicles { function = QFUNC(moduleCheckPBOs); scope = 2; isGlobal = 1; + isSingular = 1; icon = QUOTE(PATHTOF(UI\Icon_Module_CheckPBO_ca.paa)); class Arguments { class Action { diff --git a/addons/common/XEH_postInit.sqf b/addons/common/XEH_postInit.sqf index 032b6148be..615222678b 100644 --- a/addons/common/XEH_postInit.sqf +++ b/addons/common/XEH_postInit.sqf @@ -13,7 +13,7 @@ //Handle the waitAndExec array: while {!(GVAR(waitAndExecArray) isEqualTo []) && {GVAR(waitAndExecArray) select 0 select 0 <= ACE_Time}} do { - local _entry = GVAR(waitAndExecArray) deleteAt 0; + private _entry = GVAR(waitAndExecArray) deleteAt 0; (_entry select 2) call (_entry select 1); }; @@ -29,7 +29,7 @@ GVAR(nextFrameNo) = diag_frameno + 1; //Handle the waitUntilAndExec array: - local _deleted = 0; + private _deleted = 0; { // if condition is satisifed call statement if ((_x select 2) call (_x select 0)) then { @@ -194,9 +194,17 @@ call FUNC(checkFiles); ACE_LOGINFO("Settings received from server."); + if (isServer) then { //read settings from paramsArray + [] call FUNC(readSettingsFromParamsArray); + }; // Event so that ACE_Modules have their settings loaded: ["InitSettingsFromModules", []] call FUNC(localEvent); + if (isServer) then { + // Publish all settings data after all configs and modules are read + publicVariable QGVAR(settings); + }; + // Load user settings from profile if (hasInterface) then { call FUNC(loadSettingsFromProfile); diff --git a/addons/common/XEH_preInit.sqf b/addons/common/XEH_preInit.sqf index e1cc807bdc..cedc27cfee 100644 --- a/addons/common/XEH_preInit.sqf +++ b/addons/common/XEH_preInit.sqf @@ -115,6 +115,7 @@ PREP(isInBuilding); PREP(isModLoaded); PREP(isPlayer); PREP(isTurnedOut); +PREP(isUnderwater); PREP(letterToCode); PREP(lightIntensityFromObject); PREP(loadPerson); @@ -139,6 +140,7 @@ PREP(playerSide); PREP(positionToASL); PREP(progressBar); PREP(readSettingFromModule); +PREP(readSettingsFromParamsArray); PREP(receiveRequest); PREP(removeCanInteractWithCondition); PREP(removeSpecificMagazine); @@ -223,6 +225,7 @@ PREP(getTurretCopilot); PREP(getDoorTurrets); PREP(getTurretsFFV); PREP(getTurretsOther); +PREP(hasHatch); // missing inventory commands PREP(binocularMagazine); diff --git a/addons/common/functions/fnc_addScrollWheelEventHandler.sqf b/addons/common/functions/fnc_addScrollWheelEventHandler.sqf index ef60270695..df1601c95a 100644 --- a/addons/common/functions/fnc_addScrollWheelEventHandler.sqf +++ b/addons/common/functions/fnc_addScrollWheelEventHandler.sqf @@ -1,6 +1,6 @@ /* * Author: commy2 - * Add an event handler that executes every ACE_time the scroll wheel is used. This is needed, because adding a MouseZ display event handler to display 46 will break in save games. + * Add an event handler that executes every time the scroll wheel is used. This is needed, because adding a MouseZ display event handler to display 46 will break in save games. * _this will be [Interval] where 'Interval' is a number. * * Arguments: diff --git a/addons/common/functions/fnc_cachedCall.sqf b/addons/common/functions/fnc_cachedCall.sqf index e1e0e16118..59350d0483 100644 --- a/addons/common/functions/fnc_cachedCall.sqf +++ b/addons/common/functions/fnc_cachedCall.sqf @@ -1,6 +1,6 @@ /* * Author: esteldunedain, Jaynus - * Returns the result of the function and caches it up to a given ACE_time or event + * Returns the result of the function and caches it up to a given time or event * * Arguments: * 0: Parameters diff --git a/addons/common/functions/fnc_dumpArray.sqf b/addons/common/functions/fnc_dumpArray.sqf index 010736d3a9..026b08501e 100644 --- a/addons/common/functions/fnc_dumpArray.sqf +++ b/addons/common/functions/fnc_dumpArray.sqf @@ -18,7 +18,7 @@ params ["_var", ["_depth", 0, [0]]]; -local _pad = ""; +private _pad = ""; for "_i" from 0 to _depth do { _pad = _pad + toString [9]; diff --git a/addons/common/functions/fnc_getDeathAnim.sqf b/addons/common/functions/fnc_getDeathAnim.sqf index c88f89d35f..590418bf25 100644 --- a/addons/common/functions/fnc_getDeathAnim.sqf +++ b/addons/common/functions/fnc_getDeathAnim.sqf @@ -1,6 +1,6 @@ /* * Author: Glowbal, PabstMirror - * Get the death animation for the unit at current ACE_time + * Get the death animation for the unit at current time * * Arguments: * 0: unit diff --git a/addons/common/functions/fnc_getTurretIndex.sqf b/addons/common/functions/fnc_getTurretIndex.sqf index 050f3e1c4f..20ee178bf1 100644 --- a/addons/common/functions/fnc_getTurretIndex.sqf +++ b/addons/common/functions/fnc_getTurretIndex.sqf @@ -17,7 +17,7 @@ params ["_unit"]; -local _vehicle = vehicle _unit; +private _vehicle = vehicle _unit; if (_unit == _vehicle) exitWith {[]}; scopeName "main"; diff --git a/addons/common/functions/fnc_hasHatch.sqf b/addons/common/functions/fnc_hasHatch.sqf new file mode 100644 index 0000000000..a67ad0b0d3 --- /dev/null +++ b/addons/common/functions/fnc_hasHatch.sqf @@ -0,0 +1,35 @@ +/* + * Author: commy2 + * Check if unit is in a vehicle position where it can turn in or out. + * + * Arguments: + * 0: Unit + * + * Return Value: + * Unit has a hatch? + * + * Public: Yes + */ +#include "script_component.hpp" + +params ["_unit"]; + +private _vehicle = vehicle _unit; + +if (_unit == _vehicle) exitWith {false}; + +private _config = configFile >> "CfgVehicles" >> typeOf _vehicle; + +if (getNumber (_config >> "hideProxyInCombat") != 1) exitWith {false}; + +if (_unit == driver _vehicle) exitWith { + getNumber (_config >> "forceHideDriver") == 0; // return +}; + +private _turret = [_unit] call FUNC(getTurretIndex); + +if (_turret isEqualTo []) exitWith {false}; + +private _turretConfig = [_config, _turret] call FUNC(getTurretConfigPath); + +getNumber (_turretConfig >> "forceHideGunner") == 0; // return diff --git a/addons/common/functions/fnc_inWater.sqf b/addons/common/functions/fnc_inWater.sqf index 7c8e2eee21..3b323469fc 100644 --- a/addons/common/functions/fnc_inWater.sqf +++ b/addons/common/functions/fnc_inWater.sqf @@ -1,29 +1,19 @@ /* * Author: Glowbal - * Check if unit is underwater + * Check if unit's head is underwater * * Arguments: * 0: Unit * * Return Value: - * if unit is in the water (BOOLEAN) + * If unit's head is underwater * * Public: Yes + * + * Deprecated */ #include "script_component.hpp" -params ["_unit"]; +ACE_DEPRECATED("ace_common_fnc_inWater","3.5.0","ace_common_fnc_isUnderwater"); -private "_return"; -_return = false; - -if (surfaceIsWater getPosASL _unit) then { - private "_pos"; - _pos = _unit modelToWorldVisual (_unit selectionPosition "head"); - - if (_pos select 2 < 0) then { - _return = true; - }; -}; - -_return +_this call FUNC(isUnderwater) diff --git a/addons/common/functions/fnc_isUnderwater.sqf b/addons/common/functions/fnc_isUnderwater.sqf new file mode 100644 index 0000000000..d2f399b770 --- /dev/null +++ b/addons/common/functions/fnc_isUnderwater.sqf @@ -0,0 +1,29 @@ +/* + * Author: Glowbal + * Check if unit's head is underwater + * + * Arguments: + * 0: Unit + * + * Return Value: + * If unit's head is underwater + * + * Public: Yes + */ +#include "script_component.hpp" + +params ["_unit"]; + +private "_return"; +_return = false; + +if (surfaceIsWater getPosASL _unit) then { + private "_pos"; + _pos = _unit modelToWorldVisual (_unit selectionPosition "head"); + + if (_pos select 2 < 0) then { + _return = true; + }; +}; + +_return diff --git a/addons/common/functions/fnc_loadSettingsLocalizedText.sqf b/addons/common/functions/fnc_loadSettingsLocalizedText.sqf index 1e43359379..7b05902862 100644 --- a/addons/common/functions/fnc_loadSettingsLocalizedText.sqf +++ b/addons/common/functions/fnc_loadSettingsLocalizedText.sqf @@ -35,12 +35,23 @@ _fnc_parseConfigForDisplayNames = { _values set [_forEachIndex, _text]; }; } forEach _values; + + if (!(_values isEqualTo [])) then { + if (_typeOf != "SCALAR") then { + ACE_LOGWARNING_2("Setting [%1] has values[] but is not SCALAR (%2)", _name, _typeOf); + } else { + private _value = missionNamespace getVariable [_name, -1]; + if ((_value < 0) || {_value >= (count _values)}) then { + ACE_LOGWARNING_3("Setting [%1] out of bounds %2 (values[] count is %3)(", _name, _value, count _values); + }; + }; + }; true }; // Iterate through settings { - _x params ["_name"]; + _x params ["_name", "_typeOf"]; if !([configFile >> "ACE_Settings" >> _name] call _fnc_parseConfigForDisplayNames) then { if !([configFile >> "ACE_ServerSettings" >> _name] call _fnc_parseConfigForDisplayNames) then { diff --git a/addons/common/functions/fnc_loadSettingsOnServer.sqf b/addons/common/functions/fnc_loadSettingsOnServer.sqf index ea8257ec23..cdf8b48041 100644 --- a/addons/common/functions/fnc_loadSettingsOnServer.sqf +++ b/addons/common/functions/fnc_loadSettingsOnServer.sqf @@ -51,8 +51,6 @@ _fnc_parseConfigForSettings = { // mission side settings [missionConfigFile >> "ACE_Settings"] call _fnc_parseConfigForSettings; -// Publish all settings data -publicVariable QGVAR(settings); // Publish all setting values { publicVariable (_x select 0); diff --git a/addons/common/functions/fnc_progressBar.sqf b/addons/common/functions/fnc_progressBar.sqf index 29db1cd0c6..d93273a0c3 100644 --- a/addons/common/functions/fnc_progressBar.sqf +++ b/addons/common/functions/fnc_progressBar.sqf @@ -4,7 +4,7 @@ * Finish/Failure/Conditional are all passed [_args, _elapsedTime, _totalTime, _errorCode] * * Arguments: - * 0: NUMBER - Total Time (in game "ACE_time" seconds) + * 0: NUMBER - Total Time (in game "time" seconds) * 1: ARRAY - Arguments, passed to condition, fail and finish * 2: CODE or STRING - On Finish: Code called or STRING raised as event. * 3: CODE or STRING - On Failure: Code called or STRING raised as event. diff --git a/addons/common/functions/fnc_readSettingsFromParamsArray.sqf b/addons/common/functions/fnc_readSettingsFromParamsArray.sqf new file mode 100644 index 0000000000..d1fdb30b29 --- /dev/null +++ b/addons/common/functions/fnc_readSettingsFromParamsArray.sqf @@ -0,0 +1,63 @@ +/* + * Author: PabstMirror + * Read settins from paramsArray that have a ACE_setting = 1. + * Happens before modules but after all other configs (for force priority) + * + * Arguments: + * None + * + * Return Value: + * None + * + * Example: + * [] call ace_common_fnc_readSettingsFromParamsArray + * + * Public: No + */ +#include "script_component.hpp" + +//paramsArray is a normal variable not a command +private _paramsArray = missionnamespace getvariable ["paramsArray", []]; + +TRACE_1("Reading missionConfigFile params",_paramsArray); + +{ + private _config = (missionConfigFile >> "params") select _forEachIndex; + if ((getNumber (_config >> "ACE_setting")) > 0) then { + private _settingName = configName _config; + private _settingValue = _x; + private _title = getText (_config >> "title"); + + TRACE_3("ace_setting",_title,_settingName,_settingValue); + + // Check if the variable is already defined + if (isNil _settingName) exitWith { + ACE_LOGERROR_1("readSettingsFromParamsArray - param [%1] is not an ace_setting", _settingName); + }; + + private _settingData = [_settingName] call FUNC(getSettingData); + _settingData params ["", "_typeName", "", "", "", "", "_isForced"]; + + // Check if it's already forced and quit + if (_isForced) exitWith {ACE_LOGWARNING_1("readSettingsFromParamsArray - param [%1] is already set and forced", _settingName);}; + + // The setting is not forced, so update the value + // Read entry and cast it to the correct type from the existing variable + private _validValue = false; + switch (true) do { + case (_typeName == "SCALAR"): {_validValue = true;}; + case (_typeName == "BOOL"): { + _settingValue = _settingValue > 0; + _validValue = true; + }; + //TODO: Handle ARRAY,COLOR,STRING??? (bool/scalar covers most important settings) + }; + + if (!_validValue) exitWith { + ACE_LOGWARNING_3("readSettingsFromParamsArray - param [%1] type not valid [%2] - expected type [%3]", _settingName,_settingValue,_typeName); + }; + + // Update the variable globaly and Force + [_settingName, _settingValue, true, true] call FUNC(setSetting); + }; +} foreach _paramsArray; diff --git a/addons/common/functions/fnc_selectWeaponMode.sqf b/addons/common/functions/fnc_selectWeaponMode.sqf index f255c63e98..582f6fd4b2 100644 --- a/addons/common/functions/fnc_selectWeaponMode.sqf +++ b/addons/common/functions/fnc_selectWeaponMode.sqf @@ -19,7 +19,7 @@ params ["_unit", "_muzzle", "_mode"]; -local _index = 0; +private _index = 0; while { _index < 100 && {currentMuzzle _unit != _muzzle || {currentWeaponMode _unit != _mode}} diff --git a/addons/common/functions/fnc_setAllGear.sqf b/addons/common/functions/fnc_setAllGear.sqf index e25045a685..2b5a2a9cc7 100644 --- a/addons/common/functions/fnc_setAllGear.sqf +++ b/addons/common/functions/fnc_setAllGear.sqf @@ -148,7 +148,7 @@ if (_backpack != "") then { _unit addBackpack _backpack; if (_clearBackpack) then { - local _backpackObject = unitBackpack _unit; + private _backpackObject = unitBackpack _unit; clearMagazineCargoGlobal _backpackObject; clearWeaponCargoGlobal _backpackObject; diff --git a/addons/common/functions/fnc_setSetting.sqf b/addons/common/functions/fnc_setSetting.sqf index 60b64e31d4..9d3a42326c 100644 --- a/addons/common/functions/fnc_setSetting.sqf +++ b/addons/common/functions/fnc_setSetting.sqf @@ -13,27 +13,39 @@ * Return Value: * None * + * Example: + * ["ace_map_gestures_enabled", true, false, true] call ace_common_fnc_setSetting + * * Public: No */ #include "script_component.hpp" params ["_name", "_value", ["_force", false], ["_broadcastChanges", false]]; -private ["_settingData", "_failed"]; - -_settingData = [_name] call FUNC(getSettingData); +private _settingData = [_name] call FUNC(getSettingData); // Exit if the setting does not exist -if (count _settingData == 0) exitWith {}; +if (_settingData isEqualTo []) exitWith { + ACE_LOGERROR_1("SetSetting [%1] setting does not exist", _name); +}; + +_settingData params ["", "_typeName", "_isClientSetable", "", "", "", "_isForced"]; // Exit if the setting is already forced -if (_settingData select 6) exitWith {}; +if (_isForced) exitWith { + ACE_LOGINFO_1("SetSetting [%1] Trying to set forced setting", _name); +}; + +//This does NOT broadcast changes to GVAR(settings), so clients would not get updated force status +if ((missionNamespace getVariable [QEGVAR(modules,serverModulesRead), false]) && {!(_isForced isEqualTo _force)}) then { + ACE_LOGWARNING_3("SetSetting [%1] attempting to broadcast a change to force (%2 to %3)", _name, _isForced, _force); +}; // If the type is not equal, try to cast it -_failed = false; +private _failed = false; if (typeName _value != _settingData select 1) then { _failed = true; - if (_settingData select 1 == "BOOL" && typeName _value == "SCALAR") then { + if ((_typeName == "BOOL") && {typeName _value == "SCALAR"}) then { // If value is not 0 or 1 consider it invalid and don't set anything if (_value isEqualTo 0) then { _value = false; @@ -44,12 +56,12 @@ if (typeName _value != _settingData select 1) then { _failed = false; }; }; - if (_settingData select 1 == "COLOR" && typeName _value == "ARRAY") then { + if ((_typeName == "COLOR") && {typeName _value == "ARRAY"}) then { _failed = false; }; }; -if (_failed) exitWith {}; +if (_failed) exitWith {ACE_LOGERROR_3("SetSetting [%1] bad data type expected %2 got %3", _name, _typeName, typeName _value);}; // Force it if it was required _settingData set [6, _force]; diff --git a/addons/common/functions/fnc_setVariablePublic.sqf b/addons/common/functions/fnc_setVariablePublic.sqf index b6fb58b0f4..67dbd5fd2f 100644 --- a/addons/common/functions/fnc_setVariablePublic.sqf +++ b/addons/common/functions/fnc_setVariablePublic.sqf @@ -1,12 +1,12 @@ /* * Author: commy2 and joko // Jonas - * Sets a public variable, but wait a certain amount of ACE_time to transfer the value over the network. Changing the value by calling this function again resets the windup timer. + * Sets a public variable, but wait a certain amount of time to transfer the value over the network. Changing the value by calling this function again resets the windup timer. * * Arguments: * 0: Object the variable should be assigned to * 1: Name of the variable * 2: Value of the variable - * 3: Windup ACE_time (default: 1) + * 3: Windup time (default: 1) * * Return Value: * None diff --git a/addons/common/functions/fnc_throttledPublicVariable.sqf b/addons/common/functions/fnc_throttledPublicVariable.sqf index cdc72f4450..67cfc50f9a 100644 --- a/addons/common/functions/fnc_throttledPublicVariable.sqf +++ b/addons/common/functions/fnc_throttledPublicVariable.sqf @@ -19,7 +19,7 @@ params ["_unit", "_varName", "_maxDelay"]; -// Create the publish scheduler PFH the first ACE_time +// Create the publish scheduler PFH the first time if (isNil QGVAR(publishSchedId)) then { GVAR(publishVarNames) = []; GVAR(publishNextTime) = 1e7; diff --git a/addons/common/functions/fnc_timePFH.sqf b/addons/common/functions/fnc_timePFH.sqf index 152eceee3f..e5366d331e 100644 --- a/addons/common/functions/fnc_timePFH.sqf +++ b/addons/common/functions/fnc_timePFH.sqf @@ -14,13 +14,13 @@ BEGIN_COUNTER(timePFH); -local _lastTickTime = ACE_diagTime; -local _lastGameTime = ACE_gameTime; +private _lastTickTime = ACE_diagTime; +private _lastGameTime = ACE_gameTime; ACE_gameTime = time; ACE_diagTime = diag_tickTime; -local _delta = ACE_diagTime - _lastTickTime; +private _delta = ACE_diagTime - _lastTickTime; if (ACE_gameTime <= _lastGameTime) then { TRACE_1("paused",_delta); diff --git a/addons/common/functions/fnc_waitAndExecute.sqf b/addons/common/functions/fnc_waitAndExecute.sqf index af59e301f7..6f282ba656 100644 --- a/addons/common/functions/fnc_waitAndExecute.sqf +++ b/addons/common/functions/fnc_waitAndExecute.sqf @@ -1,6 +1,6 @@ /* * Author: esteldunedain - * Executes a code once with a given game ACE_time delay, using a PFH + * Executes a code once with a given game time delay, using a PFH * * Arguments: * 0: Code to execute diff --git a/addons/common/functions/fnc_waitUntilAndExecute.sqf b/addons/common/functions/fnc_waitUntilAndExecute.sqf index 6a7867d707..bbc6c540fe 100644 --- a/addons/common/functions/fnc_waitUntilAndExecute.sqf +++ b/addons/common/functions/fnc_waitUntilAndExecute.sqf @@ -11,7 +11,7 @@ * None * * Example: - * [{(_this select 0) == vehicle (_this select 0)}, {(_this select 0) setDamage 1;}, [ACE_player]] call ace_common_fnc_waitAndExecute + * [{(_this select 0) == vehicle (_this select 0)}, {(_this select 0) setDamage 1;}, [ACE_player]] call ace_common_fnc_waitUntilAndExecute * * Public: No */ diff --git a/addons/dagr/XEH_postInit.sqf b/addons/dagr/XEH_postInit.sqf index 39f2a7ea28..883a73d418 100644 --- a/addons/dagr/XEH_postInit.sqf +++ b/addons/dagr/XEH_postInit.sqf @@ -30,4 +30,4 @@ GVAR(vectorConnected) = false; GVAR(noVectorData) = true; GVAR(vectorGrid) = "00000000"; -["RangerfinderData", {_this call FUNC(handleRangeFinderData)}] call EFUNC(common,addEventHandler); +["RangerfinderData", FUNC(handleRangeFinderData)] call EFUNC(common,addEventHandler); diff --git a/addons/dagr/functions/fnc_menuInit.sqf b/addons/dagr/functions/fnc_menuInit.sqf index 739f41df0b..e4fb341537 100644 --- a/addons/dagr/functions/fnc_menuInit.sqf +++ b/addons/dagr/functions/fnc_menuInit.sqf @@ -74,13 +74,13 @@ GVAR(menuRun) = true; GVAR(menuRun) = false; [_this select 1] call CBA_fnc_removePerFrameHandler; }; - + if (GVAR(MENU_B)) then { GVAR(menu) = "main"; GVAR(selection) = 0; GVAR(numSelections) = 5; }; - + if (!GVAR(add) && !GVAR(edit)) then { if (GVAR(DOWN)) then { GVAR(selection) = (GVAR(numSelections) + GVAR(selection) + 1); @@ -90,7 +90,7 @@ GVAR(menuRun) = true; }; GVAR(selection) = if (GVAR(numSelections) > 0) then { GVAR(selection) % GVAR(numSelections) } else { 0 }; }; - + if (GVAR(LEFT)) then { GVAR(pointer) = (8 + GVAR(pointer) - 1); }; @@ -98,7 +98,7 @@ GVAR(menuRun) = true; GVAR(pointer) = (8 + GVAR(pointer) + 1); }; GVAR(pointer) = GVAR(pointer) % 8; - + (__dsp displayCtrl __PSelection1) ctrlSetText ""; (__dsp displayCtrl __PSelection2) ctrlSetText ""; (__dsp displayCtrl __PSelection3) ctrlSetText ""; @@ -113,7 +113,7 @@ GVAR(menuRun) = true; (__dsp displayCtrl __Selection2) ctrlSetText ""; (__dsp displayCtrl __Selection3) ctrlSetText ""; (__dsp displayCtrl __Selection4) ctrlSetText ""; - + (__dsp displayCtrl __F1) ctrlSetText ""; (__dsp displayCtrl __F2) ctrlSetText ""; (__dsp displayCtrl __F3) ctrlSetText ""; @@ -124,7 +124,7 @@ GVAR(menuRun) = true; (__dsp displayCtrl __Option2) ctrlSetText ""; (__dsp displayCtrl __Option3) ctrlSetText ""; (__dsp displayCtrl __Option4) ctrlSetText ""; - + switch (GVAR(menu)) do { case "main": { if (GVAR(SEL)) then { @@ -500,7 +500,7 @@ GVAR(menuRun) = true; case 6: { GVAR(digit6) = (10 + GVAR(digit6) - 1) % 10 }; case 7: { GVAR(digit7) = (10 + GVAR(digit7) - 1) % 10 }; case 8: { GVAR(digit8) = (10 + GVAR(digit8) - 1) % 10 }; - }; + }; }; }; }; @@ -590,7 +590,7 @@ GVAR(menuRun) = true; }; }; }; - + if (!GVAR(busy)) then { GVAR(F3) = false; GVAR(F2) = false; diff --git a/addons/dagr/functions/fnc_outputData.sqf b/addons/dagr/functions/fnc_outputData.sqf index 9bcf244fbc..63350c71a3 100644 --- a/addons/dagr/functions/fnc_outputData.sqf +++ b/addons/dagr/functions/fnc_outputData.sqf @@ -31,18 +31,19 @@ if (GVAR(outputPFH) != -1) exitWith {}; GVAR(outputPFH) = [{ private["_dagrElevation", "_dagrGrid", "_dagrHeading", "_dagrSpeed", "_dagrTime", "_elevation", "_gridArray", "_speed"]; - + // Abort Condition if !(GVAR(run) && [ACE_player, "ACE_DAGR"] call EFUNC(common,hasItem)) exitWith { GVAR(outputPFH) = -1; 135471 cutText ["", "PLAIN"]; [_this select 1] call CBA_fnc_removePerFrameHandler; }; - + // GRID _gridArray = [(getPos ACE_player), false] call EFUNC(common,getMapGridFromPos); - _dagrGrid = format ["%1 %2", ((_gridArray select 0) select [0,4]), ((_gridArray select 1) select [0,4])]; - + _gridArray params ["_gridArrayX","_gridArrayY"]; + _dagrGrid = format ["%1 %2", ((_gridArrayX) select [0,4]), ((_gridArrayY) select [0,4])]; + // SPEED _speed = speed (vehicle ACE_player); _speed = floor (_speed * 10) / 10; @@ -68,7 +69,7 @@ GVAR(outputPFH) = [{ __gridControl ctrlSetText format ["%1", _dagrGrid]; __speedControl ctrlSetText format ["%1", _dagrSpeed]; __elevationControl ctrlSetText format ["%1", _dagrElevation]; - __headingControl ctrlSetText (if (!GVAR(useDegrees)) then { format ["%1", _dagrHeading] } else { format ["%1 ", _dagrHeading] }); + __headingControl ctrlSetText (if (!GVAR(useDegrees)) then { format ["%1", _dagrHeading] } else { format ["%1 �", _dagrHeading] }); __timeControl ctrlSetText format ["%1", _dagrTime]; - + }, GVAR(updateInterval), []] call CBA_fnc_addPerFrameHandler; diff --git a/addons/dagr/functions/fnc_outputVector.sqf b/addons/dagr/functions/fnc_outputVector.sqf index ad9068344f..7f36facae8 100644 --- a/addons/dagr/functions/fnc_outputVector.sqf +++ b/addons/dagr/functions/fnc_outputVector.sqf @@ -1,4 +1,4 @@ -/* +/* * Author: Rosuto * DAGR vector output loop * @@ -14,7 +14,7 @@ */ #include "script_component.hpp" -private ["_pos", "_xGrid", "_yGrid", "_dagrGrid", "_bearing", "_dagrDist", "_dagrElevation", "_dagrTime", "_elevation", "_xCoord", "_yCoord"]; +private ["_xGrid", "_yGrid", "_dagrGrid", "_bearing", "_dagrDist", "_dagrElevation", "_dagrTime", "_elevation", "_xCoord", "_yCoord"]; 135471 cutRsc ["DAGR_DISPLAY", "plain down"]; @@ -30,15 +30,14 @@ private ["_pos", "_xGrid", "_yGrid", "_dagrGrid", "_bearing", "_dagrDist", "_dag __background ctrlSetText QUOTE(PATHTOF(UI\dagr_vector.paa)); if (GVAR(noVectorData)) exitwith {}; - -_pos = [GVAR(LAZPOS) select 0, GVAR(LAZPOS) select 1]; +GVAR(LAZPOS) params ["_lazPosX", "_lazPosY", "_lazPosZ"]; // Incase grids go neg due to 99-00 boundry -if (_pos select 0 < 0) then {_pos set [0, (_pos select 0) + 99999];}; -if (_pos select 1 < 0) then {_pos set [1, (_pos select 1) + 99999];}; - +if (_lazPosX < 0) then { _lazPosX = _lazPosX + 99999;}; +if (_lazPosY < 0) then {_lazPosY = _lazPosY + 99999;}; + // Find laser position -_xGrid = toArray Str(round(_pos select 0)); +_xGrid = toArray Str(round _lazPosX); while {count _xGrid < 5} do { _xGrid = [48] + _xGrid; @@ -47,7 +46,7 @@ _xGrid resize 4; _xGrid = toString _xGrid; _xGrid = parseNumber _xGrid; -_yGrid = toArray Str(round(_pos select 1)); +_yGrid = toArray Str(round _lazPosY); while {count _yGrid < 5} do { _yGrid = [48] + _yGrid; }; @@ -72,7 +71,7 @@ _yCoord = switch true do { _dagrGrid = _xCoord + " " + _yCoord; // Find target elevation -_elevation = floor ((GVAR(LAZPOS) select 2) + EGVAR(common,mapAltitude)); +_elevation = floor ((_lazPosZ) + EGVAR(common,mapAltitude)); _dagrElevation = str _elevation + "m"; // Time @@ -94,5 +93,5 @@ GVAR(vectorGrid) = _dagrGrid; __gridControl ctrlSetText format ["%1", _dagrGrid]; __speedControl ctrlSetText format ["%1", _dagrDist]; __elevationControl ctrlSetText format ["%1", _dagrElevation]; -__headingControl ctrlSetText (if (!GVAR(useDegrees)) then { format ["%1", _bearing] } else { format ["%1", _bearing] }); +__headingControl ctrlSetText (if (!GVAR(useDegrees)) then { format ["%1", _bearing] } else { format ["%1°", _bearing] }); __timeControl ctrlSetText format ["%1", _dagrTime]; diff --git a/addons/dagr/functions/fnc_outputWP.sqf b/addons/dagr/functions/fnc_outputWP.sqf index 71c3e7c1a7..204a5ef556 100644 --- a/addons/dagr/functions/fnc_outputWP.sqf +++ b/addons/dagr/functions/fnc_outputWP.sqf @@ -1,4 +1,4 @@ -/* +/* * Author: Rosuto * DAGR waypoint output loop * @@ -31,22 +31,23 @@ if (GVAR(outputPFH) != -1) exitWith {}; GVAR(outputPFH) = [{ private["_MYpos", "_WPpos", "_bearing", "_dagrDistance", "_dagrGrid", "_dagrHeading", "_distance", "_gridArray"]; - + // Abort Condition if !(GVAR(run) && [ACE_player, "ACE_DAGR"] call EFUNC(common,hasItem)) exitWith { GVAR(outputPFH) = -1; 135471 cutText ["", "PLAIN"]; [_this select 1] call CBA_fnc_removePerFrameHandler; }; - + // GRID _gridArray = [(getPos ACE_player), false] call EFUNC(common,getMapGridFromPos); - _dagrGrid = format ["%1 %2", ((_gridArray select 0) select [0,4]), ((_gridArray select 1) select [0,4])]; + _gridArray params ["_gridArrayX","_gridArrayY"]; + _dagrGrid = format ["%1 %2", (_gridArrayX select [0,4]), (_gridArrayY select [0,4])]; // WP Grid _xGrid2 = floor (DAGR_WP_INFO / 10000); _yGrid2 = DAGR_WP_INFO - _xGrid2 * 10000; - + _xCoord2 = switch true do { case (_xGrid2 >= 1000): { "" + Str(_xGrid2) }; case (_xGrid2 >= 100): { "0" + Str(_xGrid2) }; @@ -60,7 +61,7 @@ GVAR(outputPFH) = [{ case (_yGrid2 >= 10): { "00" + Str(_yGrid2) }; default { "000" + Str(_yGrid2) }; }; - + _dagrGrid2 = _xCoord2 + " " + _yCoord2; // Distance @@ -69,7 +70,7 @@ GVAR(outputPFH) = [{ _distance = _MYpos distance _WPpos; _distance = floor (_distance * 10) / 10; _dagrDistance = str _distance + "m"; - + // Heading _dagrHeading = floor (if (GVAR(useDegrees)) then { direction (vehicle ACE_player) @@ -79,12 +80,12 @@ GVAR(outputPFH) = [{ // WP Heading _bearing = floor ((_WPpos vectorDiff _MYpos) call CBA_fnc_vectDir); - + // Output __gridControl ctrlSetText format ["%1", _dagrGrid]; __speedControl ctrlSetText format ["%1", _bearing]; __elevationControl ctrlSetText format ["%1", _dagrGrid2]; - __headingControl ctrlSetText (if (!GVAR(useDegrees)) then { format ["%1", _dagrHeading] } else { format ["%1", _dagrHeading] }); + __headingControl ctrlSetText (if (!GVAR(useDegrees)) then { format ["%1", _dagrHeading] } else { format ["%1°", _dagrHeading] }); __timeControl ctrlSetText format ["%1", _dagrDistance]; - + }, GVAR(updateInterval), []] call CBA_fnc_addPerFrameHandler; diff --git a/addons/dagr/functions/fnc_toggleOverlay.sqf b/addons/dagr/functions/fnc_toggleOverlay.sqf index 1fcb87d0ff..d48a83ae51 100644 --- a/addons/dagr/functions/fnc_toggleOverlay.sqf +++ b/addons/dagr/functions/fnc_toggleOverlay.sqf @@ -23,11 +23,12 @@ if (GVAR(run)) then { }; GVAR(hidden) = true; [{ - EXPLODE_1_PVT(_this select 0,_vehicle); + params ["_args", "_idPFH"]; + _args params ["_vehicle"]; if (!GVAR(run) || (!alive ACE_player) || (vehicle ACE_player != _vehicle)) exitWith { GVAR(run) = false; 135471 cutText ["", "PLAIN"]; - [_this select 1] call CBA_fnc_removePerFrameHandler; + [_idPFH] call CBA_fnc_removePerFrameHandler; }; if (cameraView == "GUNNER") then { if (!GVAR(hidden)) then { diff --git a/addons/dagr/stringtable.xml b/addons/dagr/stringtable.xml index 1abd146800..a164ac51f3 100644 --- a/addons/dagr/stringtable.xml +++ b/addons/dagr/stringtable.xml @@ -6,24 +6,28 @@ DAGR DAGR DAGR + DAGR Configure DAGR Konfiguruj DAGR Configurar DAGR Настроить DAGR + Configurar DAGR Toggle DAGR Przełącz DAGR Mostrar DAGR Вкл./выкл. DAGR + Mostrar DAGR Defense Advanced GPS Receiver Defense Advanced GPS Receiver Defense Advanced GPS Receiver Военный многофункциональный GPS-приёмник + Defense Advanced GPS Receiver - + \ No newline at end of file diff --git a/addons/disarming/functions/fnc_disarmDropItems.sqf b/addons/disarming/functions/fnc_disarmDropItems.sqf index 91eff1c99d..be2f932028 100644 --- a/addons/disarming/functions/fnc_disarmDropItems.sqf +++ b/addons/disarming/functions/fnc_disarmDropItems.sqf @@ -63,7 +63,7 @@ if (isNull _holder) then { if (isNull _holder) exitWith { [_caller, _target, "Debug: Null Holder"] call FUNC(eventTargetFinish); }; -//Make sure only one drop operation at a ACE_time (using PFEH system as a queue) +//Make sure only one drop operation at a time (using PFEH system as a queue) if (_holder getVariable [QGVAR(holderInUse), false]) exitWith { [{ _this call FUNC(disarmDropItems); diff --git a/addons/dragging/functions/fnc_startCarry.sqf b/addons/dragging/functions/fnc_startCarry.sqf index a95a8f9fb4..3b08de2c9d 100644 --- a/addons/dragging/functions/fnc_startCarry.sqf +++ b/addons/dragging/functions/fnc_startCarry.sqf @@ -61,7 +61,7 @@ if (_target isKindOf "CAManBase") then { [_unit, _target, true] call EFUNC(common,claim); -// prevents draging and carrying at the same ACE_time +// prevents draging and carrying at the same time _unit setVariable [QGVAR(isCarrying), true, true]; // required for aborting animation diff --git a/addons/dragging/functions/fnc_startDrag.sqf b/addons/dragging/functions/fnc_startDrag.sqf index d3e55bdaea..6ad315ce00 100644 --- a/addons/dragging/functions/fnc_startDrag.sqf +++ b/addons/dragging/functions/fnc_startDrag.sqf @@ -45,7 +45,7 @@ if (_target isKindOf "CAManBase") then { [_target, "AinjPpneMrunSnonWnonDb_grab", 2, true] call EFUNC(common,doAnimation); }; -// prevents draging and carrying at the same ACE_time +// prevents draging and carrying at the same time _unit setVariable [QGVAR(isDragging), true, true]; [FUNC(startDragPFH), 0.2, [_unit, _target, ACE_time + 5]] call CBA_fnc_addPerFrameHandler; diff --git a/addons/dragging/functions/fnc_startDragPFH.sqf b/addons/dragging/functions/fnc_startDragPFH.sqf index 1edbd92a99..14af1575a6 100644 --- a/addons/dragging/functions/fnc_startDragPFH.sqf +++ b/addons/dragging/functions/fnc_startDragPFH.sqf @@ -31,7 +31,7 @@ if (!alive _target || {_unit distance _target > 10}) then { [_idPFH] call CBA_fnc_removePerFrameHandler; }; -// timeout. Do nothing. Quit. ACE_time, because anim length is linked to ingame ACE_time. +// timeout. Do nothing. Quit. ACE_time, because anim length is linked to ingame time. if (ACE_time > _timeOut) exitWith { [_idPFH] call CBA_fnc_removePerFrameHandler; diff --git a/addons/dragging/stringtable.xml b/addons/dragging/stringtable.xml index 4535a8e62e..be80801e57 100644 --- a/addons/dragging/stringtable.xml +++ b/addons/dragging/stringtable.xml @@ -1,4 +1,4 @@ - + @@ -53,6 +53,8 @@ Raise/Lower Heben/Senken Wyżej/Niżej + Levantar/Abaixar + Поднять/Опустить - + \ No newline at end of file diff --git a/addons/explosives/CfgModule.hpp b/addons/explosives/CfgModule.hpp index a27efae704..b651903f59 100644 --- a/addons/explosives/CfgModule.hpp +++ b/addons/explosives/CfgModule.hpp @@ -6,6 +6,7 @@ class ACE_ModuleExplosive: ACE_Module { function = QUOTE(FUNC(module)); scope = 2; isGlobal = 1; + isSingular = 1; icon = PATHTOF(UI\Icon_Module_Explosives_ca.paa); class Arguments { class RequireSpecialist { diff --git a/addons/explosives/functions/fnc_detonateExplosive.sqf b/addons/explosives/functions/fnc_detonateExplosive.sqf index 373e72ac21..74e4dfca11 100644 --- a/addons/explosives/functions/fnc_detonateExplosive.sqf +++ b/addons/explosives/functions/fnc_detonateExplosive.sqf @@ -7,7 +7,7 @@ * 1: Max range (-1 to ignore) * 2: Explosive * 0: Explosive - * 1: Fuse ACE_time + * 1: Fuse time * * Return Value: * None diff --git a/addons/fcs/XEH_clientInit.sqf b/addons/fcs/XEH_clientInit.sqf index f5131dd135..3338e739e1 100644 --- a/addons/fcs/XEH_clientInit.sqf +++ b/addons/fcs/XEH_clientInit.sqf @@ -1,7 +1,7 @@ #include "script_component.hpp" GVAR(enabled) = false; -GVAR(ACE_time) = 0; +GVAR(time) = 0; GVAR(position) = [0,0,0]; if (!hasInterface) exitWith {}; diff --git a/addons/fcs/functions/fnc_keyDown.sqf b/addons/fcs/functions/fnc_keyDown.sqf index a56e94bbf1..cea7196570 100644 --- a/addons/fcs/functions/fnc_keyDown.sqf +++ b/addons/fcs/functions/fnc_keyDown.sqf @@ -22,7 +22,7 @@ _distance = call FUNC(getRange); if !(!GVAR(enabled) && FUNC(canUseFCS)) exitWith {}; GVAR(Enabled) = true; -GVAR(Time) = ACE_time; +GVAR(time) = ACE_time; if (_distance == 0) then { _distance = [5, 5000, 0] call EFUNC(common,getTargetDistance); // maximum distance: 5000m, 5m precision diff --git a/addons/fcs/functions/fnc_keyUp.sqf b/addons/fcs/functions/fnc_keyUp.sqf index 1e831d6df3..37390c0b47 100644 --- a/addons/fcs/functions/fnc_keyUp.sqf +++ b/addons/fcs/functions/fnc_keyUp.sqf @@ -60,7 +60,7 @@ private ["_movingAzimuth", "_posTarget", "_velocityTarget"]; // MOVING TARGETS _movingAzimuth = 0; -if (ACE_time - GVAR(ACE_time) > 1 and GVAR(ACE_time) != -1 and count _this < 3) then { +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), @@ -68,14 +68,14 @@ if (ACE_time - GVAR(ACE_time) > 1 and GVAR(ACE_time) != -1 and count _this < 3) (getPos _vehicle select 2) + _distance * (_weaponDirection select 2) ]; _velocityTarget = [ - ((_posTarget select 0) - (GVAR(position) select 0)) / (ACE_time - GVAR(ACE_time)), - ((_posTarget select 1) - (GVAR(position) select 1)) / (ACE_time - GVAR(ACE_time)), - ((_posTarget select 2) - (GVAR(position) select 2)) / (ACE_time - GVAR(ACE_time)) + ((_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 ["_magazineType", "_ammoType", "_initSpeed", "_airFriction", "_timeToLive", "_simulationStep", "_initSpeedCoef", "_velocityMagnitude"]; - // estimate ACE_time to target + // estimate time to target _magazineType = _vehicle currentMagazineTurret _turret; _ammoType = getText (configFile >> "CfgMagazines" >> _magazineType >> "ammo"); _initSpeed = getNumber (configFile >> "CfgMagazines" >> _magazineType >> "initSpeed"); @@ -90,7 +90,7 @@ if (ACE_time - GVAR(ACE_time) > 1 and GVAR(ACE_time) != -1 and count _this < 3) if (_initSpeedCoef > 0) then { _initSpeed = _initSpeedCoef; }; - + if (_simulationStep != 0) then { private ["_posX", "_velocityX", "_velocityY", "_timeToTarget"]; @@ -130,7 +130,7 @@ if (ACE_time - GVAR(ACE_time) > 1 and GVAR(ACE_time) != -1 and count _this < 3) }; }; GVAR(enabled) = false; -GVAR(ACE_time) = -1; +GVAR(time) = -1; private ["_viewDiff", "_FCSAzimuth", "_FCSMagazines", "_FCSElevation"]; @@ -157,7 +157,7 @@ _FCSElevation = []; _maxElev = getNumber (_turretConfig >> "maxElev"); _initSpeed = getNumber (configFile >> "CfgMagazines" >> _magazine >> "initSpeed"); _airFriction = getNumber (configFile >> "CfgAmmo" >> _ammoType >> "airFriction"); - + { private ["_weapon", "_muzzles", "_weaponMagazines", "_muzzleMagazines"]; _weapon = _x; @@ -179,7 +179,7 @@ _FCSElevation = []; }; }; } forEach _weapons; - + _offset = "ace_fcs" callExtension format ["%1,%2,%3,%4", _initSpeed, _airFriction, _angleTarget, _distance]; _offset = parseNumber _offset; @@ -209,4 +209,12 @@ if(_playSound) then { if(_showHint) then { [format ["%1: %2", localize LSTRING(ZeroedTo), _distance]] call EFUNC(common,displayTextStructured); -}; \ No newline at end of file +}; + +//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 { + ((uiNamespace getVariable ["ACE_dlgRangefinder", displayNull]) displayCtrl 1713151) ctrlSetText "----"; +} else { + ((uiNamespace getVariable ["ACE_dlgRangefinder", displayNull]) displayCtrl 1713151) ctrlSetText ([_distance, 4, 0] call CBA_fnc_formatNumber); +}; diff --git a/addons/fcs/functions/script_component.hpp b/addons/fcs/functions/script_component.hpp index 8ada0f7a71..179c66c15e 100644 --- a/addons/fcs/functions/script_component.hpp +++ b/addons/fcs/functions/script_component.hpp @@ -1,12 +1 @@ -#define COMPONENT fcs -#include "\z\ace\addons\main\script_mod.hpp" - -#ifdef DEBUG_ENABLED_FCS - #define DEBUG_MODE_FULL -#endif - -#ifdef DEBUG_SETTINGS_FCS - #define DEBUG_SETTINGS DEBUG_SETTINGS_FCS -#endif - -#include "\z\ace\addons\main\script_macros.hpp" +#include "\z\ace\addons\fcs\script_component.hpp" \ No newline at end of file diff --git a/addons/finger/CfgVehicles.hpp b/addons/finger/CfgVehicles.hpp index 99d9713f00..e78ef50123 100644 --- a/addons/finger/CfgVehicles.hpp +++ b/addons/finger/CfgVehicles.hpp @@ -7,6 +7,7 @@ class CfgVehicles { icon = QUOTE(PATHTOF(UI\Icon_Module_finger_ca.paa)); function = QFUNC(moduleSettings); isGlobal = 0; + isSingular = 1; author = ECSTRING(common,ACETeam); class Arguments { class enabled { diff --git a/addons/gforces/functions/fnc_pfhUpdateGForces.sqf b/addons/gforces/functions/fnc_pfhUpdateGForces.sqf index b7173f5742..ee1bc8ca4a 100644 --- a/addons/gforces/functions/fnc_pfhUpdateGForces.sqf +++ b/addons/gforces/functions/fnc_pfhUpdateGForces.sqf @@ -19,7 +19,7 @@ EXPLODE_2_PVT(_this,_params,_pfhId); _interval = ACE_time - GVAR(lastUpdateTime); -// Update the g-forces at constant game ACE_time intervals +// Update the g-forces at constant game time intervals if (_interval < INTERVAL) exitWith {}; if (isNull ACE_player) exitWith {}; diff --git a/addons/goggles/XEH_postInit.sqf b/addons/goggles/XEH_postInit.sqf index 4958c8e02b..09a84ad151 100644 --- a/addons/goggles/XEH_postInit.sqf +++ b/addons/goggles/XEH_postInit.sqf @@ -95,7 +95,7 @@ GVAR(OldGlasses) = "#NULLSTRING"; }] call EFUNC(common,addEventHandler); // check goggles -local _fnc_checkGoggles = { +private _fnc_checkGoggles = { params ["_unit"]; if (GVAR(EffectsActive)) then { diff --git a/addons/goggles/functions/fnc_applyDirtEffect.sqf b/addons/goggles/functions/fnc_applyDirtEffect.sqf index b10ebc9668..c7ff386f9d 100644 --- a/addons/goggles/functions/fnc_applyDirtEffect.sqf +++ b/addons/goggles/functions/fnc_applyDirtEffect.sqf @@ -28,7 +28,7 @@ _effects set [DIRT, true]; SETGLASSES(_unit,_effects); if ([_unit] call FUNC(isGogglesVisible)) then { - local _dirtImage = getText (configFile >> "CfgGlasses" >> goggles _unit >> "ACE_OverlayDirt"); + private _dirtImage = getText (configFile >> "CfgGlasses" >> goggles _unit >> "ACE_OverlayDirt"); if (_dirtImage != "") then { GVAR(GogglesEffectsLayer) cutRsc ["RscACE_GogglesEffects", "PLAIN", 0.1, false]; diff --git a/addons/goggles/functions/fnc_applyDustEffect.sqf b/addons/goggles/functions/fnc_applyDustEffect.sqf index b052f3eae7..75f4853c01 100644 --- a/addons/goggles/functions/fnc_applyDustEffect.sqf +++ b/addons/goggles/functions/fnc_applyDustEffect.sqf @@ -54,7 +54,7 @@ GVAR(DustHandler) = [{ if (ACE_diagTime >= GETDUSTT(DTIME) + 3) then { SETDUST(DAMOUNT,CLAMP(GETDUSTT(DAMOUNT)-1,0,2)); - local _amount = 1 - (GETDUSTT(DAMOUNT) * 0.125); + private _amount = 1 - (GETDUSTT(DAMOUNT) * 0.125); if !(_unit getVariable ["ACE_EyesDamaged", false]) then { GVAR(PostProcessEyes) ppEffectAdjust [1, 1, 0, [0, 0, 0, 0], [_amount, _amount, _amount, _amount], [1, 1, 1, 0]]; diff --git a/addons/goggles/functions/fnc_applyRainEffect.sqf b/addons/goggles/functions/fnc_applyRainEffect.sqf index 7e1260a453..01b2894d87 100644 --- a/addons/goggles/functions/fnc_applyRainEffect.sqf +++ b/addons/goggles/functions/fnc_applyRainEffect.sqf @@ -27,7 +27,7 @@ _fnc_underCover = { if (vehicle _unit != _unit && {!isTurnedOut _unit}) exitWith {true}; // looking up and no roof over head - local _position = eyePos _unit; + private _position = eyePos _unit; positionCameraToWorld [0, 0, 1] select 2 < (positionCameraToWorld [0, 0, 0] select 2) - 0.4 || {(lineIntersects [_position, _position vectorAdd [0, 0, 15], _unit])} // return }; diff --git a/addons/goggles/functions/fnc_applyRotorWashEffect.sqf b/addons/goggles/functions/fnc_applyRotorWashEffect.sqf index 7dc088bc4e..bc8d0bafbf 100644 --- a/addons/goggles/functions/fnc_applyRotorWashEffect.sqf +++ b/addons/goggles/functions/fnc_applyRotorWashEffect.sqf @@ -86,7 +86,7 @@ if (_safe) exitWith {}; // apply rotor wash effect if (_rotorWash select 1 > 0) then { - local _scale = 0.7; + private _scale = 0.7; if (_rotorWash select 1 > 0) then { _scale = CLAMP(0.3 * (_rotorWash select 1),0.1,0.3); diff --git a/addons/goggles/functions/fnc_handleFired.sqf b/addons/goggles/functions/fnc_handleFired.sqf index 90260d07b3..793849822f 100644 --- a/addons/goggles/functions/fnc_handleFired.sqf +++ b/addons/goggles/functions/fnc_handleFired.sqf @@ -73,7 +73,7 @@ SETDUST(DTIME,ACE_diagTime); // apply dust effect if the amount of fired bullets is over the threshold if (GETDUSTT(DAMOUNT) < 2) then { - local _bulletsRequired = 100; + private _bulletsRequired = 100; if (isNumber (configFile >> _cloudType >> QGVAR(BulletCount))) then { _bulletsRequired = getNumber (configFile >> _cloudType >> QGVAR(BulletCount)); diff --git a/addons/goggles/functions/fnc_handleKilled.sqf b/addons/goggles/functions/fnc_handleKilled.sqf index d156fb684c..e8e207c478 100644 --- a/addons/goggles/functions/fnc_handleKilled.sqf +++ b/addons/goggles/functions/fnc_handleKilled.sqf @@ -26,7 +26,9 @@ GVAR(EffectsActive) = false; _unit setVariable ["ACE_EyesDamaged", false]; -[GVAR(DustHandler)] call CBA_fnc_removePerFrameHandler; +if (GVAR(DustHandler) != -1) then { + [GVAR(DustHandler)] call CBA_fnc_removePerFrameHandler; +}; GVAR(DustHandler) = -1; true diff --git a/addons/goggles/functions/fnc_isDivingGoggles.sqf b/addons/goggles/functions/fnc_isDivingGoggles.sqf index ab5bb74269..ac86a09d2b 100644 --- a/addons/goggles/functions/fnc_isDivingGoggles.sqf +++ b/addons/goggles/functions/fnc_isDivingGoggles.sqf @@ -17,7 +17,7 @@ params ["_glasses"]; -local _config = configFile >> "CfgGlasses" >> _glasses; +private _config = configFile >> "CfgGlasses" >> _glasses; if (!isClass _config) exitWith {false}; diff --git a/addons/goggles/functions/fnc_isInRotorWash.sqf b/addons/goggles/functions/fnc_isInRotorWash.sqf index 5ddc59192a..319da3a875 100644 --- a/addons/goggles/functions/fnc_isInRotorWash.sqf +++ b/addons/goggles/functions/fnc_isInRotorWash.sqf @@ -21,11 +21,11 @@ params ["_unit", ["_radius", 15]]; -local _rotorWash = [false, 0]; +private _rotorWash = [false, 0]; { if (isEngineOn _x) then { - local _distance = _unit distance _x; + private _distance = _unit distance _x; // convert distance to 0...1 range, where 0 is the maximum radius _distance = 1 - _distance / _radius; diff --git a/addons/grenades/functions/fnc_flashbangExplosionEH.sqf b/addons/grenades/functions/fnc_flashbangExplosionEH.sqf index b45dc099fc..0ac6502284 100644 --- a/addons/grenades/functions/fnc_flashbangExplosionEH.sqf +++ b/addons/grenades/functions/fnc_flashbangExplosionEH.sqf @@ -103,7 +103,7 @@ _affected = _grenade nearEntities ["CAManBase", 20]; GVAR(flashbangPPEffectCC) ppEffectAdjust [1,1,(0.8 + _strength) min 1,[1,1,1,0],[0,0,0,1],[0,0,0,0]]; GVAR(flashbangPPEffectCC) ppEffectCommit 0.01; - //PARTIALRECOVERY - start decreasing effect over ACE_time + //PARTIALRECOVERY - start decreasing effect over time [{ params ["_strength"]; diff --git a/addons/hearing/CfgVehicles.hpp b/addons/hearing/CfgVehicles.hpp index 2273653c3a..72377ca970 100644 --- a/addons/hearing/CfgVehicles.hpp +++ b/addons/hearing/CfgVehicles.hpp @@ -101,6 +101,7 @@ class CfgVehicles { function = QFUNC(moduleHearing); scope = 2; isGlobal = 1; + isSingular = 1; icon = PATHTOF(UI\Icon_Module_Hearing_ca.paa); class Arguments { class EnableCombatDeafness { diff --git a/addons/interact_menu/ACE_Settings.hpp b/addons/interact_menu/ACE_Settings.hpp index 381405987c..075408499b 100644 --- a/addons/interact_menu/ACE_Settings.hpp +++ b/addons/interact_menu/ACE_Settings.hpp @@ -96,4 +96,13 @@ class ACE_Settings { displayName = CSTRING(addBuildingActions); description = CSTRING(addBuildingActionsDescription); }; + class GVAR(menuAnimationSpeed) { + value = 0; + typeName = "SCALAR"; + isClientSettable = 1; + category = CSTRING(Category_InteractionMenu); + displayName = CSTRING(menuAnimationSpeed); + description = CSTRING(menuAnimationSpeed_Description); + values[] = {"$str_speed_normal", "2x", "3x"}; + }; }; diff --git a/addons/interact_menu/functions/fnc_keyDown.sqf b/addons/interact_menu/functions/fnc_keyDown.sqf index 8c8ecf0c20..56c0e6e19c 100644 --- a/addons/interact_menu/functions/fnc_keyDown.sqf +++ b/addons/interact_menu/functions/fnc_keyDown.sqf @@ -78,6 +78,21 @@ if (GVAR(useCursorMenu)) then { GVAR(selfMenuOffset) = ((positionCameraToWorld [0, 0, 2]) call EFUNC(common,positionToASL)) vectorDiff ((positionCameraToWorld [0, 0, 0]) call EFUNC(common,positionToASL)); +if (GVAR(menuAnimationSpeed) > 0) then { + //Auto expand the first level when self, mounted vehicle or zeus (skips the first animation as there is only one choice) + if (GVAR(openedMenuType) == 0) then { + if (isNull curatorCamera) then { + if (vehicle ACE_player != ACE_player) then { + GVAR(menuDepthPath) = [["ACE_SelfActions", (vehicle ACE_player)]]; + }; + } else { + GVAR(menuDepthPath) = [["ACE_ZeusActions", (getAssignedCuratorLogic player)]]; + }; + } else { + GVAR(menuDepthPath) = [["ACE_SelfActions", ACE_player]]; + }; +}; + ["interactMenuOpened", [_menuType]] call EFUNC(common,localEvent); true diff --git a/addons/interact_menu/functions/fnc_render.sqf b/addons/interact_menu/functions/fnc_render.sqf index 54f197a2a3..1a14acae07 100644 --- a/addons/interact_menu/functions/fnc_render.sqf +++ b/addons/interact_menu/functions/fnc_render.sqf @@ -14,13 +14,12 @@ BEGIN_COUNTER(fnc_render); -private ["_cursorPos2", "_p1", "_p2", "_forEachIndex", "_x", "_cursorScreenPos", "_closestDistance", "_closestSelection", "_sPos", "_disSq", "_closest", "_cTime", "_delta", "_foundTarget", "_misMatch", "_hoverPath", "_i", "_actionData", "_player", "_target"]; - -_foundTarget = false; +private _foundTarget = false; if (GVAR(openedMenuType) >= 0) then { - // _cursorPos1 = positionCameraToWorld [0, 0, 2]; - _cursorPos2 = positionCameraToWorld [0, 0, 2]; + BEGIN_COUNTER(fnc_renderMenuOpen); + + private _cursorPos2 = positionCameraToWorld [0, 0, 2]; // Render all available nearby interactions call FUNC(renderActionPoints); @@ -30,27 +29,26 @@ if (GVAR(openedMenuType) >= 0) then { [[0.5,0.5], "\a3\ui_f\data\IGUI\Cfg\Cursors\selected_ca.paa"] call FUNC(renderSelector); }; - _cursorScreenPos = [worldToScreen _cursorPos2, GVAR(cursorPos)] select (uiNamespace getVariable [QGVAR(cursorMenuOpened),false]); + private _cursorScreenPos = [worldToScreen _cursorPos2, GVAR(cursorPos)] select (uiNamespace getVariable [QGVAR(cursorMenuOpened),false]); - _closestDistance = 1000000; - _closestSelection = -1; + private _closestDistance = 1000000; + private _closestSelection = -1; { - _sPos = _x select 1; - _disSq = (((_cursorScreenPos select 0) - (_sPos select 0))^2 + ((_cursorScreenPos select 1) - (_sPos select 1))^2); - if(_disSq < 0.0125 && _disSq < _closestDistance) then { - _closestDistance = _disSq; + _x params ["", "_sPos"]; + private _distanceFromCursor = _cursorScreenPos distance2d _sPos; + if ((_distanceFromCursor < 0.1118) && {_distanceFromCursor < _closestDistance}) then { + _closestDistance = _distanceFromCursor; _closestSelection = _forEachIndex; }; } forEach GVAR(currentOptions); - if(_closestSelection == -1) exitWith {}; - _closest = GVAR(currentOptions) select _closestSelection; + private _closest = GVAR(currentOptions) select _closestSelection; + _closest params ["_action", "_sPos", "_hoverPath"]; - _sPos = _closest select 1; - _cTime = ACE_diagTime; - _delta = _cTime - GVAR(lastTime); + private _cTime = ACE_diagTime; + private _delta = _cTime - GVAR(lastTime); GVAR(lastTime) = _cTime; GVAR(rotationAngle) = (GVAR(rotationAngle) + (270*_delta)) mod 360; @@ -58,28 +56,17 @@ if (GVAR(openedMenuType) >= 0) then { _foundTarget = true; GVAR(actionSelected) = true; - GVAR(selectedAction) = (_closest select 0) select 1; + GVAR(selectedAction) = _action select 1; GVAR(selectedTarget) = (GVAR(selectedAction)) select 2; - _misMatch = false; - _hoverPath = (_closest select 2); + private _misMatch = !(GVAR(lastPath) isEqualTo _hoverPath); - if((count GVAR(lastPath)) != (count _hoverPath)) then { - _misMatch = true; - } else { - { - if !(_x isEqualTo (_hoverPath select _forEachIndex)) exitWith { - _misMatch = true; - }; - } forEach GVAR(lastPath); - }; - - if(_misMatch && {ACE_diagTime-GVAR(expandedTime) > 0.25}) then { + if(_misMatch && {ACE_diagTime-GVAR(expandedTime) > linearConversion [0, 2, GVAR(menuAnimationSpeed), 0.25, 0.08333333]}) then { GVAR(startHoverTime) = ACE_diagTime; GVAR(lastPath) = _hoverPath; GVAR(expanded) = false; } else { - if(!GVAR(expanded) && ACE_diagTime-GVAR(startHoverTime) > 0.25) then { + if(!GVAR(expanded) && {ACE_diagTime-GVAR(startHoverTime) > linearConversion [0, 2, GVAR(menuAnimationSpeed), 0.25, 0.08333333]}) then { GVAR(expanded) = true; // Start the expanding menu animation only if the user is not going up the menu @@ -89,9 +76,8 @@ if (GVAR(openedMenuType) >= 0) then { GVAR(menuDepthPath) = +GVAR(lastPath); // Execute the current action if it's run on hover - private "_runOnHover"; - _tmp = ((GVAR(selectedAction) select 0) select 9) select 3; - _runOnHover = true; + private _tmp = ((GVAR(selectedAction) select 0) select 9) select 3; + private _runOnHover = true; if ((typeName _tmp) == "CODE" ) then { _runOnHover = call _tmp; } else { @@ -103,14 +89,14 @@ if (GVAR(openedMenuType) >= 0) then { }; if (_runOnHover) then { this = GVAR(selectedTarget); - _player = ACE_Player; - _target = GVAR(selectedTarget); + private _player = ACE_Player; + private _target = GVAR(selectedTarget); // Clear the conditions caches ["clearConditionCaches", []] call EFUNC(common,localEvent); // Check the action conditions - _actionData = GVAR(selectedAction) select 0; + private _actionData = GVAR(selectedAction) select 0; if ([_target, _player, _actionData select 6] call (_actionData select 4)) then { // Call the statement [_target, _player, _actionData select 6] call (_actionData select 3); @@ -121,6 +107,7 @@ if (GVAR(openedMenuType) >= 0) then { }; }; }; + END_COUNTER(fnc_renderMenuOpen); }; if(!_foundTarget && GVAR(actionSelected)) then { diff --git a/addons/interact_menu/functions/fnc_renderMenu.sqf b/addons/interact_menu/functions/fnc_renderMenu.sqf index 21c434fe03..8b8ae963d9 100644 --- a/addons/interact_menu/functions/fnc_renderMenu.sqf +++ b/addons/interact_menu/functions/fnc_renderMenu.sqf @@ -101,9 +101,9 @@ if (GVAR(UseListMenu)) then { }; // Animate menu scale -if (_menuInSelectedPath && (_menuDepth == count _path)) then { - _scaleX = _scaleX * (0.3 + 0.7 * (((ACE_diagTime - GVAR(expandedTime)) * 8) min 1)); - _scaleY = _scaleY * (0.3 + 0.7 * (((ACE_diagTime - GVAR(expandedTime)) * 8) min 1)); +if (_menuInSelectedPath && {_menuDepth == count _path}) then { + _scaleX = _scaleX * (0.3 + 0.7 * (((ACE_diagTime - GVAR(expandedTime)) * linearConversion [0, 2, GVAR(menuAnimationSpeed), 8, 16]) min 1)); + _scaleY = _scaleY * (0.3 + 0.7 * (((ACE_diagTime - GVAR(expandedTime)) * linearConversion [0, 2, GVAR(menuAnimationSpeed), 8, 16]) min 1)); }; _target = _actionObject; diff --git a/addons/interact_menu/stringtable.xml b/addons/interact_menu/stringtable.xml index 42966c43c1..37da2aa95c 100644 --- a/addons/interact_menu/stringtable.xml +++ b/addons/interact_menu/stringtable.xml @@ -299,5 +299,11 @@ Menu interakce Menú de interacción + + Interaction Animation Speed + + + Makes menu animations faster and decreases the time needed to hover to show sub actions + diff --git a/addons/interaction/ACE_ZeusActions.hpp b/addons/interaction/ACE_ZeusActions.hpp index 5a7ea9d631..af29186895 100644 --- a/addons/interaction/ACE_ZeusActions.hpp +++ b/addons/interaction/ACE_ZeusActions.hpp @@ -199,47 +199,47 @@ class ACE_ZeusActions { class wedge { displayName = "$STR_Wedge"; icon="\A3\UI_F_Curator\Data\RscCommon\RscAttributeFormation\wedge_ca.paa"; - statement = "{_x setWaypointFormation 'WEDGE';} forEach (curatorSelected select 1);"; + statement = "{_x setWaypointFormation 'WEDGE';} forEach (curatorSelected select 2);"; }; class vee { displayName = "$STR_Vee"; icon="\A3\UI_F_Curator\Data\RscCommon\RscAttributeFormation\vee_ca.paa"; - statement = "{_x setWaypointFormation 'VEE';} forEach (curatorSelected select 1);"; + statement = "{_x setWaypointFormation 'VEE';} forEach (curatorSelected select 2);"; }; class line { displayName = "$STR_Line"; icon="\A3\UI_F_Curator\Data\RscCommon\RscAttributeFormation\line_ca.paa"; - statement = "{_x setWaypointFormation 'LINE';} forEach (curatorSelected select 1);"; + statement = "{_x setWaypointFormation 'LINE';} forEach (curatorSelected select 2);"; }; class column { displayName = "$STR_Column"; icon="\A3\UI_F_Curator\Data\RscCommon\RscAttributeFormation\column_ca.paa"; - statement = "{_x setWaypointFormation 'COLUMN';} forEach (curatorSelected select 1);"; + statement = "{_x setWaypointFormation 'COLUMN';} forEach (curatorSelected select 2);"; }; class file { displayName = "$STR_File"; icon = "\A3\UI_F_Curator\Data\RscCommon\RscAttributeFormation\file_ca.paa"; - statement = "{_x setWaypointFormation 'FILE';} forEach (curatorSelected select 1);"; + statement = "{_x setWaypointFormation 'FILE';} forEach (curatorSelected select 2);"; }; class stag_column { displayName = "$STR_Staggered"; icon="\A3\UI_F_Curator\Data\RscCommon\RscAttributeFormation\stag_column_ca.paa"; - statement = "{_x setWaypointFormation 'STAG COLUMN';} forEach (curatorSelected select 1);"; + statement = "{_x setWaypointFormation 'STAG COLUMN';} forEach (curatorSelected select 2);"; }; class ech_left { displayName = "$STR_EchL"; icon="\A3\UI_F_Curator\Data\RscCommon\RscAttributeFormation\ech_left_ca.paa"; - statement = "{_x setWaypointFormation 'ECH LEFT';} forEach (curatorSelected select 1);"; + statement = "{_x setWaypointFormation 'ECH LEFT';} forEach (curatorSelected select 2);"; }; class ech_right { displayName = "$STR_EchR"; icon="\A3\UI_F_Curator\Data\RscCommon\RscAttributeFormation\ech_right_ca.paa"; - statement = "{_x setWaypointFormation 'ECH RIGHT';} forEach (curatorSelected select 1);"; + statement = "{_x setWaypointFormation 'ECH RIGHT';} forEach (curatorSelected select 2);"; }; class diamond { displayName = "$STR_Diamond"; icon="\A3\UI_F_Curator\Data\RscCommon\RscAttributeFormation\diamond_ca.paa"; - statement = "{_x setWaypointFormation 'DIAMOND';} forEach (curatorSelected select 1);"; + statement = "{_x setWaypointFormation 'DIAMOND';} forEach (curatorSelected select 2);"; }; }; }; diff --git a/addons/interaction/CfgVehicles.hpp b/addons/interaction/CfgVehicles.hpp index 56fb06a85b..dfe4f2025e 100644 --- a/addons/interaction/CfgVehicles.hpp +++ b/addons/interaction/CfgVehicles.hpp @@ -8,6 +8,7 @@ class CfgVehicles { function = "ACE_Interaction_fnc_moduleInteraction"; scope = 2; isGlobal = 1; + isSingular = 1; icon = PATHTOF(UI\Icon_Module_Interaction_ca.paa); class Arguments { diff --git a/addons/interaction/XEH_postInit.sqf b/addons/interaction/XEH_postInit.sqf index ae3ebff5c3..ee90af64ad 100644 --- a/addons/interaction/XEH_postInit.sqf +++ b/addons/interaction/XEH_postInit.sqf @@ -29,12 +29,9 @@ GVAR(isOpeningDoor) = false; if (_unit == ACE_player) then { addCamShake [4, 0.5, 5]; + private _message = parseText format ([["%1 >", localize LSTRING(YouWereTappedRight)], ["< %1", localize LSTRING(YouWereTappedLeft)]] select (_shoulderNum == 0)); + [_message] call FUNC(displayTextStructured); }; - - private "_message"; - _message = parseText format ([["%1 >", localize LSTRING(YouWereTappedRight)], ["< %1", localize LSTRING(YouWereTappedLeft)]] select (_shoulderNum == 0)); - - ["displayTextStructured", _message] call EFUNC(common,targetEvent); }] call EFUNC(common,addEventHandler); // restore global fire teams for JIP diff --git a/addons/javelin/functions/fnc_onOpticLoad.sqf b/addons/javelin/functions/fnc_onOpticLoad.sqf index 895a48c910..cb4eac74f9 100644 --- a/addons/javelin/functions/fnc_onOpticLoad.sqf +++ b/addons/javelin/functions/fnc_onOpticLoad.sqf @@ -2,7 +2,7 @@ #include "script_component.hpp" TRACE_1("enter", _this); -#define __LOCKONTIMERANDOM 2 // Deviation in lock on ACE_time +#define __LOCKONTIMERANDOM 2 // Deviation in lock on time if((count _this) > 0) then { uiNameSpace setVariable ['ACE_RscOptics_javelin',_this select 0]; @@ -29,7 +29,7 @@ uiNameSpace setVariable [QGVAR(arguments), 0, // Run Time 0, // Lock Time 0, // Sound timer - (random __LOCKONTIMERANDOM), // random lock ACE_time addition + (random __LOCKONTIMERANDOM), // random lock time addition -1 ] ]; diff --git a/addons/logistics_wirecutter/CfgVehicles.hpp b/addons/logistics_wirecutter/CfgVehicles.hpp index 0b584409d3..d9c2943d45 100644 --- a/addons/logistics_wirecutter/CfgVehicles.hpp +++ b/addons/logistics_wirecutter/CfgVehicles.hpp @@ -11,16 +11,16 @@ class CfgVehicles { class Land_Net_Fence_4m_F: Wall_F { GVAR(isFence) = 1; }; class Land_Net_Fence_8m_F: Wall_F { GVAR(isFence) = 1; }; - class Land_Net_FenceD_8m_F: Wall_F { GVAR(isFence) = 1; }; class Land_New_WiredFence_5m_F: Wall_F { GVAR(isFence) = 1; }; - class Land_New_WiredFence_10m_Dam_F: Wall_F { GVAR(isFence) = 1; }; class Land_New_WiredFence_10m_F: Wall_F { GVAR(isFence) = 1; }; - class Land_Pipe_fence_4m_F: Wall_F { GVAR(isFence) = 1; }; - class Land_Pipe_fence_4mNoLC_F: Wall_F { GVAR(isFence) = 1; }; class Land_SportGround_fence_F: Wall_F { GVAR(isFence) = 1; }; class Land_Wired_Fence_4m_F: Wall_F { GVAR(isFence) = 1; }; - class Land_Wired_Fence_4mD_F: Wall_F { GVAR(isFence) = 1; }; class Land_Wired_Fence_8m_F: Wall_F { GVAR(isFence) = 1; }; - class Land_Wired_Fence_8mD_F: Wall_F { GVAR(isFence) = 1; }; + class Land_SportGround_fence_noLC_F: Wall_F { GVAR(isFence) = 1; }; + class Land_Mil_WiredFence_F: Wall_F { GVAR(isFence) = 1; }; + class Land_IndFnc_Corner_F: Wall_F { GVAR(isFence) = 1; }; + class Land_IndFnc_9_F: Wall_F { GVAR(isFence) = 1; }; + class Land_IndFnc_3_Hole_F: Wall_F { GVAR(isFence) = 1; }; + class Land_IndFnc_3_F: Wall_F { GVAR(isFence) = 1; }; class Land_Razorwire_F: NonStrategic { GVAR(isFence) = 1; }; }; diff --git a/addons/logistics_wirecutter/functions/fnc_interactEH.sqf b/addons/logistics_wirecutter/functions/fnc_interactEH.sqf index e93296e44a..e28ff17db6 100644 --- a/addons/logistics_wirecutter/functions/fnc_interactEH.sqf +++ b/addons/logistics_wirecutter/functions/fnc_interactEH.sqf @@ -56,7 +56,7 @@ TRACE_1("Starting wire-cut action PFEH",_interactionType); if ([_x] call FUNC(isFence)) then { _fencesHelped pushBack _x; _helper = "ACE_LogicDummy" createVehicleLocal (getpos _x); - _action = [QGVAR(helperCutFence), (localize LSTRING(CutFence)), QUOTE(PATHTOF(ui\wirecutter_ca.paa)), _fncStatement, _fncCondition, {}, _x, [0,0,0], 5] call EFUNC(interact_menu,createAction); + _action = [QGVAR(helperCutFence), (localize LSTRING(CutFence)), QUOTE(PATHTOF(ui\wirecutter_ca.paa)), _fncStatement, _fncCondition, {}, _x, {[0,0,0]}, 5.5] call EFUNC(interact_menu,createAction); [_helper, 0, [],_action] call EFUNC(interact_menu,addActionToObject); _helper setPosASL ((getPosASL _x) vectorAdd [0,0,1.25]); _addedHelpers pushBack _helper; diff --git a/addons/logistics_wirecutter/functions/fnc_isFence.sqf b/addons/logistics_wirecutter/functions/fnc_isFence.sqf index c1e30a7e6f..878f44cf9a 100644 --- a/addons/logistics_wirecutter/functions/fnc_isFence.sqf +++ b/addons/logistics_wirecutter/functions/fnc_isFence.sqf @@ -19,23 +19,14 @@ params ["_object"]; TRACE_1("params",_object); -private ["_typeOf", "_returnValue"]; +private _typeOf = typeOf _object; -_typeOf = typeOf _object; -_returnValue = false; - -if (_typeOf != "") then { +private _returnValue = if (_typeOf != "") then { //If the fence has configEntry we can check it directly - _returnValue = (1 == (getNumber (configFile >> "CfgVehicles" >> _typeOf >> QGVAR(isFence)))); + (1 == (getNumber (configFile >> "CfgVehicles" >> _typeOf >> QGVAR(isFence)))); } else { - //TODO: 1.50 use getModelInfo - _typeOf = toLower (str _object); //something like "123201: wall_indfnc_9.p3d" - { - if ((_typeOf find _x) != -1) exitWith { - _returnValue = true; - }; - nil - } count FENCE_P3DS; + //Check the p3d name against list (in script_component.hpp) + ((getModelInfo _object) select 0) in FENCE_P3DS; }; _returnValue diff --git a/addons/magazinerepack/functions/fnc_simulateRepackEvents.sqf b/addons/magazinerepack/functions/fnc_simulateRepackEvents.sqf index 646bd880af..230bdefb4f 100644 --- a/addons/magazinerepack/functions/fnc_simulateRepackEvents.sqf +++ b/addons/magazinerepack/functions/fnc_simulateRepackEvents.sqf @@ -9,7 +9,7 @@ * 2: Magazine is a belt * * Return Value: - * Array in format [ACE_time, isBullet, array of ammo counts] + * Array in format [time, isBullet, array of ammo counts] * * Example: * [10, [1,2,3,8], false] call ace_magazinerepack_fnc_simulateRepackEvents = diff --git a/addons/main/script_debug.hpp b/addons/main/script_debug.hpp index 578d76cc91..315a26a65f 100644 --- a/addons/main/script_debug.hpp +++ b/addons/main/script_debug.hpp @@ -6,22 +6,16 @@ STACK TRACING //#define DEBUG_EVENTS #ifdef ENABLE_CALLSTACK + #define CALLSTACK(function) {private ['_ret']; if(ACE_IS_ERRORED) then { ['AUTO','AUTO'] call ACE_DUMPSTACK_FNC; ACE_IS_ERRORED = false; }; ACE_IS_ERRORED = true; ACE_STACK_TRACE set [ACE_STACK_DEPTH, [diag_tickTime, __FILE__, __LINE__, ACE_CURRENT_FUNCTION, 'ANON', _this]]; ACE_STACK_DEPTH = ACE_STACK_DEPTH + 1; ACE_CURRENT_FUNCTION = 'ANON'; _ret = _this call ##function; ACE_STACK_DEPTH = ACE_STACK_DEPTH - 1; ACE_IS_ERRORED = false; _ret;} + #define CALLSTACK_NAMED(function, functionName) {private ['_ret']; if(ACE_IS_ERRORED) then { ['AUTO','AUTO'] call ACE_DUMPSTACK_FNC; ACE_IS_ERRORED = false; }; ACE_IS_ERRORED = true; ACE_STACK_TRACE set [ACE_STACK_DEPTH, [diag_tickTime, __FILE__, __LINE__, ACE_CURRENT_FUNCTION, functionName, _this]]; ACE_STACK_DEPTH = ACE_STACK_DEPTH + 1; ACE_CURRENT_FUNCTION = functionName; _ret = _this call ##function; ACE_STACK_DEPTH = ACE_STACK_DEPTH - 1; ACE_IS_ERRORED = false; _ret;} + #define DUMPSTACK ([__FILE__, __LINE__] call ACE_DUMPSTACK_FNC) -#define CALLSTACK(function) {private ['_ret']; if(ACE_IS_ERRORED) then { ['AUTO','AUTO'] call ACE_DUMPSTACK_FNC; ACE_IS_ERRORED = false; }; ACE_IS_ERRORED = true; ACE_STACK_TRACE set [ACE_STACK_DEPTH, [diag_tickTime, __FILE__, __LINE__, ACE_CURRENT_FUNCTION, 'ANON', _this]]; ACE_STACK_DEPTH = ACE_STACK_DEPTH + 1; ACE_CURRENT_FUNCTION = 'ANON'; _ret = _this call ##function; ACE_STACK_DEPTH = ACE_STACK_DEPTH - 1; ACE_IS_ERRORED = false; _ret;} -#define CALLSTACK_NAMED(function, functionName) {private ['_ret']; if(ACE_IS_ERRORED) then { ['AUTO','AUTO'] call ACE_DUMPSTACK_FNC; ACE_IS_ERRORED = false; }; ACE_IS_ERRORED = true; ACE_STACK_TRACE set [ACE_STACK_DEPTH, [diag_tickTime, __FILE__, __LINE__, ACE_CURRENT_FUNCTION, functionName, _this]]; ACE_STACK_DEPTH = ACE_STACK_DEPTH + 1; ACE_CURRENT_FUNCTION = functionName; _ret = _this call ##function; ACE_STACK_DEPTH = ACE_STACK_DEPTH - 1; ACE_IS_ERRORED = false; _ret;} -#define DUMPSTACK ([__FILE__, __LINE__] call ACE_DUMPSTACK_FNC) - -#define FUNC(var1) {private ['_ret']; if(ACE_IS_ERRORED) then { ['AUTO','AUTO'] call ACE_DUMPSTACK_FNC; ACE_IS_ERRORED = false; }; ACE_IS_ERRORED = true; ACE_STACK_TRACE set [ACE_STACK_DEPTH, [diag_tickTime, __FILE__, __LINE__, ACE_CURRENT_FUNCTION, 'TRIPLES(ADDON,fnc,var1)', _this]]; ACE_STACK_DEPTH = ACE_STACK_DEPTH + 1; ACE_CURRENT_FUNCTION = 'TRIPLES(ADDON,fnc,var1)'; _ret = _this call TRIPLES(ADDON,fnc,var1); ACE_STACK_DEPTH = ACE_STACK_DEPTH - 1; ACE_IS_ERRORED = false; _ret;} -#define EFUNC(var1,var2) {private ['_ret']; if(ACE_IS_ERRORED) then { ['AUTO','AUTO'] call ACE_DUMPSTACK_FNC; ACE_IS_ERRORED = false; }; ACE_IS_ERRORED = true; ACE_STACK_TRACE set [ACE_STACK_DEPTH, [diag_tickTime, __FILE__, __LINE__, ACE_CURRENT_FUNCTION, 'TRIPLES(DOUBLES(PREFIX,var1),fnc,var2)', _this]]; ACE_STACK_DEPTH = ACE_STACK_DEPTH + 1; ACE_CURRENT_FUNCTION = 'TRIPLES(DOUBLES(PREFIX,var1),fnc,var2)'; _ret = _this call TRIPLES(DOUBLES(PREFIX,var1),fnc,var2); ACE_STACK_DEPTH = ACE_STACK_DEPTH - 1; ACE_IS_ERRORED = false; _ret;} - + #define FUNC(var1) {private ['_ret']; if(ACE_IS_ERRORED) then { ['AUTO','AUTO'] call ACE_DUMPSTACK_FNC; ACE_IS_ERRORED = false; }; ACE_IS_ERRORED = true; ACE_STACK_TRACE set [ACE_STACK_DEPTH, [diag_tickTime, __FILE__, __LINE__, ACE_CURRENT_FUNCTION, 'TRIPLES(ADDON,fnc,var1)', _this]]; ACE_STACK_DEPTH = ACE_STACK_DEPTH + 1; ACE_CURRENT_FUNCTION = 'TRIPLES(ADDON,fnc,var1)'; _ret = _this call TRIPLES(ADDON,fnc,var1); ACE_STACK_DEPTH = ACE_STACK_DEPTH - 1; ACE_IS_ERRORED = false; _ret;} + #define EFUNC(var1,var2) {private ['_ret']; if(ACE_IS_ERRORED) then { ['AUTO','AUTO'] call ACE_DUMPSTACK_FNC; ACE_IS_ERRORED = false; }; ACE_IS_ERRORED = true; ACE_STACK_TRACE set [ACE_STACK_DEPTH, [diag_tickTime, __FILE__, __LINE__, ACE_CURRENT_FUNCTION, 'TRIPLES(DOUBLES(PREFIX,var1),fnc,var2)', _this]]; ACE_STACK_DEPTH = ACE_STACK_DEPTH + 1; ACE_CURRENT_FUNCTION = 'TRIPLES(DOUBLES(PREFIX,var1),fnc,var2)'; _ret = _this call TRIPLES(DOUBLES(PREFIX,var1),fnc,var2); ACE_STACK_DEPTH = ACE_STACK_DEPTH - 1; ACE_IS_ERRORED = false; _ret;} #else -#define CALLSTACK(function) function -#define CALLSTACK_NAMED(function, functionName) function -#define DUMPSTACK - -#define FUNC(var1) TRIPLES(ADDON,fnc,var1) -#define EFUNC(var1,var2) TRIPLES(DOUBLES(PREFIX,var1),fnc,var2) - + #define CALLSTACK(function) function + #define CALLSTACK_NAMED(function, functionName) function + #define DUMPSTACK #endif @@ -32,7 +26,7 @@ PERFORMANCE COUNTERS SECTION #ifdef ENABLE_PERFORMANCE_COUNTERS #define CBA_fnc_addPerFrameHandler { _ret = [(_this select 0), (_this select 1), (_this select 2), #function] call CBA_fnc_addPerFrameHandler; if(isNil "ACE_PFH_COUNTER" ) then { ACE_PFH_COUNTER=[]; }; ACE_PFH_COUNTER pushBack [[_ret, __FILE__, __LINE__], [(_this select 0), (_this select 1), (_this select 2)]]; _ret } - + #define CREATE_COUNTER(x) if(isNil "ACE_COUNTERS" ) then { ACE_COUNTERS=[]; }; GVAR(DOUBLES(x,counter))=[]; GVAR(DOUBLES(x,counter)) set[0, QUOTE(GVAR(DOUBLES(x,counter)))]; GVAR(DOUBLES(x,counter)) set[1, diag_tickTime]; ACE_COUNTERS pushBack GVAR(DOUBLES(x,counter)); #define BEGIN_COUNTER(x) if(isNil QUOTE(GVAR(DOUBLES(x,counter)))) then { CREATE_COUNTER(x) }; GVAR(DOUBLES(x,counter)) set[2, diag_tickTime]; #define END_COUNTER(x) GVAR(DOUBLES(x,counter)) pushBack [(GVAR(DOUBLES(x,counter)) select 2), diag_tickTime]; @@ -43,4 +37,4 @@ PERFORMANCE COUNTERS SECTION #define BEGIN_COUNTER(x) /* disabled */ #define END_COUNTER(x) /* disabled */ #define DUMP_COUNTERS /* disabled */ -#endif \ No newline at end of file +#endif diff --git a/addons/main/script_macros.hpp b/addons/main/script_macros.hpp index c2ecab058b..a65d126110 100644 --- a/addons/main/script_macros.hpp +++ b/addons/main/script_macros.hpp @@ -1,17 +1,9 @@ #include "\x\cba\addons\main\script_macros_common.hpp" #include "\x\cba\addons\xeh\script_xeh.hpp" -//Faster Array Unwraping (skips the IS_ARRAY check normaly found in EXPLODE_1_SYS) -#undef EXPLODE_2_SYS -#define EXPLODE_1_SYS_FAST(ARRAY,A) A =(ARRAY) select 0 -#define EXPLODE_2_SYS(ARRAY,A,B) EXPLODE_1_SYS_FAST(ARRAY,A); B = (ARRAY) select 1 - // Default versioning level #define DEFAULT_VERSIONING_LEVEL 2 -#define EGVAR(module,var) TRIPLES(PREFIX,module,var) -#define QEGVAR(module,var) QUOTE(EGVAR(module,var)) - #define DGVAR(varName) if(isNil "ACE_DEBUG_NAMESPACE") then { ACE_DEBUG_NAMESPACE = []; }; if(!(QUOTE(GVAR(varName)) in ACE_DEBUG_NAMESPACE)) then { PUSH(ACE_DEBUG_NAMESPACE, QUOTE(GVAR(varName))); }; GVAR(varName) #define DVAR(varName) if(isNil "ACE_DEBUG_NAMESPACE") then { ACE_DEBUG_NAMESPACE = []; }; if(!(QUOTE(varName) in ACE_DEBUG_NAMESPACE)) then { PUSH(ACE_DEBUG_NAMESPACE, QUOTE(varName)); }; varName #define DFUNC(var1) TRIPLES(ADDON,fnc,var1) @@ -22,14 +14,6 @@ #define PATHTOEF(var1,var2) PATHTOF_SYS(PREFIX,var1,var2) -#ifndef STRING_MACROS_GUARD -#define STRING_MACROS_GUARD - #define LSTRING(var1) QUOTE(TRIPLES(STR,ADDON,var1)) - #define ELSTRING(var1,var2) QUOTE(TRIPLES(STR,DOUBLES(PREFIX,var1),var2)) - #define CSTRING(var1) QUOTE(TRIPLES($STR,ADDON,var1)) - #define ECSTRING(var1,var2) QUOTE(TRIPLES($STR,DOUBLES(PREFIX,var1),var2)) -#endif - #define GETVAR_SYS(var1,var2) getVariable [ARR_2(QUOTE(var1),var2)] #define SETVAR_SYS(var1,var2) setVariable [ARR_2(QUOTE(var1),var2)] #define SETPVAR_SYS(var1,var2) setVariable [ARR_3(QUOTE(var1),var2,true)] diff --git a/addons/main/script_mod.hpp b/addons/main/script_mod.hpp index c87a23aba2..6345950d8b 100644 --- a/addons/main/script_mod.hpp +++ b/addons/main/script_mod.hpp @@ -5,13 +5,11 @@ #define MAJOR 3 #define MINOR 3 -#define PATCHLVL 2 +#define PATCHLVL 3 #define BUILD 0 #define VERSION MAJOR.MINOR.PATCHLVL.BUILD #define VERSION_AR MAJOR,MINOR,PATCHLVL,BUILD -#define ACE_TAG A.C.E. - // MINIMAL required version for the Mod. Components can specify others.. -#define REQUIRED_VERSION 0.5 +#define REQUIRED_VERSION 1.52 diff --git a/addons/map/CfgAmmo.hpp b/addons/map/CfgAmmo.hpp index 805e7b3627..9e98d0efea 100644 --- a/addons/map/CfgAmmo.hpp +++ b/addons/map/CfgAmmo.hpp @@ -6,7 +6,7 @@ class CfgAmmo { class F_20mm_White: FlareBase {}; class ACE_FlashlightProxy_White: F_20mm_White { - model = ""; + model = "\A3\Weapons_f\empty"; effectFlare = "FlareShell"; triggerTime = 0; diff --git a/addons/map/CfgVehicles.hpp b/addons/map/CfgVehicles.hpp index 7906de8bb7..720d4e8a7b 100644 --- a/addons/map/CfgVehicles.hpp +++ b/addons/map/CfgVehicles.hpp @@ -23,6 +23,7 @@ class CfgVehicles { function = QFUNC(moduleMap); scope = 2; isGlobal = 1; + isSingular = 1; icon = PATHTOF(UI\Icon_Module_Map_ca.paa); class Arguments { class MapIllumination { @@ -82,6 +83,7 @@ class CfgVehicles { function = QFUNC(blueForceTrackingModule); scope = 2; isGlobal = 0; + isSingular = 1; icon = PATHTOF(UI\Icon_Module_BFTracking_ca.paa); class Arguments { class Enabled { diff --git a/addons/map/XEH_postInitClient.sqf b/addons/map/XEH_postInitClient.sqf index c162f8802d..a89e3fb8e3 100644 --- a/addons/map/XEH_postInitClient.sqf +++ b/addons/map/XEH_postInitClient.sqf @@ -1,5 +1,22 @@ #include "script_component.hpp" +//Delete map glow lights from disconnecting players #2810 +if (isServer) then { + addMissionEventHandler ["HandleDisconnect",{ + params ["_disconnectedPlayer"]; + + if ((!GVAR(mapGlow)) || {isNull _disconnectedPlayer}) exitWith {}; + { + if (_x isKindOf "ACE_FlashlightProxy_White") then { + // ACE_LOGINFO_2("Deleting leftover light [%1:%2] from DC player [%3]", _x, typeOf _x, _disconnectedPlayer); + deleteVehicle _x; + }; + } forEach attachedObjects _disconnectedPlayer; + + nil + }]; +}; + // Exit on Headless as well if (!hasInterface) exitWith {}; diff --git a/addons/map/functions/fnc_determineMapLight.sqf b/addons/map/functions/fnc_determineMapLight.sqf index 8204b4b7f8..01f3882f1f 100644 --- a/addons/map/functions/fnc_determineMapLight.sqf +++ b/addons/map/functions/fnc_determineMapLight.sqf @@ -26,7 +26,7 @@ _fnc_blendColor = { (_c1 select 3) * (1 - _alpha) + (_c2 select 3) * _alpha] }; -// Ambient light tint depending on ACE_time of day +// Ambient light tint depending on time of day _lightTint = switch (true) do { case (sunOrMoon == 1.0) : { [0.5,0.5,0.5,1] }; case (sunOrMoon > 0.80) : {[[1.0 - overcast,0.2,0,1], [1,1,1,1], (sunOrMoon - 0.8)/0.2] call _fnc_blendColor}; diff --git a/addons/map/stringtable.xml b/addons/map/stringtable.xml index 0488a13493..8eab673caf 100644 --- a/addons/map/stringtable.xml +++ b/addons/map/stringtable.xml @@ -259,10 +259,14 @@ Set Channel At Start Ust. domyślny kanał + Definir canal no início + Установить канал на старте Change the starting marker channel at mission start Ustaw domyślny kanał dla markerów przy starcie misji + Muda o canal do marcador no início da missão + Изменить начальный канал для установки маркеров при запуске миссии \ No newline at end of file diff --git a/addons/map_gestures/CfgVehicles.hpp b/addons/map_gestures/CfgVehicles.hpp index f5c2ae8f38..d4c88883e6 100644 --- a/addons/map_gestures/CfgVehicles.hpp +++ b/addons/map_gestures/CfgVehicles.hpp @@ -6,11 +6,13 @@ class CfgVehicles { displayName = CSTRING(moduleSettings_displayName); function = QFUNC(moduleSettings); isGlobal = 0; + isSingular = 1; author = ECSTRING(common,ACETeam); icon = PATHTOF(ui\icon_module_map_gestures_ca.paa); class Arguments { class enabled { displayName = CSTRING(enabled_DisplayName); + description = CSTRING(enabled_description); typeName = "BOOL"; defaultValue = 1; }; @@ -18,7 +20,7 @@ class CfgVehicles { displayName = CSTRING(maxRange_displayName); description = CSTRING(maxRange_description); typeName = "NUMBER"; - defaultValue = 4; + defaultValue = 7; }; class interval { displayName = CSTRING(interval_displayName); @@ -30,13 +32,13 @@ class CfgVehicles { displayName = CSTRING(defaultLeadColor_displayName); description = CSTRING(defaultLeadColor_description); typeName = "STRING"; - defaultValue = "0,0,0,0"; + defaultValue = "1,0.88,0,0.95"; }; class defaultColor { displayName = CSTRING(defaultColor_displayName); description = CSTRING(defaultColor_description); typeName = "STRING"; - defaultValue = "0,0,0,0"; + defaultValue = "1,0.88,0,0.7"; }; }; }; @@ -53,13 +55,13 @@ class CfgVehicles { displayName = CSTRING(leadColor_displayName); description = CSTRING(leadColor_description); typeName = "STRING"; - defaultValue = "0,0,0,0"; + defaultValue = "1,0.88,0,0.95"; }; class color { displayName = CSTRING(color_displayName); description = CSTRING(color_description); typeName = "STRING"; - defaultValue = "0,0,0,0"; + defaultValue = "1,0.88,0,0.7"; }; }; }; diff --git a/addons/map_gestures/XEH_postInit.sqf b/addons/map_gestures/XEH_postInit.sqf index 777463e86a..233ee23c04 100644 --- a/addons/map_gestures/XEH_postInit.sqf +++ b/addons/map_gestures/XEH_postInit.sqf @@ -1,8 +1,13 @@ #include "script_component.hpp" +if (["STMapGestures"] call EFUNC(common,isModLoaded)) exitWith { + ACE_LOGWARNING("st_map_gestures is installed - exiting [remove st_map_gestures.pbo to allow ace version]"); +}; + if (!hasInterface) exitWith {}; ["SettingsInitialized", { + if (!GVAR(enabled)) exitWith {}; [{ if (isNull (findDisplay 12)) exitWith {}; diff --git a/addons/map_gestures/functions/fnc_moduleSettings.sqf b/addons/map_gestures/functions/fnc_moduleSettings.sqf index 99583074fc..56d3235d03 100644 --- a/addons/map_gestures/functions/fnc_moduleSettings.sqf +++ b/addons/map_gestures/functions/fnc_moduleSettings.sqf @@ -17,8 +17,6 @@ */ #include "script_component.hpp" -private ["_defaultColor", "_defaultLeadColor"]; - params ["_logic", "", "_activated"]; if (!_activated || !isServer) exitWith {}; @@ -27,11 +25,19 @@ if (!_activated || !isServer) exitWith {}; [_logic, QGVAR(maxRange), "maxRange"] call EFUNC(common,readSettingFromModule); [_logic, QGVAR(interval), "interval"] call EFUNC(common,readSettingFromModule); -_defaultLeadColor = call compile ("[" + (_logic getVariable ["defaultLeadColor", ""]) + "]"); -if (!([_defaultLeadColor] call FUNC(isValidColorArray))) exitWith {ERROR("defaultLeadColor is not a valid color array.")}; +//For default fallback colors, setting to empty ("") will not force on clients +private _defaultLeadColor = _logic getVariable ["defaultLeadColor", ""]; +if (_defaultLeadColor != "") then { + _defaultLeadColor = call compile ("[" + _defaultLeadColor + "]"); + if (!([_defaultLeadColor] call FUNC(isValidColorArray))) exitWith {ERROR("defaultLeadColor is not a valid color array.")}; + [QGVAR(defaultLeadColor), _defaultLeadColor, true, true] call EFUNC(common,setSetting); +}; -_defaultColor = call compile ("[" + (_logic getVariable ["defaultColor", ""]) + "]"); -if (!([_defaultColor] call FUNC(isValidColorArray))) exitWith {ERROR("defaultColor is not a valid color array.")}; +private _defaultColor = _logic getVariable ["defaultColor", ""]; +if (_defaultColor != "") then { + _defaultColor = call compile ("[" + _defaultColor + "]"); + if (!([_defaultColor] call FUNC(isValidColorArray))) exitWith {ERROR("defaultColor is not a valid color array.")}; + [QGVAR(defaultColor), _defaultColor, true, true] call EFUNC(common,setSetting); +}; -[QGVAR(defaultLeadColor), _defaultLeadColor, false, true] call EFUNC(common,setSetting); -[QGVAR(defaultColor), _defaultColor, false, true] call EFUNC(common,setSetting); +ACE_LOGINFO("Map Gestures Module Initialized."); diff --git a/addons/map_gestures/stringtable.xml b/addons/map_gestures/stringtable.xml index e5eab426a3..83ff9c4a86 100644 --- a/addons/map_gestures/stringtable.xml +++ b/addons/map_gestures/stringtable.xml @@ -3,96 +3,118 @@ Map Gestures + Gestos no mapa + Жесты на карте Enabled + Ativado + Включено Map Gesture Max Range + Distância para gestos no mapa + Макс. дистанция жестов на карте Max range between players to show the map gesture indicator [default: 7 meters] - - - Lead Default Alpha - - - Fallback Alpha value for group leaders. - - - Default Alpha - - - Fallback Alpha value. + Distância max. entre os jogadores para mostrar o indicador de gesto no mapa [padrão: 7 metros] + Макс. дистанция между игроками для отображения жестов на карте [по-умолчанию: 7 метров] Lead Default Color + Cor padrão para o líder + Лид. цвет по-умолчанию - Fallback Color value for group leaders. + Fallback Color value for group leaders when there is no group setting. [Module: leave blank to not force on clients] + Valor de cor alternativa para líderes de grupo + Значение цвета для лидеров групп. Default Color + Cor padrão + Цвет по-умолчанию - Fallback Color value. - - - Lead Alpha - - - Alpha value for group leaders of groups synced with this module. - - - Alpha - - - Alpha value for group members of groups synced with this module. + Fallback Color value when there is no group setting. [Module: leave blank to not force on clients] + Valor alternativo de cor + Значение цвета. Lead Color + Cor do líder + Лид. цвет Color value for group leaders of groups synced with this module. + Valor de cor para líderes de grupo sincronizados com este módulo. + Значение цвета для лидеров групп, которые [группы] синхронизированы с этим модулем. Color + Cor + Цвет Color value for group members of groups synced with this module. + Valor de cor para membros de grupo sincronizados com este módulo. + Значение цвета для членов групп, которые [группы] синхронизированы с этим модулем. Map Gestures - Group Settings + Gestos no mapa - Definições de Grupo + Жесты на карте - настройки групп Update Interval + Intervalo de atualizações + Интервал обновления Time between data updates. + Tempo entre atualização de dados + Время между обновлениями данных. Group color configurations + Configurações de cores de grupo + Конфигурация цвета групп Group color configuration containing arrays of color pairs ([leadColor, color]). + Configuração de cores de grupo contendo arrays com pares de cores ([leadColor, color]). + Конфигурация цвета групп содержит массив цветовых пар ([лид. цвет, цвет]). Hash of Group ID mapped to the Group color configuration index. + Hashes de ID de grupos mapeados para o índice de configuração de cor de grupos. + Хеш ID групп, соответствующих индексам конфигурации цвета групп. GroupID Color configuration mapping + Mapeamento de configuração para cores de GroupID + Соответствие ID групп конфигурации цвета групп Enables the Map Gestures. + Ativa os gestos no mapa + Включает указания на карте. Name Text Color + Cor do texto do nome + Цвет текста имени Color of the name tag text besides the map gestures mark. + Cor do texto da etiqueta de nome que fica embaixo da marcação de gestos no mapa. + Цвет инмени игрока рядом с маркером жестов. Map Gestures + Gestos no mapa + Жесты на карте diff --git a/addons/medical/ACE_Settings.hpp b/addons/medical/ACE_Settings.hpp index b17610b0e3..02b5375e96 100644 --- a/addons/medical/ACE_Settings.hpp +++ b/addons/medical/ACE_Settings.hpp @@ -154,13 +154,13 @@ class ACE_Settings { category = CSTRING(Category_Medical); typeName = "SCALAR"; value = 3; - values[] = {"Anywhere", "Medical vehicles", "Medical facility", "vehicle & facility", "Disabled"}; + values[] = {CSTRING(AdvancedMedicalSettings_anywhere), CSTRING(AdvancedMedicalSettings_vehicle), CSTRING(AdvancedMedicalSettings_facility), CSTRING(AdvancedMedicalSettings_vehicleAndFacility), ECSTRING(common,Disabled)}; }; class GVAR(useLocation_SurgicalKit) { category = CSTRING(Category_Medical); typeName = "SCALAR"; value = 2; - values[] = {"Anywhere", "Medical vehicles", "Medical facility", "vehicle & facility", "Disabled"}; + values[] = {CSTRING(AdvancedMedicalSettings_anywhere), CSTRING(AdvancedMedicalSettings_vehicle), CSTRING(AdvancedMedicalSettings_facility), CSTRING(AdvancedMedicalSettings_vehicleAndFacility), ECSTRING(common,Disabled)}; }; class GVAR(useCondition_PAK) { category = CSTRING(Category_Medical); diff --git a/addons/medical/CfgVehicles.hpp b/addons/medical/CfgVehicles.hpp index 3a675e9258..351d285c7e 100644 --- a/addons/medical/CfgVehicles.hpp +++ b/addons/medical/CfgVehicles.hpp @@ -17,6 +17,7 @@ class CfgVehicles { function = QUOTE(DFUNC(moduleMedicalSettings)); functionPriority = 1; isGlobal = 1; + isSingular = 1; isTriggerActivated = 0; author = ECSTRING(common,ACETeam); @@ -153,6 +154,7 @@ class CfgVehicles { function = QUOTE(FUNC(moduleAdvancedMedicalSettings)); functionPriority = 10; isGlobal = 2; + isSingular = 1; isTriggerActivated = 0; isDisposable = 0; author = ECSTRING(common,ACETeam); @@ -274,6 +276,7 @@ class CfgVehicles { function = QUOTE(DFUNC(moduleReviveSettings)); functionPriority = 1; isGlobal = 1; + isSingular = 1; isTriggerActivated = 0; author = ECSTRING(common,ACETeam); diff --git a/addons/medical/XEH_preInit.sqf b/addons/medical/XEH_preInit.sqf index 2625bf4b8a..9563752d92 100644 --- a/addons/medical/XEH_preInit.sqf +++ b/addons/medical/XEH_preInit.sqf @@ -70,6 +70,7 @@ PREP(setDead); PREP(setHitPointDamage); PREP(setStructuralDamage); PREP(setUnconscious); +PREP(translateSelections); PREP(treatment); PREP(treatment_failure); PREP(treatment_success); diff --git a/addons/medical/XEH_respawn.sqf b/addons/medical/XEH_respawn.sqf index b5b07bf141..438e7396cc 100644 --- a/addons/medical/XEH_respawn.sqf +++ b/addons/medical/XEH_respawn.sqf @@ -10,7 +10,7 @@ if (!(_unit getVariable ["ACE_isUnconscious", false])) then { [_unit, QGVAR(unconscious), false] call EFUNC(common,setCaptivityStatus); }; -// Remove maximum unconsciousness ACE_time handler +// Remove maximum unconsciousness time handler _maxUnconHandle = _unit getVariable [QGVAR(maxUnconTimeHandle), -1]; if (_maxUnconHandle > 0) then { [_maxUnconHandle] call CBA_fnc_removePerFrameHandler; diff --git a/addons/medical/functions/fnc_addHeartRateAdjustment.sqf b/addons/medical/functions/fnc_addHeartRateAdjustment.sqf index 7171eee275..9f2e7a8bf9 100644 --- a/addons/medical/functions/fnc_addHeartRateAdjustment.sqf +++ b/addons/medical/functions/fnc_addHeartRateAdjustment.sqf @@ -5,7 +5,7 @@ * Arguments: * 0: The unit * 1: value - * 2: ACE_time in seconds + * 2: time in seconds * 3: callback * * Return Value: diff --git a/addons/medical/functions/fnc_canTreat.sqf b/addons/medical/functions/fnc_canTreat.sqf index ba6ced0486..60685ee20a 100644 --- a/addons/medical/functions/fnc_canTreat.sqf +++ b/addons/medical/functions/fnc_canTreat.sqf @@ -11,6 +11,9 @@ * ReturnValue: * Can Treat * + * Example: + * [player, cursorTarget, "Head", "SurgicalKit"] call ace_medical_fnc_canTreat + * * Public: Yes */ @@ -85,10 +88,11 @@ _medVeh = {([_caller] call FUNC(isInMedicalVehicle)) || ([_target] call FUNC(isI _val = missionNamespace getvariable _x; if (typeName _val == "SCALAR") then { _return = switch (_val) do { - case 0: {true}; - case 1: _medVeh; - case 2: _medFacility; - case 3: {call _medFacility || call _medVeh}; + case 0: {true}; //AdvancedMedicalSettings_anywhere + case 1: {call _medVeh}; //AdvancedMedicalSettings_vehicle + case 2: {call _medFacility}; //AdvancedMedicalSettings_facility + case 3: {(call _medFacility) || {call _medVeh}}; //AdvancedMedicalSettings_vehicleAndFacility + default {false}; //Disabled }; }; }; diff --git a/addons/medical/functions/fnc_createLitter.sqf b/addons/medical/functions/fnc_createLitter.sqf index c234574abc..54fd6694dd 100644 --- a/addons/medical/functions/fnc_createLitter.sqf +++ b/addons/medical/functions/fnc_createLitter.sqf @@ -45,12 +45,9 @@ _createLitter = { if(surfaceIsWater (getPos _unit)) exitWith { false }; _position = getPosATL _unit; - _position params ["_posX", "_posY"]; - _position = if (random(1) >= 0.5) then { - [_posX + random 1, _posY + random 1, 0] - } else { - [_posX - random 1, _posY - random 1, 0]; - }; + _position params ["_posX", "_posY", "_posZ"]; + _position = [_posX + (random 2) - 1, _posY + (random 2) - 1, _posZ]; + _direction = (random 360); // Create the litter, and timeout the event based on the cleanup delay diff --git a/addons/medical/functions/fnc_displayPatientInformation.sqf b/addons/medical/functions/fnc_displayPatientInformation.sqf index f73376cb29..222de4463f 100644 --- a/addons/medical/functions/fnc_displayPatientInformation.sqf +++ b/addons/medical/functions/fnc_displayPatientInformation.sqf @@ -54,7 +54,7 @@ if (_show) then { _allInjuryTexts = []; _genericMessages = []; - if (GVAR(level) >= 2) then { + if (GVAR(level) >= 2 && {([_unit] call FUNC(hasMedicalEnabled))}) then { _partText = [LSTRING(Head), LSTRING(Torso), LSTRING(LeftArm) ,LSTRING(RightArm) ,LSTRING(LeftLeg), LSTRING(RightLeg)] select _selectionN; _genericMessages pushback [localize _partText, [1, 1, 1, 1]]; }; @@ -87,7 +87,7 @@ if (_show) then { _damaged = [false, false, false, false, false, false]; _selectionBloodLoss = [0,0,0,0,0,0]; - if (GVAR(level) >= 2) then { + if (GVAR(level) >= 2 && {([_target] call FUNC(hasMedicalEnabled))}) then { _openWounds = _target getvariable [QGVAR(openWounds), []]; private "_amountOf"; { diff --git a/addons/medical/functions/fnc_handleDamage.sqf b/addons/medical/functions/fnc_handleDamage.sqf index afcf6e12e5..6d955e72fd 100644 --- a/addons/medical/functions/fnc_handleDamage.sqf +++ b/addons/medical/functions/fnc_handleDamage.sqf @@ -16,7 +16,7 @@ */ #include "script_component.hpp" -params ["_unit", "_selection", "_damage", "_shooter", "_projectile"]; +params ["_unit", "_selection", "_damage", "_shooter", "_projectile", "_hitPointIndex"]; TRACE_5("ACE_DEBUG: HandleDamage Called",_unit, _selection, _damage, _shooter, _projectile); // bug, apparently can fire for remote units in special cases @@ -39,6 +39,13 @@ TRACE_3("ACE_DEBUG: HandleDamage",_selection,_damage,_unit); if (_selection == "hands") exitWith {_unit getHit "hands"}; if (_selection == "legs") exitWith {_unit getHit "legs"}; +// Deal with the new hitpoint and selection names introduced with Arma v1.50 and later. +// This will convert new selection names into selection names that the medical system understands +// TODO This should be cleaned up when we revisit the medical system at a later stage +// and instead we should deal with the new hitpoints directly +_selection = [_unit, _selection, _hitPointIndex] call FUNC(translateSelections); +_this set [1, _selection]; // ensure that the parameters are set correctly + // If the damage is being weird, we just tell it to fuck off. Ignore: "hands", "legs", "?" if (_selection != "" && {!(_selection in GVAR(SELECTIONS))}) exitWith {0}; //@todo "neck", "pelvis", "spine1", "spine2", "spine3" diff --git a/addons/medical/functions/fnc_modifyMedicalAction.sqf b/addons/medical/functions/fnc_modifyMedicalAction.sqf index 8feaa7bfca..d16ab762d5 100644 --- a/addons/medical/functions/fnc_modifyMedicalAction.sqf +++ b/addons/medical/functions/fnc_modifyMedicalAction.sqf @@ -19,7 +19,7 @@ params ["_target", "_player", "_selectionN", "_actionData"]; -if (GVAR(level) < 2) exitwith { +if (GVAR(level) < 2 || {!([_target] call FUNC(hasMedicalEnabled))}) exitwith { private ["_pointDamage"]; _pointDamage = (_target getvariable [QGVAR(bodyPartStatus), [0,0,0,0,0,0]]) select _selectionN; diff --git a/addons/medical/functions/fnc_onMedicationUsage.sqf b/addons/medical/functions/fnc_onMedicationUsage.sqf index db4ba737ea..6bef38fa27 100644 --- a/addons/medical/functions/fnc_onMedicationUsage.sqf +++ b/addons/medical/functions/fnc_onMedicationUsage.sqf @@ -7,7 +7,7 @@ * 1: Medication Treatment classname * 2: The medication treatment variablename * 3: Max dosage - * 4: The ACE_time in the system + * 4: The time in the system * 5: Incompatable medication > * * Return Value: diff --git a/addons/medical/functions/fnc_playInjuredSound.sqf b/addons/medical/functions/fnc_playInjuredSound.sqf index ddf107c840..4792f879ec 100644 --- a/addons/medical/functions/fnc_playInjuredSound.sqf +++ b/addons/medical/functions/fnc_playInjuredSound.sqf @@ -1,7 +1,7 @@ /* * Author: Glowbal * Play the injured sound for a unit if the unit is damaged. The sound broadcasted across MP. - * Will not play if the unit has already played a sound within to close a ACE_time frame. + * Will not play if the unit has already played a sound within to close a time frame. * Delay: With minimal damage (below 1), the delay is (10 + random(50)) seconds. Otherwise it is 60 seconds / damage. * * Arguments: diff --git a/addons/medical/functions/fnc_setUnconscious.sqf b/addons/medical/functions/fnc_setUnconscious.sqf index cb9fff0693..aac48a8641 100644 --- a/addons/medical/functions/fnc_setUnconscious.sqf +++ b/addons/medical/functions/fnc_setUnconscious.sqf @@ -5,7 +5,7 @@ * Arguments: * 0: The unit that will be put in an unconscious state * 1: Set unconsciouns (default: true) - * 2: Minimum unconscious ACE_time (default: (round(random(10)+5))) + * 2: Minimum unconscious time (default: (round(random(10)+5))) * 3: Force AI Unconscious (skip random death chance) (default: false) * * ReturnValue: diff --git a/addons/medical/functions/fnc_translateSelections.sqf b/addons/medical/functions/fnc_translateSelections.sqf new file mode 100644 index 0000000000..f2fe4c1de9 --- /dev/null +++ b/addons/medical/functions/fnc_translateSelections.sqf @@ -0,0 +1,63 @@ +/* + * Author: Glowbal + * Translate selection names into medical usable hit selection names. + * Aims to deal with the new hitpoint system introduced in Arma3 v1.50 and later. + * + * Arguments: + * 0: Unit + * 1: selection name + * 2: HitPoint Index + * + * Return Value: + * translated selection name + * + * Example: + * [bob, "pelvis", 4] call ace_medical_fnc_translateSelections + * Returns "body" + * + * Public: No + */ +#include "script_component.hpp" + +#define HEAD_SELECTIONS ["face_hub", "neck", "head"] +#define HEAD_HITPOINTS ["hitface", "hitneck", "hithead"] +#define TORSO_SELECTIONS ["pelvis", "spine1", "spine2", "spine3", "body"] +#define TORSO_HITPOINTS ["hitpelvis", "hitabdomen", "hitdiaphragm", "hitchest", "hitbody"] +#define L_ARM_SELECTIONS ["hand_l"] +#define L_ARM_HITPOINTS ["hitleftarm", "hand_l"] +#define R_ARM_SELECTIONS ["hand_r"] +#define R_ARM_HITPOINTS ["hitrightarm", "hand_r"] +#define L_LEG_SELECTIONS ["leg_l"] +#define L_LEG_HITPOINTS ["hitleftleg", "leg_l"] +#define R_LEG_SELECTIONS ["leg_r"] +#define R_LEG_HITPOINTS ["hitrightleg", "leg_r"] + +params ["_unit", "_selection", "_hitPointIndex"]; + +if (_selection == "") exitWith {""}; +if (_selection in HEAD_SELECTIONS) exitWith {"head"}; +if (_selection in TORSO_SELECTIONS) exitWith {"body"}; + +// Not necessary unless we get more hitpoints variants in an next arma update +/*if (_selection in L_ARM_SELECTIONS) exitwith {"hand_l"}; +if (_selection in R_ARM_SELECTIONS) exitwith {"hand_r"}; +if (_selection in L_LEG_SELECTIONS) exitwith {"leg_l"}; +if (_selection in R_LEG_SELECTIONS) exitwith {"leg_r"};*/ + +//Backup method to detect weird selections/hitpoints +if ((_selection == "?") || {!(_selection in GVAR(SELECTIONS))}) exitWith { + if (_hitPointIndex < 0) exitWith {_selection}; + private _hitPoint = toLower configName ((configProperties [(configFile >> "CfgVehicles" >> (typeOf _unit) >> "HitPoints")]) select _hitPointIndex); + TRACE_4("Weird sel/hit", _unit, _selection, _hitPointIndex, _hitPoint); + + if (_hitPoint in HEAD_HITPOINTS) exitWith {"head"}; + if (_hitPoint in TORSO_HITPOINTS) exitWith {"body"}; + if (_hitPoint in L_ARM_HITPOINTS) exitWith {"hand_l"}; + if (_hitPoint in R_ARM_HITPOINTS) exitWith {"hand_r"}; + if (_hitPoint in L_LEG_HITPOINTS) exitWith {"leg_l"}; + if (_hitPoint in R_LEG_HITPOINTS) exitWith {"leg_r"}; + + _selection +}; + +_selection; diff --git a/addons/medical/functions/fnc_treatment.sqf b/addons/medical/functions/fnc_treatment.sqf index 5e97e31501..2d0e44d488 100644 --- a/addons/medical/functions/fnc_treatment.sqf +++ b/addons/medical/functions/fnc_treatment.sqf @@ -100,10 +100,11 @@ if ("All" in _locations) then { _val = missionNamespace getvariable _x; if (typeName _val == "SCALAR") then { _return = switch (_val) do { - case 0: {true}; - case 1: _medVeh; - case 2: _medFacility; - case 3: {call _medFacility || call _medVeh}; + case 0: {true}; //AdvancedMedicalSettings_anywhere + case 1: {call _medVeh}; //AdvancedMedicalSettings_vehicle + case 2: {call _medFacility}; //AdvancedMedicalSettings_facility + case 3: {(call _medFacility) || {call _medVeh}}; //AdvancedMedicalSettings_vehicleAndFacility + default {false}; //Disabled }; }; }; diff --git a/addons/medical/functions/fnc_treatmentAdvanced_bandage.sqf b/addons/medical/functions/fnc_treatmentAdvanced_bandage.sqf index aa3669c227..cf18475866 100644 --- a/addons/medical/functions/fnc_treatmentAdvanced_bandage.sqf +++ b/addons/medical/functions/fnc_treatmentAdvanced_bandage.sqf @@ -19,6 +19,9 @@ #include "script_component.hpp" params ["_caller", "_target", "_selectionName", "_className", "_items", "", ["_specificSpot", -1]]; +[_target, "activity", LSTRING(Activity_bandagedPatient), [[_caller] call EFUNC(common,getName)]] call FUNC(addToLog); +[_target, "activity_view", LSTRING(Activity_bandagedPatient), [[_caller] call EFUNC(common,getName)]] call FUNC(addToLog); // TODO expand message + if !([_target] call FUNC(hasMedicalEnabled)) exitwith { _this call FUNC(treatmentBasic_bandage); }; @@ -30,7 +33,4 @@ if !([_target] call FUNC(hasMedicalEnabled)) exitwith { }; }foreach _items;*/ -[_target, "activity", LSTRING(Activity_bandagedPatient), [[_caller] call EFUNC(common,getName)]] call FUNC(addToLog); -[_target, "activity_view", LSTRING(Activity_bandagedPatient), [[_caller] call EFUNC(common,getName)]] call FUNC(addToLog); // TODO expand message - true; diff --git a/addons/medical/functions/fnc_treatmentAdvanced_medicationLocal.sqf b/addons/medical/functions/fnc_treatmentAdvanced_medicationLocal.sqf index 00a4fae8d9..c2797d825d 100644 --- a/addons/medical/functions/fnc_treatmentAdvanced_medicationLocal.sqf +++ b/addons/medical/functions/fnc_treatmentAdvanced_medicationLocal.sqf @@ -84,7 +84,7 @@ _resistance = _target getvariable [QGVAR(peripheralResistance), 100]; _resistance = _resistance + _viscosityChange; _target setvariable [QGVAR(peripheralResistance), _resistance max 0]; -// Call back to ensure that the medication is decreased over ACE_time +// Call back to ensure that the medication is decreased over time [_target, _classname, _varName, _maxDose, _timeInSystem, _inCompatableMedication, _viscosityChange, _painReduce] call FUNC(onMedicationUsage); true diff --git a/addons/medical/stringtable.xml b/addons/medical/stringtable.xml index 8b4282c555..5c3d03a85d 100644 --- a/addons/medical/stringtable.xml +++ b/addons/medical/stringtable.xml @@ -2105,10 +2105,13 @@ %1 wykonał cykl RKO %1 провел сердечно-легочную реанимацию %1 realicó RCP + %1 realizou RCP %1 used Personal Aid Kit %1 użył apteczki + %1 utilizou KPS + %1 использовал аптечку Heavily wounded @@ -2223,6 +2226,7 @@ Lecz w pełni zabandażowane hitpointy Curar miembros totalmente vendados Исцелять полностью перебинтованные части тела + Curar hitpoints totalmente enfaixados Pain is only temporarily suppressed @@ -2960,7 +2964,7 @@ Allow AI to go unconscious - Позволить ботам терять сознание + Позволить ботам терять сознание (вместо мгновенной смерти) Czy AI może być nieprzytomne od odniesionych obrażeń? Permita a la IA caer inconsciente KI kann bewusstlos werden @@ -3441,12 +3445,14 @@ Lecz hitpointy Curar puntos de vida Исцелять части тела + Curar hitpoints Heal fully bandaged hitpoints Po bandażowaniu ulecz hitpointy, usuwając z nich ślady krwi i przywracając im pełną sprawność. Curar miembros totalmente vendados Исцелять полностью перебинтованные части тела + Curar totalmente hitpoints enfaixados Pain suppression @@ -3844,12 +3850,14 @@ Ta osoba (%1) jest przytomna i nie może zostać załadowana Esta persona (%1) está despierto y no puede ser cargado Боец (%1) в сознании и не может быть погружен + Esta pessoa (%1) está acordada e não pode ser carregada There is no tourniquet on this body part! Na tej części ciała nie ma stazy! No hay torniquete en esta parte del cuerpo! Нет жгута на этой части тела! + Não existe nenhum torniquete nesta parte do corpo! - + \ No newline at end of file diff --git a/addons/medical_menu/ACE_Settings.hpp b/addons/medical_menu/ACE_Settings.hpp index 42bd80044f..d74a6bdfe0 100644 --- a/addons/medical_menu/ACE_Settings.hpp +++ b/addons/medical_menu/ACE_Settings.hpp @@ -24,4 +24,10 @@ class ACE_Settings { isClientSettable = 1; category = ECSTRING(medical,Category_Medical); }; + class GVAR(maxRange) { + //for ref: 3d interaction (MEDICAL_ACTION_DISTANCE) is 1.75 + value = 3; + typeName = "SCALAR"; + category = ECSTRING(medical,Category_Medical); + }; }; diff --git a/addons/medical_menu/CfgVehicles.hpp b/addons/medical_menu/CfgVehicles.hpp index 7bbe7db2ad..d2bbf55fd1 100644 --- a/addons/medical_menu/CfgVehicles.hpp +++ b/addons/medical_menu/CfgVehicles.hpp @@ -10,6 +10,7 @@ class CfgVehicles { function = QUOTE(DFUNC(module)); functionPriority = 1; isGlobal = 0; + isSingular = 1; isTriggerActivated = 0; author = ECSTRING(common,ACETeam); class Arguments { diff --git a/addons/medical_menu/XEH_postInit.sqf b/addons/medical_menu/XEH_postInit.sqf index eaf356f608..ad1acabdb3 100644 --- a/addons/medical_menu/XEH_postInit.sqf +++ b/addons/medical_menu/XEH_postInit.sqf @@ -2,6 +2,10 @@ if (!hasInterface) exitwith {}; +GVAR(MenuPFHID) = -1; +GVAR(lastOpenedOn) = -1; +GVAR(pendingReopen) = false; + ["medical_treatmentSuccess", { if (GVAR(openAfterTreatment) && {GVAR(pendingReopen)}) then { @@ -15,8 +19,9 @@ if (!hasInterface) exitwith {}; ["ACE3 Common", QGVAR(displayMenuKeyPressed), localize LSTRING(DisplayMenuKey), { - _target = cursorTarget; - if (!(_target isKindOf "CAManBase") || ACE_player distance _target > 10) then {_target = ACE_player}; + private _target = cursorTarget; + if (!((_target isKindOf "CAManBase") && {[ACE_player, _target] call FUNC(canOpenMenu)})) then {_target = ACE_player}; + // Conditions: canInteract if !([ACE_player, _target, ["isNotInside"]] call EFUNC(common,canInteractWith)) exitWith {false}; if !([ACE_player, _target] call FUNC(canOpenMenu)) exitwith {false}; @@ -27,7 +32,7 @@ if (!hasInterface) exitwith {}; }, { if (ACE_time - GVAR(lastOpenedOn) > 0.5) exitWith { - [ObjNull] call FUNC(openMenu); + [objNull] call FUNC(openMenu); }; false }, diff --git a/addons/medical_menu/functions/fnc_canOpenMenu.sqf b/addons/medical_menu/functions/fnc_canOpenMenu.sqf index 9b7c3bcbff..1ef7dccf5b 100644 --- a/addons/medical_menu/functions/fnc_canOpenMenu.sqf +++ b/addons/medical_menu/functions/fnc_canOpenMenu.sqf @@ -10,7 +10,7 @@ * Can open * * Example: - * [] call ace_medical_menu_canOpenMenu + * [player, cursorTarget] call ace_medical_menu_fnc_canOpenMenu * * Public: No */ @@ -18,7 +18,8 @@ params ["_caller", "_target"]; -if !(GVAR(allow) == 1 || (GVAR(allow) == 2 && {vehicle _caller != _caller || vehicle _target != _target} && {alive ACE_player})) exitwith {false}; -if !(GVAR(useMenu) == 1 || (GVAR(useMenu) == 2 && {vehicle _caller != _caller || vehicle _target != _target} && {alive ACE_player})) exitwith {false}; - -true +(alive _caller) +&& {!isNull _target} +&& {((_caller distance _target) < GVAR(maxRange)) || {(vehicle _caller) == (vehicle _target)}} //for now, ignore range when in same vehicle +&& {(GVAR(allow) == 1) || {(GVAR(allow) == 2) && {(vehicle _caller != _caller) || {vehicle _target != _target}}}} +&& {(GVAR(useMenu) == 1) || {(GVAR(useMenu) == 2) && {(vehicle _caller != _caller) || {vehicle _target != _target}}}} diff --git a/addons/medical_menu/functions/fnc_collectActions.sqf b/addons/medical_menu/functions/fnc_collectActions.sqf index ad189139ea..88f52c417a 100644 --- a/addons/medical_menu/functions/fnc_collectActions.sqf +++ b/addons/medical_menu/functions/fnc_collectActions.sqf @@ -20,7 +20,7 @@ _configBasic = (configFile >> "ACE_Medical_Actions" >> "Basic"); _configAdvanced = (configFile >> "ACE_Medical_Actions" >> "Advanced"); _fnc_compileActionsLevel = { - private ["_entryCount", "_actions", "_displayName", "_condition", "_category", "_statement"]; + private ["_actions", "_displayName", "_condition", "_category", "_statement"]; params ["_config"]; _actions = []; @@ -40,3 +40,26 @@ _fnc_compileActionsLevel = { GVAR(actionsBasic) = [_configBasic] call _fnc_compileActionsLevel; GVAR(actionsAdvanced) = [_configAdvanced] call _fnc_compileActionsLevel; + +//Manually add the drag actions, if dragging exists. +if (["ace_dragging"] call EFUNC(common,isModLoaded)) then { + _condition = { + (ACE_player != GVAR(INTERACTION_TARGET)) && {[ACE_player, GVAR(INTERACTION_TARGET)] call EFUNC(dragging,canDrag)} + }; + _statement = { + GVAR(pendingReopen) = false; //No medical_treatmentSuccess event after drag, so don't want this true + [ACE_player, GVAR(INTERACTION_TARGET)] call EFUNC(dragging,startDrag); + }; + GVAR(actionsBasic) pushBack [localize ELSTRING(dragging,Drag), "drag", _condition, _statement]; + GVAR(actionsAdvanced) pushBack [localize ELSTRING(dragging,Drag), "drag", _condition, _statement]; + + _condition = { + (ACE_player != GVAR(INTERACTION_TARGET)) && {[ACE_player, GVAR(INTERACTION_TARGET)] call EFUNC(dragging,canCarry)} + }; + _statement = { + GVAR(pendingReopen) = false; //No medical_treatmentSuccess event after drag, so don't want this true + [ACE_player, GVAR(INTERACTION_TARGET)] call EFUNC(dragging,startCarry); + }; + GVAR(actionsBasic) pushBack [localize ELSTRING(dragging,Carry), "drag", _condition, _statement]; + GVAR(actionsAdvanced) pushBack [localize ELSTRING(dragging,Carry), "drag", _condition, _statement]; +}; diff --git a/addons/medical_menu/functions/fnc_getTreatmentOptions.sqf b/addons/medical_menu/functions/fnc_getTreatmentOptions.sqf index 4b03d27970..2bb4499753 100644 --- a/addons/medical_menu/functions/fnc_getTreatmentOptions.sqf +++ b/addons/medical_menu/functions/fnc_getTreatmentOptions.sqf @@ -17,9 +17,10 @@ */ #include "script_component.hpp" -private "_actions"; params ["_player", "_target", "_name"]; +private ["_actions", "_collectedActions", "_bodyPart"]; + if (!([ACE_player, _target, ["isNotInside"]] call EFUNC(common,canInteractWith))) exitwith {[]}; _actions = if (EGVAR(medical,level) == 2) then { diff --git a/addons/medical_menu/functions/fnc_handleUI_DisplayOptions.sqf b/addons/medical_menu/functions/fnc_handleUI_DisplayOptions.sqf index dafd72d54d..e5b49e58bc 100644 --- a/addons/medical_menu/functions/fnc_handleUI_DisplayOptions.sqf +++ b/addons/medical_menu/functions/fnc_handleUI_DisplayOptions.sqf @@ -9,7 +9,7 @@ * None * * Example: - * ["some category"] call ace_medical_menu_handleUI_DisplayOptions + * ["some category"] call ace_medical_menu_fnc_handleUI_DisplayOptions * * Public: No */ @@ -21,7 +21,7 @@ if (!hasInterface) exitwith{}; -private ["_entries", "_display", "_newTarget", "_card", "_ctrl", "_code"]; +private ["_entries", "_display", "_newTarget", "_ctrl", "_code"]; params ["_name"]; @@ -31,9 +31,11 @@ _display = uiNamespace getVariable QGVAR(medicalMenu); if (isNil "_display") exitwith {}; // no valid dialog present if (_name isEqualTo "toggle") exitwith { - if (GVAR(INTERACTION_TARGET) != ACE_player) then { - _newTarget = ACE_player; - } else { + _newTarget = ACE_player; + //If we are on the player, and only if our old target is still valid, switch to it: + if ((GVAR(INTERACTION_TARGET) == ACE_player) && + {[ACE_player, GVAR(INTERACTION_TARGET_PREVIOUS), ["isNotInside"]] call EFUNC(common,canInteractWith)} && + {[ACE_player, GVAR(INTERACTION_TARGET_PREVIOUS)] call FUNC(canOpenMenu)}) then { _newTarget = GVAR(INTERACTION_TARGET_PREVIOUS); }; diff --git a/addons/medical_menu/functions/fnc_handleUI_dropDownTriageCard.sqf b/addons/medical_menu/functions/fnc_handleUI_dropDownTriageCard.sqf index fb924fc40b..33b82e5d78 100644 --- a/addons/medical_menu/functions/fnc_handleUI_dropDownTriageCard.sqf +++ b/addons/medical_menu/functions/fnc_handleUI_dropDownTriageCard.sqf @@ -9,7 +9,7 @@ * None * * Example: - * [] call ace_medical_menu_handleUI_dropDownTriageCard + * [] call ace_medical_menu_fnc_handleUI_dropDownTriageCard * * Public: No */ diff --git a/addons/medical_menu/functions/fnc_module.sqf b/addons/medical_menu/functions/fnc_module.sqf index d95110c200..666440e208 100644 --- a/addons/medical_menu/functions/fnc_module.sqf +++ b/addons/medical_menu/functions/fnc_module.sqf @@ -15,7 +15,7 @@ #include "script_component.hpp" -params ["_logic", "_units", "_activated"]; +params ["_logic", "", "_activated"]; if !(_activated) exitWith {}; diff --git a/addons/medical_menu/functions/fnc_onMenuClose.sqf b/addons/medical_menu/functions/fnc_onMenuClose.sqf index 4300089a4a..656336eb4e 100644 --- a/addons/medical_menu/functions/fnc_onMenuClose.sqf +++ b/addons/medical_menu/functions/fnc_onMenuClose.sqf @@ -9,7 +9,7 @@ * None * * Example: - * call ace_medical_menu_onMenuClosed + * call ace_medical_menu_fnc_onMenuClosed * * Public: No */ @@ -19,3 +19,4 @@ if (EGVAR(interact_menu,menuBackground)==1) then {[QGVAR(id), false] call EFUNC( if (EGVAR(interact_menu,menuBackground)==2) then {(uiNamespace getVariable [QEGVAR(interact_menu,menuBackground), displayNull]) closeDisplay 0;}; [GVAR(MenuPFHID)] call CBA_fnc_removePerFrameHandler; +GVAR(MenuPFHID) = -1; diff --git a/addons/medical_menu/functions/fnc_onMenuOpen.sqf b/addons/medical_menu/functions/fnc_onMenuOpen.sqf index fb64865b89..2b47312453 100644 --- a/addons/medical_menu/functions/fnc_onMenuOpen.sqf +++ b/addons/medical_menu/functions/fnc_onMenuOpen.sqf @@ -9,7 +9,7 @@ * None * * Example: - * [medical_menu] call ace_medical_menu_onMenuOpen + * [medical_menu] call ace_medical_menu_fnc_onMenuOpen * * Public: No */ @@ -64,6 +64,8 @@ disableSerialization; (_display displayCtrl 1) ctrlSetText format ["%1", [_target] call EFUNC(common,getName)]; setMousePosition [0.4, 0.4]; +if (GVAR(MenuPFHID) != -1) exitWith {ERROR("PFID already running");}; + GVAR(MenuPFHID) = [{ (_this select 0) params ["_display"]; @@ -74,15 +76,15 @@ GVAR(MenuPFHID) = [{ [GVAR(INTERACTION_TARGET)] call FUNC(updateIcons); [GVAR(LatestDisplayOptionMenu)] call FUNC(handleUI_DisplayOptions); - _status = [GVAR(INTERACTION_TARGET)] call EFUNC(medical,getTriageStatus); - (_display displayCtrl 2000) ctrlSetText (_status select 0); - (_display displayCtrl 2000) ctrlSetBackgroundColor (_status select 2); - - if (ACE_player distance _target > MAX_DISTANCE) exitwith { + //Check that it's valid to stay open: + if !(([ACE_player, _target, ["isNotInside"]] call EFUNC(common,canInteractWith)) && {[ACE_player, _target] call FUNC(canOpenMenu)}) then { closeDialog 314412; - ["displayTextStructured", [ACE_player], [[ELSTRING(medical,DistanceToFar), [_target] call EFUNC(common,getName)], 1.75, ACE_player]] call EFUNC(common,targetEvent); + //If we failed because of distance check, show UI message: + if ((ACE_player distance GVAR(INTERACTION_TARGET)) > GVAR(maxRange)) then { + ["displayTextStructured", [ACE_player], [[ELSTRING(medical,DistanceToFar), [GVAR(INTERACTION_TARGET)] call EFUNC(common,getName)], 1.75, ACE_player]] call EFUNC(common,targetEvent); + }; }; }, 0, [_display]] call CBA_fnc_addPerFrameHandler; - ["Medical_onMenuOpen", [ACE_player, _interactionTarget]] call EFUNC(common,localEvent); +["Medical_onMenuOpen", [ACE_player, _target]] call EFUNC(common,localEvent); diff --git a/addons/medical_menu/functions/fnc_openMenu.sqf b/addons/medical_menu/functions/fnc_openMenu.sqf index 067e7bda13..1c77da6a5a 100644 --- a/addons/medical_menu/functions/fnc_openMenu.sqf +++ b/addons/medical_menu/functions/fnc_openMenu.sqf @@ -9,7 +9,7 @@ * If action was taken * * Example: - * [some_player] call ace_medical_menu_openMenu + * [some_player] call ace_medical_menu_fnc_openMenu * * Public: No */ @@ -17,7 +17,7 @@ params ["_interactionTarget"]; -if (dialog || isNull _interactionTarget) exitwith { +if (dialog || {isNull _interactionTarget}) exitwith { disableSerialization; private ["_display", "_handled"]; diff --git a/addons/medical_menu/functions/fnc_updateActivityLog.sqf b/addons/medical_menu/functions/fnc_updateActivityLog.sqf index 335aea0c58..92e8474b4b 100644 --- a/addons/medical_menu/functions/fnc_updateActivityLog.sqf +++ b/addons/medical_menu/functions/fnc_updateActivityLog.sqf @@ -10,7 +10,7 @@ * None * * Example: - * [some_display, log] call ace_medical_menu_updateActivityLog + * [some_display, log] call ace_medical_menu_fnc_updateActivityLog * * Public: No */ @@ -24,7 +24,7 @@ _logCtrl = _display displayCtrl 214; lbClear _logCtrl; { - _x params ["_message", "_moment", "_dummy", "_arguments"]; + _x params ["_message", "_moment", "", "_arguments"]; if (isLocalized _message) then { _message = localize _message; diff --git a/addons/medical_menu/functions/fnc_updateBodyImage.sqf b/addons/medical_menu/functions/fnc_updateBodyImage.sqf index 34b2f450c8..1e8067a7f6 100644 --- a/addons/medical_menu/functions/fnc_updateBodyImage.sqf +++ b/addons/medical_menu/functions/fnc_updateBodyImage.sqf @@ -4,22 +4,23 @@ * * Arguments: * 0: selection bloodloss - * 1: display + * 1: damaged (array of bools) + * 2: display * * Return Value: * None * * Example: - * [0.3, some_display] call ace_medical_menu_updateBodyImage + * [0.3, some_display] call ace_medical_menu_fnc_updateBodyImage * * Public: No */ #include "script_component.hpp" -params ["_selectionBloodLoss", "_display"]; +params ["_selectionBloodLoss", "_damaged", "_display"]; // Handle the body image coloring -_availableSelections = [50, 51, 52, 53, 54, 55]; +private _availableSelections = [50, 51, 52, 53, 54, 55]; { private ["_red", "_green", "_blue"]; diff --git a/addons/medical_menu/functions/fnc_updateIcons.sqf b/addons/medical_menu/functions/fnc_updateIcons.sqf index f9d3fc5ab4..b309938476 100644 --- a/addons/medical_menu/functions/fnc_updateIcons.sqf +++ b/addons/medical_menu/functions/fnc_updateIcons.sqf @@ -9,7 +9,7 @@ * None * * Example: - * [] call ace_medical_menu_updateIcons + * [] call ace_medical_menu_fnc_updateIcons * * Public: No */ @@ -18,7 +18,7 @@ #define START_IDC 111 #define END_IDC 118 -private ["_display", "_idc", "_options", "_name", "_amount"]; +private ["_display", "_idc", "_options", "_amount"]; disableSerialization; diff --git a/addons/medical_menu/functions/fnc_updateInformationLists.sqf b/addons/medical_menu/functions/fnc_updateInformationLists.sqf index ecd700e43a..82c0a13746 100644 --- a/addons/medical_menu/functions/fnc_updateInformationLists.sqf +++ b/addons/medical_menu/functions/fnc_updateInformationLists.sqf @@ -14,7 +14,7 @@ */ #include "script_component.hpp" -private "_lbCtrl"; +private ["_lbCtrl", "_amountOfGeneric"]; params ["_display", "_genericMessages", "_allInjuryTexts"]; @@ -28,7 +28,7 @@ lbClear _lbCtrl; _amountOfGeneric = count _genericMessages; { - _x params ["_add", "_Color"]; + _x params ["_add", "_color"]; _lbCtrl lbAdd _add; _lbCtrl lbSetColor [_forEachIndex + _amountOfGeneric, _color]; } forEach _allInjuryTexts; diff --git a/addons/medical_menu/functions/fnc_updateQuickViewLog.sqf b/addons/medical_menu/functions/fnc_updateQuickViewLog.sqf index 8ca81f28ed..49da12e7f4 100644 --- a/addons/medical_menu/functions/fnc_updateQuickViewLog.sqf +++ b/addons/medical_menu/functions/fnc_updateQuickViewLog.sqf @@ -10,7 +10,7 @@ * None * * Example: - * [some_display, log] call ace_medical_menu_updateQuickViewLog + * [some_display, log] call ace_medical_menu_fnc_updateQuickViewLog * * Public: No */ @@ -24,7 +24,7 @@ _logCtrl = _display displayCtrl 215; lbClear _logCtrl; { - _x params ["_message", "_moment", "_dummy", "_arguments"]; + _x params ["_message", "_moment", "", "_arguments"]; if (isLocalized _message) then { _message = localize _message; diff --git a/addons/medical_menu/functions/fnc_updateUIInfo.sqf b/addons/medical_menu/functions/fnc_updateUIInfo.sqf index b493b5026e..56a22689db 100644 --- a/addons/medical_menu/functions/fnc_updateUIInfo.sqf +++ b/addons/medical_menu/functions/fnc_updateUIInfo.sqf @@ -10,18 +10,20 @@ * None * * Example: - * [some_player, some_display] call ace_medical_menu_updateUIInfo + * [some_player, some_display] call ace_medical_menu_fnc_updateUIInfo * * Public: No */ #include "script_component.hpp" -private ["_genericMessages", "_totalIvVolume", "_damaged", "_selectionBloodLoss", "_allInjuryTexts"]; - params ["_target", "_display"]; +private["_allInjuryTexts", "_bandagedwounds", "_damaged", "_genericMessages", "_logs", "_openWounds", "_part", "_partText", "_pointDamage", "_selectionBloodLoss", "_selectionN", "_severity", "_totalIvVolume", "_triageStatus"]; + +if (isNil "_display" || {isNull _display}) exitWith {ERROR("No display");}; + _selectionN = GVAR(selectedBodyPart); -if (_selectionN < 0 || _selectionN > 5) exitwith {}; +if (_selectionN < 0 || {_selectionN > 5}) exitwith {}; _genericMessages = []; _partText = [ELSTRING(medical,Head), ELSTRING(medical,Torso), ELSTRING(medical,LeftArm) ,ELSTRING(medical,RightArm) ,ELSTRING(medical,LeftLeg), ELSTRING(medical,RightLeg)] select _selectionN; @@ -60,7 +62,7 @@ _damaged = [false, false, false, false, false, false]; _selectionBloodLoss = [0, 0, 0, 0, 0, 0]; _allInjuryTexts = []; -if (EGVAR(medical,level) >= 2) then { +if ((EGVAR(medical,level) >= 2) && {([_target] call EFUNC(medical,hasMedicalEnabled))}) then { _openWounds = _target getVariable [QEGVAR(medical,openWounds), []]; private "_amountOf"; { @@ -109,7 +111,7 @@ if (EGVAR(medical,level) >= 2) then { { _selectionBloodLoss set [_forEachIndex, _x]; - if (_x > 0 && _forEachIndex == _selectionN) then { + if ((_x > 0) && {_forEachIndex == _selectionN}) then { _pointDamage = _x; _severity = switch (true) do { case (_pointDamage > 0.5): {localize ELSTRING(medical,HeavilyWounded)}; @@ -129,7 +131,7 @@ if (EGVAR(medical,level) >= 2) then { } forEach (_target getvariable [QEGVAR(medical,bodyPartStatus), [0,0,0,0,0,0]]); }; -[_selectionBloodLoss, _display] call FUNC(updateBodyImage); +[_selectionBloodLoss, _damaged, _display] call FUNC(updateBodyImage); [_display, _genericMessages, _allInjuryTexts] call FUNC(updateInformationLists); _logs = _target getVariable [QEGVAR(medical,logFile_activity_view), []]; diff --git a/addons/medical_menu/ui/menu.hpp b/addons/medical_menu/ui/menu.hpp index 342f0230a2..29247b6071 100644 --- a/addons/medical_menu/ui/menu.hpp +++ b/addons/medical_menu/ui/menu.hpp @@ -325,7 +325,7 @@ class GVAR(medicalMenu) { animTextureFocused = "#(argb,8,8,3)color(0,0,0,0.0)"; animTexturePressed = "#(argb,8,8,3)color(0,0,0,0.0)"; animTextureDefault = "#(argb,8,8,3)color(0,0,0,0.0)"; - action = QUOTE(GVAR(selectedBodyPart) = 0; [GVAR(INTERACTION_TARGET)] call FUNC(updateUIInfo);); + action = QUOTE(GVAR(selectedBodyPart) = 0;); }; class selectTorso : selectHead { idc = 302; @@ -333,7 +333,7 @@ class GVAR(medicalMenu) { y = "5.4 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY + (safezoneH - (((safezoneW / safezoneH) min 1.2) / 1.2))/2)"; w = "2.2 * (((safezoneW / safezoneH) min 1.2) / 40)"; h = "4.1 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)"; - action = QUOTE(GVAR(selectedBodyPart) = 1; [GVAR(INTERACTION_TARGET)] call FUNC(updateUIInfo);); + action = QUOTE(GVAR(selectedBodyPart) = 1;); }; class selectLeftArm: selectHead{ idc = 303; @@ -341,12 +341,12 @@ class GVAR(medicalMenu) { y = "5.9 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY + (safezoneH - (((safezoneW / safezoneH) min 1.2) / 1.2))/2)"; w = "1.1 * (((safezoneW / safezoneH) min 1.2) / 40)"; h = "4.3 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)"; - action = QUOTE(GVAR(selectedBodyPart) = 3; [GVAR(INTERACTION_TARGET)] call FUNC(updateUIInfo);); + action = QUOTE(GVAR(selectedBodyPart) = 3;); }; class selectRightArm: selectLeftArm{ idc = 304; x = "20.6 * (((safezoneW / safezoneH) min 1.2) / 40) + (safezoneX + (safezoneW - ((safezoneW / safezoneH) min 1.2))/2)"; - action = QUOTE(GVAR(selectedBodyPart) = 2; [GVAR(INTERACTION_TARGET)] call FUNC(updateUIInfo);); + action = QUOTE(GVAR(selectedBodyPart) = 2;); }; class selectLeftLeg :selectHead { idc = 305; @@ -354,12 +354,12 @@ class GVAR(medicalMenu) { y = "9.5 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY + (safezoneH - (((safezoneW / safezoneH) min 1.2) / 1.2))/2)"; w = "1.1 * (((safezoneW / safezoneH) min 1.2) / 40)"; h = "6 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)"; - action = QUOTE(GVAR(selectedBodyPart) = 5; [GVAR(INTERACTION_TARGET)] call FUNC(updateUIInfo);); + action = QUOTE(GVAR(selectedBodyPart) = 5;); }; class selectRightLeg :selectLeftLeg { idc = 306; x = "19.6 * (((safezoneW / safezoneH) min 1.2) / 40) + (safezoneX + (safezoneW - ((safezoneW / safezoneH) min 1.2))/2)"; - action = QUOTE(GVAR(selectedBodyPart) = 4; [GVAR(INTERACTION_TARGET)] call FUNC(updateUIInfo);); + action = QUOTE(GVAR(selectedBodyPart) = 4;); }; diff --git a/addons/microdagr/CfgVehicles.hpp b/addons/microdagr/CfgVehicles.hpp index ee16870fe0..3fcf92beaa 100644 --- a/addons/microdagr/CfgVehicles.hpp +++ b/addons/microdagr/CfgVehicles.hpp @@ -38,6 +38,7 @@ class CfgVehicles { function = QFUNC(moduleMapFill); scope = 2; isGlobal = 0; + isSingular = 1; icon = QUOTE(PATHTOF(UI\Icon_Module_microDAGR_ca.paa)); functionPriority = 0; class Arguments { diff --git a/addons/microdagr/XEH_clientInit.sqf b/addons/microdagr/XEH_clientInit.sqf index 518a648601..c918bcf454 100644 --- a/addons/microdagr/XEH_clientInit.sqf +++ b/addons/microdagr/XEH_clientInit.sqf @@ -3,9 +3,6 @@ if (!hasInterface) exitWith {}; -//Functions that are called for each draw of the map: -GVAR(miniMapDrawHandlers) = []; - //Add deviceKey entry: private ["_conditonCode", "_toggleCode", "_closeCode"]; _conditonCode = { diff --git a/addons/microdagr/XEH_preInit.sqf b/addons/microdagr/XEH_preInit.sqf index 4e6ed561c3..39a1b313c6 100644 --- a/addons/microdagr/XEH_preInit.sqf +++ b/addons/microdagr/XEH_preInit.sqf @@ -23,4 +23,7 @@ PREP(saveCurrentAndSetNewMode); PREP(showApplicationPage); PREP(updateDisplay); +//Functions that are called for each draw of the map: +GVAR(miniMapDrawHandlers) = []; + ADDON = true; diff --git a/addons/missionmodules/functions/fnc_moduleAmbianceSound.sqf b/addons/missionmodules/functions/fnc_moduleAmbianceSound.sqf index 70ef644384..26f605e347 100644 --- a/addons/missionmodules/functions/fnc_moduleAmbianceSound.sqf +++ b/addons/missionmodules/functions/fnc_moduleAmbianceSound.sqf @@ -18,10 +18,8 @@ #include "script_component.hpp" -private ["_logic", "_units", "_activated","_ambianceSounds", "_soundFiles", "_minimalDistance","_maximalDistance", "_minimalDistance", "_maxDelayBetweenSounds", "_allUnits", "_newPos", "_targetUnit", "_soundToPlay", "_soundPath", "_unparsedSounds", "_list", "_splittedList", "_nilCheckPassedList"]; -_logic = [_this,0,objNull,[objNull]] call BIS_fnc_param; -_units = [_this,1,[],[[]]] call BIS_fnc_param; -_activated = [_this,2,true,[true]] call BIS_fnc_param; +private ["_ambianceSounds", "_minimalDistance","_maximalDistance", "_minimalDistance", "_maxDelayBetweenSounds", "_missionRoot", "_unparsedSounds", "_splittedList", "_soundPath"]; +params ["_logic", "_units", "_activated"]; // We only play this on the locality of the logic, since the sounds are broadcasted across the network if (_activated && local _logic) then { @@ -34,51 +32,49 @@ if (_activated && local _logic) then { _volume = (_logic getVariable ["soundVolume", 30]) max 1; _followPlayers = _logic getVariable ["followPlayers", false]; - _splittedList = [_unparsedSounds, ","] call BIS_fnc_splitString; + _splittedList = _unparsedSounds splitString ","; + _missionRoot = str missionConfigFile select [0, count str missionConfigFile - 15]; - _nilCheckPassedList = ""; { _x = [_x] call EFUNC(common,stringRemoveWhiteSpace); - _splittedList set [_forEachIndex, _x]; - }forEach _splittedList; - _soundPath = [(str missionConfigFile), 0, -15] call BIS_fnc_trimString; - { if (isClass (missionConfigFile >> "CfgSounds" >> _x)) then { - _ambianceSounds pushBack (_soundPath + (getArray(missionConfigFile >> "CfgSounds" >> _x >> "sound") select 0)); + // CfgSounds accepts a leading backslash, but a double backslash + // is not accepted in the path, so we have to filter that. + _soundPath = getArray (missionConfigFile >> "CfgSounds" >> _x >> "sound") select 0; + if (_soundPath select [0,1] == "\") then { + _ambianceSounds pushBack (_missionRoot + (_soundPath select [1])); + } else { + _ambianceSounds pushBack (_missionRoot + _soundPath); + }; } else { if (isClass (configFile >> "CfgSounds" >> _x)) then { _ambianceSounds pushBack ((getArray(configFile >> "CfgSounds" >> _x >> "sound") select 0)); + } else { + ACE_LOGERROR_1("Ambient Sounds: Sound ""%1"" not found.",_x); }; }; - }forEach _splittedList; + + false + } count _splittedList; if (count _ambianceSounds == 0) exitWith {}; { - if !([".", _x, true] call BIS_fnc_inString) then { + if ((_x find ".") == -1) then { _ambianceSounds set [_forEachIndex, _x + ".wss"]; }; - }forEach _ambianceSounds; + } forEach _ambianceSounds; [{ - private ["_args", "_logic", "_ambianceSounds", "_minimalDistance", "_maximalDistance", "_minDelayBetweensounds", "_maxDelayBetweenSounds", "_volume", "_followPlayers","_lastTimePlayed", "_newPos"]; - _args = _this select 0; - _logic = _args select 0; - _minDelayBetweensounds = _args select 4; - _maxDelayBetweenSounds = _args select 5; - _lastTimePlayed = _args select 8; + private ["_newPos", "_allUnits", "_targetUnit"]; + params ["_args", "_pfhHandle"]; + _args params ["_logic", "_ambianceSounds", "_minimalDistance", "_maximalDistance", "_minDelayBetweensounds", "_maxDelayBetweenSounds", "_volume", "_followPlayers", "_lastTimePlayed"]; if (!alive _logic) exitWith { - [(_this select 1)] call cba_fnc_removePerFrameHandler; + [_pfhHandle] call cba_fnc_removePerFrameHandler; }; if (ACE_time - _lastTimePlayed >= ((_minDelayBetweensounds + random(_maxDelayBetweenSounds)) min _maxDelayBetweenSounds)) then { - _ambianceSounds = _args select 1; - _minimalDistance = _args select 2; - _maximalDistance = _args select 3; - - _volume = _args select 6; - _followPlayers = _args select 7; // Find all players in session. _allUnits = if (isMultiplayer) then {playableUnits} else {[ACE_player]}; @@ -87,7 +83,7 @@ if (_activated && local _logic) then { if (count _allUnits > 0) then { // Select a target unit at random. - _targetUnit = _allUnits select (round(random((count _allUnits)-1))); + _targetUnit = _allUnits call BIS_fnc_selectRandom; // find the position from which we are going to play this sound from. _newPos = (getPos _targetUnit); @@ -112,7 +108,7 @@ if (_activated && local _logic) then { // If no unit is to close to this position, we will play the sound. if ({(_newPos distance _x < (_minimalDistance / 2))}count _allUnits == 0) then { - playSound3D [_ambianceSounds select (round(random((count _ambianceSounds)-1))), ObjNull, false, _newPos, _volume, 1, 1000]; + playSound3D [_ambianceSounds call BIS_fnc_selectRandom, objNull, false, _newPos, _volume, 1, 1000]; _args set [8, ACE_time]; }; }; diff --git a/addons/mk6mortar/CfgVehicles.hpp b/addons/mk6mortar/CfgVehicles.hpp index b351e440b4..481687f89f 100644 --- a/addons/mk6mortar/CfgVehicles.hpp +++ b/addons/mk6mortar/CfgVehicles.hpp @@ -52,6 +52,7 @@ class CfgVehicles { function = QFUNC(moduleInit); scope = 2; isGlobal = 0; + isSingular = 1; icon = QUOTE(PATHTOF(UI\Icon_Module_mk6_ca.paa)); functionPriority = 0; class Arguments { diff --git a/addons/mk6mortar/functions/fnc_dev_simulateFindSolution.sqf b/addons/mk6mortar/functions/fnc_dev_simulateFindSolution.sqf index 32a5a314a7..d302a40f40 100644 --- a/addons/mk6mortar/functions/fnc_dev_simulateFindSolution.sqf +++ b/addons/mk6mortar/functions/fnc_dev_simulateFindSolution.sqf @@ -51,5 +51,5 @@ while {(_numberOfAttempts < MAX_ATTEMPTS) && {(abs _error) > 0.2}} do { }; if (_numberOfAttempts >= MAX_ATTEMPTS) exitWith {[]}; -//return the elevation and ACE_time required +//return the elevation and time required [_solutionElevation, (_lastTestResult select 1)] diff --git a/addons/mk6mortar/functions/fnc_dev_simulateShot.sqf b/addons/mk6mortar/functions/fnc_dev_simulateShot.sqf index 65f87256fe..0e53807a6b 100644 --- a/addons/mk6mortar/functions/fnc_dev_simulateShot.sqf +++ b/addons/mk6mortar/functions/fnc_dev_simulateShot.sqf @@ -45,7 +45,7 @@ _currentVelocity = [0, (_muzzleVelocity * cos _angleDeg), (_muzzleVelocity * sin _currentTime = 0; _lastPos = _currentPos; -_kCoefficent = -1 * _relDensity * _airFriction; //save ACE_time in the loop and compute once +_kCoefficent = -1 * _relDensity * _airFriction; //save time in the loop and compute once while {((_currentVelocity select 2) > 0) || ((_currentPos select 2) >= _heightOfTarget)} do { _lastPos = _currentPos; @@ -64,7 +64,7 @@ _linConversion = linearConversion [(_lastPos select 2), (_currentPos select 2), _middlePos = (_lastPos vectorMultiply (1 - _linConversion)) vectorAdd (_currentPos vectorMultiply (_linConversion)); // _middlePosOld = (_lastPos vectorAdd _currentPos) vectorMultiply 0.5; -//Same to find travel ACE_time +//Same to find travel time _middleTotalTravelTime = _currentTime - (_timeStep * (1-_linConversion)); //Find shot offset (from crosswind), in degrees diff --git a/addons/modules/XEH_postInit.sqf b/addons/modules/XEH_postInit.sqf index 62d16f42ce..1935714dc8 100644 --- a/addons/modules/XEH_postInit.sqf +++ b/addons/modules/XEH_postInit.sqf @@ -4,27 +4,32 @@ ["InitSettingsFromModules", { // TODO This is a basic and limited implementation that mimics some of the functionality from the A3 module framework, but not all of it. // We have to execute this in the postInit XEH because on object init, the parameters of the modules are not yet available. They are if we execute it at the start of postInit execution. + + private _uniqueModulesHandled = []; { [_x] call { - private ["_logic", "_logicType", "_config", "_isGlobal", "_isDisposable", "_isPersistent","_function"]; - _logic = _this select 0; - _logicType = typeof _logic; + params ["_logic"]; + private _logicType = typeof _logic; _logic hideobject true; if (_logic getvariable [QGVAR(initalized), false]) exitwith {}; - _config = (configFile >> "CfgVehicles" >> _logicType); + private _config = (configFile >> "CfgVehicles" >> _logicType); if !(isClass _config) exitwith {}; - // isGlobal = 1; - _isGlobal = getNumber (_config >> "isGlobal") > 0; - _isDisposable = getNumber (_config >> "isDisposable") > 0; - _isPersistent = getNumber (_config >> "isPersistent") > 0 || getnumber (_config >> "isGlobal") > 1; - _function = getText (_config >> "function"); + private _isGlobal = getNumber (_config >> "isGlobal") > 0; + private _isDisposable = getNumber (_config >> "isDisposable") > 0; + private _isPersistent = getNumber (_config >> "isPersistent") > 0 || getnumber (_config >> "isGlobal") > 1; + private _isSingular = getNumber (_config >> "isSingular") > 0; + private _function = getText (_config >> "function"); if (isnil _function) then { _function = compile _function; } else { _function = missionNamespace getvariable _function; }; + if (_isSingular && {_logicType in _uniqueModulesHandled}) then { //ToDo: should this be an exit? + ACE_LOGWARNING_1("Module [%1] - More than 1 singular module placed", _logicType); + }; + if (_isSingular) then {_uniqueModulesHandled pushBack _logicType;}; if (_isGlobal || isServer) then { [_logic, (synchronizedObjects _logic), true] call _function; @@ -38,7 +43,7 @@ deleteVehicle _logic; }; }; - }foreach GVAR(moduleInitCollection); + } forEach GVAR(moduleInitCollection); if (isServer) then { GVAR(serverModulesRead) = true; diff --git a/addons/movement/CfgMoves.hpp b/addons/movement/CfgMoves.hpp index 50d3e3ab2b..a828c5278c 100644 --- a/addons/movement/CfgMoves.hpp +++ b/addons/movement/CfgMoves.hpp @@ -114,26 +114,11 @@ class CfgMovesMaleSdr: CfgMovesBasic { leftHandIKCurve[] = {}; }; - // enable optics in prone left and right stance - class AidlPpneMstpSrasWrflDnon_G0S; - class AadjPpneMstpSrasWrflDleft: AidlPpneMstpSrasWrflDnon_G0S { - enableOptics = 1; - }; - class AadjPpneMstpSrasWrflDright: AidlPpneMstpSrasWrflDnon_G0S { - enableOptics = 1; - }; + // enable optics in prone down stance class AadjPpneMstpSrasWrflDup; class AadjPpneMstpSrasWrflDdown: AadjPpneMstpSrasWrflDup { enableOptics = 1; }; - - class AidlPpneMstpSrasWpstDnon_G0S; - class AadjPpneMstpSrasWpstDleft: AidlPpneMstpSrasWpstDnon_G0S { - enableOptics = 2; - }; - class AadjPpneMstpSrasWpstDright: AidlPpneMstpSrasWpstDnon_G0S { - enableOptics = 2; - }; class AadjPpneMstpSrasWpstDup; class AadjPpneMstpSrasWpstDdown: AadjPpneMstpSrasWpstDup { enableOptics = 2; diff --git a/addons/nametags/CfgVehicles.hpp b/addons/nametags/CfgVehicles.hpp index f6e28095b4..7ca13b5aeb 100644 --- a/addons/nametags/CfgVehicles.hpp +++ b/addons/nametags/CfgVehicles.hpp @@ -7,6 +7,7 @@ class CfgVehicles { function = QFUNC(moduleNameTags); scope = 2; isGlobal = 1; + isSingular = 1; icon = QUOTE(PATHTOF(UI\Icon_Module_NameTags_ca.paa)); class Arguments { class showPlayerNames { diff --git a/addons/nametags/functions/fnc_initIsSpeaking.sqf b/addons/nametags/functions/fnc_initIsSpeaking.sqf index 4d4d576c52..3b8aea497a 100644 --- a/addons/nametags/functions/fnc_initIsSpeaking.sqf +++ b/addons/nametags/functions/fnc_initIsSpeaking.sqf @@ -41,7 +41,7 @@ if (isClass (configFile >> "cfgPatches" >> "acre_api")) then { ACE_LOGINFO("ACRE Detected."); DFUNC(isSpeaking) = { params ["_unit"]; - (([_unit] call acre_api_fnc_isSpeaking) || {[ACE_player] call acre_api_fnc_isBroadcasting}) && {!(_unit getVariable ["ACE_isUnconscious", false])} + ([_unit] call acre_api_fnc_isSpeaking) && {!(_unit getVariable ["ACE_isUnconscious", false])} }; } else { if (isClass (configFile >> "cfgPatches" >> "task_force_radio")) then { diff --git a/addons/nametags/stringtable.xml b/addons/nametags/stringtable.xml index d3616d18f4..61a2b3f5a2 100644 --- a/addons/nametags/stringtable.xml +++ b/addons/nametags/stringtable.xml @@ -1,4 +1,4 @@ - + diff --git a/addons/optionsmenu/CfgVehicles.hpp b/addons/optionsmenu/CfgVehicles.hpp index 1357417add..cbe03a4cfb 100644 --- a/addons/optionsmenu/CfgVehicles.hpp +++ b/addons/optionsmenu/CfgVehicles.hpp @@ -8,6 +8,7 @@ class CfgVehicles { function = QUOTE(DFUNC(moduleAllowConfigExport)); functionPriority = 1; isGlobal = 1; + isSingular = 1; isTriggerActivated = 0; author = ECSTRING(common,ACETeam); class Arguments { diff --git a/addons/optionsmenu/stringtable.xml b/addons/optionsmenu/stringtable.xml index 6b4cad396b..cd4cc429b0 100644 --- a/addons/optionsmenu/stringtable.xml +++ b/addons/optionsmenu/stringtable.xml @@ -1,4 +1,4 @@ - + @@ -356,6 +356,7 @@ Pošle debug informace do RPT a schránky. Protokolliert Debug-Informationen im RPT und speichert sie in der Zwischenablage. Envia informação de depuração para RPT e área de transferência. + Отправляет отладочную информацию в RPT и буфер обмена. Headbug Fix @@ -415,4 +416,4 @@ Logística - + \ No newline at end of file diff --git a/addons/overheating/functions/fnc_cooldown.sqf b/addons/overheating/functions/fnc_cooldown.sqf index 9e54d35b56..52052c7251 100644 --- a/addons/overheating/functions/fnc_cooldown.sqf +++ b/addons/overheating/functions/fnc_cooldown.sqf @@ -16,7 +16,7 @@ EXPLODE_3_PVT(_this,_temperature,_barrelMass,_totalTime); -// If a long ACE_time passed since the last shot, there's no need to calculate anything; the weapon should be cool +// If a long time passed since the last shot, there's no need to calculate anything; the weapon should be cool if (_totalTime > 1800) exitWith {0}; private ["_barrelSurface", "_time", "_deltaTime"]; diff --git a/addons/overpressure/functions/fnc_cacheOverPressureValues.sqf b/addons/overpressure/functions/fnc_cacheOverPressureValues.sqf index 0717065c43..8de8af6375 100644 --- a/addons/overpressure/functions/fnc_cacheOverPressureValues.sqf +++ b/addons/overpressure/functions/fnc_cacheOverPressureValues.sqf @@ -24,9 +24,9 @@ private ["_array", "_type", "_return", "_config" /*, "_priority"*/]; // get Priority Array from Config _array = [ - getNumber (configFile >> "CfgWeapons" >> QGVAR(priority)), - getNumber (configFile >> "CfgMagazines" >> QGVAR(priority)), - getNumber (configFile >> "CfgAmmo" >> QGVAR(priority)) + getNumber (configFile >> "CfgWeapons" >> _weapon >> QGVAR(priority)), + getNumber (configFile >> "CfgMagazines" >> _magazine >> QGVAR(priority)), + getNumber (configFile >> "CfgAmmo" >> _ammo >> QGVAR(priority)) ]; TRACE_1("Proiroity Array",_array); diff --git a/addons/overpressure/functions/fnc_fireLauncherBackblast.sqf b/addons/overpressure/functions/fnc_fireLauncherBackblast.sqf index 1653fce9e1..e457e023c6 100644 --- a/addons/overpressure/functions/fnc_fireLauncherBackblast.sqf +++ b/addons/overpressure/functions/fnc_fireLauncherBackblast.sqf @@ -41,14 +41,14 @@ _var params["_backblastAngle","_backblastRange","_backblastDamage"]; // Damage to others private "_affected"; -_affected = getPos _projectile nearEntities ["CAManBase", _backblastRange]; +_affected = (ASLtoAGL _position) nearEntities ["CAManBase", _backblastRange]; // Let each client handle their own affected units -["overpressure", _affected, [_firer, _position, _direction, _weapon]] call EFUNC(common,targetEvent); +["overpressure", _affected, [_firer, _position, _direction, _weapon, _magazine, _ammo]] call EFUNC(common,targetEvent); // Damage to the firer private "_distance"; -_distance = [_position, _direction, _backblastRange] call FUNC(getDistance); +_distance = [_position, _direction, _backblastRange, _firer] call FUNC(getDistance); TRACE_1("Distance",_distance); diff --git a/addons/overpressure/functions/fnc_fireOverpressureZone.sqf b/addons/overpressure/functions/fnc_fireOverpressureZone.sqf index 3068928ba4..02de0eb311 100644 --- a/addons/overpressure/functions/fnc_fireOverpressureZone.sqf +++ b/addons/overpressure/functions/fnc_fireOverpressureZone.sqf @@ -40,7 +40,7 @@ _var params["_dangerZoneAngle","_dangerZoneRange","_dangerZoneDamage"]; // Damage to others private "_affected"; -_affected = getPos _projectile nearEntities ["CAManBase", _dangerZoneRange]; +_affected = (ASLtoAGL _position) nearEntities ["CAManBase", _dangerZoneRange]; // Let each client handle their own affected units ["overpressure", _affected, [_firer, _position, _direction, _weapon, _magazine, _ammo]] call EFUNC(common,targetEvent); diff --git a/addons/overpressure/functions/fnc_getDistance.sqf b/addons/overpressure/functions/fnc_getDistance.sqf index 3b3103d951..cabdd267fa 100644 --- a/addons/overpressure/functions/fnc_getDistance.sqf +++ b/addons/overpressure/functions/fnc_getDistance.sqf @@ -7,60 +7,45 @@ * 0: Pos ASL of origin (ARRAY> * 1: Direction * 2: Max distance to search + * 3: Shooter * * Return value: - * Distance to intersection (+- 0.1 m) + * Distance to intersection (999 if distance is greater than max) + * + * Example: + * [[1823.41,5729.05,6.66627], [-0.953255,0.109689,-0.281554], 15, ace_player] call ace_overpressure_fnc_getDistance + * */ #include "script_component.hpp" -EXPLODE_3_PVT(_this,_posASL,_direction,_maxDistance); +params ["_posASL", "_direction", "_maxDistance", "_shooter"]; +TRACE_3("params",_posASL,_direction,_maxDistance); -private ["_distance", "_interval", "_line", "_intersections", "_terrainIntersect", "_lastTerrainIntersect"]; +private _intersections = lineIntersectsSurfaces [_posASL, _posASL vectorAdd (_direction vectorMultiply _maxDistance), _shooter, objNull, true, 99]; -_distance = _maxDistance; -_interval = _distance; -_line = [_posASL, []]; -_terrainIntersect = false; -_lastTerrainIntersect = false; +TRACE_1("lineIntersectsSurfaces",_intersections); -while { - _interval > 0.1 -} do { - _lastTerrainIntersect = _terrainIntersect; - _interval = _interval / 2; +private _distance = 999; - _line set [1, _posASL vectorAdd (_direction vectorMultiply _distance)]; +{ + _x params ["_intersectPosASL", "_surfaceNormal", "_intersectObject"]; - _intersections = { - _x isKindOf "Static" || {_x isKindOf "AllVehicles"} - } count (lineIntersectsWith _line); + //Hit something solid that can reflect - (Static covers Building) + if ((isNull _intersectObject) || {(_intersectObject isKindOf "Static") || {_intersectObject isKindOf "AllVehicles"}}) exitWith { + _distance = _posASL vectorDistance _intersectPosASL; + TRACE_3("hit solid object",_distance,_intersectObject,typeOf _intersectObject); - _terrainIntersect = if (_intersections > 0) then { - false - } else { - terrainIntersectASL _line + if (isNull _intersectObject) then { //Terrain: + // Calculate the angle between the terrain and the back blast direction + _angle = 90 - acos (- (_surfaceNormal vectorDotProduct _direction)); + TRACE_3("Terrain Intersect",_surfaceNormal,_direction,_angle); + // Angles is below 25deg, no backblast at all + if (_angle < 25) exitWith {_distance = 999}; + // Angles is below 45deg the distance is increased according to the difference + if (_angle < 45) exitWith {_distance = _distance * (5 - 4 * sqrt ((_angle - 25)/20))}; + // Angles above 45degcreate full backblast + }; }; - - _distance = _distance + ([1, -1] select (_intersections > 0 || _terrainIntersect)) * _interval; - - if (_distance > _maxDistance) exitWith {_distance = 999}; -}; - -if (_distance > _maxDistance) exitWith {_distance}; - -// If the intersection was with the terrain, check slope -if (_terrainIntersect || _lastTerrainIntersect) exitWith { - private ["_slope","_angle"]; - _slope = surfaceNormal (_posASL vectorAdd (_direction vectorMultiply _distance)); - // Calculate the angle between the terrain and the back blast direction - _angle = 90 - acos (- (_slope vectorDotProduct _direction)); - - //systemChat format ["Angle: %1", _angle]; - // Angles is below 25º, no backblast at all - if (_angle < 25) exitWith {_distance = 999}; - // Angles is below 45º the distance is increased according to the difference - if (_angle < 45) exitWith {_distance = _distance * (5 - 4 * sqrt ((_angle - 25)/20))}; - // Angles above 45º create full backblast -}; +} forEach _intersections; _distance diff --git a/addons/overpressure/functions/fnc_overpressureDamage.sqf b/addons/overpressure/functions/fnc_overpressureDamage.sqf index a39aec3c14..f9c58050e0 100644 --- a/addons/overpressure/functions/fnc_overpressureDamage.sqf +++ b/addons/overpressure/functions/fnc_overpressureDamage.sqf @@ -30,12 +30,6 @@ _var params["_overpressureAngle","_overpressureRange","_overpressureDamage"]; TRACE_4("Parameters:",_overpressureAngle,_overpressureRange,_overpressureDamage,_weapon); -private "_pos"; -_pos = _posASL; -if (!surfaceIsWater _pos) then { - _pos = ASLtoATL _pos; -}; - { if (local _x && {_x != _firer} && {vehicle _x == _x}) then { private ["_targetPositionASL", "_relativePosition", "_axisDistance", "_distance", "_angle", "_line", "_line2"]; @@ -68,4 +62,4 @@ if (!surfaceIsWater _pos) then { }; }; }; -} forEach (_pos nearEntities ["CAManBase", _overpressureRange]); +} forEach ((ASLtoAGL _posASL) nearEntities ["CAManBase", _overpressureRange]); diff --git a/addons/parachute/functions/fnc_showAltimeter.sqf b/addons/parachute/functions/fnc_showAltimeter.sqf index 28909f19cd..6f4159e85d 100644 --- a/addons/parachute/functions/fnc_showAltimeter.sqf +++ b/addons/parachute/functions/fnc_showAltimeter.sqf @@ -15,9 +15,7 @@ */ #include "script_component.hpp" -private ["_unit"]; - -_unit = _this select 0; +params ["_unit"]; (["ACE_Altimeter"] call BIS_fnc_rscLayer) cutRsc ["ACE_Altimeter", "PLAIN", 0, true]; if (isNull (uiNamespace getVariable ["ACE_Altimeter", displayNull])) exitWith {}; @@ -27,7 +25,7 @@ GVAR(AltimeterActive) = true; [{ if (!GVAR(AltimeterActive)) exitWith {[_this select 1] call CALLSTACK(cba_fnc_removePerFrameEventHandler)}; disableSerialization; - EXPLODE_4_PVT(_this select 0,_display,_unit,_oldHeight,_prevTime); + (_this select 0) params ["_display", "_unit", "_oldHeight", "_prevTime"]; if !("ACE_Altimeter" in assignedItems _unit) exitWith {[_this select 1] call CALLSTACK(cba_fnc_removePerFrameEventHandler); call FUNC(hideAltimeter)}; private ["_height", "_hour", "_minute", "_descentRate","_HeightText", "_DecendRate", "_TimeText", "_curTime", "_timeDiff"]; @@ -38,7 +36,7 @@ GVAR(AltimeterActive) = true; _hour = floor daytime; _minute = floor ((daytime - _hour) * 60); - _height = (getPosASL _unit) select 2; + _height = ((getPosASL _unit) select 2) + EGVAR(common,mapAltitude); _curTime = ACE_time; _timeDiff = _curTime - _prevTime; _descentRate = if(_timeDiff > 0) then {floor((_oldHeight - _height) / _timeDiff)} else {0}; diff --git a/addons/parachute/script_component.hpp b/addons/parachute/script_component.hpp index 93a3e0d363..5668220421 100644 --- a/addons/parachute/script_component.hpp +++ b/addons/parachute/script_component.hpp @@ -1,4 +1,3 @@ -#define DEBUG_ENABLED_PARACHUTE #define COMPONENT parachute #include "\z\ace\addons\main\script_mod.hpp" diff --git a/addons/realisticnames/CfgVehicles.hpp b/addons/realisticnames/CfgVehicles.hpp index c3288815dd..9aea632247 100644 --- a/addons/realisticnames/CfgVehicles.hpp +++ b/addons/realisticnames/CfgVehicles.hpp @@ -308,6 +308,9 @@ class CfgVehicles { class O_Heli_Light_02_F: Heli_Light_02_base_F { displayName = CSTRING(Heli_Light_02_Name); }; + class O_Heli_Light_02_v2_F: Heli_Light_02_base_F { + displayName = CSTRING(Heli_Light_02_v2_Name); + }; class Heli_Light_02_unarmed_base_F; class O_Heli_Light_02_unarmed_F: Heli_Light_02_unarmed_base_F { displayName = CSTRING(Heli_Light_02_unarmed_Name); diff --git a/addons/realisticnames/CfgWeapons.hpp b/addons/realisticnames/CfgWeapons.hpp index 83534a1083..2adff28a41 100644 --- a/addons/realisticnames/CfgWeapons.hpp +++ b/addons/realisticnames/CfgWeapons.hpp @@ -525,12 +525,14 @@ class CfgWeapons { class LMG_coax: LMG_RCWS { displayName = "PKT"; }; - - class ACE_LMG_coax_MBT_01: LMG_coax { + // class ACE_LMG_coax_PKT_mem2: LMG_coax {}; + class ACE_LMG_coax_MAG58_mem2: LMG_coax { displayName = "MAG 58"; }; - - class ACE_LMG_coax_APC_Tracked_03: LMG_coax { + class ACE_LMG_coax_MAG58_mem3: LMG_coax { + displayName = "MAG 58"; + }; + class ACE_LMG_coax_L94A1_mem3: LMG_coax { displayName = "L94A1"; }; diff --git a/addons/realisticnames/stringtable.xml b/addons/realisticnames/stringtable.xml index 5f84a4f16d..fbf1e37226 100644 --- a/addons/realisticnames/stringtable.xml +++ b/addons/realisticnames/stringtable.xml @@ -817,6 +817,17 @@ Ka-60 Kasatka Ka-60 Kasatka + + Ka-60 Kasatka (Black & White) + Ka-60 Kasatka (černobílá) + Ka-60 Kasatka (noir et blanc) + Ka-60 Kasatka (Schwarz-weiß) + Ka-60 Kasatka (bianco e nero) + Ka-60 Kasatka (czarno-biały) + Ka-60 Kasatka (preto e branco) + Ka-60 Касатка (белый и черный) + Ka-60 Kasatka (blanco y negro) + Ka-60 Kasatka (unarmed) Ka-60 Kasatka (unbewaffnet) diff --git a/addons/reload/functions/fnc_canCheckAmmo.sqf b/addons/reload/functions/fnc_canCheckAmmo.sqf index 8fbb37c726..41a46ea465 100644 --- a/addons/reload/functions/fnc_canCheckAmmo.sqf +++ b/addons/reload/functions/fnc_canCheckAmmo.sqf @@ -25,7 +25,7 @@ if (_target isKindOf "StaticWeapon") exitWith { // no check ammo action on destroyed static weapons if (!alive _target) exitWith {false}; - local _found = false; + private _found = false; { if (_x select 2) exitWith { diff --git a/addons/reloadlaunchers/functions/fnc_reloadLauncher.sqf b/addons/reloadlaunchers/functions/fnc_reloadLauncher.sqf index a14e0dfc1f..fc802a025c 100644 --- a/addons/reloadlaunchers/functions/fnc_reloadLauncher.sqf +++ b/addons/reloadlaunchers/functions/fnc_reloadLauncher.sqf @@ -21,5 +21,5 @@ _target selectWeapon _weapon; if (currentWeapon _target != _weapon) exitWith {}; if (currentMagazine _target != "") exitWith {}; -// command is wip, reload ACE_time for launchers is not intended. +// command is wip, reload time for launchers is not intended. _target addWeaponItem [_weapon, _magazine]; diff --git a/addons/repair/CfgVehicles.hpp b/addons/repair/CfgVehicles.hpp index ee31e2c873..85abce4028 100644 --- a/addons/repair/CfgVehicles.hpp +++ b/addons/repair/CfgVehicles.hpp @@ -25,6 +25,7 @@ class CfgVehicles { function = QFUNC(moduleRepairSettings); functionPriority = 1; isGlobal = 1; + isSingular = 1; isTriggerActivated = 0; author = ECSTRING(Common,ACETeam); class Arguments { diff --git a/addons/repair/stringtable.xml b/addons/repair/stringtable.xml index d4b9527f09..ddbccb7777 100644 --- a/addons/repair/stringtable.xml +++ b/addons/repair/stringtable.xml @@ -1,4 +1,4 @@ - + @@ -388,6 +388,7 @@ Ocas Хвост Tail + Cauda Pitot Tube @@ -1000,12 +1001,14 @@ Wym. naprawy kół Requisitos de reparación de ruedas Для ремонта колес требуется + Requerimentos para reparo de rodas Items required to remove/replace wheels Przedmioty potrzebne do wymiany kół Elementos necesarios para quitar/cambiar ruedas Предметы, которые требуются для снятия/замены колес + Itens requeridos para remover/trocar rodas - + \ No newline at end of file diff --git a/addons/respawn/functions/fnc_restoreGear.sqf b/addons/respawn/functions/fnc_restoreGear.sqf index d01e45dd50..a0ca2aa35e 100644 --- a/addons/respawn/functions/fnc_restoreGear.sqf +++ b/addons/respawn/functions/fnc_restoreGear.sqf @@ -37,7 +37,7 @@ if ( }; if (currentWeapon _unit != "") then { - local _index = 0; + private _index = 0; while { _index < 100 && {currentWeaponMode _unit != _activeWeaponMode} diff --git a/addons/scopes/functions/fnc_showZeroing.sqf b/addons/scopes/functions/fnc_showZeroing.sqf index d3d4a38a9d..dd302ff333 100644 --- a/addons/scopes/functions/fnc_showZeroing.sqf +++ b/addons/scopes/functions/fnc_showZeroing.sqf @@ -44,7 +44,7 @@ _horizontal = _display displayCtrl 13; _vertical ctrlSetText (str _elevation); _horizontal ctrlSetText (str _windage); -// Set the ACE_time when to hide the knobs +// Set the time when to hide the knobs GVAR(timeToHide) = ACE_diagTime + 3.0; if !(isNil QGVAR(fadePFH)) exitWith {}; diff --git a/addons/sitting/CfgEventHandlers.hpp b/addons/sitting/CfgEventHandlers.hpp index da7efe1601..3481fa1fb5 100644 --- a/addons/sitting/CfgEventHandlers.hpp +++ b/addons/sitting/CfgEventHandlers.hpp @@ -22,7 +22,7 @@ class Extended_Killed_EventHandlers { class Extended_InitPost_EventHandlers { class ThingX { class ADDON { - init = QUOTE(_this call DFUNC(addSitActions)) + init = QUOTE(_this call DFUNC(addSitActions)); }; }; }; diff --git a/addons/sitting/CfgVehicles.hpp b/addons/sitting/CfgVehicles.hpp index 4ac0d0edb7..cb2422bd6d 100644 --- a/addons/sitting/CfgVehicles.hpp +++ b/addons/sitting/CfgVehicles.hpp @@ -7,6 +7,7 @@ class CfgVehicles { function = QFUNC(moduleInit); scope = 2; isGlobal = 1; + isSingular = 1; icon = QUOTE(PATHTOF(UI\Icon_Module_Sitting_ca.paa)); class Arguments { class enable { diff --git a/addons/spectator/UI/interface.hpp b/addons/spectator/UI/interface.hpp index e8bc6c210f..a3ad215ea2 100644 --- a/addons/spectator/UI/interface.hpp +++ b/addons/spectator/UI/interface.hpp @@ -190,8 +190,8 @@ class GVAR(interface) { 1 }; multiselectEnabled = 0; + maxHistoryDelay = 10e10; onTreeDblClick = QUOTE([ARR_2('onTreeDblClick',_this)] call FUNC(handleInterface)); - onTreeSelChanged = QUOTE([ARR_2('onTreeSelChanged',_this)] call FUNC(handleInterface)); }; class unitFrame: RscFrame { x = 0; diff --git a/addons/spectator/XEH_postInit.sqf b/addons/spectator/XEH_postInit.sqf index 35b463837f..a9737868a0 100644 --- a/addons/spectator/XEH_postInit.sqf +++ b/addons/spectator/XEH_postInit.sqf @@ -8,3 +8,6 @@ GVAR(availableModes) = [[0,1,2], [1,2], [0], [1], [2]] select GVAR(restrictModes); GVAR(availableVisions) = [[-2,-1,0,1], [-2,-1], [-2,0,1], [-2]] select GVAR(restrictVisions); }] call EFUNC(common,addEventHandler); + +// Should prevent unending spectator on mission end +addMissionEventHandler ["Ended",{ [false] call FUNC(setSpectator) }]; diff --git a/addons/spectator/XEH_preInit.sqf b/addons/spectator/XEH_preInit.sqf index e26dc27d07..13f2ba1708 100644 --- a/addons/spectator/XEH_preInit.sqf +++ b/addons/spectator/XEH_preInit.sqf @@ -35,7 +35,7 @@ GVAR(camDistance) = 10; GVAR(camMode) = 0; GVAR(camPan) = 0; GVAR(camPos) = ATLtoASL [worldSize * 0.5, worldSize * 0.5, 20]; -GVAR(camSpeed) = 2.5; +GVAR(camSpeed) = 1.5; GVAR(camTilt) = -10; GVAR(camUnit) = objNull; GVAR(camVision) = -2; diff --git a/addons/spectator/functions/fnc_handleInterface.sqf b/addons/spectator/functions/fnc_handleInterface.sqf index 7c961071c3..8f29b20296 100644 --- a/addons/spectator/functions/fnc_handleInterface.sqf +++ b/addons/spectator/functions/fnc_handleInterface.sqf @@ -45,37 +45,36 @@ switch (toLower _mode) do { }; } forEach [ [localize LSTRING(uiControls),""], - [localize LSTRING(uiToggleUnits),"1"], - [localize LSTRING(uiToggleHelp),"2"], - [localize LSTRING(uiToggleTools),"3"], - [localize LSTRING(uiToggleCompass),"4"], - [localize LSTRING(uiToggleIcons),"5"], - [localize LSTRING(uiToggleMap),"M"], - [localize LSTRING(uiToggleInterface),"Backspace"], + [localize LSTRING(uiToggleUnits),keyName 2], + [localize LSTRING(uiToggleHelp),keyName 3], + [localize LSTRING(uiToggleTools),keyName 4], + [localize LSTRING(uiToggleCompass),keyName 5], + [localize LSTRING(uiToggleIcons),keyName 6], + [localize LSTRING(uiToggleMap),keyName 50], + [localize LSTRING(uiToggleInterface),keyName 14], [localize LSTRING(freeCamControls),""], - [localize LSTRING(freeCamForward),"W"], - [localize LSTRING(freeCamBackward),"S"], - [localize LSTRING(freeCamLeft),"A"], - [localize LSTRING(freeCamRight),"D"], - [localize LSTRING(freeCamUp),"Q"], - [localize LSTRING(freeCamDown),"Z"], + [localize LSTRING(freeCamForward),keyName 17], + [localize LSTRING(freeCamBackward),keyName 31], + [localize LSTRING(freeCamLeft),keyName 30], + [localize LSTRING(freeCamRight),keyName 32], + [localize LSTRING(freeCamUp),keyName 16], + [localize LSTRING(freeCamDown),keyName 44], [localize LSTRING(freeCamPan),"RMB (Hold)"], [localize LSTRING(freeCamDolly),"LMB (Hold)"], [localize LSTRING(freeCamBoost),"Shift (Hold)"], - [localize LSTRING(freeCamFocus),"F"], [localize LSTRING(attributeControls),""], - [localize LSTRING(nextCam),"Up Arrow"], - [localize LSTRING(prevCam),"Down Arrow"], - [localize LSTRING(nextUnit),"Right Arrow"], - [localize LSTRING(prevUnit),"Left Arrow"], - [localize LSTRING(nextVis),"N"], - [localize LSTRING(prevVis),"Ctrl + N"], + [localize LSTRING(nextCam),keyName 200], + [localize LSTRING(prevCam),keyName 208], + [localize LSTRING(nextUnit),keyName 205], + [localize LSTRING(prevUnit),keyName 203], + [localize LSTRING(nextVis),keyName 49], + [localize LSTRING(prevVis),format["%1 + %2",keyName 29,keyname 49]], [localize LSTRING(adjZoom),"Scrollwheel"], - [localize LSTRING(adjSpeed),"Ctrl + Scrollwheel"], - [localize LSTRING(incZoom),"Num-/Num+"], - [localize LSTRING(incSpeed),"Ctrl + Num-/Num+"], - [localize LSTRING(reZoom),"Alt + Num-"], - [localize LSTRING(reSpeed),"Alt + Num+"] + [localize LSTRING(adjSpeed),format["%1 + Scrollwheel",keyName 29]], + [localize LSTRING(incZoom),format["%1/%2",keyName 74,keyName 78]], + [localize LSTRING(incSpeed),format["%1 + %2/%3",keyName 29,keyName 74,keyName 78]], + [localize LSTRING(reZoom),format["%1 + %2",keyName 56,keyName 74]], + [localize LSTRING(reSpeed),format["%1 + %2",keyName 56,keyName 78]] ]; // Handle support for BI's respawn counter @@ -126,7 +125,6 @@ switch (toLower _mode) do { GVAR(heldKeys) resize 255; GVAR(mouse) = [false,false]; GVAR(mousePos) = [0.5,0.5]; - GVAR(treeSel) = objNull; }; // Mouse events case "onmousebuttondown": { @@ -226,19 +224,11 @@ switch (toLower _mode) do { case 32: { // D GVAR(camDolly) set [0, GVAR(camSpeed) * ([1, 2] select _shift)]; }; - case 33: { // F - private ["_sel","_vector"]; - _sel = GVAR(treeSel); - if ((GVAR(camMode) == 0) && {!isNull _sel} && {_sel in GVAR(unitList)}) then { - _vector = (positionCameraToWorld [0,0,0]) vectorDiff (positionCameraToWorld [0,0,25]); - [nil,nil,nil,(getPosATL _sel) vectorAdd _vector] call FUNC(setCameraAttributes); - }; - }; case 44: { // Z GVAR(camBoom) = -0.5 * GVAR(camSpeed) * ([1, 2] select _shift); }; case 49: { // N - if (GVAR(camMode) == 0) then { + if (GVAR(camMode) != 1) then { if (_ctrl) then { [nil,nil,-1] call FUNC(cycleCamera); } else { @@ -250,7 +240,7 @@ switch (toLower _mode) do { [_display,nil,nil,nil,true] call FUNC(toggleInterface); }; case 57: { // Spacebar - // Freecam attachment here, if in external then set cam pos and attach + // Switch between unit and freecam here }; case 74: { // Num - if (_alt) exitWith { [nil,nil,nil,nil,nil,nil, 1.25] call FUNC(setCameraAttributes); }; @@ -261,7 +251,7 @@ switch (toLower _mode) do { }; }; case 78: { // Num + - if (_alt) exitWith { [nil,nil,nil,nil,nil,nil,nil, 2.5] call FUNC(setCameraAttributes); }; + if (_alt) exitWith { [nil,nil,nil,nil,nil,nil,nil, 1.5] call FUNC(setCameraAttributes); }; if (_ctrl) then { [nil,nil,nil,nil,nil,nil,nil, GVAR(camSpeed) + 0.05] call FUNC(setCameraAttributes); } else { @@ -335,15 +325,6 @@ switch (toLower _mode) do { [_newMode,_newUnit] call FUNC(transitionCamera); }; }; - case "ontreeselchanged": { - _args params ["_tree","_sel"]; - - if (count _sel == 3) then { - GVAR(treeSel) = objectFromNetId (_tree tvData _sel); - } else { - GVAR(treeSel) = objNull; - }; - }; case "onunitsupdate": { _args params ["_tree"]; private ["_cachedUnits","_cachedGrps","_cachedSides","_s","_g","_grp","_u","_unit","_side"]; diff --git a/addons/spectator/functions/fnc_handleMap.sqf b/addons/spectator/functions/fnc_handleMap.sqf index fd084f9967..b83ccdcd7d 100644 --- a/addons/spectator/functions/fnc_handleMap.sqf +++ b/addons/spectator/functions/fnc_handleMap.sqf @@ -18,12 +18,32 @@ #include "script_component.hpp" params ["_map"]; -private ["_cachedVehicles","_unit","_color","_icon","_txt"]; +private ["_center","_radius","_scaled","_drawVehicles","_leader","_color","_cachedVehicles","_unit","_icon","_txt"]; if (GVAR(camMode) == 0) then { _map drawIcon ["\A3\UI_F\Data\GUI\Rsc\RscDisplayMissionEditor\iconcamera_ca.paa",[0,0,0,1],GVAR(freeCamera),20,20,GVAR(camPan)]; }; +_center = _map ctrlMapScreenToWorld [0.5,0.5]; +_radius = (_map ctrlMapScreenToWorld [safeZoneX,safeZoneY]) distance2D _center; +_scaled = (ctrlMapScale _map) > 0.2; + +// Draw only group icons when scaled out +_drawVehicles = []; +{ + _leader = leader _x; + if (_scaled) then { + _color = GETVAR(_x,GVAR(gColor),[ARR_4(0,0,0,0)]); + _map drawIcon ["\A3\ui_f\data\map\markers\nato\b_inf.paa", _color, _leader, 20, 20, 0, "", 0, 0]; + } else { + if ((_leader distance2D _center) < _radius) then { + _drawVehicles append (units _x); + }; + }; + nil +} count GVAR(groupList); + +// Draw units when group leader is within screen bounds _cachedVehicles = []; { _unit = vehicle _x; @@ -41,7 +61,7 @@ _cachedVehicles = []; _icon = GETVAR(_unit,GVAR(uIcon),""); _txt = ["", GETVAR(_x,GVAR(uName),"")] select (isPlayer _x); - _map drawIcon [_icon, _color, _unit, 19, 19, getDir _unit, _txt, 1, 0.03]; + _map drawIcon [_icon, _color, _unit, 19, 19, getDir _unit, _txt, 1, 0.04]; }; - false -} count GVAR(unitList); + nil +} count (_drawVehicles arrayIntersect GVAR(unitList)); diff --git a/addons/spectator/functions/fnc_handleToolbar.sqf b/addons/spectator/functions/fnc_handleToolbar.sqf index 878f3e46de..4e79c172bd 100644 --- a/addons/spectator/functions/fnc_handleToolbar.sqf +++ b/addons/spectator/functions/fnc_handleToolbar.sqf @@ -26,8 +26,13 @@ private ["_name","_vision","_fov","_speed","_mode","_time","_toolbar"]; _toolbar = _display displayCtrl IDC_TOOL; // Find all tool values +if (GVAR(camVision) >= 0) then { + _vision = localize LSTRING(VisionThermal); +} else { + _vision = [localize LSTRING(VisionNight), localize LSTRING(VisionNormal)] select (GVAR(camVision) < -1); +}; + if (GVAR(camMode) == 0) then { - _vision = if (GVAR(camVision) >= 0) then {localize LSTRING(VisionThermal)} else { [localize LSTRING(VisionNight), localize LSTRING(VisionNormal)] select (GVAR(camVision) < -1) }; _fov = format ["%1x", floor(GVAR(camZoom) * 100) * 0.01]; _speed = format ["%1 m/s", floor(GVAR(camSpeed) * 100) * 0.01]; } else { diff --git a/addons/spectator/functions/fnc_interrupt.sqf b/addons/spectator/functions/fnc_interrupt.sqf index 48cca7d102..72bb3eaa32 100644 --- a/addons/spectator/functions/fnc_interrupt.sqf +++ b/addons/spectator/functions/fnc_interrupt.sqf @@ -4,7 +4,7 @@ * * Arguments: * 0: Reason - * 1: Interrupting + * 1: Interrupting (default: true) * * Return Value: * None diff --git a/addons/spectator/functions/fnc_respawnTemplate.sqf b/addons/spectator/functions/fnc_respawnTemplate.sqf index d903e3ecc4..4584a1fc3c 100644 --- a/addons/spectator/functions/fnc_respawnTemplate.sqf +++ b/addons/spectator/functions/fnc_respawnTemplate.sqf @@ -34,7 +34,7 @@ _pos = (getPosATL _unit) vectorAdd [0,0,5]; // Enter/exit spectator based on the respawn type and whether killed/respawned if (alive _unit) then { if (_respawn == 1) then { - [_unit,QGVAR(isSeagull)] call EFUNC(common,hideUnit); + [_unit] call FUNC(stageSpectator); [2,_killer,_vision,_pos,getDir _unit] call FUNC(setCameraAttributes); [true] call FUNC(setSpectator); } else { diff --git a/addons/spectator/functions/fnc_setCameraAttributes.sqf b/addons/spectator/functions/fnc_setCameraAttributes.sqf index dd8dd3ef6a..f908b30b76 100644 --- a/addons/spectator/functions/fnc_setCameraAttributes.sqf +++ b/addons/spectator/functions/fnc_setCameraAttributes.sqf @@ -1,23 +1,24 @@ /* * Author: SilentSpike * Sets the spectator camera attributes as desired + * All values are optional and default to whatever the current value is * * Arguments: - * 0: Camera mode + * 0: Camera mode * - 0: Free * - 1: Internal * - 2: External - * 1: Camera unit (objNull for random) - * 2: Camera vision + * 1: Camera unit (objNull for random) + * 2: Camera vision * - -2: Normal * - -1: Night vision * - 0: Thermal white hot * - 1: Thermal black hot - * 3: Camera position (ATL) - * 4: Camera pan (0 - 360) - * 5: Camera tilt (-90 - 90) - * 6: Camera zoom (0.01 - 2) - * 7: Camera speed in m/s (0.05 - 10) + * 3: Camera position (ATL) + * 4: Camera pan (0 - 360) + * 5: Camera tilt (-90 - 90) + * 6: Camera zoom (0.01 - 2) + * 7: Camera speed in m/s (0.05 - 10) * * Return Value: * None diff --git a/addons/spectator/functions/fnc_setSpectator.sqf b/addons/spectator/functions/fnc_setSpectator.sqf index efa7000b8f..065ca0079b 100644 --- a/addons/spectator/functions/fnc_setSpectator.sqf +++ b/addons/spectator/functions/fnc_setSpectator.sqf @@ -7,7 +7,8 @@ * The spectator interface will be opened/closed * * Arguments: - * 0: Spectator state of local client + * 0: Spectator state of local client (default: true) + * 1: Force interface (default: true) * * Return Value: * None @@ -20,7 +21,7 @@ #include "script_component.hpp" -params [["_set",true,[true]]]; +params [["_set",true,[true]], ["_force",true,[true]]]; // Only clients can be spectators if (!hasInterface) exitWith {}; @@ -29,7 +30,10 @@ if (!hasInterface) exitWith {}; if (_set isEqualTo GVAR(isSet)) exitwith {}; // Handle common addon audio -if (["ace_hearing"] call EFUNC(common,isModLoaded)) then {EGVAR(hearing,disableVolumeUpdate) = _set}; +if (["ace_hearing"] call EFUNC(common,isModLoaded)) then { + EGVAR(hearing,disableVolumeUpdate) = _set; + EGVAR(hearing,deafnessDV) = 0; +}; if (["acre_sys_radio"] call EFUNC(common,isModLoaded)) then {[_set] call acre_api_fnc_setSpectator}; if (["task_force_radio"] call EFUNC(common,isModLoaded)) then {[player, _set] call TFAR_fnc_forceSpectator}; @@ -45,7 +49,6 @@ if (_set) then { GVAR(heldKeys) resize 255; GVAR(mouse) = [false,false]; GVAR(mousePos) = [0.5,0.5]; - GVAR(treeSel) = objNull; // Update units before opening to support pre-set camera unit [] call FUNC(updateUnits); @@ -75,7 +78,17 @@ if (_set) then { [{ // Create the display (findDisplay 46) createDisplay QGVAR(interface); - }, []] call EFUNC(common,execNextFrame); + + // If not forced, make esc end spectator + if (_this) then { + (findDisplay 12249) displayAddEventHandler ["KeyDown", { + if (_this select 1 == 1) then { + [false] call ace_spectator_fnc_setSpectator; + true + }; + }]; + }; + }, !_force] call EFUNC(common,execNextFrame); // Cache and disable nametag settings if (["ace_nametags"] call EFUNC(common,isModLoaded)) then { @@ -119,7 +132,6 @@ if (_set) then { GVAR(heldKeys) = nil; GVAR(mouse) = nil; GVAR(mousePos) = nil; - GVAR(treeSel) = nil; // Reset nametag settings if (["ace_nametags"] call EFUNC(common,isModLoaded)) then { diff --git a/addons/spectator/functions/fnc_stageSpectator.sqf b/addons/spectator/functions/fnc_stageSpectator.sqf index 7f0d862719..61445f3dd9 100644 --- a/addons/spectator/functions/fnc_stageSpectator.sqf +++ b/addons/spectator/functions/fnc_stageSpectator.sqf @@ -7,8 +7,8 @@ * Upon unstage, units will be moved to the position they were in upon staging * * Arguments: - * 0: Unit to put into spectator stage - * 1: Spectator stage + * 0: Unit to put into spectator stage (default: player) + * 1: Unit should be staged (default: true) * * Return Value: * None diff --git a/addons/spectator/functions/fnc_transitionCamera.sqf b/addons/spectator/functions/fnc_transitionCamera.sqf index edc7fa23a2..0f6eb3ffc7 100644 --- a/addons/spectator/functions/fnc_transitionCamera.sqf +++ b/addons/spectator/functions/fnc_transitionCamera.sqf @@ -49,7 +49,6 @@ if (_newMode == 0) then { // Free // Preserve camUnit value for consistency when manually changing view _camera cameraEffect ["internal", "back"]; - showCinemaBorder false; // Apply the camera zoom _camera camSetFov -(linearConversion [0.01,2,GVAR(camZoom),-2,-0.01,true]); @@ -63,23 +62,6 @@ if (_newMode == 0) then { // Free GVAR(camAgent) switchCamera "internal"; clearRadio; - - // If new vision isn't available then keep current (unless current also isn't) - if !(_newVision in GVAR(availableVisions)) then { - _newVision = GVAR(availableVisions) select ((GVAR(availableVisions) find GVAR(camVision)) max 0); - }; - - // Vision mode only applies to free cam - if (_newVision < 0) then { - false setCamUseTi 0; - camUseNVG (_newVision >= -1); - } else { - true setCamUseTi _newVision; - }; - GVAR(camVision) = _newVision; - - // Handle camera movement - if (isNil QGVAR(camHandler)) then { GVAR(camHandler) = [FUNC(handleCamera), 0] call CBA_fnc_addPerFrameHandler; }; } else { _camera = GVAR(unitCamera); @@ -103,10 +85,6 @@ if (_newMode == 0) then { // Free } else { // Switch to the camera _camera cameraEffect ["internal", "back"]; - showCinemaBorder false; - - // Handle camera orbit movement - if (isNil QGVAR(camHandler)) then { GVAR(camHandler) = [FUNC(handleCamera), 0] call CBA_fnc_addPerFrameHandler; }; }; // Clear radio if group changed @@ -117,4 +95,27 @@ if (_newMode == 0) then { // Free GVAR(camUnit) = _newUnit; }; +if (_newMode in [0,2]) then { + // Set up camera UI + showCinemaBorder false; + cameraEffectEnableHUD true; + + // Handle camera movement + if (isNil QGVAR(camHandler)) then { GVAR(camHandler) = [FUNC(handleCamera), 0] call CBA_fnc_addPerFrameHandler; }; + + // If new vision isn't available then keep current (unless current also isn't) + if !(_newVision in GVAR(availableVisions)) then { + _newVision = GVAR(availableVisions) select ((GVAR(availableVisions) find GVAR(camVision)) max 0); + }; + + // Vision mode applies to free and external cam + if (_newVision < 0) then { + false setCamUseTi 0; + camUseNVG (_newVision >= -1); + } else { + true setCamUseTi _newVision; + }; + GVAR(camVision) = _newVision; +}; + GVAR(camMode) = _newMode; diff --git a/addons/spectator/functions/fnc_updateUnits.sqf b/addons/spectator/functions/fnc_updateUnits.sqf index 0297b31b8d..e5b15b6bc1 100644 --- a/addons/spectator/functions/fnc_updateUnits.sqf +++ b/addons/spectator/functions/fnc_updateUnits.sqf @@ -4,7 +4,7 @@ * * Arguments: * 0: Units to add to the whitelist - * 1: Use blacklist + * 1: Use blacklist (default: false) * * Return Value: * None diff --git a/addons/spectator/stringtable.xml b/addons/spectator/stringtable.xml index 00d50e4704..d8c7cd1310 100644 --- a/addons/spectator/stringtable.xml +++ b/addons/spectator/stringtable.xml @@ -344,14 +344,6 @@ Ускорение камеры Aumento de velocidad - - Focus on Unit - Skup na jednostce - Focar na unidade - Фокус на юните - Zaměřit se na Jednotku - Centrarse en la unidad - Interface Interfejs diff --git a/addons/tacticalladder/stringtable.xml b/addons/tacticalladder/stringtable.xml index b347c4e2d9..3d377ed420 100644 --- a/addons/tacticalladder/stringtable.xml +++ b/addons/tacticalladder/stringtable.xml @@ -1,4 +1,4 @@ - + @@ -41,6 +41,8 @@ Extend, +Ctrl tilt Ausfahren, +Strg kippen Rozłóż, +Ctrl nachyl + Extender, +Ctrl tilt + Разложить, +Ctrl наклонить Position ladder @@ -67,4 +69,4 @@ Pegar escada - + \ No newline at end of file diff --git a/addons/vehiclelock/CfgVehicles.hpp b/addons/vehiclelock/CfgVehicles.hpp index 9e6f155616..873c875f09 100644 --- a/addons/vehiclelock/CfgVehicles.hpp +++ b/addons/vehiclelock/CfgVehicles.hpp @@ -74,6 +74,7 @@ class CfgVehicles { function = QFUNC(moduleInit); scope = 2; isGlobal = 0; + isSingular = 1; icon = QUOTE(PATHTOF(UI\Icon_Module_VehicleLock_ca.paa)); functionPriority = 0; class Arguments { diff --git a/addons/vehicles/CfgVehicles.hpp b/addons/vehicles/CfgVehicles.hpp index a07781a413..8834cc1d4d 100644 --- a/addons/vehicles/CfgVehicles.hpp +++ b/addons/vehicles/CfgVehicles.hpp @@ -91,7 +91,7 @@ class CfgVehicles { class O_APC_Tracked_02_cannon_F: O_APC_Tracked_02_base_F { class Turrets: Turrets { class MainTurret: MainTurret { - weapons[] = {"autocannon_30mm_CTWS","ACE_LMG_coax_MBT_01","missiles_titan"}; + weapons[] = {"autocannon_30mm_CTWS","ACE_LMG_coax_PKT_mem2","missiles_titan"}; magazines[] = {"140Rnd_30mm_MP_shells_Tracer_Green","60Rnd_30mm_APFSDS_shells_Tracer_Green","2000Rnd_762x51_Belt_Green","2Rnd_GAT_missiles"}; }; }; @@ -101,7 +101,7 @@ class CfgVehicles { fuelCapacity = 660 * FUEL_FACTOR; class Turrets: Turrets { class MainTurret: MainTurret { - weapons[] = {"autocannon_30mm","ACE_LMG_coax_APC_Tracked_03"}; + weapons[] = {"autocannon_30mm","ACE_LMG_coax_L94A1_mem3"}; magazines[] = {"140Rnd_30mm_MP_shells_Tracer_Yellow","60Rnd_30mm_APFSDS_shells_Tracer_Yellow","1000Rnd_762x51_Belt_Yellow","1000Rnd_762x51_Belt_Yellow"}; class Turrets: Turrets { class CommanderOptics: CommanderOptics {}; @@ -114,7 +114,7 @@ class CfgVehicles { fuelCapacity = 550 * FUEL_FACTOR; class Turrets: Turrets { class MainTurret: MainTurret { - weapons[] = {"cannon_120mm_long","ACE_LMG_coax_MBT_01"}; + weapons[] = {"cannon_120mm_long","ACE_LMG_coax_MAG58_mem3"}; magazines[] = {"28Rnd_120mm_APFSDS_shells_Tracer_Yellow","14Rnd_120mm_HE_shells_Tracer_Yellow","2000Rnd_762x51_Belt_Yellow","2000Rnd_762x51_Belt_Yellow"}; class Turrets: Turrets { class CommanderOptics: CommanderOptics {}; @@ -127,8 +127,8 @@ class CfgVehicles { fuelCapacity = 500 * FUEL_FACTOR; class Turrets: Turrets { class MainTurret: MainTurret { - weapons[] = {"cannon_120mm","ACE_LMG_coax_MBT_01"}; - magazines[] = {"32Rnd_120mm_APFSDS_shells_Tracer_Red","16Rnd_120mm_HE_shells_Tracer_Red","2000Rnd_762x51_Belt_Green","2000Rnd_762x51_Belt_Green"}; + weapons[] = {"cannon_120mm","ACE_LMG_coax_MAG58_mem2"}; + magazines[] = {"32Rnd_120mm_APFSDS_shells_Tracer_Red","16Rnd_120mm_HE_shells_Tracer_Red","2000Rnd_762x51_Belt_Red","2000Rnd_762x51_Belt_Red"}; class Turrets: Turrets { class CommanderOptics: CommanderOptics {}; }; @@ -281,8 +281,8 @@ class CfgVehicles { class B_APC_Wheeled_01_cannon_F: B_APC_Wheeled_01_base_F { class Turrets: Turrets { class MainTurret: MainTurret { - weapons[] = {"autocannon_40mm_CTWS","ACE_LMG_coax_MBT_01"}; - magazines[] = {"60Rnd_40mm_GPR_Tracer_Red_shells","40Rnd_40mm_APFSDS_Tracer_Red_shells","2000Rnd_762x51_Belt_Green"}; + weapons[] = {"autocannon_40mm_CTWS","ACE_LMG_coax_MAG58_mem2"}; + magazines[] = {"60Rnd_40mm_GPR_Tracer_Red_shells","40Rnd_40mm_APFSDS_Tracer_Red_shells","2000Rnd_762x51_Belt_Red"}; }; }; }; @@ -301,8 +301,8 @@ class CfgVehicles { class B_MBT_01_TUSK_F: B_MBT_01_cannon_F { class Turrets: Turrets { class MainTurret: MainTurret { - weapons[] = {"cannon_105mm","ACE_LMG_coax_MBT_01"}; - magazines[] = {"40Rnd_105mm_APFSDS_T_Red","20Rnd_105mm_HEAT_MP_T_Red","2000Rnd_762x51_Belt_Green","2000Rnd_762x51_Belt_Green"}; + weapons[] = {"cannon_105mm","ACE_LMG_coax_MAG58_mem2"}; + magazines[] = {"40Rnd_105mm_APFSDS_T_Red","20Rnd_105mm_HEAT_MP_T_Red","2000Rnd_762x51_Belt_Red","2000Rnd_762x51_Belt_Red"}; class Turrets: Turrets { class CommanderOptics: CommanderOptics {}; }; @@ -326,7 +326,7 @@ class CfgVehicles { class I_APC_Wheeled_03_cannon_F: I_APC_Wheeled_03_base_F { class Turrets: Turrets { class MainTurret: MainTurret { - weapons[] = {"autocannon_30mm_CTWS","ACE_LMG_coax_MBT_01","missiles_titan"}; + weapons[] = {"autocannon_30mm_CTWS","ACE_LMG_coax_MAG58_mem2","missiles_titan"}; magazines[] = {"140Rnd_30mm_MP_shells_Tracer_Yellow","60Rnd_30mm_APFSDS_shells_Tracer_Yellow","2000Rnd_762x51_Belt_Yellow","2Rnd_GAT_missiles"}; }; }; diff --git a/addons/vehicles/CfgWeapons.hpp b/addons/vehicles/CfgWeapons.hpp index 76feb1818a..5cb30518d9 100644 --- a/addons/vehicles/CfgWeapons.hpp +++ b/addons/vehicles/CfgWeapons.hpp @@ -5,8 +5,26 @@ class CfgWeapons { class LMG_RCWS: MGun {}; class LMG_coax; - class ACE_LMG_coax_MBT_01: LMG_coax {}; - class ACE_LMG_coax_APC_Tracked_03: LMG_coax {}; + class ACE_LMG_coax_L94A1_mem3: LMG_coax {}; + class ACE_LMG_coax_PKT_mem2: LMG_coax { + class GunParticles { + class effect1 { + positionName = "usti hlavne2"; + directionName = "konec hlavne2"; + effectName = "MachineGunCloud"; + }; + }; + }; + class ACE_LMG_coax_MAG58_mem3: LMG_coax {}; + class ACE_LMG_coax_MAG58_mem2: LMG_coax { + class GunParticles { + class effect1 { + positionName = "usti hlavne2"; + directionName = "konec hlavne2"; + effectName = "MachineGunCloud"; + }; + }; + }; class LMG_Minigun: LMG_RCWS { magazines[] = {"1000Rnd_65x39_Belt","1000Rnd_65x39_Belt_Green","1000Rnd_65x39_Belt_Tracer_Green","1000Rnd_65x39_Belt_Tracer_Red","1000Rnd_65x39_Belt_Tracer_Yellow","1000Rnd_65x39_Belt_Yellow","2000Rnd_65x39_Belt","2000Rnd_65x39_Belt_Green","2000Rnd_65x39_Belt_Tracer_Green","2000Rnd_65x39_Belt_Tracer_Green_Splash","2000Rnd_65x39_Belt_Tracer_Red","2000Rnd_65x39_Belt_Tracer_Yellow","2000Rnd_65x39_Belt_Tracer_Yellow_Splash","2000Rnd_65x39_Belt_Yellow","2000Rnd_762x51_Belt_T_Green","2000Rnd_762x51_Belt_T_Red","2000Rnd_762x51_Belt_T_Yellow","200Rnd_65x39_Belt","200Rnd_65x39_Belt_Tracer_Green","200Rnd_65x39_Belt_Tracer_Red","200Rnd_65x39_Belt_Tracer_Yellow","5000Rnd_762x51_Belt","5000Rnd_762x51_Yellow_Belt"}; diff --git a/addons/viewdistance/CfgVehicles.hpp b/addons/viewdistance/CfgVehicles.hpp index 8e4e30d266..86d906bfce 100644 --- a/addons/viewdistance/CfgVehicles.hpp +++ b/addons/viewdistance/CfgVehicles.hpp @@ -7,6 +7,7 @@ class CfgVehicles { displayName = CSTRING(Module_DisplayName); scope = 2; isGlobal = 1; + isSingular = 1; //icon = ""; // needs an icon class Arguments { class moduleViewDistanceEnabled { diff --git a/addons/weather/CfgVehicles.hpp b/addons/weather/CfgVehicles.hpp index ebdd65c30d..f37a62449a 100644 --- a/addons/weather/CfgVehicles.hpp +++ b/addons/weather/CfgVehicles.hpp @@ -8,6 +8,7 @@ class CfgVehicles { function = QUOTE(DFUNC(initModuleSettings)); functionPriority = 1; isGlobal = 1; + isSingular = 1; isTriggerActivated = 0; author = ECSTRING(common,ACETeam); class Arguments { diff --git a/addons/winddeflection/CfgVehicles.hpp b/addons/winddeflection/CfgVehicles.hpp index 2694bb1b34..c52949e1fc 100644 --- a/addons/winddeflection/CfgVehicles.hpp +++ b/addons/winddeflection/CfgVehicles.hpp @@ -8,6 +8,7 @@ class CfgVehicles { function = QUOTE(DFUNC(initModuleSettings)); functionPriority = 1; isGlobal = 1; + isSingular = 1; isTriggerActivated = 0; author = ECSTRING(common,ACETeam); class Arguments { diff --git a/addons/zeus/CfgVehicles.hpp b/addons/zeus/CfgVehicles.hpp index 35c43b0e84..f5144e60e6 100644 --- a/addons/zeus/CfgVehicles.hpp +++ b/addons/zeus/CfgVehicles.hpp @@ -23,6 +23,7 @@ class CfgVehicles { function = QFUNC(moduleZeusSettings); functionPriority = 1; isGlobal = 1; + isSingular = 1; isTriggerActivated = 0; author = "SilentSpike"; class Arguments { diff --git a/addons/zeus/stringtable.xml b/addons/zeus/stringtable.xml index 6063f5011a..b885e1cec1 100644 --- a/addons/zeus/stringtable.xml +++ b/addons/zeus/stringtable.xml @@ -1,4 +1,4 @@ - + @@ -214,15 +214,23 @@ Add Spare Wheel + Adicionar roda sobressalente + Добавить запасное колесо Adds a Spare Wheel to the vehicle + Adiciona uma roda sobressalente ao veículo + Добавляет запасное колесо в транспорт Add Spare Track + Adicionar esteira sobressalente + Дабавить запасную гусеницу Adds a Spare Track to the vehicle + Adiciona uma esteira sobressalente ao veículo + Добавляет запасную гусеницу в транспорт Unit must be alive @@ -264,9 +272,13 @@ Unit must be a vehicle with cargo space + Unidade deve ser um veículo com espaço em carga + Юнит должен быть транспортом с грузовым отсеком Unit must have cargo space left + Unidade deve conter espaço sobressalente + Юнит должен иметь свободное место в грузовом отсеке Unit must not be captive @@ -317,4 +329,4 @@ Añadir cualquier objeto creado a todos los directores en la misión - + \ No newline at end of file diff --git a/docs/README_DE.md b/docs/README_DE.md index 24be427392..a51c562de8 100644 --- a/docs/README_DE.md +++ b/docs/README_DE.md @@ -3,25 +3,25 @@

- ACE3 Version + ACE3 Version - ACE3 Download + ACE3 Download - ACE3 Issues + ACE3 Issues - BIF Thread + BIF Thread - ACE3 License + ACE3 License - ACE3 Slack + ACE3 Slack - ACE3 Build Status + ACE3 Build Status

Benötigt die aktuellste Version von CBA A3. Besucht uns auf Facebook | YouTube | Twitter | Reddit

@@ -30,30 +30,54 @@ Da die MOD vollkommen als **open-source** Projekt gestaltet ist, steht es jedem frei Änderungen vorzuschlagen, oder seine eigene, modifizierte Version zu erstellen, solange diese ebenfalls der Öffentlichkeit zugänglich ist und mit GNU General Public License übereinstimmt. (Weitere Informationen ist der Lizenzdatei in diesem Projekt entnehmbar) -Die Mod ist **modular gestaltet** — beinahe jede PBO kann entfernt werden, sodass jede Gemeinschaft ihre eigene Version der Mod unterhalten kann. Dies kann zum Beispiel einige Funktionalitäten ausschließen, da das Feature nicht gewünscht ist, oder es mit einer anderen MOD in Konflikt gerät etc. .Ebenfalls können viele Einstellungen vom Missionsersteller vorgenommen werden (u.a. am medizinischem System), sodass eine individuelle Erfahrung gewährleistet wird. +Die Mod ist **modular aufgebaut**. Beinahe jede PBO kann entfernt werden, sodass jede Gemeinschaft ihre eigene Version der Mod unterhalten kann. Dies kann zum Beispiel einige Funktionalitäten ausschließen, wenn gewisse Features nicht gewünscht sind, oder es mit einer anderen Mod in Konflikt gerät. Ebenfalls können viele Einstellungen vom Missionsersteller vorgenommen werden (u.a. am Sanitätssystem), sodass eine individuelle Erfahrung gewährleistet werden kann. -### Features -- Verbessertes medizinisches System -- Logistik System: U.a. Transport und Fahrzeugreparatur -- Sprengstoffsystem mit unterschiedlichen Zündern +### Hauptmerkmale +- Vollkommen neues 3D-Interaktionssystem +- Leistungs- und stabilitätsoptimiert +- Hauptmerkmal auf Modularität und individuelle Anpassungsmöglichkeiten +- Neue, flexible Spieler- und Servereinstellungen +- Verbessertes Sanitätssystem mit unterschiedlichen Stufen (Basis/Erweitert) +- Echte und stetige Wettersynchronisation +- Ballistik basierend auf vielen Faktoren u.a. Wetter und Wind - Gefangenensystem -- Reale Namen für Arma 3 Fahrzeuge und Waffen -- Realistisches, ballistisches Verhalten (Wind und Luftfeuchtigkeit) -- Simulation der Rückstrahlzone -- Ein Feuerleitsystem für gepanzerte Fahrzeuge und Hubschrauber -***und noch viel mehr...*** +- Sprengtoffmechaniken mit unterschiedlichen Zündern +- Kartenverbesserungen – Setzen von Markierungen / Kartenwerkzeuge +- Erweitertes Raketenlenksystem + +#### Weitere Mechaniken +- Tragen und Ziehen +- Waffen und Fahrzeuge tragen die Namen ihrer Vorbilder aus der echten Welt +- Ein Feuerleitsystem (FLS) für Hubschrauber und Panzer +- Viele Funktionen werden in C/C++ Erweiterungen berechnet +- Rückstrahlzonen- und Überdrucksimulation +- Einwegwaffen +- Realistische G-Kräfte +- Fahrzeuge abschließen +- Realistische Nacht- und Thermalsicht +- Magazine umpacken +- Realistische Waffen Er- bzw. Überhitzung +- Temporäre Taubheit bei zu lauten Geräuschen +- Verbesserte Ragdoll-Physik +- Verbesserte Interaktionen für MG2s und Munitionsschlepper +- Einstellbare Zielfernrohre +- Keine Ruheanimationen bei gesenkter Waffe +- Über Hindernisse springen, über Mauern klettern, Zäune durchtrennen +- Kein "sprechender Charkater" +- Vector IV, MicroDAGR und Kestrel
+***und noch viel viel mehr...*** #### Anleitungen Du hast ACE3 installiert, hast aber keine Ahnung was und wie alles funktioniert und wo sich was befindet? - [Erste Schritte](http://ace3mod.com/wiki/user/getting-started.html). #### Mitwirken -Wenn du bei der Entwicklung der MOD mithelfen möchtest, so kannst du dies tun, indem du nach Fehlern Ausschau hältst, oder neue Funktionen vorschlägst. Um etwas beizutragen, "Forke" einfach dieses Archiv (bzw. repository) und erstelle deine "Pull-Request", welche von anderen Entwicklern und Beiträgern überprüft wird. Bitte trage dich dabei in [`AUTHORS.txt`](https://github.com/acemod/ACE3/blob/master/AUTHORS.txt) mit deinem Nutzernamen und einer gütligen Email-Adresse ein. +Wenn du bei der Entwicklung von ACE3 mithelfen möchtest, kannst du dies tun, indem du nach Fehlern Ausschau hältst oder neue Funktionen vorschlägst. Um etwas beizutragen, "Forke" dieses Repository und erstelle deine "Pull-Requests", welche von anderen Entwicklern und Beiträgern überprüft werden. Bitte trage dich dabei in [`AUTHORS.txt`](https://github.com/acemod/ACE3/blob/master/AUTHORS.txt) mit deinem Nutzernamen und einer gültigen Email-Adresse ein. -Um einen Fehler oder ein Feature zu melden bzw. ein bereits Bestehendes zu ändern - nutze unseren [Issue Tracker](https://github.com/acemod/ACE3/issues). Besuche auch: +Um uns einen Fehler, Anregungen oder neue Funktionalitäten mitzuteilen: Nutze unseren [Issue Tracker](https://github.com/acemod/ACE3/issues). Besuche auch: - [Wie kann ich ein Problem melden](http://ace3mod.com/wiki/user/how-to-report-an-issue.html) -- [Wie kann ich ein Feature Request erstellen](http://ace3mod.com/wiki/user/how-to-make-a-feature-request.html) +- [Wie kann ich ein Wunsch zu einer neuen Funktion mitteilen?](http://ace3mod.com/wiki/user/how-to-make-a-feature-request.html) -#### Testen & MOD erstellen -Wenn du die neusten Entwicklungen erleben und uns dabei helfen möchtest bestehende Fehler zu entdecken, lade dir einfach die "Master Branch" herunter. Entweder nutzt du [Git](https://help.github.com/articles/fetching-a-remote/) - wenn die Schritte bekannt sind - oder du lädst es dir direkt über [diesen Link](https://github.com/acemod/ACE3/archive/master.zip) herunter. -Wie du deine eigene Entwicklungsumgebung und eine Testversion von ACE3 erstellst folge [dieser Anleitung](https://github.com/acemod/ACE3/blob/master/documentation/development/setting-up-the-development-environment.md). +#### Testen & Mod erstellen +Wenn du die neusten Entwicklungen erleben und uns dabei helfen möchtest bestehende Fehler zu entdecken, lade dir die "Master Branch" herunter. Entweder nutzt du [Git](https://help.github.com/articles/fetching-a-remote/) - wenn die Schritte bekannt sind - oder du lädst es dir direkt über [diesen Link](https://github.com/acemod/ACE3/archive/master.zip) herunter. +Wie du deine eigene Entwicklungsumgebung und eine Testversion von ACE3 erstellst, folge [dieser Anleitung](https://github.com/acemod/ACE3/blob/master/documentation/development/setting-up-the-development-environment.md). diff --git a/docs/README_PL.md b/docs/README_PL.md index b12f574b6f..4d7f5d1e09 100644 --- a/docs/README_PL.md +++ b/docs/README_PL.md @@ -3,25 +3,25 @@

- ACE3 Wersja + ACE3 Wersja - ACE3 Pobierz + ACE3 Pobierz - ACE3 Zagadnienia + ACE3 Zagadnienia - Temat BIF + Temat BIF - ACE3 Licencja + ACE3 Licencja - ACE3 Slack + ACE3 Slack - ACE3 Build Status + ACE3 Build Status

Wymaga najnowszej wersji CBA A3. Odwiedź nas na Facebook | YouTube | Twitter | Reddit

diff --git a/extras/assets/icons/Icon_Module_png/Icon_Module_Make_Unit_Handcuffed_ca.png b/extras/assets/icons/Icon_Module_png/Icon_Module_Make_Unit_Handcuffed_ca.png new file mode 100644 index 0000000000..e097b6ac7f Binary files /dev/null and b/extras/assets/icons/Icon_Module_png/Icon_Module_Make_Unit_Handcuffed_ca.png differ diff --git a/mod.cpp b/mod.cpp index 2e8513a952..096e6d563d 100644 --- a/mod.cpp +++ b/mod.cpp @@ -1,8 +1,8 @@ -name = "Advanced Combat Environment 3.3.2"; +name = "Advanced Combat Environment 3.3.3"; picture = "logo_ace3_ca.paa"; actionName = "GitHub"; action = "https://github.com/acemod/ACE3"; -description = "ACE3 - Version 3.3.2"; +description = "ACE3 - Version 3.3.3"; logo = "logo_ace3_ca.paa"; logoOver = "logo_ace3_ca.paa"; tooltip = "ACE3"; diff --git a/tools/cba/addons/main/script_macros_common.hpp b/tools/cba/addons/main/script_macros_common.hpp index 78893db662..d205bfc975 100644 --- a/tools/cba/addons/main/script_macros_common.hpp +++ b/tools/cba/addons/main/script_macros_common.hpp @@ -199,7 +199,7 @@ Parameters: Example: (begin example) - ERROR("Value not found","value of frog not found in config ...yada...yada..."); + ERROR("value of frog not found in config ...yada...yada..."); (end) Author: @@ -674,8 +674,9 @@ Author: Sickboy ------------------------------------------- */ #define GVAR(var1) DOUBLES(ADDON,var1) -#define EGVAR(var1,var2) DOUBLES(DOUBLES(PREFIX,var1),var2) +#define EGVAR(var1,var2) TRIPLES(PREFIX,var1,var2) #define QGVAR(var1) QUOTE(GVAR(var1)) +#define QEGVAR(var1,var2) QUOTE(EGVAR(var1,var2)) /* ------------------------------------------- Macro: GVARMAIN() @@ -694,6 +695,7 @@ Author: Sickboy ------------------------------------------- */ #define GVARMAIN(var1) GVARMAINS(PREFIX,var1) +#define QGVARMAIN(var1) QUOTE(GVARMAIN(var1)) // TODO: What's this? #define SETTINGS DOUBLES(PREFIX,settings) #define CREATELOGIC CREATELOGICS(PREFIX,COMPONENT) diff --git a/tools/cba/addons/xeh/init_pre.sqf b/tools/cba/addons/xeh/init_pre.sqf index 44b4657aca..1b6642c777 100644 --- a/tools/cba/addons/xeh/init_pre.sqf +++ b/tools/cba/addons/xeh/init_pre.sqf @@ -356,5 +356,11 @@ SLX_XEH_STR spawn { */ { (_x/SLX_XEH_STR_PreInit) call FUNC(init_once) } forEach SLX_XEH_CONFIG_FILES; - -XEH_LOG("XEH: PreInit Finished. " + PFORMAT_3("CACHE DISABLED? (Disable caching with cba_cache_disable.pbo)",SLX_XEH_RECOMPILE,CBA_COMPILE_RECOMPILE,CBA_FUNC_RECOMPILE)); +private "_s"; +// Normally, full caching is enabled. If not, log an informative message. +_s = if (SLX_XEH_RECOMPILE || CBA_COMPILE_RECOMPILE || CBA_FUNC_RECOMPILE) then { + PFORMAT_3(" CACHE DISABLED? (Disable caching with cba_cache_disable.pbo)",SLX_XEH_RECOMPILE,CBA_COMPILE_RECOMPILE,CBA_FUNC_RECOMPILE) +} else { + "" +}; +XEH_LOG("XEH: PreInit Finished." + _s); diff --git a/tools/cba/addons/xeh/script_xeh.hpp b/tools/cba/addons/xeh/script_xeh.hpp index ba55dbc917..4f242b492e 100644 --- a/tools/cba/addons/xeh/script_xeh.hpp +++ b/tools/cba/addons/xeh/script_xeh.hpp @@ -40,6 +40,7 @@ local = "_this call SLX_XEH_EH_Local"; \ respawn = "_this call SLX_XEH_EH_Respawn"; \ put = "_this call SLX_XEH_EH_Put"; \ take = "_this call SLX_XEH_EH_Take"; \ +seatSwitched = "_this call SLX_XEH_EH_SeatSwitched"; \ soundPlayed = "_this call SLX_XEH_EH_SoundPlayed"; \ weaponAssembled = "_this call SLX_XEH_EH_WeaponAssembled"; \ weaponDisAssembled = "_this call SLX_XEH_EH_WeaponDisassembled"; @@ -51,11 +52,11 @@ weaponDisAssembled = "_this call SLX_XEH_EH_WeaponDisassembled"; -/* +/* MACRO: DELETE_EVENTHANDLERS Removes all event handlers. - + Example: (begin example) class DefaultEventhandlers; @@ -103,6 +104,7 @@ delete local; \ delete respawn; \ delete put; \ delete take; \ +delete seatSwitched; \ delete soundPlayed; \ delete weaponAssembled; \ delete weaponDisAssembled; diff --git a/tools/make.py b/tools/make.py index f8a4c80886..e4b99116a6 100644 --- a/tools/make.py +++ b/tools/make.py @@ -489,7 +489,7 @@ def check_for_obsolete_pbos(addonspath, file): def backup_config(module): - #PABST: Convert config (run the macro'd config.cpp through CfgConvert twice to produce a de-macro'd cpp that pboProject can read without fucking up: + #backup original $PBOPREFIX$ global work_drive global prefix @@ -503,52 +503,11 @@ def backup_config(module): except: print_error("Error creating backup of $PBOPREFIX$ for module {}.".format(module)) - try: - shutil.copyfile(os.path.join(work_drive, prefix, module, "config.cpp"), os.path.join(work_drive, prefix, module, "config.backup")) - os.chdir(work_drive) - except: - print_error("Error creating backup of config.cpp for module {}.".format(module)) - return True -def convert_config(module): - try: - global work_drive - global prefix - global arma3tools_path - - cmd = [os.path.join(arma3tools_path, "CfgConvert", "CfgConvert.exe"), "-bin", "-dst", os.path.join(work_drive, prefix, module, "config.bin"), os.path.join(work_drive, prefix, module, "config.cpp")] - ret = subprocess.call(cmd) - if ret != 0: - print_error("CfgConvert -bin return code == {}. Usually means there is a syntax error within the config.cpp file.".format(str(ret))) - os.remove(os.path.join(work_drive, prefix, module, "config.cpp")) - shutil.copyfile(os.path.join(work_drive, prefix, module, "config.backup"), os.path.join(work_drive, prefix, module, "config.cpp")) - - cmd = [os.path.join(arma3tools_path, "CfgConvert", "CfgConvert.exe"), "-txt", "-dst", os.path.join(work_drive, prefix, module, "config.cpp"), os.path.join(work_drive, prefix, module, "config.bin")] - ret = subprocess.call(cmd) - if ret != 0: - print_error("CfgConvert -txt return code == {}. Usually means there is a syntax error within the config.cpp file.".format(str(ret))) - os.remove(os.path.join(work_drive, prefix, module, "config.cpp")) - shutil.copyfile(os.path.join(work_drive, prefix, module, "config.backup"), os.path.join(work_drive, prefix, module, "config.cpp")) - except Exception as e: - print_error("Exception from convert_config=>CfgConvert: {}".format(e)) - return False - - return True - - def addon_restore(modulePath): - #PABST: cleanup config BS (you could comment this out to see the "de-macroed" cpp - #print_green("\Pabst! (restoring): {}".format(os.path.join(modulePath, "config.cpp"))) + #restore original $PBOPREFIX$ try: - if os.path.isfile(os.path.join(modulePath, "config.cpp")): - os.remove(os.path.join(modulePath, "config.cpp")) - if os.path.isfile(os.path.join(modulePath, "config.backup")): - os.rename(os.path.join(modulePath, "config.backup"), os.path.join(modulePath, "config.cpp")) - if os.path.isfile(os.path.join(modulePath, "config.bin")): - os.remove(os.path.join(modulePath, "config.bin")) - if os.path.isfile(os.path.join(modulePath, "texHeaders.bin")): - os.remove(os.path.join(modulePath, "texHeaders.bin")) if os.path.isfile(os.path.join(modulePath, "$PBOPREFIX$.backup")): if os.path.isfile(os.path.join(modulePath, "$PBOPREFIX$")): os.remove(os.path.join(modulePath, "$PBOPREFIX$")) @@ -1216,9 +1175,6 @@ See the make.cfg file for additional build options. nobinFilePath = os.path.join(work_drive, prefix, module, "$NOBIN$") backup_config(module) - if (not os.path.isfile(nobinFilePath)): - convert_config(module) - version_stamp_pboprefix(module,commit_id) if os.path.isfile(nobinFilePath): @@ -1440,4 +1396,4 @@ if __name__ == "__main__": main(sys.argv) d,h,m,s = Fract_Sec(timeit.default_timer() - start_time) print("\nTotal Program time elapsed: {0:2}h {1:2}m {2:4.5f}s".format(h,m,s)) -input("Press Enter to continue...") + input("Press Enter to continue...") diff --git a/tools/search_privates.py b/tools/search_privates.py index 207c6403e0..7c6b042c1a 100644 --- a/tools/search_privates.py +++ b/tools/search_privates.py @@ -16,7 +16,7 @@ def get_private_declare(content): priv_dec_str = ''.join(priv_srch_declared) - srch = re.compile('(?