diff --git a/.gibot.yml b/.gibot.yml index 4b8dffb6f7..442f0a9ea3 100644 --- a/.gibot.yml +++ b/.gibot.yml @@ -2,26 +2,25 @@ stages: mark_for_closing: days: 30 labels: - - need more info - - invalid - - can't reproduce - - wontfix - - information required + - status/need more info + - status/invalid + - status/can't reproduce + - status/wontfix exclude: - - marked for cleanup + - status/marked for cleanup comment: - 'Hello @{author}! There has been no activity on this ticket for over a period of {days} days. I am automatically replying to let you know we will close this ticket within 1 week due to inactivity and consider this resolved.' - - 'If you believe this in error, please reply with the requested information.' + - 'If you believe this is in error, please reply with the requested information.' - 'Thank you. :robot:' action: close: false comment: true assign_label: - - marked for cleanup + - status/marked for cleanup clean_up: days: 7 labels: - - marked for cleanup + - status/marked for cleanup comment: - 'Hello @{author}! We have detected no activity for {days} days on this ticket. We therefore assume that the original reporter has lost interest or the issue has been resolved.' - 'Since we have marked this ticket for deletion, we will be closing it.' @@ -31,25 +30,25 @@ stages: close: true comment: true assign_label: - - closed by bot + - status/closed by bot remove_label: - - marked for cleanup + - status/marked for cleanup remind_about_old_ticket: - days: 130 + days: 160 labels: - - bug - - critical bug + - kind/bug + - kind/critical bug exclude: - - need more info - - invalid - - can't reproduce - - wontfix - - information required - - marked for cleanup - - inactive + - status/need more info + - status/invalid + - status/can't reproduce + - status/wontfix + - status/marked for cleanup + - status/inactive + - status/stale comment: - 'Hello @acemod/maintainers. This ticket has been open for over {days} days without any activity.' action: comment: true assign_label: - - inactive + - status/inactive diff --git a/.github/ISSUE_TEMPLATE.md b/.github/ISSUE_TEMPLATE.md index 28549dd503..a333dc08fe 100644 --- a/.github/ISSUE_TEMPLATE.md +++ b/.github/ISSUE_TEMPLATE.md @@ -3,8 +3,10 @@ **ACE3 Version:** `3.x.x` (stable / dev + commit hash) **Mods:** -- `@CBA_A3` -- `@ace` +``` +- CBA_A3 +- ace +``` **Description:** - Add a detailed description of the error. This makes it easier for us to fix the issue. diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md index 2dbbc268af..69565c700e 100644 --- a/.github/PULL_REQUEST_TEMPLATE.md +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -2,4 +2,4 @@ - Describe what this pull request will do - Each change in a separate line - Include documentation if applicable -- Respect the [Development Guidelines](http://ace3mod.com/wiki/development/) +- Respect the [Development Guidelines](https://ace3mod.com/wiki/development/) diff --git a/.github_changelog_generator b/.github_changelog_generator new file mode 100644 index 0000000000..6d1d741bbd --- /dev/null +++ b/.github_changelog_generator @@ -0,0 +1,20 @@ +# No issues and PRs without labels +issues=false +pr-wo-labels=false + +# Issues are disabled, don't fetch them +max-issues=0 + +# Label filters +exclude-labels=by design,can't reproduce,duplicate,question,invalid,wontfix,ignore changelog + +# Tag is created before generating changelog for release candidates +unreleased=false + +# No section labels, we only want a list of merged PRs (label separation only works for Issues) +simple-list=true + +# Misc +author=false +compare-link=false +header-label=## Change Log Summary diff --git a/.gitignore b/.gitignore index 5aebbbd408..1d60d27088 100644 --- a/.gitignore +++ b/.gitignore @@ -7,3 +7,4 @@ texHeaders.bin *.swo *.biprivatekey Thumbs.db +CHANGELOG.md diff --git a/.travis.yml b/.travis.yml index 90c037b514..8a03778a53 100644 --- a/.travis.yml +++ b/.travis.yml @@ -4,7 +4,7 @@ branches: - release language: python python: -- '3.4' +- '3.5' before_script: - if [ -n "${GH_TOKEN}" ] && [ "${TRAVIS_BRANCH}" == "master" ] && [ "${TRAVIS_PULL_REQUEST}" == "false" ]; then pip install pygithub; diff --git a/AUTHORS.txt b/AUTHORS.txt index f9e55823b1..4fe978dd40 100644 --- a/AUTHORS.txt +++ b/AUTHORS.txt @@ -1,4 +1,4 @@ -# ACE3 CONTRIBUTOR LIST +# ACE3 CONTRIBUTOR LIST # If you contributed, but are not listed here, contact me: # koffeinflummi@gmail.com # @@ -29,6 +29,7 @@ Walter Pearce # CONTRIBUTORS [BIG]Bull 11RDP-LoupVert +654wak654 ACCtomeek adam3adam Adanteh @@ -37,7 +38,9 @@ Aggr094 alef Aleksey EpMAK Yermakov Alganthe +Andrea "AtixNeon" Verano Anthariel +Anton Arkhir Asgar Serran BaerMitUmlaut @@ -49,6 +52,8 @@ Brakoviejo Brisse Brostrom.A | Evul BullHorn +chris579 +classicarma Clon1998 Codingboy Coren @@ -59,6 +64,7 @@ dixon13 Drill Dudakov aka [OMCB]Kaban Dslyecxi +ElTyranos eRazeri evromalarkey F3 Project @@ -82,13 +88,16 @@ Harakhti havena Hawkins Head +Hybrid V Karneck Kavinsky +Keithen Kllrt legman Legolasindar "Viper" licht-im-Norden87 looter +Luigi "Luigium" Myrini Macusercom MarcBook meat @@ -100,6 +109,7 @@ nomisum OnkelDisMaster oscarmolinadev PaxJaromeMalues +Phyma pokertour Professor rakowozz @@ -118,8 +128,10 @@ Tessa Elieff Toaster Tonic Tourorist +Tuupertunut Valentin Torikian voiper VyMajoris(W-Cephei) Winter +xrufix zGuba diff --git a/README.md b/README.md index d9c6a41678..db6119f9a3 100644 --- a/README.md +++ b/README.md @@ -4,7 +4,7 @@

- ACE3 Version + ACE3 Version ACE3 Issues @@ -18,8 +18,8 @@ ACE3 License - - ACE3 Slack + + ACE3 Slack ACE3 Build Status @@ -28,7 +28,7 @@

Requires the latest version of CBA A3.
- Visit us on Twitter | Facebook | YouTube | Reddit
+ 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. @@ -37,7 +37,8 @@ The project is entirely **open-source** and all contributions are welcome. Feel The mod is **built modularly**, so almost any included PBO can be easily removed from the configuration. This way, a team can maintain its own tailored version of ACE3 by simply excluding any components they don't need, or those possibly in conflict with other mods. Modules themselves, e.g. the medical system, also include various customization options, allowing mission designers to tweak the overall experience. -### Core features +## Core features + - Brand new 3D interaction/action system - Performance and reliability framework - Focus on modularity and customization @@ -51,7 +52,8 @@ The mod is **built modularly**, so almost any included PBO can be easily removed - Logistics - Advanced missile guidance and laser designation -#### Additional features +### Additional features + - Carrying and dragging - Realistic names for vehicles and weapons - A fire control system (FCS) for armored vehicles and helicopters @@ -72,18 +74,56 @@ The mod is **built modularly**, so almost any included PBO can be easily removed - Vector, MicroDAGR and Kestrel devices
***and much more...*** -### Guides & how-tos -If you installed ACE3 but have trouble understanding how it all works, or where to start, read this first: -- [Installation guide](http://ace3mod.com/wiki/user/installation-guide.html) -- [Information center](http://ace3mod.com/wiki/user/information-center.html) +## Getting started -#### Contributing -You can help out with the ongoing development by looking for potential bugs in our code base, or by contributing new features. To contribute something to ACE3, simply fork this repository and submit your pull requests for review by other collaborators. Remember to add yourself to the author array of any PBO you will be editing and the [`AUTHORS.txt`](https://github.com/acemod/ACE3/blob/master/AUTHORS.txt) file; including a valid email address. +ACE3 requires Arma 3 and the latest version of CBA A3. See the following pages for help and information on how to get started with ACE3: + +- [Installation guide](https://ace3mod.com/wiki/user/installation-guide.html) +- [Information center](https://ace3mod.com/wiki/user/information-center.html) + +## Contributing + +You can help out with the ongoing development by looking for potential bugs in our code base, or by contributing new features. We are always welcoming new pull requests containing bug fixes, refactors and new features. We have a list of tasks and bugs on our issue tracker on Github. Please comment on issues if you want to contribute with, to avoid duplicating effort. + +### Contribution guidelines + +To contribute something to ACE3, simply fork this repository and submit your pull requests for review by other collaborators. Remember to add yourself to the author array of any PBO you will be editing and the [`AUTHORS.txt`](https://github.com/acemod/ACE3/blob/master/AUTHORS.txt) file; including a valid email address. + +### Submitting issues and requesting features Please, use our [Issue Tracker](https://github.com/acemod/ACE3/issues) to report a bug, propose a feature, or suggest changes to the existing ones. See also: -- [How to report an issue](http://ace3mod.com/wiki/user/how-to-report-an-issue.html) -- [How to make a feature request](http://ace3mod.com/wiki/user/how-to-make-a-feature-request.html) +- [How to report an issue](https://ace3mod.com/wiki/user/how-to-report-an-issue.html) +- [How to make a feature request](https://ace3mod.com/wiki/user/how-to-make-a-feature-request.html) + +### Testing & building -#### Testing & building To help us test the latest development changes, download our master branch ([directly](https://github.com/acemod/ACE3/archive/master.zip), or [with git](https://help.github.com/articles/fetching-a-remote/)), then assemble a test build: -- [Setting up the development environment](http://ace3mod.com/wiki/development/setting-up-the-development-environment.html) – step-by-step instructions on how to properly setup and build a version of ACE3 for testing purposes. + +- [Setting up the development environment](https://ace3mod.com/wiki/development/setting-up-the-development-environment.html) – step-by-step instructions on how to properly setup and build a version of ACE3 for testing purposes. + +### Get in touch + + + + + + + + + + + + + + + + + + + + +
SlackWe have a public Slack team that anyone can join. This is where all our developers and contributors hang out and where we make announcements
TwitterYou can follow our Twitter account to get updates and various links to guides
FacebookYou can follow our Facebook account to get updates and various links to guides
Bohemia ForumWe have a dedicated thread on the Bohemia Forums for the ACE3 project
+ +## License + +ACE3 is licensed under the GNU General Public License ([GPLv2](https://github.com/acemod/ACE3/blob/master/LICENSE)). diff --git a/ace_advanced_ballistics.dll b/ace_advanced_ballistics.dll index 705a90b2ef..43698cf95b 100644 Binary files a/ace_advanced_ballistics.dll and b/ace_advanced_ballistics.dll differ diff --git a/ace_advanced_ballistics_x64.dll b/ace_advanced_ballistics_x64.dll new file mode 100644 index 0000000000..83858d86e3 Binary files /dev/null and b/ace_advanced_ballistics_x64.dll differ diff --git a/ace_break_line_x64.dll b/ace_break_line_x64.dll new file mode 100644 index 0000000000..d021bf25d2 Binary files /dev/null and b/ace_break_line_x64.dll differ diff --git a/ace_clipboard_x64.dll b/ace_clipboard_x64.dll new file mode 100644 index 0000000000..db7730f0fe Binary files /dev/null and b/ace_clipboard_x64.dll differ diff --git a/ace_fcs_x64.dll b/ace_fcs_x64.dll new file mode 100644 index 0000000000..4ee8dc1d89 Binary files /dev/null and b/ace_fcs_x64.dll differ diff --git a/ace_medical_x64.dll b/ace_medical_x64.dll new file mode 100644 index 0000000000..a903cddfe9 Binary files /dev/null and b/ace_medical_x64.dll differ diff --git a/ace_parse_imagepath_x64.dll b/ace_parse_imagepath_x64.dll new file mode 100644 index 0000000000..8d154117c5 Binary files /dev/null and b/ace_parse_imagepath_x64.dll differ diff --git a/addons/advanced_ballistics/ACE_Settings.hpp b/addons/advanced_ballistics/ACE_Settings.hpp index 9815cc8491..0c2265619a 100644 --- a/addons/advanced_ballistics/ACE_Settings.hpp +++ b/addons/advanced_ballistics/ACE_Settings.hpp @@ -69,7 +69,7 @@ class ACE_Settings { displayName = CSTRING(simulationInterval_DisplayName); description = CSTRING(simulationInterval_Description); typeName = "SCALAR"; - value = 0.0; + value = 0.05; }; class GVAR(simulationRadius) { category = CSTRING(DisplayName); diff --git a/addons/advanced_ballistics/CfgVehicles.hpp b/addons/advanced_ballistics/CfgVehicles.hpp index 804a6e9236..151972ea02 100644 --- a/addons/advanced_ballistics/CfgVehicles.hpp +++ b/addons/advanced_ballistics/CfgVehicles.hpp @@ -71,7 +71,7 @@ class CfgVehicles { displayName = CSTRING(simulationInterval_DisplayName); description = CSTRING(simulationInterval_Description); typeName = "NUMBER"; - defaultValue = 0.0; + defaultValue = 0.05; }; class simulationRadius { displayName = CSTRING(simulationRadius_DisplayName); diff --git a/addons/advanced_ballistics/XEH_preInit.sqf b/addons/advanced_ballistics/XEH_preInit.sqf index a7feade1c3..b47cf6628d 100644 --- a/addons/advanced_ballistics/XEH_preInit.sqf +++ b/addons/advanced_ballistics/XEH_preInit.sqf @@ -2,6 +2,8 @@ ADDON = false; +PREP_RECOMPILE_START; #include "XEH_PREP.hpp" +PREP_RECOMPILE_END; ADDON = true; diff --git a/addons/advanced_ballistics/functions/fnc_calculateAmmoTemperatureVelocityShift.sqf b/addons/advanced_ballistics/functions/fnc_calculateAmmoTemperatureVelocityShift.sqf index 19cd55c98e..fd086d65d1 100644 --- a/addons/advanced_ballistics/functions/fnc_calculateAmmoTemperatureVelocityShift.sqf +++ b/addons/advanced_ballistics/functions/fnc_calculateAmmoTemperatureVelocityShift.sqf @@ -10,6 +10,9 @@ * Return Value: * muzzle velocity shift - m/s * + * Example: + * [[], 5] call ace_advanced_ballistics_fnc_calcilateAmmoTemperatureVelocityShift + * * Public: No */ #include "script_component.hpp" diff --git a/addons/advanced_ballistics/functions/fnc_calculateAtmosphericCorrection.sqf b/addons/advanced_ballistics/functions/fnc_calculateAtmosphericCorrection.sqf index 2b90767a4f..326de5478e 100644 --- a/addons/advanced_ballistics/functions/fnc_calculateAtmosphericCorrection.sqf +++ b/addons/advanced_ballistics/functions/fnc_calculateAtmosphericCorrection.sqf @@ -13,6 +13,9 @@ * Return Value: * corrected ballistic coefficient * + * Example: + * [2, 5, 5, 0.5, "ASM"] call ace_advanced_ballistics_fnc_calculateAtmosphericCorrection + * * Public: No */ #include "script_component.hpp" diff --git a/addons/advanced_ballistics/functions/fnc_calculateBarrelLengthVelocityShift.sqf b/addons/advanced_ballistics/functions/fnc_calculateBarrelLengthVelocityShift.sqf index 1f8a7e6eb9..746818623a 100644 --- a/addons/advanced_ballistics/functions/fnc_calculateBarrelLengthVelocityShift.sqf +++ b/addons/advanced_ballistics/functions/fnc_calculateBarrelLengthVelocityShift.sqf @@ -4,7 +4,7 @@ * Calculates the muzzle velocity shift caused by different barrel lengths * * Arguments: - * 0: barrel length - mm + * 0: barrel length - mm * 1: muzzle velocity lookup table - m/s * 2: barrel length lookup table - mm * 3: muzzle velocity - m/s @@ -12,23 +12,23 @@ * Return Value: * muzzle velocity shift - m/s * + * Example: + * [5, [0,5], [0,5], 5] call ace_advanced_ballistics_fnc_calculateBarrelLengthVelocityShift + * * Public: No */ #include "script_component.hpp" scopeName "main"; -private ["_muzzleVelocityTableCount", "_barrelLengthTableCount", "_lowerDataIndex", - "_upperDataIndex", "_lowerBarrelLength", "_upperBarrelLength", "_lowerMuzzleVelocity", - "_upperMuzzleVelocity", "_interpolationRatio"]; params ["_barrelLength", "_muzzleVelocityTable", "_barrelLengthTable", "_muzzleVelocity"]; TRACE_4("params",_barrelLength,_muzzleVelocityTable,_barrelLengthTable,_muzzleVelocity); // If barrel length is not defined, then there is no point in calculating muzzle velocity if (_barrelLength == 0) exitWith { 0 }; -_muzzleVelocityTableCount = count _muzzleVelocityTable; -_barrelLengthTableCount = count _barrelLengthTable; +private _muzzleVelocityTableCount = count _muzzleVelocityTable; +private _barrelLengthTableCount = count _barrelLengthTable; // Exit if tables are different sizes, have no elements or have only one element if (_muzzleVelocityTableCount != _barrelLengthTableCount || _muzzleVelocityTableCount == 0 || _barrelLengthTableCount == 0) exitWith { 0 }; @@ -43,6 +43,9 @@ if (_barrelLength in _barrelLengthTable) exitWith { if (_barrelLength <= (_barrelLengthTable select 0)) exitWith { (_muzzleVelocityTable select 0) - _muzzleVelocity }; if (_barrelLength >= (_barrelLengthTable select _barrelLengthTableCount - 1)) exitWith { (_muzzleVelocityTable select _barrelLengthTableCount - 1) - _muzzleVelocity }; +private _upperDataIndex = -1; +private _lowerDataIndex = -1; + // Find closest bordering values for barrel length { if (_barrelLength <= _x) then { @@ -53,19 +56,15 @@ if (_barrelLength >= (_barrelLengthTable select _barrelLengthTableCount - 1)) ex } forEach _barrelLengthTable; // Worst case scenario -if (isNil "_lowerDataIndex" || isNil "_upperDataIndex") exitWith {0}; +if (_upperDataIndex == -1 || _lowerDataIndex == -1) exitWith {0}; -_lowerBarrelLength = _barrelLengthTable select _lowerDataIndex; -_upperBarrelLength = _barrelLengthTable select _upperDataIndex; -_lowerMuzzleVelocity = _muzzleVelocityTable select _lowerDataIndex; -_upperMuzzleVelocity = _muzzleVelocityTable select _upperDataIndex; +private _lowerBarrelLength = _barrelLengthTable select _lowerDataIndex; +private _upperBarrelLength = _barrelLengthTable select _upperDataIndex; +private _lowerMuzzleVelocity = _muzzleVelocityTable select _lowerDataIndex; +private _upperMuzzleVelocity = _muzzleVelocityTable select _upperDataIndex; // Calculate interpolation ratio -_interpolationRatio = if (abs (_lowerBarrelLength - _upperBarrelLength) > 0) then { - (_upperBarrelLength - _barrelLength) / (_upperBarrelLength - _lowerBarrelLength) -} else { - 0 -}; +private _interpolationRatio = [0, (_upperBarrelLength - _barrelLength) / (_upperBarrelLength - _lowerBarrelLength)] select (abs (_lowerBarrelLength - _upperBarrelLength) > 0); // Calculate interpolated muzzle velocity shift (_lowerMuzzleVelocity + ((_upperMuzzleVelocity - _lowerMuzzleVelocity) * (1 - _interpolationRatio))) - _muzzleVelocity // Return diff --git a/addons/advanced_ballistics/functions/fnc_calculateRetardation.sqf b/addons/advanced_ballistics/functions/fnc_calculateRetardation.sqf index 0bd801c6b9..1c7cadd3f0 100644 --- a/addons/advanced_ballistics/functions/fnc_calculateRetardation.sqf +++ b/addons/advanced_ballistics/functions/fnc_calculateRetardation.sqf @@ -11,6 +11,9 @@ * Return Value: * retardation - m/(s^2) * + * Example: + * [5, 20, 10] call ace_advanced_ballistics_fnc_calculateRetardation + * * Public: No */ #include "script_component.hpp" diff --git a/addons/advanced_ballistics/functions/fnc_calculateStabilityFactor.sqf b/addons/advanced_ballistics/functions/fnc_calculateStabilityFactor.sqf index 07fc7c67c9..8af9f77930 100644 --- a/addons/advanced_ballistics/functions/fnc_calculateStabilityFactor.sqf +++ b/addons/advanced_ballistics/functions/fnc_calculateStabilityFactor.sqf @@ -15,6 +15,9 @@ * Return Value: * stability factor * + * Example: + * [1, 2, 3, 4, 5, 6, 7] call ace_advanced_ballistics_fnc_calculateStabilityFactor + * * Public: No */ #include "script_component.hpp" diff --git a/addons/advanced_ballistics/functions/fnc_diagnoseWeapons.sqf b/addons/advanced_ballistics/functions/fnc_diagnoseWeapons.sqf index 4d344e8bfe..40d065198c 100644 --- a/addons/advanced_ballistics/functions/fnc_diagnoseWeapons.sqf +++ b/addons/advanced_ballistics/functions/fnc_diagnoseWeapons.sqf @@ -10,6 +10,9 @@ * Return Value: * None * + * Example: + * [] call ace_advanced_ballistics_fnc_diagnoseWeapons + * * Public: No */ #define DEBUG_MODE_FULL diff --git a/addons/advanced_ballistics/functions/fnc_displayProtractor.sqf b/addons/advanced_ballistics/functions/fnc_displayProtractor.sqf index 528b3e2e97..f50dcc6887 100644 --- a/addons/advanced_ballistics/functions/fnc_displayProtractor.sqf +++ b/addons/advanced_ballistics/functions/fnc_displayProtractor.sqf @@ -9,6 +9,9 @@ * Return Value: * None * + * Example: + * [] call ace_advanced_ballistics_fnc_displayProtractor + * * Public: No */ #include "script_component.hpp" diff --git a/addons/advanced_ballistics/functions/fnc_handleFirePFH.sqf b/addons/advanced_ballistics/functions/fnc_handleFirePFH.sqf index 6a9c7ce243..cedd846634 100644 --- a/addons/advanced_ballistics/functions/fnc_handleFirePFH.sqf +++ b/addons/advanced_ballistics/functions/fnc_handleFirePFH.sqf @@ -8,12 +8,13 @@ * Return Value: * None * + * Example: + * [] call ace_advanced_ballistics_fnc_handleFirePFH + * * Public: No */ #include "script_component.hpp" -private _aceTimeSecond = floor CBA_missionTime; - { _x params ["_bullet","_caliber","_bulletTraceVisible","_index"]; @@ -30,7 +31,7 @@ private _aceTimeSecond = floor CBA_missionTime; drop ["\A3\data_f\ParticleEffects\Universal\Refract","","Billboard",1,0.1,getPos _bullet,[0,0,0],0,1.275,1,0,[0.02*_caliber,0.01*_caliber],[[0,0,0,0.65],[0,0,0,0.2]],[1,0],0,0,"","",""]; }; - call compile ("ace_advanced_ballistics" callExtension format["simulate:%1:%2:%3:%4:%5:%6:%7", _index, _bulletVelocity, _bulletPosition, ACE_wind, ASLToATL(_bulletPosition) select 2, _aceTimeSecond, CBA_missionTime - _aceTimeSecond]); + _bullet setVelocity (_bulletVelocity vectorAdd (parseSimpleArray ("ace_advanced_ballistics" callExtension format["simulate:%1:%2:%3:%4:%5:%6", _index, _bulletVelocity, _bulletPosition, ACE_wind, ASLToATL(_bulletPosition) select 2, CBA_missionTime toFixed 6]))); }; nil } count +GVAR(allBullets); diff --git a/addons/advanced_ballistics/functions/fnc_handleFired.sqf b/addons/advanced_ballistics/functions/fnc_handleFired.sqf index 7085224771..f9145ddc37 100644 --- a/addons/advanced_ballistics/functions/fnc_handleFired.sqf +++ b/addons/advanced_ballistics/functions/fnc_handleFired.sqf @@ -9,6 +9,9 @@ * Return Value: * None * + * Example: + * [] call ace_advanced_ballistics_fnc_handleFired + * * Public: No */ #include "script_component.hpp" @@ -16,10 +19,7 @@ //IGNORE_PRIVATE_WARNING ["_unit", "_weapon", "_muzzle", "_mode", "_ammo", "_magazine", "_projectile", "_vehicle", "_gunner", "_turret"]; TRACE_10("firedEH:",_unit, _weapon, _muzzle, _mode, _ammo, _magazine, _projectile, _vehicle, _gunner, _turret); -// Parameterization -private ["_abort", "_AmmoCacheEntry", "_WeaponCacheEntry", "_opticsName", "_opticType", "_bulletTraceVisible", "_temperature", "_barometricPressure", "_bulletMass", "_bulletLength", "_muzzleVelocity", "_muzzleVelocityShift", "_bulletVelocity", "_bulletLength", "_barrelTwist", "_stabilityFactor", "_aceTimeSecond", "_barrelVelocityShift", "_ammoTemperatureVelocityShift"]; - -_abort = false; +private _abort = false; if (!(_ammo isKindOf "BulletBase")) exitWith {}; if (!alive _projectile) exitWith {}; @@ -30,8 +30,8 @@ if (!GVAR(simulateForEveryone) && !(local _unit)) then { _abort = true; if (GVAR(simulateForSnipers)) then { if (currentWeapon _unit == primaryWeapon _unit && count primaryWeaponItems _unit > 2) then { - _opticsName = (primaryWeaponItems _unit) select 2; - _opticType = getNumber(configFile >> "CfgWeapons" >> _opticsName >> "ItemInfo" >> "opticType"); + private _opticsName = (primaryWeaponItems _unit) select 2; + private _opticType = getNumber(configFile >> "CfgWeapons" >> _opticsName >> "ItemInfo" >> "opticType"); _abort = _opticType != 2; // We only abort if the non local shooter is not a sniper }; }; @@ -42,18 +42,12 @@ if (!GVAR(simulateForEveryone) && !(local _unit)) then { //if (!GVAR(vehicleGunnerEnabled) && !(_unit isKindOf "Man")) then { _abort = true; }; // We currently do not have firedEHs on vehicles if (GVAR(disabledInFullAutoMode) && getNumber(configFile >> "CfgWeapons" >> _weapon >> _mode >> "autoFire") == 1) then { _abort = true; }; -if (_abort || !(GVAR(extensionAvailable))) exitWith { - if (missionNamespace getVariable [QEGVAR(windDeflection,enabled), false]) then { - EGVAR(windDeflection,trackedBullets) pushBack [_projectile, getNumber(configFile >> "CfgAmmo" >> _ammo >> "airFriction")]; - }; -}; - // Get Weapon and Ammo Configurations -_AmmoCacheEntry = uiNamespace getVariable format[QGVAR(%1), _ammo]; +private _AmmoCacheEntry = uiNamespace getVariable format[QGVAR(%1), _ammo]; if (isNil "_AmmoCacheEntry") then { _AmmoCacheEntry = _ammo call FUNC(readAmmoDataFromConfig); }; -_WeaponCacheEntry = uiNamespace getVariable format[QGVAR(%1), _weapon]; +private _WeaponCacheEntry = uiNamespace getVariable format[QGVAR(%1), _weapon]; if (isNil "_WeaponCacheEntry") then { _WeaponCacheEntry = _weapon call FUNC(readWeaponDataFromConfig); }; @@ -62,22 +56,24 @@ _AmmoCacheEntry params ["_airFriction", "_caliber", "_bulletLength", "_bulletMas _WeaponCacheEntry params ["_barrelTwist", "_twistDirection", "_barrelLength"]; -_bulletVelocity = velocity _projectile; -_muzzleVelocity = vectorMagnitude _bulletVelocity; +private _bulletVelocity = velocity _projectile; +private _muzzleVelocity = vectorMagnitude _bulletVelocity; -_barrelVelocityShift = 0; +private _barrelVelocityShift = 0; if (GVAR(barrelLengthInfluenceEnabled)) then { _barrelVelocityShift = [_barrelLength, _muzzleVelocityTable, _barrelLengthTable, _muzzleVelocity] call FUNC(calculateBarrelLengthVelocityShift); }; -_ammoTemperatureVelocityShift = 0; +private _ammoTemperatureVelocityShift = 0; +private _temperature = nil; //Need the variable in this scope. So we need to init it here. + if (GVAR(ammoTemperatureEnabled)) then { _temperature = ((getPosASL _unit) select 2) call EFUNC(weather,calculateTemperatureAtHeight); _ammoTemperatureVelocityShift = ([_ammoTempMuzzleVelocityShifts, _temperature] call FUNC(calculateAmmoTemperatureVelocityShift)); }; if (GVAR(ammoTemperatureEnabled) || GVAR(barrelLengthInfluenceEnabled)) then { - _muzzleVelocityShift = _barrelVelocityShift + _ammoTemperatureVelocityShift; + private _muzzleVelocityShift = _barrelVelocityShift + _ammoTemperatureVelocityShift; TRACE_4("shift",_muzzleVelocity,_muzzleVelocityShift, _barrelVelocityShift, _ammoTemperatureVelocityShift); if (_muzzleVelocityShift != 0) then { _muzzleVelocity = _muzzleVelocity + _muzzleVelocityShift; @@ -86,32 +82,37 @@ if (GVAR(ammoTemperatureEnabled) || GVAR(barrelLengthInfluenceEnabled)) then { }; }; -_bulletTraceVisible = false; +if (_abort || !(GVAR(extensionAvailable))) exitWith { + if (missionNamespace getVariable [QEGVAR(windDeflection,enabled), false]) then { + EGVAR(windDeflection,trackedBullets) pushBack [_projectile, getNumber(configFile >> "CfgAmmo" >> _ammo >> "airFriction")]; + }; +}; + +private _bulletTraceVisible = false; if (GVAR(bulletTraceEnabled) && cameraView == "GUNNER") then { if (currentWeapon ACE_player == binocular ACE_player) then { _bulletTraceVisible = true; } else { if (currentWeapon ACE_player == primaryWeapon ACE_player && count primaryWeaponItems ACE_player > 2) then { - _opticsName = (primaryWeaponItems ACE_player) select 2; - _opticType = getNumber(configFile >> "CfgWeapons" >> _opticsName >> "ItemInfo" >> "opticType"); + private _opticsName = (primaryWeaponItems ACE_player) select 2; + private _opticType = getNumber(configFile >> "CfgWeapons" >> _opticsName >> "ItemInfo" >> "opticType"); _bulletTraceVisible = _opticType == 2; }; }; }; -_stabilityFactor = 1.5; +private _stabilityFactor = 1.5; if (_caliber > 0 && _bulletLength > 0 && _bulletMass > 0 && _barrelTwist > 0) then { if (isNil "_temperature") then { _temperature = ((getPosASL _unit) select 2) call EFUNC(weather,calculateTemperatureAtHeight); }; - _barometricPressure = ((getPosASL _projectile) select 2) call EFUNC(weather,calculateBarometricPressure); + private _barometricPressure = ((getPosASL _projectile) select 2) call EFUNC(weather,calculateBarometricPressure); _stabilityFactor = [_caliber, _bulletLength, _bulletMass, _barrelTwist, _muzzleVelocity, _temperature, _barometricPressure] call FUNC(calculateStabilityFactor); }; GVAR(currentbulletID) = (GVAR(currentbulletID) + 1) % 10000; -_aceTimeSecond = floor CBA_missionTime; -"ace_advanced_ballistics" callExtension format["new:%1:%2:%3:%4:%5:%6:%7:%8:%9:%10:%11:%12:%13:%14:%15:%16:%17:%18", GVAR(currentbulletID), _airFriction, _ballisticCoefficients, _velocityBoundaries, _atmosphereModel, _dragModel, _stabilityFactor, _twistDirection, _muzzleVelocity, _transonicStabilityCoef, getPosASL _projectile, EGVAR(common,mapLatitude), EGVAR(weather,currentTemperature), EGVAR(common,mapAltitude), EGVAR(weather,currentHumidity), overcast, _aceTimeSecond, CBA_missionTime - _aceTimeSecond]; +"ace_advanced_ballistics" callExtension format["new:%1:%2:%3:%4:%5:%6:%7:%8:%9:%10:%11:%12:%13:%14:%15:%16:%17", GVAR(currentbulletID), _airFriction, _ballisticCoefficients, _velocityBoundaries, _atmosphereModel, _dragModel, _stabilityFactor, _twistDirection, _muzzleVelocity, _transonicStabilityCoef, getPosASL _projectile, EGVAR(common,mapLatitude), EGVAR(weather,currentTemperature), EGVAR(common,mapAltitude), EGVAR(weather,currentHumidity), EGVAR(weather,currentOvercast), CBA_missionTime toFixed 6]; GVAR(allBullets) pushBack [_projectile, _caliber, _bulletTraceVisible, GVAR(currentbulletID)]; diff --git a/addons/advanced_ballistics/functions/fnc_initModuleSettings.sqf b/addons/advanced_ballistics/functions/fnc_initModuleSettings.sqf index 4898c51c10..ced2ffbf4e 100644 --- a/addons/advanced_ballistics/functions/fnc_initModuleSettings.sqf +++ b/addons/advanced_ballistics/functions/fnc_initModuleSettings.sqf @@ -10,6 +10,9 @@ * Return Value: * None * + * Example: + * [LOGIC, [bob, kevin], true] call ace_advanced_ballistics_fnc_initModuleSettings + * * Public: No */ #include "script_component.hpp" diff --git a/addons/advanced_ballistics/functions/fnc_initializeTerrainExtension.sqf b/addons/advanced_ballistics/functions/fnc_initializeTerrainExtension.sqf index 9c226d4a44..a1f40f5d13 100644 --- a/addons/advanced_ballistics/functions/fnc_initializeTerrainExtension.sqf +++ b/addons/advanced_ballistics/functions/fnc_initializeTerrainExtension.sqf @@ -8,6 +8,9 @@ * Return Value: * None * + * Example: + * [] call ace_advanced_ballistics_fnc_initializeTerrainExtension + * * Public: No */ #include "script_component.hpp" @@ -16,10 +19,8 @@ if (!hasInterface) exitWith {}; if (!GVAR(enabled)) exitWith {}; if (!GVAR(extensionAvailable)) exitWith {}; -private ["_initStartTime", "_mapSize", "_mapGrids", "_gridCells", "_x", "_y", "_gridCenter", "_gridHeight", "_gridNumObjects", "_gridSurfaceIsWater"]; - -_initStartTime = CBA_missionTime; -_mapSize = getNumber (configFile >> "CfgWorlds" >> worldName >> "MapSize"); +private _initStartTime = CBA_missionTime; +private _mapSize = getNumber (configFile >> "CfgWorlds" >> worldName >> "MapSize"); if (("ace_advanced_ballistics" callExtension format["init:%1:%2", worldName, _mapSize]) == "Terrain already initialized") exitWith { INFO_1("Terrain already initialized [world: %1]", worldName); @@ -28,8 +29,8 @@ if (("ace_advanced_ballistics" callExtension format["init:%1:%2", worldName, _ma #endif }; -_mapGrids = ceil(_mapSize / 50) + 1; -_gridCells = _mapGrids * _mapGrids; +private _mapGrids = ceil(_mapSize / 50) + 1; +private _gridCells = _mapGrids * _mapGrids; GVAR(currentGrid) = 0; @@ -48,12 +49,12 @@ INFO_2("Starting Terrain Extension [cells: %1] [world: %2]", _gridCells, worldNa }; for "_i" from 1 to 50 do { - _x = floor(GVAR(currentGrid) / _mapGrids) * 50; - _y = (GVAR(currentGrid) - floor(GVAR(currentGrid) / _mapGrids) * _mapGrids) * 50; - _gridCenter = [_x + 25, _y + 25]; - _gridHeight = round(getTerrainHeightASL _gridCenter); - _gridNumObjects = count (_gridCenter nearObjects ["Building", 50]); - _gridSurfaceIsWater = if (surfaceIsWater _gridCenter) then {1} else {0}; + private _x = floor(GVAR(currentGrid) / _mapGrids) * 50; + private _y = (GVAR(currentGrid) - floor(GVAR(currentGrid) / _mapGrids) * _mapGrids) * 50; + private _gridCenter = [_x + 25, _y + 25]; + private _gridHeight = round(getTerrainHeightASL _gridCenter); + private _gridNumObjects = count (_gridCenter nearObjects ["Building", 50]); + private _gridSurfaceIsWater = if (surfaceIsWater _gridCenter) then {1} else {0}; "ace_advanced_ballistics" callExtension format["set:%1:%2:%3", _gridHeight, _gridNumObjects, _gridSurfaceIsWater]; GVAR(currentGrid) = GVAR(currentGrid) + 1; if (GVAR(currentGrid) >= _gridCells) exitWith {}; diff --git a/addons/advanced_ballistics/functions/fnc_readAmmoDataFromConfig.sqf b/addons/advanced_ballistics/functions/fnc_readAmmoDataFromConfig.sqf index 160b6ddd06..c3e5838be2 100644 --- a/addons/advanced_ballistics/functions/fnc_readAmmoDataFromConfig.sqf +++ b/addons/advanced_ballistics/functions/fnc_readAmmoDataFromConfig.sqf @@ -7,48 +7,51 @@ * ammo - classname * * Return Value: - * 0: _airFriction - * 1: _caliber - * 2: _bulletLength - * 3: _bulletMass - * 4: _transonicStabilityCoef - * 5: _dragModel - * 6: _ballisticCoefficients - * 7: _velocityBoundaries - * 8: _atmosphereModel - * 9: _ammoTempMuzzleVelocityShifts - * 10: _muzzleVelocityTable - * 11: _barrelLengthTable + * 0: _airFriction + * 1: _caliber + * 2: _bulletLength + * 3: _bulletMass + * 4: _transonicStabilityCoef + * 5: _dragModel + * 6: _ballisticCoefficients + * 7: _velocityBoundaries + * 8: _atmosphereModel + * 9: _ammoTempMuzzleVelocityShifts + * 10: _muzzleVelocityTable + * 11: _barrelLengthTable + * + * Example: + * ["ammo"] call ace_advanced_ballistics_fnc_readAmmoDataFromConfig * * Public: No */ #include "script_component.hpp" TRACE_1("Reading Ammo Config",_this); -private ["_ammo", "_airFriction", "_caliber", "_bulletLength", "_bulletMass", "_transonicStabilityCoef", "_dragModel", "_ballisticCoefficients", "_velocityBoundaries", "_atmosphereModel", "_ammoTempMuzzleVelocityShifts", "_muzzleVelocityTable", "_barrelLengthTable", "_result"]; -_ammoConfig = configFile >> "CfgAmmo" >> _this; -_airFriction = getNumber(_ammoConfig >> "airFriction"); -_caliber = getNumber(_ammoConfig >> "ACE_caliber"); -_bulletLength = getNumber(_ammoConfig >> "ACE_bulletLength"); -_bulletMass = getNumber(_ammoConfig >> "ACE_bulletMass"); -_transonicStabilityCoef = getNumber(_ammoConfig >> "ACE_transonicStabilityCoef"); +private _ammoConfig = configFile >> "CfgAmmo" >> _this; + +private _airFriction = getNumber(_ammoConfig >> "airFriction"); +private _caliber = getNumber(_ammoConfig >> "ACE_caliber"); +private _bulletLength = getNumber(_ammoConfig >> "ACE_bulletLength"); +private _bulletMass = getNumber(_ammoConfig >> "ACE_bulletMass"); +private _transonicStabilityCoef = getNumber(_ammoConfig >> "ACE_transonicStabilityCoef"); if (_transonicStabilityCoef == 0) then { _transonicStabilityCoef = 0.5; }; -_dragModel = getNumber(_ammoConfig >> "ACE_dragModel"); +private _dragModel = getNumber(_ammoConfig >> "ACE_dragModel"); if (_dragModel == 0 || !(_dragModel in [1, 2, 5, 6, 7, 8])) then { _dragModel = 1; }; -_ballisticCoefficients = getArray(_ammoConfig >> "ACE_ballisticCoefficients"); -_velocityBoundaries = getArray(_ammoConfig >> "ACE_velocityBoundaries"); -_atmosphereModel = getText(_ammoConfig >> "ACE_standardAtmosphere"); +private _ballisticCoefficients = getArray(_ammoConfig >> "ACE_ballisticCoefficients"); +private _velocityBoundaries = getArray(_ammoConfig >> "ACE_velocityBoundaries"); +private _atmosphereModel = getText(_ammoConfig >> "ACE_standardAtmosphere"); if (_atmosphereModel isEqualTo "") then { _atmosphereModel = "ICAO"; }; -_ammoTempMuzzleVelocityShifts = getArray(_ammoConfig >> "ACE_ammoTempMuzzleVelocityShifts"); -_muzzleVelocityTable = getArray(_ammoConfig >> "ACE_muzzleVelocities"); -_barrelLengthTable = getArray(_ammoConfig >> "ACE_barrelLengths"); +private _ammoTempMuzzleVelocityShifts = getArray(_ammoConfig >> "ACE_ammoTempMuzzleVelocityShifts"); +private _muzzleVelocityTable = getArray(_ammoConfig >> "ACE_muzzleVelocities"); +private _barrelLengthTable = getArray(_ammoConfig >> "ACE_barrelLengths"); //Handle subsonic ammo that would have a huge muzzle velocity shift (when ballistic configs not explicitly defined) private _typicalSpeed = getNumber (_ammoConfig >> "typicalSpeed"); @@ -86,7 +89,7 @@ if ((_typicalSpeed > 0) && {_typicalSpeed < 360}) then { }; }; -_result = [_airFriction, _caliber, _bulletLength, _bulletMass, _transonicStabilityCoef, _dragModel, _ballisticCoefficients, _velocityBoundaries, _atmosphereModel, _ammoTempMuzzleVelocityShifts, _muzzleVelocityTable, _barrelLengthTable]; +private _result = [_airFriction, _caliber, _bulletLength, _bulletMass, _transonicStabilityCoef, _dragModel, _ballisticCoefficients, _velocityBoundaries, _atmosphereModel, _ammoTempMuzzleVelocityShifts, _muzzleVelocityTable, _barrelLengthTable]; uiNamespace setVariable [format[QGVAR(%1), _this], _result]; diff --git a/addons/advanced_ballistics/functions/fnc_readWeaponDataFromConfig.sqf b/addons/advanced_ballistics/functions/fnc_readWeaponDataFromConfig.sqf index 7c97e10bda..af31a67fca 100644 --- a/addons/advanced_ballistics/functions/fnc_readWeaponDataFromConfig.sqf +++ b/addons/advanced_ballistics/functions/fnc_readWeaponDataFromConfig.sqf @@ -7,9 +7,12 @@ * weapon - classname * * Return Value: - * 0: _barrelTwist - * 1: _twistDirection - * 2: _barrelLength + * 0: _barrelTwist + * 1: _twistDirection + * 2: _barrelLength + * + * Example: + * ["weapon"] call ace_advanced_ballistics_fnc_readWeaponDataFromConfig * * Public: No */ @@ -30,6 +33,6 @@ private _barrelLength = getNumber(_weaponConfig >> "ACE_barrelLength"); private _result = [_barrelTwist, _twistDirection, _barrelLength]; -uiNamespace setVariable [format[QGVAR(%1), _weapon], _result]; +uiNamespace setVariable [format[QGVAR(%1), _this], _result]; _result diff --git a/addons/advanced_ballistics/stringtable.xml b/addons/advanced_ballistics/stringtable.xml index 6fcac4c3dd..1beff014f3 100644 --- a/addons/advanced_ballistics/stringtable.xml +++ b/addons/advanced_ballistics/stringtable.xml @@ -13,6 +13,9 @@ Zobrazit údaje o větru Mostrar Informação do Vento 風の情報を表示 + 바람의 정보를 표시 + 顯示風況 + 显示风况 Show Protractor @@ -26,6 +29,9 @@ Zobrazit úhloměr Mostrar Transferidor 分度器を表示 + 각도기 표시 + 顯示量角器 + 显示量角器 Advanced Ballistics @@ -39,6 +45,9 @@ Продвинутая баллистика Balistica Avanzata アドバンスド バリスティックス + 고급 탄도학 + 先進彈道系統 + 先进弹道系统 Advanced Ballistics @@ -52,6 +61,9 @@ Продвинутая баллистика Balistica Avanzata アドバンスド バリスティックス + 고급 탄도학 + 先進彈道系統 + 先进弹道系统 Enables advanced ballistics @@ -65,6 +77,9 @@ Включает продвинутую баллистику Abilita Balistica Avanzata アドバンスド バリスティックスを有効化 + 고급 탄도학을 적용합니다 + 啟用先進彈道系統 + 启用先进弹道系统 Enabled For Snipers @@ -78,6 +93,9 @@ Включена для снайперов Abilita per Tiratori Scelti 狙撃手へ有効化 + 저격수만 적용 + 啟用給狙擊手 + 启用给狙击手 Enables advanced ballistics for non local snipers (when using high power optics) @@ -91,6 +109,9 @@ Включает продвинутую баллистику для нелокальных снайперов (при использовании мощной оптики) Abilita Balistica Avanzata per Tiratori Scelti non locali (con ottiche ad alto potenziale) 非ローカルの狙撃手 (高倍率スコープを使っている場合)へアドバンスド バリスティックスを有効化します + 고급 탄도학을 비-저격수 인원에게도 적용합니다(고성능 조준경을 사용시) + 啟用先進彈道系統給非本地狙擊手(當使用高倍率光學瞄鏡時) + 启用先进弹道系统给非本地狙击手(当使用高倍率光学瞄镜时) Enabled For Group Members @@ -104,6 +125,9 @@ Включена для группы Abilita per Membri del Gruppo グループ メンバーへ有効化 + 그룹 멤버도 적용 + 啟用給小隊成員 + 启用给小队成员 Enables advanced ballistics for non local group members @@ -117,6 +141,9 @@ Включает продвинутую баллистику для нелокальных членов группы Abilita Balistica Avanzata per Membri non locali del Gruppo 非ローカルのグループ メンバーへアドバンスド バリスティックスを有効化します + 고급 탄도학을 비-그룹멤버에게도 적용합니다 + 啟用先進彈道系統給非本地小隊成員 + 启用先进弹道系统给非本地小队成员 Enabled For Everyone @@ -130,6 +157,9 @@ Включена для всех Abilita per tutti 全員に有効化 + 모두에게 적용 + 啟用給所有人 + 启用给所有人 Enables advanced ballistics for all non local players (enabling this may degrade performance during heavy firefights in multiplayer) @@ -141,8 +171,11 @@ Active la balistique avancée pour tous les joueurs non locaux (activer cette option peut avoir un impact sur les performance en multi durant les grands échanges de tirs) Engedélyezi a fejlett ballisztikát az összes nem-helyi játékosnak (ez a funkció leronthatja a teljesítményt intenzív többjátékos tűzharcok alatt) Включает продвинутую баллистику для всех нелокальных игроков (включение этой опции может снизить производительность при массовых перестрелках в мультиплеере) - Abilita Balistica Avanzata per tutti i giocatori non locali (abilitare questo parametro potrebbe degradare le prestazioni durante scontri intensi in multiplayer) + Abilita Balistica Avanzata per tutti i giocatori non locali (abilitare questo parametro potrebbe ridurre le prestazioni durante scontri intensi in multiplayer) 非ローカルの全プレイヤーへアドバンスド バリスティックスを有効化します (マルチプレイで大規模な銃撃戦がおこなわれると、動作の低下を招きます) + 고급 탄도학을 모든 비-로컬그룹에게도 적용합니다(적용 후 대규모 전투시 성능하락을 유발할 수 있습니다) + 啟用先進彈道系統給所有非本地玩家 (啟用此功能後,在多人連線大量交火時可能會降低效能) + 启用先进弹道系统给所有非本地玩家 (启用此功能后,在多人连线大量交火时可能会降低效能) Always Enabled For Group Members @@ -156,6 +189,9 @@ Всегда включена для членов группы Sempre abilitato per Membri del Gruppo 常にグループ メンバーへ有効化 + 그룹 멤버에게 항상 적용 + 永遠啟用給小隊成員 + 永远启用给小队成员 Always enables advanced ballistics when a group member fires @@ -167,8 +203,11 @@ Active tout le temps la balistique avancée quand un membre du groupe ouvre le feu Mindig engedélyezi a fejlett ballisztikát, ha egy csoporttag tüzel Всегда включает продвинутую баллистику когда стреляет член группы - Abilita sempre Balistica Avanzata quando un Membro del Gruppo spara + Abilita sempre Balistica Avanzata quando un membro del gruppo spara グループ メンバーが射撃した時、常にアドバンスド バリスティックスを有効化します + 그룹 멤버가 발사시 항상 고급 탄도학을 적용합니다 + 當小隊成員開火時,永遠啟用先進彈道系統 + 当小队成员开火时,永远启用先进弹道系统 Disabled In FullAuto Mode @@ -182,6 +221,9 @@ Выкл. для автомат. режима Disabilita in modalità di fuoco automatico フルオートでは無効化 + 조정간 자동시 비활성화 + 在全自動模式時關閉 + 在全自动模式时关闭 Disables the advanced ballistics during full auto fire @@ -195,6 +237,9 @@ Выключает продвинутую баллистику при стрельбе в полностью автоматическом режиме Disabilita Balistica Avanzata durante fuoco automatico フルオートで射撃中ではアドバンスド バリスティックスを無効化します + 조정간 자동시 고급 탄도학을 비활성화 합니다 + 在全自動模式開火時,關閉先進彈道系統 + 在全自动模式开火时,关闭先进弹道系统 Enable Ammo Temperature Simulation @@ -208,6 +253,9 @@ Симуляция температуры для боеприпасов Abilita simulazione della temperatura delle munizioni 弾薬の温度シミュレーションを有効化 + 탄약 온도 구현 적용 + 啟用彈藥溫度模擬系統 + 启用弹药温度模拟系统 Muzzle velocity varies with ammo temperature @@ -219,8 +267,11 @@ La température de la munition influe sur la vélocité intiale A kezdősebesség a lőszer hőmérsékletétől függően változó Начальная скорость пули зависит от температуры - Velocità alla volata varia con la temperatura delle munizioni + La velocità dello sparo varia a seconda della temperatura delle munizioni 弾薬の温度により初速値を変化させます + 탄약 온도에 비례해 총구 속도가 달라집니다 + 子彈初速將隨彈藥溫度而有所變化 + 子弹初速将随弹药温度而有所变化 Enable Barrel Length Simulation @@ -234,6 +285,9 @@ Симуляция длины ствола Abilita simulazione della lunghezza della canna 銃身長のシミュレーションを有効化 + 총열 길이 구현 적용 + 啟用槍管長度模擬系統 + 启用枪管长度模拟系统 Muzzle velocity varies with barrel length @@ -245,8 +299,11 @@ La longueur du canon influe sur la vélocité initale A kezdősebesség a cső hosszától függően változó Начальная скорость пули зависит от длины ствола - Velocità alla volata varia con la lunghezza della canna + La velocità di sparo varia a seconda della lunghezza della canna 銃身長により初速値を変化させます + 총구 속도가 총열에 비례해 달라집니다 + 子彈初速將隨槍管長度而有所變化 + 子弹初速将随枪管长度而有所变化 Enable Bullet Trace Effect @@ -258,8 +315,11 @@ Activer l'effet balle traçante Nyomkövető-effekt engedélyezése Следы пуль - Abilita effetto di tracciatura dei proiettili + Abilita effetto dei Proiettili Traccianti 弾丸の痕跡表示を有効化 + 예광탄 효과 적용 + 啟用曳光彈效果 + 启用曳光弹效果 Enables a bullet trace effect to high caliber bullets (only visible when looking through high power optics) @@ -271,8 +331,11 @@ Active une tracante pour les munitions de gros calibre (seulement visible en utilisant des optiques avancées) Engedélyezi a nagy kaliberű lövedékek nyomának vizuális követését (csak nagy teljesítményű optikán keresztül látható) Включает эффект следов пуль для больших калибров (видны только через мощную оптику) - Abilita effetto di tracciatura per proiettili di alto calibro (visibile solo attraverso ottiche ad alto potenziale) + Abilita effetto dei proiettili traccianti di alto calibro (visibile solo attraverso ottiche ad alto potenziale) 大口径の銃弾による弾丸の痕跡表示を有効化します (高倍率スコープを介してでしか見れません) + 대구경 탄환에 예광탄 효과를 적용합니다(오직 고성능 조준경 사용시에만 보입니다) + 啟用曳光彈效果給大口徑子彈 (只有透過高倍率光學瞄鏡才能看到) + 启用曳光弹效果给大口径子弹 (只有透过高倍率光学瞄镜才能看到) Simulation Interval @@ -286,6 +349,9 @@ Интервал симуляции Intervallo Simulazione シミュレーション間隔 + 구현 간격 + 模擬間隔 + 模拟间隔 Defines the interval between every calculation step @@ -299,6 +365,9 @@ Определяет временной интервал между вычислениями Definisce l'intervallo tra ogni step di calcolo 各計算ごとの間隔を定義します + 각 계산 단위의 간격을 정의합니다 + 定義每個模擬計算之間的時間間隔 + 定义每个模拟计算之间的时间间隔 Simulation Radius @@ -312,6 +381,9 @@ Радиус симуляции Raggio Simulazione シミュレーションの適用範囲 + 구현 범위 + 模擬半徑 + 模拟半径 Defines the radius around the player (in meters) at which advanced ballistics are applied to projectiles @@ -325,6 +397,9 @@ Определяет радиус вокруг игрока (в метрах), в котором продвинутая баллистика применяется к снарядам Definisce il raggio attorno al giocatore (in metri) per cui la Balistica Avanzata è applicata ai proiettili プレイヤーの周囲にアドバンスド バリスティックスによる弾道を適用させる範囲を半径で定義します (メートル) + 플레이어 주위의 발사체를 고급 탄도학으로 정의하는 범위를 정합니다(미터) + 以玩家的半徑距離(公尺)定義先進彈道系統啟用範圍 + 以玩家的半径距离(公尺)定义先进弹道系统启用范围 This module enables advanced ballistics simulation - meaning the trajectory of projectiles is influenced by variables like air temperature, atmospheric pressure, humidity, gravity, the type of ammunition and the weapon from which it was fired. @@ -338,6 +413,9 @@ Este módulo permite la simulación balística avanzada - es decir, la trayectoria de los proyectiles está influenciada por variables como la temperatura del aire, la presión atmosférica, la humedad, la gravedad, el tipo de municiones y el arma desde el que fue disparada. Questo modulo abilita la simulazione della Balistica Avanzata - cioè la traiettoria dei proiettili è influenzata da variabili come la temperatura dell'aria, pressione atmosferica, umidità, gravità, il tipo di munizione e l'arma da cui è sparata このモジュールはアドバンスド バリスティックスを有効化します。弾道は気温や気圧、湿度、重力、弾薬の種類、発射する武器から影響を受けるようになります。 + 이 모듈은 고급 탄도학을 적용시킵니다 - 이는 발사체의 궤적이 기온, 대기압, 습도, 중력, 탄환의 종류와 어느 무기에서 발사되는지에 따라 영향을 받습니다. + 該模塊實現先進的彈道仿真 - 這意味著子彈的軌跡是由空氣溫度、大氣壓力、濕度、重力、彈藥類型以及射擊的武器所影響 + 该模块实现先进的弹道仿真 - 这意味着子弹的轨迹是由空气温度、大气压力、湿度、重力、弹药类型以及射击的武器所影响 - \ No newline at end of file + diff --git a/addons/advanced_fatigue/ACE_Settings.hpp b/addons/advanced_fatigue/ACE_Settings.hpp index 8242e16111..8abdcc5865 100644 --- a/addons/advanced_fatigue/ACE_Settings.hpp +++ b/addons/advanced_fatigue/ACE_Settings.hpp @@ -1,13 +1,13 @@ class ACE_Settings { class GVAR(enabled) { - category = "Advanced Fatigue"; + category = CSTRING(DisplayName); displayName = CSTRING(Enabled); description = CSTRING(Enabled_Description); typeName = "BOOL"; value = 1; }; class GVAR(enableStaminaBar) { - category = "Advanced Fatigue"; + category = CSTRING(DisplayName); displayName = CSTRING(EnableStaminaBar); description = CSTRING(EnableStaminaBar_Description); typeName = "BOOL"; @@ -15,28 +15,28 @@ class ACE_Settings { isClientSettable = 1; }; class GVAR(performanceFactor) { - category = "Advanced Fatigue"; + category = CSTRING(DisplayName); displayName = CSTRING(PerformanceFactor); description = CSTRING(PerformanceFactor_Description); typeName = "SCALAR"; value = 1; }; class GVAR(recoveryFactor) { - category = "Advanced Fatigue"; + category = CSTRING(DisplayName); displayName = CSTRING(RecoveryFactor); description = CSTRING(RecoveryFactor_Description); typeName = "SCALAR"; value = 1; }; class GVAR(loadFactor) { - category = "Advanced Fatigue"; + category = CSTRING(DisplayName); displayName = CSTRING(LoadFactor); description = CSTRING(LoadFactor_Description); typeName = "SCALAR"; value = 1; }; class GVAR(terrainGradientFactor) { - category = "Advanced Fatigue"; + category = CSTRING(DisplayName); displayName = CSTRING(TerrainGradientFactor); description = CSTRING(TerrainGradientFactor_Description); typeName = "SCALAR"; diff --git a/addons/advanced_fatigue/CfgVehicles.hpp b/addons/advanced_fatigue/CfgVehicles.hpp index 922322b588..83026e2167 100644 --- a/addons/advanced_fatigue/CfgVehicles.hpp +++ b/addons/advanced_fatigue/CfgVehicles.hpp @@ -3,7 +3,7 @@ class CfgVehicles { class GVAR(moduleSettings): ACE_Module { author = ECSTRING(common,ACETeam); category = "ACE"; - displayName = "Advanced Fatigue"; + displayName = CSTRING(DisplayName); function = QFUNC(moduleSettings); scope = 2; isGlobal = 1; diff --git a/addons/advanced_fatigue/XEH_postInit.sqf b/addons/advanced_fatigue/XEH_postInit.sqf index d566e3b042..542360c0c3 100644 --- a/addons/advanced_fatigue/XEH_postInit.sqf +++ b/addons/advanced_fatigue/XEH_postInit.sqf @@ -12,10 +12,17 @@ if (!hasInterface) exitWith {}; GVAR(ppeBlackout) ppEffectCommit 0.4; // - GVAR updating and initialization ----------------------------------------- - if !(isNull ACE_player) then { - [ACE_player, objNull] call FUNC(handlePlayerChanged); - }; - ["unit", FUNC(handlePlayerChanged)] call CBA_fnc_addPlayerEventHandler; + ["unit", FUNC(handlePlayerChanged), true] call CBA_fnc_addPlayerEventHandler; + + ["visibleMap", { + params ["", "_visibleMap"]; // command visibleMap is updated one frame later + private _staminaBarContainer = uiNamespace getVariable [QGVAR(staminaBarContainer), controlNull]; + _staminaBarContainer ctrlShow ((!_visibleMap) && {(vehicle ACE_player) == ACE_player}); + }, true] call CBA_fnc_addPlayerEventHandler; + ["vehicle", { + private _staminaBarContainer = uiNamespace getVariable [QGVAR(staminaBarContainer), controlNull]; + _staminaBarContainer ctrlShow ((!visibleMap) && {(vehicle ACE_player) == ACE_player}); + }, true] call CBA_fnc_addPlayerEventHandler; // - Duty factors ------------------------------------------------------------- if (["ACE_Medical"] call EFUNC(common,isModLoaded)) then { diff --git a/addons/advanced_fatigue/XEH_preInit.sqf b/addons/advanced_fatigue/XEH_preInit.sqf index 9b799a0816..7d682e7db6 100644 --- a/addons/advanced_fatigue/XEH_preInit.sqf +++ b/addons/advanced_fatigue/XEH_preInit.sqf @@ -2,7 +2,9 @@ ADDON = false; +PREP_RECOMPILE_START; #include "XEH_PREP.hpp" +PREP_RECOMPILE_END; //#include "initSettings.sqf" GVAR(staminaBarWidth) = 10 * (((safezoneW / safezoneH) min 1.2) / 40); diff --git a/addons/advanced_fatigue/functions/fnc_addDutyFactor.sqf b/addons/advanced_fatigue/functions/fnc_addDutyFactor.sqf index 74a42d55cf..89801e902e 100644 --- a/addons/advanced_fatigue/functions/fnc_addDutyFactor.sqf +++ b/addons/advanced_fatigue/functions/fnc_addDutyFactor.sqf @@ -8,6 +8,11 @@ * * Return Value: * None + * + * Example: + * ["ID", 5] call ace_advanced_fatigue_fnc_addDutyFactor + * + * Public: No */ #include "script_component.hpp" params [["_id", "", [""]], ["_factor", 1, [0, {}]]]; diff --git a/addons/advanced_fatigue/functions/fnc_createStaminaBar.sqf b/addons/advanced_fatigue/functions/fnc_createStaminaBar.sqf index 773e240494..ce88c2b42e 100644 --- a/addons/advanced_fatigue/functions/fnc_createStaminaBar.sqf +++ b/addons/advanced_fatigue/functions/fnc_createStaminaBar.sqf @@ -7,6 +7,11 @@ * * Return Value: * None + * + * Example: + * [DISPLAY] call ace_advanced_fatigue_fnc_createStaminaBar + * + * Public: No */ #include "script_component.hpp" params ["_display"]; diff --git a/addons/advanced_fatigue/functions/fnc_getAnimDuty.sqf b/addons/advanced_fatigue/functions/fnc_getAnimDuty.sqf index b91e8a09bf..629152b6a1 100644 --- a/addons/advanced_fatigue/functions/fnc_getAnimDuty.sqf +++ b/addons/advanced_fatigue/functions/fnc_getAnimDuty.sqf @@ -21,14 +21,16 @@ private _duty = 1; private _animType = _animName select [1, 3]; GVAR(isSwimming) = false; +GVAR(isProne) = (stance _unit) == "PRONE"; -if (_animType in ["idl", "mov"]) then { +if (_animType in ["idl", "mov", "adj"]) then { switch (_animName select [5, 3]) do { case ("knl"): { _duty = 1.5; }; case ("pne"): { - _duty = 12; + _duty = 10; + GVAR(isProne) = true; // #4880 - Unarmed sprint->prone has wrong `stance` }; default { _duty = 1; @@ -47,9 +49,15 @@ if (_animType in ["idl", "mov"]) then { }; } else { // swimming and diving - if (_animType in ["swm", "ssw", "bsw", "dve", "sdv", "bdv"]) then { - _duty = 5; - GVAR(isSwimming) = true; + switch (true) do { + case (_animType in ["swm", "ssw", "bsw"]): { + _duty = 6.5; + GVAR(isSwimming) = true; + }; + case (_animType in ["dve", "sdv", "bdv"]): { + _duty = 2.5; + GVAR(isSwimming) = true; + }; }; }; diff --git a/addons/advanced_fatigue/functions/fnc_getMetabolicCosts.sqf b/addons/advanced_fatigue/functions/fnc_getMetabolicCosts.sqf index fd2234d1f2..c2c673fd95 100644 --- a/addons/advanced_fatigue/functions/fnc_getMetabolicCosts.sqf +++ b/addons/advanced_fatigue/functions/fnc_getMetabolicCosts.sqf @@ -18,18 +18,8 @@ #include "script_component.hpp" params ["_unit", "_velocity"]; -private _virtualLoad = 0; -{ - _virtualLoad = _virtualLoad + (_x getVariable [QEGVAR(movement,vLoad), 0]); -} forEach [ - _unit, - uniformContainer _unit, - vestContainer _unit, - backpackContainer _unit -]; +private _gearMass = ((_unit getVariable [QEGVAR(movement,totalLoad), loadAbs _unit]) / 22.046) * GVAR(loadFactor); -private _gearMass = ((loadAbs _unit + _virtualLoad) * 0.1 / 2.2046) * GVAR(loadFactor); -private _terrainFactor = 1; private _terrainAngle = asin (1 - ((surfaceNormal getPosASL _unit) select 2)); private _terrainGradient = (_terrainAngle / 45 min 1) * 5 * GVAR(terrainGradientFactor); private _duty = GVAR(animDuty); @@ -50,12 +40,12 @@ if (_velocity > 2) then { ( 2.10 * SIM_BODYMASS + 4 * (SIM_BODYMASS + _gearMass) * ((_gearMass / SIM_BODYMASS) ^ 2) - + _terrainFactor * (SIM_BODYMASS + _gearMass) * (0.90 * (_velocity ^ 2) + 0.66 * _velocity * _terrainGradient) + + (SIM_BODYMASS + _gearMass) * (0.90 * (_velocity ^ 2) + 0.66 * _velocity * _terrainGradient) ) * 0.23 * _duty } else { ( 1.05 * SIM_BODYMASS + 4 * (SIM_BODYMASS + _gearMass) * ((_gearMass / SIM_BODYMASS) ^ 2) - + _terrainFactor * (SIM_BODYMASS + _gearMass) * (1.15 * (_velocity ^ 2) + 0.66 * _velocity * _terrainGradient) + + (SIM_BODYMASS + _gearMass) * (1.15 * (_velocity ^ 2) + 0.66 * _velocity * _terrainGradient) ) * 0.23 * _duty }; diff --git a/addons/advanced_fatigue/functions/fnc_handleEffects.sqf b/addons/advanced_fatigue/functions/fnc_handleEffects.sqf index e23b9d86cd..111727c826 100644 --- a/addons/advanced_fatigue/functions/fnc_handleEffects.sqf +++ b/addons/advanced_fatigue/functions/fnc_handleEffects.sqf @@ -58,7 +58,18 @@ if (GVAR(ppeBlackoutLast) == 1) then { // - Physical effects --------------------------------------------------------- if (GVAR(isSwimming)) exitWith { - _unit setAnimSpeedCoef (1 - _fatigue / 3); + _unit setAnimSpeedCoef linearConversion [0.7, 0.9, _fatigue, 1, 0.5, true]; + + if ((isSprintAllowed _unit) && {_fatigue > 0.7}) then { + [_unit, "blockSprint", QUOTE(ADDON), true] call EFUNC(common,statusEffect_set); + } else { + if ((!isSprintAllowed _unit) && {_fatigue < 0.7}) then { + [_unit, "blockSprint", QUOTE(ADDON), false] call EFUNC(common,statusEffect_set); + }; + }; +}; +if ((getAnimSpeedCoef _unit) != 1) then { + _unit setAnimSpeedCoef 1; }; if (_overexhausted) then { diff --git a/addons/advanced_fatigue/functions/fnc_handlePlayerChanged.sqf b/addons/advanced_fatigue/functions/fnc_handlePlayerChanged.sqf index c275b91cc8..0e31e89645 100644 --- a/addons/advanced_fatigue/functions/fnc_handlePlayerChanged.sqf +++ b/addons/advanced_fatigue/functions/fnc_handlePlayerChanged.sqf @@ -8,13 +8,21 @@ * * Return Value: * None + * + * Example: + * [newbob, oldbob] call ace_advanced_fatigue_fnc_handlePlayerChanged + * + * Public: No */ #include "script_component.hpp" params ["_newUnit", "_oldUnit"]; +TRACE_2("unit changed",_newUnit,_oldUnit); if !(isNull _oldUnit) then { _oldUnit enableStamina true; _oldUnit removeEventHandler ["AnimChanged", _oldUnit getVariable [QGVAR(animHandler), -1]]; + _oldUnit setVariable [QGVAR(animHandler), nil]; + TRACE_1("remove old",_oldUnit getVariable QGVAR(animHandler)); _oldUnit setVariable [QGVAR(ae1Reserve), GVAR(ae1Reserve)]; _oldUnit setVariable [QGVAR(ae2Reserve), GVAR(ae2Reserve)]; @@ -30,6 +38,7 @@ if (_newUnit getVariable [QGVAR(animHandler), -1] == -1) then { private _animHandler = _newUnit addEventHandler ["AnimChanged", { GVAR(animDuty) = _this call FUNC(getAnimDuty); }]; + TRACE_1("add new",_animHandler); _newUnit setVariable [QGVAR(animHandler), _animHandler]; }; @@ -50,7 +59,6 @@ GVAR(peakPower) = VO2MAX_STRENGTH * GVAR(VO2MaxPower); GVAR(ae1PathwayPower) = GVAR(peakPower) / (13.3 + 16.7 + 113.3) * 13.3 * ANTPERCENT ^ 1.28 * 1.362; GVAR(ae2PathwayPower) = GVAR(peakPower) / (13.3 + 16.7 + 113.3) * 16.7 * ANTPERCENT ^ 1.28 * 1.362; -GVAR(anPathwayPower) = GVAR(peakPower) - _ae1PathwayPower - _ae2PathwayPower; GVAR(ppeBlackoutLast) = 100; GVAR(lastBreath) = 0; diff --git a/addons/advanced_fatigue/functions/fnc_handleStaminaBar.sqf b/addons/advanced_fatigue/functions/fnc_handleStaminaBar.sqf index 2f865ac821..72772d16b1 100644 --- a/addons/advanced_fatigue/functions/fnc_handleStaminaBar.sqf +++ b/addons/advanced_fatigue/functions/fnc_handleStaminaBar.sqf @@ -7,6 +7,11 @@ * * Return Value: * None + * + * Example: + * [0.5] call ace_advanced_fatigue_fnc_handleStaminaBar + * + * Public: No */ #include "script_component.hpp" params ["_stamina"]; diff --git a/addons/advanced_fatigue/functions/fnc_mainLoop.sqf b/addons/advanced_fatigue/functions/fnc_mainLoop.sqf index f438d6ef08..4b23153dff 100644 --- a/addons/advanced_fatigue/functions/fnc_mainLoop.sqf +++ b/addons/advanced_fatigue/functions/fnc_mainLoop.sqf @@ -7,17 +7,25 @@ * * Return Value: * None + * + * Example: + * [] call ace_advanced_fatigue_fnc_mainLoop + * + * Public: No */ #include "script_component.hpp" if (!alive ACE_player) exitWith { // Dead people don't breath, Will also handle null (Map intros) [FUNC(mainLoop), [], 1] call CBA_fnc_waitAndExecute; + private _staminaBarContainer = uiNamespace getVariable [QGVAR(staminaBarContainer), controlNull]; + _staminaBarContainer ctrlSetFade 1; + _staminaBarContainer ctrlCommit 1; }; private _currentWork = REE; private _currentSpeed = (vectorMagnitude (velocity ACE_player)) min 6; // fix #4481. Diving to the ground is recorded as PRONE stance with running speed velocity. Cap maximum speed to fix. -if (stance ACE_player == "PRONE") then { +if (GVAR(isProne)) then { _currentSpeed = _currentSpeed min 1.5; }; @@ -29,11 +37,11 @@ if ((vehicle ACE_player == ACE_player) && {_currentSpeed > 0.1} && {isTouchingGr // Calculate muscle damage increase // Note: Muscle damage recovery is ignored as it takes multiple days GVAR(muscleDamage) = GVAR(muscleDamage) + (_currentWork / GVAR(peakPower)) ^ 3.2 * 0.00004; -private _muscleIntegrity = 1 - GVAR(muscleDamage); +private _muscleIntegritySqrt = sqrt (1 - GVAR(muscleDamage)); // Calculate available power -private _ae1PathwayPowerFatigued = GVAR(ae1PathwayPower) * sqrt (GVAR(ae1Reserve) / AE1_MAXRESERVE) * OXYGEN * sqrt _muscleIntegrity; -private _ae2PathwayPowerFatigued = GVAR(ae2PathwayPower) * sqrt (GVAR(ae2Reserve) / AE2_MAXRESERVE) * OXYGEN * sqrt _muscleIntegrity; +private _ae1PathwayPowerFatigued = GVAR(ae1PathwayPower) * sqrt (GVAR(ae1Reserve) / AE1_MAXRESERVE) * OXYGEN * _muscleIntegritySqrt; +private _ae2PathwayPowerFatigued = GVAR(ae2PathwayPower) * sqrt (GVAR(ae2Reserve) / AE2_MAXRESERVE) * OXYGEN * _muscleIntegritySqrt; // Calculate how much power is consumed from each reserve private _ae1Power = _currentWork min _ae1PathwayPowerFatigued; diff --git a/addons/advanced_fatigue/functions/fnc_moduleSettings.sqf b/addons/advanced_fatigue/functions/fnc_moduleSettings.sqf index 275e4b7907..9d1a0a6ab6 100644 --- a/addons/advanced_fatigue/functions/fnc_moduleSettings.sqf +++ b/addons/advanced_fatigue/functions/fnc_moduleSettings.sqf @@ -7,6 +7,11 @@ * * Return Value: * None + * + * Example: + * [MODULE] call ace_advanced_fatigue_fnc_moduleSettings + * + * Public: No */ #include "script_component.hpp" params ["_logic"]; diff --git a/addons/advanced_fatigue/functions/fnc_removeDutyFactor.sqf b/addons/advanced_fatigue/functions/fnc_removeDutyFactor.sqf index 0a67f318ac..4ae07704a5 100644 --- a/addons/advanced_fatigue/functions/fnc_removeDutyFactor.sqf +++ b/addons/advanced_fatigue/functions/fnc_removeDutyFactor.sqf @@ -7,6 +7,11 @@ * * Return Value: * None + * + * Example: + * ["ID"] call ace_advanced_fatigue_fnc_removeDutyFactor + * + * Public: No */ #include "script_component.hpp" params [["_id", "", [""]]]; diff --git a/addons/advanced_fatigue/stringtable.xml b/addons/advanced_fatigue/stringtable.xml index 9915a0cfbc..3eacd2eedd 100644 --- a/addons/advanced_fatigue/stringtable.xml +++ b/addons/advanced_fatigue/stringtable.xml @@ -1,83 +1,156 @@  + + Advanced Fatigue + Erweiterte Ausdauer + 進階疲勞 + 进阶疲劳 + アドバンスド疲労 + Fatica Avanzata + Performance Factor Leistungsfaktor パフォーマンス要因 Współczynnik wydolności + 성능 요인 + Facteur de performance + Fattore Prestazione + 體力值 + 体力值 Influences the overall performance of all players with no custom factor. Higher means better. Beinflusst die Leistungsfähigkeit aller Spieler ohne eigenen Leistungsfaktor. Ein höherer Wert bedeutet bessere Leistung. - 非カスタム要因をもつ全プレイヤーへ全体的に動作を影響させます。高いほど影響がでます。 + 非カスタム要因をもつ全プレイヤーへ全体的に動作を影響させます。高いほど良い効果があります。 Wpływa na ogólną wydolność organizmu u wszystkich graczy bez ustawionego niestandardowego współczynnika. Więcej znaczy lepiej. + 모든 성능이 임의로 설정된 값 없이 영향받습니다. 값이 클수록 더 나은 성능을 발휘합니다 + Influence les performances générales de tous les joueurs sans facteurs personalisés. Une valeur plus élevée implique de meilleures performances. + Influenza qualsiasi prestazione di tutti i giocatori smuniti di un fattore personalizzato. Maggiore significa migliore. + 影響所有玩家的體力表現,值越高代表體力越好 + 影响所有玩家的体力表现,值越高代表体力越好 Influences the overall performance of this unit. Higher means better. Beinflusst die Leistungsfähigkeit dieser Einheit. Ein höherer Wert bedeutet bessere Leistung. - 非カスタム要因をもつ全プレイヤーへ全体的に動作を影響させます。高いほど影響がでます。 + このユニットの全体的な動作に影響させます。高いほど良い効果があります。 Wpływa na ogólną wydolność tej jednostki. Więcej znaczy lepiej. + 모든 성능이 이 단위로 영향을 받습니다. 값이 클수록 더 나은 성능을 발휘합니다 + Influence les performances générales de cette unité. Une valeur plus élevée implique de meilleures performances. + Influenza qualsiasi prestazione di questa unità. Maggiore significa migliore. + 影響這個單位的體力表現,值越高代表體力越好 + 影响这个单位的体力表现,值越高代表体力越好 Recovery Factor Erholungsfaktor 回復要因 Współczynnik regeneracji + 회복 요인 + Facteur de récupération + Fattore Recupero + 回復值 + 回复值 Changes how fast the player recovers when resting. Higher is faster. Ändert, wie schnell ein Spieler Ausdauer regeneriert. Ein höherer Wert bedeutet eine schnellere Regeneration. - 休憩時は、プレイヤーが早く回復します。高いほど早くなります。 + 休憩時はプレイヤーが早く回復します。高いほど早くなります。 Wpływa na czas regeneracji podczas postoju. Więcej znaczy szybciej. + 얼마나 빨리 회복하는지를 바꿉니다. 값이 클수록 더 나은 성능을 발휘합니다 + Change la vitesse à laquelle les joueurs récupèrent leur endurance lorsqu'ils se reposent. Une valeur plus élevée implique une récupération plus rapide. + Determina in quanto tempo il giocatore recupera quando rilassato. Maggiore significa migliore. + 決定玩家休息多久就能回復體力,值越高恢復越快 + 决定玩家休息多久就能回复体力,值越高恢复越快 Load Factor Gewichtsfaktor 負荷要因 Współczynnik masy ekwipunku + 부담 요인 + Facteur d'encombrement + Fattore Caricamento + 負重量 + 负重量 Increases or decreases how much weight influences the players performance. Zero means equipment weight has no performance influence. Erhöht oder verringert, wie viel Einfluss das Ausrüstungsgewicht auf die Leistung hat. Null heißt, dass es keinen Einfluss hat. - 重量によりプレイヤーの動作への影響下増加したり、低下します。装備を持っていない場合、影響はしません。 + 重量の増減によりプレイヤーの動作へ影響を与えます。装備を持っていない場合、影響はしません。 Zmniejsza lub zwiększa wpływ ciężaru ekwipunku na wydolność gracza. Zero oznacza kompletny brak wpływu na wydolność. + 플레이어가 무게에 따라 얼마나 영향받는지를 증가시키거나 감소시킵니다. 0의 경우 플레이어가 장비 무게에 영향받지 않습니다. + Augmente ou réduit l'influence que le poids à sur les performances des joueurs. Zéro implique que le poids de l'équipement n'a pas d'influence sur les performances. + Incrementa o decrementa quanto il peso influenza le prestazioni dei giocatori. Zero significa che il peso dell'equipaggiamento non ha alcuna influenza nelle prestazioni. + 增加或降低玩家所能承受的負重量. 如設定值為0, 代表裝備的重量將不會影響到玩家的體力表現 + 增加或降低玩家所能承受的负重量. 如设定值为0, 代表装备的重量将不会影响到玩家的体力表现 Terrain Gradient Factor Terrainsteigungsfaktor 地形の勾配による要因 Współczynnik terenu + 지형 경사도 요인 + Facteur d'inclinaison du terrain + Fattore Pendenza Terreno + 地形陡峭影響值 + 地形陡峭影响值 Sets how much steep terrain increases stamina loss. Higher means higher stamina loss. Beeinflusst, wie stark Steigungen den Ausdauerverbrauch erhöhen. Ein höherer Wert erhöht den Ausdauerverbrauch. 地形によって影響する体力の消費量を決定します。高数値ではより体力を消費します。 Wpływa na to w jakim stopniu stromy teren wpływa na utratę wytrzymałości. Więcej oznacza szybszą utratę wytrzymałości. + 경사도에 따라 얼마나 피로해지는지를 정합니다. 값이 클수록 더 많은 피로를 유발합니다. + Configure l'influence de l'inclinaison du terrain sur la perte d'endurance. Une valeur plus élevée implique une perte d'endurance plus importante. + Stabilisce quanto la pendenza del terreno incrementa la perdita della stamina. Maggiore significa più stamina persa. + 設定陡峭的地形將會影響多少體力的流失,值越高代表體力流失越快 + 设定陡峭的地形将会影响多少体力的流,失值越高代表体力流失越快 Enabled Aktiv 有効化 Włączone + 활성화 + Activé + Abilitato + 啟用 + 启用 Enables/disables Advanced Fatigue. Aktiviert/deaktiviert Advanced Fatigue. アドバンスド疲労の有効化と無効化 Włącza/wyłącza zaawansowaną wytrzymałość + 고급 피로도 활성화/비활성화 + Active/désactive la fatigue avancée. + Abilita/disabilita la Fatica Avanzata. + 啟用/關閉進階體力. + 启用/关闭进阶体力. Show stamina bar Zeige Ausdauerleiste 体力バーを表示 Pokaż pasek wytrzymałości + 피로도 막대 + Afficher la barre d'endurance + Mostra barra stamina + 顯示體力條 + 显示体力条 Shows the stamina bar. Zeigt die Ausdauerleiste an. 体力バーを表示します。 Pokazuje pasek wytrzymałości. + 피로도 막대를 보여줍니다. + Affiche la barre d'endurance. + Mostra la barra della stamina. + 顯示體力條 + 显示体力条 diff --git a/addons/advanced_throwing/CfgAmmo.hpp b/addons/advanced_throwing/CfgAmmo.hpp new file mode 100644 index 0000000000..9bcf6c37d8 --- /dev/null +++ b/addons/advanced_throwing/CfgAmmo.hpp @@ -0,0 +1,7 @@ +class CfgAmmo { + class Default; + class Grenade: Default { + GVAR(torqueDirection)[] = {1, 1, 0}; + GVAR(torqueMagnitude) = "(50 + random 100) * selectRandom [1, -1]"; + }; +}; diff --git a/addons/advanced_throwing/CfgVehicles.hpp b/addons/advanced_throwing/CfgVehicles.hpp index 043de34bdb..8faa1698f9 100644 --- a/addons/advanced_throwing/CfgVehicles.hpp +++ b/addons/advanced_throwing/CfgVehicles.hpp @@ -60,6 +60,7 @@ class CfgVehicles { displayName = CSTRING(PickUp); condition = QUOTE([ARR_2(_player,true)] call FUNC(canPrepare)); statement = QUOTE(_this call FUNC(pickUp)); + exceptions[] = {"isNotSwimming"}; distance = 1.8; // Requires >1.7 to work when standing with weapon on back icon = "\a3\ui_f\data\igui\cfg\actions\obsolete\ui_action_takemine_ca.paa"; }; diff --git a/addons/advanced_throwing/XEH_postInit.sqf b/addons/advanced_throwing/XEH_postInit.sqf index 4cb4f320e2..7c0a194267 100644 --- a/addons/advanced_throwing/XEH_postInit.sqf +++ b/addons/advanced_throwing/XEH_postInit.sqf @@ -11,7 +11,7 @@ GVAR(ammoMagLookup) = call CBA_fnc_createNamespace; { { private _ammo = getText (configFile >> "CfgMagazines" >> _x >> "ammo"); - GVAR(ammoMagLookup) setVariable [_ammo, _x]; + if (_ammo != "") then { GVAR(ammoMagLookup) setVariable [_ammo, _x]; }; } count (getArray (configFile >> "CfgWeapons" >> "Throw" >> _x >> "magazines")); nil } count getArray (configFile >> "CfgWeapons" >> "Throw" >> "muzzles"); @@ -21,6 +21,7 @@ GVAR(ammoMagLookup) = call CBA_fnc_createNamespace; ["ACE3 Weapons", QGVAR(prepare), localize LSTRING(Prepare), { // Condition if (!([ACE_player] call FUNC(canPrepare))) exitWith {false}; + if (EGVAR(common,isReloading)) exitWith {true}; // Statement [ACE_player] call FUNC(prepare); @@ -30,7 +31,7 @@ GVAR(ammoMagLookup) = call CBA_fnc_createNamespace; ["ACE3 Weapons", QGVAR(dropModeToggle), localize LSTRING(DropModeToggle), { // Condition - if !(ACE_player getVariable [QGVAR(inHand), false]) exitWith {false}; + if (!(ACE_player getVariable [QGVAR(inHand), false]) || {underwater ACE_player}) exitWith {false}; // Statement private _currentDropMode = ACE_player getVariable [QGVAR(dropMode), false]; @@ -67,7 +68,8 @@ GVAR(ammoMagLookup) = call CBA_fnc_createNamespace; }] call CBA_fnc_addPlayerEventhandler; ["visibleMap", { - if (visibleMap && {ACE_player getVariable [QGVAR(inHand), false]}) then { + params ["", "_visibleMap"]; // command visibleMap is updated one frame later + if (_visibleMap && {ACE_player getVariable [QGVAR(inHand), false]}) then { [ACE_player, "Opened Map"] call FUNC(exitThrowMode); }; }] call CBA_fnc_addPlayerEventhandler; @@ -92,6 +94,7 @@ GVAR(ammoMagLookup) = call CBA_fnc_createNamespace; // Set last thrown time on Vanilla Throwing and Advanced Throwing ["ace_firedPlayer", { + //IGNORE_PRIVATE_WARNING ["_unit", "_weapon"]; if (_weapon == "Throw") then { _unit setVariable [QGVAR(lastThrownTime), CBA_missionTime]; }; @@ -114,8 +117,9 @@ addMissionEventHandler ["Draw3D", { // Blue is predicted before throw, red is re drawIcon3D ["\a3\ui_f\data\gui\cfg\hints\icon_text\group_1_ca.paa", [0,0,1,1], _newTrajAGL, 1, 1, 0, "", 2]; } forEach GVAR(predictedPath); { - _newTrajAGL = _x; - drawIcon3D ["\a3\ui_f\data\gui\cfg\hints\icon_text\group_1_ca.paa", [1,0,0,1], _newTrajAGL, 1, 1, 0, "", 2]; - } forEach GVAR(flightPath) + _x params ["_pos", "_vectorUp"]; + drawIcon3D ["\a3\ui_f\data\gui\cfg\hints\icon_text\group_1_ca.paa", [1,0,0,1], _pos, 1, 1, 0, "", 2]; + drawLine3D [_pos, _pos vectorAdd _vectorUp, [1,0,1,1]]; + } forEach GVAR(flightPath); }]; #endif diff --git a/addons/advanced_throwing/XEH_preInit.sqf b/addons/advanced_throwing/XEH_preInit.sqf index a7feade1c3..b47cf6628d 100644 --- a/addons/advanced_throwing/XEH_preInit.sqf +++ b/addons/advanced_throwing/XEH_preInit.sqf @@ -2,6 +2,8 @@ ADDON = false; +PREP_RECOMPILE_START; #include "XEH_PREP.hpp" +PREP_RECOMPILE_END; ADDON = true; diff --git a/addons/advanced_throwing/config.cpp b/addons/advanced_throwing/config.cpp index 021a57bea6..10ca7f642c 100644 --- a/addons/advanced_throwing/config.cpp +++ b/addons/advanced_throwing/config.cpp @@ -15,5 +15,6 @@ class CfgPatches { }; #include "ACE_Settings.hpp" +#include "CfgAmmo.hpp" #include "CfgEventHandlers.hpp" #include "CfgVehicles.hpp" diff --git a/addons/advanced_throwing/functions/fnc_canPrepare.sqf b/addons/advanced_throwing/functions/fnc_canPrepare.sqf index 2e9547fd35..ba3fc53796 100644 --- a/addons/advanced_throwing/functions/fnc_canPrepare.sqf +++ b/addons/advanced_throwing/functions/fnc_canPrepare.sqf @@ -32,6 +32,5 @@ GVAR(enabled) && #endif {!(call EFUNC(common,isFeatureCameraActive))} && -{!EGVAR(common,isReloading)} && -{[_unit, objNull, ["isNotInside", "isNotSitting"/*, "isNotOnLadder"*/]] call EFUNC(common,canInteractWith)} && // Ladder needs positioning fixes on throw +{[_unit, objNull, ["isNotInside", "isNotSwimming", "isNotSitting"/*, "isNotOnLadder"*/]] call EFUNC(common,canInteractWith)} && // Ladder needs positioning fixes on throw {_unit call CBA_fnc_canUseWeapon} // Disable in non-FFV seats due to surface detection issues diff --git a/addons/advanced_throwing/functions/fnc_drawArc.sqf b/addons/advanced_throwing/functions/fnc_drawArc.sqf index 0935b75ab5..eef326750d 100644 --- a/addons/advanced_throwing/functions/fnc_drawArc.sqf +++ b/addons/advanced_throwing/functions/fnc_drawArc.sqf @@ -67,7 +67,7 @@ for "_i" from 0.05 to 1.45 step 0.1 do { private _col = [ [1, 1, 1, _alpha], [0, 1, 0, _alpha], [1, 0, 0, _alpha], [1, 1, 0, _alpha] ] select _cross; if (_cross != 2 && {lineIntersects [eyePos ACE_player, _newTrajASL]}) then { - _col set [3, 0.1] + _col set [3, 0.1]; }; _pathData pushBack [_col, ASLToAGL _newTrajASL, _iDim]; diff --git a/addons/advanced_throwing/functions/fnc_drawThrowable.sqf b/addons/advanced_throwing/functions/fnc_drawThrowable.sqf index 226519b931..0e6a6dea99 100644 --- a/addons/advanced_throwing/functions/fnc_drawThrowable.sqf +++ b/addons/advanced_throwing/functions/fnc_drawThrowable.sqf @@ -36,6 +36,11 @@ if (_throwable isEqualTo [] && {!_primed}) exitWith { private _throwableMag = _throwable param [0, "#none"]; +// If not primed, double check we actually have the magazine in inventory +if ((!_primed) && {!((_throwableMag in (uniformItems ACE_player)) || {_throwableMag in (vestItems ACE_player)} || {_throwableMag in (backpackItems ACE_player)})}) exitWith { + [ACE_player, "No valid throwable (glitched currentThrowable)"] call FUNC(exitThrowMode); +}; + // Get correct throw power for primed grenade if (_primed) then { private _ammoType = typeOf _activeThrowable; @@ -123,6 +128,10 @@ _activeThrowable setDir (_unitDirVisual + 90); private _pitch = [-30, -90] select (_throwType == "high"); [_activeThrowable, _pitch, 0] call BIS_fnc_setPitchBank; +// Force drop mode if underwater +if (underwater player) then { + ACE_player setVariable [QGVAR(dropMode), true]; +}; if (ACE_player getVariable [QGVAR(dropMode), false]) then { _posFin = _posFin vectorAdd (AGLToASL (positionCameraToWorld [_leanCoef, 0, ACE_player getVariable [QGVAR(dropDistance), DROP_DISTANCE_DEFAULT]])); diff --git a/addons/advanced_throwing/functions/fnc_exitThrowMode.sqf b/addons/advanced_throwing/functions/fnc_exitThrowMode.sqf index c508d0a803..33ff556f6a 100644 --- a/addons/advanced_throwing/functions/fnc_exitThrowMode.sqf +++ b/addons/advanced_throwing/functions/fnc_exitThrowMode.sqf @@ -32,6 +32,10 @@ if !(_unit getVariable [QGVAR(primed), false]) then { _unit setVariable [QGVAR(lastThrownTime), CBA_missionTime]; // Fix floating for throwables without proper physics (eg. IR Grenade) _activeThrowable setVelocity [0, 0, -0.1]; + + // Set thrower + private _instigator = (getShotParents _activeThrowable) param [1, _unit]; // getShotParents could be [] on replaced grenades (like IR chemlight) + [QEGVAR(common,setShotParents), [_activeThrowable, _unit, _instigator]] call CBA_fnc_serverEvent; }; // Restore muzzle ammo (setAmmo 1 has no impact if no appliccable throwable in inventory) diff --git a/addons/advanced_throwing/functions/fnc_moduleInit.sqf b/addons/advanced_throwing/functions/fnc_moduleInit.sqf index 043f15b491..fe380d2bb5 100644 --- a/addons/advanced_throwing/functions/fnc_moduleInit.sqf +++ b/addons/advanced_throwing/functions/fnc_moduleInit.sqf @@ -13,8 +13,7 @@ * Example: * [logic, [unit1, unit2], true] call ace_advanced_throwing_fnc_moduleInit * - * Public: - * No + * Public: No */ #include "script_component.hpp" diff --git a/addons/advanced_throwing/functions/fnc_prime.sqf b/addons/advanced_throwing/functions/fnc_prime.sqf index 727ace4e23..d52bee67f2 100644 --- a/addons/advanced_throwing/functions/fnc_prime.sqf +++ b/addons/advanced_throwing/functions/fnc_prime.sqf @@ -54,6 +54,9 @@ deleteVehicle _activeThrowableOld; _activeThrowable // projectile ]] call CBA_fnc_globalEvent; +// Set prime instigator +[QEGVAR(common,setShotParents), [_activeThrowable, _unit, _unit]] call CBA_fnc_serverEvent; + if (_showHint) then { // Show primed hint private _displayNameShort = getText (configFile >> "CfgMagazines" >> _throwableMag >> "displayNameShort"); diff --git a/addons/advanced_throwing/functions/fnc_renderPickUpInteraction.sqf b/addons/advanced_throwing/functions/fnc_renderPickUpInteraction.sqf index 960bf8fec5..9f2743c600 100644 --- a/addons/advanced_throwing/functions/fnc_renderPickUpInteraction.sqf +++ b/addons/advanced_throwing/functions/fnc_renderPickUpInteraction.sqf @@ -7,7 +7,7 @@ * None * * Return Value: - * Nothing + * None * * Example: * call ace_advanced_throwing_fnc_renderPickUpInteraction diff --git a/addons/advanced_throwing/functions/fnc_throw.sqf b/addons/advanced_throwing/functions/fnc_throw.sqf index a3273eb034..b7019b49dd 100644 --- a/addons/advanced_throwing/functions/fnc_throw.sqf +++ b/addons/advanced_throwing/functions/fnc_throw.sqf @@ -49,9 +49,15 @@ if (!(_unit getVariable [QGVAR(primed), false])) then { _newVelocity = _newVelocity vectorAdd (velocity (vehicle _unit)); }; + private _config = configFile >> "CfgAmmo" >> typeOf _activeThrowable; + private _torqueDir = vectorNormalized (getArray (_config >> QGVAR(torqueDirection))); + private _torqueMag = getNumber (_config >> QGVAR(torqueMagnitude)); + private _torque = _torqueDir vectorMultiply _torqueMag; + // Drop if unit dies during throw process if (alive _unit) then { _activeThrowable setVelocity _newVelocity; + _activeThrowable addTorque (_unit vectorModelToWorld _torque); }; // Invoke listenable event @@ -67,12 +73,12 @@ if (!(_unit getVariable [QGVAR(primed), false])) then { #ifdef DRAW_THROW_PATH -GVAR(predictedPath) = call FUNC(drawArc); // save the current throw arc +GVAR(predictedPath) = call FUNC(drawArc); // Save the current throw arc GVAR(flightPath) = []; -[_unit getVariable QGVAR(activeThrowable)] spawn { - params ["_grenade"]; - while {!isNull _grenade} do { - GVAR(flightPath) pushBack ASLtoAGL getPosASL _grenade; +GVAR(flightRotation) = []; +(_unit getVariable QGVAR(activeThrowable)) spawn { + while {!isNull _this && {(getPosATL _this) select 2 > 0.05}} do { + GVAR(flightPath) pushBack [ASLtoAGL (getPosASL _this), vectorUp _this]; sleep 0.05; }; }; diff --git a/addons/advanced_throwing/stringtable.xml b/addons/advanced_throwing/stringtable.xml index dfd346a9e1..e282981030 100644 --- a/addons/advanced_throwing/stringtable.xml +++ b/addons/advanced_throwing/stringtable.xml @@ -6,126 +6,252 @@ Улучшенный бросок гранат アドバンスド投てき Zaawansowane rzucanie + Erweitertes Wurfsystem + 고급 투척 + Lancé amélioré + Lancio Avanzato + 進階投擲 + 进阶投掷 Allows changing advanced throwing behaviour. Позволяет настраивать поведение улучшенного броска гранат. アドバンスド投てきの挙動変更を許可します。 Zezwala na zmianę zachowania zaawansowanego trybu rzucania. + Erlaubt es, das Verhalten des erweiterten Wurfsystems zu ändern. + 고급 투척 행위를 허가합니다 + Permet de changer la configuration du lancé amélioré. + Permette il cambiamento della modalità di tiro. + 允許使用更多不同的投擲方式 + 允许使用更多不同的投掷方式 Enable Advanced Throwing Включить улучшенный бросок アドバンスド投てきを有効化 Aktywuj zaawansowane rzucanie + Aktiviere erweitertes Wurfsystem + 고급 투척 활성화 + Active le lancé amélioré + Abilita Lancio Avanzato + 啟用進階投擲 + 启用进阶投掷 Enables advanced throwing system. Включает систему улучшенного броска. アドバンスド投てきシステムを有効化 Aktywuje system zaawansowanego rzucania. + Aktiviert das erweiterte Wurfsystem. + 고급 투척을 활성화 합니다 + Active le système de lancé amélioré. + Abilita il sistema di lancio avanzato. + 啟用進階投擲系統 + 启用进阶投掷系统 Show Throw Arc Показать траекторию броска 軌道を表示 Pokaż trasę lotu + Zeige Wurfbogen + 투척 궤적 표시 + Afficher l'arc de lancé + Mostra Arco di Tiro + 顯示投擲軌道 + 显示投掷轨道 Enables visualization of the throw arc (where throwable will fly). Включает визуализацию траектории броска (как полетит граната). 投てき物の予測軌道の表示を有効化します。 Wyświetla wizualizację trasy przelotu granatu. + Aktiviert die Visualisierung des Wurfbogens (wohin das Objekt geworfen werden wird). + 투척 궤도를 시각화 합니다(투척물이 어디로 갈지) + Active la visualisation de l'arc de lancé (où l'objet lancé va atterrir). + Abilita la visualizzazione dell'arco del tiro (dove l'oggetto lanciabile volerà). + 顯示投擲軌道幫助投擲 + 显示投掷轨道帮助投掷 Show Throwing Mouse Controls Показывать управление мышью 投てきのマウス操作を表示 Pokaż podpowiedzi sterowania myszą + Zeige Maussteuerung beim Werfen + 마우스 조작 표시 + Afficher les contrôles à la souris du lancé + Mostra Comandi Mouse Lancio + 顯示滑鼠投擲控制提示 + 显示滑鼠投掷控制提示 Enables visual cues for mouse controls when throwable is prepared. Включает отображение подсказок по управлению мышью, когда граната подготовлена. 投てき物を投げるとき、マウス操作の説明表示を有効化します。 Wyświetla podpowiedzi sterowania myszą kiedy obiekt miotany jest w ręku. + Aktiviert visuelle Hinweise zur Maussteuerung, wenn ein Objekt zum Werfen vorbereitet wird. + 투척물을 준비시 마우스 조작을 시각화해서 보여줍니다 + Active les aides visuels pour les controles à la souris lorsqu'un lancé est préparé. + Abilita la visualizzazione dei controlli del mouse quando l'oggetto lanciabile è pronto. + 開啟後會在準備投擲時, 顯示滑鼠相關操作 + 开启后会在准备投掷时, 显示滑鼠相关操作 Enable Throwables Pick Up Включить подбор гранат 投てき物の拾い上げを有効化 Zezwól na podnoszenie obiektów miotanych + Aktiviere Aufheben von Wurfobjekten + 투척물 줍기 활성화 + Active la récupération des objets lancés + Abilita Raccogli Oggetti + 啟用可撿取地面投擲物 + 启用可捡取地面投掷物 Enables ability to pick up throwables from the ground. Включает возможность подбирать гранаты с земли. 地面に落ちている投てき物の拾い上げ動作を有効化します。 Umożliwia podnoszenie obiektów miotanych z ziemi. + Aktiviert die Möglichkeit, geworfene Objekte wieder vom Boden aufzuheben. + 땅에 떨어진 투척물을 주울 수 있게 해줍니다. + Active la capacité de récupérer les objets lancés sur le sol. + Abilita la possibilità di raccogliere un oggetto lanciabile da terra. + 啟用後, 可撿取地面上的投擲物 + 启用后, 可捡取地面上的投掷物 Enable Attached Throwables Pick Up Включить подбор прикрепленных гранат 拾い上げた投てき物の取り付けを有効化 Zezwól na podnoszenie przyczepionych obiektów miotanych + Aktiviere erneute Aufnahme befestigter Wurfobjekte + 부착 투척물 줍기 활성화 + Active le ramassage d'objets lançables attachés + Abilita Raccogli Oggetti Lanciabili da altri Oggetti + 啟用可撿取附著投擲物 + 启用可捡取附着投掷物 Enables ability to pick up throwables from attached objects. Включает возможность подбирать гранаты, прикрепленные к объектам. オブジェクトに取り付けられていた投てき物を拾い上げられるようにします。 Umożliwia podnoszenie obiektów miotanych przyczepionych do innych obiektów. + Aktiviert die Möglichkeit, befestigte Wurfobjekte erneut aufzunehmen. + 부착된 투척물을 주울 수 있게 해줍니다. + Active la capacité à ramasser les objets lançables attaché à d'autres objets. + Abilita la possibilità di raccogliere gli oggetti lanciabili dagli altri oggetti. + 啟用後, 可撿取附著在物件上的投擲物 + 启用后, 可捡取附着在物件上的投掷物 Prepare/Change Throwable Подготовить/заменить гранату - 機能の起動/変更 + 投てき物の準備/変更 Przygotuj/zmień ob. miotany + Wurfobjekt vorbereiten/wechseln + 투척물 준비/변경 + Préparer/changer d'objet + Prepara/Cambia Oggetto lanciabile + 準備/變更投擲物 + 准备/变更投掷物 Throwable Drop Mode (Hold) Режим броска гранаты (удерживать) 投てきモード (押しっぱ) Tryb upuszczania ob. miotanego (przytrzymaj) + Wurfobjekt Fallmodus (halten) + 투척물 떨어뜨리기 모드(꾹눌러서) + Mode de lancé de l'objet (Tenir) + Modalità Oggetto Gettabile (Mantenere) + 投擲模式 (按住) + 投掷模式 (按住) Throwable Drop Mode (Toggle) Режим броска гранаты (переключить) - 投てきモード (トグル) + 投てきモード (切り替え) Tryb upuszczania ob. miotanego (przełącz) + Wurfobjekt Fallmodus (umschalten) + 투척물 떨어뜨리기 모드(토글) + Mode de lancé de l'objet (Basculer) + Modalità Oggetto lanciabile Gettabile (Interruttore) + 投擲模式 (切換) + 投掷模式 (切换) Primed Подготовлена 起動した Odbezpieczony + Scharf gemacht + 뇌관 작동 + Amorcer + Armato + 引信開始燃燒 + 引信开始燃烧 Throw Бросить 投げる Rzuć + Werfen + 던지기 + Lancer + Lanciare + 投擲 + 投掷 (Scroll) Change Mode (Скролл) Изменить режим (スクロール) モード変更 (Kółko m.) zmień tryb + (Scrollen) Modus wechseln + (마우스 휠) 모드 변경 + (Molette souris) Changer de mode + (Scorrere) Cambio Modalità + (滾輪) 變更模式 + (滚轮) 变更模式 (Scroll) Extend (Скролл) Увеличить (スクロール) 遠くに (Kółko m.) przedłuż + (Scrollen) Erweitern + (마우스 휠) 연장 + (Molette souris) Etendre + (Scorrere) Estendere + (滾輪) 延長 + (滚轮) 延长 (Click) Cook (Клик) Подготовить (クリック) 起爆 (Kliknięcie) Odbezpiecz + (Klicken) Abkochen + (클릭) 예열 + (Clique) Dégoupiller + (Click) Arma + (點擊) 提早拉開引信 + (点击) 提早拉开引信 Pick Up Подобрать 拾い上げる Podnieś + Aufheben + 줍기 + Ramasser + Raccogli + 撿取 + 捡取 diff --git a/addons/ai/CfgAISkill.hpp b/addons/ai/CfgAISkill.hpp deleted file mode 100644 index c01b5eb96e..0000000000 --- a/addons/ai/CfgAISkill.hpp +++ /dev/null @@ -1,28 +0,0 @@ - -/* - * Documentation: - * https://community.bistudio.com/wiki/AI_Sub-skills - * - * The idea here is to reduce the AI's godlike aiming - * capabilties while retaining it's high intelligence. - * The AI should be smart enough to move through a town, - * but also be 'human' in their reaction time and aim. - * - * Note: All these values can still be adjusted via - * scripts, these arrays just change what 0 & 1 - * are for setSkill. - */ - -class CfgAISkill { - aimingAccuracy[] = {0,0, 1,0.8}; // {0,0,1,1}; v1.26 defaults - aimingShake[] = {0,0, 1,0.6}; // {0,0,1,1}; - aimingSpeed[] = {0,0, 1,0.7}; // {0,0.5,1,1}; - commanding[] = {0,0, 1,0.8}; // {0,0,1,1}; - courage[] = {0,0, 1,0.7}; // {0,0,1,1}; - endurance[] = {0,0, 1,0.7}; // {0,0,1,1}; - general[] = {0,0, 1,0.9}; // {0,0,1,1}; - // apparently breaks rapid firing in single fire mode for players - //reloadSpeed[] = {0,0, 1,0.8}; // {0,0,1,1}; - spotDistance[] = {0,0, 1,0.9}; // {0,0.2,1,0.4}; - spotTime[] = {0,0, 1,0.7}; // {0,0,1,0.7}; -}; diff --git a/addons/ai/CfgEventHandlers.hpp b/addons/ai/CfgEventHandlers.hpp new file mode 100644 index 0000000000..becf395052 --- /dev/null +++ b/addons/ai/CfgEventHandlers.hpp @@ -0,0 +1,18 @@ + +class Extended_PreStart_EventHandlers { + class ADDON { + init = QUOTE(call COMPILE_FILE(XEH_preStart)); + }; +}; + +class Extended_PreInit_EventHandlers { + class ADDON { + init = QUOTE(call COMPILE_FILE(XEH_preInit)); + }; +}; + +class Extended_PostInit_EventHandlers { + class ADDON { + init = QUOTE(call COMPILE_FILE(XEH_postInit)); + }; +}; diff --git a/addons/ai/CfgWeapons.hpp b/addons/ai/CfgWeapons.hpp index 74df685fb0..01d8d5f9c2 100644 --- a/addons/ai/CfgWeapons.hpp +++ b/addons/ai/CfgWeapons.hpp @@ -467,7 +467,7 @@ class CfgWeapons { }; // Scorpion EVO - class SMG_02_base_F: Rifle_Base_F { + class SMG_02_base_F: Rifle_Short_Base_F { class Single: Mode_SemiAuto { minRange = 50; //2; diff --git a/addons/ai/README.md b/addons/ai/README.md index 40b4e776a4..e3175b1006 100644 --- a/addons/ai/README.md +++ b/addons/ai/README.md @@ -1,7 +1,7 @@ ace_ai ====== -Minor changes of AI skill and overhaul of AI firing modes of vanilla weapons, encouraging the AI to use full-auto and bursts more often. +Overhaul of AI firing modes of vanilla weapons, encouraging the AI to use full-auto and bursts more often. ## Maintainers diff --git a/addons/ai/XEH_PREP.hpp b/addons/ai/XEH_PREP.hpp new file mode 100644 index 0000000000..d3a61e3012 --- /dev/null +++ b/addons/ai/XEH_PREP.hpp @@ -0,0 +1,3 @@ +PREP(garrison); +PREP(unGarrison); +PREP(garrisonMove); diff --git a/addons/ai/XEH_postInit.sqf b/addons/ai/XEH_postInit.sqf new file mode 100644 index 0000000000..cf0ab8e49d --- /dev/null +++ b/addons/ai/XEH_postInit.sqf @@ -0,0 +1,84 @@ +#include "script_component.hpp" + +[QGVAR(AISection), { + params [["_units", [], [[]]], ["_sections", [], [[]]], ["_bool", true, [true]]]; + { + private _section = _x; + { + if (_bool) then { + _x enableAI _section; + } else { + _x disableAI _section; + }; + LOG(format [ARR_4("XEH_postInit: %1 disableAI %2 | ID %3", _x, _section, clientOwner)]); + } foreach (_units select {local _x}); + } foreach _sections +}] call CBA_fnc_addEventHandler; + +[QGVAR(unGarrison), FUNC(unGarrison)] call CBA_fnc_addEventHandler; +[QGVAR(doMove), { + params ["_unitsArray"]; + { + _x params ["_unit", "_pos"]; + //_unit doFollow leader _unit; + _unit setDestination [_pos, "LEADER PLANNED", true]; + _unit doMove _pos; + LOG(format [ARR_4("XEH_postInit: %1 doMove %2 | ID %3", _unit, _pos, clientOwner)]); + } foreach _unitsArray +}] call CBA_fnc_addEventHandler; +[QGVAR(setBehaviour), { + params ["_groupsArray", "_behaviour"]; + { + _x params ["_group"]; + _group setBehaviour _behaviour; + LOG(format [ARR_4("XEH_postInit: %1 setBehaviour %2 | ID %3", _group, _behaviour, clientOwner)]); + } foreach _groupsArray +}] call CBA_fnc_addEventHandler; +[QGVAR(enableAttack), { + params ["_unitsArray", "_mode"]; + { + _x params ["_unit"]; + _unit enableAttack _mode; + LOG(format [ARR_4("XEH_postInit: %1 enableAttack %2 | ID %3", _unit, _mode, clientOwner)]); + } foreach _unitsArray +}] call CBA_fnc_addEventHandler; + +#ifdef DEBUG_MODE_FULL + addMissionEventHandler ["Draw3D", { + private _unitMoveList = missionNameSpace getVariable [QGVAR(garrison_unitMoveList), []]; + + { + _x params ["_unit", "_pos"]; + + switch true do { + case (surfaceIsWater (getPos _unit) && {surfaceIsWater _pos}) : { + for "_i" from 0 to 3 do { + drawLine3D [_unit modelToWorldVisualWorld [0,0,1], (AGLtoASL _pos), [1,0,0,1]]; + }; + drawIcon3D ["\a3\ui_f\data\map\groupicons\waypoint.paa", [1,0,0,1], (AGLtoASL _pos), 0.75, 0.75, 0.75]; + }; + + case (!surfaceIsWater (getPos _unit) && {!surfaceIsWater _pos}) : { + for "_i" from 0 to 3 do { + drawLine3D [_unit modelToWorldVisual [0,0,1], _pos, [1,0,0,1]]; + }; + drawIcon3D ["\a3\ui_f\data\map\groupicons\waypoint.paa", [1,0,0,1], _pos, 0.75, 0.75, 0.75]; + }; + + case (!surfaceIsWater (getPos _unit) && {surfaceIsWater _pos}) : { + for "_i" from 0 to 3 do { + drawLine3D [_unit modelToWorldVisual [0,0,1], (AGLToASL _pos), [1,0,0,1]]; + }; + drawIcon3D ["\a3\ui_f\data\map\groupicons\waypoint.paa", [1,0,0,1], (AGLtoASL _pos), 0.75, 0.75, 0.75]; + }; + + case (surfaceIsWater (getPos _unit) && {!surfaceIsWater _pos}) : { + for "_i" from 0 to 3 do { + drawLine3D [_unit modelToWorldVisualWorld [0,0,1], _pos, [1,0,0,1]]; + }; + drawIcon3D ["\a3\ui_f\data\map\groupicons\waypoint.paa", [1,0,0,1], _pos, 0.75, 0.75, 0.75]; + }; + }; + } foreach _unitMoveList; + }]; +#endif \ No newline at end of file diff --git a/addons/ai/XEH_preInit.sqf b/addons/ai/XEH_preInit.sqf new file mode 100644 index 0000000000..b47cf6628d --- /dev/null +++ b/addons/ai/XEH_preInit.sqf @@ -0,0 +1,9 @@ +#include "script_component.hpp" + +ADDON = false; + +PREP_RECOMPILE_START; +#include "XEH_PREP.hpp" +PREP_RECOMPILE_END; + +ADDON = true; diff --git a/addons/javelin/XEH_post_init.sqf b/addons/ai/XEH_preStart.sqf similarity index 57% rename from addons/javelin/XEH_post_init.sqf rename to addons/ai/XEH_preStart.sqf index 6eccf9d1dd..022888575e 100644 --- a/addons/javelin/XEH_post_init.sqf +++ b/addons/ai/XEH_preStart.sqf @@ -1,2 +1,3 @@ #include "script_component.hpp" +#include "XEH_PREP.hpp" diff --git a/addons/ai/config.cpp b/addons/ai/config.cpp index 60bf7184a4..bc3b2df4ac 100644 --- a/addons/ai/config.cpp +++ b/addons/ai/config.cpp @@ -14,5 +14,5 @@ class CfgPatches { }; }; -#include "CfgAISkill.hpp" #include "CfgWeapons.hpp" +#include "CfgEventHandlers.hpp" diff --git a/addons/ai/functions/fnc_garrison.sqf b/addons/ai/functions/fnc_garrison.sqf new file mode 100644 index 0000000000..c303d2b90c --- /dev/null +++ b/addons/ai/functions/fnc_garrison.sqf @@ -0,0 +1,278 @@ +/* + * Author: alganthe + * Garrison function used to garrison AI inside buildings. + * + * Arguments: + * 0: The building(s) nearest this position are used + * 1: Limit the building search to those type of building + * 2: Units that will be garrisoned + * 3: Radius to fill building(s) (default: 50) + * 4: 0: even filling, 1: building by building, 2: random filling (default: 0) + * 5: True to fill building(s) from top to bottom (default: false) (note: only works with filling mode 0 and 1) + * 6: Teleport units (default: false) + + * Return Value: + * Units not garrisoned + * + * Example: + * [position, nil, [unit1, unit2, unit3, unitN], 200, 1, false, false] call ace_ai_fnc_garrison + * + * Public: Yes +*/ +#include "script_component.hpp" + +params [["_startingPos",[0,0,0], [[]], 3], ["_buildingTypes", ["Building"], [[]]], ["_unitsArray", [], [[]]], ["_fillingRadius", 50, [0]], ["_fillingType", 0, [0]], ["_topDownFilling", false, [true]], ["_teleport", false, [true]]]; + +TRACE_6("fnc_garrison: Start",_startingPos,_buldingTypes,count _unitsArray,_fillingRadius,_fillingTYpe,_topDownFilling); + +_unitsArray = _unitsArray select {alive _x && {!isPlayer _x}}; + +if (_startingPos isEqualTo [0,0,0]) exitWith { + TRACE_1("fnc_garrison: StartingPos error",_startingPos); + [LSTRING(GarrisonInvalidPosition)] call EFUNC(common,displayTextStructured); +}; + +if (count _unitsArray == 0 || {isNull (_unitsArray select 0)}) exitWith { + TRACE_1("fnc_garrison: Units error",_unitsArray); + [LSTRING(GarrisonNoUnits)] call EFUNC(common,displayTextStructured); +}; + +private _buildings = nearestObjects [_startingPos, _buildingTypes, ([_fillingRadius, 50] select (_fillingRadius < 50))]; +if (_fillingRadius >= 50) then { + _buildings = [_buildings] call CBA_fnc_shuffle; +}; + +if (count _buildings == 0) exitWith { + TRACE_1("fnc_garrison: Building error",_buildings); + [LSTRING(GarrisonNoBuilding)] call EFUNC(common,displayTextStructured); +}; + +private _buildingsIndex = []; + +if (_topDownFilling) then { + { + private _buildingPos = _x buildingPos -1; + + // Those reverse are necessary, as dumb as it is there's no better way to sort those subarrays in sqf + { + reverse _x; + } foreach _buildingPos; + + _buildingPos sort false; + + { + reverse _x; + } foreach _buildingPos; + + _buildingsIndex pushBack _buildingPos; + } foreach _buildings; +} else { + { + _buildingsIndex pushBack (_x buildingPos -1); + } foreach _buildings; +}; + +// Remove buildings without positions +{ + _buildingsIndex deleteAt (_buildingsIndex find _x); +} foreach (_buildingsIndex select {count _x == 0}); + +//Remove positions units are already pathing to +_buildingsIndex = _buildingsIndex apply { + private _testedBuilding = _x; + + _testedBuilding select { + private _testedPos = _x; + (({(_x select 1) isEqualTo _testedPos} count (missionNameSpace getVariable [QGVAR(garrison_unitMoveList), []])) == 0) + } +}; + +// Warn the user that there's not enough positions to place all units +private _count = 0; +{_count = _count + count _x} foreach _buildingsIndex; +if ( (count _unitsArray) - _count > 0) then { + TRACE_4("fnc_garrison: Not enough spots to place all units",_unitsArray,count _unitsArray,_count,((count _unitsArray) - _count > 0)); + [LSTRING(GarrisonNotEnoughPos)] call EFUNC(common,displayTextStructured); +}; + +private _placedUnits = []; +private _unitMoveList = []; + +// Force all units to un-garrison +[QGVAR(unGarrison), [_unitsArray], _unitsArray] call CBA_fnc_targetEvent; + +private _fnc_comparePos = { + params ["_nearestUnits", "_pos"]; + ({ + if (surfaceIsWater getPos _x) then { + floor ((getPosASL _x) select 2) == floor ((AGLtoASL _pos) select 2) + } else { + floor ((getPosATL _x) select 2) == floor (_pos select 2) + }; + } count _nearestUnits) > 0 +}; + +// Do the placement +switch (_fillingType) do { + + // Even filling + case 0: { + + while {count _unitsArray > 0} do { + if (count _buildingsIndex == 0) exitWith {}; + private _building = _buildingsIndex select 0; + + if (_building isEqualTo []) then { + LOG(format [ARR_2("fnc_garrison: Empty building array | removing building from buildingsIndex | %1 buildings remaining",count _buildingsIndex)]); + _buildingsIndex deleteAt 0; + + } else { + private _pos = _building select 0; + private _nearestUnits = (_pos nearEntities ["CAManBase", 2]); + LOG(format [ARR_3("fnc_garrison: Unit detection | %1 units nearby | %2 units within height",count _nearestUnits, {floor ((getPos _x) select 2) == floor (_pos select 2)} count _nearestUnits)]); + + if (count _nearestUnits > 0 && {[_nearestUnits, _pos] call _fnc_comparePos}) then { + LOG(format [ARR_2("fnc_garrison: Unit present | removing position | %1 positions remaining for this building",count (_buildingsIndex select (_buildingsIndex find _building)) - 1)]); + _buildingsIndex set [0, _building - [_pos]]; + + } else { + private _unit = _unitsArray select 0; + private _posSurface = surfaceIsWater _pos; + + if (_teleport) then { + doStop _unit; + if (_posSurface) then { + _unit setPosASL (AGLtoASL _pos); + } else { + _unit setPosATL _pos; + }; + + } else { + _unitMoveList pushBack [_unit,[_pos, AGLToASL _pos] select (_posSurface)]; + }; + + _placedUnits pushBack _unit; + _unitsArray deleteAt (_unitsArray find _unit); + _building deleteAt 0; + _buildingsIndex deleteAt 0; + _buildingsIndex pushBackUnique _building; + _unit setVariable [QGVAR(garrisonned), true, true]; + }; + }; + }; + }; + + // Building by building + case 1: { + + while {count _unitsArray > 0} do { + if (count _buildingsIndex == 0) exitWith {}; + private _building = _buildingsIndex select 0; + + if (_building isEqualTo []) then { + LOG(format [ARR_2("fnc_garrison: empty building array | removing building from buildingsIndex | %1 buildings remaining",count _buildingsIndex)]); + _buildingsIndex deleteAt 0; + + } else { + private _pos = _building select 0; + private _nearestUnits = (_pos nearEntities ["CAManBase", 2]); + LOG(format [ARR_3("fnc_garrison: Unit detection | %1 units nearby | %2 units within height",count _nearestUnits, {floor ((getPos _x) select 2) == floor (_pos select 2)} count _nearestUnits)]); + + if (count _nearestUnits > 0 && {[_nearestUnits, _pos] call _fnc_comparePos}) then { + LOG(format [ARR_2("fnc_garrison: Unit present | removing position | %1 positions remaining for this building",count (_buildingsIndex select (_buildingsIndex find _building)) - 1)]); + _buildingsIndex set [0, _building - [_pos]]; + + } else { + private _unit = _unitsArray select 0; + private _posSurface = surfaceIsWater _pos; + + if (_teleport) then { + doStop _unit; + if (_posSurface) then { + _unit setPosASL (AGLtoASL _pos); + } else { + _unit setPosATL _pos; + }; + + } else { + _unitMoveList pushBack [_unit,[_pos, AGLToASL _pos] select (_posSurface)]; + }; + + _placedUnits pushBack _unit; + _unitsArray deleteAt (_unitsArray find _unit); + _buildingsIndex set [0, _building - [_pos]]; + _unit setVariable [QGVAR(garrisonned), true, true]; + }; + }; + }; + }; + + // Random + case 2: { + + while {count _unitsArray > 0} do { + if (count _buildingsIndex == 0) exitWith {}; + private _building = selectRandom _buildingsIndex; + + if (_building isEqualTo []) then { + LOG(format [ARR_2("fnc_garrison: empty building array | removing building from buildingsIndex | %1 buildings remaining",count _buildingsIndex)]); + _buildingsIndex deleteAt (_buildingsIndex find _building); + + } else { + private _pos = selectRandom _building; + private _nearestUnits = (_pos nearEntities ["CAManBase", 2]); + LOG(format [ARR_3("fnc_garrison: Unit detection | %1 units nearby | %2 units within height",count _nearestUnits, {floor ((getPos _x) select 2) == floor (_pos select 2)} count _nearestUnits)]); + + if (count _nearestUnits > 0 && {[_nearestUnits, _pos] call _fnc_comparePos}) then { + LOG(format [ARR_2("fnc_garrison: Unit present | removing position | %1 positions remaining for this building",count (_buildingsIndex select (_buildingsIndex find _building)) - 1)]); + _buildingsIndex set [(_buildingsIndex find _building), _building - [_pos]]; + + } else { + private _unit = _unitsArray select 0; + private _posSurface = surfaceIsWater _pos; + + if (_teleport) then { + doStop _unit; + if (_posSurface) then { + _unit setPosASL (AGLtoASL _pos); + } else { + _unit setPosATL _pos; + }; + + } else { + _unitMoveList pushBack [_unit,[_pos, AGLToASL _pos] select (_posSurface)]; + }; + + _placedUnits pushBack _unit; + _unitsArray deleteAt (_unitsArray find _unit); + _buildingsIndex set [(_buildingsIndex find _building), _building - [_pos]]; + _unit setVariable [QGVAR(garrisonned), true, true]; + }; + }; + }; + }; +}; + +TRACE_1(format [ARR_2("fnc_garrison: while loop ended | %1 units ready to be treated by PFH",count _unitMoveList)], _teleport); + +// Update the unit list and remove duplicate positions and units +private _garrison_unitMoveList = missionNameSpace getVariable [QGVAR(garrison_unitMoveList), []]; + +_garrison_unitMoveList = _garrison_unitMoveList select { + _x params ["_testedUnit", "_testedPos"]; + ({(_x select 0) isEqualTo _testedUnit} count _unitMoveList == 0) +}; + +_garrison_unitMoveList append _unitMoveList; + +missionNameSpace setVariable [QGVAR(garrison_unitMoveList), _garrison_unitMoveList, true]; + +if (_teleport) then { + [QGVAR(AISection), [_placedUnits, ["PATH"], false], _placedUnits] call CBA_fnc_targetEvent; + +} else { + [_unitMoveList] call FUNC(garrisonMove); +}; + +TRACE_1(format [ARR_3("fnc_garrison: End | %1 units left | %2 buildings left", count _unitsArray, count _buildingsIndex)], _unitsArray); +_unitsArray diff --git a/addons/ai/functions/fnc_garrisonMove.sqf b/addons/ai/functions/fnc_garrisonMove.sqf new file mode 100644 index 0000000000..fc9f09b6ce --- /dev/null +++ b/addons/ai/functions/fnc_garrisonMove.sqf @@ -0,0 +1,149 @@ +/* + * Author: alganthe + * Internal function used by ace_ai_fnc_garrison to make the units move to the positions it picked. + * + * Arguments: + * 0: Array of arrays + * 0: Unit needing to be placed + * 1: Position the unit need to be placed at + * + * Return Value: + * Nothing + * + * Example: + * [ [unit1, [10, 10, 10]], [unit2, [30, 30, 30]], [unitN, getPos player] ] call ace_ai_fnc_garrisonMove + * + * Public: No +*/ +#include "script_component.hpp" + +params [ ["_unitMoveList", nil, [[]]] ]; + +if (isNil "_unitMoveList") exitWith {}; + +// Start initial movement +private _unitMoveListUnits = (_unitMoveList apply {_x select 0}); +[QGVAR(setBehaviour), [(_unitMoveListUnits select {leader _x == _x}), "AWARE"], _unitMoveListUnits] call CBA_fnc_targetEvent; +[QGVAR(AISection), [_unitMoveListUnits, ["FSM"], false], _unitMoveListUnits] call CBA_fnc_targetEvent; +[QGVAR(doMove), [_unitMoveList], _unitMoveListUnits] call CBA_fnc_targetEvent; +[QGVAR(enableAttack), [_unitMoveListUnits select {leader _x == _x}, false], _unitMoveListUnits] call CBA_fnc_targetEvent; + +{ + _x setVariable [QGVAR(garrisonMove_failSafe), nil, true]; + _x setVariable [QGVAR(garrisonMove_unitPosMemory), nil, true]; +} foreach _unitMoveListUnits; + +// Avoid duplicate PFHs +if (isNil QGVAR(garrison_moveUnitPFH)) then { + missionNameSpace setVariable [QGVAR(garrison_moveUnitPFH), true, true]; + + // PFH checking if the units have reached their destination + [{ + params ["_args", "_pfhID"]; + + private _unitMoveList = missionNameSpace getVariable [QGVAR(garrison_unitMoveList), []]; + + // End PFH if all units are placed / unable to reach position + if (_unitMoveList isEqualTo []) then { + missionNameSpace setVariable [QGVAR(garrison_moveUnitPFH), nil, true]; + LOG("garrisonMove PFH: PFH finished it's job | deleting PFH"); + _pfhID call CBA_fnc_removePerFrameHandler; + + } else { + { + _x params ["_unit", "_pos"]; + + // Check if unit is alive or even existing + if (!alive _unit) then { + _unitMoveList deleteAt (_unitMoveList find _x); + LOG(format [ARR_2("garrisonMove PFH: unit dead or deleted | %1 units left", count _unitMoveList)]); + + } else { + private _unitPos = getPos _unit; + if (surfaceisWater _unitPos) then { + _unitPos = getPosASL _unit; + } else { + _unitPos = getPosATL _unit; + }; + + if (unitReady _unit) then { + // Check for distance, doMove and AI are moody and may stop for no reason, within 6 meters and ready should be fine + if (_unitPos distance _pos < 3) then { + _unit setVariable [QGVAR(garrisonMove_failSafe), nil, true]; + _unit setVariable [QGVAR(garrisonMove_unitPosMemory), nil, true]; + _unit setVariable [QGVAR(garrisonned), true, true]; + _unitMoveList deleteAt (_unitMoveList find _x); + + [QGVAR(AISection), [[_unit], ["PATH"], false], _unit] call CBA_fnc_targetEvent; + [QGVAR(AISection), [[_unit], ["FSM"], true], _unit] call CBA_fnc_targetEvent; + + if ({(_x select 0) in units _unit && {!isPlayer (_x select 0)}} count _unitMoveList == 0) then { + [QGVAR(enableAttack), [[_unit], true], _unit] call CBA_fnc_targetEvent; + }; + + LOG(format [ARR_2("garrisonMove PFH: unit in position | %1 units left", count _unitMoveList)]); + + } else { + // Tell the unit to move if an order wasn't given within 30s, avoid doMove spam + (_unit getVariable [QGVAR(garrisonMove_failSafe), [CBA_missionTime, 5]]) params ["_failSafeTimer", "_failSafeRemainingAttemps"]; + + if (_failSafeTimer <= CBA_missionTime) then { + if (_failSafeRemainingAttemps == 0 ) then { + _unit setVariable [QGVAR(garrisonMove_failSafe), nil, true]; + _unit setVariable [QGVAR(garrisonMove_unitPosMemory), nil, true]; + [QGVAR(unGarrison), [[_unit]], _unit] call CBA_fnc_targetEvent; + _unitMoveList deleteAt (_unitMoveList find _x); + LOG("garrisonMove PFH unitReady: all moving commands failed | restoring AI capabilities"); + + } else { + _unit setVariable [QGVAR(garrisonMove_failSafe), [_failSafeTimer + 15, _failSafeRemainingAttemps - 1]]; + [QGVAR(doMove), [[[_unit, _pos]]], _unit] call CBA_fnc_targetEvent; + LOG("garrisonMove PFH unitReady: unit not close enough | Sending another doMove command"); + }; + }; + }; + } else { + (_unit getVariable [QGVAR(garrisonMove_unitPosMemory), [CBA_missionTime, [0,0,0]]]) params ["_unitPosTimer", "_unitOldPos"]; + + // AI may sometimes not be able to report unitReady, this is to avoid the PFH running forever + switch true do { + case ((_unitPosTimer + 15) < CBA_missionTime && {(_unitPos distance _pos) < 3}) : { + TRACE_1("case 1",_unit); + _unit setVariable [QGVAR(garrisonMove_failSafe), nil, true]; + _unit setVariable [QGVAR(garrisonMove_unitPosMemory), nil, true]; + _unit setVariable [QGVAR(garrisonned), true, true]; + _unitMoveList deleteAt (_unitMoveList find _x); + + [QGVAR(AISection), [[_unit], ["PATH"], false], _unit] call CBA_fnc_targetEvent; + [QGVAR(AISection), [[_unit], ["FSM"], true], _unit] call CBA_fnc_targetEvent; + + if ({(_x select 0) in units _unit && {!isPlayer (_x select 0)}} count _unitMoveList == 0) then { + [QGVAR(enableAttack), [[_unit], true], _unit] call CBA_fnc_targetEvent; + }; + + LOG(format [ARR_2("garrisonMove PFH unitNotReady: unit in position | %1 units left", count _unitMoveList)]); + }; + + case ((_unitPosTimer + 15) < CBA_missionTime && {_unitOldPos distance _unitPos < 0.5}) : { + TRACE_3("case 2",_unit, ((_unitPosTimer + 15) < CBA_missionTime), (_unitOldPos distance _unitPos < 0.5)); + _unit setVariable [QGVAR(garrisonMove_failSafe), nil, true]; + _unit setVariable [QGVAR(garrisonMove_unitPosMemory), nil, true]; + [QGVAR(unGarrison), [[_unit]], _unit] call CBA_fnc_targetEvent; + _unitMoveList deleteAt (_unitMoveList find _x); + LOG("garrisonMove PFH unitNotReady: all moving commands failed | restoring AI capabilities"); + }; + + case (_unitOldPos distance _unitPos < 0.5) : {}; + + default { + _unit setVariable [QGVAR(garrisonMove_unitPosMemory), [CBA_missionTime, _unitPos]]; + }; + }; + }; + }; + } foreach _unitMoveList; + + missionNameSpace setVariable [QGVAR(garrison_unitMoveList), _unitMoveList, true]; + }; + }, 0.5, []] call CBA_fnc_addPerFrameHandler; +}; diff --git a/addons/ai/functions/fnc_unGarrison.sqf b/addons/ai/functions/fnc_unGarrison.sqf new file mode 100644 index 0000000000..6174a840bd --- /dev/null +++ b/addons/ai/functions/fnc_unGarrison.sqf @@ -0,0 +1,57 @@ +/* + * Author: alganthe + * Used to un-garrison units. + * + * Arguments: + * 0: Units to un-garrison + * + * Return Value: + * None + * + * Example: + * [unit1, unit2, unit3] call ace_ai_fnc_unGarrison + * + * Public: Yes + * +*/ +#include "script_component.hpp" + +params [["_units", [], [[]]]]; + +_units = _units select {local _x}; + +{ + if (!isPlayer _x && {local _x}) then { + _x enableAI "PATH"; + _x enableAI "FSM"; + + private _leader = leader _x; + + TRACE_3("fnc_ungarrison: unit and leader",_x , _leader, (_leader == _x)); + + _x setVariable [QGVAR(garrisonned), false, true]; + + if (_leader != _x) then { + doStop _x; + _x doFollow _leader; + + } else { + _x doMove ((nearestBuilding (getPos _x)) buildingExit 0); + }; + + private _fnc_countGarrisonnedUnits = { + params ["_unit", "_bool"]; + if (_bool) then { + ({(_x getVariable [QGVAR(garrisonned), false]) && {!isPlayer _x}} count units _unit) + } else { + ({!(_x getVariable [QGVAR(garrisonned), false]) && {!isPlayer _x}} count units _unit) + }; + + }; + + if ([_x, true] call _fnc_countGarrisonnedUnits == ({!isPlayer _x} count (units _x)) - 1 || {[_x, false] call _fnc_countGarrisonnedUnits == {!isPlayer _x} count (units _x)}) then { + LOG("fnc_ungarrison: enableAttack true"); + (group _x) enableAttack true; + }; + }; +} foreach _units; diff --git a/addons/ai/functions/script_component.hpp b/addons/ai/functions/script_component.hpp new file mode 100644 index 0000000000..91e8ec0809 --- /dev/null +++ b/addons/ai/functions/script_component.hpp @@ -0,0 +1 @@ +#include "\z\ace\addons\ai\script_component.hpp" diff --git a/addons/ai/script_component.hpp b/addons/ai/script_component.hpp index 9a0afcf434..3a05db6896 100644 --- a/addons/ai/script_component.hpp +++ b/addons/ai/script_component.hpp @@ -2,8 +2,8 @@ #define COMPONENT_BEAUTIFIED AI #include "\z\ace\addons\main\script_mod.hpp" -// #define DEBUG_MODE_FULL -// #define DISABLE_COMPILE_CACHE +//#define DEBUG_MODE_FULL +//#define DISABLE_COMPILE_CACHE // #define ENABLE_PERFORMANCE_COUNTERS #ifdef DEBUG_ENABLED_AI diff --git a/addons/ai/stringtable.xml b/addons/ai/stringtable.xml new file mode 100644 index 0000000000..62e206bace --- /dev/null +++ b/addons/ai/stringtable.xml @@ -0,0 +1,37 @@ + + + + + Invalid position provided. + Position invalide fourni + 位置が無効です。 + Posizione invalida fornita. + 提供的位置無效。 + 提供的位置无效。 + + + No units provided. + Aucune unité fourni + ユニットがありません。 + Nessuna unità fornita. + 找不到可用的單位。 + 找不到可用的单位。 + + + There aren't enough positions to place all units. + Il n'y a pas assez de positions pour placer toutes les unités + 全ユニットを置くために十分な位置がありません。 + Non ci sono abbastanza posizioni per piazzare tutte le unità. + 沒有足夠的位置能擺放所有單位。 + 没有足够的位置能摆放所有单位。 + + + No building found. + Aucun bâtiment trouvé + 建物がありません。 + Nessun edificio trovato. + 沒找到建築物。 + 没找到建筑物。 + + + diff --git a/addons/aircraft/CfgAmmo.hpp b/addons/aircraft/CfgAmmo.hpp index 2c3701b8e0..0da9c7760f 100644 --- a/addons/aircraft/CfgAmmo.hpp +++ b/addons/aircraft/CfgAmmo.hpp @@ -1,4 +1,3 @@ - class CfgAmmo { class BulletBase; class B_20mm : BulletBase { @@ -11,11 +10,11 @@ class CfgAmmo { explosive = 1.8; tracersEvery = 3; tracerEndTime = 3.5; - CraterEffects = "ExploAmmoCrater"; explosionEffects = "ExploAmmoExplosion"; model = "\A3\Weapons_f\Data\bullettracer\tracer_red"; }; + class ACE_20mm_HE : B_20mm {}; class ACE_20mm_AP : B_20mm { hit = 50; @@ -40,30 +39,20 @@ class CfgAmmo { // also adjust tracer, "muh lightshow"; also adjust splash damage radius class Gatling_30mm_HE_Plane_CAS_01_F: BulletBase { - hit = 80; - indirectHit = 12; - indirectHitRange = 3; //2; - caliber = 1.4; - deflecting = 3; - fuseDistance = 3; - tracerStartTime = 0.02; - timeToLive = 40; + hit = 80; // default: 180 + indirectHit = 12; // default: 4 + indirectHitRange = 3; // default: 3 + caliber = 1.4; // default: 5 + deflecting = 3; // default: 5 + fuseDistance = 3; // default: 10 + tracerStartTime = 0.02; // default: 0.1 + timeToLive = 40; // default: 6 }; - // helper projectiles to simulate a rof > fps - class ACE_Gatling_30mm_HE_Plane_CAS_01_Deploy: Gatling_30mm_HE_Plane_CAS_01_F { - simulation = "shotSubmunitions"; - triggerTime = 0; - submunitionAmmo = "ACE_Gatling_30mm_HE_Plane_CAS_01_Sub"; - submunitionConeType[] = {"custom", {{0,0}, {0,0}, {0,0}} }; - }; - - class ACE_Gatling_30mm_HE_Plane_CAS_01_Sub: Gatling_30mm_HE_Plane_CAS_01_F {}; - // adjust damage and splash damage, closer to bluefor gatling with same caliber class Cannon_30mm_HE_Plane_CAS_02_F: Gatling_30mm_HE_Plane_CAS_01_F { - hit = 70; //40; - indirectHit = 11; //14; - indirectHitRange = 3; + hit = 70; // default: 150 + indirectHit = 11; // default: 4 + indirectHitRange = 3; // default: 3 }; }; diff --git a/addons/aircraft/CfgEventHandlers.hpp b/addons/aircraft/CfgEventHandlers.hpp new file mode 100644 index 0000000000..9426fa861e --- /dev/null +++ b/addons/aircraft/CfgEventHandlers.hpp @@ -0,0 +1,17 @@ +class Extended_PreStart_EventHandlers { + class ADDON { + init = QUOTE(call COMPILE_FILE(XEH_preStart)); + }; +}; + +class Extended_PreInit_EventHandlers { + class ADDON { + init = QUOTE(call COMPILE_FILE(XEH_preInit)); + }; +}; + +class Extended_PostInit_EventHandlers { + class ADDON { + clientInit = QUOTE(call COMPILE_FILE(XEH_postInitClient)); + }; +}; diff --git a/addons/aircraft/CfgMagazines.hpp b/addons/aircraft/CfgMagazines.hpp index b09bac6943..19797b53d8 100644 --- a/addons/aircraft/CfgMagazines.hpp +++ b/addons/aircraft/CfgMagazines.hpp @@ -1,9 +1,7 @@ - class CfgMagazines { // shoot helper object to tripple rof class VehicleMagazine; class 1000Rnd_Gatling_30mm_Plane_CAS_01_F: VehicleMagazine { - ammo = "ACE_Gatling_30mm_HE_Plane_CAS_01_Deploy"; count = 1170; }; diff --git a/addons/aircraft/CfgVehicles.hpp b/addons/aircraft/CfgVehicles.hpp index 9839149b3d..5d3d705db6 100644 --- a/addons/aircraft/CfgVehicles.hpp +++ b/addons/aircraft/CfgVehicles.hpp @@ -1,4 +1,3 @@ - class CfgVehicles { class All { class Turrets; @@ -11,7 +10,6 @@ class CfgVehicles { }; class Air: AllVehicles {}; - class Helicopter: Air { class Turrets { class MainTurret; @@ -19,13 +17,11 @@ class CfgVehicles { }; class Plane: Air {}; - class ParachuteBase: Helicopter { class Turrets; }; class UAV: Plane {}; - class Helicopter_Base_F: Helicopter { class Turrets: Turrets { class CopilotTurret; @@ -37,53 +33,27 @@ class CfgVehicles { class Turrets: Turrets { class CopilotTurret; }; - //class UserActions; }; class Heli_Light_01_base_F: Helicopter_Base_H { - lockDetectionSystem = 0; - incomingMissileDetectionSystem = 16; - driverCanEject = 1; + incomingMissileDetectionSystem = 16; // Vanilla: 0 class Turrets: Turrets { class CopilotTurret: CopilotTurret { - canEject = 1; showHMD = 1; }; }; }; - class Heli_Light_01_unarmed_base_F: Heli_Light_01_base_F {}; - - class B_Heli_Light_01_F: Heli_Light_01_unarmed_base_F { - /*class Turrets: Turrets { - class CopilotTurret: CopilotTurret {}; - };*/ - }; - class Heli_Light_01_armed_base_F: Heli_Light_01_base_F { - lockDetectionSystem = 0; - incomingMissileDetectionSystem = 16; - driverCanEject = 1; - - class Turrets: Turrets { - class CopilotTurret: CopilotTurret { - canEject = 1; - }; - }; + incomingMissileDetectionSystem = 16; // Vanilla: 0 }; - - class B_Heli_Light_01_armed_F: Heli_Light_01_armed_base_F {}; - class Heli_Light_02_base_F: Helicopter_Base_H { - driverCanEject = 1; - lockDetectionSystem = 12; - incomingMissileDetectionSystem = 16; - magazines[] = {"2000Rnd_762x51_Belt_T_Green","12Rnd_PG_missiles","168Rnd_CMFlare_Chaff_Magazine"}; + incomingMissileDetectionSystem = 16; // Vanilla: 24 + magazines[] = {"2000Rnd_762x51_Belt_T_Green", "12Rnd_PG_missiles", "168Rnd_CMFlare_Chaff_Magazine"}; // Switch gun magazine to 7.62mm from 6.5mm class Turrets: Turrets { class CopilotTurret: CopilotTurret { - canEject = 1; showHMD = 1; }; }; @@ -97,248 +67,81 @@ class CfgVehicles { #include "Heli_Attack_01_base_F.hpp" - class B_Heli_Attack_01_F: Heli_Attack_01_base_F {}; - class Heli_Attack_02_base_F: Helicopter_Base_F { - lockDetectionSystem = 12; - incomingMissileDetectionSystem = 16; - driverCanEject = 1; - - class Turrets: Turrets { - class MainTurret: MainTurret { - canEject = 1; - }; - }; + incomingMissileDetectionSystem = 16; // Vanilla: 24 }; class Heli_Transport_01_base_F: Helicopter_Base_H { - lockDetectionSystem = 12; - incomingMissileDetectionSystem = 16; - driverCanEject = 1; + incomingMissileDetectionSystem = 16; // Vanilla: 24 class Turrets: Turrets { class CopilotTurret: CopilotTurret { - canEject = 1; showHMD = 1; }; + class MainTurret: MainTurret { - magazines[] = {"2000Rnd_762x51_Belt_T_Red"}; - canEject = 1; + magazines[] = {"2000Rnd_762x51_Belt_T_Red"}; // Switch gun magazine to 7.62mm from 6.5mm }; + class RightDoorGun: MainTurret { - magazines[] = {"2000Rnd_762x51_Belt_T_Red"}; - canEject = 1; + magazines[] = {"2000Rnd_762x51_Belt_T_Red"}; // Switch gun magazine to 7.62mm from 6.5mm }; }; - - /*class UserActions { - class DoorL1_Open { - available = 1; - condition = "((this doorPhase 'door_L') == 0) AND Alive(this) AND driver this != player AND gunner this != player"; - }; - class DoorR1_Open: DoorL1_Open { - condition = "((this doorPhase 'door_R') == 0) AND Alive(this) AND driver this != player AND gunner this != player"; - }; - class DoorL1_Close: DoorL1_Open { - condition = "((this doorPhase 'door_L') > 0) AND Alive(this) AND driver this != player AND gunner this != player"; - }; - class DoorR1_Close: DoorL1_Close { - condition = "((this doorPhase 'door_R') > 0) AND Alive(this) AND driver this != player AND gunner this != player"; - }; - };*/ }; class Heli_Transport_02_base_F: Helicopter_Base_H { - lockDetectionSystem = 12; - incomingMissileDetectionSystem = 16; - driverCanEject = 1; + incomingMissileDetectionSystem = 16; // Vanilla: 24 class Turrets: Turrets { class CopilotTurret: CopilotTurret { - canEject = 1; showHMD = 1; }; }; - - /*class UserActions: UserActions { - class DoorL1_Open { - available = 1; - condition = "this animationPhase ""door_back_L"" < 0.5 AND Alive(this)"; - }; - class DoorR1_Open: DoorL1_Open { - condition = "this animationPhase ""door_back_R"" < 0.5 AND Alive(this)"; - }; - class DoorL1_Close: DoorL1_Open { - condition = "this animationPhase ""door_back_L"" > 0.5 AND Alive(this)"; - }; - class DoorR1_Close: DoorL1_Close { - condition = "this animationPhase ""door_back_R"" > 0.5 AND Alive(this)"; - }; - class CargoRamp_Open: DoorL1_Open { - userActionID = 52; - displayName = CSTRING(OpenCargoRamp); - textToolTip = CSTRING(OpenCargoRamp); - position = "action_cargoramp"; - radius = 3.0; - condition = "this animationPhase ""cargoramp_open"" < 0.5 AND Alive(this)"; - statement = "this animateDoor ['cargoramp_open', 1]"; - }; - class CargoRamp_Close: DoorL1_Close { - userActionID = 55; - displayName = CSTRING(CloseCargoRamp); - textToolTip = CSTRING(CloseCargoRamp); - position = "action_cargoramp"; - radius = 3.0; - condition = "this animationPhase ""cargoramp_open"" > 0.5 AND Alive(this)"; - statement = "this animateDoor ['cargoramp_open', 0]"; - }; - };*/ }; - class Heli_light_03_base_F: Helicopter_Base_F {}; - class I_Heli_light_03_base_F: Heli_light_03_base_F { - lockDetectionSystem = 0; - incomingMissileDetectionSystem = 16; - driverCanEject = 1; - weapons[] = {"M134_minigun","missiles_DAR","CMFlareLauncher", "ACE_AIR_SAFETY" }; - magazines[] = {"5000Rnd_762x51_Yellow_Belt","24Rnd_missiles","168Rnd_CMFlare_Chaff_Magazine"}; + class Heli_light_03_base_F: Helicopter_Base_F { + lockDetectionSystem = 0; // Vanilla: 12 + incomingMissileDetectionSystem = 16; // Vanilla: 24 class Turrets: Turrets { class MainTurret: MainTurret { - canEject = 1; showHMD = 1; - gunBeg = "commanderview"; - gunEnd = "laserstart"; - memoryPointGun = "laserstart"; - stabilizedInAxes = 3; - weapons[] = {"Laserdesignator_mounted"}; - soundServo[] = {"",0.01,1,30}; + weapons[] = {"Laserdesignator_mounted"}; // Add Laser Designator magazines[] = {"Laserbatteries"}; - inGunnerMayFire = 1; }; }; }; - class I_Heli_light_03_F: Heli_light_03_base_F { - class Turrets: Turrets { - class MainTurret: MainTurret {}; - }; - }; - - class Heli_light_03_unarmed_base_F: Heli_light_03_base_F {}; - - class I_Heli_light_03_unarmed_F: Heli_light_03_unarmed_base_F {}; class Plane_CAS_01_base_F: Plane_Base_F { - lockDetectionSystem = 12; - incomingMissileDetectionSystem = 16; - - class Turrets; - - #include + lockDetectionSystem = 12; // Vanilla: 8 + incomingMissileDetectionSystem = 16; // Vanilla: 24 }; class Plane_CAS_02_base_F: Plane_Base_F { - lockDetectionSystem = 12; - incomingMissileDetectionSystem = 16; - - class Turrets; - - #include + lockDetectionSystem = 12; // Vanilla: 8 + incomingMissileDetectionSystem = 16; // Vanilla: 24 }; class Plane_Fighter_03_base_F: Plane_Base_F { - lockDetectionSystem = 12; - incomingMissileDetectionSystem = 16; - - class Turrets; - - #include - }; - - class UAV_01_base_F: Helicopter_Base_F { - /*class Turrets: Turrets { - class MainTurret: MainTurret {}; - };*/ + lockDetectionSystem = 12; // Vanilla: 8 + incomingMissileDetectionSystem = 16; // Vanilla: 24 }; class UAV_02_base_F: UAV { - weapons[] = {}; + weapons[] = {}; // Remove flare launcher magazines[] = {}; - - class Turrets { - class MainTurret; - }; }; class UAV_02_CAS_base_F: UAV_02_base_F { - weapons[] = {}; + weapons[] = {}; // Remove flare launcher magazines[] = {}; - - /*class Turrets: Turrets { - class MainTurret: MainTurret {}; - };*/ }; - class Heli_Transport_03_base_F: Helicopter_Base_H {}; - class B_Heli_Transport_03_base_F: Heli_Transport_03_base_F { - lockDetectionSystem = 12; - incomingMissileDetectionSystem = 16; - driverCanEject = 1; - - class Turrets: Turrets { - class CopilotTurret: CopilotTurret { - canEject = 1; - }; - //class MainTurret: MainTurret {}; - class RightDoorGun: MainTurret {}; - }; + class Heli_Transport_03_base_F: Helicopter_Base_H { + incomingMissileDetectionSystem = 16; // Vanilla: 24 }; - - class B_Heli_Transport_03_unarmed_base_F: Heli_Transport_03_base_F { - class Turrets: Turrets { - class CopilotTurret: CopilotTurret { - canEject = 1; - }; - //class MainTurret: MainTurret {}; - //class RightDoorGun: MainTurret {}; - }; - }; - class Heli_Transport_04_base_F: Helicopter_Base_H { - lockDetectionSystem = 12; - incomingMissileDetectionSystem = 16; - driverCanEject = 1; - - class Turrets: Turrets { - class CopilotTurret: CopilotTurret { - canEject = 1; - }; - class LoadmasterTurret: MainTurret { - canEject = 1; - }; - }; - }; - - class O_Heli_Transport_04_bench_F: Heli_Transport_04_base_F { - class Turrets: Turrets { - class CopilotTurret: CopilotTurret { - canEject = 1; - }; - class LoadmasterTurret: LoadmasterTurret { - canEject = 1; - }; - }; - }; - - class O_Heli_Transport_04_covered_F: Heli_Transport_04_base_F { - class Turrets: Turrets { - class CopilotTurret: CopilotTurret { - canEject = 1; - }; - class LoadmasterTurret: LoadmasterTurret { - canEject = 1; - }; - }; + incomingMissileDetectionSystem = 16; // Vanilla: 24 }; }; diff --git a/addons/aircraft/CfgWeapons.hpp b/addons/aircraft/CfgWeapons.hpp index e97889eabf..2d16223e1d 100644 --- a/addons/aircraft/CfgWeapons.hpp +++ b/addons/aircraft/CfgWeapons.hpp @@ -1,13 +1,8 @@ - -class Mode_SemiAuto; -class Mode_Burst; class Mode_FullAuto; class CfgWeapons { - class RocketPods; - class ACE_AIR_SAFETY : RocketPods - { + class ACE_AIR_SAFETY : RocketPods { CanLock = 0; displayName = "SAFE"; displayNameMagazine = "SAFE"; @@ -21,18 +16,6 @@ class CfgWeapons { magazineReloadTime = 0.1; }; - // Manual Switching Of Flare Mode - class SmokeLauncher; - class CMFlareLauncher: SmokeLauncher { - modes[] = {"Single","Burst","AIBurst"}; - class Single: Mode_SemiAuto { - reloadTime = 0.1; - }; - class Burst: Mode_Burst { - displayName = CSTRING(CMFlareLauncher_Burst_Name); - }; - }; - // bigger mag for comanche class CannonCore; class gatling_20mm: CannonCore { @@ -43,6 +26,7 @@ class CfgWeapons { reloadTime = 0.023; //0.04; dispersion = 0.006; //0.0022; }; + class close: manual {}; class short: close {}; class medium: close {}; @@ -57,18 +41,22 @@ class CfgWeapons { dispersion = 0.006; displayName = CSTRING(gatling_20mm_Name); }; + class close: close { reloadTime = 0.04; dispersion = 0.006; }; + class short: short { reloadTime = 0.04; dispersion = 0.006; }; + class medium: medium { reloadTime = 0.04; dispersion = 0.006; }; + class far: far { reloadTime = 0.04; dispersion = 0.006; @@ -78,14 +66,13 @@ class CfgWeapons { // buff gatling rof class MGunCore; class MGun: MGunCore {}; - class LMG_RCWS: MGun {}; - class LMG_Minigun: LMG_RCWS { class manual: MGun { reloadTime = 0.075; //0.015; dispersion = 0.00093; //0.006; }; + class close: manual {}; class short: close {}; class medium: close {}; @@ -94,10 +81,12 @@ class CfgWeapons { class LMG_Minigun_heli: LMG_Minigun { showAimCursorInternal = 0; + class manual: manual { reloadTime = 0.015; //0.033; Note: This is a way to fast ROF (requires over 60 FPS) @todo dispersion = 0.006; //0.0087; }; + class close: manual {}; class short: close {}; class medium: close {}; @@ -110,30 +99,16 @@ class CfgWeapons { dispersion = 0.0064; //0.0023; multiplier = 1; }; + class HighROF: LowROF { reloadTime = 0.02; //0.03; dispersion = 0.0064; //0.0023; multiplier = 1; }; + class close: HighROF {}; class short: close {}; class medium: LowROF {}; class far: medium {}; }; - - class Gatling_30mm_Plane_CAS_01_F: CannonCore { - autoFire = 1; - burst = 1; - class LowROF: Mode_FullAuto { - autoFire = 0; - burst = 22; //65; - reloadTime = 0.0462; //0.0154; //0.034; - multiplier = 3; - }; - class close: LowROF {}; - class near: close {}; - class short: close {}; - class medium: close {}; - class far: close {}; - }; }; diff --git a/addons/aircraft/Heli_Attack_01_base_F.hpp b/addons/aircraft/Heli_Attack_01_base_F.hpp index f56cda1fd8..7e59abad48 100644 --- a/addons/aircraft/Heli_Attack_01_base_F.hpp +++ b/addons/aircraft/Heli_Attack_01_base_F.hpp @@ -1,896 +1,14 @@ class Heli_Attack_01_base_F: Helicopter_Base_F { - lockDetectionSystem = 12; - incomingMissileDetectionSystem = 16; - driverCanEject = 1; - - class MFD - { - class AirplaneHUD - { - class Bones{}; - class Draw{}; - topLeft = "HUD_top_left"; - topRight = "HUD_top_right"; - bottomLeft = "HUD_bottom_left"; - borderLeft = 0; - borderRight = 0; - borderTop = 0; - borderBottom = 0; - color[] = {0.15,1,0.15,1}; - enableParallax = 0; - helmetMountedDisplay = 1; - helmetPosition[] = {0,0,0}; - helmetRight[] = {0,0,0}; - helmetDown[] = {0,0,0}; - }; - class ACE_HUD_1 - { - topLeft = "HUD_top_left"; - topRight = "HUD_top_right"; - bottomLeft = "HUD_bottom_left"; - borderLeft = 0; - borderRight = 0; - borderTop = 0; - borderBottom = 0; - color[] = {0.15,1,0.15,1}; - enableParallax = 0; - class Bones - { - class GunnerAim - { - type = "vector"; - source = "weapon"; - pos0[] = {0.5,"0.9 - 0.04 + 0.012"}; - pos10[] = {"0.5 + 0.0111","0.9 - 0.04 + 0.012 + 0.0133"}; - }; - class Target - { - source = "target"; - type = "vector"; - pos0[] = {0.5,0.5}; - pos10[] = {0.85,0.85}; - }; - class Velocity - { - type = "vector"; - source = "velocity"; - pos0[] = {0.5,0.5}; - pos10[] = {0.65,0.65}; - }; - class Velocity_slip - { - type = "vector"; - source = "velocity"; - pos0[] = {0.5,0.845}; - pos10[] = {0.53,0.845}; - }; - class VspeedBone - { - type = "linear"; - source = "vspeed"; - sourceScale = 1; - min = -10; - max = 10; - minPos[] = {0.93,0.2}; - maxPos[] = {0.93,0.8}; - }; - class RadarAltitudeBone - { - type = "linear"; - source = "altitudeAGL"; - sourceScale = 1; - min = 0; - max = 60; - minPos[] = {0.965,0.2}; - maxPos[] = {0.965,0.8}; - }; - class HorizonBankRot - { - type = "rotational"; - source = "horizonBank"; - center[] = {0.5,0.5}; - min = -3.1416; - max = 3.1416; - minAngle = -180; - maxAngle = 180; - aspectRatio = 1; - }; - class ForwardVec - { - type = "vector"; - source = "forward"; - pos0[] = {0,0}; - pos10[] = {0.25,0.25}; - }; - class WeaponAim - { - type = "vector"; - source = "weapon"; - pos0[] = {0.5,0.5}; - pos10[] = {0.75,0.75}; - }; - class Level0 - { - type = "horizon"; - pos0[] = {0.5,0.5}; - pos10[] = {0.78,0.78}; - angle = 0; - }; - class LevelP5: Level0 - { - angle = 5; - }; - class LevelM5: Level0 - { - angle = -5; - }; - class LevelP10: Level0 - { - angle = 10; - }; - class LevelM10: Level0 - { - angle = -10; - }; - class LevelP15: Level0 - { - angle = 15; - }; - class LevelM15: Level0 - { - angle = -15; - }; - class LevelP20: Level0 - { - angle = 20; - }; - class LevelM20: Level0 - { - angle = -20; - }; - class LevelP25: Level0 - { - angle = 25; - }; - class LevelM25: Level0 - { - angle = -25; - }; - class LevelP30: Level0 - { - angle = 30; - }; - class LevelM30: Level0 - { - angle = -30; - }; - class LevelP35: Level0 - { - angle = 35; - }; - class LevelM35: Level0 - { - angle = -35; - }; - class LevelP40: Level0 - { - angle = 40; - }; - class LevelM40: Level0 - { - angle = -40; - }; - class LevelP45: Level0 - { - angle = 45; - }; - class LevelM45: Level0 - { - angle = -45; - }; - class LevelP50: Level0 - { - angle = 50; - }; - class LevelM50: Level0 - { - angle = -50; - }; - }; - class Draw - { - color[] = {0.18,1,0.18}; - alpha = 1; - condition = "on"; - class Horizont - { - clipTL[] = {0.15,0.15}; - clipBR[] = {0.85,0.85}; - class Dimmed - { - class Level0 - { - type = "line"; - points[] = {{ "Level0",{ -0.42,0 },1 },{ "Level0",{ -0.38,0 },1 },{ },{ "Level0",{ -0.37,0 },1 },{ "Level0",{ -0.33,0 },1 },{ },{ "Level0",{ -0.32,0 },1 },{ "Level0",{ -0.28,0 },1 },{ },{ "Level0",{ -0.27,0 },1 },{ "Level0",{ -0.23,0 },1 },{ },{ "Level0",{ -0.22,0 },1 },{ "Level0",{ -0.18,0 },1 },{ },{ "Level0",{ -0.17,0 },1 },{ "Level0",{ -0.13,0 },1 },{ },{ "Level0",{ -0.12,0 },1 },{ "Level0",{ -0.08,0 },1 },{ },{ "Level0",{ 0.42,0 },1 },{ "Level0",{ 0.38,0 },1 },{ },{ "Level0",{ 0.37,0 },1 },{ "Level0",{ 0.33,0 },1 },{ },{ "Level0",{ 0.32,0 },1 },{ "Level0",{ 0.28,0 },1 },{ },{ "Level0",{ 0.27,0 },1 },{ "Level0",{ 0.23,0 },1 },{ },{ "Level0",{ 0.22,0 },1 },{ "Level0",{ 0.18,0 },1 },{ },{ "Level0",{ 0.17,0 },1 },{ "Level0",{ 0.13,0 },1 },{ },{ "Level0",{ 0.12,0 },1 },{ "Level0",{ 0.08,0 },1 }}; - }; - }; - }; - class HorizonBankRot - { - type = "line"; - width = 3; - points[] = {{ "HorizonBankRot",{ 0,0.25 },1 },{ "HorizonBankRot",{ -0.01,0.23 },1 },{ "HorizonBankRot",{ 0.01,0.23 },1 },{ "HorizonBankRot",{ 0,0.25 },1 }}; - }; - class Static_HAD_BOX - { - clipTL[] = {0,1}; - clipBR[] = {1,0}; - type = "line"; - width = 5; - points[] = {{ { "0.5-0.1","0.9-0.04" },1 },{ { "0.5-0.1","0.9+0.04" },1 },{ { "0.5+0.1","0.9+0.04" },1 },{ { "0.5+0.1","0.9-0.04" },1 },{ { "0.5-0.1","0.9-0.04" },1 },{ },{ { "0.5-0.1","0.9-0.04+0.012" },1 },{ { "0.5-0.092","0.9-0.04+0.012" },1 },{ },{ { "0.5+0.1","0.9-0.04+0.012" },1 },{ { "0.5+0.092","0.9-0.04+0.012" },1 },{ },{ { 0.5,"0.9-0.04" },1 },{ { 0.5,"0.9-0.032" },1 },{ },{ { 0.5,"0.9+0.04" },1 },{ { 0.5,"0.9+0.032" },1 },{ }}; - }; - class Gunner_HAD - { - type = "line"; - width = 6; - points[] = {{ "GunnerAim",{ -0.015,-0.008 },1 },{ "GunnerAim",{ -0.015,0.008 },1 },{ "GunnerAim",{ 0.015,0.008 },1 },{ "GunnerAim",{ 0.015,-0.008 },1 },{ "GunnerAim",{ -0.015,-0.008 },1 }}; - }; - class Slip_ball_group - { - class Slip_bars - { - type = "line"; - width = 4; - points[] = {{ { "0.5-0.018","0.9-0.04" },1 },{ { "0.5-0.018","0.9-0.075" },1 },{ },{ { "0.5+0.018","0.9-0.04" },1 },{ { "0.5+0.018","0.9-0.075" },1 }}; - }; - class Slip_ball - { - type = "line"; - width = 6; - points[] = {{ "Velocity_slip",1,{ "0 * 0.75","-0.02 * 0.75" },1 },{ "Velocity_slip",1,{ "0.0099999998 * 0.75","-0.01732 * 0.75" },1 },{ "Velocity_slip",1,{ "0.01732 * 0.75","-0.0099999998 * 0.75" },1 },{ "Velocity_slip",1,{ "0.02 * 0.75","0 * 0.75" },1 },{ "Velocity_slip",1,{ "0.01732 * 0.75","0.0099999998 * 0.75" },1 },{ "Velocity_slip",1,{ "0.0099999998 * 0.75","0.01732 * 0.75" },1 },{ "Velocity_slip",1,{ "0 * 0.75","0.02 * 0.75" },1 },{ "Velocity_slip",1,{ "-0.0099999998 * 0.75","0.01732 * 0.75" },1 },{ "Velocity_slip",1,{ "-0.01732 * 0.75","0.0099999998 * 0.75" },1 },{ "Velocity_slip",1,{ "-0.02 * 0.75","0 * 0.75" },1 },{ "Velocity_slip",1,{ "-0.01732 * 0.75","-0.0099999998 * 0.75" },1 },{ "Velocity_slip",1,{ "-0.0099999998 * 0.75","-0.01732 * 0.75" },1 },{ "Velocity_slip",1,{ "0 * 0.75","-0.02 * 0.75" },1 },{ },{ "Velocity_slip",1,{ "0 * 0.6","-0.02 * 0.6" },1 },{ "Velocity_slip",1,{ "0.0099999998 * 0.6","-0.01732 * 0.6" },1 },{ "Velocity_slip",1,{ "0.01732 * 0.6","-0.0099999998 * 0.6" },1 },{ "Velocity_slip",1,{ "0.02 * 0.6","0 * 0.6" },1 },{ "Velocity_slip",1,{ "0.01732 * 0.6","0.0099999998 * 0.6" },1 },{ "Velocity_slip",1,{ "0.0099999998 * 0.6","0.01732 * 0.6" },1 },{ "Velocity_slip",1,{ "0 * 0.6","0.02 * 0.6" },1 },{ "Velocity_slip",1,{ "-0.0099999998 * 0.6","0.01732 * 0.6" },1 },{ "Velocity_slip",1,{ "-0.01732 * 0.6","0.0099999998 * 0.6" },1 },{ "Velocity_slip",1,{ "-0.02 * 0.6","0 * 0.6" },1 },{ "Velocity_slip",1,{ "-0.01732 * 0.6","-0.0099999998 * 0.6" },1 },{ "Velocity_slip",1,{ "-0.0099999998 * 0.6","-0.01732 * 0.6" },1 },{ "Velocity_slip",1,{ "0 * 0.6","-0.02 * 0.6" },1 },{ },{ "Velocity_slip",1,{ "0 * 0.5","-0.02 * 0.5" },1 },{ "Velocity_slip",1,{ "0.0099999998 * 0.5","-0.01732 * 0.5" },1 },{ "Velocity_slip",1,{ "0.01732 * 0.5","-0.0099999998 * 0.5" },1 },{ "Velocity_slip",1,{ "0.02 * 0.5","0 * 0.5" },1 },{ "Velocity_slip",1,{ "0.01732 * 0.5","0.0099999998 * 0.5" },1 },{ "Velocity_slip",1,{ "0.0099999998 * 0.5","0.01732 * 0.5" },1 },{ "Velocity_slip",1,{ "0 * 0.5","0.02 * 0.5" },1 },{ "Velocity_slip",1,{ "-0.0099999998 * 0.5","0.01732 * 0.5" },1 },{ "Velocity_slip",1,{ "-0.01732 * 0.5","0.0099999998 * 0.5" },1 },{ "Velocity_slip",1,{ "-0.02 * 0.5","0 * 0.5" },1 },{ "Velocity_slip",1,{ "-0.01732 * 0.5","-0.0099999998 * 0.5" },1 },{ "Velocity_slip",1,{ "-0.0099999998 * 0.5","-0.01732 * 0.5" },1 },{ "Velocity_slip",1,{ "0 * 0.5","-0.02 * 0.5" },1 },{ },{ "Velocity_slip",1,{ "0 * 0.4","-0.02 * 0.4" },1 },{ "Velocity_slip",1,{ "0.0099999998 * 0.4","-0.01732 * 0.4" },1 },{ "Velocity_slip",1,{ "0.01732 * 0.4","-0.0099999998 * 0.4" },1 },{ "Velocity_slip",1,{ "0.02 * 0.4","0 * 0.4" },1 },{ "Velocity_slip",1,{ "0.01732 * 0.4","0.0099999998 * 0.4" },1 },{ "Velocity_slip",1,{ "0.0099999998 * 0.4","0.01732 * 0.4" },1 },{ "Velocity_slip",1,{ "0 * 0.4","0.02 * 0.4" },1 },{ "Velocity_slip",1,{ "-0.0099999998 * 0.4","0.01732 * 0.4" },1 },{ "Velocity_slip",1,{ "-0.01732 * 0.4","0.0099999998 * 0.4" },1 },{ "Velocity_slip",1,{ "-0.02 * 0.4","0 * 0.4" },1 },{ "Velocity_slip",1,{ "-0.01732 * 0.4","-0.0099999998 * 0.4" },1 },{ "Velocity_slip",1,{ "-0.0099999998 * 0.4","-0.01732 * 0.4" },1 },{ "Velocity_slip",1,{ "0 * 0.4","-0.02 * 0.4" },1 },{ },{ "Velocity_slip",1,{ "0 * 0.30","-0.02 * 0.30" },1 },{ "Velocity_slip",1,{ "0.0099999998 * 0.30","-0.01732 * 0.30" },1 },{ "Velocity_slip",1,{ "0.01732 * 0.30","-0.0099999998 * 0.30" },1 },{ "Velocity_slip",1,{ "0.02 * 0.30","0 * 0.30" },1 },{ "Velocity_slip",1,{ "0.01732 * 0.30","0.0099999998 * 0.30" },1 },{ "Velocity_slip",1,{ "0.0099999998 * 0.30","0.01732 * 0.30" },1 },{ "Velocity_slip",1,{ "0 * 0.30","0.02 * 0.30" },1 },{ "Velocity_slip",1,{ "-0.0099999998 * 0.30","0.01732 * 0.30" },1 },{ "Velocity_slip",1,{ "-0.01732 * 0.30","0.0099999998 * 0.30" },1 },{ "Velocity_slip",1,{ "-0.02 * 0.30","0 * 0.30" },1 },{ "Velocity_slip",1,{ "-0.01732 * 0.30","-0.0099999998 * 0.30" },1 },{ "Velocity_slip",1,{ "-0.0099999998 * 0.30","-0.01732 * 0.30" },1 },{ "Velocity_slip",1,{ "0 * 0.30","-0.02 * 0.30" },1 },{ },{ "Velocity_slip",1,{ "0 * 0.20","-0.02 * 0.20" },1 },{ "Velocity_slip",1,{ "0.0099999998 * 0.20","-0.01732 * 0.20" },1 },{ "Velocity_slip",1,{ "0.01732 * 0.20","-0.0099999998 * 0.20" },1 },{ "Velocity_slip",1,{ "0.02 * 0.20","0 * 0.20" },1 },{ "Velocity_slip",1,{ "0.01732 * 0.20","0.0099999998 * 0.20" },1 },{ "Velocity_slip",1,{ "0.0099999998 * 0.20","0.01732 * 0.20" },1 },{ "Velocity_slip",1,{ "0 * 0.20","0.02 * 0.20" },1 },{ "Velocity_slip",1,{ "-0.0099999998 * 0.20","0.01732 * 0.20" },1 },{ "Velocity_slip",1,{ "-0.01732 * 0.20","0.0099999998 * 0.20" },1 },{ "Velocity_slip",1,{ "-0.02 * 0.20","0 * 0.20" },1 },{ "Velocity_slip",1,{ "-0.01732 * 0.20","-0.0099999998 * 0.20" },1 },{ "Velocity_slip",1,{ "-0.0099999998 * 0.20","-0.01732 * 0.20" },1 },{ "Velocity_slip",1,{ "0 * 0.20","-0.02 * 0.20" },1 },{ },{ "Velocity_slip",1,{ "0 * 0.1","-0.02 * 0.1" },1 },{ "Velocity_slip",1,{ "0.0099999998 * 0.1","-0.01732 * 0.1" },1 },{ "Velocity_slip",1,{ "0.01732 * 0.1","-0.0099999998 * 0.1" },1 },{ "Velocity_slip",1,{ "0.02 * 0.1","0 * 0.1" },1 },{ "Velocity_slip",1,{ "0.01732 * 0.1","0.0099999998 * 0.1" },1 },{ "Velocity_slip",1,{ "0.0099999998 * 0.1","0.01732 * 0.1" },1 },{ "Velocity_slip",1,{ "0 * 0.1","0.02 * 0.1" },1 },{ "Velocity_slip",1,{ "-0.0099999998 * 0.1","0.01732 * 0.1" },1 },{ "Velocity_slip",1,{ "-0.01732 * 0.1","0.0099999998 * 0.1" },1 },{ "Velocity_slip",1,{ "-0.02 * 0.1","0 * 0.1" },1 },{ "Velocity_slip",1,{ "-0.01732 * 0.1","-0.0099999998 * 0.1" },1 },{ "Velocity_slip",1,{ "-0.0099999998 * 0.1","-0.01732 * 0.1" },1 },{ "Velocity_slip",1,{ "0 * 0.1","-0.02 * 0.1" },1 }}; - }; - }; - class Centerline - { - type = "line"; - width = 5; - points[] = {{ { 0.5,0.48 },1 },{ { 0.5,0.45 },1 },{ },{ { 0.5,0.52 },1 },{ { 0.5,0.55 },1 },{ },{ { 0.48,0.5 },1 },{ { 0.45,0.5 },1 },{ },{ { 0.52,0.5 },1 },{ { 0.55,0.5 },1 },{ }}; - }; - class WeaponName - { - type = "text"; - source = "weapon"; - sourceScale = 1; - align = "right"; - scale = 1; - pos[] = {{ 0.61,0.86 },1}; - right[] = {{ 0.65,0.86 },1}; - down[] = {{ 0.61,0.9 },1}; - }; - class Ammo_GUN - { - type = "group"; - condition = "mgun"; - class Ammo_count_GUN - { - type = "text"; - source = "ammo"; - sourceScale = 1; - align = "right"; - scale = 1; - pos[] = {{ 0.61,0.89 },1}; - right[] = {{ 0.65,0.89 },1}; - down[] = {{ 0.61,0.93 },1}; - }; - }; - class Ammo_RKT - { - type = "group"; - condition = "rocket"; - class Ammo_count_RKT - { - type = "text"; - source = "ammo"; - sourceScale = 1; - align = "right"; - scale = 1; - pos[] = {{ 0.61,0.89 },1}; - right[] = {{ 0.65,0.89 },1}; - down[] = {{ 0.61,0.93 },1}; - }; - }; - class Ammo_AGM - { - type = "group"; - condition = "AAmissile"; - class Ammo_count_AGM - { - type = "text"; - source = "ammo"; - sourceScale = 1; - align = "right"; - scale = 1; - pos[] = {{ 0.61,0.89 },1}; - right[] = {{ 0.65,0.89 },1}; - down[] = {{ 0.61,0.93 },1}; - }; - }; - class Ammo_AAM - { - type = "group"; - condition = "ATmissile"; - class Ammo_count_AAM - { - type = "text"; - source = "ammo"; - sourceScale = 1; - align = "right"; - scale = 1; - pos[] = {{ 0.61,0.89 },1}; - right[] = {{ 0.65,0.89 },1}; - down[] = {{ 0.61,0.93 },1}; - }; - }; - class Ammo_Bomb - { - type = "group"; - condition = "Bomb"; - class Ammo_count_Bomb - { - type = "text"; - source = "ammo"; - sourceScale = 1; - align = "right"; - scale = 1; - pos[] = {{ 0.61,0.89 },1}; - right[] = {{ 0.65,0.89 },1}; - down[] = {{ 0.61,0.93 },1}; - }; - }; - class LightsGroup - { - type = "group"; - condition = "lights"; - class LightsText - { - type = "text"; - source = "static"; - text = "LIGHTS"; - align = "right"; - scale = 1; - pos[] = {{ 0.03,"0.53 + 0.055" },1}; - right[] = {{ 0.07,"0.53 + 0.055" },1}; - down[] = {{ 0.03,"0.53 + 0.095" },1}; - }; - }; - class CollisionLightsGroup - { - type = "group"; - condition = "collisionlights"; - class CollisionLightsText - { - type = "text"; - source = "static"; - text = "A-COL"; - align = "right"; - scale = 1; - pos[] = {{ 0.03,"0.53 + 0.105" },1}; - right[] = {{ 0.07,"0.53 + 0.105" },1}; - down[] = {{ 0.03,"0.53 + 0.145" },1}; - }; - }; - class GearGroup - { - type = "group"; - condition = "ils"; - class GearText - { - type = "text"; - source = "static"; - text = "GEAR"; - align = "right"; - scale = 1; - pos[] = {{ 0.03,"0.53 + 0.155" },1}; - right[] = {{ 0.07,"0.53 + 0.155" },1}; - down[] = {{ 0.03,"0.53 + 0.195" },1}; - }; - }; - class ATMissileTOFGroup - { - condition = "ATmissile"; - type = "group"; - class TOFtext - { - type = "text"; - align = "right"; - source = "static"; - text = "TOF="; - scale = 1; - pos[] = {{ 0.61,0.92 },1}; - right[] = {{ 0.65,0.92 },1}; - down[] = {{ 0.61,0.96 },1}; - }; - class TOFnumber - { - type = "text"; - source = "targetDist"; - sourcescale = 0.0025; - align = "right"; - scale = 1; - pos[] = {{ 0.69,0.92 },1}; - right[] = {{ 0.73,0.92 },1}; - down[] = {{ 0.69,0.96 },1}; - }; - }; - class LaserTOFGroup - { - condition = "Bomb"; - type = "group"; - class TOFtext - { - type = "text"; - align = "right"; - source = "static"; - text = "TOF="; - scale = 1; - pos[] = {{ 0.61,0.92 },1}; - right[] = {{ 0.65,0.92 },1}; - down[] = {{ 0.61,0.96 },1}; - }; - class TOFnumber - { - type = "text"; - source = "targetDist"; - sourcescale = 0.0025; - align = "right"; - scale = 1; - pos[] = {{ 0.69,0.92 },1}; - right[] = {{ 0.73,0.92 },1}; - down[] = {{ 0.69,0.96 },1}; - }; - }; - class RocketTOFGroup - { - condition = "Rocket"; - type = "group"; - class TOFtext - { - type = "text"; - align = "right"; - source = "static"; - text = "TOF="; - scale = 1; - pos[] = {{ 0.61,0.92 },1}; - right[] = {{ 0.65,0.92 },1}; - down[] = {{ 0.61,0.96 },1}; - }; - class TOFnumber - { - type = "text"; - source = "targetDist"; - sourcescale = 0.0025; - align = "right"; - scale = 1; - pos[] = {{ 0.69,0.92 },1}; - right[] = {{ 0.73,0.92 },1}; - down[] = {{ 0.69,0.96 },1}; - }; - }; - class RangeNumber - { - type = "text"; - source = "targetDist"; - sourceScale = 1; - align = "left"; - scale = 1; - pos[] = {{ 0.39,0.89 },1}; - right[] = {{ 0.43,0.89 },1}; - down[] = {{ 0.39,0.93 },1}; - }; - class RangeText - { - type = "text"; - source = "static"; - text = "RNG"; - align = "left"; - scale = 1; - pos[] = {{ 0.39,0.86 },1}; - right[] = {{ 0.43,0.86 },1}; - down[] = {{ 0.39,0.9 },1}; - }; - class SpeedNumber - { - type = "text"; - align = "right"; - scale = 1; - source = "speed"; - sourceScale = 3.6; - pos[] = {{ 0.03,0.475 },1}; - right[] = {{ 0.08,0.475 },1}; - down[] = {{ 0.03,0.525 },1}; - }; - class TorqueNumber - { - condition = "simulRTD"; - class Torque_number - { - type = "text"; - align = "left"; - scale = 1; - source = "rtdRotorTorque"; - sourceScale = 290; - pos[] = {{ 0.065,0.175 },1}; - right[] = {{ 0.115,0.175 },1}; - down[] = {{ 0.065,0.225 },1}; - }; - class Torquetext - { - type = "text"; - source = "static"; - text = "%"; - align = "right"; - scale = 1; - pos[] = {{ 0.07,0.175 },1}; - right[] = {{ 0.12,0.175 },1}; - down[] = {{ 0.07,0.225 },1}; - }; - }; - class AltNumber: SpeedNumber - { - align = "right"; - source = "altitudeAGL"; - sourceScale = 1; - pos[] = {{ 0.83,0.475 },1}; - right[] = {{ 0.88,0.475 },1}; - down[] = {{ 0.83,0.525 },1}; - }; - class ASLNumber - { - type = "text"; - source = "altitudeASL"; - sourceScale = 1; - align = "right"; - scale = 1; - pos[] = {{ 0.835,0.18 },1}; - right[] = {{ 0.875,0.18 },1}; - down[] = {{ 0.835,0.22 },1}; - }; - class VspeedScalePosta - { - type = "line"; - width = 5; - points[] = {{ { 0.98,0.2 },1 },{ { 1,0.2 },1 },{ },{ { 0.93,0.2 },1 },{ { 0.95,0.2 },1 },{ },{ { 0.98,0.35 },1 },{ { 1,0.35 },1 },{ },{ { 0.93,0.35 },1 },{ { 0.95,0.35 },1 },{ },{ { 0.94,0.38 },1 },{ { 0.95,0.38 },1 },{ },{ { 0.94,0.41 },1 },{ { 0.95,0.41 },1 },{ },{ { 0.94,0.44 },1 },{ { 0.95,0.44 },1 },{ },{ { 0.94,0.47 },1 },{ { 0.95,0.47 },1 },{ },{ { 0.98,0.5 },1 },{ { 1,0.5 },1 },{ },{ { 0.93,0.5 },1 },{ { 0.95,0.5 },1 },{ },{ { 0.94,0.53 },1 },{ { 0.95,0.53 },1 },{ },{ { 0.94,0.56 },1 },{ { 0.95,0.56 },1 },{ },{ { 0.94,0.59 },1 },{ { 0.95,0.59 },1 },{ },{ { 0.94,0.62 },1 },{ { 0.95,0.62 },1 },{ },{ { 0.98,0.65 },1 },{ { 1,0.65 },1 },{ },{ { 0.93,0.65 },1 },{ { 0.95,0.65 },1 },{ },{ { 0.99,0.68 },1 },{ { 0.98,0.68 },1 },{ },{ { 0.99,0.71 },1 },{ { 0.98,0.71 },1 },{ },{ { 0.99,0.74 },1 },{ { 0.98,0.74 },1 },{ },{ { 0.99,0.77 },1 },{ { 0.98,0.77 },1 },{ },{ { 0.98,0.8 },1 },{ { 1,0.8 },1 },{ },{ { 0.93,0.8 },1 },{ { 0.95,0.8 },1 },{ }}; - }; - class RadarAltitudeBand - { - clipTL[] = {0,0.2}; - clipBR[] = {1,0.8}; - hideValue = 201; - class radarbanda - { - type = "line"; - width = 17; - points[] = {{ "RadarAltitudeBone",{ 0,0 },1 },{ "RadarAltitudeBone",{ 0,0.6 },1 }}; - }; - }; - class VspeedBand - { - type = "line"; - width = 3; - points[] = {{ "VspeedBone",{ -0.01,0 },1 },{ "VspeedBone",{ -0.025,-0.015 },1 },{ "VspeedBone",{ -0.025,0.015 },1 },{ "VspeedBone",{ -0.01,0 },1 },{ }}; - }; - class HeadingNumber: SpeedNumber - { - source = "heading"; - sourceScale = 1; - align = "center"; - pos[] = {{ 0.5,0.045 },1}; - right[] = {{ 0.56,0.045 },1}; - down[] = {{ 0.5,"0.045 + 0.06" },1}; - }; - class Center_box - { - type = "line"; - width = 1.5; - points[] = {{ { 0.45,"0.02 + 0.085 - 0.06" },1 },{ { "0.45 + 0.10","0.02 + 0.085 - 0.06" },1 },{ { "0.45 + 0.10","0.02 + 0.085" },1 },{ { 0.45,"0.02 + 0.085" },1 },{ { 0.45,"0.02 + 0.085 - 0.06" },1 }}; - }; - class HeadingArrow - { - type = "line"; - width = 7; - points[] = {{ { "0.5","0.128 + 0.03" },1 },{ { 0.5,0.128 },1 }}; - }; - class HeadingScale_LEFT - { - clipTL[] = {0,0}; - clipBR[] = {0.45,1}; - class Heading_group - { - type = "scale"; - horizontal = 1; - source = "heading"; - sourceScale = 1; - width = 5; - top = 0.12; - center = 0.5; - bottom = 0.88; - lineXleft = "0.03 + 0.085"; - lineYright = "0.02 + 0.085"; - lineXleftMajor = "0.04 + 0.085"; - lineYrightMajor = "0.02 + 0.085"; - majorLineEach = 3; - numberEach = 3; - step = 10; - stepSize = "0.05"; - align = "center"; - scale = 1; - pos[] = {0.12,"0.0 + 0.065"}; - right[] = {0.16,"0.0 + 0.065"}; - down[] = {0.12,"0.04 + 0.065"}; - }; - }; - class HeadingScale_RIGHT - { - clipTL[] = {0.55,0}; - clipBR[] = {1,1}; - class Heading_group - { - type = "scale"; - horizontal = 1; - source = "heading"; - sourceScale = 1; - width = 5; - top = 0.12; - center = 0.5; - bottom = 0.88; - lineXleft = "0.03 + 0.085"; - lineYright = "0.02 + 0.085"; - lineXleftMajor = "0.04 + 0.085"; - lineYrightMajor = "0.02 + 0.085"; - majorLineEach = 3; - numberEach = 3; - step = 10; - stepSize = "0.05"; - align = "center"; - scale = 1; - pos[] = {0.12,"0.0 + 0.065"}; - right[] = {0.16,"0.0 + 0.065"}; - down[] = {0.12,"0.04 + 0.065"}; - }; - }; - class HeadingScale_BOTTOM - { - clipTL[] = {0.45,"0.02 + 0.085"}; - clipBR[] = {"0.45 + 0.10",1}; - class Heading_group - { - type = "scale"; - horizontal = 1; - source = "heading"; - sourceScale = 1; - width = 5; - top = 0.12; - center = 0.5; - bottom = 0.88; - lineXleft = "0.03 + 0.085"; - lineYright = "0.02 + 0.085"; - lineXleftMajor = "0.04 + 0.085"; - lineYrightMajor = "0.02 + 0.085"; - majorLineEach = 3; - numberEach = 3; - step = 10; - stepSize = "0.05"; - align = "center"; - scale = 1; - pos[] = {0.12,"0.0 + 0.065"}; - right[] = {0.16,"0.0 + 0.065"}; - down[] = {0.12,"0.04 + 0.065"}; - }; - }; - class Fuel_Text - { - type = "text"; - source = "static"; - text = "Fuel"; - align = "right"; - scale = 1; - pos[] = {{ 0.03,0.9 },1}; - right[] = {{ 0.07,0.9 },1}; - down[] = {{ 0.03,0.94 },1}; - }; - class Fuel_Number - { - type = "text"; - source = "fuel"; - sourceScale = 100; - align = "right"; - scale = 1; - pos[] = {{ 0.1,0.9 },1}; - right[] = {{ 0.14,0.9 },1}; - down[] = {{ 0.1,0.94 },1}; - }; - }; - helmetMountedDisplay = 1; - helmetPosition[] = {-0.04,0.04,0.1}; - helmetRight[] = {0.08,0,0}; - helmetDown[] = {0,-0.08,0}; - }; - class ACE_HUD_2 - { - topLeft = "HUD_top_left"; - topRight = "HUD_top_right"; - bottomLeft = "HUD_bottom_left"; - borderLeft = 0; - borderRight = 0; - borderTop = 0; - borderBottom = 0; - color[] = {0.15,1,0.15,1}; - enableParallax = 0; - class Bones - { - class Velocity - { - type = "vector"; - source = "velocity"; - pos0[] = {0.5,0.5}; - pos10[] = {0.75,0.75}; - }; - class ForwardVec1 - { - type = "vector"; - source = "forward"; - pos0[] = {0,0}; - pos10[] = {0.25,0.25}; - }; - class ForwardVec - { - type = "vector"; - source = "forward"; - pos0[] = {0,0}; - pos10[] = {0.253,0.253}; - }; - class WeaponAim - { - type = "vector"; - source = "weapon"; - pos0[] = {0.5,0.5}; - pos10[] = {0.753,0.753}; - }; - class WeaponAim1 - { - type = "vector"; - source = "weapon"; - pos0[] = {0,0}; - pos10[] = {0.253,0.23}; - }; - class Target - { - type = "vector"; - source = "target"; - pos0[] = {0.5,0.5}; - pos10[] = {0.753,0.753}; - }; - class RadarContact - { - type = "fixed"; - pos[] = {0,0}; - }; - }; - class Draw - { - color[] = {0.18,1,0.18}; - alpha = 1; - condition = "on"; - class PlaneMovementCrosshair - { - type = "line"; - width = 7; - points[] = {{ "ForwardVec1",1,"Velocity",1,{ 0,-0.02 },1 },{ "ForwardVec1",1,"Velocity",1,{ 0.01,-0.01732 },1 },{ "ForwardVec1",1,"Velocity",1,{ 0.01732,-0.01 },1 },{ "ForwardVec1",1,"Velocity",1,{ 0.02,0 },1 },{ "ForwardVec1",1,"Velocity",1,{ 0.01732,0.01 },1 },{ "ForwardVec1",1,"Velocity",1,{ 0.01,0.01732 },1 },{ "ForwardVec1",1,"Velocity",1,{ 0,0.02 },1 },{ "ForwardVec1",1,"Velocity",1,{ -0.01,0.01732 },1 },{ "ForwardVec1",1,"Velocity",1,{ -0.01732,0.01 },1 },{ "ForwardVec1",1,"Velocity",1,{ -0.02,0 },1 },{ "ForwardVec1",1,"Velocity",1,{ -0.01732,-0.01 },1 },{ "ForwardVec1",1,"Velocity",1,{ -0.01,-0.01732 },1 },{ "ForwardVec1",1,"Velocity",1,{ 0,-0.02 },1 },{ },{ "ForwardVec1",1,"Velocity",1,{ 0.04,0 },1 },{ "ForwardVec1",1,"Velocity",1,{ 0.02,0 },1 },{ },{ "ForwardVec1",1,"Velocity",1,{ -0.04,0 },1 },{ "ForwardVec1",1,"Velocity",1,{ -0.02,0 },1 },{ },{ "ForwardVec1",1,"Velocity",1,{ 0,-0.04 },1 },{ "ForwardVec1",1,"Velocity",1,{ 0,-0.02 },1 }}; - }; - class Gunner_AIM - { - type = "group"; - class Circle - { - type = "line"; - width = 6; - points[] = {{ "ForwardVec",1,"WeaponAim",1,{ 0,-0.015 },1 },{ "ForwardVec",1,"WeaponAim",1,{ 0,-0.03 },1 },{ },{ "ForwardVec",1,"WeaponAim",1,{ 0,-0.0325 },1 },{ "ForwardVec",1,"WeaponAim",1,{ 0,-0.0475 },1 },{ },{ "ForwardVec",1,"WeaponAim",1,{ 0,0.015 },1 },{ "ForwardVec",1,"WeaponAim",1,{ 0,0.03 },1 },{ },{ "ForwardVec",1,"WeaponAim",1,{ 0,0.0325 },1 },{ "ForwardVec",1,"WeaponAim",1,{ 0,0.0475 },1 },{ },{ "ForwardVec",1,"WeaponAim",1,{ -0.015,0 },1 },{ "ForwardVec",1,"WeaponAim",1,{ -0.03,0 },1 },{ },{ "ForwardVec",1,"WeaponAim",1,{ -0.0325,0 },1 },{ "ForwardVec",1,"WeaponAim",1,{ -0.0475,0 },1 },{ },{ "ForwardVec",1,"WeaponAim",1,{ 0.015,0 },1 },{ "ForwardVec",1,"WeaponAim",1,{ 0.03,0 },1 },{ },{ "ForwardVec",1,"WeaponAim",1,{ 0.0325,0 },1 },{ "ForwardVec",1,"WeaponAim",1,{ 0.0475,0 },1 }}; - }; - }; - class GunCross - { - condition = "mgun"; - class Circle - { - type = "line"; - width = 9; - points[] = {{ "ForwardVec",1,"WeaponAim",1,{ 0,-0.05 },1 },{ "ForwardVec",1,"WeaponAim",1,{ 0,-0.015 },1 },{ },{ "ForwardVec",1,"WeaponAim",1,{ 0,0.015 },1 },{ "ForwardVec",1,"WeaponAim",1,{ 0,0.05 },1 },{ },{ "ForwardVec",1,"WeaponAim",1,{ -0.05,0 },1 },{ "ForwardVec",1,"WeaponAim",1,{ -0.015,0 },1 },{ },{ "ForwardVec",1,"WeaponAim",1,{ 0.015,0 },1 },{ "ForwardVec",1,"WeaponAim",1,{ 0.05,0 },1 },{ }}; - }; - }; - class RocketCross - { - condition = "rocket"; - width = 6; - class Circle - { - type = "line"; - width = 6; - points[] = {{ "ForwardVec",1,"WeaponAim",1,{ -0.05,-0.08 },1 },{ "ForwardVec",1,"WeaponAim",1,{ 0.05,-0.08 },1 },{ },{ "ForwardVec",1,"WeaponAim",1,{ 0,-0.08 },1 },{ "ForwardVec",1,"WeaponAim",1,{ 0,0.08 },1 },{ },{ "ForwardVec",1,"WeaponAim",1,{ -0.05,0.08 },1 },{ "ForwardVec",1,"WeaponAim",1,{ 0.05,0.08 },1 },{ }}; - }; - }; - class AT_Aim - { - condition = "ATmissile"; - width = 2; - class Circle - { - type = "line"; - width = 2; - points[] = {{ "ForwardVec",1,"WeaponAim",1,{ -0.1,-0.1 },1 },{ "ForwardVec",1,"WeaponAim",1,{ 0.1,-0.1 },1 },{ "ForwardVec",1,"WeaponAim",1,{ 0.1,0.1 },1 },{ "ForwardVec",1,"WeaponAim",1,{ -0.1,0.1 },1 },{ "ForwardVec",1,"WeaponAim",1,{ -0.1,-0.1 },1 }}; - }; - }; - class AA_aim - { - condition = "AAmissile"; - class Circle - { - type = "line"; - width = 2.5; - points[] = {{ "ForwardVec",1,"WeaponAim",1,{ "0 / 4","-0.248559 / 4" },1 },{ "ForwardVec",1,"WeaponAim",1,{ "0.0434 / 4","-0.244781 / 4" },1 },{ "ForwardVec",1,"WeaponAim",1,{ "0.0855 / 4","-0.233571 / 4" },1 },{ "ForwardVec",1,"WeaponAim",1,{ "0.125 / 4","-0.215252 / 4" },1 },{ "ForwardVec",1,"WeaponAim",1,{ "0.1607 / 4","-0.190396 / 4" },1 },{ "ForwardVec",1,"WeaponAim",1,{ "0.1915 / 4","-0.159774 / 4" },1 },{ "ForwardVec",1,"WeaponAim",1,{ "0.2165 / 4","-0.12428 / 4" },1 },{ "ForwardVec",1,"WeaponAim",1,{ "0.234925 / 4","-0.0850072 / 4" },1 },{ "ForwardVec",1,"WeaponAim",1,{ "0.2462 / 4","-0.0431499 / 4" },1 },{ "ForwardVec",1,"WeaponAim",1,{ "0.25 / 4","0 / 4" },1 },{ "ForwardVec",1,"WeaponAim",1,{ "0.2462 / 4","0.0431499 / 4" },1 },{ "ForwardVec",1,"WeaponAim",1,{ "0.234925 / 4","0.0850072 / 4" },1 },{ "ForwardVec",1,"WeaponAim",1,{ "0.2165 / 4","0.12428 / 4" },1 },{ "ForwardVec",1,"WeaponAim",1,{ "0.1915 / 4","0.159774 / 4" },1 },{ "ForwardVec",1,"WeaponAim",1,{ "0.1607 / 4","0.190396 / 4" },1 },{ "ForwardVec",1,"WeaponAim",1,{ "0.125 / 4","0.215252 / 4" },1 },{ "ForwardVec",1,"WeaponAim",1,{ "0.0855 / 4","0.233571 / 4" },1 },{ "ForwardVec",1,"WeaponAim",1,{ "0.0434 / 4","0.244781 / 4" },1 },{ "ForwardVec",1,"WeaponAim",1,{ "0 / 4","0.248559 / 4" },1 },{ "ForwardVec",1,"WeaponAim",1,{ "-0.0434 / 4","0.244781 / 4" },1 },{ "ForwardVec",1,"WeaponAim",1,{ "-0.0855 / 4","0.233571 / 4" },1 },{ "ForwardVec",1,"WeaponAim",1,{ "-0.125 / 4","0.215252 / 4" },1 },{ "ForwardVec",1,"WeaponAim",1,{ "-0.1607 / 4","0.190396 / 4" },1 },{ "ForwardVec",1,"WeaponAim",1,{ "-0.1915 / 4","0.159774 / 4" },1 },{ "ForwardVec",1,"WeaponAim",1,{ "-0.2165 / 4","0.12428 / 4" },1 },{ "ForwardVec",1,"WeaponAim",1,{ "-0.234925 / 4","0.0850072 / 4" },1 },{ "ForwardVec",1,"WeaponAim",1,{ "-0.2462 / 4","0.0431499 / 4" },1 },{ "ForwardVec",1,"WeaponAim",1,{ "-0.25 / 4","0 / 4" },1 },{ "ForwardVec",1,"WeaponAim",1,{ "-0.2462 / 4","-0.0431499 / 4" },1 },{ "ForwardVec",1,"WeaponAim",1,{ "-0.234925 / 4","-0.0850072 / 4" },1 },{ "ForwardVec",1,"WeaponAim",1,{ "-0.2165 / 4","-0.12428 / 4" },1 },{ "ForwardVec",1,"WeaponAim",1,{ "-0.1915 / 4","-0.159774 / 4" },1 },{ "ForwardVec",1,"WeaponAim",1,{ "-0.1607 / 4","-0.190396 / 4" },1 },{ "ForwardVec",1,"WeaponAim",1,{ "-0.125 / 4","-0.215252 / 4" },1 },{ "ForwardVec",1,"WeaponAim",1,{ "-0.0855 / 4","-0.233571 / 4" },1 },{ "ForwardVec",1,"WeaponAim",1,{ "-0.0434 / 4","-0.244781 / 4" },1 },{ "ForwardVec",1,"WeaponAim",1,{ "0 / 4","-0.248559 / 4" },1 },{ },{ "ForwardVec",1,"WeaponAim",1,{ "0 / 2","-0.248559 / 2" },1 },{ "ForwardVec",1,"WeaponAim",1,{ "0.0434 / 2","-0.244781 / 2" },1 },{ "ForwardVec",1,"WeaponAim",1,{ "0.0855 / 2","-0.233571 / 2" },1 },{ "ForwardVec",1,"WeaponAim",1,{ "0.125 / 2","-0.215252 / 2" },1 },{ "ForwardVec",1,"WeaponAim",1,{ "0.1607 / 2","-0.190396 / 2" },1 },{ "ForwardVec",1,"WeaponAim",1,{ "0.1915 / 2","-0.159774 / 2" },1 },{ "ForwardVec",1,"WeaponAim",1,{ "0.2165 / 2","-0.12428 / 2" },1 },{ "ForwardVec",1,"WeaponAim",1,{ "0.234925 / 2","-0.0850072 / 2" },1 },{ "ForwardVec",1,"WeaponAim",1,{ "0.2462 / 2","-0.0431499 / 2" },1 },{ "ForwardVec",1,"WeaponAim",1,{ "0.25 / 2","0 / 2" },1 },{ "ForwardVec",1,"WeaponAim",1,{ "0.2462 / 2","0.0431499 / 2" },1 },{ "ForwardVec",1,"WeaponAim",1,{ "0.234925 / 2","0.0850072 / 2" },1 },{ "ForwardVec",1,"WeaponAim",1,{ "0.2165 / 2","0.12428 / 2" },1 },{ "ForwardVec",1,"WeaponAim",1,{ "0.1915 / 2","0.159774 / 2" },1 },{ "ForwardVec",1,"WeaponAim",1,{ "0.1607 / 2","0.190396 / 2" },1 },{ "ForwardVec",1,"WeaponAim",1,{ "0.125 / 2","0.215252 / 2" },1 },{ "ForwardVec",1,"WeaponAim",1,{ "0.0855 / 2","0.233571 / 2" },1 },{ "ForwardVec",1,"WeaponAim",1,{ "0.0434 / 2","0.244781 / 2" },1 },{ "ForwardVec",1,"WeaponAim",1,{ "0 / 2","0.248559 / 2" },1 },{ "ForwardVec",1,"WeaponAim",1,{ "-0.0434 / 2","0.244781 / 2" },1 },{ "ForwardVec",1,"WeaponAim",1,{ "-0.0855 / 2","0.233571 / 2" },1 },{ "ForwardVec",1,"WeaponAim",1,{ "-0.125 / 2","0.215252 / 2" },1 },{ "ForwardVec",1,"WeaponAim",1,{ "-0.1607 / 2","0.190396 / 2" },1 },{ "ForwardVec",1,"WeaponAim",1,{ "-0.1915 / 2","0.159774 / 2" },1 },{ "ForwardVec",1,"WeaponAim",1,{ "-0.2165 / 2","0.12428 / 2" },1 },{ "ForwardVec",1,"WeaponAim",1,{ "-0.234925 / 2","0.0850072 / 2" },1 },{ "ForwardVec",1,"WeaponAim",1,{ "-0.2462 / 2","0.0431499 / 2" },1 },{ "ForwardVec",1,"WeaponAim",1,{ "-0.25 / 2","0 / 2" },1 },{ "ForwardVec",1,"WeaponAim",1,{ "-0.2462 / 2","-0.0431499 / 2" },1 },{ "ForwardVec",1,"WeaponAim",1,{ "-0.234925 / 2","-0.0850072 / 2" },1 },{ "ForwardVec",1,"WeaponAim",1,{ "-0.2165 / 2","-0.12428 / 2" },1 },{ "ForwardVec",1,"WeaponAim",1,{ "-0.1915 / 2","-0.159774 / 2" },1 },{ "ForwardVec",1,"WeaponAim",1,{ "-0.1607 / 2","-0.190396 / 2" },1 },{ "ForwardVec",1,"WeaponAim",1,{ "-0.125 / 2","-0.215252 / 2" },1 },{ "ForwardVec",1,"WeaponAim",1,{ "-0.0855 / 2","-0.233571 / 2" },1 },{ "ForwardVec",1,"WeaponAim",1,{ "-0.0434 / 2","-0.244781 / 2" },1 },{ "ForwardVec",1,"WeaponAim",1,{ "0 / 2","-0.248559 / 2" },1 }}; - }; - }; - class TargetACQ - { - type = "line"; - width = 2; - points[] = {{ "ForwardVec",1,"target",{ 0,-0.06 },1 },{ "ForwardVec",1,"target",{ 0,-0.055 },1 },{ },{ "ForwardVec",1,"target",{ 0,-0.05 },1 },{ "ForwardVec",1,"target",{ 0,-0.045 },1 },{ },{ "ForwardVec",1,"target",{ 0,-0.04 },1 },{ "ForwardVec",1,"target",{ 0,-0.035 },1 },{ },{ "ForwardVec",1,"target",{ 0,-0.03 },1 },{ "ForwardVec",1,"target",{ 0,-0.025 },1 },{ },{ "ForwardVec",1,"target",{ 0,-0.02 },1 },{ "ForwardVec",1,"target",{ 0,-0.015 },1 },{ },{ "ForwardVec",1,"target",{ 0,-0.01 },1 },{ "ForwardVec",1,"target",{ 0,-0.005 },1 },{ },{ "ForwardVec",1,"target",{ 0,0 },1 },{ "ForwardVec",1,"target",{ 0,0 },1 },{ },{ "ForwardVec",1,"target",{ 0,0.06 },1 },{ "ForwardVec",1,"target",{ 0,0.055 },1 },{ },{ "ForwardVec",1,"target",{ 0,0.05 },1 },{ "ForwardVec",1,"target",{ 0,0.045 },1 },{ },{ "ForwardVec",1,"target",{ 0,0.04 },1 },{ "ForwardVec",1,"target",{ 0,0.035 },1 },{ },{ "ForwardVec",1,"target",{ 0,0.03 },1 },{ "ForwardVec",1,"target",{ 0,0.025 },1 },{ },{ "ForwardVec",1,"target",{ 0,0.02 },1 },{ "ForwardVec",1,"target",{ 0,0.015 },1 },{ },{ "ForwardVec",1,"target",{ 0,0.01 },1 },{ "ForwardVec",1,"target",{ 0,0.005 },1 },{ },{ "ForwardVec",1,"target",{ -0.06,0 },1 },{ "ForwardVec",1,"target",{ -0.055,0 },1 },{ },{ "ForwardVec",1,"target",{ -0.05,0 },1 },{ "ForwardVec",1,"target",{ -0.045,0 },1 },{ },{ "ForwardVec",1,"target",{ -0.04,0 },1 },{ "ForwardVec",1,"target",{ -0.035,0 },1 },{ },{ "ForwardVec",1,"target",{ -0.03,0 },1 },{ "ForwardVec",1,"target",{ -0.025,0 },1 },{ },{ "ForwardVec",1,"target",{ -0.02,0 },1 },{ "ForwardVec",1,"target",{ -0.015,0 },1 },{ },{ "ForwardVec",1,"target",{ -0.01,0 },1 },{ "ForwardVec",1,"target",{ -0.005,0 },1 },{ },{ "ForwardVec",1,"target",{ 0.06,0 },1 },{ "ForwardVec",1,"target",{ 0.055,0 },1 },{ },{ "ForwardVec",1,"target",{ 0.05,0 },1 },{ "ForwardVec",1,"target",{ 0.045,0 },1 },{ },{ "ForwardVec",1,"target",{ 0.04,0 },1 },{ "ForwardVec",1,"target",{ 0.035,0 },1 },{ },{ "ForwardVec",1,"target",{ 0.03,0 },1 },{ "ForwardVec",1,"target",{ 0.025,0 },1 },{ },{ "ForwardVec",1,"target",{ 0.02,0 },1 },{ "ForwardVec",1,"target",{ 0.015,0 },1 },{ },{ "ForwardVec",1,"target",{ 0.01,0 },1 },{ "ForwardVec",1,"target",{ 0.005,0 },1 },{ }}; - }; - class RadarTargets - { - type = "radar"; - pos0[] = {0.5,0.5}; - pos10[] = {0.753,0.753}; - width = 2.5; - points[] = {{ "ForwardVec",1,"RadarContact",{ -0.01,-0.01 },1 },{ "ForwardVec",1,"RadarContact",{ 0.01,-0.01 },1 },{ "ForwardVec",1,"RadarContact",{ 0.01,0.01 },1 },{ "ForwardVec",1,"RadarContact",{ -0.01,0.01 },1 },{ "ForwardVec",1,"RadarContact",{ -0.01,-0.01 },1 }}; - }; - }; - helmetMountedDisplay = 1; - helmetPosition[] = {-0.035,0.035,0.1}; - helmetRight[] = {0.07,0,0}; - helmetDown[] = {0,-0.07,0}; - }; - }; + incomingMissileDetectionSystem = 16; // Vanilla: 24 class Turrets: Turrets { class MainTurret: MainTurret { - weapons[] = {"ACE_gatling_20mm_Comanche","missiles_DAGR","missiles_ASRAAM", "ACE_AIR_SAFETY"}; - magazines[] = {"ACE_500Rnd_20mm_shells_Comanche","4Rnd_AAA_missiles","24Rnd_PG_missiles"}; - - outGunnerMayFire = 1; - commanding = -1; - primaryGunner = 1; - gunnerOpticsModel = ""; - gunnerOpticsEffect[] = {"TankCommanderOptics1"}; - gunnerForceOptics = 0; + weapons[] = {"ACE_gatling_20mm_Comanche", "missiles_DAGR", "missiles_ASRAAM"}; + magazines[] = {"ACE_500Rnd_20mm_shells_Comanche", "4Rnd_AAA_missiles", "24Rnd_PG_missiles"}; turretInfoType = "Rsc_ACE_Helo_UI_Turret"; - showAllTargets = 2; - discretedistance[] = {100,200,300,400,500,600,700,800,900,1000,1100,1200,1300,1400,1500,1600,1700,1800,1900,2000,2100,2200,2300,2400,2500,2600,2700,2800,2900,3000}; - discretedistanceinitindex = 3; - copilotHasFlares = 1; - directionStabilized = 1; - isCopilot = 1; - showHMD = 1; - CanEject = 1; - startEngine = 0; - minElev = -51; - maxElev = 9; - initElev = 6; - minTurn = -120; - maxTurn = 120; - initTurn = 0; - class OpticsIn - { + + class OpticsIn { delete Narrow; delete Medium; delete Wide; @@ -906,13 +24,14 @@ class Heli_Attack_01_base_F: Helicopter_Base_F { initFov = 0.466; minFov = 0.466; maxFov = 0.466; - visionMode[] = {"Normal","Ti"}; - thermalMode[] = {0,1}; - gunnerOpticsColor[] = {0,0,0,1}; + visionMode[] = {"Normal", "Ti"}; + thermalMode[] = {0, 1}; + gunnerOpticsColor[] = {0, 0, 0, 1}; directionStabilized = 0; horizontallyStabilized = 1; gunnerOpticsModel = "\A3\Weapons_F_Beta\Reticle\Heli_Attack_01_Optics_Gunner_wide_F"; }; + class ACE_Wide: ACE_WideUnstabilized { opticsDisplayName = "W"; initAngleX = 0; @@ -924,50 +43,50 @@ class Heli_Attack_01_base_F: Helicopter_Base_F { initFov = 0.466; minFov = 0.466; maxFov = 0.466; - visionMode[] = {"Normal","Ti"}; - thermalMode[] = {0,1}; - gunnerOpticsColor[] = {0,0,0,1}; + visionMode[] = {"Normal", "Ti"}; + thermalMode[] = {0, 1}; + gunnerOpticsColor[] = {0, 0, 0, 1}; directionStabilized = 1; horizontallyStabilized = 1; gunnerOpticsModel = "\A3\Weapons_F_Beta\Reticle\Heli_Attack_01_Optics_Gunner_wide_F"; }; + class ACE_Medium: ACE_Wide { opticsDisplayName = "M"; initFov = 0.093; minFov = 0.093; maxFov = 0.093; - gunnerOpticsColor[] = {0,0,0,1}; + gunnerOpticsColor[] = {0, 0, 0, 1}; directionStabilized = 1; horizontallyStabilized = 1; gunnerOpticsModel = "\A3\Weapons_F_Beta\Reticle\Heli_Attack_01_Optics_Gunner_medium_F"; }; + class ACE_Narrow: ACE_Wide { opticsDisplayName = "N"; initFov = 0.029; minFov = 0.029; maxFov = 0.029; - gunnerOpticsColor[] = {0,0,0,1}; + gunnerOpticsColor[] = {0, 0, 0, 1}; directionStabilized = 1; horizontallyStabilized = 1; gunnerOpticsModel = "\A3\Weapons_F_Beta\Reticle\Heli_Attack_01_Optics_Gunner_narrow_F"; - }; + class ACE_Narrower: ACE_Wide { opticsDisplayName = "Z"; initFov = 0.01; minFov = 0.01; maxFov = 0.01; - gunnerOpticsColor[] = {0,0,0,1}; + gunnerOpticsColor[] = {0, 0, 0, 1}; directionStabilized = 1; horizontallyStabilized = 1; gunnerOpticsModel = "\A3\Weapons_F_Beta\Reticle\Heli_Attack_01_Optics_Gunner_narrow_F"; - }; }; - class OpticsOut - { - class Monocular - { + + class OpticsOut { + class Monocular { initAngleX = 0; minAngleX = -30; maxAngleX = 30; @@ -990,8 +109,19 @@ class Heli_Attack_01_base_F: Helicopter_Base_F { class Gatling { weapon = "ACE_gatling_20mm_Comanche"; }; + class Muzzle_flash { weapon = "ACE_gatling_20mm_Comanche"; }; }; }; + +class Heli_Attack_01_dynamicLoadout_base_F: Heli_Attack_01_base_F { + class Turrets: Turrets { + class MainTurret: MainTurret { + weapons[] = {"ACE_gatling_20mm_Comanche"}; + magazines[] = {"ACE_500Rnd_20mm_shells_Comanche"}; + }; + }; +}; + diff --git a/addons/aircraft/README.md b/addons/aircraft/README.md index 3db71ca51a..c1bf72b3d7 100644 --- a/addons/aircraft/README.md +++ b/addons/aircraft/README.md @@ -1,7 +1,7 @@ ace_aircraft ============ -Changes to air weaponry, flight models and HUDs. +Changes to air weaponry, ejection and HUDs. - Contributions by Kimi (geraldbolso1899) for HUD updates diff --git a/addons/aircraft/RscInGameUI.hpp b/addons/aircraft/RscInGameUI.hpp index d3ef60c6b6..67116a7b62 100644 --- a/addons/aircraft/RscInGameUI.hpp +++ b/addons/aircraft/RscInGameUI.hpp @@ -10,572 +10,568 @@ class HScrollbar; class RscLadderPicture; class RscControlsGroupNoScrollbars; - -class RscInGameUI -{ +class RscInGameUI { class RscUnitInfo; - class Rsc_ACE_Helo_UI_Turret: RscUnitInfo - { + class Rsc_ACE_Helo_UI_Turret: RscUnitInfo { idd = 300; - controls[] = {"CA_IGUI_elements_group","CA_VehicleToggles"}; + controls[] = {"CA_IGUI_elements_group", "CA_VehicleToggles"}; + class VScrollbar; class HScrollbar; - class CA_IGUI_elements_group: RscControlsGroup - { + class CA_IGUI_elements_group: RscControlsGroup { idc = 170; - class VScrollbar: VScrollbar - { + + class VScrollbar: VScrollbar { width = 0; }; - class HScrollbar: HScrollbar - { + + class HScrollbar: HScrollbar { height = 0; }; - x = "0 * (0.01875 * SafezoneH) + (SafezoneX + ((SafezoneW - SafezoneH) / 2))"; - y = "0 * (0.025 * SafezoneH) + (SafezoneY)"; - w = "53.5 * (0.01875 * SafezoneH)"; - h = "40 * (0.025 * SafezoneH)"; - class controls - { - class CA_Distance: RscText - { + + x = "0 * (0.01875 * SafezoneH) + (SafezoneX + ((SafezoneW - SafezoneH) / 2))"; + y = "0 * (0.025 * SafezoneH) + (SafezoneY)"; + w = "53.5 * (0.01875 * SafezoneH)"; + h = "40 * (0.025 * SafezoneH)"; + + class controls { + class CA_Distance: RscText { idc = 151; style = 2; - sizeEx = "0.0295*SafezoneH"; + sizeEx = "0.0295 * SafezoneH"; shadow = 0; font = "EtelkaMonospacePro"; - x = "24.78 * (0.01875 * SafezoneH)"; - y = "30.88 * (0.025 * SafezoneH)"; - w = "4 * (0.01875 * SafezoneH)"; - h = "1.2 * (0.025 * SafezoneH)"; + x = "24.78 * (0.01875 * SafezoneH)"; + y = "30.88 * (0.025 * SafezoneH)"; + w = "4 * (0.01875 * SafezoneH)"; + h = "1.2 * (0.025 * SafezoneH)"; }; - class CA_Speed: RangeText - { + + class CA_Speed: RangeText { idc = 188; style = 2; - sizeEx = "0.0295*SafezoneH"; + sizeEx = "0.0295 * SafezoneH"; shadow = 0; font = "EtelkaMonospacePro"; text = "120"; - x = "14.78 * (0.01875 * SafezoneH)"; - y = "30.88 * (0.025 * SafezoneH)"; - w = "4 * (0.01875 * SafezoneH)"; - h = "1.2 * (0.025 * SafezoneH)"; + x = "14.78 * (0.01875 * SafezoneH)"; + y = "30.88 * (0.025 * SafezoneH)"; + w = "4 * (0.01875 * SafezoneH)"; + h = "1.2 * (0.025 * SafezoneH)"; }; - class CA_Alt: RangeText - { + + class CA_Alt: RangeText { idc = 189; style = 2; - sizeEx = "0.0295*SafezoneH"; + sizeEx = "0.0295 * SafezoneH"; shadow = 0; font = "EtelkaMonospacePro"; text = "3825"; - x = "34.78 * (0.01875 * SafezoneH)"; - y = "30.88 * (0.025 * SafezoneH)"; - w = "4 * (0.01875 * SafezoneH)"; - h = "1.2 * (0.025 * SafezoneH)"; + x = "34.78 * (0.01875 * SafezoneH)"; + y = "30.88 * (0.025 * SafezoneH)"; + w = "4 * (0.01875 * SafezoneH)"; + h = "1.2 * (0.025 * SafezoneH)"; }; - class CA_VisionMode: RscText - { + + class CA_VisionMode: RscText { idc = 152; style = 0; - sizeEx = "0.0295*SafezoneH"; + sizeEx = "0.0295 * SafezoneH"; shadow = 0; font = "EtelkaMonospacePro"; text = "VIS"; - x = "12.58 * (0.01875 * SafezoneH)"; - y = "8 * (0.025 * SafezoneH)"; - w = "4 * (0.01875 * SafezoneH)"; - h = "1.2 * (0.025 * SafezoneH)"; + x = "12.58 * (0.01875 * SafezoneH)"; + y = "8 * (0.025 * SafezoneH)"; + w = "4 * (0.01875 * SafezoneH)"; + h = "1.2 * (0.025 * SafezoneH)"; }; - class CA_FlirMode: RscText - { + + class CA_FlirMode: RscText { idc = 153; style = 0; - sizeEx = "0.0295*SafezoneH"; + sizeEx = "0.0295 * SafezoneH"; shadow = 0; font = "EtelkaMonospacePro"; text = "BHOT"; - x = "15.78 * (0.01875 * SafezoneH)"; - y = "8 * (0.025 * SafezoneH)"; - w = "4.5 * (0.01875 * SafezoneH)"; - h = "1.2 * (0.025 * SafezoneH)"; + x = "15.78 * (0.01875 * SafezoneH)"; + y = "8 * (0.025 * SafezoneH)"; + w = "4.5 * (0.01875 * SafezoneH)"; + h = "1.2 * (0.025 * SafezoneH)"; }; - class ValueGrid: RangeText - { + + class ValueGrid: RangeText { idc = 172; font = "EtelkaMonospacePro"; style = 2; - sizeEx = "0.0295*SafezoneH"; + sizeEx = "0.0295 * SafezoneH"; shadow = 0; - x = "12.20 * (0.01875 * SafezoneH)"; - y = "3.5 * (0.025 * SafezoneH)"; - w = "6 * (0.01875 * SafezoneH)"; - h = "1 * (0.025 * SafezoneH)"; + x = "12.20 * (0.01875 * SafezoneH)"; + y = "3.5 * (0.025 * SafezoneH)"; + w = "6 * (0.01875 * SafezoneH)"; + h = "1 * (0.025 * SafezoneH)"; }; - class TextTADS: RangeText - { + + class TextTADS: RangeText { idc = 1010; text = "TADS"; font = "EtelkaMonospacePro"; style = 2; shadow = 0; - x = "12.30 * (0.01875 * SafezoneH)"; - y = "5 * (0.025 * SafezoneH)"; - w = "4 * (0.01875 * SafezoneH)"; - h = "1.2 * (0.025 * SafezoneH)"; + x = "12.30 * (0.01875 * SafezoneH)"; + y = "5 * (0.025 * SafezoneH)"; + w = "4 * (0.01875 * SafezoneH)"; + h = "1.2 * (0.025 * SafezoneH)"; }; - class ValueTime: RangeText - { + + class ValueTime: RangeText { idc = 190; text = "20:28:35"; font = "EtelkaMonospacePro"; style = 2; - sizeEx = "0.0295*SafezoneH"; + sizeEx = "0.0295 * SafezoneH"; shadow = 0; - x = "12.1 * (0.01875 * SafezoneH)"; - y = "6.5 * (0.025 * SafezoneH)"; - w = "6 * (0.01875 * SafezoneH)"; - h = "1 * (0.025 * SafezoneH)"; + x = "12.1 * (0.01875 * SafezoneH)"; + y = "6.5 * (0.025 * SafezoneH)"; + w = "6 * (0.01875 * SafezoneH)"; + h = "1 * (0.025 * SafezoneH)"; }; - class CA_Laser: RscText - { + + class CA_Laser: RscText { idc = 158; style = "0x30 + 0x800"; - sizeEx = "0.038*SafezoneH"; + sizeEx = "0.038 * SafezoneH"; shadow = 0; font = "EtelkaMonospacePro"; text = QPATHTOF(data\Helo_LaserON.paa); - x = "20.45 * (0.01875 * SafezoneH)"; - y = "14.1 * (0.025 * SafezoneH)"; - w = "12.5 * (0.01875 * SafezoneH)"; - h = "12 * (0.025 * SafezoneH)"; + x = "20.45 * (0.01875 * SafezoneH)"; + y = "14.1 * (0.025 * SafezoneH)"; + w = "12.5 * (0.01875 * SafezoneH)"; + h = "12 * (0.025 * SafezoneH)"; }; - class CA_Heading: RscText - { + + class CA_Heading: RscText { idc = 156; style = 0; - sizeEx = "0.038*SafezoneH"; + sizeEx = "0.038 * SafezoneH"; shadow = 0; font = "EtelkaMonospacePro"; text = "023"; - x = "24.83 * (0.01875 * SafezoneH)"; - y = "6 * (0.025 * SafezoneH)"; - w = "4 * (0.01875 * SafezoneH)"; - h = "1.2 * (0.025 * SafezoneH)"; + x = "24.83 * (0.01875 * SafezoneH)"; + y = "6 * (0.025 * SafezoneH)"; + w = "4 * (0.01875 * SafezoneH)"; + h = "1.2 * (0.025 * SafezoneH)"; }; }; }; }; - class Rsc_ACE_Helo_UI_01: RscUnitInfo - { - controls[] = {"WeaponInfoControlsGroupRight","CA_TextFlaresMode","CA_TextFlares","CA_VehicleToggles","CA_Radar"}; + + class Rsc_ACE_Helo_UI_01: RscUnitInfo { + controls[] = {"WeaponInfoControlsGroupRight", "CA_TextFlaresMode", "CA_TextFlares", "CA_VehicleToggles", "CA_Radar"}; }; - class Rsc_ACE_Helo_UI_02: RscUnitInfo - { - controls[] = {"CA_TextFlaresMode","CA_TextFlares","CA_VehicleToggles","CA_Radar"}; + + class Rsc_ACE_Helo_UI_02: RscUnitInfo { + controls[] = {"CA_TextFlaresMode", "CA_TextFlares", "CA_VehicleToggles", "CA_Radar"}; }; - class Rsc_ACE_Drones_UI_Turret: RscUnitInfo - { + + class Rsc_ACE_Drones_UI_Turret: RscUnitInfo { idd = 300; - controls[] = {"CA_Zeroing","CA_IGUI_elements_group","CA_VehicleToggles"}; - class CA_IGUI_elements_group: RscControlsGroup - { + controls[] = {"CA_Zeroing", "CA_IGUI_elements_group", "CA_VehicleToggles"}; + + class CA_IGUI_elements_group: RscControlsGroup { idc = 170; - class VScrollbar: VScrollbar - { + + class VScrollbar: VScrollbar { width = 0; }; - class HScrollbar: HScrollbar - { + + class HScrollbar: HScrollbar { height = 0; }; - x = "0 * (0.01875 * SafezoneH) + (SafezoneX + ((SafezoneW - SafezoneH) / 2))"; - y = "0 * (0.025 * SafezoneH) + (SafezoneY)"; - w = "53.5 * (0.01875 * SafezoneH)"; - h = "40 * (0.025 * SafezoneH)"; - class controls - { - class CA_Distance: RscText - { + + x = "0 * (0.01875 * SafezoneH) + (SafezoneX + ((SafezoneW - SafezoneH) / 2))"; + y = "0 * (0.025 * SafezoneH) + (SafezoneY)"; + w = "53.5 * (0.01875 * SafezoneH)"; + h = "40 * (0.025 * SafezoneH)"; + + class controls { + class CA_Distance: RscText { idc = 151; style = 2; - sizeEx = "0.0295*SafezoneH"; + sizeEx = "0.0295 * SafezoneH"; shadow = 0; font = "EtelkaMonospacePro"; - x = "24.78 * (0.01875 * SafezoneH)"; - y = "30.88 * (0.025 * SafezoneH)"; - w = "4 * (0.01875 * SafezoneH)"; - h = "1.2 * (0.025 * SafezoneH)"; + x = "24.78 * (0.01875 * SafezoneH)"; + y = "30.88 * (0.025 * SafezoneH)"; + w = "4 * (0.01875 * SafezoneH)"; + h = "1.2 * (0.025 * SafezoneH)"; }; - class CA_Speed: RangeText - { + + class CA_Speed: RangeText { idc = 188; style = 2; - sizeEx = "0.0295*SafezoneH"; + sizeEx = "0.0295 * SafezoneH"; shadow = 0; font = "EtelkaMonospacePro"; text = "120"; - x = "14.78 * (0.01875 * SafezoneH)"; - y = "30.88 * (0.025 * SafezoneH)"; - w = "4 * (0.01875 * SafezoneH)"; - h = "1.2 * (0.025 * SafezoneH)"; + x = "14.78 * (0.01875 * SafezoneH)"; + y = "30.88 * (0.025 * SafezoneH)"; + w = "4 * (0.01875 * SafezoneH)"; + h = "1.2 * (0.025 * SafezoneH)"; }; - class CA_Alt: RangeText - { + + class CA_Alt: RangeText { idc = 189; style = 2; - sizeEx = "0.0295*SafezoneH"; + sizeEx = "0.0295 * SafezoneH"; shadow = 0; font = "EtelkaMonospacePro"; text = "3825"; - x = "34.78 * (0.01875 * SafezoneH)"; - y = "30.88 * (0.025 * SafezoneH)"; - w = "4 * (0.01875 * SafezoneH)"; - h = "1.2 * (0.025 * SafezoneH)"; + x = "34.78 * (0.01875 * SafezoneH)"; + y = "30.88 * (0.025 * SafezoneH)"; + w = "4 * (0.01875 * SafezoneH)"; + h = "1.2 * (0.025 * SafezoneH)"; }; - class ValueTime: RangeText - { + + class ValueTime: RangeText { idc = 190; text = "20:28:35"; font = "EtelkaMonospacePro"; style = 2; - sizeEx = "0.0295*SafezoneH"; + sizeEx = "0.0295 * SafezoneH"; shadow = 0; - x = "1.75 * (0.01875 * SafezoneH)"; - y = "10.5 * (0.025 * SafezoneH)"; - w = "6 * (0.01875 * SafezoneH)"; - h = "1 * (0.025 * SafezoneH)"; + x = "1.75 * (0.01875 * SafezoneH)"; + y = "10.5 * (0.025 * SafezoneH)"; + w = "6 * (0.01875 * SafezoneH)"; + h = "1 * (0.025 * SafezoneH)"; }; - class CA_VisionMode: RscText - { + + class CA_VisionMode: RscText { idc = 152; style = 0; - sizeEx = "0.0295*SafezoneH"; + sizeEx = "0.0295 * SafezoneH"; shadow = 0; font = "EtelkaMonospacePro"; text = "VIS"; align = "right"; - x = "2.6 * (0.01875 * SafezoneH)"; - y = "12.0 * (0.025 * SafezoneH)"; - w = "4 * (0.01875 * SafezoneH)"; - h = "1.0 * (0.025 * SafezoneH)"; + x = "2.6 * (0.01875 * SafezoneH)"; + y = "12.0 * (0.025 * SafezoneH)"; + w = "4 * (0.01875 * SafezoneH)"; + h = "1.0 * (0.025 * SafezoneH)"; }; - class CA_FlirMode: RscText - { + + class CA_FlirMode: RscText { idc = 153; style = 0; - sizeEx = "0.0295*SafezoneH"; + sizeEx = "0.0295 * SafezoneH"; shadow = 0; font = "EtelkaMonospacePro"; text = "BHOT"; align = "right"; - x = "6.18 * (0.01875 * SafezoneH)"; - y = "12.0 * (0.025 * SafezoneH)"; - w = "4.5 * (0.01875 * SafezoneH)"; - h = "1.0 * (0.025 * SafezoneH)"; + x = "6.18 * (0.01875 * SafezoneH)"; + y = "12.0 * (0.025 * SafezoneH)"; + w = "4.5 * (0.01875 * SafezoneH)"; + h = "1.0 * (0.025 * SafezoneH)"; }; - class TgT_Grid_text: RangeText - { + + class TgT_Grid_text: RangeText { idc = 1005; text = "TGT:"; font = "EtelkaMonospacePro"; style = 2; - sizeEx = "0.0295*SafezoneH"; + sizeEx = "0.0295 * SafezoneH"; shadow = 0; - x = "1.20 * (0.01875 * SafezoneH)"; - y = "13.5 * (0.025 * SafezoneH)"; - w = "6 * (0.01875 * SafezoneH)"; - h = "1 * (0.025 * SafezoneH)"; + x = "1.20 * (0.01875 * SafezoneH)"; + y = "13.5 * (0.025 * SafezoneH)"; + w = "6 * (0.01875 * SafezoneH)"; + h = "1 * (0.025 * SafezoneH)"; }; - class TGT_ValueGrid: RangeText - { + + class TGT_ValueGrid: RangeText { idc = 172; font = "EtelkaMonospacePro"; - colorText[] = {0.706,0.0745,0.0196,0.8}; + colorText[] = {0.706, 0.0745, 0.0196, 0.8}; style = 2; sizeEx = "0.0295*SafezoneH"; shadow = 0; - x = "5.20 * (0.01875 * SafezoneH)"; - y = "13.5 * (0.025 * SafezoneH)"; - w = "6 * (0.01875 * SafezoneH)"; - h = "1 * (0.025 * SafezoneH)"; + x = "5.20 * (0.01875 * SafezoneH)"; + y = "13.5 * (0.025 * SafezoneH)"; + w = "6 * (0.01875 * SafezoneH)"; + h = "1 * (0.025 * SafezoneH)"; }; - class OWN_Grid_text: RangeText - { + + class OWN_Grid_text: RangeText { idc = 1005; text = "OWN:"; font = "EtelkaMonospacePro"; style = 2; - sizeEx = "0.0295*SafezoneH"; + sizeEx = "0.0295 * SafezoneH"; shadow = 0; - x = "1.20 * (0.01875 * SafezoneH)"; - y = "15 * (0.025 * SafezoneH)"; - w = "6 * (0.01875 * SafezoneH)"; - h = "1 * (0.025 * SafezoneH)"; + x = "1.20 * (0.01875 * SafezoneH)"; + y = "15 * (0.025 * SafezoneH)"; + w = "6 * (0.01875 * SafezoneH)"; + h = "1 * (0.025 * SafezoneH)"; }; - class OWN_ValueGrid: RangeText - { + + class OWN_ValueGrid: RangeText { idc = 171; font = "EtelkaMonospacePro"; - colorText[] = {0.15,1,0.15,0.8}; + colorText[] = {0.15, 1, 0.15, 0.8}; style = 2; - sizeEx = "0.0295*SafezoneH"; + sizeEx = "0.0295 * SafezoneH"; shadow = 0; - x = "5.20 * (0.01875 * SafezoneH)"; - y = "15 * (0.025 * SafezoneH)"; - w = "6 * (0.01875 * SafezoneH)"; - h = "1 * (0.025 * SafezoneH)"; + x = "5.20 * (0.01875 * SafezoneH)"; + y = "15 * (0.025 * SafezoneH)"; + w = "6 * (0.01875 * SafezoneH)"; + h = "1 * (0.025 * SafezoneH)"; }; - class CA_Laser: RscText - { + + class CA_Laser: RscText { idc = 158; style = "0x30 + 0x800"; - sizeEx = "0.038*SafezoneH"; + sizeEx = "0.038 * SafezoneH"; shadow = 0; align = "right"; font = "EtelkaMonospacePro"; text = QPATHTOF(data\Helo_LaserON.paa); - x = "20.45 * (0.01875 * SafezoneH)"; - y = "14.1 * (0.025 * SafezoneH)"; - w = "12.5 * (0.01875 * SafezoneH)"; - h = "12 * (0.025 * SafezoneH)"; + x = "20.45 * (0.01875 * SafezoneH)"; + y = "14.1 * (0.025 * SafezoneH)"; + w = "12.5 * (0.01875 * SafezoneH)"; + h = "12 * (0.025 * SafezoneH)"; }; - class CA_Heading: RscText - { + + class CA_Heading: RscText { idc = 156; style = 0; - sizeEx = "0.038*SafezoneH"; + sizeEx = "0.038 * SafezoneH"; shadow = 0; font = "EtelkaMonospacePro"; text = "023"; align = "right"; - x = "25 * (0.01875 * SafezoneH)"; - y = "5 * (0.025 * SafezoneH)"; - w = "4 * (0.01875 * SafezoneH)"; - h = "1.2 * (0.025 * SafezoneH)"; + x = "25 * (0.01875 * SafezoneH)"; + y = "5 * (0.025 * SafezoneH)"; + w = "4 * (0.01875 * SafezoneH)"; + h = "1.2 * (0.025 * SafezoneH)"; }; }; }; }; - class Rsc_ACE_Drones_UI_Pilots: RscUnitInfo - { + + class Rsc_ACE_Drones_UI_Pilots: RscUnitInfo { idd = 300; - controls[] = {"WeaponInfoControlsGroupRight","CA_BackgroundVehicle","CA_BackgroundVehicleTitle","CA_BackgroundVehicleTitleDark","CA_BackgroundFuel","CA_Vehicle","CA_VehicleRole","CA_HitZones","CA_SpeedBackground","CA_SpeedUnits","CA_Speed","CA_ValueFuel","CA_AltBackground","CA_AltUnits","CA_Alt","CA_VehicleToggles","CA_Radar","DriverOpticsGroup"}; - class DriverOpticsGroup: RscControlsGroup - { + controls[] = {"WeaponInfoControlsGroupRight", "CA_BackgroundVehicle", "CA_BackgroundVehicleTitle", "CA_BackgroundVehicleTitleDark", "CA_BackgroundFuel", "CA_Vehicle", "CA_VehicleRole", "CA_HitZones", "CA_SpeedBackground", "CA_SpeedUnits", "CA_Speed", "CA_ValueFuel", "CA_AltBackground", "CA_AltUnits", "CA_Alt", "CA_VehicleToggles", "CA_Radar", "DriverOpticsGroup"}; + + class DriverOpticsGroup: RscControlsGroup { idc = 392; - class VScrollbar: VScrollbar - { + + class VScrollbar: VScrollbar { width = 0; }; - class HScrollbar: HScrollbar - { + + class HScrollbar: HScrollbar { height = 0; }; - x = "0 * (0.01875 * SafezoneH) + (SafezoneX + ((SafezoneW - SafezoneH) / 2))"; - y = "0 * (0.025 * SafezoneH) + (SafezoneY)"; - w = "53.5 * (0.01875 * SafezoneH)"; - h = "40 * (0.025 * SafezoneH)"; - class controls - { - class TextGrid: RscText - { + x = "0 * (0.01875 * SafezoneH) + (SafezoneX + ((SafezoneW - SafezoneH) / 2))"; + y = "0 * (0.025 * SafezoneH) + (SafezoneY)"; + w = "53.5 * (0.01875 * SafezoneH)"; + h = "40 * (0.025 * SafezoneH)"; + + class controls { + class TextGrid: RscText { style = 0; - sizeEx = "0.02*SafezoneH"; + sizeEx = "0.02 * SafezoneH"; shadow = 0; font = "EtelkaMonospacePro"; idc = 1005; text = "GRID:"; - x = "5.8 * (0.01875 * SafezoneH)"; - y = "31.8 * (0.025 * SafezoneH)"; - w = "5 * (0.01875 * SafezoneH)"; - h = "1 * (0.025 * SafezoneH)"; + x = "5.8 * (0.01875 * SafezoneH)"; + y = "31.8 * (0.025 * SafezoneH)"; + w = "5 * (0.01875 * SafezoneH)"; + h = "1 * (0.025 * SafezoneH)"; }; - class ValueGrid: TextGrid - { + + class ValueGrid: TextGrid { idc = 189; text = "382546"; - x = "10.3 * (0.01875 * SafezoneH)"; - y = "31.8 * (0.025 * SafezoneH)"; - w = "6 * (0.01875 * SafezoneH)"; - h = "1 * (0.025 * SafezoneH)"; + x = "10.3 * (0.01875 * SafezoneH)"; + y = "31.8 * (0.025 * SafezoneH)"; + w = "6 * (0.01875 * SafezoneH)"; + h = "1 * (0.025 * SafezoneH)"; }; - class TextTime: TextGrid - { + + class TextTime: TextGrid { idc = 1010; text = "TIME [UTC]:"; - x = "5.8 * (0.01875 * SafezoneH)"; - y = "32.6 * (0.025 * SafezoneH)"; - w = "5 * (0.01875 * SafezoneH)"; - h = "1 * (0.025 * SafezoneH)"; + x = "5.8 * (0.01875 * SafezoneH)"; + y = "32.6 * (0.025 * SafezoneH)"; + w = "5 * (0.01875 * SafezoneH)"; + h = "1 * (0.025 * SafezoneH)"; }; - class ValueTime: TextGrid - { + + class ValueTime: TextGrid { idc = 101; text = "20:28:35"; - x = "10 * (0.01875 * SafezoneH)"; - y = "32.6 * (0.025 * SafezoneH)"; - w = "6 * (0.01875 * SafezoneH)"; - h = "1 * (0.025 * SafezoneH)"; + x = "10 * (0.01875 * SafezoneH)"; + y = "32.6 * (0.025 * SafezoneH)"; + w = "6 * (0.01875 * SafezoneH)"; + h = "1 * (0.025 * SafezoneH)"; }; - class TextMag: TextGrid - { + + class TextMag: TextGrid { idc = 1011; text = "CAM MAG:"; - x = "5.8 * (0.01875 * SafezoneH)"; - y = "7 * (0.025 * SafezoneH)"; - w = "5 * (0.01875 * SafezoneH)"; - h = "1 * (0.025 * SafezoneH)"; + x = "5.8 * (0.01875 * SafezoneH)"; + y = "7 * (0.025 * SafezoneH)"; + w = "5 * (0.01875 * SafezoneH)"; + h = "1 * (0.025 * SafezoneH)"; }; - class OpticsZoom: TextGrid - { + + class OpticsZoom: TextGrid { idc = 192; text = "28x"; - x = "10.3 * (0.01875 * SafezoneH)"; - y = "7 * (0.025 * SafezoneH)"; - w = "6 * (0.01875 * SafezoneH)"; - h = "1 * (0.025 * SafezoneH)"; + x = "10.3 * (0.01875 * SafezoneH)"; + y = "7 * (0.025 * SafezoneH)"; + w = "6 * (0.01875 * SafezoneH)"; + h = "1 * (0.025 * SafezoneH)"; }; - class BorderLineSpdTop: RscPicture - { + + class BorderLineSpdTop: RscPicture { idc = 1203; text = "\A3\Ui_f\data\IGUI\Cfg\HelicopterHUD\border_line_ca.paa"; - x = "3.343 * (0.01875 * SafezoneH)"; - y = "12.4 * (0.025 * SafezoneH)"; - w = "3 * (0.01875 * SafezoneH)"; - h = "1 * (0.025 * SafezoneH)"; + x = "3.343 * (0.01875 * SafezoneH)"; + y = "12.4 * (0.025 * SafezoneH)"; + w = "3 * (0.01875 * SafezoneH)"; + h = "1 * (0.025 * SafezoneH)"; }; - class BorderLineSpdBottom: RscPicture - { + + class BorderLineSpdBottom: RscPicture { idc = 1207; text = "\A3\Ui_f\data\IGUI\Cfg\HelicopterHUD\border_line_ca.paa"; - x = "3.343 * (0.01875 * SafezoneH)"; - y = "26.5 * (0.025 * SafezoneH)"; - w = "3 * (0.01875 * SafezoneH)"; - h = "1 * (0.025 * SafezoneH)"; + x = "3.343 * (0.01875 * SafezoneH)"; + y = "26.5 * (0.025 * SafezoneH)"; + w = "3 * (0.01875 * SafezoneH)"; + h = "1 * (0.025 * SafezoneH)"; }; - class BorderLineAltTop: RscPicture - { + + class BorderLineAltTop: RscPicture { idc = 1205; text = "\A3\Ui_f\data\IGUI\Cfg\HelicopterHUD\border_line_ca.paa"; - x = "47.16 * (0.01875 * SafezoneH)"; - y = "12.4 * (0.025 * SafezoneH)"; - w = "3 * (0.01875 * SafezoneH)"; - h = "1 * (0.025 * SafezoneH)"; + x = "47.16 * (0.01875 * SafezoneH)"; + y = "12.4 * (0.025 * SafezoneH)"; + w = "3 * (0.01875 * SafezoneH)"; + h = "1 * (0.025 * SafezoneH)"; }; - class BorderLineAltBottom: RscPicture - { + + class BorderLineAltBottom: RscPicture { idc = 1206; text = "\A3\Ui_f\data\IGUI\Cfg\HelicopterHUD\border_line_ca.paa"; - x = "47.16 * (0.01875 * SafezoneH)"; - y = "26.5 * (0.025 * SafezoneH)"; - w = "3 * (0.01875 * SafezoneH)"; - h = "1 * (0.025 * SafezoneH)"; + x = "47.16 * (0.01875 * SafezoneH)"; + y = "26.5 * (0.025 * SafezoneH)"; + w = "3 * (0.01875 * SafezoneH)"; + h = "1 * (0.025 * SafezoneH)"; }; - class TextSpd: TextGrid - { + + class TextSpd: TextGrid { idc = 1004; text = "SPD"; - x = "4.8 * (0.01875 * SafezoneH)"; - y = "11.8 * (0.025 * SafezoneH)"; - w = "5 * (0.01875 * SafezoneH)"; - h = "1.2 * (0.025 * SafezoneH)"; + x = "4.8 * (0.01875 * SafezoneH)"; + y = "11.8 * (0.025 * SafezoneH)"; + w = "5 * (0.01875 * SafezoneH)"; + h = "1.2 * (0.025 * SafezoneH)"; }; - class SpeedValueBorder: RscPicture - { + + class SpeedValueBorder: RscPicture { idc = 1200; text = "\A3\Ui_f\data\IGUI\Cfg\HelicopterHUD\altimeter_value_ca.paa"; - x = "6.3 * (0.01875 * SafezoneH)"; - y = "19 * (0.025 * SafezoneH)"; - w = "5 * (0.01875 * SafezoneH)"; - h = "2 * (0.025 * SafezoneH)"; + x = "6.3 * (0.01875 * SafezoneH)"; + y = "19 * (0.025 * SafezoneH)"; + w = "5 * (0.01875 * SafezoneH)"; + h = "2 * (0.025 * SafezoneH)"; }; - class CA_Speed: TextGrid - { + + class CA_Speed: TextGrid { idc = 190; sizeEx = "0.03*SafezoneH"; text = "120"; - x = "7.5 * (0.01875 * SafezoneH)"; - y = "19.5 * (0.025 * SafezoneH)"; - w = "6 * (0.01875 * SafezoneH)"; - h = "1.2 * (0.025 * SafezoneH)"; + x = "7.5 * (0.01875 * SafezoneH)"; + y = "19.5 * (0.025 * SafezoneH)"; + w = "6 * (0.01875 * SafezoneH)"; + h = "1.2 * (0.025 * SafezoneH)"; }; - class AnalogueSpeed: RscLadderPicture - { + + class AnalogueSpeed: RscLadderPicture { idc = 384; topValue = 1312; bottomValue = -345; visibleRange = -1; text = "\A3\Ui_f\data\IGUI\Cfg\HelicopterHUD\UAVspeedLadder_ca.paa"; - x = "1.5 * (0.01875 * SafezoneH)"; - y = "13 * (0.025 * SafezoneH)"; - w = "5 * (0.01875 * SafezoneH)"; - h = "14 * (0.025 * SafezoneH)"; + x = "1.5 * (0.01875 * SafezoneH)"; + y = "13 * (0.025 * SafezoneH)"; + w = "5 * (0.01875 * SafezoneH)"; + h = "14 * (0.025 * SafezoneH)"; }; - class TextAlt: TextGrid - { + + class TextAlt: TextGrid { idc = 1006; text = "ALT"; - x = "46.9 * (0.01875 * SafezoneH)"; - y = "11.8 * (0.025 * SafezoneH)"; - w = "5 * (0.01875 * SafezoneH)"; - h = "1.2 * (0.025 * SafezoneH)"; + x = "46.9 * (0.01875 * SafezoneH)"; + y = "11.8 * (0.025 * SafezoneH)"; + w = "5 * (0.01875 * SafezoneH)"; + h = "1.2 * (0.025 * SafezoneH)"; }; - class AltValueBorder: RscPicture - { + + class AltValueBorder: RscPicture { idc = 1201; text = "\A3\Ui_f\data\IGUI\Cfg\HelicopterHUD\airspeed_value_ca.paa"; - x = "42.25 * (0.01875 * SafezoneH)"; - y = "19 * (0.025 * SafezoneH)"; - w = "5 * (0.01875 * SafezoneH)"; - h = "2 * (0.025 * SafezoneH)"; + x = "42.25 * (0.01875 * SafezoneH)"; + y = "19 * (0.025 * SafezoneH)"; + w = "5 * (0.01875 * SafezoneH)"; + h = "2 * (0.025 * SafezoneH)"; }; - class CA_Alt: TextGrid - { + + class CA_Alt: TextGrid { idc = 191; - sizeEx = "0.03*SafezoneH"; + sizeEx = "0.03 * SafezoneH"; style = 1; text = "3825"; - x = "43 * (0.01875 * SafezoneH)"; - y = "19.5 * (0.025 * SafezoneH)"; - w = "3.2 * (0.01875 * SafezoneH)"; - h = "1.2 * (0.025 * SafezoneH)"; + x = "43 * (0.01875 * SafezoneH)"; + y = "19.5 * (0.025 * SafezoneH)"; + w = "3.2 * (0.01875 * SafezoneH)"; + h = "1.2 * (0.025 * SafezoneH)"; }; - class AnalogueAlt: RscLadderPicture - { + + class AnalogueAlt: RscLadderPicture { idc = 385; topValue = 14430; bottomValue = -2110; visibleRange = -1; text = "\A3\Ui_f\data\IGUI\Cfg\HelicopterHUD\UAValtLadder_ca.paa"; - x = "47 * (0.01875 * SafezoneH)"; - y = "13 * (0.025 * SafezoneH)"; - w = "2.5 * (0.01875 * SafezoneH)"; - h = "14 * (0.025 * SafezoneH)"; + x = "47 * (0.01875 * SafezoneH)"; + y = "13 * (0.025 * SafezoneH)"; + w = "2.5 * (0.01875 * SafezoneH)"; + h = "14 * (0.025 * SafezoneH)"; }; - class AnalogueHorizon: RscLadderPicture - { + + class AnalogueHorizon: RscLadderPicture { idc = 383; topValue = 90; bottomValue = -90; visibleRange = -1; text = "\A3\Ui_f\data\IGUI\Cfg\HelicopterHUD\horizon_ladder_ca.paa"; - x = "16.75 * (0.01875 * SafezoneH)"; - y = "5 * (0.025 * SafezoneH)"; - w = "20 * (0.01875 * SafezoneH)"; - h = "30 * (0.025 * SafezoneH)"; + x = "16.75 * (0.01875 * SafezoneH)"; + y = "5 * (0.025 * SafezoneH)"; + w = "20 * (0.01875 * SafezoneH)"; + h = "30 * (0.025 * SafezoneH)"; }; - class HorizonCenter: RscPicture - { + + class HorizonCenter: RscPicture { idc = 1202; text = "\A3\Ui_f\data\IGUI\Cfg\HelicopterHUD\horizon_aircraft_ca.paa"; - x = "24.75 * (0.01875 * SafezoneH)"; - y = "19 * (0.025 * SafezoneH)"; - w = "4 * (0.01875 * SafezoneH)"; - h = "2 * (0.025 * SafezoneH)"; + x = "24.75 * (0.01875 * SafezoneH)"; + y = "19 * (0.025 * SafezoneH)"; + w = "4 * (0.01875 * SafezoneH)"; + h = "2 * (0.025 * SafezoneH)"; }; }; }; }; -}; \ No newline at end of file +}; diff --git a/addons/aircraft/XEH_PREP.hpp b/addons/aircraft/XEH_PREP.hpp new file mode 100644 index 0000000000..65407a32f0 --- /dev/null +++ b/addons/aircraft/XEH_PREP.hpp @@ -0,0 +1,2 @@ +PREP(initEjectAction); +PREP(canShowEject); diff --git a/addons/aircraft/XEH_postInitClient.sqf b/addons/aircraft/XEH_postInitClient.sqf new file mode 100644 index 0000000000..e468602dbc --- /dev/null +++ b/addons/aircraft/XEH_postInitClient.sqf @@ -0,0 +1,29 @@ +#include "script_component.hpp" + +if (!hasInterface) exitWith {}; + +private _cfgAction = configFile >> "CfgActions" >> "Eject"; +GVAR(ejectActionParams) = [ + [ + "", // will be set with setUserActionText + { + params ["_vehicle", "_unit"]; + private _preserveEngineOn = (_unit == driver _vehicle) && {isEngineOn _vehicle}; + moveOut _unit; + if (_preserveEngineOn) then { + // vehicle is local to last driver, no need to care + _vehicle engineOn true; + }; + }, + nil, + getNumber (_cfgAction >> "priority"), + false, + true, + getText (_cfgAction >> "shortcut"), + '[_this, _target] call DFUNC(canShowEject)' + ], + getText (_cfgAction >> "text"), + getText (_cfgAction >> "textDefault") +]; + +["Helicopter", "initPost", LINKFUNC(initEjectAction)] call CBA_fnc_addClassEventHandler; diff --git a/addons/aircraft/XEH_preInit.sqf b/addons/aircraft/XEH_preInit.sqf new file mode 100644 index 0000000000..b47cf6628d --- /dev/null +++ b/addons/aircraft/XEH_preInit.sqf @@ -0,0 +1,9 @@ +#include "script_component.hpp" + +ADDON = false; + +PREP_RECOMPILE_START; +#include "XEH_PREP.hpp" +PREP_RECOMPILE_END; + +ADDON = true; diff --git a/addons/aircraft/XEH_preStart.sqf b/addons/aircraft/XEH_preStart.sqf new file mode 100644 index 0000000000..022888575e --- /dev/null +++ b/addons/aircraft/XEH_preStart.sqf @@ -0,0 +1,3 @@ +#include "script_component.hpp" + +#include "XEH_PREP.hpp" diff --git a/addons/aircraft/config.cpp b/addons/aircraft/config.cpp index 863797ebeb..21b8d9b3c9 100644 --- a/addons/aircraft/config.cpp +++ b/addons/aircraft/config.cpp @@ -8,7 +8,7 @@ class CfgPatches { requiredVersion = REQUIRED_VERSION; requiredAddons[] = {"ace_common"}; author = ECSTRING(common,ACETeam); - authors[] = {"KoffeinFlummi","Crusty","commy2","jaynus","Kimi"}; + authors[] = {"KoffeinFlummi", "Crusty", "commy2", "jaynus", "Kimi"}; url = ECSTRING(main,URL); VERSION_CONFIG; @@ -18,7 +18,8 @@ class CfgPatches { }; #include "CfgAmmo.hpp" +#include "CfgEventHandlers.hpp" #include "CfgMagazines.hpp" #include "CfgVehicles.hpp" #include "CfgWeapons.hpp" -#include "RscInGameUI.hpp" \ No newline at end of file +#include "RscInGameUI.hpp" diff --git a/addons/aircraft/flightmodel_alca.hpp b/addons/aircraft/flightmodel_alca.hpp deleted file mode 100644 index 09785e22e7..0000000000 --- a/addons/aircraft/flightmodel_alca.hpp +++ /dev/null @@ -1,24 +0,0 @@ - -acceleration = 300; -maxSpeed = 936; -irScanRangeMin = 500; -irScanRangeMax = 5000; -aileronSensitivity = 0.64; -elevatorSensitivity = 0.682; -rudderInfluence = 0.001; -aileronControlsSensitivityCoef = 3; -elevatorControlsSensitivity = 2; -rudderControlsSensitivityoef = 4; -elevatorCoef[] = {0.6,0.73,0.62,0.52,0.39,0.33,0.28}; -aileronCoef[] = {0.5,0.68,0.75,0.86,0.92,0.96,1}; -rudderCoef[] = {0.9,0.75,0.58,0.45,0.38,0.35,0.3}; -envelope[] = {0,0.06,1.2,3,3.6,3.75,3.65,3.45,3.3,2.8,2.4,1.9,1.5}; -angleOfIndicence = 0.0523599; //determines velocity vector behaviour, how quickly it catches up with where your nose is pointing, I think -draconicForceXCoef = 7.5; //max angle of attack, lower value gives higher aoa -draconicForceYCoef = 0.2198; //Something to do with bleed off of speed, low values seem to increase bleed off -draconicForceZCoef = 5.12; //???? -draconicTorqueXCoef = 0.18; //resistance to elevator input, also impacts speed degradation -draconicTorqueYCoef = 0.000017; -thrustCoef[] = {1.3,1.27,1.24,1.2,1.17,1.15,1.13,1.1,1.06,1,0.94,0.72,0.51,0.4,0.25,0}; -gunAimDown = 0.029; -flapsFrictionCoef = 0.32; diff --git a/addons/aircraft/flightmodel_thunderbolt.hpp b/addons/aircraft/flightmodel_thunderbolt.hpp deleted file mode 100644 index 2446e166bc..0000000000 --- a/addons/aircraft/flightmodel_thunderbolt.hpp +++ /dev/null @@ -1,22 +0,0 @@ - -maxSpeed = 736; -aileronSensitivity = 0.85; -elevatorSensitivity = 0.75; -rudderInfluence = 0.001; -aileronControlsSensitivityCoef = 3; -elevatorControlsSensitivity = 2; -rudderControlsSensitivityoef = 4; -elevatorCoef[] = {0.7,0.75,0.75,0.65,0.55,0.45,0.35}; -aileronCoef[] = {0.6,0.85,0.88,0.92,0.95,0.97,1}; -rudderCoef[] = {0.8,0.75,0.65,0.5,0.4,0.33,0.3}; -flapsFrictionCoef = 0.35; -angleOfIndicence = 0.0523599; -draconicForceXCoef = 9.5; -draconicForceYCoef = 0.56; -draconicForceZCoef = 0.1; -draconicTorqueXCoef = 0.58; -draconicTorqueYCoef = 0.00013; -envelope[] = {0,0,0.75,2.4,3.6,3.8,3.7,3.2,2.2,1.7,0.9}; -thrustCoef[] = {1,1.2,1.3,1.25,1.06,1.01,1,0.92,0.75,0.65,0.5,0.25,0}; -acceleration = 265; -landingSpeed = 220; diff --git a/addons/aircraft/flightmodel_yak.hpp b/addons/aircraft/flightmodel_yak.hpp deleted file mode 100644 index bcf5a4cfd0..0000000000 --- a/addons/aircraft/flightmodel_yak.hpp +++ /dev/null @@ -1,21 +0,0 @@ - -maxSpeed = 1059; -acceleration = 300; -aileronSensitivity = 0.635; -elevatorSensitivity = 0.814; -rudderInfluence = 0.001; -aileronControlsSensitivityCoef = 3; -elevatorControlsSensitivity = 2; -rudderControlsSensitivityoef = 4; -elevatorCoef[] = {0.6,0.76,0.7,0.65,0.58,0.47,0.43}; -aileronCoef[] = {0.5,0.85,0.87,0.89,0.92,0.95,1}; -rudderCoef[] = {0.8,0.7,0.6,0.5,0.4,0.32,0.27}; -angleOfIndicence = 0.0523599; -draconicForceXCoef = 7.6; -draconicForceYCoef = 0.75; -draconicForceZCoef = 0.085; -draconicTorqueXCoef = 0.815; -draconicTorqueYCoef = 0.000152; -envelope[] = {0,0.446,1.5,3.9,5.2,4.8,4.2,3.5,2,1,0.5}; -thrustCoef[] = {1,1.2,1.7,1.7,1.65,1.54,1.32,1.1,0.95,0.75,0.5,0.35,0}; -flapsFrictionCoef = 0.32; diff --git a/addons/aircraft/functions/fnc_canShowEject.sqf b/addons/aircraft/functions/fnc_canShowEject.sqf new file mode 100644 index 0000000000..095a787cb7 --- /dev/null +++ b/addons/aircraft/functions/fnc_canShowEject.sqf @@ -0,0 +1,34 @@ +/* + * Author: Dystopian + * Check if Eject action can be shown. + * + * Arguments: + * 0: Unit who calls action + * 1: Vehicle which action is attached to + * + * Return Value: + * Can show + * + * Example: + * [player, vehicle player] call ace_aircraft_fnc_canShowEject + * + * Public: No + */ +#include "script_component.hpp" + +#define FULLCREW_UNIT 0 +#define FULLCREW_ROLE 1 +#define FULLCREW_TURRETPATH 3 + +params ["_unit", "_vehicle"]; + +_vehicle == vehicle _unit +&& { + private _ejectVarName = ""; + { + if (_unit == _x select FULLCREW_UNIT) exitWith { + _ejectVarName = format [QGVAR(ejectAction_%1_%2), _x select FULLCREW_ROLE, _x select FULLCREW_TURRETPATH]; + }; + } count fullCrew _vehicle; + _vehicle getVariable [_ejectVarName, false] +} diff --git a/addons/aircraft/functions/fnc_initEjectAction.sqf b/addons/aircraft/functions/fnc_initEjectAction.sqf new file mode 100644 index 0000000000..94b72099ee --- /dev/null +++ b/addons/aircraft/functions/fnc_initEjectAction.sqf @@ -0,0 +1,48 @@ +/* + * Author: Dystopian + * Add Eject action to vehicle if needed. + * + * Arguments: + * 0: Vehicle + * + * Return Value: + * None + * + * Example: + * [cursorObject] call ace_aircraft_fnc_initEjectAction + * + * Public: No + */ +#include "script_component.hpp" + +params ["_vehicle"]; + +if (unitIsUAV _vehicle) exitWith {}; + +private _config = configFile >> "CfgVehicles" >> typeOf _vehicle; + +private _addAction = false; + +if (0 == getNumber (_config >> "driverCanEject")) then { + TRACE_2("eject action",typeOf _vehicle,"driver"); + _vehicle setVariable [QGVAR(ejectAction_driver_[]), true]; + _addAction = true; +}; + +{ + { + _x params ["", "_role", "", "_turretPath"]; + if (0 == getNumber (([_config, _turretPath] call CBA_fnc_getTurret) >> "canEject")) then { + TRACE_2("eject action",typeOf _vehicle,_turretPath); + _vehicle setVariable [format [QGVAR(ejectAction_%1_%2), _role, _turretPath], true]; + _addAction = true; + }; + } forEach fullCrew [_vehicle, _x, true]; +} forEach ["gunner", "commander", "turret"]; + +if (!_addAction) exitWith {}; + +GVAR(ejectActionParams) params ["_params", "_text", "_picture"]; +private _actionID = _vehicle addAction _params; +_vehicle setUserActionText [_actionID, _text, "", _picture]; +_vehicle setVariable [QGVAR(ejectAction), _actionID]; diff --git a/addons/aircraft/functions/script_component.hpp b/addons/aircraft/functions/script_component.hpp new file mode 100644 index 0000000000..8614d199c3 --- /dev/null +++ b/addons/aircraft/functions/script_component.hpp @@ -0,0 +1 @@ +#include "\z\ace\addons\aircraft\script_component.hpp" diff --git a/addons/aircraft/stringtable.xml b/addons/aircraft/stringtable.xml index a0337317ea..0c52397242 100644 --- a/addons/aircraft/stringtable.xml +++ b/addons/aircraft/stringtable.xml @@ -1,19 +1,6 @@ - + - - Burst - Feuerstoß - Ráfaga - Seria - Dávka - Rafale - Очередь - Sorozat - Rajada - Raffica - バースト - XM301 XM301 @@ -26,6 +13,9 @@ XM301 XM301 XM301 + XM301 + XM301 + XM301 Open Cargo Door @@ -39,6 +29,9 @@ Apri la rampa di carico Abrir porta de carga カーゴ ドアを開く + 화물칸 개방 + 開啟貨艙門 + 开启货舱门 Close Cargo Door @@ -52,6 +45,9 @@ Chiudi la rampa di carico Fechar porta de carga カーゴ ドアを閉じる + 화물칸 폐쇄 + 關閉貨艙門 + 关闭货舱门 - \ No newline at end of file + diff --git a/addons/apl/functions/script_component.hpp b/addons/apl/functions/script_component.hpp deleted file mode 100644 index a25cdfebcc..0000000000 --- a/addons/apl/functions/script_component.hpp +++ /dev/null @@ -1 +0,0 @@ -#include "\z\ace\addons\apl\script_component.hpp" \ No newline at end of file diff --git a/addons/atragmx/CfgWeapons.hpp b/addons/atragmx/CfgWeapons.hpp index af5e1a9955..2fa31fc628 100644 --- a/addons/atragmx/CfgWeapons.hpp +++ b/addons/atragmx/CfgWeapons.hpp @@ -1,7 +1,7 @@ class CfgWeapons { class ACE_ItemCore; - class InventoryItem_Base_F; + class CBA_MiscItem_ItemInfo; class ACE_ATragMX: ACE_ItemCore { author = "Ruthberg"; @@ -13,7 +13,7 @@ class CfgWeapons { icon = "iconObject_circle"; mapSize = 0.034; - class ItemInfo: InventoryItem_Base_F { + class ItemInfo: CBA_MiscItem_ItemInfo { mass = 2; }; }; diff --git a/addons/atragmx/RscTitles.hpp b/addons/atragmx/RscTitles.hpp index 625cd68deb..834c4eb8af 100644 --- a/addons/atragmx/RscTitles.hpp +++ b/addons/atragmx/RscTitles.hpp @@ -2,6 +2,10 @@ #define ST_RIGHT 1 #define ST_CENTER 2 +#define ST_WITH_RECT 160 + +#define LB_TEXTURES 0x10 + class ATragMX_RscText { idc=-1; type=0; @@ -48,7 +52,6 @@ class ATragMX_RscButton { shadow=0; }; class ATragMX_RscEdit { - access=0; type=2; style=ST_RIGHT; x=0; @@ -93,7 +96,7 @@ class ATragMX_RscToolbox { class ATragMX_RscListBox { idc=-1; type=5; - style=0; + style=LB_TEXTURES; font="TahomaB"; sizeEx=0.028; rowHeight=0.03; @@ -113,13 +116,14 @@ class ATragMX_RscListBox { soundSelect[]={"",0.09,1}; class ScrollBar { - color[]={1,1,1,0.6}; - colorActive[]={1,1,1,1}; - colorDisabled[]={1,1,1,0.3}; - //thumb="\ca\ui\data\igui_scrollbar_thumb_ca.paa"; - //arrowFull="\ca\ui\data\igui_arrow_top_active_ca.paa"; - //arrowEmpty="\ca\ui\data\igui_arrow_top_ca.paa"; - //border="\ca\ui\data\igui_border_scroll_ca.paa"; + width=0.05; + color[]={0.15,0.21,0.23,0.3}; + colorActive[]={0.15,0.21,0.23,0.3}; + colorDisabled[]={0.15,0.21,0.23,0.3}; + arrowEmpty="\A3\ui_f\data\gui\cfg\scrollbar\arrowEmpty_ca.paa"; + arrowFull="\A3\ui_f\data\gui\cfg\scrollbar\arrowFull_ca.paa"; + border="\A3\ui_f\data\gui\cfg\scrollbar\border_ca.paa"; + thumb="\A3\ui_f\data\gui\cfg\scrollbar\thumb_ca.paa"; }; class ListScrollBar : ScrollBar { @@ -128,7 +132,6 @@ class ATragMX_RscListBox { class ATragMX_RscListNBox: ATragMX_RscListBox { idc=-1; type=102; - columns[]={0.0, 0.225, 0.475, 0.7}; drawSideArrows=0; idcLeft=-1; idcRight=-1; @@ -350,6 +353,7 @@ class ATragMX_Display { colorBackground[]={0.15,0.21,0.23,0.3}; colorFocused[]={0.15,0.21,0.23,0.2}; text="MV"; + action=QUOTE(0 call FUNC(toggle_muzzle_velocity_data)); }; class TEXT_MUZZLE_VELOCITY_OUTPUT: TEXT_BORE_HEIGHT_OUTPUT { idc=130; @@ -383,18 +387,18 @@ class ATragMX_Display { y=0.265*safezoneH+safezoneY+0.320; text=""; }; - class TEXT_BAROMETRIC_PRESSURE: TEXT_AIR_FRICTION { + class TEXT_BAROMETRIC_PRESSURE: TEXT_TEMPERATURE { idc=21; x=0.550*safezoneW+safezoneX+0.20; + y=0.265*safezoneH+safezoneY+0.355; text="BP"; }; class TEXT_BAROMETRIC_PRESSURE_OUTPUT: TEXT_TEMPERATURE_OUTPUT { idc=210; y=0.265*safezoneH+safezoneY+0.355; }; - class TEXT_RELATIVE_HUMIDITY: TEXT_AIR_FRICTION { + class TEXT_RELATIVE_HUMIDITY: TEXT_BAROMETRIC_PRESSURE { idc=22; - x=0.550*safezoneW+safezoneX+0.20; y=0.265*safezoneH+safezoneY+0.390; text="RH"; }; @@ -526,7 +530,7 @@ class ATragMX_Display { }; class TEXT_ELEVATION_OUTPUT_ABSOLUTE: ATragMX_RscText { idc=400; - style=160; + style=ST_WITH_RECT+ST_RIGHT; sizeEx=0.025; w=0.065; h=0.032; @@ -606,17 +610,40 @@ class ATragMX_Display { class TEXT_SCOPE_CLICK_NUMBER: TEXT_GUN_LIST { idc=2001; style=ST_CENTER; - w=0.03; + w=0.025; x=0.550*safezoneW+safezoneX+0.27; text="4"; action=QUOTE(call FUNC(toggle_solution_setup)); }; - class TEXT_CALCULATE: TEXT_SCOPE_UNIT { + class TEXT_OPTIONS: TEXT_GUN_LIST { idc=3000; style=ST_RIGHT; x=0.550*safezoneW+safezoneX+0.3; - text="Calc"; - action=QUOTE(call FUNC(calculate_target_solution)); + text="Options"; + action=QUOTE(false call FUNC(toggle_option_menu)); + }; + class TEXT_OPTIONS_BACKGROUND: ATragMX_RscButton { + idc=3001; + colorBackground[]={0.15,0.21,0.23,0.2}; + colorBackgroundActive[]={0.15,0.21,0.23,0.2}; + colorFocused[]={0.15,0.21,0.23,0.2}; + x=0.550*safezoneW+safezoneX+0.105; + y=0.265*safezoneH+safezoneY+0.17; + w=0.3; + h=0.535; + offsetPressedX=0.0; + offsetPressedY=0.0; + action=QUOTE(false call FUNC(toggle_option_menu)); + }; + class TEXT_OPTIONS_LIST_OUTPUT: ATragMX_RscListBox { + idc=3002; + style=0; + w=0.17; + h=0.28; + x=0.550*safezoneW+safezoneX+0.225; + y=0.265*safezoneH+safezoneY+0.355; + sizeEx=0.025; + onMouseButtonClick=QUOTE(true call FUNC(toggle_option_menu)); }; class TEXT_RANGE_CARD_SCOPE_UNIT: TEXT_GUN_PROFILE { @@ -666,6 +693,7 @@ class ATragMX_Display { }; class TEXT_RANGE_CARD_OUTPUT: ATragMX_RscListNBox { idc=5007; + columns[]={0.0, 0.225, 0.475, 0.7}; idcLeft=50061; idcRight=50062; w=0.285; @@ -674,16 +702,17 @@ class ATragMX_Display { y=0.265*safezoneH+safezoneY+0.27; }; - class TEXT_GUN_LIST_OUTPUT: ATragMX_RscListBox { + class TEXT_GUN_LIST_OUTPUT: ATragMX_RscListNBox { idc=6000; + columns[]={-0.05}; w=0.16; h=0.45; x=0.550*safezoneW+safezoneX+0.11; y=0.265*safezoneH+safezoneY+0.24; - sizeEx=0.025; + sizeEx=0.018; colorSelectBackground[]={0.15,0.21,0.23,0.3}; colorSelectBackground2[]={0.15,0.21,0.23,0.3}; - onMouseButtonDblClick=QUOTE(true call FUNC(toggle_gun_list)); + onLBDblClick=QUOTE(true call FUNC(toggle_gun_list)); }; class TEXT_GUN_LIST_COLUMN_CAPTION: TEXT_GUN_PROFILE { idc=6001; @@ -766,8 +795,9 @@ class ATragMX_Display { class TEXT_TARGET_RANGE_ASSIST_TARGET_SIZE: TEXT_TARGET_RANGE_ASSIST_MEASUREMENT_METHOD { idc=7003; style=ST_RIGHT; - x=0.550*safezoneW+safezoneX+0.10; + x=0.550*safezoneW+safezoneX+0.092; y=0.265*safezoneH+safezoneY+0.4; + w=0.128; text="Target Size"; }; class TEXT_TARGET_RANGE_ASSIST_IMAGE_SIZE: TEXT_TARGET_RANGE_ASSIST_TARGET_SIZE { @@ -874,22 +904,22 @@ class ATragMX_Display { class TEXT_TARGET_SPEED_ASSIST_TARGET_RANGE: TEXT_TARGET_RANGE_ASSIST_TARGET_SIZE { idc=8000; - x=0.550*safezoneW+safezoneX+0.13; + x=0.550*safezoneW+safezoneX+0.12; text="Target Range"; }; class TEXT_TARGET_SPEED_ASSIST_NUM_TICKS: TEXT_TARGET_RANGE_ASSIST_IMAGE_SIZE { idc=8001; - x=0.550*safezoneW+safezoneX+0.13; + x=0.550*safezoneW+safezoneX+0.12; text="Num Ticks"; }; class TEXT_TARGET_SPEED_ASSIST_TIME: TEXT_TARGET_RANGE_ASSIST_ANGLE { idc=8002; - x=0.550*safezoneW+safezoneX+0.13; + x=0.550*safezoneW+safezoneX+0.12; text="Time (secs)"; }; class TEXT_TARGET_SPEED_ASSIST_TARGET_ESTIMATED_SPEED: TEXT_TARGET_RANGE_ASSIST_ESTIMATED_RANGE { idc=8003; - x=0.550*safezoneW+safezoneX+0.13; + x=0.550*safezoneW+safezoneX+0.12; text="Est Speed"; }; class TEXT_TARGET_SPEED_ASSIST_TARGET_RANGE_INPUT: TEXT_TARGET_RANGE_ASSIST_TARGET_SIZE_INPUT { @@ -1040,6 +1070,8 @@ class ATragMX_Display { x=0.550*safezoneW+safezoneX+0.12; y=0.265*safezoneH+safezoneY+0.28; text=""; + onKeyDown=QUOTE(call FUNC(trim_gun_name)); + onKeyUp=QUOTE(call FUNC(trim_gun_name)); }; class TEXT_ADD_NEW_GUN_OK: ATragMX_RscButton { idc=11002; @@ -1468,5 +1500,343 @@ class ATragMX_Display { y=0.265*safezoneH+safezoneY+0.55; action=QUOTE(0 call FUNC(toggle_solution_setup)); }; + + class TEXT_MUZZLE_VELOCITY_DATA_TEMPERATURE: TEXT_BORE_HEIGHT { + idc=16000; + w=0.22; + y=0.265*safezoneH+safezoneY+0.25; + sizeEx=0.022; + text="Temperature"; + }; + class TEXT_MUZZLE_VELOCITY_DATA_MUZZLE_VELOCITY: TEXT_MUZZLE_VELOCITY_DATA_TEMPERATURE { + idc=16001; + x=0.550*safezoneW+safezoneX+0.215; + sizeEx=0.022; + text="Muzzle velocity"; + }; + class TEXT_MUZZLE_VELOCITY_DATA_TEMPERATURE_INPUT_1: ATragMX_RscEdit { + idc=160021; + w=0.082; + h=0.035; + x=0.550*safezoneW+safezoneX+0.128; + y=0.265*safezoneH+safezoneY+0.29; + text="0"; + }; + class TEXT_MUZZLE_VELOCITY_DATA_TEMPERATURE_INPUT_2: TEXT_MUZZLE_VELOCITY_DATA_TEMPERATURE_INPUT_1 { + idc=160022; + y=0.265*safezoneH+safezoneY+0.325; + }; + class TEXT_MUZZLE_VELOCITY_DATA_TEMPERATURE_INPUT_3: TEXT_MUZZLE_VELOCITY_DATA_TEMPERATURE_INPUT_1 { + idc=160023; + y=0.265*safezoneH+safezoneY+0.360; + }; + class TEXT_MUZZLE_VELOCITY_DATA_TEMPERATURE_INPUT_4: TEXT_MUZZLE_VELOCITY_DATA_TEMPERATURE_INPUT_1 { + idc=160024; + y=0.265*safezoneH+safezoneY+0.395; + }; + class TEXT_MUZZLE_VELOCITY_DATA_TEMPERATURE_INPUT_5: TEXT_MUZZLE_VELOCITY_DATA_TEMPERATURE_INPUT_1 { + idc=160025; + y=0.265*safezoneH+safezoneY+0.430; + }; + class TEXT_MUZZLE_VELOCITY_DATA_TEMPERATURE_INPUT_6: TEXT_MUZZLE_VELOCITY_DATA_TEMPERATURE_INPUT_1 { + idc=160026; + y=0.265*safezoneH+safezoneY+0.465; + }; + class TEXT_MUZZLE_VELOCITY_DATA_TEMPERATURE_INPUT_7: TEXT_MUZZLE_VELOCITY_DATA_TEMPERATURE_INPUT_1 { + idc=160027; + y=0.265*safezoneH+safezoneY+0.500; + }; + class TEXT_MUZZLE_VELOCITY_DATA_MUZZLE_VELOCITY_INPUT_1: TEXT_MUZZLE_VELOCITY_DATA_TEMPERATURE_INPUT_1 { + idc=160031; + x=0.550*safezoneW+safezoneX+0.225; + }; + class TEXT_MUZZLE_VELOCITY_DATA_MUZZLE_VELOCITY_INPUT_2: TEXT_MUZZLE_VELOCITY_DATA_TEMPERATURE_INPUT_2 { + idc=160032; + x=0.550*safezoneW+safezoneX+0.225; + }; + class TEXT_MUZZLE_VELOCITY_DATA_MUZZLE_VELOCITY_INPUT_3: TEXT_MUZZLE_VELOCITY_DATA_TEMPERATURE_INPUT_3 { + idc=160033; + x=0.550*safezoneW+safezoneX+0.225; + }; + class TEXT_MUZZLE_VELOCITY_DATA_MUZZLE_VELOCITY_INPUT_4: TEXT_MUZZLE_VELOCITY_DATA_TEMPERATURE_INPUT_4 { + idc=160034; + x=0.550*safezoneW+safezoneX+0.225; + }; + class TEXT_MUZZLE_VELOCITY_DATA_MUZZLE_VELOCITY_INPUT_5: TEXT_MUZZLE_VELOCITY_DATA_TEMPERATURE_INPUT_5 { + idc=160035; + x=0.550*safezoneW+safezoneX+0.225; + }; + class TEXT_MUZZLE_VELOCITY_DATA_MUZZLE_VELOCITY_INPUT_6: TEXT_MUZZLE_VELOCITY_DATA_TEMPERATURE_INPUT_6 { + idc=160036; + x=0.550*safezoneW+safezoneX+0.225; + }; + class TEXT_MUZZLE_VELOCITY_DATA_MUZZLE_VELOCITY_INPUT_7: TEXT_MUZZLE_VELOCITY_DATA_TEMPERATURE_INPUT_7 { + idc=160037; + x=0.550*safezoneW+safezoneX+0.225; + }; + class TEXT_MUZZLE_VELOCITY_DATA_CLEAR: TEXT_TARGET_DATA_NEXT { + idc=16004; + style=ST_CENTER; + h=0.035; + y=0.265*safezoneH+safezoneY+0.3625; + text="Clear"; + action=QUOTE(call FUNC(clear_muzzle_velocity_data)); + }; + class TEXT_MUZZLE_VELOCITY_DATA_QUESTIONMARK: TEXT_MUZZLE_VELOCITY_DATA_CLEAR { + idc=16005; + y=0.265*safezoneH+safezoneY+0.430; + text="?"; + action=""; + }; + class TEXT_MUZZLE_VELOCITY_DATA_DONE: TEXT_TARGET_DATA_DONE { + idc=16006; + action=QUOTE(1 call FUNC(toggle_muzzle_velocity_data)); + }; + class TEXT_MUZZLE_VELOCITY_DATA_CANCEL: TEXT_TARGET_DATA_CANCEL { + idc=16007; + action=QUOTE(0 call FUNC(toggle_muzzle_velocity_data)); + }; + class TEXT_MUZZLE_VELOCITY_DATA_PREV: TEXT_TARGET_DATA_PREV { + idc=16008; + }; + class TEXT_MUZZLE_VELOCITY_DATA_NEXT: TEXT_TARGET_DATA_NEXT { + idc=16009; + }; + + class TEXT_C1_BALLISTIC_COEFFICIENT_DATA_DISTANCE: TEXT_BORE_HEIGHT { + idc=17000; + w=0.22; + x=0.550*safezoneW+safezoneX+0.15; + y=0.265*safezoneH+safezoneY+0.25; + sizeEx=0.022; + text="Meters"; + }; + class TEXT_C1_BALLISTIC_COEFFICIENT_DATA_C1_BALLISTIC_COEFFICIENT: TEXT_C1_BALLISTIC_COEFFICIENT_DATA_DISTANCE { + idc=17001; + x=0.550*safezoneW+safezoneX+0.235; + sizeEx=0.022; + text="BC-Coef"; + }; + class TEXT_C1_BALLISTIC_COEFFICIENT_DATA_DISTANCE_INPUT_1: ATragMX_RscEdit { + idc=170021; + w=0.082; + h=0.035; + x=0.550*safezoneW+safezoneX+0.128; + y=0.265*safezoneH+safezoneY+0.29; + text="0"; + }; + class TEXT_C1_BALLISTIC_COEFFICIENT_DATA_DISTANCE_INPUT_2: TEXT_C1_BALLISTIC_COEFFICIENT_DATA_DISTANCE_INPUT_1 { + idc=170022; + y=0.265*safezoneH+safezoneY+0.325; + }; + class TEXT_C1_BALLISTIC_COEFFICIENT_DATA_DISTANCE_INPUT_3: TEXT_C1_BALLISTIC_COEFFICIENT_DATA_DISTANCE_INPUT_1 { + idc=170023; + y=0.265*safezoneH+safezoneY+0.360; + }; + class TEXT_C1_BALLISTIC_COEFFICIENT_DATA_DISTANCE_INPUT_4: TEXT_C1_BALLISTIC_COEFFICIENT_DATA_DISTANCE_INPUT_1 { + idc=170024; + y=0.265*safezoneH+safezoneY+0.395; + }; + class TEXT_C1_BALLISTIC_COEFFICIENT_DATA_DISTANCE_INPUT_5: TEXT_C1_BALLISTIC_COEFFICIENT_DATA_DISTANCE_INPUT_1 { + idc=170025; + y=0.265*safezoneH+safezoneY+0.430; + }; + class TEXT_C1_BALLISTIC_COEFFICIENT_DATA_DISTANCE_INPUT_6: TEXT_C1_BALLISTIC_COEFFICIENT_DATA_DISTANCE_INPUT_1 { + idc=170026; + y=0.265*safezoneH+safezoneY+0.465; + }; + class TEXT_C1_BALLISTIC_COEFFICIENT_DATA_DISTANCE_INPUT_7: TEXT_C1_BALLISTIC_COEFFICIENT_DATA_DISTANCE_INPUT_1 { + idc=170027; + y=0.265*safezoneH+safezoneY+0.500; + }; + class TEXT_C1_BALLISTIC_COEFFICIENT_DATA_C1_BALLISTIC_COEFFICIENT_INPUT_1: TEXT_C1_BALLISTIC_COEFFICIENT_DATA_DISTANCE_INPUT_1 { + idc=170031; + x=0.550*safezoneW+safezoneX+0.225; + }; + class TEXT_C1_BALLISTIC_COEFFICIENT_DATA_C1_BALLISTIC_COEFFICIENT_INPUT_2: TEXT_C1_BALLISTIC_COEFFICIENT_DATA_DISTANCE_INPUT_2 { + idc=170032; + x=0.550*safezoneW+safezoneX+0.225; + }; + class TEXT_C1_BALLISTIC_COEFFICIENT_DATA_C1_BALLISTIC_COEFFICIENT_INPUT_3: TEXT_C1_BALLISTIC_COEFFICIENT_DATA_DISTANCE_INPUT_3 { + idc=170033; + x=0.550*safezoneW+safezoneX+0.225; + }; + class TEXT_C1_BALLISTIC_COEFFICIENT_DATA_C1_BALLISTIC_COEFFICIENT_INPUT_4: TEXT_C1_BALLISTIC_COEFFICIENT_DATA_DISTANCE_INPUT_4 { + idc=170034; + x=0.550*safezoneW+safezoneX+0.225; + }; + class TEXT_C1_BALLISTIC_COEFFICIENT_DATA_C1_BALLISTIC_COEFFICIENT_INPUT_5: TEXT_C1_BALLISTIC_COEFFICIENT_DATA_DISTANCE_INPUT_5 { + idc=170035; + x=0.550*safezoneW+safezoneX+0.225; + }; + class TEXT_C1_BALLISTIC_COEFFICIENT_DATA_C1_BALLISTIC_COEFFICIENT_INPUT_6: TEXT_C1_BALLISTIC_COEFFICIENT_DATA_DISTANCE_INPUT_6 { + idc=170036; + x=0.550*safezoneW+safezoneX+0.225; + }; + class TEXT_C1_BALLISTIC_COEFFICIENT_DATA_C1_BALLISTIC_COEFFICIENT_INPUT_7: TEXT_C1_BALLISTIC_COEFFICIENT_DATA_DISTANCE_INPUT_7 { + idc=170037; + x=0.550*safezoneW+safezoneX+0.225; + }; + class TEXT_C1_BALLISTIC_COEFFICIENT_DATA_QUESTIONMARK: TEXT_TARGET_DATA_NEXT { + idc=17004; + style=ST_CENTER; + w=0.04; + h=0.035; + y=0.265*safezoneH+safezoneY+0.35; + text="?"; + action=""; + }; + class TEXT_C1_BALLISTIC_COEFFICIENT_DATA_CLEAR: TEXT_C1_BALLISTIC_COEFFICIENT_DATA_QUESTIONMARK { + idc=17005; + w=0.07; + y=0.265*safezoneH+safezoneY+0.4175; + text="Clear"; + action=QUOTE(call FUNC(clear_c1_ballistic_coefficient_data)); + }; + class TEXT_C1_BALLISTIC_COEFFICIENT_DATA_DONE: TEXT_TARGET_DATA_DONE { + idc=17006; + action=QUOTE(1 call FUNC(toggle_c1_ballistic_coefficient_data)); + }; + class TEXT_C1_BALLISTIC_COEFFICIENT_DATA_CANCEL: TEXT_TARGET_DATA_CANCEL { + idc=17007; + action=QUOTE(0 call FUNC(toggle_c1_ballistic_coefficient_data)); + }; + class TEXT_C1_BALLISTIC_COEFFICIENT_DATA_PREV: TEXT_TARGET_DATA_PREV { + idc=17008; + }; + class TEXT_C1_BALLISTIC_COEFFICIENT_DATA_NEXT: TEXT_TARGET_DATA_NEXT { + idc=17009; + }; + + class TEXT_TRUING_DROP_ZERO_RANGE: ATragMX_RscText { + idc=18000; + style=ST_LEFT; + x=0.550*safezoneW+safezoneX+0.115; + y=0.265*safezoneH+safezoneY+0.220; + w=0.135; + h=0.03; + sizeEx=0.025; + text="ZR=100meters"; + }; + class TEXT_TRUING_DROP_DROP_UNIT: TEXT_TRUING_DROP_ZERO_RANGE { + idc=18001; + style=ST_LEFT; + x=0.550*safezoneW+safezoneX+0.25; + text="Drop=mil"; + }; + class TEXT_TRUING_DROP_TARGET_RANGE: TEXT_TRUING_DROP_ZERO_RANGE { + idc=18002; + y=0.265*safezoneH+safezoneY+0.35; + sizeEx=0.027; + text="Target Range"; + }; + class TEXT_TRUING_DROP_DROP: TEXT_TRUING_DROP_TARGET_RANGE { + idc=18003; + w=0.07; + y=0.265*safezoneH+safezoneY+0.40; + text="Drop"; + }; + class TEXT_TRUING_DROP_MUZZLE_VELOCITY: TEXT_TRUING_DROP_DROP { + idc=18004; + y=0.265*safezoneH+safezoneY+0.50; + text="MV"; + }; + class TEXT_TRUING_DROP_C1_BALLISTIC_COEFFICIENT: TEXT_TRUING_DROP_DROP { + idc=18005; + y=0.265*safezoneH+safezoneY+0.55; + text="C1"; + }; + class TEXT_TRUING_DROP_DROP_OUTPUT: ATragMX_RscEdit { + idc=18006; + style=ST_WITH_RECT+ST_RIGHT; + colorBackground[]={0.15,0.21,0.23,0.3}; + colorDisabled[]={0,0,0,1}; + w=0.06; + y=0.265*safezoneH+safezoneY+0.40; + x=0.550*safezoneW+safezoneX+0.17; + text=""; + }; + class TEXT_TRUING_DROP_MUZZLE_VELOCITY_OUTPUT: TEXT_TRUING_DROP_DROP_OUTPUT { + idc=18007; + y=0.265*safezoneH+safezoneY+0.50; + text=""; + }; + class TEXT_TRUING_DROP_C1_BALLISTIC_COEFFICIENT_OUTPUT: TEXT_TRUING_DROP_DROP_OUTPUT { + idc=18008; + y=0.265*safezoneH+safezoneY+0.55; + text=""; + }; + class TEXT_TRUING_DROP_SUPER: TEXT_TARGET_A { + idc=18009; + w=0.06; + x=0.550*safezoneW+safezoneX+0.25; + y=0.265*safezoneH+safezoneY+0.30; + text="SUPER"; + action=QUOTE(GVAR(truingDropMode) = 0; call FUNC(update_truing_drop_selection)); + }; + class TEXT_TRUING_DROP_SUB: TEXT_TRUING_DROP_SUPER { + idc=18010; + x=0.550*safezoneW+safezoneX+0.32; + text="SUB"; + action=QUOTE(GVAR(truingDropMode) = 1; call FUNC(update_truing_drop_selection)); + }; + class TEXT_TRUING_DROP_TARGET_RANGE_SUPER_INPUT: ATragMX_RscEdit { + idc=18011; + style=ST_WITH_RECT+ST_RIGHT; + colorDisabled[]={0,0,0,0.6}; + w=0.06; + x=0.550*safezoneW+safezoneX+0.25; + y=0.265*safezoneH+safezoneY+0.35; + }; + class TEXT_TRUING_DROP_TARGET_RANGE_SUB_INPUT: TEXT_TRUING_DROP_TARGET_RANGE_SUPER_INPUT { + idc=18012; + x=0.550*safezoneW+safezoneX+0.32; + }; + class TEXT_TRUING_DROP_DROP_SUPER_INPUT: TEXT_TRUING_DROP_TARGET_RANGE_SUPER_INPUT { + idc=18013; + y=0.265*safezoneH+safezoneY+0.40; + }; + class TEXT_TRUING_DROP_DROP_SUB_INPUT: TEXT_TRUING_DROP_TARGET_RANGE_SUB_INPUT { + idc=18014; + y=0.265*safezoneH+safezoneY+0.40; + }; + class TEXT_TRUING_DROP_CALC: TEXT_GUN_LIST { + idc=18015; + style=ST_CENTER; + w=0.11; + x=0.550*safezoneW+safezoneX+0.26; + y=0.265*safezoneH+safezoneY+0.45; + text="Calc"; + action=QUOTE(true call FUNC(calculate_truing_drop)); + }; + class TEXT_TRUING_DROP_MV_INPUT: TEXT_TRUING_DROP_TARGET_RANGE_SUPER_INPUT { + idc=18016; + y=0.265*safezoneH+safezoneY+0.50; + }; + class TEXT_TRUING_DROP_C1_BALLISTIC_COEFFICIENT_INPUT: TEXT_TRUING_DROP_TARGET_RANGE_SUB_INPUT { + idc=18017; + y=0.265*safezoneH+safezoneY+0.55; + }; + class TEXT_TRUING_DROP_ACCEPT: TEXT_GUN_LIST { + idc=18018; + w=0.085; + h=0.04; + x=0.550*safezoneW+safezoneX+0.125; + y=0.265*safezoneH+safezoneY+0.60; + text="Accept"; + action=QUOTE(1 call FUNC(toggle_truing_drop)); + }; + class TEXT_TRUING_DROP_CANCEL: TEXT_TRUING_DROP_ACCEPT { + idc=18019; + x=0.550*safezoneW+safezoneX+0.210; + text="Cancel"; + action=QUOTE(0 call FUNC(toggle_truing_drop)); + }; + class TEXT_TRUING_DROP_RESTORE: TEXT_TRUING_DROP_CANCEL { + idc=18020; + x=0.550*safezoneW+safezoneX+0.29525; + text="Restore"; + action=QUOTE(true call FUNC(restore_truing_drop)); + }; }; }; diff --git a/addons/atragmx/XEH_PREP.hpp b/addons/atragmx/XEH_PREP.hpp index 20900711c3..c77b7e0655 100644 --- a/addons/atragmx/XEH_PREP.hpp +++ b/addons/atragmx/XEH_PREP.hpp @@ -1,13 +1,17 @@ PREP(add_new_gun); +PREP(calculate_distance_at_velocity); PREP(calculate_range_card); PREP(calculate_solution); PREP(calculate_target_range_assist); PREP(calculate_target_solution); PREP(calculate_target_speed_assist); +PREP(calculate_truing_drop); PREP(can_show); PREP(change_gun); PREP(change_target_slot); +PREP(clear_c1_ballistic_coefficient_data); +PREP(clear_muzzle_velocity_data); PREP(clear_user_data); PREP(create_dialog); PREP(cycle_gun_list); @@ -18,17 +22,29 @@ PREP(cycle_scope_unit); PREP(cycle_target_size_units); PREP(cycle_target_speed_direction); PREP(delete_gun); +PREP(evaluate_option_menu_input); PREP(init); +PREP(initGunList); +PREP(insert_c1_ballistic_coefficient_data); +PREP(insert_muzzle_velocity_data); PREP(parse_input); +PREP(read_gun_list_entries_from_config); +PREP(recalculate_c1_ballistic_coefficient); +PREP(recalculate_muzzle_velocity); PREP(reset_relative_click_memory); PREP(restore_atmo_default); +PREP(restore_truing_drop); PREP(restore_user_data); PREP(save_gun); +PREP(shift_c1_ballistic_coefficient_data); +PREP(shift_muzzle_velocity_data); PREP(show_add_new_gun); PREP(show_atmo_env_data); +PREP(show_c1_ballistic_coefficient_data); PREP(show_gun_ammo_data); PREP(show_gun_list); PREP(show_main_page); +PREP(show_muzzle_velocity_data); PREP(show_range_card); PREP(show_range_card_setup); PREP(show_solution_setup); @@ -36,24 +52,36 @@ PREP(show_target_data); PREP(show_target_range_assist); PREP(show_target_speed_assist); PREP(show_target_speed_assist_timer); +PREP(show_truing_drop); PREP(sord); +PREP(store_gun_list); PREP(store_user_data); PREP(target_speed_assist_timer); PREP(toggle_atmo_env_data); +PREP(toggle_c1_ballistic_coefficient_data); +PREP(toggle_coriolis); PREP(toggle_gun_ammo_data); PREP(toggle_gun_list); +PREP(toggle_muzzle_velocity_data); +PREP(toggle_option_menu); PREP(toggle_range_card); PREP(toggle_range_card_setup); PREP(toggle_solution_setup); PREP(toggle_target_data); PREP(toggle_target_range_assist); PREP(toggle_target_speed_assist); +PREP(toggle_truing_drop); +PREP(trim_gun_name); +PREP(true_c1_ballistic_coefficient); +PREP(true_muzzle_velocity); PREP(update_atmosphere); PREP(update_atmo_env_data); PREP(update_atmo_selection); +PREP(update_c1_ballistic_coefficient_data); PREP(update_gun); PREP(update_gun_ammo_data); PREP(update_inclination_angle); +PREP(update_muzzle_velocity_data); PREP(update_range_card); PREP(update_relative_click_memory); PREP(update_result); @@ -62,6 +90,8 @@ PREP(update_solution_setup); PREP(update_target); PREP(update_target_data); PREP(update_target_selection); +PREP(update_truing_drop_data); +PREP(update_truing_drop_selection); PREP(update_unit_selection); PREP(update_zero_range); PREP(on_close_dialog); diff --git a/addons/atragmx/XEH_postInit.sqf b/addons/atragmx/XEH_postInit.sqf index 4a68aac749..9034016212 100644 --- a/addons/atragmx/XEH_postInit.sqf +++ b/addons/atragmx/XEH_postInit.sqf @@ -2,53 +2,7 @@ #include "initKeybinds.sqf" -if ((profileNamespace getVariable ["ACE_ATragMX_profileNamespaceVersion", 0]) == ATRAGMX_PROFILE_NAMESPACE_VERSION && count (profileNamespace getVariable ["ACE_ATragMX_gunList", []]) > 0) then { - GVAR(gunList) = profileNamespace getVariable "ACE_ATragMX_gunList"; -} else { - // Profile Name, Muzzle Velocity, Zero Range, Scope Base Angle, AirFriction, Bore Height, Scope Unit, Scope Click Unit, Scope Click Number, Maximum Elevation, Dialed Elevation, Dialed Windage, Mass, Bullet Diameter, Rifle Twist, BC, Drag Model, Atmosphere Model - GVAR(gunList) = [["12.7x108mm" , 820, 100, 0.0657485, -0.00063800, 3.81, 0, 2, 10, 120, 0, 0, 48.28, 12.7, 38.10, 0.630, 1, "ASM" ], - - ["12.7x99mm AMAX" , 860, 100, 0.0611565, -0.00036645, 3.81, 0, 2, 10, 120, 0, 0, 48.60, 12.7, 38.10, 1.050, 1, "ASM" ], - ["12.7x99mm" , 900, 100, 0.0582418, -0.00057503, 3.81, 0, 2, 10, 120, 0, 0, 41.92, 12.7, 38.10, 0.670, 1, "ASM" ], - ["12.7x99mm API" , 900, 100, 0.0582418, -0.00057503, 3.81, 0, 2, 10, 120, 0, 0, 41.99, 12.9, 38.10, 0.670, 1, "ASM" ], - - ["12.7x54mm" , 300, 100, 0.3394630, -0.00019268, 3.81, 0, 2, 10, 120, 0, 0, 48.60, 12.7, 24.13, 1.050, 1, "ASM" ], - - [".408 Chey Tac" , 910, 100, 0.0569400, -0.00038944, 3.81, 0, 2, 10, 120, 0, 0, 26.57, 10.4, 33.02, 0.970, 1, "ASM" ], - - ["9.3×64mm" , 870, 100, 0.0619295, -0.00108571, 3.81, 0, 2, 10, 120, 0, 0, 14.90, 9.30, 35.56, 0.368, 1, "ASM" ], - - [".338LM 250gr" , 880, 100, 0.0598469, -0.00059133, 3.81, 0, 2, 10, 120, 0, 0, 16.20, 8.58, 25.40, 0.322, 7, "ICAO"], - [".338LM 300gr" , 800, 100, 0.0677343, -0.00052190, 3.81, 0, 2, 10, 120, 0, 0, 19.44, 8.58, 25.40, 0.381, 7, "ICAO"], - [".338LM API526" , 895, 100, 0.0588865, -0.00069611, 3.81, 0, 2, 10, 120, 0, 0, 16.39, 8.58, 25.40, 0.560, 1, "ASM" ], - - [".300WM Mk248 Mod0" , 900, 100, 0.0584442, -0.00070530, 3.81, 0, 2, 10, 120, 0, 0, 12.31, 7.80, 25.40, 0.268, 7, "ICAO"], - [".300WM Mk248 Mod1" , 867, 100, 0.0610738, -0.00061188, 3.81, 0, 2, 10, 120, 0, 0, 14.26, 7.80, 25.40, 0.310, 7, "ICAO"], - [".300WM Berger OTM" , 853, 100, 0.0622179, -0.00053733, 3.81, 0, 2, 10, 120, 0, 0, 14.90, 7.80, 25.40, 0.368, 7, "ICAO"], - - ["7.62x54mmR" , 800, 100, 0.0691878, -0.00100023, 3.81, 0, 2, 10, 120, 0, 0, 9.849, 7.92, 24.13, 0.400, 1, "ICAO"], - - ["7.62x51mm M80" , 810, 100, 0.0679374, -0.00100957, 3.81, 0, 2, 10, 120, 0, 0, 9.461, 7.82, 25.40, 0.200, 7, "ICAO"], - ["7.62x51mm M118LR" , 780, 100, 0.0710319, -0.00082828, 3.81, 0, 2, 10, 120, 0, 0, 11.34, 7.82, 25.40, 0.243, 7, "ICAO"], - ["7.62x51mm Mk316" , 780, 100, 0.0710319, -0.00082029, 3.81, 0, 2, 10, 120, 0, 0, 11.34, 7.82, 25.40, 0.243, 7, "ICAO"], - ["7.62x51mm Mk319" , 910, 100, 0.0584524, -0.00102338, 3.81, 0, 2, 10, 120, 0, 0, 8.424, 7.82, 25.40, 0.377, 1, "ICAO"], - ["7.62x51mm M993" , 930, 100, 0.0570316, -0.00107148, 3.81, 0, 2, 10, 120, 0, 0, 8.230, 7.82, 25.40, 0.359, 1, "ICAO"], - ["7.62x51mm Subsonic", 320, 100, 0.3059680, -0.00049899, 3.81, 0, 2, 10, 120, 0, 0, 12.96, 7.82, 25.40, 0.235, 7, "ICAO"], - - ["6.5x39mm" , 800, 100, 0.0683482, -0.00075308, 3.81, 0, 2, 10, 120, 0, 0, 7.970, 6.71, 22.86, 0.263, 7, "ICAO"], - ["6.5x47mm Lapua" , 800, 100, 0.0682221, -0.00067037, 3.81, 0, 2, 10, 120, 0, 0, 9.007, 6.71, 22.86, 0.290, 7, "ICAO"], - ["6.5mm Creedmor" , 840, 100, 0.0636501, -0.00060887, 3.81, 0, 2, 10, 120, 0, 0, 9.072, 6.71, 22.86, 0.317, 7, "ICAO"], - - ["5.56x45mm M855" , 870, 100, 0.0626386, -0.00126466, 3.81, 0, 2, 10, 120, 0, 0, 4.018, 5.70, 17.78, 0.151, 7, "ASM" ], - ["5.56x45mm Mk262" , 820, 100, 0.0671481, -0.00109563, 3.81, 0, 2, 10, 120, 0, 0, 4.990, 5.70, 17.78, 0.361, 1, "ASM" ], - ["5.56x45mm Mk318" , 880, 100, 0.0615937, -0.00123318, 3.81, 0, 2, 10, 120, 0, 0, 4.018, 5.70, 17.78, 0.307, 1, "ASM" ], - ["5.56x45mm M995" , 869, 100, 0.0626713, -0.00123272, 3.81, 0, 2, 10, 120, 0, 0, 4.536, 5.70, 17.78, 0.310, 1, "ASM" ]]; - - [] call FUNC(clear_user_data); - profileNamespace setVariable ["ACE_ATragMX_gunList", GVAR(gunList)]; -}; - -[] call FUNC(init); -[] call FUNC(restore_user_data); +GVAR(active) = false; +GVAR(initialised) = false; [QEGVAR(vector,rangefinderData), {_this call FUNC(sord)}] call CBA_fnc_addEventHandler; diff --git a/addons/atragmx/XEH_preInit.sqf b/addons/atragmx/XEH_preInit.sqf index a7feade1c3..b47cf6628d 100644 --- a/addons/atragmx/XEH_preInit.sqf +++ b/addons/atragmx/XEH_preInit.sqf @@ -2,6 +2,8 @@ ADDON = false; +PREP_RECOMPILE_START; #include "XEH_PREP.hpp" +PREP_RECOMPILE_END; ADDON = true; diff --git a/addons/atragmx/config.cpp b/addons/atragmx/config.cpp index d7cb846c60..125d4a488e 100644 --- a/addons/atragmx/config.cpp +++ b/addons/atragmx/config.cpp @@ -6,7 +6,7 @@ class CfgPatches { units[] = {"ACE_Item_ATragMX"}; weapons[] = {"ACE_ATragMX"}; requiredVersion = REQUIRED_VERSION; - requiredAddons[] = {"ACE_common", "ACE_weather"}; + requiredAddons[] = {"ACE_Advanced_Ballistics", "ACE_common", "ACE_weather"}; author = ECSTRING(common,ACETeam); authors[] = {"Ruthberg"}; url = ECSTRING(main,URL); diff --git a/addons/atragmx/functions/fnc_add_new_gun.sqf b/addons/atragmx/functions/fnc_add_new_gun.sqf index dbc85cc27f..729649dc5d 100644 --- a/addons/atragmx/functions/fnc_add_new_gun.sqf +++ b/addons/atragmx/functions/fnc_add_new_gun.sqf @@ -6,7 +6,7 @@ * Nothing * * Return Value: - * Nothing + * None * * Example: * call ace_atragmx_fnc_add_new_gun @@ -15,13 +15,16 @@ */ #include "script_component.hpp" +call FUNC(trim_gun_name); + private _gunName = ctrlText 11001; + if (_gunName != "") then { - private _gunProfileEntry = [_gunName, 810, 100, 0.0679, -0.0010350, 3.81, 0, 2, 10, 120, 0, 0, 9.525, 7.82, 25.40, 0.393, 1, "ICAO"], + private _gunProfileEntry = [_gunName, 810, 100, 0.0679, -0.0010350, 3.81, 0, 2, 10, 120, 0, 0, 9.525, 7.82, 25.40, 0.393, 1, "ICAO", [[-15,0],[0,0],[10,0],[15,0],[25,0],[30,0],[35,0]], [[0,0],[0,0],[0,0],[0,0],[0,0],[0,0],[0,0]], true]; GVAR(gunList) = GVAR(gunList) + [_gunProfileEntry]; - lbAdd [6000, _gunProfileEntry select 0]; + lbAdd [6000, _gunName]; - profileNamespace setVariable ["ACE_ATragMX_gunList", GVAR(gunList)]; + call FUNC(store_gun_list); }; diff --git a/addons/atragmx/functions/fnc_calculate_distance_at_velocity.sqf b/addons/atragmx/functions/fnc_calculate_distance_at_velocity.sqf new file mode 100644 index 0000000000..cbb78df8e7 --- /dev/null +++ b/addons/atragmx/functions/fnc_calculate_distance_at_velocity.sqf @@ -0,0 +1,38 @@ +/* + * Author: Ruthberg + * Calculates distance at which the bullet velocity drops below the threshold velocity + * + * Arguments: + * theshold velocity + * + * Return Value: + * distance + * + * Example: + * 403 call ace_atragmx_fnc_calculate_distance_at_velocity + * + * Public: No + */ +#include "script_component.hpp" + +#define __DELTA_T 0.001 + +if (isNil QGVAR(targetSolutionInput)) exitWith { 0 }; + +private _thresholdVelocity = _this; +private _velocity = GVAR(targetSolutionInput) select 4; + +if (_velocity <= _thresholdVelocity) exitWith { 0 }; + +private _distance = 0; + +while {_velocity > _thresholdVelocity} do { + private _bc = GVAR(targetSolutionInput) select 14; + private _dragModel = GVAR(targetSolutionInput) select 15; + private _temperature = GVAR(targetSolutionInput) select 5; + private _drag = parseNumber(("ace_advanced_ballistics" callExtension format["retard:%1:%2:%3:%4", _dragModel, _bc, _velocity, _temperature])); + _distance = _distance + _velocity * __DELTA_T; + _velocity = _velocity - (_drag * __DELTA_T); +}; + +_distance diff --git a/addons/atragmx/functions/fnc_calculate_range_card.sqf b/addons/atragmx/functions/fnc_calculate_range_card.sqf index 0b6d0a177b..837a46079f 100644 --- a/addons/atragmx/functions/fnc_calculate_range_card.sqf +++ b/addons/atragmx/functions/fnc_calculate_range_card.sqf @@ -3,10 +3,10 @@ * Calculates the range card output based on the current data set * * Arguments: - * Nothing + * None * * Return Value: - * Nothing + * None * * Example: * call ace_atragmx_fnc_calculate_range_card @@ -15,61 +15,16 @@ */ #include "script_component.hpp" -[] call FUNC(parse_input); +GVAR(rangeCardData) = []; -GVAR(workingMemory) params ["", - "_muzzleVelocity", "", - "_scopeBaseAngle", - "_airFriction", - "_boreHeight", "", "", "", "", "", "", - "_bulletMass", - "_bulletDiameter", - "_barrelTwist", - "_bc", - "_dragModel", - "_atmosphereModel" -]; - -private _twistDirection = 0; -if (_barrelTwist > 0) then { - _twistDirection = 1; -} else { - if (_barrelTwist < 0) then { - _twistDirection = -1; - }; -}; -_barrelTwist = abs _barrelTwist; - -private _altitude = GVAR(altitude); -private _temperature = GVAR(temperature); -private _barometricPressure = GVAR(barometricPressure); -private _relativeHumidity = GVAR(relativeHumidity); -if (!GVAR(atmosphereModeTBH)) then { - _barometricPressure = 1013.25 * (1 - (0.0065 * _altitude) / (273.15 + _temperature + 0.0065 * _altitude)) ^ 5.255754495; - _relativeHumidity = 50; -}; - -private _bulletLength = 45.72; -private _stabilityFactor = 1.5; -if (missionNamespace getVariable [QEGVAR(advanced_ballistics,enabled), false]) then { - if (_bulletDiameter > 0 && _bulletLength > 0 && _bulletMass > 0 && _barrelTwist > 0) then { - _stabilityFactor = [_bulletDiameter, _bulletLength, _bulletMass, _barrelTwist * 10, _muzzleVelocity, _temperature, _barometricPressure] call EFUNC(advanced_ballistics,calculateStabilityFactor); - }; -}; - -private _latitude = GVAR(latitude) select GVAR(currentTarget); -private _directionOfFire = GVAR(directionOfFire) select GVAR(currentTarget); -private _windSpeed1 = (GVAR(windSpeed1) select GVAR(currentTarget)); -private _windSpeed2 = (GVAR(windSpeed2) select GVAR(currentTarget)); -private _windDirection = (GVAR(windDirection) select GVAR(currentTarget)); -private _inclinationAngle = (GVAR(inclinationAngle) select GVAR(currentTarget)); -private _targetSpeed = (GVAR(targetSpeed) select GVAR(currentTarget)); private _targetRange = GVAR(rangeCardEndRange); if (GVAR(currentUnit) == 1) then { _targetRange = _targetRange / 1.0936133; }; -GVAR(rangeCardData) = []; +private _solutionInput = +GVAR(targetSolutionInput); +_solutionInput set [ 8, round(_solutionInput select 4)]; +_solutionInput set [13, _targetRange]; +_solutionInput set [17, true]; -private _result = [_scopeBaseAngle, _bulletMass, _boreHeight, _airFriction, _muzzleVelocity, _temperature, _barometricPressure, _relativeHumidity, 1000, - [_windSpeed1, _windSpeed2], _windDirection, _inclinationAngle, _targetSpeed, _targetRange, _bc, _dragModel, _atmosphereModel, true, _stabilityFactor, _twistDirection, _latitude, _directionOfFire] call FUNC(calculate_solution); +private _result = _solutionInput call FUNC(calculate_solution); diff --git a/addons/atragmx/functions/fnc_calculate_solution.sqf b/addons/atragmx/functions/fnc_calculate_solution.sqf index d98c46c5fb..a37156de28 100644 --- a/addons/atragmx/functions/fnc_calculate_solution.sqf +++ b/addons/atragmx/functions/fnc_calculate_solution.sqf @@ -51,33 +51,34 @@ params [ ]; _windSpeed params ["_windSpeed1", "_windSpeed2"]; -private ["_bulletPos", "_bulletVelocity", "_bulletAccel", "_bulletSpeed", "_gravity", "_deltaT"]; -_bulletPos = [0, 0, 0]; -_bulletVelocity = [0, 0, 0]; -_bulletAccel = [0, 0, 0]; -_bulletSpeed = 0; -_gravity = [0, sin(_scopeBaseAngle + _inclinationAngle) * -9.80665, cos(_scopeBaseAngle + _inclinationAngle) * -9.80665]; -_deltaT = 1 / _simSteps; +private _tx = 0; +private _tz = 0; +private _lastBulletPos = [0, 0, 0]; +private _bulletPos = [0, 0, 0]; +private _bulletVelocity = [0, 0, 0]; +private _bulletAccel = [0, 0, 0]; +private _bulletSpeed = 0; +private _gravity = [0, sin(_scopeBaseAngle + _inclinationAngle) * -9.80665, cos(_scopeBaseAngle + _inclinationAngle) * -9.80665]; +private _deltaT = 1 / _simSteps; -private ["_elevation", "_windage1", "_windage2", "_lead", "_TOF", "_trueVelocity", "_trueSpeed", "_kineticEnergy", "_verticalCoriolis", "_verticalDeflection", "_horizontalCoriolis", "_horizontalDeflection", "_spinDrift", "_spinDeflection"]; -_elevation = 0; -_windage1 = 0; -_windage2 = 0; -_lead = 0; -_TOF = 0; -_trueVelocity = [0, 0, 0]; -_trueSpeed = 0; -_verticalCoriolis = 0; -_verticalDeflection = 0; -_horizontalCoriolis = 0; -_horizontalDeflection = 0; -_spinDrift = 0; -_spinDeflection = 0; +private _elevation = 0; +private _windage1 = 0; +private _windage2 = 0; +private _lead = 0; +private _TOF = 0; +private _trueVelocity = [0, 0, 0]; +private _trueSpeed = 0; +private _verticalCoriolis = 0; +private _verticalDeflection = 0; +private _horizontalCoriolis = 0; +private _horizontalDeflection = 0; +private _spinDrift = 0; +private _spinDeflection = 0; -private ["_n", "_range", "_rangeFactor"]; -_n = 0; -_range = 0; -_rangeFactor = 1; +private _n = 0; +private _range = 0; +private _trueRange = 0; +private _rangeFactor = 1; if (_storeRangeCardData) then { if (GVAR(currentUnit) == 1) then { _rangeFactor = 1.0936133; @@ -85,27 +86,18 @@ if (_storeRangeCardData) then { GVAR(rangeCardData) = []; }; -private ["_wind1", "_wind2", "_windDrift"]; -_wind1 = [cos(270 - _windDirection * 30) * _windSpeed1, sin(270 - _windDirection * 30) * _windSpeed1, 0]; -_wind2 = [cos(270 - _windDirection * 30) * _windSpeed2, sin(270 - _windDirection * 30) * _windSpeed2, 0]; -_windDrift = 0; +private _wind1 = [cos(270 - _windDirection * 30) * _windSpeed1, sin(270 - _windDirection * 30) * _windSpeed1, 0]; +private _wind2 = [cos(270 - _windDirection * 30) * _windSpeed2, sin(270 - _windDirection * 30) * _windSpeed2, 0]; +private _windDrift = 0; if (missionNamespace getVariable [QEGVAR(advanced_ballistics,enabled), false]) then { - _bc = [_bc, _temperature, _barometricPressure, _relativeHumidity, _atmosphereModel] call EFUNC(advanced_ballistics,calculateAtmosphericCorrection); + _bc = parseNumber(("ace_advanced_ballistics" callExtension format["atmosphericCorrection:%1:%2:%3:%4:%5", _bc, _temperature, _barometricPressure, _relativeHumidity, _atmosphereModel])); }; -private ["_speedTotal", "_stepsTotal", "_speedAverage"]; -_speedTotal = 0; -_stepsTotal = 0; -_speedAverage = 0; - -private ["_eoetvoesMultiplier"]; -_eoetvoesMultiplier = 0; +private _eoetvoesMultiplier = 0; if (missionNamespace getVariable [QEGVAR(advanced_ballistics,enabled), false]) then { _eoetvoesMultiplier = 2 * (0.0000729 * _muzzleVelocity / -9.80665) * cos(_latitude) * sin(_directionOfFire); }; -_TOF = 0; - _bulletPos set [0, 0]; _bulletPos set [1, 0]; _bulletPos set [2, -(_boreHeight / 100)]; @@ -117,19 +109,11 @@ _bulletVelocity set [2, Sin(_scopeBaseAngle) * _muzzleVelocity]; while {_TOF < 15 && (_bulletPos select 1) < _targetRange} do { _bulletSpeed = vectorMagnitude _bulletVelocity; - _speedTotal = _speedTotal + _bulletSpeed; - _stepsTotal = _stepsTotal + 1; - _speedAverage = (_speedTotal / _stepsTotal); - _trueVelocity = _bulletVelocity vectorDiff _wind1; _trueSpeed = vectorMagnitude _trueVelocity; if (missionNamespace getVariable [QEGVAR(advanced_ballistics,enabled), false]) then { - private _drag = if (missionNamespace getVariable [QEGVAR(advanced_ballistics,extensionAvailable), false]) then { - parseNumber(("ace_advanced_ballistics" callExtension format["retard:%1:%2:%3", _dragModel, _bc, _trueSpeed])) - } else { - ([_dragModel, _bc, _trueSpeed] call EFUNC(advanced_ballistics,calculateRetardation)) - }; + private _drag = parseNumber(("ace_advanced_ballistics" callExtension format["retard:%1:%2:%3:%4", _dragModel, _bc, _trueSpeed, _temperature])); _bulletAccel = (vectorNormalized _trueVelocity) vectorMultiply (-1 * _drag); } else { _bulletAccel = _trueVelocity vectorMultiply (_trueSpeed * _airFriction); @@ -137,29 +121,32 @@ while {_TOF < 15 && (_bulletPos select 1) < _targetRange} do { _bulletAccel = _bulletAccel vectorAdd _gravity; + _lastBulletPos = _bulletPos; + _bulletPos = _bulletPos vectorAdd (_bulletVelocity vectorMultiply (_deltaT * 0.5)); _bulletVelocity = _bulletVelocity vectorAdd (_bulletAccel vectorMultiply _deltaT); - _bulletPos = _bulletPos vectorAdd (_bulletVelocity vectorMultiply _deltaT); + _bulletPos = _bulletPos vectorAdd (_bulletVelocity vectorMultiply (_deltaT * 0.5)); _TOF = _TOF + _deltaT; if (_storeRangeCardData) then { _range = GVAR(rangeCardStartRange) + _n * GVAR(rangeCardIncrement); if ((_bulletPos select 1) * _rangeFactor >= _range && _range <= GVAR(rangeCardEndRange)) then { - if ((_bulletPos select 1) > 0) then { - _elevation = - atan((_bulletPos select 2) / (_bulletPos select 1)); - _windage1 = - atan((_bulletPos select 0) / (_bulletPos select 1)); - _windDrift = (_wind2 select 0) * (_TOF - (_range / _rangeFactor) / _muzzleVelocity); - _windage2 = - atan(_windDrift / (_bulletPos select 1)); - }; - if (_range != 0) then { - _lead = (_targetSpeed * _TOF) / (Tan(3.38 / 60) * _range); + _trueRange = _range / _rangeFactor; + if (_trueRange != 0) then { + _tx = (_lastBulletPos select 0) + (_trueRange - (_lastBulletPos select 1)) * ((_bulletPos select 0) - (_lastBulletPos select 0)) / ((_bulletPos select 1) - (_lastBulletPos select 1)); + _tz = (_lastBulletPos select 2) + (_trueRange - (_lastBulletPos select 1)) * ((_bulletPos select 2) - (_lastBulletPos select 2)) / ((_bulletPos select 1) - (_lastBulletPos select 1)); + _elevation = - atan(_tz / _trueRange); + _windage1 = - atan(_tx / _trueRange); + _windDrift = (_wind2 select 0) * (_TOF - _trueRange / _muzzleVelocity); + _windage2 = - atan(_windDrift / _trueRange); + _lead = (_targetSpeed * _TOF) / (Tan(MRAD_TO_DEG(1)) * _trueRange); }; _kineticEnergy = 0.5 * (_bulletMass / 1000 * (_bulletSpeed ^ 2)); _kineticEnergy = _kineticEnergy * 0.737562149; if ((missionNamespace getVariable [QEGVAR(advanced_ballistics,enabled), false]) && (_bulletPos select 1) > 0) then { // Coriolis - _horizontalDeflection = 0.0000729 * ((_bulletPos select 1) ^ 2) * sin(_latitude) / _speedAverage; + _horizontalDeflection = 0.0000729 * (_bulletPos select 1) * _TOF * sin(_latitude); _horizontalCoriolis = - atan(_horizontalDeflection / (_bulletPos select 1)); _windage1 = _windage1 + _horizontalCoriolis; _windage2 = _windage2 + _horizontalCoriolis; @@ -180,15 +167,14 @@ while {_TOF < 15 && (_bulletPos select 1) < _targetRange} do { }; }; -if ((_bulletPos select 1) > 0) then { - _elevation = - atan((_bulletPos select 2) / (_bulletPos select 1)); - _windage1 = - atan((_bulletPos select 0) / (_bulletPos select 1)); - _windDrift = (_wind2 select 0) * (_TOF - _targetRange / _muzzleVelocity); - _windage2 = - atan(_windDrift / (_bulletPos select 1)); -}; - if (_targetRange != 0) then { - _lead = (_targetSpeed * _TOF) / (Tan(3.38 / 60) * _targetRange); + _tx = (_lastBulletPos select 0) + (_targetRange - (_lastBulletPos select 1)) * ((_bulletPos select 0) - (_lastBulletPos select 0)) / ((_bulletPos select 1) - (_lastBulletPos select 1)); + _tz = (_lastBulletPos select 2) + (_targetRange - (_lastBulletPos select 1)) * ((_bulletPos select 2) - (_lastBulletPos select 2)) / ((_bulletPos select 1) - (_lastBulletPos select 1)); + _elevation = - atan(_tz / _targetRange); + _windage1 = - atan(_tx / _targetRange); + _windDrift = (_wind2 select 0) * (_TOF - _targetRange / _muzzleVelocity); + _windage2 = - atan(_windDrift / _targetRange); + _lead = (_targetSpeed * _TOF) / (Tan(MRAD_TO_DEG(1)) * _targetRange); }; _kineticEnergy = 0.5 * (_bulletMass / 1000 * (_bulletSpeed ^ 2)); @@ -196,7 +182,7 @@ _kineticEnergy = _kineticEnergy * 0.737562149; if ((missionNamespace getVariable [QEGVAR(advanced_ballistics,enabled), false]) && (_bulletPos select 1) > 0) then { // Coriolis - _horizontalDeflection = 0.0000729 * ((_bulletPos select 1) ^ 2) * sin(_latitude) / _speedAverage; + _horizontalDeflection = 0.0000729 * (_bulletPos select 1) * _TOF * sin(_latitude); _horizontalCoriolis = - atan(_horizontalDeflection / (_bulletPos select 1)); _windage1 = _windage1 + _horizontalCoriolis; _windage2 = _windage2 + _horizontalCoriolis; diff --git a/addons/atragmx/functions/fnc_calculate_target_range_assist.sqf b/addons/atragmx/functions/fnc_calculate_target_range_assist.sqf index e59cdee37d..3a1bd879f1 100644 --- a/addons/atragmx/functions/fnc_calculate_target_range_assist.sqf +++ b/addons/atragmx/functions/fnc_calculate_target_range_assist.sqf @@ -3,10 +3,10 @@ * Calculates the target range and updates the output fields * * Arguments: - * Nothing + * None * * Return Value: - * Nothing + * None * * Example: * call ace_atragmx_fnc_calculate_target_range_assist @@ -16,7 +16,7 @@ #include "script_component.hpp" private _angle = parseNumber(ctrlText 7012); -private _targetSize = parseNumber(ctrlText 7010); +private _targetSize = abs(parseNumber(ctrlText 7010)); if (GVAR(rangeAssistUseTargetHeight)) then { _targetSize = _targetSize * cos(_angle); }; @@ -43,7 +43,7 @@ switch (GVAR(rangeAssistImageSizeUnit)) do { _imageSize = _imageSize / 60 / 1.047; }; }; -private _estRange = parseNumber(ctrlText 7013); +private _estRange = abs(parseNumber(ctrlText 7013)); if (GVAR(currentUnit) == 1) then { _estRange = _estRange / 1.0936133; }; @@ -52,7 +52,7 @@ switch (_this) do { case 0: { _targetSize = tan(_imageSize) * _estRange; - if (GVAR(rangeAssistUseTargetHeight)) then { + if (GVAR(rangeAssistUseTargetHeight) && cos(_angle) != 0) then { _targetSize = _targetSize / cos(_angle); }; @@ -71,7 +71,9 @@ switch (_this) do { ctrlSetText [7010, Str(Round(_targetSize * 100) / 100)]; }; case 1: { - _imageSize = atan(_targetSize / _estRange); + if (_estRange > 0) then { + _imageSize = atan(_targetSize / _estRange); + }; switch (GVAR(rangeAssistImageSizeUnit)) do { case 0: { @@ -88,7 +90,9 @@ switch (_this) do { ctrlSetText [7011, Str(Round(_imageSize * 100) / 100)]; }; case 2: { - _estRange = _targetSize / tan(_imageSize); + if (tan(_imageSize) != 0) then { + _estRange = _targetSize / tan(_imageSize); + }; ctrlSetText [7013, Str(Round(_estRange))]; }; diff --git a/addons/atragmx/functions/fnc_calculate_target_solution.sqf b/addons/atragmx/functions/fnc_calculate_target_solution.sqf index 8bd844938f..4477025618 100644 --- a/addons/atragmx/functions/fnc_calculate_target_solution.sqf +++ b/addons/atragmx/functions/fnc_calculate_target_solution.sqf @@ -3,10 +3,10 @@ * Calculates the fireing solution and updates the result input/output fields * * Arguments: - * Nothing + * None * * Return Value: - * Nothing + * None * * Example: * call ace_atragmx_fnc_calculate_target_solution @@ -17,21 +17,19 @@ [] call FUNC(parse_input); -private ["_scopeBaseAngle"]; -_scopeBaseAngle = (GVAR(workingMemory) select 3); +private _scopeBaseAngle = (GVAR(workingMemory) select 3); -private ["_bulletMass", "_bulletDiameter", "_boreHeight", "_airFriction", "_barrelTwist", "_muzzleVelocity", "_bc", "_dragModel", "_atmosphereModel", "_twistDirection"]; -_bulletMass = GVAR(workingMemory) select 12; -_bulletDiameter = GVAR(workingMemory) select 13; -_boreHeight = GVAR(workingMemory) select 5; -_airFriction = GVAR(workingMemory) select 4; -_barrelTwist = GVAR(workingMemory) select 14; -_muzzleVelocity = GVAR(workingMemory) select 1; -_bc = GVAR(workingMemory) select 15; -_dragModel = GVAR(workingMemory) select 16; -_atmosphereModel = GVAR(workingMemory) select 17; +private _bulletMass = GVAR(workingMemory) select 12; +private _bulletDiameter = GVAR(workingMemory) select 13; +private _boreHeight = GVAR(workingMemory) select 5; +private _airFriction = GVAR(workingMemory) select 4; +private _barrelTwist = GVAR(workingMemory) select 14; +private _muzzleVelocity = GVAR(workingMemory) select 1; +private _bc = GVAR(workingMemory) select 15; +private _dragModel = GVAR(workingMemory) select 16; +private _atmosphereModel = GVAR(workingMemory) select 17; -_twistDirection = 0; +private _twistDirection = 0; if (_barrelTwist > 0) then { _twistDirection = 1; } else { @@ -41,38 +39,36 @@ if (_barrelTwist > 0) then { }; _barrelTwist = abs(_barrelTwist); -private ["_altitude", "_temperature", "_barometricPressure", "_relativeHumidity"]; -_altitude = GVAR(altitude); -_temperature = GVAR(temperature); -_barometricPressure = GVAR(barometricPressure); -_relativeHumidity = GVAR(relativeHumidity); +private _altitude = GVAR(altitude); +private _temperature = GVAR(temperature); +private _barometricPressure = GVAR(barometricPressure); +private _relativeHumidity = GVAR(relativeHumidity); if (!GVAR(atmosphereModeTBH)) then { _barometricPressure = 1013.25 * (1 - (0.0065 * _altitude) / (273.15 + _temperature + 0.0065 * _altitude)) ^ 5.255754495; - _relativeHumidity = 50; + _relativeHumidity = 0.5; }; -private ["_bulletLength", "_stabilityFactor"]; -_bulletLength = 45.72; -_stabilityFactor = 1.5; +private _bulletLength = 50 * _bulletMass / ((_bulletDiameter/2)^2); +private _stabilityFactor = 1.5; if (missionNamespace getVariable [QEGVAR(advanced_ballistics,enabled), false]) then { if (_bulletDiameter > 0 && _bulletLength > 0 && _bulletMass > 0 && _barrelTwist > 0) then { _stabilityFactor = [_bulletDiameter, _bulletLength, _bulletMass, _barrelTwist * 10, _muzzleVelocity, _temperature, _barometricPressure] call EFUNC(advanced_ballistics,calculateStabilityFactor); }; }; -private ["_latitude", "_directionOfFire", "_windSpeed1", "_windSpeed2", "_windDirection", "_inclinationAngle", "_targetSpeed", "_targetRange"]; -_latitude = GVAR(latitude) select GVAR(currentTarget); -_directionOfFire = GVAR(directionOfFire) select GVAR(currentTarget); -_windSpeed1 = GVAR(windSpeed1) select GVAR(currentTarget); -_windSpeed2 = GVAR(windSpeed2) select GVAR(currentTarget); -_windDirection = GVAR(windDirection) select GVAR(currentTarget); -_inclinationAngle = GVAR(inclinationAngle) select GVAR(currentTarget); -_targetSpeed = GVAR(targetSpeed) select GVAR(currentTarget); -_targetRange = GVAR(targetRange) select GVAR(currentTarget); +private _latitude = GVAR(latitude) select GVAR(currentTarget); +private _directionOfFire = GVAR(directionOfFire) select GVAR(currentTarget); +private _windSpeed1 = GVAR(windSpeed1) select GVAR(currentTarget); +private _windSpeed2 = GVAR(windSpeed2) select GVAR(currentTarget); +private _windDirection = GVAR(windDirection) select GVAR(currentTarget); +private _inclinationAngle = GVAR(inclinationAngle) select GVAR(currentTarget); +private _targetSpeed = GVAR(targetSpeed) select GVAR(currentTarget); +private _targetRange = GVAR(targetRange) select GVAR(currentTarget); -private ["_result"]; -_result = [_scopeBaseAngle, _bulletMass, _boreHeight, _airFriction, _muzzleVelocity, _temperature, _barometricPressure, _relativeHumidity, 1000, - [_windSpeed1, _windSpeed2], _windDirection, _inclinationAngle, _targetSpeed, _targetRange, _bc, _dragModel, _atmosphereModel, false, _stabilityFactor, _twistDirection, _latitude, _directionOfFire] call FUNC(calculate_solution); +GVAR(targetSolutionInput) = [_scopeBaseAngle, _bulletMass, _boreHeight, _airFriction, _muzzleVelocity, _temperature, _barometricPressure, _relativeHumidity, round(_muzzleVelocity), + [_windSpeed1, _windSpeed2], _windDirection, _inclinationAngle, _targetSpeed, _targetRange, _bc, _dragModel, _atmosphereModel, false, _stabilityFactor, _twistDirection, _latitude, _directionOfFire]; + +private _result = GVAR(targetSolutionInput) call FUNC(calculate_solution); GVAR(elevationOutput) set [GVAR(currentTarget), _result select 0]; GVAR(windage1Output) set [GVAR(currentTarget), (_result select 1) select 0]; @@ -80,5 +76,8 @@ GVAR(windage2Output) set [GVAR(currentTarget), (_result select 1) select 1]; GVAR(leadOutput) set [GVAR(currentTarget), _result select 2]; GVAR(tofOutput) set [GVAR(currentTarget), _result select 3]; GVAR(velocityOutput) set [GVAR(currentTarget), _result select 4]; +GVAR(verticalCoriolisOutput) set [GVAR(currentTarget), _result select 6]; +GVAR(horizontalCoriolisOutput) set [GVAR(currentTarget), _result select 7]; +GVAR(spinDriftOutput) set [GVAR(currentTarget), _result select 8]; [] call FUNC(update_result); diff --git a/addons/atragmx/functions/fnc_calculate_target_speed_assist.sqf b/addons/atragmx/functions/fnc_calculate_target_speed_assist.sqf index c3a4dac24f..eacefc9833 100644 --- a/addons/atragmx/functions/fnc_calculate_target_speed_assist.sqf +++ b/addons/atragmx/functions/fnc_calculate_target_speed_assist.sqf @@ -3,10 +3,10 @@ * Calculates the target speed and updates the output fields * * Arguments: - * Nothing + * None * * Return Value: - * Nothing + * None * * Example: * call ace_atragmx_fnc_calculate_target_speed_assist @@ -15,12 +15,10 @@ */ #include "script_component.hpp" -private ["_targetRange", "_numTicks", "_timeSecs", "_estSpeed"]; - -_targetRange = parseNumber(ctrlText 8004); -_numTicks = parseNumber(ctrlText 8005); -_timeSecs = parseNumber(ctrlText 8006); -_estSpeed = 0; +private _targetRange = parseNumber(ctrlText 8004); +private _numTicks = parseNumber(ctrlText 8005); +private _timeSecs = parseNumber(ctrlText 8006); +private _estSpeed = 0; if (GVAR(currentUnit) == 1) then { _targetRange = _targetRange / 1.0936133; diff --git a/addons/atragmx/functions/fnc_calculate_truing_drop.sqf b/addons/atragmx/functions/fnc_calculate_truing_drop.sqf new file mode 100644 index 0000000000..fa43ac73c2 --- /dev/null +++ b/addons/atragmx/functions/fnc_calculate_truing_drop.sqf @@ -0,0 +1,107 @@ +/* + * Author: Ruthberg + * Calculates the truing drop and updates the output fields + * + * Arguments: + * parse input + * + * Return Value: + * None + * + * Example: + * call ace_atragmx_fnc_calculate_truing_drop + * + * Public: No + */ +#include "script_component.hpp" + +private _parseInput = _this; + +private _transonicRange = GVAR(truingDropRangeData) select 0; +private _subsonicRange = GVAR(truingDropRangeData) select 1; +private _transonicDrop = GVAR(truingDropDropData) select 1; +private _subsonicDrop = GVAR(truingDropDropData) select 2; + +if (_parseInput) then { + _transonicRange = 0 max abs(parseNumber(ctrlText 18011)) min 4000; + _subsonicRange = 0 max abs(parseNumber(ctrlText 18012)) min 4000; + if (GVAR(currentUnit) != 2) then { + _transonicRange = _transonicRange * 0.9144; + _subsonicRange = _subsonicRange * 0.9144; + }; + _transonicRange = Round(_transonicRange); + _subsonicRange = Round(_subsonicRange); + + _subsonicRange = _transonicRange max _subsonicRange; + + _transonicDrop = -100 max parseNumber(ctrlText 18013) min 100; + _subsonicDrop = -100 max parseNumber(ctrlText 18014) min 100; + private _dropUnit = GVAR(currentScopeUnit); + if (_dropUnit == 3) then { + switch (GVAR(currentScopeClickUnit)) do { + case 0: { _dropUnit = 1; }; + case 1: { _dropUnit = 2; }; + case 2: { _dropUnit = 0; }; + }; + }; + switch (_dropUnit) do { + case 0: { + _transonicDrop = MRAD_TO_MOA(_transonicDrop); + _subsonicDrop = MRAD_TO_MOA(_subsonicDrop); + }; + case 2: { + _transonicDrop = _transonicDrop / 1.047; + _subsonicDrop = _subsonicDrop / 1.047; + }; + }; + _transonicDrop = Round(_transonicDrop * 100) / 100; + _subsonicDrop = Round(_subsonicDrop * 100) / 100; + + _subsonicDrop = _transonicDrop max _subsonicDrop; +}; + +if ((GVAR(truingDropDropData) select 0) == 0 || {!([_transonicRange, _subsonicRange] isEqualTo GVAR(truingDropRangeData))}) then { + if (isNil QGVAR(targetSolutionInput)) then { + call FUNC(calculate_target_solution); + }; + private _solutionInput = +GVAR(targetSolutionInput); + + if (_transonicRange == 0) then { + _transonicRange = Round(403 call FUNC(calculate_distance_at_velocity)); + }; + _solutionInput set [13, _transonicRange]; + private _result1 = _solutionInput call FUNC(calculate_solution); + _transonicDrop = Round((_result1 select 0) * 100) / 100; + GVAR(truingDropRangeData) set [0, _transonicRange]; + GVAR(truingDropDropData) set [1, _transonicDrop]; + GVAR(truingDropReferenceDropData) set [0, _transonicDrop]; + + private _speedOfSound = (_solutionInput select 5) call EFUNC(weather,calculateSpeedOfSound); + if (_subsonicRange == 0) then { + _subsonicRange = _speedOfSound call FUNC(calculate_distance_at_velocity); + if (GVAR(currentUnit) == 2) then { + _subsonicRange = _subsonicRange + 200; + } else { + _subsonicRange = _subsonicRange + 200 * 1.0936133; + }; + _subsonicRange = Round(_subsonicRange); + }; + _solutionInput set [13, _subsonicRange]; + private _result2 = _solutionInput call FUNC(calculate_solution); + _subsonicDrop = Round((_result2 select 0) * 100) / 100; + GVAR(truingDropRangeData) set [1, _subsonicRange]; + GVAR(truingDropDropData) set [2, _subsonicDrop]; + GVAR(truingDropReferenceDropData) set [1, _subsonicDrop]; +} else { + if (_transonicDrop != GVAR(truingDropDropData) select 1 || _subsonicDrop != GVAR(truingDropDropData) select 2) then { + GVAR(truingDropDropData) set [1, _transonicDrop]; + GVAR(truingDropDropData) set [2, _subsonicDrop]; + if (GVAR(truingDropMode) == 0) then { + call FUNC(true_muzzle_velocity); + } else { + call FUNC(true_c1_ballistic_coefficient); + }; + }; +}; + +call FUNC(update_truing_drop_data); diff --git a/addons/atragmx/functions/fnc_can_show.sqf b/addons/atragmx/functions/fnc_can_show.sqf index 7054e85cf9..bf05edee98 100644 --- a/addons/atragmx/functions/fnc_can_show.sqf +++ b/addons/atragmx/functions/fnc_can_show.sqf @@ -3,7 +3,7 @@ * Tests if the ATragMX dialog can be shown * * Arguments: - * Nothing + * None * * Return Value: * can_show diff --git a/addons/atragmx/functions/fnc_change_gun.sqf b/addons/atragmx/functions/fnc_change_gun.sqf index babd4e733c..53167f87b1 100644 --- a/addons/atragmx/functions/fnc_change_gun.sqf +++ b/addons/atragmx/functions/fnc_change_gun.sqf @@ -8,7 +8,7 @@ * update display * * Return Value: - * Nothing + * None * * Example: * call ace_atragmx_fnc_change_gun @@ -26,6 +26,12 @@ if (_restoreMemory) then { }; GVAR(currentGun) = _gunID; +[false, false] call FUNC(recalculate_muzzle_velocity); +if (missionNamespace getVariable [QEGVAR(advanced_ballistics,enabled), false]) then { + false call FUNC(restore_truing_drop); + [false, false] call FUNC(recalculate_c1_ballistic_coefficient); +}; + if (_updateDisplay) then { lbSetCurSel [6000, GVAR(currentGun)]; }; @@ -37,6 +43,8 @@ GVAR(currentScopeClickNumber) = 1 max (GVAR(workingMemory) select 8) min 10; if (_updateDisplay) then { [] call FUNC(update_gun); [] call FUNC(update_gun_ammo_data); + [] call FUNC(update_muzzle_velocity_data); + [] call FUNC(update_c1_ballistic_coefficient_data); }; GVAR(elevationOutput) set [GVAR(currentTarget), 0]; @@ -45,6 +53,9 @@ GVAR(windage2Output) set [GVAR(currentTarget), 0]; GVAR(leadOutput) set [GVAR(currentTarget), 0]; GVAR(tofOutput) set [GVAR(currentTarget), 0]; GVAR(velocityOutput) set [GVAR(currentTarget), 0]; +GVAR(verticalCoriolisOutput) set [GVAR(currentTarget), 0]; +GVAR(horizontalCoriolisOutput) set [GVAR(currentTarget), 0]; +GVAR(spinDriftOutput) set [GVAR(currentTarget), 0]; if (_updateDisplay) then { [] call FUNC(calculate_target_solution); diff --git a/addons/atragmx/functions/fnc_change_target_slot.sqf b/addons/atragmx/functions/fnc_change_target_slot.sqf index a867749f21..158e31ad87 100644 --- a/addons/atragmx/functions/fnc_change_target_slot.sqf +++ b/addons/atragmx/functions/fnc_change_target_slot.sqf @@ -6,7 +6,7 @@ * target * * Return Value: - * Nothing + * None * * Example: * 2 call ace_atragmx_fnc_change_target_slot @@ -17,9 +17,8 @@ private _target = 0 max _this min 3; -call FUNC(parse_input); +[] call FUNC(parse_input); GVAR(currentTarget) = _target; call FUNC(update_target_selection); - -[] call FUNC(calculate_target_solution); +call FUNC(calculate_target_solution); diff --git a/addons/atragmx/functions/fnc_clear_c1_ballistic_coefficient_data.sqf b/addons/atragmx/functions/fnc_clear_c1_ballistic_coefficient_data.sqf new file mode 100644 index 0000000000..a795b74c70 --- /dev/null +++ b/addons/atragmx/functions/fnc_clear_c1_ballistic_coefficient_data.sqf @@ -0,0 +1,21 @@ +/* + * Author: Ruthberg + * Clears the c1 ballistic coefficient data fields + * + * Arguments: + * None + * + * Return Value: + * None + * + * Example: + * call ace_atragmx_fnc_clear_c1_ballistic_coefficient_data + * + * Public: No + */ +#include "script_component.hpp" + +// Distances +{ctrlSetText [_x, "0"]} forEach [170021, 170022, 170023, 170024, 170025, 170026, 170027]; +// Ballistic Coefficients +{ctrlSetText [_x, "0"]} forEach [170031, 170032, 170033, 170034, 170035, 170036, 170037]; diff --git a/addons/atragmx/functions/fnc_clear_muzzle_velocity_data.sqf b/addons/atragmx/functions/fnc_clear_muzzle_velocity_data.sqf new file mode 100644 index 0000000000..6f4472c550 --- /dev/null +++ b/addons/atragmx/functions/fnc_clear_muzzle_velocity_data.sqf @@ -0,0 +1,21 @@ +/* + * Author: Ruthberg + * Clears the muzzle velocity data fields + * + * Arguments: + * None + * + * Return Value: + * None + * + * Example: + * call ace_atragmx_fnc_clear_muzzle_velocity_data + * + * Public: No + */ +#include "script_component.hpp" + +// Temperatures +{ctrlSetText [_x, "0"]} forEach [160021, 160022, 160023, 160024, 160025, 160026, 160027]; +// Muzzle velocities +{ctrlSetText [_x, "0"]} forEach [160031, 160032, 160033, 160034, 160035, 160036, 160037]; diff --git a/addons/atragmx/functions/fnc_clear_user_data.sqf b/addons/atragmx/functions/fnc_clear_user_data.sqf index 308b5bbf12..727c8da107 100644 --- a/addons/atragmx/functions/fnc_clear_user_data.sqf +++ b/addons/atragmx/functions/fnc_clear_user_data.sqf @@ -3,10 +3,10 @@ * Removes all user data from the profileNamespace * * Arguments: - * Nothing + * None * * Return Value: - * Nothing + * None * * Example: * call ace_atragmx_fnc_clear_user_data @@ -28,6 +28,7 @@ profileNamespace setVariable ["ACE_ATragMX_temperature", nil]; profileNamespace setVariable ["ACE_ATragMX_barometricPressure", nil]; profileNamespace setVariable ["ACE_ATragMX_relativeHumidity", nil]; +profileNamespace setVariable ["ACE_ATragMX_showCoriolis", nil]; profileNamespace setVariable ["ACE_ATragMX_showWind2", nil]; profileNamespace setVariable ["ACE_ATragMX_latitude", nil]; profileNamespace setVariable ["ACE_ATragMX_directionOfFire", nil]; @@ -42,4 +43,4 @@ profileNamespace setVariable ["ACE_ATragMX_targetRange", nil]; profileNamespace setVariable ["ACE_ATragMX_rangeCardStartRange", nil]; profileNamespace setVariable ["ACE_ATragMX_rangeCardEndRange", nil]; profileNamespace setVariable ["ACE_ATragMX_rangeCardIncrement", nil]; -profileNamespace setVariable ["ACE_ATragMX_rangeCardCurrentColumn", nil]; \ No newline at end of file +profileNamespace setVariable ["ACE_ATragMX_rangeCardCurrentColumn", nil]; diff --git a/addons/atragmx/functions/fnc_create_dialog.sqf b/addons/atragmx/functions/fnc_create_dialog.sqf index 2eee7c1824..c342bb1eb0 100644 --- a/addons/atragmx/functions/fnc_create_dialog.sqf +++ b/addons/atragmx/functions/fnc_create_dialog.sqf @@ -3,10 +3,10 @@ * Creates the ATragMX dialog * * Arguments: - * Nothing + * None * * Return Value: - * Nothing + * None * * Example: * call ace_atragmx_fnc_create_dialog @@ -18,6 +18,16 @@ #define __dsp (uiNamespace getVariable "ATragMX_Display") #define __ctrlBackground (__dsp displayCtrl 720000) +// Do all initialisation now +if (!GVAR(initialised)) then { + [] call FUNC(initGunList); + [] call FUNC(init); + [] call FUNC(restore_user_data); + [] call FUNC(read_gun_list_entries_from_config); + GVAR(initialised) = true; + TRACE_1("",GVAR(initialised)); +}; + if (GVAR(active)) exitWith { false }; if (underwater ACE_player) exitWith { false }; if (!("ACE_ATragMX" in (uniformItems ACE_player)) && !("ACE_ATragMX" in (vestItems ACE_player))) exitWith { false }; @@ -30,8 +40,10 @@ GVAR(showMainPage) call FUNC(show_main_page); GVAR(showAddNewGun) call FUNC(show_add_new_gun); GVAR(showAtmoEnvData) call FUNC(show_atmo_env_data); +GVAR(showC1BallisticCoefficientData) call FUNC(show_c1_ballistic_coefficient_data); GVAR(showGunAmmoData) call FUNC(show_gun_ammo_data); GVAR(showGunList) call FUNC(show_gun_list); +GVAR(showMuzzleVelocityData) call FUNC(show_muzzle_velocity_data); GVAR(showRangeCard) call FUNC(show_range_card); if (GVAR(showRangeCard)) then { ctrlSetFocus ((uiNamespace getVariable "ATragMX_Display") displayCtrl 5001); @@ -43,6 +55,7 @@ GVAR(showTargetData) call FUNC(show_target_data); GVAR(showTargetRangeAssist) call FUNC(show_target_range_assist); GVAR(showTargetSpeedAssist) call FUNC(show_target_speed_assist); GVAR(showTargetSpeedAssistTimer) call FUNC(show_target_speed_assist_timer); +GVAR(showTruingDrop) call FUNC(show_truing_drop); [GVAR(currentGun), false, true] call FUNC(change_gun); @@ -50,6 +63,13 @@ GVAR(showTargetSpeedAssistTimer) call FUNC(show_target_speed_assist_timer); lbAdd [6000, _x select 0]; } forEach GVAR(gunList); +ctrlShow [3001, false]; +ctrlShow [3002, false]; + +{ + (__dsp displayCtrl _x) ctrlEnable false; +} forEach [18006, 18007, 18008]; + GVAR(active) = true; GVAR(DialogPFH) = [{ diff --git a/addons/atragmx/functions/fnc_cycle_gun_list.sqf b/addons/atragmx/functions/fnc_cycle_gun_list.sqf index 1cc22abb45..550bc624f2 100644 --- a/addons/atragmx/functions/fnc_cycle_gun_list.sqf +++ b/addons/atragmx/functions/fnc_cycle_gun_list.sqf @@ -6,7 +6,7 @@ * step * * Return Value: - * Nothing + * None * * Example: * call ace_atragmx_fnc_cycle_scope_unit diff --git a/addons/atragmx/functions/fnc_cycle_image_size_units.sqf b/addons/atragmx/functions/fnc_cycle_image_size_units.sqf index ce91f818c6..2981a9a73e 100644 --- a/addons/atragmx/functions/fnc_cycle_image_size_units.sqf +++ b/addons/atragmx/functions/fnc_cycle_image_size_units.sqf @@ -6,7 +6,7 @@ * step * * Return Value: - * Nothing + * None * * Example: * call ace_atragmx_fnc_cycle_image_size_units diff --git a/addons/atragmx/functions/fnc_cycle_num_ticks_units.sqf b/addons/atragmx/functions/fnc_cycle_num_ticks_units.sqf index 49b4ad0ffa..fc4746ee56 100644 --- a/addons/atragmx/functions/fnc_cycle_num_ticks_units.sqf +++ b/addons/atragmx/functions/fnc_cycle_num_ticks_units.sqf @@ -6,7 +6,7 @@ * step * * Return Value: - * Nothing + * None * * Example: * call ace_atragmx_fnc_cycle_num_ticks_units diff --git a/addons/atragmx/functions/fnc_cycle_range_card_columns.sqf b/addons/atragmx/functions/fnc_cycle_range_card_columns.sqf index dc572ede19..dfba1f0574 100644 --- a/addons/atragmx/functions/fnc_cycle_range_card_columns.sqf +++ b/addons/atragmx/functions/fnc_cycle_range_card_columns.sqf @@ -3,10 +3,10 @@ * Cycles through the range card columns * * Arguments: - * Nothing + * None * * Return Value: - * Nothing + * None * * Example: * call ace_atragmx_fnc_cycle_range_card_columns diff --git a/addons/atragmx/functions/fnc_cycle_scope_unit.sqf b/addons/atragmx/functions/fnc_cycle_scope_unit.sqf index d83236bc78..a2020f4147 100644 --- a/addons/atragmx/functions/fnc_cycle_scope_unit.sqf +++ b/addons/atragmx/functions/fnc_cycle_scope_unit.sqf @@ -3,10 +3,10 @@ * Cycles through the scope units * * Arguments: - * Nothing + * None * * Return Value: - * Nothing + * None * * Example: * call ace_atragmx_fnc_cycle_scope_unit @@ -15,10 +15,10 @@ */ #include "script_component.hpp" -[] call FUNC(parse_input); - GVAR(currentScopeUnit) = (GVAR(currentScopeUnit) + 1) % (count GVAR(scopeUnits)); GVAR(workingMemory) set [6, GVAR(currentScopeUnit)]; +true call FUNC(show_main_page); + [] call FUNC(update_scope_unit); [] call FUNC(update_result); diff --git a/addons/atragmx/functions/fnc_cycle_target_size_units.sqf b/addons/atragmx/functions/fnc_cycle_target_size_units.sqf index f44d2a5343..267d4d5772 100644 --- a/addons/atragmx/functions/fnc_cycle_target_size_units.sqf +++ b/addons/atragmx/functions/fnc_cycle_target_size_units.sqf @@ -6,7 +6,7 @@ * step * * Return Value: - * Nothing + * None * * Example: * call ace_atragmx_fnc_cycle_target_size_units diff --git a/addons/atragmx/functions/fnc_cycle_target_speed_direction.sqf b/addons/atragmx/functions/fnc_cycle_target_speed_direction.sqf index 568dbcec53..e1e8282440 100644 --- a/addons/atragmx/functions/fnc_cycle_target_speed_direction.sqf +++ b/addons/atragmx/functions/fnc_cycle_target_speed_direction.sqf @@ -3,10 +3,10 @@ * Cycles through the target directions left/right * * Arguments: - * Nothing + * None * * Return Value: - * Nothing + * None * * Example: * call ace_atragmx_fnc_cycle_target_direction diff --git a/addons/atragmx/functions/fnc_delete_gun.sqf b/addons/atragmx/functions/fnc_delete_gun.sqf index 42970d7aab..55548527f1 100644 --- a/addons/atragmx/functions/fnc_delete_gun.sqf +++ b/addons/atragmx/functions/fnc_delete_gun.sqf @@ -3,10 +3,10 @@ * Deletes the currently selected gun profile from the profileNamespace * * Arguments: - * Nothing + * None * * Return Value: - * Nothing + * None * * Example: * call ace_atragmx_fnc_delete_gun @@ -28,4 +28,4 @@ GVAR(gunList) = GVAR(gunList) - [0]; lbDelete [6000, _index]; -profileNamespace setVariable ["ACE_ATragMX_gunList", GVAR(gunList)]; +call FUNC(store_gun_list); diff --git a/addons/atragmx/functions/fnc_evaluate_option_menu_input.sqf b/addons/atragmx/functions/fnc_evaluate_option_menu_input.sqf new file mode 100644 index 0000000000..2e4c9ef023 --- /dev/null +++ b/addons/atragmx/functions/fnc_evaluate_option_menu_input.sqf @@ -0,0 +1,30 @@ +/* + * Author: Ruthberg + * Evalutes input from the option menu + * + * Arguments: + * option menu id + * + * Return Value: + * None + * + * Example: + * 1 call ace_atragmx_fnc_evaluate_option_menu_input + * + * Public: No + */ +#include "script_component.hpp" + +params ["_optionID"]; + +switch (_optionID) do { + case 0: {}; // Accuracy 1st + case 1: { 0 call FUNC(toggle_muzzle_velocity_data); }; // MuzVel Table + case 2: { 0 call FUNC(toggle_c1_ballistic_coefficient_data); }; // Bal Coef Table + case 3: { 0 call FUNC(toggle_target_speed_assist); }; // Target Speed Est + case 4: { 0 call FUNC(toggle_target_range_assist); }; // Target Range Est + case 5: { 0 call FUNC(toggle_truing_drop); }; // Truing Drop + case 6: { 0 call FUNC(toggle_coriolis); }; // Show Coriolis + case 7: { 0 call FUNC(toggle_solution_setup); }; // Set Clicks + case 8: {}; // Gun Note +}; diff --git a/addons/atragmx/functions/fnc_init.sqf b/addons/atragmx/functions/fnc_init.sqf index 30b17ebf90..a574e946f8 100644 --- a/addons/atragmx/functions/fnc_init.sqf +++ b/addons/atragmx/functions/fnc_init.sqf @@ -3,10 +3,10 @@ * Inits all global variables with the default values * * Arguments: - * Nothing + * None * * Return Value: - * Nothing + * None * * Example: * call ace_atragmx_fnc_init @@ -15,7 +15,6 @@ */ #include "script_component.hpp" -GVAR(active) = false; GVAR(workingMemory) = +(GVAR(gunList) select 0); @@ -52,7 +51,7 @@ GVAR(atmosphereModeTBH) = true; GVAR(altitude) = 0; GVAR(temperature) = 15; GVAR(barometricPressure) = 1013.25; -GVAR(relativeHumidity) = 0.5; +GVAR(relativeHumidity) = 0.0; GVAR(latitude) = [38, 38, 38, 38]; GVAR(directionOfFire) = [0, 0, 0, 0]; @@ -65,18 +64,33 @@ GVAR(targetSpeedDirection) = [1, 1, 1, 1]; GVAR(targetRange) = [0, 0, 0, 0]; GVAR(showWind2) = false; +GVAR(showCoriolis) = false; GVAR(elevationOutput) = [0, 0, 0, 0]; GVAR(windage1Output) = [0, 0, 0, 0]; GVAR(windage2Output) = [0, 0, 0, 0]; GVAR(leadOutput) = [0, 0, 0, 0]; GVAR(tofOutput) = [0, 0, 0, 0]; GVAR(velocityOutput) = [0, 0, 0, 0]; +GVAR(verticalCoriolisOutput) = [0, 0, 0, 0]; +GVAR(horizontalCoriolisOutput) = [0, 0, 0, 0]; +GVAR(spinDriftOutput) = [0, 0, 0, 0]; + +GVAR(truingDropMode) = 0; +GVAR(truingDropRangeData) = [0, 0]; +GVAR(truingDropDropData) = [0, 0, 0]; +GVAR(truingDropReferenceDropData) = [0, 0, 0]; +GVAR(truingDropC1) = 0; +GVAR(truingDropMuzzleVelocity) = 0; + +GVAR(targetSolutionInput) = nil; GVAR(showMainPage) = true; GVAR(showAddNewGun) = false; GVAR(showAtmoEnvData) = false; +GVAR(showC1BallisticCoefficientData) = false; GVAR(showGunAmmoData) = false; GVAR(showGunList) = false; +GVAR(showMuzzleVelocityData) = false; GVAR(showRangeCard) = false; GVAR(showRangeCardSetup) = false; GVAR(showSolutionSetup) = false; @@ -84,3 +98,4 @@ GVAR(showTargetData) = false; GVAR(showTargetRangeAssist) = false; GVAR(showTargetSpeedAssist) = false; GVAR(showTargetSpeedAssistTimer) = false; +GVAR(showTruingDrop) = false; diff --git a/addons/atragmx/functions/fnc_initGunList.sqf b/addons/atragmx/functions/fnc_initGunList.sqf new file mode 100644 index 0000000000..6c61aee16b --- /dev/null +++ b/addons/atragmx/functions/fnc_initGunList.sqf @@ -0,0 +1,83 @@ +/* + * Author: Ruthberg + * Inits the gun list from user profile + * + * Arguments: + * None + * + * Return Value: + * None + * + * Example: + * call ace_atragmx_fnc_initGunList + * + * Public: No + */ +#include "script_component.hpp" + +LOG_2("Trying to load gunlist from profile [Version: %1][Count: %2]", profileNamespace getVariable [ARR_2(QGVAR(profileNamespaceVersion), 'none')], count (profileNamespace getVariable [ARR_2(QGVAR(gunList), [])])); + +private _resetGunList = true; +if ((profileNamespace getVariable ["ACE_ATragMX_profileNamespaceVersion", 0]) == ATRAGMX_PROFILE_NAMESPACE_VERSION && {count (profileNamespace getVariable ["ACE_ATragMX_gunList", []]) > 0}) then { + GVAR(gunList) = profileNamespace getVariable "ACE_ATragMX_gunList"; + _resetGunList = false; + { + // Verify each gun has correct param type + if (!(_x isEqualTypeArray ["", 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "", [], [], false])) exitWith { + _resetGunList = true; + }; + } forEach GVAR(gunList); +}; + +if (_resetGunList) then { + WARNING("Reseting Profile Gunlist"); + // Profile Name, Muzzle Velocity, Zero Range, Scope Base Angle, AirFriction, Bore Height, Scope Unit, Scope Click Unit, Scope Click Number, Maximum Elevation, Dialed Elevation, Dialed Windage, Mass, Bullet Diameter, Rifle Twist, BC, Drag Model, Atmosphere Model, Muzzle Velocity vs. Temperature Interpolation, C1 Ballistic Coefficient vs. Distance Interpolation, Persistent + GVAR(gunList) = [["12.7x108mm" , 812, 100, 0.0958029, -0.00063800, 8.89, 0, 2, 10, 120, 0, 0, 48.28, 12.7, 38.10, 0.630, 1, "ASM" , [[-15,793],[0,800],[10,807],[15,812],[25,826],[30,835],[35,846]] , [[0,0],[0,0],[0,0],[0,0],[0,0],[0,0],[0,0]], true], + + ["12.7x99mm AMAX" , 852, 100, 0.0907214, -0.00037397, 8.89, 0, 2, 10, 120, 0, 0, 48.60, 12.7, 38.10, 1.050, 1, "ASM" , [[-15,833],[0,840],[10,847],[15,852],[25,866],[30,875],[35,886]] , [[0,0],[0,0],[0,0],[0,0],[0,0],[0,0],[0,0]], true], + ["12.7x99mm" , 892, 100, 0.0879633, -0.00058679, 8.89, 0, 2, 10, 120, 0, 0, 41.92, 12.7, 38.10, 0.670, 1, "ASM" , [[-15,873],[0,880],[10,887],[15,892],[25,906],[30,915],[35,926]] , [[0,0],[0,0],[0,0],[0,0],[0,0],[0,0],[0,0]], true], + + ["12.7x54mm" , 299, 100, 0.3567550, -0.00019568, 6.60, 0, 2, 10, 120, 0, 0, 48.60, 12.7, 24.13, 1.050, 1, "ASM" , [[-15,297],[0,298],[10,299],[15,299],[25,301],[30,302],[35,303]] , [[0,0],[0,0],[0,0],[0,0],[0,0],[0,0],[0,0]], true], + + [".50 Beowulf" , 562, 100, 0.1425100, -0.00205896, 6.60, 0, 2, 10, 120, 0, 0, 21.71, 12.7, 50.80, 0.210, 1, "ASM" , [[-15,560],[0,561],[10,562],[15,562],[25,564],[30,565],[35,566]] , [[0,0],[0,0],[0,0],[0,0],[0,0],[0,0],[0,0]], true], + + [".408 CheyTac 305gr", 1059, 100, 0.0686329, -0.00065414, 7.37, 0, 2, 10, 120, 0, 0, 19.76, 10.4, 33.02, 0.569, 1, "ICAO", [[-15,1040],[0,1047],[10,1054],[15,1059],[25,1073],[30,1082],[35,1093]], [[0,0],[0,0],[0,0],[0,0],[0,0],[0,0],[0,0]], true], + [".408 CheyTac 419gr", 859, 100, 0.0816039, -0.00046249, 7.37, 0, 2, 10, 120, 0, 0, 27.15, 10.4, 33.02, 0.866, 1, "ICAO", [[-15,840],[0,847],[10,854],[15,859],[25,873],[30,882],[35,893]] , [[0,0],[0,0],[0,0],[0,0],[0,0],[0,0],[0,0]], true], + + ["9.3×64mm" , 862, 100, 0.0875873, -0.00110727, 8.13, 0, 2, 10, 120, 0, 0, 14.90, 9.30, 35.56, 0.368, 1, "ASM" , [[-15,843],[0,850],[10,857],[15,862],[25,876],[30,885],[35,896]] , [[0,0],[0,0],[0,0],[0,0],[0,0],[0,0],[0,0]], true], + + [".338LM 250gr" , 872, 100, 0.0809096, -0.00060841, 7.37, 0, 2, 10, 120, 0, 0, 16.20, 8.58, 25.40, 0.645, 1, "ICAO", [[-15,853],[0,860],[10,867],[15,872],[25,886],[30,895],[35,906]] , [[0,0],[0,0],[0,0],[0,0],[0,0],[0,0],[0,0]], true], + [".338LM 300gr" , 792, 100, 0.0890193, -0.00055706, 7.37, 0, 2, 10, 120, 0, 0, 19.44, 8.58, 25.40, 0.759, 1, "ICAO", [[-15,773],[0,780],[10,787],[15,792],[25,806],[30,815],[35,826]] , [[0,0],[0,0],[0,0],[0,0],[0,0],[0,0],[0,0]], true], + [".338LM API526" , 872, 100, 0.0810834, -0.00069220, 7.37, 0, 2, 10, 120, 0, 0, 16.39, 8.58, 25.40, 0.580, 1, "ICAO", [[-15,853],[0,860],[10,867],[15,872],[25,886],[30,895],[35,906]] , [[0,0],[0,0],[0,0],[0,0],[0,0],[0,0],[0,0]], true], + + [".300WM Mk248 Mod0" , 857, 100, 0.0825862, -0.00072468, 7.37, 0, 2, 10, 120, 0, 0, 12.31, 7.80, 25.40, 0.537, 1, "ICAO", [[-15,838],[0,845],[10,852],[15,857],[25,871],[30,880],[35,891]] , [[0,0],[0,0],[0,0],[0,0],[0,0],[0,0],[0,0]], true], + [".300WM Mk248 Mod1" , 839, 100, 0.0841417, -0.00063027, 7.37, 0, 2, 10, 120, 0, 0, 14.26, 7.80, 25.40, 0.619, 1, "ICAO", [[-15,820],[0,827],[10,834],[15,839],[25,853],[30,862],[35,873]] , [[0,0],[0,0],[0,0],[0,0],[0,0],[0,0],[0,0]], true], + [".300WM Berger OTM" , 792, 100, 0.0891300, -0.00055262, 7.37, 0, 2, 10, 120, 0, 0, 14.90, 7.80, 25.40, 0.715, 1, "ICAO", [[-15,773],[0,780],[10,787],[15,792],[25,806],[30,815],[35,826]] , [[0,0],[0,0],[0,0],[0,0],[0,0],[0,0],[0,0]], true], + + ["7.62x54mmR" , 812, 100, 0.0868171, -0.00102329, 7.11, 0, 2, 10, 120, 0, 0, 9.849, 7.92, 24.13, 0.400, 1, "ICAO", [[-15,793],[0,800],[10,807],[15,812],[25,826],[30,835],[35,846]] , [[0,0],[0,0],[0,0],[0,0],[0,0],[0,0],[0,0]], true], + + ["7.62x51mm M80" , 802, 100, 0.0909184, -0.00103711, 7.62, 0, 2, 10, 120, 0, 0, 9.461, 7.82, 25.40, 0.398, 1, "ICAO", [[-15,783],[0,790],[10,797],[15,802],[25,816],[30,825],[35,836]] , [[0,0],[0,0],[0,0],[0,0],[0,0],[0,0],[0,0]], true], + ["7.62x51mm M118LR" , 757, 100, 0.0958841, -0.00085157, 7.62, 0, 2, 10, 120, 0, 0, 11.34, 7.82, 25.40, 0.482, 1, "ICAO", [[-15,738],[0,745],[10,752],[15,757],[25,771],[30,780],[35,791]] , [[0,0],[0,0],[0,0],[0,0],[0,0],[0,0],[0,0]], true], + ["7.62x51mm Mk316" , 781, 100, 0.0928267, -0.00084311, 7.62, 0, 2, 10, 120, 0, 0, 11.34, 7.82, 25.40, 0.483, 1, "ICAO", [[-15,777],[0,778],[10,779],[15,781],[25,783],[30,785],[35,787]] , [[0,0],[0,0],[0,0],[0,0],[0,0],[0,0],[0,0]], true], + ["7.62x51mm Mk319" , 900, 100, 0.0811838, -0.00104515, 7.62, 0, 2, 10, 120, 0, 0, 8.424, 7.82, 25.40, 0.377, 1, "ICAO", [[-15,898],[0,899],[10,900],[15,900],[25,902],[30,903],[35,904]] , [[0,0],[0,0],[0,0],[0,0],[0,0],[0,0],[0,0]], true], + ["7.62x51mm M993" , 912, 100, 0.0803840, -0.00109390, 7.62, 0, 2, 10, 120, 0, 0, 8.230, 7.82, 25.40, 0.359, 1, "ICAO", [[-15,893],[0,900],[10,907],[15,912],[25,926],[30,935],[35,946]] , [[0,0],[0,0],[0,0],[0,0],[0,0],[0,0],[0,0]], true], + ["7.62x51mm Subsonic", 314, 100, 0.3344490, -0.00060194, 6.86, 0, 2, 10, 120, 0, 0, 12.96, 7.82, 25.40, 0.502, 1, "ICAO", [[-15,312],[0,313],[10,314],[15,314],[25,316],[30,317],[35,318]] , [[0,0],[0,0],[0,0],[0,0],[0,0],[0,0],[0,0]], true], + + ["7.62x39mm" , 708, 100, 0.1066160, -0.00154815, 7.62, 0, 2, 10, 120, 0, 0, 7.970, 7.82, 25.40, 0.275, 1, "ICAO", [[-15,689],[0,696],[10,703],[15,708],[25,722],[30,731],[35,742]] , [[0,0],[0,0],[0,0],[0,0],[0,0],[0,0],[0,0]], true], + + ["6.5x39mm" , 766, 100, 0.0872025, -0.00077363, 6.35, 0, 2, 10, 120, 0, 0, 7.970, 6.71, 22.86, 0.524, 1, "ICAO", [[-15,747],[0,754],[10,761],[15,766],[25,780],[30,789],[35,800]] , [[0,0],[0,0],[0,0],[0,0],[0,0],[0,0],[0,0]], true], + ["6.5x47mm Lapua" , 767, 100, 0.0868248, -0.00069003, 6.35, 0, 2, 10, 120, 0, 0, 9.007, 6.71, 22.86, 0.577, 1, "ICAO", [[-15,748],[0,755],[10,762],[15,767],[25,781],[30,790],[35,801]] , [[0,0],[0,0],[0,0],[0,0],[0,0],[0,0],[0,0]], true], + ["6.5mm Creedmor" , 822, 100, 0.0800956, -0.00062437, 6.35, 0, 2, 10, 120, 0, 0, 9.072, 6.71, 22.86, 0.632, 1, "ICAO", [[-15,803],[0,810],[10,817],[15,822],[25,836],[30,845],[35,856]] , [[0,0],[0,0],[0,0],[0,0],[0,0],[0,0],[0,0]], true], + + ["5.8x42mm DBP87" , 942, 100, 0.0916742, -0.00121087, 9.91, 0, 2, 10, 120, 0, 0, 4.150, 5.99, 24.40, 0.313, 1, "ICAO", [[-15,923],[0,930],[10,937],[15,942],[25,956],[30,965],[35,976]] , [[0,0],[0,0],[0,0],[0,0],[0,0],[0,0],[0,0]], true], + + ["5.56x45mm M855" , 862, 100, 0.0825404, -0.00130094, 7.11, 0, 2, 10, 120, 0, 0, 4.018, 5.70, 17.78, 0.302, 1, "ASM" , [[-15,843],[0,849],[10,857],[15,862],[25,876],[30,885],[35,898]] , [[0,0],[0,0],[0,0],[0,0],[0,0],[0,0],[0,0]], true], + ["5.56x45mm Mk262" , 812, 100, 0.0872422, -0.00111805, 7.11, 0, 2, 10, 120, 0, 0, 4.990, 5.70, 17.78, 0.361, 1, "ASM" , [[-15,793],[0,800],[10,807],[15,812],[25,826],[30,835],[35,846]] , [[0,0],[0,0],[0,0],[0,0],[0,0],[0,0],[0,0]], true], + ["5.56x45mm Mk318" , 872, 100, 0.0814490, -0.00125880, 7.11, 0, 2, 10, 120, 0, 0, 4.018, 5.70, 17.78, 0.307, 1, "ASM" , [[-15,853],[0,860],[10,867],[15,872],[25,886],[30,895],[35,906]] , [[0,0],[0,0],[0,0],[0,0],[0,0],[0,0],[0,0]], true], + ["5.56x45mm M995" , 861, 100, 0.0825279, -0.00126182, 7.11, 0, 2, 10, 120, 0, 0, 4.536, 5.70, 17.78, 0.310, 1, "ASM" , [[-15,842],[0,849],[10,856],[15,861],[25,875],[30,884],[35,895]] , [[0,0],[0,0],[0,0],[0,0],[0,0],[0,0],[0,0]], true], + + ["5.45x39mm 7N6M" , 727, 100, 0.0802286, -0.00119458, 3.81, 0, 2, 10, 120, 0, 0, 3.428, 5.59, 16.00, 0.336, 1, "ICAO", [[-15,708],[0,715],[10,722],[15,727],[25,741],[30,750],[35,761]], [[0,0],[0,0],[0,0],[0,0],[0,0],[0,0],[0,0]], true]]; + + [] call FUNC(clear_user_data); + profileNamespace setVariable ["ACE_ATragMX_gunList", GVAR(gunList)]; +}; diff --git a/addons/atragmx/functions/fnc_insert_c1_ballistic_coefficient_data.sqf b/addons/atragmx/functions/fnc_insert_c1_ballistic_coefficient_data.sqf new file mode 100644 index 0000000000..ba5a781813 --- /dev/null +++ b/addons/atragmx/functions/fnc_insert_c1_ballistic_coefficient_data.sqf @@ -0,0 +1,55 @@ +/* + * Author: Ruthberg + * Inserts entry in the c1 ballistic coefficient vs. distance interpolation table + * + * Arguments: + * transonic range - + * subsonic range - + * c1 ballistic coefficient - + * + * Return Value: + * None + * + * Example: + * [800, 0.485] call ace_atragmx_fnc_insert_c1_ballistic_coefficient_data + * + * Public: No + */ +#include "script_component.hpp" + +params ["_transonicRange", "_subsonicRange", "_c1"]; + +private _entries = {(_x select 1) > 0} count (GVAR(workingMemory) select 19); + +if (_entries > 0) then { + // Insert + private _insertIndex = 0; + private _minDiff = 10000; + { + if (_minDiff > 0 && {(((GVAR(workingMemory) select 19) select _forEachIndex) select 1) == 0}) then { + _insertIndex = _forEachIndex; + _minDiff = 0; + }; + private _tr = ((GVAR(workingMemory) select 19) select _forEachIndex) select 0; + private _diff = abs(_subsonicRange - _tr); + if (_diff == 0) exitWith { + _insertIndex = _forEachIndex; + }; + if (_diff < _minDiff) then { + _insertIndex = _forEachIndex; + _minDiff = _diff; + }; + } forEach (GVAR(workingMemory) select 19); + + (GVAR(workingMemory) select 19) set [_insertIndex, [_subsonicRange, 0.1 max _c1 min 2.0]]; +} else { + // Reset + private _zeroRange = GVAR(workingMemory) select 2; + private _bc = GVAR(workingMemory) select 15; + GVAR(workingMemory) set [19, [[0,0],[0,0],[0,0],[0,0],[0,0],[0,0],[0,0]]]; + (GVAR(workingMemory) select 19) set [0, [_zeroRange, _bc]]; + (GVAR(workingMemory) select 19) set [1, [_transonicRange + (_subsonicRange - _transonicRange) * 0.75, _bc]]; + (GVAR(workingMemory) select 19) set [2, [_subsonicRange, 0.1 max _c1 min 2.0]]; +}; + +call FUNC(update_c1_ballistic_coefficient_data); diff --git a/addons/atragmx/functions/fnc_insert_muzzle_velocity_data.sqf b/addons/atragmx/functions/fnc_insert_muzzle_velocity_data.sqf new file mode 100644 index 0000000000..43cd936beb --- /dev/null +++ b/addons/atragmx/functions/fnc_insert_muzzle_velocity_data.sqf @@ -0,0 +1,41 @@ +/* + * Author: Ruthberg + * Inserts entry in the muzzle velocity vs. temperature interpolation table + * + * Arguments: + * temperature - + * muzzle velocity - + * + * Return Value: + * None + * + * Example: + * [10, 800] call ace_atragmx_fnc_insert_muzzle_velocity_data + * + * Public: No + */ +#include "script_component.hpp" + +params ["_temperature", "_muzzleVelocity"]; + +private _insertIndex = 0; +private _minDiff = 1000; +{ + if (_minDiff > 0 && {(((GVAR(workingMemory) select 18) select _forEachIndex) select 1) == 0}) then { + _insertIndex = _forEachIndex; + _minDiff = 0; + }; + private _t = ((GVAR(workingMemory) select 18) select _forEachIndex) select 0; + private _diff = abs(_temperature - _t); + if (_diff == 0) exitWith { + _insertIndex = _forEachIndex; + }; + if (_diff < _minDiff) then { + _insertIndex = _forEachIndex; + _minDiff = _diff; + }; +} forEach (GVAR(workingMemory) select 18); + +(GVAR(workingMemory) select 18) set [_insertIndex, [_temperature, 0 max _muzzleVelocity min 1400]]; + +call FUNC(update_muzzle_velocity_data); diff --git a/addons/atragmx/functions/fnc_on_close_dialog.sqf b/addons/atragmx/functions/fnc_on_close_dialog.sqf index fca60574a9..1c96828b1a 100644 --- a/addons/atragmx/functions/fnc_on_close_dialog.sqf +++ b/addons/atragmx/functions/fnc_on_close_dialog.sqf @@ -1,5 +1,21 @@ +/* + * Author: ACE-Team + * On close Dialog + * + * Arguments: + * None + * + * Return Value: + * None + * + * Example: + * call ace_atragmx_fnc_on_close_dialog + * + * Public: No + */ + #include "script_component.hpp" uiNamespace setVariable ['ATragMX_Display', nil]; GVAR(active) = false; -[GVAR(DialogPFH)] call CBA_fnc_removePerFrameHandler; \ No newline at end of file +[GVAR(DialogPFH)] call CBA_fnc_removePerFrameHandler; diff --git a/addons/atragmx/functions/fnc_parse_input.sqf b/addons/atragmx/functions/fnc_parse_input.sqf index 61a8caea6a..05615d04e4 100644 --- a/addons/atragmx/functions/fnc_parse_input.sqf +++ b/addons/atragmx/functions/fnc_parse_input.sqf @@ -1,12 +1,12 @@ /* * Author: Ruthberg - * Parses all input fields in the gun, atmosphere and target column and the result input fields + * Parses all input fields in the gun-, atmosphere- and target column, the result input fields and the muzzle velocity data input fields * * Arguments: - * Nothing + * None * * Return Value: - * Nothing + * None * * Example: * call ace_atragmx_fnc_parse_input @@ -15,24 +15,99 @@ */ #include "script_component.hpp" -GVAR(altitude) = -1000 max parseNumber(ctrlText 130030) min 20000; -GVAR(temperature) = -50 max parseNumber(ctrlText 130040) min 160; -GVAR(barometricPressure) = 10 max parseNumber(ctrlText 130050) min 1350; -GVAR(relativeHumidity) = (0 max parseNumber(ctrlText 130060) min 100) / 100; +// Muzzle velocity vs. temperature interpolation data +{ + private _temperature = parseNumber(ctrlText _x); + if (GVAR(currentUnit) != 2) then { + _temperature = -50 max _temperature min 160; + _temperature = (_temperature - 32) / 1.8; + } else { + _temperature = -50 max _temperature min 71; + }; + ((GVAR(workingMemory) select 18) select _forEachIndex) set [0, _temperature]; +} forEach [160021, 160022, 160023, 160024, 160025, 160026, 160027]; +{ + private _muzzleVelocity = abs(parseNumber(ctrlText _x)); + if (_muzzleVelocity > 0) then { + if (GVAR(currentUnit) != 2) then { + _muzzleVelocity = 300 max _muzzleVelocity min 4500; + _muzzleVelocity = _muzzleVelocity * 0.3048; + } else { + _muzzleVelocity = 100 max _muzzleVelocity min 1400; + }; + }; + ((GVAR(workingMemory) select 18) select _forEachIndex) set [1, _muzzleVelocity]; +} forEach [160031, 160032, 160033, 160034, 160035, 160036, 160037]; + +// C1 coefficient vs. distance interpolation data +{ + private _distance = abs(parseNumber(ctrlText _x)); + if (_distance > 0) then { + if (GVAR(currentUnit) == 1) then { + _distance = 25 max _distance min 4000; + _distance = _distance * 0.9144; + } else { + _distance = 25 max _distance min 3700; + }; + }; + ((GVAR(workingMemory) select 19) select _forEachIndex) set [0, _distance]; +} forEach [170021, 170022, 170023, 170024, 170025, 170026, 170027]; +{ + private _c1 = abs(parseNumber(ctrlText _x)); + if (_c1 > 0) then { + _c1 = 0.1 max _c1 min 2.0; + }; + ((GVAR(workingMemory) select 19) select _forEachIndex) set [1, _c1]; +} forEach [170031, 170032, 170033, 170034, 170035, 170036, 170037]; + +GVAR(altitude) = parseNumber(ctrlText 130030); +GVAR(temperature) = parseNumber(ctrlText 130040); +GVAR(barometricPressure) = parseNumber(ctrlText 130050); +GVAR(relativeHumidity) = parseNumber(ctrlText 130060) / 100; if (GVAR(currentUnit) != 2) then { + GVAR(altitude) = -1000 max GVAR(altitude) min 20000; + GVAR(temperature) = -50 max GVAR(temperature) min 160; + GVAR(barometricPressure) = 10 max GVAR(barometricPressure) min 40; GVAR(altitude) = GVAR(altitude) * 0.3048; GVAR(temperature) = (GVAR(temperature) - 32) / 1.8; GVAR(barometricPressure) = GVAR(barometricPressure) * 33.86389; +} else { + GVAR(altitude) = -300 max GVAR(altitude) min 6100; + GVAR(temperature) = -50 max GVAR(temperature) min 71; + GVAR(barometricPressure) = 340 max GVAR(barometricPressure) min 1350; }; -private ["_inclinationAngleCosine", "_inclinationAngleDegree"]; +private _windSpeed1 = parseNumber(ctrlText 140020); +private _windSpeed2 = parseNumber(ctrlText 140021); +private _targetSpeed = parseNumber(ctrlText 140050); +private _targetRange = parseNumber(ctrlText 140060); +if (GVAR(currentUnit) != 2) then { + _windSpeed1 = 0 max _windSpeed1 min 50; + _windSpeed2 = 0 max _windSpeed2 min 50; + _targetSpeed = 0 max _targetSpeed min 50; + _windSpeed1 = _windSpeed1 * 0.44704; + _windSpeed2 = _windSpeed2 * 0.44704; + _targetSpeed = _targetSpeed * 0.44704; +} else { + _windSpeed1 = 0 max _windSpeed1 min 25; + _windSpeed2 = 0 max _windSpeed2 min 25; + _targetSpeed = 0 max _targetSpeed min 25; +}; +if (GVAR(currentUnit) == 1) then { + _targetRange = 25 max _targetRange min 4000; + _targetRange = _targetRange * 0.9144; +} else { + _targetRange = 25 max _targetRange min 3700; +}; GVAR(latitude) set [GVAR(currentTarget), -90 max Round(parseNumber(ctrlText 140000)) min 90]; GVAR(directionOfFire) set [GVAR(currentTarget), 0 max abs(Round(parseNumber(ctrlText 140010))) min 359]; -GVAR(windSpeed1) set [GVAR(currentTarget), 0 max abs(parseNumber(ctrlText 140020)) min 50]; -GVAR(windSpeed2) set [GVAR(currentTarget), 0 max abs(parseNumber(ctrlText 140021)) min 50]; +GVAR(windSpeed1) set [GVAR(currentTarget), _windSpeed1]; +GVAR(windSpeed2) set [GVAR(currentTarget), _windSpeed2]; GVAR(windDirection) set [GVAR(currentTarget), 1 max Round(parseNumber(ctrlText 140030)) min 12]; -_inclinationAngleCosine = 0.5 max parseNumber(ctrlText 140041) min 1; -_inclinationAngleDegree = -60 max round(parseNumber(ctrlText 140040)) min 60; +GVAR(targetSpeed) set [GVAR(currentTarget), _targetSpeed]; +GVAR(targetRange) set [GVAR(currentTarget), _targetRange]; +private _inclinationAngleCosine = 0.5 max parseNumber(ctrlText 140041) min 1; +private _inclinationAngleDegree = -60 max round(parseNumber(ctrlText 140040)) min 60; if (_inclinationAngleDegree != GVAR(inclinationAngle) select GVAR(currentTarget)) then { GVAR(inclinationAngle) set [GVAR(currentTarget), _inclinationAngleDegree]; } else { @@ -40,58 +115,61 @@ if (_inclinationAngleDegree != GVAR(inclinationAngle) select GVAR(currentTarget) GVAR(inclinationAngle) set [GVAR(currentTarget), round(acos(_inclinationAngleCosine))]; }; }; -GVAR(targetSpeed) set [GVAR(currentTarget), 0 max abs(parseNumber(ctrlText 140050)) min 50]; if ((ctrlText 140051) == ">") then { GVAR(targetSpeedDirection) set [GVAR(currentTarget), +1]; } else { GVAR(targetSpeedDirection) set [GVAR(currentTarget), -1]; }; -GVAR(targetRange) set [GVAR(currentTarget), 0 max abs(parseNumber(ctrlText 140060)) min 4000]; -if (GVAR(currentUnit) != 2) then { - GVAR(windSpeed1) set [GVAR(currentTarget), (GVAR(windSpeed1) select GVAR(currentTarget)) * 0.44704]; - GVAR(windSpeed2) set [GVAR(currentTarget), (GVAR(windSpeed2) select GVAR(currentTarget)) * 0.44704]; - GVAR(targetSpeed) set [GVAR(currentTarget), (GVAR(targetSpeed) select GVAR(currentTarget)) * 0.44704]; -}; -if (GVAR(currentUnit) == 1) then { - GVAR(targetRange) set [GVAR(currentTarget), (GVAR(targetRange) select GVAR(currentTarget)) * 0.9144]; -}; -private ["_boreHeight", "_bulletMass", "_bulletDiameter", "_airFriction", "_rifleTwist", "_muzzleVelocity", "_zeroRange"]; -_boreHeight = parseNumber(ctrlText 120000); -_bulletMass = parseNumber(ctrlText 120010); -_bulletDiameter = parseNumber(ctrlText 120020) * 10; +private _boreHeight = parseNumber(ctrlText 120000); +private _bulletMass = parseNumber(ctrlText 120010); +private _bulletDiameter = parseNumber(ctrlText 120020); +private _airFriction = parseNumber(ctrlText 120030); if (missionNamespace getVariable [QEGVAR(advanced_ballistics,enabled), false]) then { - _airFriction = 0.1 max parseNumber(ctrlText 120030) min 2; + _airFriction = 0.1 max _airFriction min 2; } else { - _airFriction = parseNumber(ctrlText 120030) / -1000; + _airFriction = _airFriction / -1000; }; -_rifleTwist = parseNumber(ctrlText 120040); -_muzzleVelocity = parseNumber(ctrlText 120050); -_zeroRange = parseNumber (ctrlText 120060); +private _rifleTwist = parseNumber(ctrlText 120040); +private _muzzleVelocity = parseNumber(ctrlText 120050); +private _zeroRange = parseNumber(ctrlText 120060); if (GVAR(currentUnit) != 2) then { + _boreHeight = 0.1 max _boreHeight min 5; + _bulletMass = 1 max _bulletMass min 1500; + _bulletDiameter = 0.1 max _bulletDiameter min 1.0; + _rifleTwist = 1 max _rifleTwist min 36; + _muzzleVelocity = 300 max _muzzleVelocity min 4500; _boreHeight = _boreHeight * 2.54; _bulletMass = _bulletMass * 0.06479891; _bulletDiameter = _bulletDiameter * 2.54; _rifleTwist = _rifleTwist * 2.54; - _muzzleVelocity = _muzzleVelocity / 3.2808399; + _muzzleVelocity = _muzzleVelocity * 0.3048; +} else { + _boreHeight = 0.1 max _boreHeight min 10; + _bulletMass = 1 max _bulletMass min 100; + _bulletDiameter = 0.1 max _bulletDiameter min 2.5; + _rifleTwist = 1 max _rifleTwist min 75; + _muzzleVelocity = 100 max _muzzleVelocity min 1400; }; +_zeroRange = 25 max _zeroRange min 1000; if (GVAR(currentUnit) == 1) then { - _zeroRange = _zeroRange / 1.0936133; + _zeroRange = _zeroRange * 0.9144; }; -_boreHeight = 0.1 max _boreHeight min 10; -_bulletMass = 1 max _bulletMass min 100; -_bulletDiameter = 1 max _bulletDiameter min 25; -_muzzleVelocity = 100 max _muzzleVelocity min 1400; -_zeroRange = 0 max _zeroRange min 1000; GVAR(workingMemory) set [5, _boreHeight]; GVAR(workingMemory) set [12, _bulletMass]; -GVAR(workingMemory) set [13, _bulletDiameter]; +GVAR(workingMemory) set [13, _bulletDiameter * 10]; GVAR(workingMemory) set [14, _rifleTwist]; if (missionNamespace getVariable [QEGVAR(advanced_ballistics,enabled), false]) then { + if (_airFriction != GVAR(workingMemory) select 15) then { + (_airFriction - (GVAR(workingMemory) select 15)) call FUNC(shift_c1_ballistic_coefficient_data); + }; GVAR(workingMemory) set [15, _airFriction]; } else { GVAR(workingMemory) set [4, _airFriction]; }; +if (_muzzleVelocity != GVAR(workingMemory) select 1) then { + (_muzzleVelocity - (GVAR(workingMemory) select 1)) call FUNC(shift_muzzle_velocity_data); +}; GVAR(workingMemory) set [1, _muzzleVelocity]; GVAR(workingMemory) set [2, _zeroRange]; @@ -101,5 +179,7 @@ GVAR(workingMemory) set [2, _zeroRange]; [] call FUNC(update_atmo_env_data); [] call FUNC(update_target); [] call FUNC(update_target_data); +[] call FUNC(update_muzzle_velocity_data); +[] call FUNC(update_c1_ballistic_coefficient_data); [] call FUNC(store_user_data); diff --git a/addons/atragmx/functions/fnc_read_gun_list_entries_from_config.sqf b/addons/atragmx/functions/fnc_read_gun_list_entries_from_config.sqf new file mode 100644 index 0000000000..4d99a5637f --- /dev/null +++ b/addons/atragmx/functions/fnc_read_gun_list_entries_from_config.sqf @@ -0,0 +1,123 @@ +/* + * Author: Ruthberg + * Reads gun list entries from the config and appends them to the gun list + * + * Arguments: + * None + * + * Return Value: + * None + * + * Example: + * call ace_atragmx_fnc_read_gun_list_entries_from_config + * + * Public: No + */ +#include "script_component.hpp" + +private _validate_preset = { + private _valid = true; + if (count _this != 20) then { + private _errorMsg = format ["Invalid preset array size: %1", count _this]; + ERROR(_errorMsg); + _valid = false; + }; + if (_this select 0 == "") then { + ERROR("Invalid gun profile name"); + _valid = false; + }; + if (count (_this select 0) > 14) then { + WARNING("Gun profile name too long (max. allowed 14 characters)"); + }; + if (_this select 1 < 0 || _this select 1 > 1400) then { + private _errorMsg = format ["Invalid muzzle velocity: %1", _this select 1]; + ERROR(_errorMsg); + _valid = false; + }; + if (_this select 2 < 25 || _this select 2 > 1000) then { + private _errorMsg = format ["Invalid zero range: %1", _this select 2]; + ERROR(_errorMsg); + _valid = false; + }; + if (_this select 4 > 0) then { + private _errorMsg = format ["Invalid airFriction value: %1", _this select 4]; + ERROR(_errorMsg); + _valid = false; + }; + if (_this select 5 < 0.1 || _this select 5 > 10) then { + private _errorMsg = format ["Invalid bore height value: %1", _this select 4]; + ERROR(_errorMsg); + _valid = false; + }; + if (_this select 12 < 1 || _this select 12 > 100) then { + private _errorMsg = format ["Invalid bullet weight: %1", _this select 12]; + ERROR(_errorMsg); + _valid = false; + }; + if (_this select 13 < 1 || _this select 13 > 25) then { + private _errorMsg = format ["Invalid bullet diameter: %1", _this select 13]; + ERROR(_errorMsg); + _valid = false; + }; + if (_this select 14 < 1 || _this select 14 > 75) then { + private _errorMsg = format ["Invalid rifle twist: %1", _this select 14]; + ERROR(_errorMsg); + _valid = false; + }; + if (_this select 15 < 0.1 || _this select 15 > 2.0) then { + private _errorMsg = format ["Invalid ballistic coefficient: %1", _this select 15]; + ERROR(_errorMsg); + _valid = false; + }; + if (_this select 16 != 1) then { + private _errorMsg = format ["Invalid drag model: %1", _this select 16]; + ERROR(_errorMsg); + _valid = false; + }; + if (!((_this select 17) in ["ASM", "ICAO"])) then { + private _errorMsg = format ["Invalid atmosphere model: %1", _this select 17]; + ERROR(_errorMsg); + _valid = false; + }; + if (count (_this select 18) != 7) then { + private _errorMsg = format ["Invalid muzzle velocity table array size: %1", count (_this select 18)]; + ERROR(_errorMsg); + _valid = false; + } else { + { + if (count _x != 2) exitWith { + private _errorMsg = format ["Invalid muzzle velocity table subarray size: %1", count _x]; + ERROR(_errorMsg); + _valid = false; + }; + } forEach (_this select 18); + }; + if (count (_this select 19) != 7) then { + private _errorMsg = format ["Invalid drag coefficient table array size: %1", count (_this select 19)]; + ERROR(_errorMsg); + _valid = false; + } else { + { + if (count _x != 2) exitWith { + private _errorMsg = format ["Invalid drag coefficient table subarray size: %1", count _x]; + ERROR(_errorMsg); + _valid = false; + }; + } forEach (_this select 19); + }; + _valid +}; + +{ + private _preset = _x >> "preset"; + + if (isArray(_preset)) then { + private _gun = getArray _preset; + + if (_gun call _validate_preset) then { + _gun set [0, (_gun select 0) select [0, 14]]; + _gun set [20, false]; + GVAR(gunList) = GVAR(gunList) + [_gun]; + }; + }; +} forEach ("true" configClasses (configFile >> "ACE_ATragMX_Presets")); diff --git a/addons/atragmx/functions/fnc_recalculate_c1_ballistic_coefficient.sqf b/addons/atragmx/functions/fnc_recalculate_c1_ballistic_coefficient.sqf new file mode 100644 index 0000000000..ee67a6b93c --- /dev/null +++ b/addons/atragmx/functions/fnc_recalculate_c1_ballistic_coefficient.sqf @@ -0,0 +1,62 @@ +/* + * Author: Ruthberg + * Recalculates the c1 ballistic coefficient based on the c1 ballistic coefficient vs. distance interpolation input + * + * Arguments: + * parse input + * update display + * + * Return Value: + * None + * + * Example: + * call ace_atragmx_fnc_recalculate_c1_ballistic_coefficient + * + * Public: No + */ +#include "script_component.hpp" + +params ["_parseInput", "_updateDisplay"]; + +if (_parseInput) then { + [] call FUNC(parse_input); +}; + +private _lookupTable = []; +{ + if ((_x select 1) > 0) then { + _lookupTable pushBack _x; + }; +} forEach (GVAR(workingMemory) select 19); + +private _lookupTableSize = count _lookupTable; +if (_lookupTableSize < 2) exitWith {}; +_lookupTable sort true; + +private _lowerIndex = -1; +private _upperIndex = -1; + +for "_index" from 1 to (_lookupTableSize - 1) do { + _upperIndex = _index; + _lowerIndex = _upperIndex - 1; + if (((_lookupTable select _index) select 0) >= (GVAR(targetRange) select GVAR(currentTarget))) exitWith {}; +}; + +private _lowerDistance = (_lookupTable select _lowerIndex) select 0; +private _upperDistance = (_lookupTable select _upperIndex) select 0; +private _lowerC1 = (_lookupTable select _lowerIndex) select 1; +private _upperC1 = (_lookupTable select _upperIndex) select 1; +private _c1 = _lowerC1; +if (_lowerDistance != _upperDistance) then { + private _slope = (_upperC1 - _lowerC1) / (_upperDistance - _lowerDistance); + _c1 = _lowerC1 + ((GVAR(targetRange) select GVAR(currentTarget)) - _lowerDistance) * _slope; +}; +_c1 = 0.1 max _c1 min 2.0; + +if (_c1 != GVAR(workingMemory) select 15) then { + GVAR(workingMemory) set [15, _c1]; + if (_updateDisplay) then { + call FUNC(update_gun); + call FUNC(update_gun_ammo_data); + }; +}; diff --git a/addons/atragmx/functions/fnc_recalculate_muzzle_velocity.sqf b/addons/atragmx/functions/fnc_recalculate_muzzle_velocity.sqf new file mode 100644 index 0000000000..e4e3cd70c6 --- /dev/null +++ b/addons/atragmx/functions/fnc_recalculate_muzzle_velocity.sqf @@ -0,0 +1,61 @@ +/* + * Author: Ruthberg + * Recalculates the muzzle velocity based on the muzzle velocity vs. temperature interpolation input + * + * Arguments: + * parse input + * update display + * + * Return Value: + * None + * + * Example: + * call ace_atragmx_fnc_recalculate_muzzle_velocity + * + * Public: No + */ +#include "script_component.hpp" + +params ["_parseInput", "_updateDisplay"]; + +if (_parseInput) then { + [] call FUNC(parse_input); +}; + +private _lookupTable = []; +{ + if ((_x select 1) > 0) then { + _lookupTable pushBack _x; + }; +} forEach (GVAR(workingMemory) select 18); + +private _lookupTableSize = count _lookupTable; +if (_lookupTableSize < 2) exitWith {}; +_lookupTable sort true; + +private _lowerIndex = -1; +private _upperIndex = -1; +for "_index" from 1 to (_lookupTableSize - 1) do { + _upperIndex = _index; + _lowerIndex = _upperIndex - 1; + if (((_lookupTable select _index) select 0) >= GVAR(temperature)) exitWith {}; +}; + +private _lowerTemperature = (_lookupTable select _lowerIndex) select 0; +private _upperTemperature = (_lookupTable select _upperIndex) select 0; +private _lowerMuzzleVelocity = (_lookupTable select _lowerIndex) select 1; +private _upperMuzzleVelocity = (_lookupTable select _upperIndex) select 1; +private _muzzleVelocity = _lowerMuzzleVelocity; +if (_lowerTemperature != _upperTemperature) then { + private _slope = (_upperMuzzleVelocity - _lowerMuzzleVelocity) / (_upperTemperature - _lowerTemperature); + _muzzleVelocity = _lowerMuzzleVelocity + (GVAR(temperature) - _lowerTemperature) * _slope; +}; +_muzzleVelocity = 100 max _muzzleVelocity min 1400; + +if (_muzzleVelocity != GVAR(workingMemory) select 1) then { + GVAR(workingMemory) set [1, _muzzleVelocity]; + if (_updateDisplay) then { + call FUNC(update_gun); + call FUNC(update_gun_ammo_data); + }; +}; diff --git a/addons/atragmx/functions/fnc_reset_relative_click_memory.sqf b/addons/atragmx/functions/fnc_reset_relative_click_memory.sqf index 489e832ea2..85d8ff6bc6 100644 --- a/addons/atragmx/functions/fnc_reset_relative_click_memory.sqf +++ b/addons/atragmx/functions/fnc_reset_relative_click_memory.sqf @@ -3,10 +3,10 @@ * Resets the relative click memory and updates the result input/output fields * * Arguments: - * Nothing + * None * * Return Value: - * Nothing + * None * * Example: * call ace_atragmx_fnc_reset_relative_click_memory diff --git a/addons/atragmx/functions/fnc_restore_atmo_default.sqf b/addons/atragmx/functions/fnc_restore_atmo_default.sqf index 08b7c56d86..d644f81630 100644 --- a/addons/atragmx/functions/fnc_restore_atmo_default.sqf +++ b/addons/atragmx/functions/fnc_restore_atmo_default.sqf @@ -3,10 +3,10 @@ * Restores the atmospheric data defaults * * Arguments: - * Nothing + * None * * Return Value: - * Nothing + * None * * Example: * call ace_atragmx_fnc_restore_atmo_default @@ -19,7 +19,7 @@ GVAR(atmosphereModeTBH) = true; GVAR(altitude) = 0; GVAR(temperature) = 15; GVAR(barometricPressure) = 1013.25; -GVAR(relativeHumidity) = 0.5; +GVAR(relativeHumidity) = 0.0; [] call FUNC(update_atmo_selection); [] call FUNC(update_atmosphere); diff --git a/addons/atragmx/functions/fnc_restore_truing_drop.sqf b/addons/atragmx/functions/fnc_restore_truing_drop.sqf new file mode 100644 index 0000000000..a3fb516f23 --- /dev/null +++ b/addons/atragmx/functions/fnc_restore_truing_drop.sqf @@ -0,0 +1,33 @@ +/* + * Author: Ruthberg + * Restores the truing drop defaults + * + * Arguments: + * update display + * + * Return Value: + * None + * + * Example: + * call ace_atragmx_fnc_restore_truing_drop + * + * Public: No + */ +#include "script_component.hpp" + +private _updateDisplay = _this; + +GVAR(truingDropMode) = 0; +GVAR(truingDropRangeData) = [0, 0]; +GVAR(truingDropDropData) = [0, 0, 0]; +GVAR(truingDropReferenceDropData) = [0, 0, 0]; +GVAR(truingDropC1) = 0; +GVAR(truingDropMuzzleVelocity) = 0; + +// Resets input fields +call FUNC(update_truing_drop_selection); + +if (_updateDisplay) then { + // Repopulates input fields + false call FUNC(calculate_truing_drop); +}; diff --git a/addons/atragmx/functions/fnc_restore_user_data.sqf b/addons/atragmx/functions/fnc_restore_user_data.sqf index 896455ec7a..a90c537f91 100644 --- a/addons/atragmx/functions/fnc_restore_user_data.sqf +++ b/addons/atragmx/functions/fnc_restore_user_data.sqf @@ -3,10 +3,10 @@ * Reads user data from profileNamespace * * Arguments: - * Nothing + * None * * Return Value: - * Nothing + * None * * Example: * call ace_atragmx_fnc_restore_user_data @@ -23,9 +23,10 @@ GVAR(atmosphereModeTBH) = profileNamespace getVariable ["ACE_ATragMX_atmosphereM GVAR(altitude) = -1000 max (profileNamespace getVariable ["ACE_ATragMX_altitude", 0]) min 20000; GVAR(temperature) = -50 max (profileNamespace getVariable ["ACE_ATragMX_temperature", 15]) min 160; GVAR(barometricPressure) = 340 max (profileNamespace getVariable ["ACE_ATragMX_barometricPressure", 1013.25]) min 1350; -GVAR(relativeHumidity) = 0 max (profileNamespace getVariable ["ACE_ATragMX_relativeHumidity", 0.5]) min 1; +GVAR(relativeHumidity) = 0 max (profileNamespace getVariable ["ACE_ATragMX_relativeHumidity", 0.0]) min 1; GVAR(showWind2) = profileNamespace getVariable ["ACE_ATragMX_showWind2", false]; +GVAR(showCoriolis) = profileNamespace getVariable ["ACE_ATragMX_showCoriolis", true]; GVAR(latitude) = profileNamespace getVariable ["ACE_ATragMX_latitude", [38, 38, 38, 38]]; GVAR(directionOfFire) = profileNamespace getVariable ["ACE_ATragMX_directionOfFire", [0, 0, 0, 0]]; GVAR(windSpeed1) = profileNamespace getVariable ["ACE_ATragMX_windSpeed1", [0, 0, 0, 0]]; diff --git a/addons/atragmx/functions/fnc_save_gun.sqf b/addons/atragmx/functions/fnc_save_gun.sqf index 64fe17e4c4..45558d3de3 100644 --- a/addons/atragmx/functions/fnc_save_gun.sqf +++ b/addons/atragmx/functions/fnc_save_gun.sqf @@ -3,10 +3,10 @@ * Saves the currently select gun profile into the profileNamespace * * Arguments: - * Nothing + * None * * Return Value: - * Nothing + * None * * Example: * call ace_atragmx_fnc_save_gun @@ -15,8 +15,7 @@ */ #include "script_component.hpp" -private ["_index"]; -_index = 0 max (lbCurSel 6000); +private _index = 0 max (lbCurSel 6000); GVAR(gunList) set [_index, +GVAR(workingMemory)]; @@ -25,4 +24,4 @@ lbClear 6000; lbAdd [6000, _x select 0]; } forEach GVAR(gunList); -profileNamespace setVariable ["ACE_ATragMX_gunList", GVAR(gunList)]; +call FUNC(store_gun_list); diff --git a/addons/atragmx/functions/fnc_shift_c1_ballistic_coefficient_data.sqf b/addons/atragmx/functions/fnc_shift_c1_ballistic_coefficient_data.sqf new file mode 100644 index 0000000000..89667e25b9 --- /dev/null +++ b/addons/atragmx/functions/fnc_shift_c1_ballistic_coefficient_data.sqf @@ -0,0 +1,25 @@ +/* + * Author: Ruthberg + * Shifts all c1 ballistic coefficient entries in the c1 ballistic coefficient vs. distance interpolation table + * + * Arguments: + * ballistic coefficient - + * + * Return Value: + * None + * + * Example: + * 10 call ace_atragmx_fnc_shift_c1_ballistic_coefficient_data + * + * Public: No + */ +#include "script_component.hpp" + +if (_this == 0) exitWith {}; + +{ + private _c1 = _x select 1; + if (_c1 > 0) then { + ((GVAR(workingMemory) select 19) select _forEachIndex) set [1, 0.1 max (_c1 + _this) min 2]; + } +} forEach (GVAR(workingMemory) select 19); diff --git a/addons/atragmx/functions/fnc_shift_muzzle_velocity_data.sqf b/addons/atragmx/functions/fnc_shift_muzzle_velocity_data.sqf new file mode 100644 index 0000000000..75fcc9c3a6 --- /dev/null +++ b/addons/atragmx/functions/fnc_shift_muzzle_velocity_data.sqf @@ -0,0 +1,25 @@ +/* + * Author: Ruthberg + * Shifts all muzzle velocity entries in the muzzle velocity vs. temperature interpolation table + * + * Arguments: + * velocity - + * + * Return Value: + * None + * + * Example: + * 10 call ace_atragmx_fnc_shift_muzzle_velocity_data + * + * Public: No + */ +#include "script_component.hpp" + +if (_this == 0) exitWith {}; + +{ + private _velocity = _x select 1; + if (_velocity > 0) then { + ((GVAR(workingMemory) select 18) select _forEachIndex) set [1, 0 max (_velocity + _this) min 1400]; + } +} forEach (GVAR(workingMemory) select 18); diff --git a/addons/atragmx/functions/fnc_show_add_new_gun.sqf b/addons/atragmx/functions/fnc_show_add_new_gun.sqf index b5b0f29a18..a5d4fd8b8b 100644 --- a/addons/atragmx/functions/fnc_show_add_new_gun.sqf +++ b/addons/atragmx/functions/fnc_show_add_new_gun.sqf @@ -6,10 +6,10 @@ * visible - * * Return Value: - * Nothing + * None * * Example: - * call ace_atragmx_fnc_show_add_new_gun + * false call ace_atragmx_fnc_show_add_new_gun * * Public: No */ diff --git a/addons/atragmx/functions/fnc_show_atmo_env_data.sqf b/addons/atragmx/functions/fnc_show_atmo_env_data.sqf index 56f75f7844..75dcaad502 100644 --- a/addons/atragmx/functions/fnc_show_atmo_env_data.sqf +++ b/addons/atragmx/functions/fnc_show_atmo_env_data.sqf @@ -6,7 +6,7 @@ * visible - * * Return Value: - * Nothing + * None * * Example: * false call ace_atragmx_fnc_show_atmo_env_data diff --git a/addons/atragmx/functions/fnc_show_c1_ballistic_coefficient_data.sqf b/addons/atragmx/functions/fnc_show_c1_ballistic_coefficient_data.sqf new file mode 100644 index 0000000000..797f0498fe --- /dev/null +++ b/addons/atragmx/functions/fnc_show_c1_ballistic_coefficient_data.sqf @@ -0,0 +1,30 @@ +/* + * Author: Ruthberg + * Shows/Hides the c1 ballistic coefficient data controls + * + * Arguments: + * visible - + * + * Return Value: + * None + * + * Example: + * false call ace_atragmx_fnc_show_c1_ballistic_coefficient_data + * + * Public: No + */ +#include "script_component.hpp" + +GVAR(showC1BallisticCoefficientData) = _this; + +{ctrlShow [_x, _this]} forEach [17000, 17001, 170021, 170022, 170023, 170024, 170025, 170026, 170027, 170031, 170032, 170033, 170034, 170035, 170036, 170037, 17004, 17005, 17006, 17007, 17008, 17009]; + +if (_this) then { + if (GVAR(currentUnit) != 1) then { + ctrlSetText [17000, "Meters"]; + } else { + ctrlSetText [17000, "Yards"]; + }; + ctrlSetFocus ((uiNamespace getVariable "ATragMX_Display") displayCtrl 170031); + [] call FUNC(update_c1_ballistic_coefficient_data); +}; diff --git a/addons/atragmx/functions/fnc_show_gun_ammo_data.sqf b/addons/atragmx/functions/fnc_show_gun_ammo_data.sqf index dfab6da238..c6fb288acc 100644 --- a/addons/atragmx/functions/fnc_show_gun_ammo_data.sqf +++ b/addons/atragmx/functions/fnc_show_gun_ammo_data.sqf @@ -6,7 +6,7 @@ * visible - * * Return Value: - * Nothing + * None * * Example: * false call ace_atragmx_fnc_show_gun_ammo_data diff --git a/addons/atragmx/functions/fnc_show_gun_list.sqf b/addons/atragmx/functions/fnc_show_gun_list.sqf index ce3b3bae3a..e6c8156d26 100644 --- a/addons/atragmx/functions/fnc_show_gun_list.sqf +++ b/addons/atragmx/functions/fnc_show_gun_list.sqf @@ -6,10 +6,10 @@ * visible - * * Return Value: - * Nothing + * None * * Example: - * call ace_atragmx_fnc_show_gun_list + * false call ace_atragmx_fnc_show_gun_list * * Public: No */ diff --git a/addons/atragmx/functions/fnc_show_main_page.sqf b/addons/atragmx/functions/fnc_show_main_page.sqf index 486ea1655a..6b2259c72a 100644 --- a/addons/atragmx/functions/fnc_show_main_page.sqf +++ b/addons/atragmx/functions/fnc_show_main_page.sqf @@ -6,10 +6,10 @@ * visible - * * Return Value: - * Nothing + * None * * Example: - * call ace_atragmx_fnc_show_main_page + * false call ace_atragmx_fnc_show_main_page * * Public: No */ @@ -21,6 +21,18 @@ GVAR(showMainPage) = _this; 500, 501, 502, 503, 600, 601, 602, 603, 1000, 1001, 1002, 1003, 1004, 2000, 2001, 3000, 4000, 4001, 4002, 4003, 4004, 4005, 4006, 4007, 4008]; if (_this) then { + if (GVAR(showCoriolis)) then { + ctrlSetText [4003, "Hold"]; + ctrlSetText [4004, "Cor"]; + ctrlSetText [4005, "Spin"]; + {ctrlShow [_x, false]} forEach [402, 4006, 4007]; + } else { + ctrlSetText [4003, "Abs"]; + ctrlSetText [4004, "Rel"]; + ctrlSetText [4005, "Cur"]; + private _visible = (GVAR(currentScopeUnit) == 3); + {ctrlShow [_x, _visible]} forEach [401, 402, 411, 412, 4004, 4005, 4006, 4007]; + }; if (GVAR(atmosphereModeTBH)) then { {ctrlShow [_x, false]} forEach [23, 230]; } else { diff --git a/addons/atragmx/functions/fnc_show_muzzle_velocity_data.sqf b/addons/atragmx/functions/fnc_show_muzzle_velocity_data.sqf new file mode 100644 index 0000000000..20c7bf1826 --- /dev/null +++ b/addons/atragmx/functions/fnc_show_muzzle_velocity_data.sqf @@ -0,0 +1,25 @@ +/* + * Author: Ruthberg + * Shows/Hides the muzzle velocity data controls + * + * Arguments: + * visible - + * + * Return Value: + * None + * + * Example: + * false call ace_atragmx_fnc_show_muzzle_velocity_data + * + * Public: No + */ +#include "script_component.hpp" + +GVAR(showMuzzleVelocityData) = _this; + +{ctrlShow [_x, _this]} forEach [16000, 16001, 160021, 160022, 160023, 160024, 160025, 160026, 160027, 160031, 160032, 160033, 160034, 160035, 160036, 160037, 16004, 16005, 16006, 16007, 16008, 16009]; + +if (_this) then { + ctrlSetFocus ((uiNamespace getVariable "ATragMX_Display") displayCtrl 160031); + [] call FUNC(update_muzzle_velocity_data); +}; diff --git a/addons/atragmx/functions/fnc_show_range_card.sqf b/addons/atragmx/functions/fnc_show_range_card.sqf index 7709589beb..d2dc368bb4 100644 --- a/addons/atragmx/functions/fnc_show_range_card.sqf +++ b/addons/atragmx/functions/fnc_show_range_card.sqf @@ -6,10 +6,10 @@ * visible - * * Return Value: - * Nothing + * None * * Example: - * call ace_atragmx_fnc_show_range_card + * false call ace_atragmx_fnc_show_range_card * * Public: No */ diff --git a/addons/atragmx/functions/fnc_show_range_card_setup.sqf b/addons/atragmx/functions/fnc_show_range_card_setup.sqf index f4d55f33d1..6597e4ee7e 100644 --- a/addons/atragmx/functions/fnc_show_range_card_setup.sqf +++ b/addons/atragmx/functions/fnc_show_range_card_setup.sqf @@ -6,10 +6,10 @@ * visible - * * Return Value: - * Nothing + * None * * Example: - * call ace_atragmx_fnc_show_range_card_setup + * false call ace_atragmx_fnc_show_range_card_setup * * Public: No */ diff --git a/addons/atragmx/functions/fnc_show_solution_setup.sqf b/addons/atragmx/functions/fnc_show_solution_setup.sqf index 761df45e6f..83476228f4 100644 --- a/addons/atragmx/functions/fnc_show_solution_setup.sqf +++ b/addons/atragmx/functions/fnc_show_solution_setup.sqf @@ -6,7 +6,7 @@ * visible - * * Return Value: - * Nothing + * None * * Example: * false call ace_atragmx_fnc_show_solution_setup diff --git a/addons/atragmx/functions/fnc_show_target_data.sqf b/addons/atragmx/functions/fnc_show_target_data.sqf index f1b432edf8..7a0845f862 100644 --- a/addons/atragmx/functions/fnc_show_target_data.sqf +++ b/addons/atragmx/functions/fnc_show_target_data.sqf @@ -6,7 +6,7 @@ * visible - * * Return Value: - * Nothing + * None * * Example: * false call ace_atragmx_fnc_show_target_data diff --git a/addons/atragmx/functions/fnc_show_target_range_assist.sqf b/addons/atragmx/functions/fnc_show_target_range_assist.sqf index d910271aa4..0f6c7bad04 100644 --- a/addons/atragmx/functions/fnc_show_target_range_assist.sqf +++ b/addons/atragmx/functions/fnc_show_target_range_assist.sqf @@ -6,10 +6,10 @@ * visible - * * Return Value: - * Nothing + * None * * Example: - * call ace_atragmx_fnc_show_target_range_assist + * false call ace_atragmx_fnc_show_target_range_assist * * Public: No */ diff --git a/addons/atragmx/functions/fnc_show_target_speed_assist.sqf b/addons/atragmx/functions/fnc_show_target_speed_assist.sqf index c5a23eb1b7..ac99a4e76e 100644 --- a/addons/atragmx/functions/fnc_show_target_speed_assist.sqf +++ b/addons/atragmx/functions/fnc_show_target_speed_assist.sqf @@ -6,10 +6,10 @@ * visible - * * Return Value: - * Nothing + * None * * Example: - * call ace_atragmx_fnc_show_target_speed_assist + * false call ace_atragmx_fnc_show_target_speed_assist * * Public: No */ diff --git a/addons/atragmx/functions/fnc_show_target_speed_assist_timer.sqf b/addons/atragmx/functions/fnc_show_target_speed_assist_timer.sqf index a731dd194d..cb28390ff6 100644 --- a/addons/atragmx/functions/fnc_show_target_speed_assist_timer.sqf +++ b/addons/atragmx/functions/fnc_show_target_speed_assist_timer.sqf @@ -6,10 +6,10 @@ * visible - * * Return Value: - * Nothing + * None * * Example: - * call ace_atragmx_fnc_show_target_speed_assist_timer + * false call ace_atragmx_fnc_show_target_speed_assist_timer * * Public: No */ diff --git a/addons/atragmx/functions/fnc_show_truing_drop.sqf b/addons/atragmx/functions/fnc_show_truing_drop.sqf new file mode 100644 index 0000000000..644fe834b6 --- /dev/null +++ b/addons/atragmx/functions/fnc_show_truing_drop.sqf @@ -0,0 +1,43 @@ +/* + * Author: Ruthberg + * Shows/Hides the truing drop controls + * + * Arguments: + * visible - + * + * Return Value: + * None + * + * Example: + * false call ace_atragmx_fnc_show_truing_drop + * + * Public: No + */ +#include "script_component.hpp" + +GVAR(showTruingDrop) = _this; + +{ctrlShow [_x, _this]} forEach [18000, 18001, 18002, 18003, 18004, 18005, 18006, 18007, 18008, 18009, 18010, 18011, 18012, 18013, 18014, 18015, 18016, 18017, 18018, 18019, 18020]; + +if (_this) then { + if (GVAR(currentUnit) == 2) then { + ctrlSetText [18000, format["ZR=%1meters", Round(GVAR(workingMemory) select 2)]]; + } else { + ctrlSetText [18000, format["ZR=%1yards", Round((GVAR(workingMemory) select 2) * 1.0936133)]]; + }; + private _dropUnit = GVAR(currentScopeUnit); + if (_dropUnit == 3) then { + switch (GVAR(currentScopeClickUnit)) do { + case 0: { _dropUnit = 1; }; + case 1: { _dropUnit = 2; }; + case 2: { _dropUnit = 0; }; + }; + }; + switch (_dropUnit) do { + case 0: { ctrlSetText [18001, "Drop=mils"]; }; + case 1: { ctrlSetText [18001, "Drop=tmoa"]; }; + case 2: { ctrlSetText [18001, "Drop=smoa"]; }; + }; + false call FUNC(calculate_truing_drop); + call FUNC(update_truing_drop_selection); +}; diff --git a/addons/atragmx/functions/fnc_sord.sqf b/addons/atragmx/functions/fnc_sord.sqf index b342072018..792d727c70 100644 --- a/addons/atragmx/functions/fnc_sord.sqf +++ b/addons/atragmx/functions/fnc_sord.sqf @@ -8,7 +8,7 @@ * 2: Inclination (Degrees) * * Return Value: - * Nothing + * None * * Example: * [1000, 45, 1] call ace_microdagr_fnc_recieveRangefinderData @@ -17,6 +17,8 @@ */ #include "script_component.hpp" +if (!GVAR(initialised)) exitWith {}; + params ["_slopeDistance", "_azimuth", "_inclination"]; GVAR(inclinationAngle) set [GVAR(currentTarget), round(_inclination)]; diff --git a/addons/atragmx/functions/fnc_store_gun_list.sqf b/addons/atragmx/functions/fnc_store_gun_list.sqf new file mode 100644 index 0000000000..b3969837d2 --- /dev/null +++ b/addons/atragmx/functions/fnc_store_gun_list.sqf @@ -0,0 +1,25 @@ +/* + * Author: Ruthberg + * Saves the persistent gun list entries into profileNamespace + * + * Arguments: + * None + * + * Return Value: + * None + * + * Example: + * call ace_atragmx_fnc_store_user_data + * + * Public: No + */ +#include "script_component.hpp" + +private _gunList = []; +{ + if (_x select 20) then { + _gunList pushBack _x; + }; +} forEach GVAR(gunList); + +profileNamespace setVariable ["ACE_ATragMX_gunList", _gunList]; diff --git a/addons/atragmx/functions/fnc_store_user_data.sqf b/addons/atragmx/functions/fnc_store_user_data.sqf index 5cfe7f2ae0..264ac07458 100644 --- a/addons/atragmx/functions/fnc_store_user_data.sqf +++ b/addons/atragmx/functions/fnc_store_user_data.sqf @@ -3,10 +3,10 @@ * Saves user data into profileNamespace * * Arguments: - * Nothing + * None * * Return Value: - * Nothing + * None * * Example: * call ace_atragmx_fnc_store_user_data @@ -28,6 +28,7 @@ profileNamespace setVariable ["ACE_ATragMX_barometricPressure", GVAR(barometricP profileNamespace setVariable ["ACE_ATragMX_relativeHumidity", GVAR(relativeHumidity)]; profileNamespace setVariable ["ACE_ATragMX_showWind2", GVAR(showWind2)]; +profileNamespace setVariable ["ACE_ATragMX_showCoriolis", GVAR(showCoriolis)]; profileNamespace setVariable ["ACE_ATragMX_latitude", GVAR(latitude)]; profileNamespace setVariable ["ACE_ATragMX_directionOfFire", GVAR(directionOfFire)]; profileNamespace setVariable ["ACE_ATragMX_windSpeed1", GVAR(windSpeed1)]; @@ -41,4 +42,4 @@ profileNamespace setVariable ["ACE_ATragMX_targetRange", GVAR(targetRange)]; profileNamespace setVariable ["ACE_ATragMX_rangeCardStartRange", GVAR(rangeCardStartRange)]; profileNamespace setVariable ["ACE_ATragMX_rangeCardEndRange", GVAR(rangeCardEndRange)]; profileNamespace setVariable ["ACE_ATragMX_rangeCardIncrement", GVAR(rangeCardIncrement)]; -profileNamespace setVariable ["ACE_ATragMX_rangeCardCurrentColumn", GVAR(rangeCardCurrentColumn)]; \ No newline at end of file +profileNamespace setVariable ["ACE_ATragMX_rangeCardCurrentColumn", GVAR(rangeCardCurrentColumn)]; diff --git a/addons/atragmx/functions/fnc_target_speed_assist_timer.sqf b/addons/atragmx/functions/fnc_target_speed_assist_timer.sqf index d270dbf4c3..d9ae84e1ae 100644 --- a/addons/atragmx/functions/fnc_target_speed_assist_timer.sqf +++ b/addons/atragmx/functions/fnc_target_speed_assist_timer.sqf @@ -3,10 +3,10 @@ * Shows and starts the target speed assist timer * * Arguments: - * Nothing + * None * * Return Value: - * Nothing + * None * * Example: * call ace_atragmx_fnc_target_speed_assist_timer diff --git a/addons/atragmx/functions/fnc_toggle_atmo_env_data.sqf b/addons/atragmx/functions/fnc_toggle_atmo_env_data.sqf index 87e973c7c0..5e420b41f8 100644 --- a/addons/atragmx/functions/fnc_toggle_atmo_env_data.sqf +++ b/addons/atragmx/functions/fnc_toggle_atmo_env_data.sqf @@ -6,7 +6,7 @@ * Apply new data? * * Return Value: - * Nothing + * None * * Example: * 1 call ace_atragmx_fnc_toggle_atmo_env_data @@ -20,7 +20,11 @@ if (ctrlVisible 13000) then { true call FUNC(show_main_page); if (_this == 1) then { + GVAR(truingDropDropData) set [0, 0]; + [true, true] call FUNC(recalculate_muzzle_velocity); call FUNC(calculate_target_solution); + } else { + call FUNC(update_atmo_env_data); }; } else { true call FUNC(show_atmo_env_data); diff --git a/addons/atragmx/functions/fnc_toggle_c1_ballistic_coefficient_data.sqf b/addons/atragmx/functions/fnc_toggle_c1_ballistic_coefficient_data.sqf new file mode 100644 index 0000000000..c83e21a872 --- /dev/null +++ b/addons/atragmx/functions/fnc_toggle_c1_ballistic_coefficient_data.sqf @@ -0,0 +1,33 @@ +/* + * Author: Ruthberg + * Toggles the c1 ballistic coefficient data screen on/off + * + * Arguments: + * Apply new data? + * + * Return Value: + * None + * + * Example: + * 1 call ace_atragmx_fnc_toggle_c1_ballistic_coefficient_data + * + * Public: No + */ +#include "script_component.hpp" + +if (!(missionNamespace getVariable [QEGVAR(advanced_ballistics,enabled), false])) exitWith {}; + +if (ctrlVisible 17000) then { + false call FUNC(show_c1_ballistic_coefficient_data); + true call FUNC(show_main_page); + + if (_this == 1) then { + [true, true] call FUNC(recalculate_c1_ballistic_coefficient); + call FUNC(calculate_target_solution); + } else { + call FUNC(update_c1_ballistic_coefficient_data); + }; +} else { + true call FUNC(show_c1_ballistic_coefficient_data); + false call FUNC(show_main_page); +}; diff --git a/addons/atragmx/functions/fnc_toggle_coriolis.sqf b/addons/atragmx/functions/fnc_toggle_coriolis.sqf new file mode 100644 index 0000000000..a711d2a55e --- /dev/null +++ b/addons/atragmx/functions/fnc_toggle_coriolis.sqf @@ -0,0 +1,19 @@ +/* + * Author: Ruthberg + * Toggles the coriolis and spin drift output on/off + * + * Arguments: + * None + * + * Return Value: + * None + * + * Example: + * call ace_atragmx_fnc_toggle_coriolis + * + * Public: No + */ +#include "script_component.hpp" + +GVAR(showCoriolis) = !GVAR(showCoriolis); +true call FUNC(show_main_page); diff --git a/addons/atragmx/functions/fnc_toggle_gun_ammo_data.sqf b/addons/atragmx/functions/fnc_toggle_gun_ammo_data.sqf index f3eb814da7..332c0f1aba 100644 --- a/addons/atragmx/functions/fnc_toggle_gun_ammo_data.sqf +++ b/addons/atragmx/functions/fnc_toggle_gun_ammo_data.sqf @@ -6,7 +6,7 @@ * Apply new data? * * Return Value: - * Nothing + * None * * Example: * 1 call ace_atragmx_fnc_toggle_gun_ammo_data @@ -20,8 +20,11 @@ if (ctrlVisible 12000) then { true call FUNC(show_main_page); if (_this == 1) then { + GVAR(truingDropDropData) set [0, 0]; call FUNC(update_zero_range); call FUNC(calculate_target_solution); + } else { + call FUNC(update_gun_ammo_data); }; } else { true call FUNC(show_gun_ammo_data); diff --git a/addons/atragmx/functions/fnc_toggle_gun_list.sqf b/addons/atragmx/functions/fnc_toggle_gun_list.sqf index e5dbf54bd5..6ff6e3b6f4 100644 --- a/addons/atragmx/functions/fnc_toggle_gun_list.sqf +++ b/addons/atragmx/functions/fnc_toggle_gun_list.sqf @@ -6,7 +6,7 @@ * change gun? * * Return Value: - * Nothing + * None * * Example: * false call ace_atragmx_fnc_toggle_gun_list diff --git a/addons/atragmx/functions/fnc_toggle_muzzle_velocity_data.sqf b/addons/atragmx/functions/fnc_toggle_muzzle_velocity_data.sqf new file mode 100644 index 0000000000..d00992d856 --- /dev/null +++ b/addons/atragmx/functions/fnc_toggle_muzzle_velocity_data.sqf @@ -0,0 +1,33 @@ +/* + * Author: Ruthberg + * Toggles the muzzle velocity data screen on/off + * + * Arguments: + * Apply new data? + * + * Return Value: + * None + * + * Example: + * 1 call ace_atragmx_fnc_toggle_muzzle_velocity_data + * + * Public: No + */ +#include "script_component.hpp" + +if (!(missionNamespace getVariable [QEGVAR(advanced_ballistics,enabled), false])) exitWith {}; + +if (ctrlVisible 16000) then { + false call FUNC(show_muzzle_velocity_data); + true call FUNC(show_main_page); + + if (_this == 1) then { + [true, true] call FUNC(recalculate_muzzle_velocity); + call FUNC(calculate_target_solution); + } else { + call FUNC(update_muzzle_velocity_data); + }; +} else { + true call FUNC(show_muzzle_velocity_data); + false call FUNC(show_main_page); +}; diff --git a/addons/atragmx/functions/fnc_toggle_option_menu.sqf b/addons/atragmx/functions/fnc_toggle_option_menu.sqf new file mode 100644 index 0000000000..f7d7f06a13 --- /dev/null +++ b/addons/atragmx/functions/fnc_toggle_option_menu.sqf @@ -0,0 +1,53 @@ +/* + * Author: Ruthberg + * Toggles the option menu on/off + * + * Arguments: + * open menu item + * + * Return Value: + * None + * + * Example: + * 1 call ace_atragmx_fnc_toggle_option_menu + * + * Public: No + */ +#include "script_component.hpp" + +if (ctrlVisible 3001) then { + if (_this) then { + private _optionID = lbCurSel 3002; + if (_optionID > 0) then { + ctrlShow [3001, false]; + ctrlShow [3002, false]; + [_optionID] call FUNC(evaluate_option_menu_input); + }; + } else { + ctrlShow [3001, false]; + ctrlShow [3002, false]; + }; +} else { + lbClear 3002; + + lbAdd [3002, "Accuracy 1st"]; + lbAdd [3002, "Muz Vel Table"]; + lbAdd [3002, "Drag Coef Table"]; + lbAdd [3002, "Target Speed Est"]; + lbAdd [3002, "Target Range Est"]; + lbAdd [3002, "Truing Drop"]; + if (GVAR(showCoriolis)) then { + lbAdd [3002, "Show Coriolis *"]; + } else { + lbAdd [3002, "Show Coriolis"]; + }; + lbAdd [3002, "Set Clicks"]; + lbAdd [3002, "Gun Note"]; + + lbSetCurSel [3002, 0]; + + ctrlShow [3001, true]; + ctrlShow [3002, true]; + + ctrlSetFocus ((uiNamespace getVariable ["ATragMX_Display", displayNull]) displayCtrl 3002); +}; diff --git a/addons/atragmx/functions/fnc_toggle_range_card.sqf b/addons/atragmx/functions/fnc_toggle_range_card.sqf index 7d8b7a0239..4e7ea4d511 100644 --- a/addons/atragmx/functions/fnc_toggle_range_card.sqf +++ b/addons/atragmx/functions/fnc_toggle_range_card.sqf @@ -3,10 +3,10 @@ * Toggles the range card screen on/off * * Arguments: - * Nothing + * None * * Return Value: - * Nothing + * None * * Example: * call ace_atragmx_fnc_toggle_range_card diff --git a/addons/atragmx/functions/fnc_toggle_range_card_setup.sqf b/addons/atragmx/functions/fnc_toggle_range_card_setup.sqf index 96c31459b2..e5d68c3933 100644 --- a/addons/atragmx/functions/fnc_toggle_range_card_setup.sqf +++ b/addons/atragmx/functions/fnc_toggle_range_card_setup.sqf @@ -6,7 +6,7 @@ * Apply new range card settings * * Return Value: - * Nothing + * None * * Example: * 1 call ace_atragmx_fnc_toggle_range_card_setup diff --git a/addons/atragmx/functions/fnc_toggle_solution_setup.sqf b/addons/atragmx/functions/fnc_toggle_solution_setup.sqf index 5372b205d0..f548df689f 100644 --- a/addons/atragmx/functions/fnc_toggle_solution_setup.sqf +++ b/addons/atragmx/functions/fnc_toggle_solution_setup.sqf @@ -6,7 +6,7 @@ * Apply new data? * * Return Value: - * Nothing + * None * * Example: * 1 call ace_atragmx_fnc_toggle_solution_setup diff --git a/addons/atragmx/functions/fnc_toggle_target_data.sqf b/addons/atragmx/functions/fnc_toggle_target_data.sqf index 2cfa2f8df5..863af6511f 100644 --- a/addons/atragmx/functions/fnc_toggle_target_data.sqf +++ b/addons/atragmx/functions/fnc_toggle_target_data.sqf @@ -6,7 +6,7 @@ * Apply new data? * * Return Value: - * Nothing + * None * * Example: * 1 call ace_atragmx_fnc_toggle_target_data @@ -21,6 +21,8 @@ if (ctrlVisible 14000) then { if (_this == 1) then { call FUNC(calculate_target_solution); + } else { + call FUNC(update_target_data); }; } else { true call FUNC(show_target_data); diff --git a/addons/atragmx/functions/fnc_toggle_target_range_assist.sqf b/addons/atragmx/functions/fnc_toggle_target_range_assist.sqf index 83d2daa95f..ad593830f9 100644 --- a/addons/atragmx/functions/fnc_toggle_target_range_assist.sqf +++ b/addons/atragmx/functions/fnc_toggle_target_range_assist.sqf @@ -6,7 +6,7 @@ * update range? * * Return Value: - * Nothing + * None * * Example: * 1 call ace_atragmx_fnc_toggle_target_range_assist diff --git a/addons/atragmx/functions/fnc_toggle_target_speed_assist.sqf b/addons/atragmx/functions/fnc_toggle_target_speed_assist.sqf index 4d1680d195..7dadd8be03 100644 --- a/addons/atragmx/functions/fnc_toggle_target_speed_assist.sqf +++ b/addons/atragmx/functions/fnc_toggle_target_speed_assist.sqf @@ -6,7 +6,7 @@ * update speed? * * Return Value: - * Nothing + * None * * Example: * 1 call ace_atragmx_fnc_toggle_target_speed_assist @@ -21,8 +21,7 @@ if (ctrlVisible 8000) then { if (_this == 1) then { [] call FUNC(calculate_target_speed_assist); - private ["_targetSpeed"]; - _targetSpeed = parseNumber(ctrlText 8007); + private _targetSpeed = parseNumber(ctrlText 8007); if (_targetSpeed != 0) then { ctrlSetText [330, Str(_targetSpeed)]; ctrlSetText [140050, Str(_targetSpeed)]; diff --git a/addons/atragmx/functions/fnc_toggle_truing_drop.sqf b/addons/atragmx/functions/fnc_toggle_truing_drop.sqf new file mode 100644 index 0000000000..9865005c78 --- /dev/null +++ b/addons/atragmx/functions/fnc_toggle_truing_drop.sqf @@ -0,0 +1,39 @@ +/* + * Author: Ruthberg + * Toggles the truing drop screen on/off + * + * Arguments: + * Apply new data? + * + * Return Value: + * None + * + * Example: + * 1 call ace_atragmx_fnc_toggle_truing_drop + * + * Public: No + */ +#include "script_component.hpp" + +if (!(missionNamespace getVariable [QEGVAR(advanced_ballistics,enabled), false])) exitWith {}; + +if (ctrlVisible 18000) then { + false call FUNC(show_truing_drop); + true call FUNC(show_main_page); + + if (_this == 1) then { + if (GVAR(truingDropMode) == 0) then { + [GVAR(temperature), GVAR(truingDropMuzzleVelocity)] call FUNC(insert_muzzle_velocity_data); + [false, true] call FUNC(recalculate_muzzle_velocity); + } else { + [GVAR(truingDropRangeData) select 0, GVAR(truingDropRangeData) select 1, GVAR(truingDropC1)] call FUNC(insert_c1_ballistic_coefficient_data); + [false, true] call FUNC(recalculate_c1_ballistic_coefficient); + }; + call FUNC(calculate_target_solution); + } else { + call FUNC(update_truing_drop_data); + }; +} else { + false call FUNC(show_main_page); + true call FUNC(show_truing_drop); +}; diff --git a/addons/atragmx/functions/fnc_trim_gun_name.sqf b/addons/atragmx/functions/fnc_trim_gun_name.sqf new file mode 100644 index 0000000000..36344d6dfa --- /dev/null +++ b/addons/atragmx/functions/fnc_trim_gun_name.sqf @@ -0,0 +1,18 @@ +/* + * Author: Ruthberg + * Trims the gun name input field + * + * Arguments: + * None + * + * Return Value: + * None + * + * Example: + * call ace_atragmx_fnc_trim_gun_name + * + * Public: No + */ +#include "script_component.hpp" + +ctrlSetText [11001, (ctrlText 11001) select [0, 14]]; diff --git a/addons/atragmx/functions/fnc_true_c1_ballistic_coefficient.sqf b/addons/atragmx/functions/fnc_true_c1_ballistic_coefficient.sqf new file mode 100644 index 0000000000..dfa41ea0b4 --- /dev/null +++ b/addons/atragmx/functions/fnc_true_c1_ballistic_coefficient.sqf @@ -0,0 +1,43 @@ +/* + * Author: Ruthberg + * Trues the c1 ballistic coefficient + * + * Arguments: + * None + * + * Return Value: + * None + * + * Example: + * call ace_atragmx_fnc_true_c1_ballistic_coefficient + * + * Public: No + */ +#include "script_component.hpp" + +private _referenceDrop = GVAR(truingDropDropData) select 0; +private _actualDrop = GVAR(truingDropDropData) select 2; + +if (Round(_actualDrop * 10) / 10 == Round(_referenceDrop * 10) / 10) exitWith {}; + +private _step = 0.01; +if (_actualDrop > _referenceDrop) then { + _step = -0.01; +}; + +private _solutionInput = +GVAR(targetSolutionInput); +_solutionInput set [ 8, 200]; +_solutionInput set [13, GVAR(truingDropRangeData) select 1]; +private _c1 = _solutionInput select 14; + +{ + _step = _step * _x; + while { _actualDrop * _step < _referenceDrop * _step } do { + _c1 = _c1 + _step; + _solutionInput set [14, _c1]; + private _result = _solutionInput call FUNC(calculate_solution); + _referenceDrop = (_result select 0); + }; +} forEach [1, -0.1]; + +GVAR(truingDropC1) = _c1; diff --git a/addons/atragmx/functions/fnc_true_muzzle_velocity.sqf b/addons/atragmx/functions/fnc_true_muzzle_velocity.sqf new file mode 100644 index 0000000000..db907aa29d --- /dev/null +++ b/addons/atragmx/functions/fnc_true_muzzle_velocity.sqf @@ -0,0 +1,43 @@ +/* + * Author: Ruthberg + * Trues the muzzle velocity + * + * Arguments: + * None + * + * Return Value: + * None + * + * Example: + * call ace_atragmx_fnc_true_muzzle_velocity + * + * Public: No + */ +#include "script_component.hpp" + +private _referenceDrop = GVAR(truingDropDropData) select 0; +private _actualDrop = GVAR(truingDropDropData) select 1; + +if (Round(_actualDrop * 10) / 10 == Round(_referenceDrop * 10) / 10) exitWith {}; + +private _step = 10; +if (_actualDrop > _referenceDrop) then { + _step = -10; +}; + +private _solutionInput = +GVAR(targetSolutionInput); +_solutionInput set [ 8, 200]; +_solutionInput set [13, GVAR(truingDropRangeData) select 0]; +private _muzzleVelocity = _solutionInput select 4; + +{ + _step = _step * _x; + while { _actualDrop * _step < _referenceDrop * _step } do { + _muzzleVelocity = _muzzleVelocity + _step; + _solutionInput set [4, _muzzleVelocity]; + private _result = _solutionInput call FUNC(calculate_solution); + _referenceDrop = (_result select 0); + }; +} forEach [1, -0.1]; + +GVAR(truingDropMuzzleVelocity) = _muzzleVelocity; diff --git a/addons/atragmx/functions/fnc_update_atmo_env_data.sqf b/addons/atragmx/functions/fnc_update_atmo_env_data.sqf index 7cd34754da..e8e805c0ab 100644 --- a/addons/atragmx/functions/fnc_update_atmo_env_data.sqf +++ b/addons/atragmx/functions/fnc_update_atmo_env_data.sqf @@ -3,10 +3,10 @@ * Updates the atmospheric data fields * * Arguments: - * Nothing + * None * * Return Value: - * Nothing + * None * * Example: * call ace_atragmx_fnc_update_atmo_env_data diff --git a/addons/atragmx/functions/fnc_update_atmo_selection.sqf b/addons/atragmx/functions/fnc_update_atmo_selection.sqf index 18036178b4..cd808326f8 100644 --- a/addons/atragmx/functions/fnc_update_atmo_selection.sqf +++ b/addons/atragmx/functions/fnc_update_atmo_selection.sqf @@ -3,10 +3,10 @@ * Updates the atmospheric data input method * * Arguments: - * Nothing + * None * * Return Value: - * Nothing + * None * * Example: * call ace_atragmx_fnc_update_atmo_selection diff --git a/addons/atragmx/functions/fnc_update_atmosphere.sqf b/addons/atragmx/functions/fnc_update_atmosphere.sqf index be7565bda7..d54daed532 100644 --- a/addons/atragmx/functions/fnc_update_atmosphere.sqf +++ b/addons/atragmx/functions/fnc_update_atmosphere.sqf @@ -3,10 +3,10 @@ * Updates all atmosphere column input fields * * Arguments: - * Nothing + * None * * Return Value: - * Nothing + * None * * Example: * call ace_atragmx_fnc_update_atmosphere diff --git a/addons/atragmx/functions/fnc_update_c1_ballistic_coefficient_data.sqf b/addons/atragmx/functions/fnc_update_c1_ballistic_coefficient_data.sqf new file mode 100644 index 0000000000..5095ee0d96 --- /dev/null +++ b/addons/atragmx/functions/fnc_update_c1_ballistic_coefficient_data.sqf @@ -0,0 +1,25 @@ +/* + * Author: Ruthberg + * Updates the c1 ballistic coefficient data fields + * + * Arguments: + * None + * + * Return Value: + * None + * + * Example: + * call ace_atragmx_fnc_update_c1_ballistic_coefficient_data + * + * Public: No + */ +#include "script_component.hpp" + +// Distances +if (GVAR(currentUnit) != 1) then { + {ctrlSetText [_x, Str(Round(((GVAR(workingMemory) select 19) select _forEachIndex) select 0))]} forEach [170021, 170022, 170023, 170024, 170025, 170026, 170027]; +} else { + {ctrlSetText [_x, Str(Round((((GVAR(workingMemory) select 19) select _forEachIndex) select 0) * 1.0936133))]} forEach [170021, 170022, 170023, 170024, 170025, 170026, 170027]; +}; +// Ballistic coefficients +{ctrlSetText [_x, Str(Round((((GVAR(workingMemory) select 19) select _forEachIndex) select 1) * 1000) / 1000)]} forEach [170031, 170032, 170033, 170034, 170035, 170036, 170037]; diff --git a/addons/atragmx/functions/fnc_update_gun.sqf b/addons/atragmx/functions/fnc_update_gun.sqf index aa1f8c44bf..ff7de54a1c 100644 --- a/addons/atragmx/functions/fnc_update_gun.sqf +++ b/addons/atragmx/functions/fnc_update_gun.sqf @@ -3,10 +3,10 @@ * Updates all gun column input fields * * Arguments: - * Nothing + * None * * Return Value: - * Nothing + * None * * Example: * call ace_atragmx_fnc_update_gun diff --git a/addons/atragmx/functions/fnc_update_gun_ammo_data.sqf b/addons/atragmx/functions/fnc_update_gun_ammo_data.sqf index 6332506006..7d29252b28 100644 --- a/addons/atragmx/functions/fnc_update_gun_ammo_data.sqf +++ b/addons/atragmx/functions/fnc_update_gun_ammo_data.sqf @@ -3,10 +3,10 @@ * Updates the gun ammo data fields * * Arguments: - * Nothing + * None * * Return Value: - * Nothing + * None * * Example: * call ace_atragmx_fnc_update_gun_ammo_data @@ -68,7 +68,7 @@ if (GVAR(currentUnit) == 2) then { ctrlSetText [12000, "Bore (inches)"]; ctrlSetText [12001, "Bullet Weight (grains)"]; ctrlSetText [12002, "Bullet Diam (inches)"]; - ctrlSetText [12004, "Rifle Twist (inches/trn)"]; + ctrlSetText [12004, "Rifle Twist (in/trn)"]; ctrlSetText [12005, "Muzzle Velocity (feet/sec)"]; }; diff --git a/addons/atragmx/functions/fnc_update_inclination_angle.sqf b/addons/atragmx/functions/fnc_update_inclination_angle.sqf index ea5599bf2d..82813282f7 100644 --- a/addons/atragmx/functions/fnc_update_inclination_angle.sqf +++ b/addons/atragmx/functions/fnc_update_inclination_angle.sqf @@ -6,7 +6,7 @@ * Reference input field ID * * Return Value: - * Nothing + * None * * Example: * 0 call ace_atragmx_fnc_update_inclination_angle @@ -15,9 +15,8 @@ */ #include "script_component.hpp" -private ["_inclinationAngleCosine", "_inclinationAngleDegree"]; -_inclinationAngleCosine = 0.5 max parseNumber(ctrlText 140041) min 1; -_inclinationAngleDegree = -60 max parseNumber(ctrlText 140040) min 60; +private _inclinationAngleCosine = 0.5 max parseNumber(ctrlText 140041) min 1; +private _inclinationAngleDegree = -60 max parseNumber(ctrlText 140040) min 60; if (_this == 0) then { ctrlSetText [140040, Str(round(acos(_inclinationAngleCosine)))]; diff --git a/addons/atragmx/functions/fnc_update_muzzle_velocity_data.sqf b/addons/atragmx/functions/fnc_update_muzzle_velocity_data.sqf new file mode 100644 index 0000000000..466d83cc4c --- /dev/null +++ b/addons/atragmx/functions/fnc_update_muzzle_velocity_data.sqf @@ -0,0 +1,28 @@ +/* + * Author: Ruthberg + * Updates the muzzle velocity data fields + * + * Arguments: + * None + * + * Return Value: + * None + * + * Example: + * call ace_atragmx_fnc_update_muzzle_velocity_data + * + * Public: No + */ +#include "script_component.hpp" + +if (GVAR(currentUnit) == 2) then { + // Temperatures + {ctrlSetText [_x, Str(Round((((GVAR(workingMemory) select 18) select _forEachIndex) select 0) * 10) / 10)]} forEach [160021, 160022, 160023, 160024, 160025, 160026, 160027]; + // Muzzle velocities + {ctrlSetText [_x, Str(Round(((GVAR(workingMemory) select 18) select _forEachIndex) select 1))]} forEach [160031, 160032, 160033, 160034, 160035, 160036, 160037]; +} else { + // Temperatures + {ctrlSetText [_x, Str(Round(((((GVAR(workingMemory) select 18) select _forEachIndex) select 0) * 1.8 + 32) * 10) / 10)]} forEach [160021, 160022, 160023, 160024, 160025, 160026, 160027]; + // Muzzle velocities + {ctrlSetText [_x, Str(Round((((GVAR(workingMemory) select 18) select _forEachIndex) select 1) * 3.2808399))]} forEach [160031, 160032, 160033, 160034, 160035, 160036, 160037]; +}; diff --git a/addons/atragmx/functions/fnc_update_range_card.sqf b/addons/atragmx/functions/fnc_update_range_card.sqf index e8c910ca74..4bcf4c3e42 100644 --- a/addons/atragmx/functions/fnc_update_range_card.sqf +++ b/addons/atragmx/functions/fnc_update_range_card.sqf @@ -3,10 +3,10 @@ * Updates the range card listbox content * * Arguments: - * Nothing + * None * * Return Value: - * Nothing + * None * * Example: * call ace_atragmx_fnc_update_range_card @@ -15,8 +15,7 @@ */ #include "script_component.hpp" -private ["_range", "_elevation", "_windage1", "_windage2", "_clickSize", "_clickNumber", "_clickInterval", "_lead", "_TOF", "_velocity", "_kineticEnergy", "_rangeOutput", "_elevationOutput", "_windageOutput", "_lastColumnOutput", "_speedOfSound"]; -_lastColumnOutput = ""; +private _lastColumnOutput = ""; if (GVAR(showWind2) && GVAR(rangeCardCurrentColumn) == 0) then { ctrlSetText [5006, "Wind2"]; @@ -32,23 +31,23 @@ if (GVAR(currentUnit) == 1) then { lnbClear 5007; -_speedOfSound = GVAR(temperature) call EFUNC(weather,calculateSpeedOfSound); +private _speedOfSound = GVAR(temperature) call EFUNC(weather,calculateSpeedOfSound); { - _range = _x select 0; - _elevation = _x select 1; - _windage1 = (_x select 2) select 0; - _windage2 = (_x select 2) select 1; - _lead = _x select 3; - _TOF = _x select 4; - _velocity = _x select 5; - _kineticEnergy = _x select 6; + private _range = _x select 0; + private _elevation = _x select 1; + private _windage1 = (_x select 2) select 0; + private _windage2 = (_x select 2) select 1; + private _lead = _x select 3; + private _TOF = _x select 4; + private _velocity = _x select 5; + private _kineticEnergy = _x select 6; switch (GVAR(currentScopeUnit)) do { case 0: { - _elevation = _elevation / 3.38; - _windage1 = _windage1 / 3.38; - _windage2 = _windage2 / 3.38; + _elevation = MRAD_TO_MOA(_elevation); + _windage1 = MRAD_TO_MOA(_windage1); + _windage2 = MRAD_TO_MOA(_windage2); }; case 2: { _elevation = _elevation * 1.047; @@ -56,13 +55,9 @@ _speedOfSound = GVAR(temperature) call EFUNC(weather,calculateSpeedOfSound); _windage2 = _windage2 * 1.047; }; case 3: { - switch (GVAR(workingMemory) select 7) do { - case 0: { _clickSize = 1; }; - case 1: { _clickSize = 1 / 1.047; }; - case 2: { _clickSize = 3.38; }; - }; - _clickNumber = GVAR(workingMemory) select 8; - _clickInterval = _clickSize / _clickNumber; + private _clickSize = [1, 1 / 1.047, MOA_TO_MRAD(1)] select (GVAR(workingMemory) select 7); + private _clickNumber = GVAR(workingMemory) select 8; + private _clickInterval = _clickSize / _clickNumber; _elevation = Round(_elevation / _clickInterval); _windage1 = Round(_windage1 / _clickInterval); @@ -70,10 +65,10 @@ _speedOfSound = GVAR(temperature) call EFUNC(weather,calculateSpeedOfSound); }; }; - _elevationOutput = Str(Round(_elevation * 100) / 100); - _windageOutput = Str(Round(_windage1 * 100) / 100); + private _elevationOutput = Str(Round(_elevation * 100) / 100); + private _windageOutput = Str(Round(_windage1 * 100) / 100); - _rangeOutput = Str(_range); + private _rangeOutput = Str(_range); if (_velocity < _speedOfSound) then { _rangeOutput = _rangeOutput + "*"; }; diff --git a/addons/atragmx/functions/fnc_update_relative_click_memory.sqf b/addons/atragmx/functions/fnc_update_relative_click_memory.sqf index 1dc534ce4b..fe09d46cf7 100644 --- a/addons/atragmx/functions/fnc_update_relative_click_memory.sqf +++ b/addons/atragmx/functions/fnc_update_relative_click_memory.sqf @@ -3,10 +3,10 @@ * Updates the relative click memory * * Arguments: - * Nothing + * None * * Return Value: - * Nothing + * None * * Example: * call ace_atragmx_fnc_update_relative_click_memory diff --git a/addons/atragmx/functions/fnc_update_result.sqf b/addons/atragmx/functions/fnc_update_result.sqf index 2b6ca29e23..0f69d742dc 100644 --- a/addons/atragmx/functions/fnc_update_result.sqf +++ b/addons/atragmx/functions/fnc_update_result.sqf @@ -3,10 +3,10 @@ * Updates the result input and output fields * * Arguments: - * Nothing + * None * * Return Value: - * Nothing + * None * * Example: * call ace_atragmx_fnc_update_result @@ -15,32 +15,42 @@ */ #include "script_component.hpp" -private ["_elevationAbs", "_elevationRel", "_elevationCur", "_windageAbs", "_wind2", "_windageRel", "_windageCur", "_lead", "_clickSize", "_clickNumber", "_clickInterval"]; -_elevationAbs = GVAR(elevationOutput) select GVAR(currentTarget); -_windageAbs = GVAR(windage1Output) select GVAR(currentTarget); +private _elevationAbs = GVAR(elevationOutput) select GVAR(currentTarget); +private _elevationRel = 0; +private _elevationCur = 0; +private _windageAbs = GVAR(windage1Output) select GVAR(currentTarget); +private _windageRel = 0; +private _windageCur = 0; -_wind2 = GVAR(windage2Output) select GVAR(currentTarget); +private _wind2 = GVAR(windage2Output) select GVAR(currentTarget); -_elevationCur = GVAR(workingMemory) select 10; -_windageCur = GVAR(workingMemory) select 11; +if (GVAR(showCoriolis)) then { + _elevationRel = GVAR(verticalCoriolisOutput) select GVAR(currentTarget); + _windageRel = GVAR(horizontalCoriolisOutput) select GVAR(currentTarget); -_elevationRel = _elevationAbs - _elevationCur; -_windageRel = _windageAbs - _windageCur; + _windageCur = GVAR(spinDriftOutput) select GVAR(currentTarget); +} else { + _elevationCur = GVAR(workingMemory) select 10; + _windageCur = GVAR(workingMemory) select 11; -_lead = GVAR(leadOutput) select GVAR(currentTarget); + _elevationRel = _elevationAbs - _elevationCur; + _windageRel = _windageAbs - _windageCur; +}; + +private _lead = GVAR(leadOutput) select GVAR(currentTarget); switch (GVAR(currentScopeUnit)) do { case 0: { - _elevationAbs = _elevationAbs / 3.38; - _windageAbs = _windageAbs / 3.38; + _elevationAbs = MRAD_TO_MOA(_elevationAbs); + _windageAbs = MRAD_TO_MOA(_windageAbs); - _wind2 = _wind2 / 3.38; + _wind2 = MRAD_TO_MOA(_wind2); - _elevationRel = _elevationRel / 3.38; - _windageRel = _windageRel / 3.38; + _elevationRel = MRAD_TO_MOA(_elevationRel); + _windageRel = MRAD_TO_MOA(_windageRel); - _elevationCur = _elevationCur / 3.38; - _windageCur = _windageCur / 3.38; + _elevationCur = MRAD_TO_MOA(_elevationCur); + _windageCur = MRAD_TO_MOA(_windageCur); }; case 2: { _elevationAbs = _elevationAbs * 1.047; @@ -55,13 +65,9 @@ switch (GVAR(currentScopeUnit)) do { _windageCur = _windageCur * 1.047; }; case 3: { - switch (GVAR(workingMemory) select 7) do { - case 0: { _clickSize = 1; }; - case 1: { _clickSize = 1 / 1.047; }; - case 2: { _clickSize = 3.38; }; - }; - _clickNumber = GVAR(workingMemory) select 8; - _clickInterval = _clickSize / _clickNumber; + private _clickSize = [1, 1 / 1.047, MOA_TO_MRAD(1)] select (GVAR(workingMemory) select 7); + private _clickNumber = GVAR(workingMemory) select 8; + private _clickInterval = _clickSize / _clickNumber; _elevationAbs = Round(_elevationAbs / _clickInterval); _windageAbs = Round(_windageAbs / _clickInterval); diff --git a/addons/atragmx/functions/fnc_update_scope_unit.sqf b/addons/atragmx/functions/fnc_update_scope_unit.sqf index 46db8c40c4..b66d0885bb 100644 --- a/addons/atragmx/functions/fnc_update_scope_unit.sqf +++ b/addons/atragmx/functions/fnc_update_scope_unit.sqf @@ -3,10 +3,10 @@ * Updates the scope unit fields * * Arguments: - * Nothing + * None * * Return Value: - * Nothing + * None * * Example: * call ace_atragmx_fnc_update_scope_unit @@ -26,4 +26,4 @@ if (GVAR(currentScopeUnit) == 3) then { } else { ctrlSetText [5000, GVAR(scopeUnits) select GVAR(currentScopeUnit)]; ctrlShow [2001, false]; -}; \ No newline at end of file +}; diff --git a/addons/atragmx/functions/fnc_update_solution_setup.sqf b/addons/atragmx/functions/fnc_update_solution_setup.sqf index 204a844c9d..8850c937a5 100644 --- a/addons/atragmx/functions/fnc_update_solution_setup.sqf +++ b/addons/atragmx/functions/fnc_update_solution_setup.sqf @@ -3,10 +3,10 @@ * Updates all solution setup input fields * * Arguments: - * Nothing + * None * * Return Value: - * Nothing + * None * * Example: * call ace_atragmx_fnc_update_solution_setup diff --git a/addons/atragmx/functions/fnc_update_target.sqf b/addons/atragmx/functions/fnc_update_target.sqf index ef2ef1de5c..c457a5cc21 100644 --- a/addons/atragmx/functions/fnc_update_target.sqf +++ b/addons/atragmx/functions/fnc_update_target.sqf @@ -3,10 +3,10 @@ * Updates all target column input fields * * Arguments: - * Nothing + * None * * Return Value: - * Nothing + * None * * Example: * call ace_atragmx_fnc_update_target diff --git a/addons/atragmx/functions/fnc_update_target_data.sqf b/addons/atragmx/functions/fnc_update_target_data.sqf index 6fa9035a62..3cb6c24c9c 100644 --- a/addons/atragmx/functions/fnc_update_target_data.sqf +++ b/addons/atragmx/functions/fnc_update_target_data.sqf @@ -3,10 +3,10 @@ * Updates all target column input fields * * Arguments: - * Nothing + * None * * Return Value: - * Nothing + * None * * Example: * call ace_atragmx_fnc_update_target diff --git a/addons/atragmx/functions/fnc_update_target_selection.sqf b/addons/atragmx/functions/fnc_update_target_selection.sqf index d9fd6002c9..7ae6256f33 100644 --- a/addons/atragmx/functions/fnc_update_target_selection.sqf +++ b/addons/atragmx/functions/fnc_update_target_selection.sqf @@ -3,10 +3,10 @@ * Updates all input fields based on the currently selected target * * Arguments: - * Nothing + * None * * Return Value: - * Nothing + * None * * Example: * call ace_atragmx_fnc_update_target_selection diff --git a/addons/atragmx/functions/fnc_update_truing_drop_data.sqf b/addons/atragmx/functions/fnc_update_truing_drop_data.sqf new file mode 100644 index 0000000000..c546e78d41 --- /dev/null +++ b/addons/atragmx/functions/fnc_update_truing_drop_data.sqf @@ -0,0 +1,77 @@ +/* + * Author: Ruthberg + * Updates the truing drop data fields + * + * Arguments: + * None + * + * Return Value: + * None + * + * Example: + * call ace_atragmx_fnc_update_truing_drop_data + * + * Public: No + */ +#include "script_component.hpp" + +if (GVAR(currentUnit) == 2) then { + ctrlSetText [18011, Str(Round(GVAR(truingDropRangeData) select 0))]; + ctrlSetText [18012, Str(Round(GVAR(truingDropRangeData) select 1))]; +} else { + ctrlSetText [18011, Str(Round((GVAR(truingDropRangeData) select 0) * 1.0936133))]; + ctrlSetText [18012, Str(Round((GVAR(truingDropRangeData) select 1) * 1.0936133))]; +}; + +if (GVAR(truingDropMode) == 0) then { + GVAR(truingDropDropData) set [0, GVAR(truingDropReferenceDropData) select 0]; +} else { + GVAR(truingDropDropData) set [0, GVAR(truingDropReferenceDropData) select 1]; +}; + +private _dropUnit = GVAR(currentScopeUnit); +if (_dropUnit == 3) then { + switch (GVAR(currentScopeClickUnit)) do { + case 0: { _dropUnit = 1; }; + case 1: { _dropUnit = 2; }; + case 2: { _dropUnit = 0; }; + }; +}; + +private _dropData = +GVAR(truingDropDropData); + +switch (_dropUnit) do { + case 0: { + _dropData set [0, MRAD_TO_MOA(_dropData select 0)]; + _dropData set [1, MRAD_TO_MOA(_dropData select 1)]; + _dropData set [2, MRAD_TO_MOA(_dropData select 2)]; + }; + case 2: { + _dropData set [0, (_dropData select 0) * 1.047]; + _dropData set [1, (_dropData select 1) * 1.047]; + _dropData set [2, (_dropData select 2) * 1.047]; + }; +}; + +ctrlSetText [18006, Str(Round((_dropData select 0) * 100) / 100)]; +ctrlSetText [18013, Str(Round((_dropData select 1) * 100) / 100)]; +ctrlSetText [18014, Str(Round((_dropData select 2) * 100) / 100)]; + +if (GVAR(currentUnit) != 2) then { + ctrlSetText [18007, Str(Round((GVAR(workingMemory) select 1) * 3.2808399))]; + ctrlSetText [18016, Str(Round((GVAR(workingMemory) select 1) * 3.2808399))]; + if (GVAR(truingDropMuzzleVelocity) > 0) then { + ctrlSetText [18016, Str(Round(GVAR(truingDropMuzzleVelocity) * 3.2808399))]; + }; +} else { + ctrlSetText [18007, Str(Round(GVAR(workingMemory) select 1))]; + ctrlSetText [18016, Str(Round(GVAR(workingMemory) select 1))]; + if (GVAR(truingDropMuzzleVelocity) > 0) then { + ctrlSetText [18016, Str(Round(GVAR(truingDropMuzzleVelocity)))]; + }; +}; +ctrlSetText [18008, Str(Round((GVAR(workingMemory) select 15) * 1000) / 1000)]; +ctrlSetText [18017, Str(Round((GVAR(workingMemory) select 15) * 1000) / 1000)]; +if (GVAR(truingDropC1) > 0) then { + ctrlSetText [18017, Str(Round(GVAR(truingDropC1) * 1000) / 1000)]; +}; diff --git a/addons/atragmx/functions/fnc_update_truing_drop_selection.sqf b/addons/atragmx/functions/fnc_update_truing_drop_selection.sqf new file mode 100644 index 0000000000..e00876e4a1 --- /dev/null +++ b/addons/atragmx/functions/fnc_update_truing_drop_selection.sqf @@ -0,0 +1,43 @@ +/* + * Author: Ruthberg + * Updates the truing drop input method + * + * Arguments: + * None + * + * Return Value: + * None + * + * Example: + * call ace_atragmx_fnc_update_truing_drop_selection + * + * Public: No + */ +#include "script_component.hpp" + +#define __dsp (uiNamespace getVariable "ATragMX_Display") + +(__dsp displayCtrl 18009) ctrlEnable true; +(__dsp displayCtrl 18010) ctrlEnable true; + +if (GVAR(truingDropMode) == 0) then { + (__dsp displayCtrl 18009) ctrlEnable false; + { + (__dsp displayCtrl _x) ctrlEnable true; + } forEach [18011, 18013, 18016]; + { + (__dsp displayCtrl _x) ctrlEnable false; + } forEach [18012, 18014, 18017]; + ctrlSetFocus (__dsp displayCtrl 18011); +} else { + (__dsp displayCtrl 18010) ctrlEnable false; + { + (__dsp displayCtrl _x) ctrlEnable true; + } forEach [18012, 18014, 18017]; + { + (__dsp displayCtrl _x) ctrlEnable false; + } forEach [18011, 18013, 18016]; + ctrlSetFocus (__dsp displayCtrl 18012); +}; + +[] call FUNC(update_truing_drop_data); diff --git a/addons/atragmx/functions/fnc_update_unit_selection.sqf b/addons/atragmx/functions/fnc_update_unit_selection.sqf index 77d96bfdd6..2fc5400e27 100644 --- a/addons/atragmx/functions/fnc_update_unit_selection.sqf +++ b/addons/atragmx/functions/fnc_update_unit_selection.sqf @@ -3,10 +3,10 @@ * Updates all input fields based on the currently selected unit * * Arguments: - * Nothing + * None * * Return Value: - * Nothing + * None * * Example: * call ace_atragmx_fnc_update_unit_selection @@ -27,5 +27,7 @@ [] call FUNC(update_atmo_env_data); [] call FUNC(update_target); [] call FUNC(update_target_data); +[] call FUNC(update_muzzle_velocity_data); +[] call FUNC(update_c1_ballistic_coefficient_data); [] call FUNC(update_result); diff --git a/addons/atragmx/functions/fnc_update_zero_range.sqf b/addons/atragmx/functions/fnc_update_zero_range.sqf index 299c321d33..d849fa76c3 100644 --- a/addons/atragmx/functions/fnc_update_zero_range.sqf +++ b/addons/atragmx/functions/fnc_update_zero_range.sqf @@ -3,10 +3,10 @@ * Updates the scope base angle based on the zero range input * * Arguments: - * Nothing + * None * * Return Value: - * Nothing + * None * * Example: * call ace_atragmx_fnc_update_zero_range @@ -15,36 +15,33 @@ */ #include "script_component.hpp" -private ["_scopeBaseAngle"]; -_scopeBaseAngle = (GVAR(workingMemory) select 3); +[] call FUNC(parse_input); -private ["_bulletMass", "_boreHeight", "_airFriction", "_muzzleVelocity", "_bc", "_dragModel", "_atmosphereModel"]; -_bulletMass = GVAR(workingMemory) select 12; -_boreHeight = GVAR(workingMemory) select 5; -_airFriction = GVAR(workingMemory) select 4; -_muzzleVelocity = GVAR(workingMemory) select 1; -_bc = GVAR(workingMemory) select 15; -_dragModel = GVAR(workingMemory) select 16; -_atmosphereModel = GVAR(workingMemory) select 17; +private _bulletMass = GVAR(workingMemory) select 12; +private _boreHeight = GVAR(workingMemory) select 5; +private _airFriction = GVAR(workingMemory) select 4; +private _muzzleVelocity = GVAR(workingMemory) select 1; +private _bc = GVAR(workingMemory) select 15; +private _dragModel = GVAR(workingMemory) select 16; +private _atmosphereModel = GVAR(workingMemory) select 17; +private _zeroRange = GVAR(workingMemory) select 2; +private _altitude = GVAR(altitude); +private _temperature = GVAR(temperature); +private _barometricPressure = GVAR(barometricPressure); +private _relativeHumidity = GVAR(relativeHumidity); -private ["_zeroRange"]; -_zeroRange = Round(parseNumber(ctrlText 120060)); -if (GVAR(currentUnit) == 1) then { - _zeroRange = _zeroRange / 1.0936133; -}; -if (_zeroRange < 10) exitWith { - GVAR(workingMemory) set [2, _zeroRange]; - GVAR(workingMemory) set [3, 0]; +if (!GVAR(atmosphereModeTBH)) then { + _barometricPressure = 1013.25 * (1 - (0.0065 * _altitude) / (273.15 + _temperature + 0.0065 * _altitude)) ^ 5.255754495; + _relativeHumidity = 0.5; }; -private ["_altitude", "_temperature", "_barometricPressure", "_relativeHumidity"]; -_altitude = GVAR(altitude); -_temperature = GVAR(temperature); -_barometricPressure = GVAR(barometricPressure); -_relativeHumidity = GVAR(relativeHumidity); - -private ["_result"]; -_result = [_scopeBaseAngle, _bulletMass, _boreHeight, _airFriction, _muzzleVelocity, _temperature, _barometricPressure, _relativeHumidity, 1000, [0, 0], 0, 0, 0, _zeroRange, _bc, _dragModel, _atmosphereModel, false, 1.5, 0, 0, 0] call FUNC(calculate_solution); +private _scopeBaseAngle = if (!(missionNamespace getVariable [QEGVAR(advanced_ballistics,enabled), false])) then { + private _zeroAngle = "ace_advanced_ballistics" callExtension format ["zeroAngleVanilla:%1:%2:%3:%4", _zeroRange, _muzzleVelocity, _airFriction, _boreHeight]; + (parseNumber _zeroAngle) +} else { + private _zeroAngle = "ace_advanced_ballistics" callExtension format ["zeroAngle:%1:%2:%3:%4:%5:%6:%7:%8:%9", _zeroRange, _muzzleVelocity, _boreHeight, _temperature, _barometricPressure, _relativeHumidity, _bc, _dragModel, _atmosphereModel]; + (parseNumber _zeroAngle) +}; GVAR(workingMemory) set [2, _zeroRange]; -GVAR(workingMemory) set [3, _scopeBaseAngle + (_result select 0) / 60]; +GVAR(workingMemory) set [3, _scopeBaseAngle]; diff --git a/addons/atragmx/initKeybinds.sqf b/addons/atragmx/initKeybinds.sqf index 94704e8132..067f1ba057 100644 --- a/addons/atragmx/initKeybinds.sqf +++ b/addons/atragmx/initKeybinds.sqf @@ -15,11 +15,10 @@ //Add deviceKey entry: -private ["_conditonCode", "_toggleCode", "_closeCode"]; -_conditonCode = { +private _conditonCode = { [] call FUNC(can_show); }; -_toggleCode = { +private _toggleCode = { // Conditions: canInteract if !([ACE_player, objNull, ["notOnMap", "isNotInside", "isNotSitting"]] call EFUNC(common,canInteractWith)) exitWith {}; if (GVAR(active)) exitWith { @@ -28,7 +27,7 @@ _toggleCode = { // Statement [] call FUNC(create_dialog); }; -_closeCode = { +private _closeCode = { if (GVAR(active)) exitWith { closeDialog 0; }; diff --git a/addons/atragmx/script_component.hpp b/addons/atragmx/script_component.hpp index 0eae4ee5a0..7b6aaa74cd 100644 --- a/addons/atragmx/script_component.hpp +++ b/addons/atragmx/script_component.hpp @@ -16,4 +16,11 @@ #include "\z\ace\addons\main\script_macros.hpp" -#define ATRAGMX_PROFILE_NAMESPACE_VERSION 1.7 +#define MOA_TO_MRAD(d) (d * 3.43774677) // Conversion factor: 54 / (5 * PI) +#define MRAD_TO_MOA(d) (d * 0.29088821) // Conversion factor: (5 * PI) / 54 +#define DEG_TO_MOA(d) (d * 60) // Conversion factor: 60 +#define MOA_TO_DEG(d) (d / 60) // Conversion factor: 1 / 60 +#define DEG_TO_MRAD(d) (d * 17.45329252) // Conversion factor: (50 * PI) / 9 +#define MRAD_TO_DEG(d) (d / 17.45329252) // Conversion factor: 9 / (50 * PI) + +#define ATRAGMX_PROFILE_NAMESPACE_VERSION 2.1 diff --git a/addons/atragmx/stringtable.xml b/addons/atragmx/stringtable.xml index 8c99e374e0..4c11ea8add 100644 --- a/addons/atragmx/stringtable.xml +++ b/addons/atragmx/stringtable.xml @@ -1,4 +1,4 @@ - + @@ -13,6 +13,9 @@ ATragMX ATragMX ATragMX + ATragMX + ATragMX + ATragMX Open ATragMX @@ -26,6 +29,9 @@ Otevřít ATragMX Abrir ATragMX ATragMX を開く + ATragMX 열기 + 開啟ATragMX + 开启ATragMX Rugged PDA with ATragMX @@ -39,6 +45,9 @@ PDA s ATragMX PDA Robusto com ATragMX ATragMX 付きの携行型端末 + ATragMX가 달린 PDA + 裝有軍用PDA的ATragMX + 装有军用PDA的ATragMX Open ATragMX @@ -52,6 +61,9 @@ Otevřít ATragMX Abrir ATragMX ATragMX を開く + ATragMX 열기 + 開啟ATragMX + 开启ATragMX - \ No newline at end of file + diff --git a/addons/attach/CfgVehicles.hpp b/addons/attach/CfgVehicles.hpp index 1e0c0f3e71..84ca6ee290 100644 --- a/addons/attach/CfgVehicles.hpp +++ b/addons/attach/CfgVehicles.hpp @@ -6,21 +6,19 @@ displayName = CSTRING(AttachDetach); \ condition = QUOTE(_this call FUNC(canAttach)); \ insertChildren = QUOTE(_this call FUNC(getChildrenAttachActions)); \ - exceptions[] = {}; \ + exceptions[] = {"isNotSwimming"}; \ showDisabled = 0; \ priority = 0; \ icon = QPATHTOF(UI\attach_ca.paa); \ - distance = 4.5; \ }; \ class GVAR(DetachVehicle) { \ displayName = CSTRING(Detach); \ condition = QUOTE(_this call FUNC(canDetach)); \ statement = QUOTE(_this call FUNC(detach) ); \ - exceptions[] = {}; \ + exceptions[] = {"isNotSwimming"}; \ showDisabled = 0; \ priority = 0.1; \ icon = QPATHTOF(UI\detach_ca.paa); \ - distance = 4.5; \ }; \ }; \ }; @@ -57,7 +55,7 @@ class CfgVehicles { displayName = CSTRING(AttachDetach); condition = QUOTE(_this call FUNC(canAttach)); insertChildren = QUOTE(_this call FUNC(getChildrenAttachActions)); - exceptions[] = {"isNotDragging"}; + exceptions[] = {"isNotDragging", "isNotSwimming"}; showDisabled = 0; priority = 5; icon = QPATHTOF(UI\attach_ca.paa); @@ -66,7 +64,7 @@ class CfgVehicles { displayName = CSTRING(Detach); condition = QUOTE(_this call FUNC(canDetach)); statement = QUOTE(_this call FUNC(detach)); - exceptions[] = {"isNotDragging"}; + exceptions[] = {"isNotDragging", "isNotSwimming"}; showDisabled = 0; priority = 5; icon = QPATHTOF(UI\detach_ca.paa); diff --git a/addons/attach/CfgWeapons.hpp b/addons/attach/CfgWeapons.hpp index cc50b3be5e..34969d5c14 100644 --- a/addons/attach/CfgWeapons.hpp +++ b/addons/attach/CfgWeapons.hpp @@ -1,6 +1,6 @@ class CfgWeapons { class ACE_ItemCore; - class InventoryItem_Base_F; + class CBA_MiscItem_ItemInfo; class ACE_IR_Strobe_Item: ACE_ItemCore { ACE_attachable = "ACE_IR_Strobe_Effect"; @@ -11,8 +11,8 @@ class CfgWeapons { model = QPATHTOF(data\ace_IRStrobe.p3d); picture = QPATHTOF(UI\irstrobe_item.paa); - class ItemInfo: InventoryItem_Base_F { + class ItemInfo: CBA_MiscItem_ItemInfo { mass = 1; }; }; -}; \ No newline at end of file +}; diff --git a/addons/attach/XEH_preInit.sqf b/addons/attach/XEH_preInit.sqf index a7feade1c3..b47cf6628d 100644 --- a/addons/attach/XEH_preInit.sqf +++ b/addons/attach/XEH_preInit.sqf @@ -2,6 +2,8 @@ ADDON = false; +PREP_RECOMPILE_START; #include "XEH_PREP.hpp" +PREP_RECOMPILE_END; ADDON = true; diff --git a/addons/attach/functions/fnc_attach.sqf b/addons/attach/functions/fnc_attach.sqf index 366a43d900..d91102ee5f 100644 --- a/addons/attach/functions/fnc_attach.sqf +++ b/addons/attach/functions/fnc_attach.sqf @@ -8,7 +8,7 @@ * 2: Array containing a string of the attachable item * * Return Value: - * Nothing + * None * * Example: * [bob, bob, ["light"]] call ace_attach_fnc_attach; @@ -21,29 +21,27 @@ params ["_attachToVehicle","_unit","_args", ["_silentScripted", false]]; _args params [["_itemClassname","", [""]]]; TRACE_4("params",_attachToVehicle,_unit,_itemClassname,_silentScripted); -private ["_itemVehClass", "_onAtachText", "_selfAttachPosition", "_attachedItem", "_tempObject", "_actionID", "_model"]; - //Sanity Check (_unit has item in inventory, not over attach limit) if ((_itemClassname == "") || {(!_silentScripted) && {!(_this call FUNC(canAttach))}}) exitWith {ERROR("Tried to attach, but check failed");}; -_itemVehClass = getText (configFile >> "CfgWeapons" >> _itemClassname >> "ACE_Attachable"); -_onAtachText = getText (configFile >> "CfgWeapons" >> _itemClassname >> "displayName"); +private _itemVehClass = getText (configFile >> "CfgWeapons" >> _itemClassname >> "ACE_Attachable"); +private _onAttachText = getText (configFile >> "CfgWeapons" >> _itemClassname >> "displayName"); if (_itemVehClass == "") then { _itemVehClass = getText (configFile >> "CfgMagazines" >> _itemClassname >> "ACE_Attachable"); - _onAtachText = getText (configFile >> "CfgMagazines" >> _itemClassname >> "displayName"); + _onAttachText = getText (configFile >> "CfgMagazines" >> _itemClassname >> "displayName"); }; if (_itemVehClass == "") exitWith {ERROR("no ACE_Attachable for Item");}; -_onAtachText = format [localize LSTRING(Item_Attached), _onAtachText]; +private _onAttachText = format [localize LSTRING(Item_Attached), _onAttachText]; if (_unit == _attachToVehicle) then { //Self Attachment - _attachedItem = _itemVehClass createVehicle [0,0,0]; + private _attachedItem = _itemVehClass createVehicle [0,0,0]; _attachedItem attachTo [_unit, [0.05, -0.09, 0.1], "leftshoulder"]; if (!_silentScripted) then { _unit removeItem _itemClassname; // Remove item - [_onAtachText] call EFUNC(common,displayTextStructured); + [_onAttachText] call EFUNC(common,displayTextStructured); }; _unit setVariable [QGVAR(attached), [[_attachedItem, _itemClassname]], true]; } else { @@ -54,11 +52,10 @@ if (_unit == _attachToVehicle) then { //Self Attachment [{[localize LSTRING(PlaceAction), ""] call EFUNC(interaction,showMouseHint)}, []] call CBA_fnc_execNextFrame; _unit setVariable [QGVAR(placeActionEH), [_unit, "DefaultAction", {true}, {GVAR(placeAction) = PLACE_APPROVE;}] call EFUNC(common,AddActionEventHandler)]; - _actionID = _unit addAction [format ["%1", localize LSTRING(CancelAction)], {GVAR(placeAction) = PLACE_CANCEL}]; + private _actionID = _unit addAction [format ["%1", localize LSTRING(CancelAction)], {GVAR(placeAction) = PLACE_CANCEL}]; //Display to show virtual object: - private []; - _model = getText (configFile >> "CfgAmmo" >> _itemVehClass >> "model"); + private _model = getText (configFile >> "CfgAmmo" >> _itemVehClass >> "model"); if (_model == "") then { _model = getText (configFile >> "CfgVehicles" >> _itemVehClass >> "model"); }; @@ -68,23 +65,22 @@ if (_unit == _attachToVehicle) then { //Self Attachment ((uiNamespace getVariable [QGVAR(virtualAmmoDisplay), displayNull]) displayCtrl 800851) ctrlSetModel _model; [{ - private ["_angle", "_dir", "_screenPos", "_realDistance", "_up", "_virtualPos", "_virtualPosASL", "_lineInterection"]; params ["_args","_idPFH"]; - _args params ["_unit","_attachToVehicle","_itemClassname","_itemVehClass","_onAtachText","_actionID"]; + _args params ["_unit","_attachToVehicle","_itemClassname","_itemVehClass","_onAttachText","_actionID"]; - _virtualPosASL = (eyePos _unit) vectorAdd (positionCameraToWorld [0,0,0.6]) vectorDiff (positionCameraToWorld [0,0,0]); + private _virtualPosASL = (eyePos _unit) vectorAdd (positionCameraToWorld [0,0,0.6]) vectorDiff (positionCameraToWorld [0,0,0]); if (cameraView == "EXTERNAL") then { _virtualPosASL = _virtualPosASL vectorAdd ((positionCameraToWorld [0.3,0,0]) vectorDiff (positionCameraToWorld [0,0,0])); }; - _virtualPos = _virtualPosASL call EFUNC(common,ASLToPosition); - _lineInterection = lineIntersects [eyePos ACE_player, _virtualPosASL, ACE_player]; + private _virtualPos = _virtualPosASL call EFUNC(common,ASLToPosition); + private _lineInterection = lineIntersects [eyePos ACE_player, _virtualPosASL, ACE_player]; //Don't allow placing in a bad position: if (_lineInterection && {GVAR(placeAction) == PLACE_APPROVE}) then {GVAR(placeAction) = PLACE_WAITING;}; if ((GVAR(placeAction) != PLACE_WAITING) || {_unit != ACE_player} || - {!([_unit, _attachToVehicle, []] call EFUNC(common,canInteractWith))} || + {!([_unit, _attachToVehicle, ["isNotSwimming"]] call EFUNC(common,canInteractWith))} || {!([_attachToVehicle, _unit, _itemClassname] call FUNC(canAttach))}) then { [_idPFH] call CBA_fnc_removePerFrameHandler; @@ -96,7 +92,7 @@ if (_unit == _attachToVehicle) then { //Self Attachment (QGVAR(virtualAmmo) call BIS_fnc_rscLayer) cutText ["", "PLAIN"]; if (GVAR(placeAction) == PLACE_APPROVE) then { - [_unit, _attachToVehicle, _itemClassname, _itemVehClass, _onAtachText, _virtualPos] call FUNC(placeApprove); + [_unit, _attachToVehicle, _itemClassname, _itemVehClass, _onAttachText, _virtualPos] call FUNC(placeApprove); }; } else { //Show the virtual object: @@ -104,18 +100,18 @@ if (_unit == _attachToVehicle) then { //Self Attachment ((uiNamespace getVariable [QGVAR(virtualAmmoDisplay), displayNull]) displayCtrl 800851) ctrlShow false; } else { ((uiNamespace getVariable [QGVAR(virtualAmmoDisplay), displayNull]) displayCtrl 800851) ctrlShow true; - _screenPos = worldToScreen _virtualPos; + private _screenPos = worldToScreen _virtualPos; if (_screenPos isEqualTo []) exitWith { ((uiNamespace getVariable [QGVAR(virtualAmmoDisplay), displayNull]) displayCtrl 800851) ctrlShow false; }; - _realDistance = (_virtualPos distance (positionCameraToWorld [0,0,0])) / ((call CBA_fnc_getFov) select 1); + private _realDistance = (_virtualPos distance (positionCameraToWorld [0,0,0])) / ((call CBA_fnc_getFov) select 1); _screenPos = [(_screenPos select 0), _realDistance, (_screenPos select 1)]; ((uiNamespace getVariable [QGVAR(virtualAmmoDisplay), displayNull]) displayCtrl 800851) ctrlSetPosition _screenPos; - _dir = (positionCameraToWorld [0,0,1]) vectorFromTo (positionCameraToWorld [0,0,0]); - _angle = asin (_dir select 2); - _up = [0, cos _angle, sin _angle]; + private _dir = (positionCameraToWorld [0,0,1]) vectorFromTo (positionCameraToWorld [0,0,0]); + private _angle = asin (_dir select 2); + private _up = [0, cos _angle, sin _angle]; ((uiNamespace getVariable [QGVAR(virtualAmmoDisplay), displayNull]) displayCtrl 800851) ctrlSetModelDirAndUp [[1,0,0], _up]; }; }; - }, 0, [_unit, _attachToVehicle, _itemClassname, _itemVehClass, _onAtachText, _actionID]] call CBA_fnc_addPerFrameHandler; + }, 0, [_unit, _attachToVehicle, _itemClassname, _itemVehClass, _onAttachText, _actionID]] call CBA_fnc_addPerFrameHandler; }; diff --git a/addons/attach/functions/fnc_canAttach.sqf b/addons/attach/functions/fnc_canAttach.sqf index 37d92e8908..d862088fcd 100644 --- a/addons/attach/functions/fnc_canAttach.sqf +++ b/addons/attach/functions/fnc_canAttach.sqf @@ -21,13 +21,11 @@ params ["_attachToVehicle","_player","_args"]; _args params [["_itemClassname","", [""]]]; TRACE_3("params",_attachToVehicle,_player,_itemClassname); -private ["_attachLimit", "_attachedObjects"]; - -_attachLimit = [6, 1] select (_player == _attachToVehicle); -_attachedObjects = _attachToVehicle getVariable [QGVAR(attached), []]; +private _attachLimit = [6, 1] select (_player == _attachToVehicle); +private _attachedObjects = _attachToVehicle getVariable [QGVAR(attached), []]; ((_player == _attachToVehicle) || {canStand _player}) && -{(_attachToVehicle distance _player) < 7} && -{alive _attachToVehicle} && -{(count _attachedObjects) < _attachLimit} && +{(_attachToVehicle distance _player) < 10} && +{alive _attachToVehicle} && +{(count _attachedObjects) < _attachLimit} && {_itemClassname in ((itemsWithMagazines _player) + [""])}; diff --git a/addons/attach/functions/fnc_canDetach.sqf b/addons/attach/functions/fnc_canDetach.sqf index d9796a5a5c..bd9d7453cb 100644 --- a/addons/attach/functions/fnc_canDetach.sqf +++ b/addons/attach/functions/fnc_canDetach.sqf @@ -21,12 +21,10 @@ TRACE_2("params",_attachToVehicle,_unit); if ((vehicle _unit) != _unit) exitWith {false}; -_attachedList = _attachToVehicle getVariable [QGVAR(attached), []]; +private _attachedList = _attachToVehicle getVariable [QGVAR(attached), []]; if ((count _attachedList) == 0) exitWith {false}; -private ["_inRange"]; - -_inRange = false; +private _inRange = false; { _x params ["_xObject"]; if (isNull _xObject) exitWith { diff --git a/addons/attach/functions/fnc_detach.sqf b/addons/attach/functions/fnc_detach.sqf index 4ff4f9fbd6..b3d565570f 100644 --- a/addons/attach/functions/fnc_detach.sqf +++ b/addons/attach/functions/fnc_detach.sqf @@ -7,7 +7,7 @@ * 1: unit doing the detaching (player) * * Return Value: - * Nothing + * None * * Example: * [car, bob] call ace_attach_fnc_detach @@ -19,16 +19,14 @@ params ["_attachToVehicle","_unit"], TRACE_2("params",_attachToVehicle,_unit); -private ["_attachedList", "_itemDisplayName", "_attachedObject", "_attachedIndex", "_itemName", "_minDistance", "_isChemlight"]; +private _attachedList = _attachToVehicle getVariable [QGVAR(attached), []]; -_attachedList = _attachToVehicle getVariable [QGVAR(attached), []]; - -_attachedObject = objNull; -_attachedIndex = -1; -_itemName = ""; +private _attachedObject = objNull; +private _attachedIndex = -1; +private _itemName = ""; //Find closest attached object -_minDistance = 1000; +private _minDistance = 1000; { _x params ["_xObject", "_xItemName"]; @@ -45,7 +43,7 @@ _minDistance = 1000; if (isNull _attachedObject || {_itemName == ""}) exitWith {ERROR("Could not find attached object")}; // Check if item is a chemlight -_isChemlight = _attachedObject isKindOf "Chemlight_base"; +private _isChemlight = _attachedObject isKindOf "Chemlight_base"; // Exit if can't add the item if (!(_unit canAdd _itemName) && {!_isChemlight}) exitWith { @@ -69,7 +67,7 @@ if (toLower _itemName in ["b_ir_grenade", "o_ir_grenade", "i_ir_grenade"]) then detach _x; deleteVehicle _x; } forEach (attachedObjects _attachedObject); - + // Delete attached item detach _attachedObject; deleteVehicle _attachedObject; @@ -80,7 +78,7 @@ _attachedList deleteAt _attachedIndex; _attachToVehicle setVariable [QGVAR(attached), _attachedList, true]; // Display message -_itemDisplayName = getText (configFile >> "CfgWeapons" >> _itemName >> "displayName"); +private _itemDisplayName = getText (configFile >> "CfgWeapons" >> _itemName >> "displayName"); if (_itemDisplayName == "") then { _itemDisplayName = getText (configFile >> "CfgMagazines" >> _itemName >> "displayName"); }; diff --git a/addons/attach/functions/fnc_getChildrenAttachActions.sqf b/addons/attach/functions/fnc_getChildrenAttachActions.sqf index 0b2e4e705c..c9bec90aac 100644 --- a/addons/attach/functions/fnc_getChildrenAttachActions.sqf +++ b/addons/attach/functions/fnc_getChildrenAttachActions.sqf @@ -17,21 +17,20 @@ */ #include "script_component.hpp" -private ["_listed", "_actions", "_item", "_displayName", "_picture", "_action"]; params ["_target","_player"]; TRACE_2("params",_target,_player); -_listed = []; -_actions = []; +private _listed = []; +private _actions = []; { if !(_x in _listed) then { _listed pushBack _x; - _item = ConfigFile >> "CfgMagazines" >> _x; + private _item = ConfigFile >> "CfgMagazines" >> _x; if (getText (_item >> "ACE_Attachable") != "") then { - _displayName = getText(_item >> "displayName"); - _picture = getText(_item >> "picture"); - _action = [_x, _displayName, _picture, {[{_this call FUNC(attach)}, _this] call CBA_fnc_execNextFrame}, {_this call FUNC(canAttach)}, {}, [_x]] call EFUNC(interact_menu,createAction); + private _displayName = getText(_item >> "displayName"); + private _picture = getText(_item >> "picture"); + private _action = [_x, _displayName, _picture, {[{_this call FUNC(attach)}, _this] call CBA_fnc_execNextFrame}, {true}, {}, [_x]] call EFUNC(interact_menu,createAction); _actions pushBack [_action, [], _target]; }; }; @@ -40,11 +39,11 @@ _actions = []; { if !(_x in _listed) then { _listed pushBack _x; - _item = ConfigFile >> "CfgWeapons" >> _x; + private _item = ConfigFile >> "CfgWeapons" >> _x; if (getText (_item >> "ACE_Attachable") != "") then { - _displayName = getText(_item >> "displayName"); - _picture = getText(_item >> "picture"); - _action = [_x, _displayName, _picture, {[{_this call FUNC(attach)}, _this] call CBA_fnc_execNextFrame}, {_this call FUNC(canAttach)}, {}, [_x]] call EFUNC(interact_menu,createAction); + private _displayName = getText(_item >> "displayName"); + private _picture = getText(_item >> "picture"); + private _action = [_x, _displayName, _picture, {[{_this call FUNC(attach)}, _this] call CBA_fnc_execNextFrame}, {true}, {}, [_x]] call EFUNC(interact_menu,createAction); _actions pushBack [_action, [], _target]; }; }; diff --git a/addons/attach/functions/fnc_placeApprove.sqf b/addons/attach/functions/fnc_placeApprove.sqf index 922136107e..dea5c7b3ab 100644 --- a/addons/attach/functions/fnc_placeApprove.sqf +++ b/addons/attach/functions/fnc_placeApprove.sqf @@ -16,7 +16,7 @@ * 5: Starting Pos of dummy item * * Return Value: - * Nothing + * None * * Example: * No @@ -25,38 +25,47 @@ */ #include "script_component.hpp" -private ["_startingOffset", "_startDistanceFromCenter", "_closeInUnitVector", "_closeInMax", "_closeInMin", "_closeInDistance", "_endPosTestOffset", "_endPosTest", "_doesIntersect", "_startingPosShifted", "_startASL", "_endPosShifted", "_endASL", "_attachedObject", "_attachList"]; +params ["_unit", "_attachToVehicle", "_itemClassname", "_itemVehClass", "_onAttachText", "_startingPosition"]; +TRACE_6("params",_unit,_attachToVehicle,_itemClassname,_itemVehClass,_onAttachText,_startingPosition); -params ["_unit", "_attachToVehicle", "_itemClassname", "_itemVehClass", "_onAtachText", "_startingPosition"]; -TRACE_6("params",_unit,_attachToVehicle,_itemClassname,_itemVehClass,_onAtachText,_startingPosition); +private _startingOffset = _attachToVehicle worldToModel _startingPosition; -_startingOffset = _attachToVehicle worldToModel _startingPosition; +private _startDistanceFromCenter = vectorMagnitude _startingOffset; +private _closeInUnitVector = vectorNormalized (_startingOffset vectorFromTo [0,0,0]); -_startDistanceFromCenter = vectorMagnitude _startingOffset; -_closeInUnitVector = vectorNormalized (_startingOffset vectorFromTo [0,0,0]); - -_closeInMax = _startDistanceFromCenter; -_closeInMin = 0; +private _closeInMax = _startDistanceFromCenter; +private _closeInMin = 0; while {(_closeInMax - _closeInMin) > 0.01} do { - _closeInDistance = (_closeInMax + _closeInMin) / 2; + private _closeInDistance = (_closeInMax + _closeInMin) / 2; // systemChat format ["Trying %1 from %2 start %3", _closeInDistance, [_closeInMax, _closeInMin], _startDistanceFromCenter]; - _endPosTestOffset = _startingOffset vectorAdd (_closeInUnitVector vectorMultiply _closeInDistance); + private _endPosTestOffset = _startingOffset vectorAdd (_closeInUnitVector vectorMultiply _closeInDistance); _endPosTestOffset set [2, (_startingOffset select 2)]; - _endPosTest = _attachToVehicle modelToWorldVisual _endPosTestOffset; + private _endPosTest = _attachToVehicle modelToWorldVisual _endPosTestOffset; - _doesIntersect = false; + private _doesIntersect = false; { if (_doesIntersect) exitWith {}; - _startingPosShifted = _startingPosition vectorAdd _x; - _startASL = if (surfaceIsWater _startingPosShifted) then {_startingPosShifted} else {ATLtoASL _startingPosShifted}; + private _startingPosShifted = _startingPosition vectorAdd _x; + private _startASL = if (surfaceIsWater _startingPosShifted) then {_startingPosShifted} else {ATLtoASL _startingPosShifted}; { - _endPosShifted = _endPosTest vectorAdd _x; - _endASL = if (surfaceIsWater _startingPosShifted) then {_endPosShifted} else {ATLtoASL _endPosShifted}; + private _endPosShifted = _endPosTest vectorAdd _x; + private _endASL = if (surfaceIsWater _startingPosShifted) then {_endPosShifted} else {ATLtoASL _endPosShifted}; - //Uncomment to see the lazor show, and see how the scanning works: - // drawLine3D [_startingPosShifted, _endPosShifted, [1,0,0,1]]; - if (_attachToVehicle in lineIntersectsWith [_startASL, _endASL, _unit]) exitWith {_doesIntersect = true}; + #ifdef DRAW_ATTACH_SCAN + [{ + params ["_args", "_idPFH"]; + _args params ["_startingPosShifted", "_endPosShifted", "_timeAdded"]; + drawLine3D [_startingPosShifted, _endPosShifted, [1,0,0,1]]; + if (_timeAdded + 5 < CBA_missionTime) then { + [_idPFH] call CBA_fnc_removePerFrameHandler; + }; + }, 0, [_startingPosShifted, _endPosShifted, CBA_missionTime]] call CBA_fnc_addPerFrameHandler; + #endif + + // Default max results is 1, so take only first subarray and select parentObject (object itself or parent of proxy) + private _intersectObject = ((lineIntersectsSurfaces [_startASL, _endASL, _unit]) param [0, objNull]) param [3, objNull]; + if (_attachToVehicle == _intersectObject) exitWith {_doesIntersect = true}; } forEach [[0,0,0.045], [0,0,-0.045], [0,0.045,0], [0,-0.045,0], [0.045,0,0], [-0.045,0,0]]; } forEach [[0,0,0], [0,0,0.05], [0,0,-0.05]]; @@ -67,7 +76,7 @@ while {(_closeInMax - _closeInMin) > 0.01} do { }; }; -_closeInDistance = (_closeInMax + _closeInMin) / 2; +private _closeInDistance = (_closeInMax + _closeInMin) / 2; //Checks (too close to center or can't attach) if (((_startDistanceFromCenter - _closeInDistance) < 0.1) || {!([_attachToVehicle, _unit, _itemClassname] call FUNC(canAttach))}) exitWith { @@ -79,17 +88,17 @@ if (((_startDistanceFromCenter - _closeInDistance) < 0.1) || {!([_attachToVehicl _closeInDistance = (_closeInDistance - 0.0085); //Create New 'real' Object -_endPosTestOffset = _startingOffset vectorAdd (_closeInUnitVector vectorMultiply _closeInDistance); +private _endPosTestOffset = _startingOffset vectorAdd (_closeInUnitVector vectorMultiply _closeInDistance); _endPosTestOffset set [2, (_startingOffset select 2)]; -_attachedObject = _itemVehClass createVehicle (getPos _unit); +private _attachedObject = _itemVehClass createVehicle (getPos _unit); _attachedObject attachTo [_attachToVehicle, _endPosTestOffset]; //Remove Item from inventory _unit removeItem _itemClassname; //Add Object to attached array -_attachList = _attachToVehicle getVariable [QGVAR(attached), []]; +private _attachList = _attachToVehicle getVariable [QGVAR(attached), []]; _attachList pushBack [_attachedObject, _itemClassname]; _attachToVehicle setVariable [QGVAR(attached), _attachList, true]; -[_onAtachText] call EFUNC(common,displayTextStructured); +[_onAttachText] call EFUNC(common,displayTextStructured); diff --git a/addons/attach/script_component.hpp b/addons/attach/script_component.hpp index b4fa09f5dd..2b341f106a 100644 --- a/addons/attach/script_component.hpp +++ b/addons/attach/script_component.hpp @@ -2,6 +2,7 @@ #define COMPONENT_BEAUTIFIED Attach #include "\z\ace\addons\main\script_mod.hpp" +// #define DRAW_ATTACH_SCAN // #define DEBUG_MODE_FULL // #define DISABLE_COMPILE_CACHE // #define ENABLE_PERFORMANCE_COUNTERS diff --git a/addons/attach/stringtable.xml b/addons/attach/stringtable.xml index 07768fce69..a8e8c23cdf 100644 --- a/addons/attach/stringtable.xml +++ b/addons/attach/stringtable.xml @@ -12,7 +12,10 @@ Attacca l'oggetto Tárgy hozzácsatolása Прикрепить предмет - &gt;&gt; アイテムを取り付ける + アイテムを取り付ける + 물건 부착 + 附掛裝備>> + 附挂装备>> Attach @@ -26,6 +29,9 @@ Hozzácsatolás Прикрепить 取り付ける + 부착 + 附掛 + 附挂 Detach item @@ -39,6 +45,9 @@ Tárgy lecsatolása Отсоединить アイテムを外す + 분리 + 取下裝備 + 取下装备 IR Strobe Attached @@ -52,6 +61,9 @@ Infravörös jeladó hozzácsatolva ИК-маяк прикреплён 赤外線ストロボを取り付ける + 적외선 스트로브 부착됨 + 已附掛紅外線頻閃器 + 已附挂红外线频闪器 IR Strobe Detached @@ -65,6 +77,9 @@ Infravörös jeladó lecsatolva ИК-маяк отсоединён 赤外線ストロボを外す + 적외선 스트로브 분리됨 + 已取下紅外線頻閃器 + 已取下红外线频闪器 IR Grenade Attached @@ -78,6 +93,9 @@ Infravörös gránát hozzácsatolva ИК-граната прикреплена 赤外線グレネードを取り付ける + 적외선 수류탄 부착됨 + 已附掛紅外線手榴彈 + 已附挂红外线手榴弹 IR Grenade Detached @@ -91,6 +109,9 @@ Infravörös gránát lecsatolva ИК-граната отсоединена 赤外線グレネードを外す + 적외선 수류탄 분리됨 + 已取下紅外線手榴彈 + 已取下红外线手榴弹 Chemlight Attached @@ -104,6 +125,9 @@ Chemlight hozzácsatolva Химсвет прикреплён ケミライトを取り付け + 켐라이트 부착됨 + 已附掛螢光棒 + 已附挂萤光棒 Chemlight Detached @@ -117,6 +141,9 @@ Chemlight hozzácsatolva Химсвет отсоединён ケミライトを外す + 켐라이트 분리됨 + 已取下螢光棒 + 已取下萤光棒 No inventory space @@ -130,6 +157,9 @@ Nincs több hely В инвентаре нет места インベントリに空きがない + 넣을 공간이 없음 + 無可用空間 + 无可用空间 IR Strobe @@ -143,6 +173,9 @@ Infravörös jeladó ИК-маяк 赤外線ストロボ + 적외선 스트로브 + 紅外線頻閃器 + 红外线频闪器 IR Strobe allows you to signal your position through a pulsating beacon only visible with NVGs. @@ -156,6 +189,9 @@ Az infravörös jeladóval megjelölheted a helyzetedet úgy, hogy annak pulzáló fénye csak éjjellátó készülékkel látható. ИК-маяк позволяет сигнализировать о своём местоположении через пульсирующий свет, видимый только через ПНВ. 赤外線ストロボはあなたの位置を知らせますが、夜間暗視装置を介してでしか見れません。 + 적외선 스트로브는 자신의 위치를 반짝이면서 표시합니다. 이는 야간투시경으로 밖에 보지 못합니다. + 紅外線閃頻器,藉由紅外線閃頻信號來辨識你的位置,僅能使用夜視系統來辨識紅外線信號 + 红外线闪频器,藉由红外线闪频信号来辨识你的位置,仅能使用夜视系统来辨识红外线信号 Place @@ -169,6 +205,9 @@ Elhelyez Установить 置く + 두기 + 放置 + 放置 Cancel @@ -182,6 +221,9 @@ Mégse Отмена やめる + 취소 + 取消 + 取消 Attach Failed @@ -195,6 +237,9 @@ Hozzácsatolás sikertelen Non si attacca 取り付けに失敗した + 부착 실패 + 附掛失敗 + 附挂失败 %1<br/>Attached @@ -207,7 +252,10 @@ %1<br/>attaccata %1<br/>hozzácsatolva %1<br/>присоединен(-а) - %1&lt;br/&gt; を取り付けた + %1<br/>を取り付けた + %1<br/>부착됨 + %1<br/>已附掛 + %1<br/>已附挂 %1<br/>Detached @@ -220,7 +268,10 @@ %1<br/>staccata %1<br/>lecsatolva %1<br/>отсоединен(-а) - %1&lt;br/&gt; を外した + %1<br/>を外した + %1<br/>분리됨 + %1<br/>已取下 + %1<br/>已取下 - \ No newline at end of file + diff --git a/addons/backpacks/XEH_preInit.sqf b/addons/backpacks/XEH_preInit.sqf index a7feade1c3..b47cf6628d 100644 --- a/addons/backpacks/XEH_preInit.sqf +++ b/addons/backpacks/XEH_preInit.sqf @@ -2,6 +2,8 @@ ADDON = false; +PREP_RECOMPILE_START; #include "XEH_PREP.hpp" +PREP_RECOMPILE_END; ADDON = true; diff --git a/addons/backpacks/functions/fnc_backpackOpened.sqf b/addons/backpacks/functions/fnc_backpackOpened.sqf index 8b4e05c20e..0b94b391f0 100644 --- a/addons/backpacks/functions/fnc_backpackOpened.sqf +++ b/addons/backpacks/functions/fnc_backpackOpened.sqf @@ -3,13 +3,16 @@ * Someone opened your backpack. Play sound and camshake. Execute locally. * * Arguments: - * 0: Who accessed your inventory? (Object) - * 1: Unit that wields the backpack (Object) - * 2: The backpack object (Object) + * 0: Who accessed your inventory? + * 1: Unit that wields the backpack + * 2: The backpack object * * Return Value: * None * + * Example: + * [bob, kevin, backpack] call ace_backpacks_fnc_backpackOpened + * * Public: No */ #include "script_component.hpp" diff --git a/addons/backpacks/functions/fnc_isBackpack.sqf b/addons/backpacks/functions/fnc_isBackpack.sqf index aa12b85ad9..80550290f2 100644 --- a/addons/backpacks/functions/fnc_isBackpack.sqf +++ b/addons/backpacks/functions/fnc_isBackpack.sqf @@ -8,6 +8,9 @@ * Return Value: * Boolean * + * Example: + * [bob] call ace_backpacks_fnc_isBackpack + * * Public: Yes */ #include "script_component.hpp" diff --git a/addons/backpacks/functions/fnc_onOpenInventory.sqf b/addons/backpacks/functions/fnc_onOpenInventory.sqf index 0857f6b7ab..b229bbb111 100644 --- a/addons/backpacks/functions/fnc_onOpenInventory.sqf +++ b/addons/backpacks/functions/fnc_onOpenInventory.sqf @@ -7,7 +7,10 @@ * 1: Backpack * * Return Value: - * false. Always open the inventory dialog. (Bool) + * false. Always open the inventory dialog. + * + * Example: + * [bob, backpack] call ace_backpacks_fnc_onOpenInventory * * Public: No */ diff --git a/addons/ballistics/CfgAmmo.hpp b/addons/ballistics/CfgAmmo.hpp index 0819f8aa4b..acbb8a5953 100644 --- a/addons/ballistics/CfgAmmo.hpp +++ b/addons/ballistics/CfgAmmo.hpp @@ -7,9 +7,7 @@ class CfgAmmo { }; class B_556x45_Ball : BulletBase { - airFriction=-0.00126466; - hit=8; - typicalSpeed=750; + airFriction=-0.00130094; tracerScale = 1; tracerStartTime=0.073; // M856 tracer burns out to 800m tracerEndTime=1.57123; // Time in seconds calculated with ballistics calculator @@ -25,11 +23,7 @@ class CfgAmmo { ACE_barrelLengths[]={210.82, 238.76, 269.24, 299.72, 330.2, 360.68, 391.16, 419.1, 449.58, 480.06, 508.0, 609.6}; }; class ACE_556x45_Ball_Mk262 : B_556x45_Ball { - airFriction=-0.00109563; - caliber=0.8; - deflecting=18; - hit=11; - typicalSpeed=836; + airFriction=-0.00111805; ACE_caliber=5.69; ACE_bulletLength=23.012; ACE_bulletMass=4.9896; @@ -42,11 +36,7 @@ class CfgAmmo { ACE_barrelLengths[]={190.5, 368.3, 457.2, 508.0}; }; class ACE_556x45_Ball_Mk318 : B_556x45_Ball { - airFriction=-0.00123318; - caliber=0.8; - deflecting=18; - hit=9; - typicalSpeed=886; + airFriction=-0.0012588; ACE_caliber=5.69; ACE_bulletLength=23.012; ACE_bulletMass=4.0176; @@ -59,11 +49,8 @@ class CfgAmmo { ACE_barrelLengths[]={254.0, 393.7, 508.0}; }; class ACE_556x45_Ball_M995_AP : B_556x45_Ball { - airFriction=-0.00123272; + airFriction=-0.00126182; caliber=1.6; - deflecting=18; - hit=6; - typicalSpeed=869; ACE_caliber=5.69; ACE_bulletLength=23.012; ACE_bulletMass=4.5359237; @@ -79,12 +66,8 @@ class CfgAmmo { class ACE_B_556x45_Ball_Tracer_Dim: B_556x45_Ball_Tracer_Red { nvgOnly = 1; }; - class ACE_545x39_Ball_7N6M : B_556x45_Ball { - airFriction=-0.00114744; - caliber=0.6; - deflecting=18; - hit=7; - typicalSpeed=880; + class B_545x39_Ball_F : BulletBase { + airFriction=-0.00119458; ACE_caliber=5.588; ACE_bulletLength=21.59; ACE_bulletMass=3.42792; @@ -93,35 +76,27 @@ class CfgAmmo { ACE_velocityBoundaries[]={}; ACE_standardAtmosphere="ICAO"; ACE_dragModel=7; - ACE_muzzleVelocities[]={780, 880, 920}; - ACE_barrelLengths[]={254.0, 414.02, 508.0}; - }; - class B_556x45_Ball_Tracer_Green; - class ACE_545x39_Ball_7T3M : B_556x45_Ball_Tracer_Green { - airFriction=-0.00114744; - caliber=0.6; - deflecting=18; - hit=7; - typicalSpeed=883; - tracerStartTime=0.073; // 7T3M tracer burns out to 850m - tracerEndTime=1.70236; // Time in seconds calculated with ballistics calculator - ACE_caliber=5.588; - ACE_bulletLength=21.59; - ACE_bulletMass=3.22704; - ACE_ammoTempMuzzleVelocityShifts[]={-26.55, -25.47, -22.85, -20.12, -16.98, -12.80, -7.64, -1.53, 5.96, 15.17, 26.19}; - ACE_ballisticCoefficients[]={0.168}; - ACE_velocityBoundaries[]={}; - ACE_standardAtmosphere="ICAO"; - ACE_dragModel=7; - ACE_muzzleVelocities[]={785, 883, 925}; - ACE_barrelLengths[]={254.0, 414.02, 508.0}; + ACE_muzzleVelocities[]={735, 883, 892}; + ACE_barrelLengths[]={206.5, 414.02, 508.0}; }; class B_56x15_dual: BulletBase { tracerScale = 0.5; }; + class B_580x42_Ball_F: BulletBase { + airFriction=-0.00121087; + ACE_caliber=5.9944; + ACE_bulletLength=24.2; + ACE_bulletMass=4.15; + ACE_ammoTempMuzzleVelocityShifts[]={-26.55, -25.47, -22.85, -20.12, -16.98, -12.80, -7.64, -1.53, 5.96, 15.17, 26.19}; + ACE_ballisticCoefficients[]={0.156}; + ACE_velocityBoundaries[]={}; + ACE_standardAtmosphere="ICAO"; + ACE_dragModel=7; + ACE_muzzleVelocities[]={790, 930, 950}; + ACE_barrelLengths[]={369.0, 463.0, 600.0}; + }; class B_65x39_Caseless : BulletBase { - airFriction=-0.00075308; - typicalSpeed=800; + airFriction=-0.00077363; tracerScale = 1.1; //1.0; ACE_caliber=6.706; ACE_bulletLength=32.893; @@ -143,8 +118,7 @@ class CfgAmmo { nvgOnly = 1; }; class ACE_65x47_Ball_Scenar: B_65x39_Caseless { - airFriction=-0.00067037; - typicalSpeed=820 ; + airFriction=-0.00069003; caliber=0.9; ACE_caliber=6.706; ACE_bulletLength=34.646; @@ -158,8 +132,7 @@ class CfgAmmo { ACE_barrelLengths[]={254.0, 406.4, 508.0, 609.6, 660.4}; }; class ACE_65_Creedmor_Ball: B_65x39_Caseless { - airFriction=-0.00060887; - typicalSpeed=860 ; + airFriction=-0.00062437; caliber=1.1; ACE_caliber=6.706; ACE_bulletLength=36.22; @@ -177,9 +150,7 @@ class CfgAmmo { tracerScale = 1.1; //1.0; }; class B_762x51_Ball : BulletBase { - airFriction=-0.00100957; - typicalSpeed=833; - hit=9; + airFriction=-0.00103711; tracerScale = 1.2; //0.6; tracerStartTime=0.073; // Based on the British L5A1 which burns out to 1000m tracerEndTime=2.15957; // Time in seconds calculated with ballistics calculator @@ -199,7 +170,7 @@ class CfgAmmo { nvgOnly = 1; }; class ACE_762x51_Ball_M118LR : B_762x51_Ball { - airFriction=-0.00082828; + airFriction=-0.00085157; caliber=1.8; hit=16; typicalSpeed=790; @@ -215,7 +186,7 @@ class CfgAmmo { ACE_barrelLengths[]={406.4, 508.0, 609.6, 660.4}; }; class ACE_762x51_Ball_Mk316_Mod_0 : B_762x51_Ball { - airFriction=-0.00082029; + airFriction=-0.00084311; caliber=1.8; hit=16; typicalSpeed=790; @@ -231,7 +202,7 @@ class CfgAmmo { ACE_barrelLengths[]={406.4, 508.0, 609.6, 660.4}; }; class ACE_762x51_Ball_Mk319_Mod_0 : B_762x51_Ball { - airFriction=-0.00102338; + airFriction=-0.00104515; caliber=1.5; hit=14; typicalSpeed=900; @@ -247,7 +218,7 @@ class CfgAmmo { ACE_barrelLengths[]={330.2, 406.4, 508.0}; }; class ACE_762x51_Ball_M993_AP : B_762x51_Ball { - airFriction=-0.00107148; + airFriction=-0.0010939; caliber=2.2; hit=11; typicalSpeed=910; @@ -263,7 +234,7 @@ class CfgAmmo { ACE_barrelLengths[]={330.2, 406.4, 508.0}; }; class ACE_762x51_Ball_Subsonic : B_762x51_Ball { - airFriction=-0.00049899; + airFriction=-0.00060194; caliber=1; hit=6; typicalSpeed=320; @@ -278,56 +249,8 @@ class CfgAmmo { ACE_muzzleVelocities[]={305, 325, 335, 340}; ACE_barrelLengths[]={406.4, 508.0, 609.6, 660.4}; }; - class ACE_30_06_M1_Ball : B_762x51_Ball { - airFriction=-0.00080900; - typicalSpeed=800; - caliber=2.0; - hit=10; - ACE_caliber=7.823; - ACE_bulletLength=30.734; - ACE_bulletMass=11.2752; - ACE_ammoTempMuzzleVelocityShifts[]={-26.55, -25.47, -22.85, -20.12, -16.98, -12.80, -7.64, -1.53, 5.96, 15.17, 26.19}; - ACE_ballisticCoefficients[]={0.494}; - ACE_velocityBoundaries[]={}; - ACE_standardAtmosphere="ASM"; - ACE_dragModel=1; - ACE_muzzleVelocities[]={700, 785, 800, 830, 840}; - ACE_barrelLengths[]={254.0, 406.4, 508.0, 609.6, 660.4}; - }; - class ACE_7_Remington_Magnum_Ball : B_762x51_Ball { - airFriction=-0.00056738; - typicalSpeed=820; - caliber=2.1; - hit=8; - ACE_caliber=7.214; - ACE_bulletLength=38.837; - ACE_bulletMass=11.664; - ACE_ammoTempMuzzleVelocityShifts[]={-26.55, -25.47, -22.85, -20.12, -16.98, -12.80, -7.64, -1.53, 5.96, 15.17, 26.19}; - ACE_ballisticCoefficients[]={0.345}; - ACE_velocityBoundaries[]={}; - ACE_standardAtmosphere="ICAO"; - ACE_dragModel=7; - ACE_muzzleVelocities[]={720, 780, 812, 822, 830}; - ACE_barrelLengths[]={254.0, 406.4, 508.0, 609.6, 660.4}; - }; - class ACE_243_Winchester_Ball : B_762x51_Ball { - airFriction=-0.00067875; - typicalSpeed=915; - caliber=2.3; - hit=6; - ACE_caliber=6.172; - ACE_bulletLength=32.563; - ACE_bulletMass=11.664; - ACE_ammoTempMuzzleVelocityShifts[]={-26.55, -25.47, -22.85, -20.12, -16.98, -12.80, -7.64, -1.53, 5.96, 15.17, 26.19}; - ACE_ballisticCoefficients[]={0.278}; - ACE_velocityBoundaries[]={}; - ACE_standardAtmosphere="ICAO"; - ACE_dragModel=7; - ACE_muzzleVelocities[]={830, 875, 900, 915, 920}; - ACE_barrelLengths[]={254.0, 406.4, 508.0, 609.6, 660.4}; - }; class ACE_762x67_Ball_Mk248_Mod_0 : B_762x51_Ball { - airFriction=-0.00070530; + airFriction=-0.00072468; caliber=1.8; hit=17; typicalSpeed=900; @@ -343,7 +266,7 @@ class CfgAmmo { ACE_barrelLengths[]={508.0, 609.6, 660.4}; }; class ACE_762x67_Ball_Mk248_Mod_1 : B_762x51_Ball { - airFriction=-0.00061188; + airFriction=-0.00063027; caliber=1.9; hit=18; typicalSpeed=867; @@ -359,7 +282,7 @@ class CfgAmmo { ACE_barrelLengths[]={508.0, 609.6, 660.4}; }; class ACE_762x67_Ball_Berger_Hybrid_OTM : B_762x51_Ball { - airFriction=-0.00053733; + airFriction=-0.00055262; caliber=2.0; hit=19; typicalSpeed=853; @@ -375,24 +298,7 @@ class CfgAmmo { ACE_barrelLengths[]={508.0, 609.6, 660.4}; }; class B_762x54_Ball: B_762x51_Ball { - airFriction=-0.00100023; - typicalSpeed=820; - ACE_caliber=7.925; - ACE_bulletLength=28.956; - ACE_bulletMass=9.8496; - ACE_ammoTempMuzzleVelocityShifts[]={-26.55, -25.47, -22.85, -20.12, -16.98, -12.80, -7.64, -1.53, 5.96, 15.17, 26.19}; - ACE_ballisticCoefficients[]={0.4}; - ACE_velocityBoundaries[]={}; - ACE_standardAtmosphere="ICAO"; - ACE_dragModel=1; - ACE_muzzleVelocities[]={700, 800, 820, 833}; - ACE_barrelLengths[]={406.4, 508.0, 609.6, 660.4}; - }; - class ACE_762x54_Ball_7N14 : B_762x51_Ball { - airFriction=-0.00100023; - caliber=1.5; - hit=15; - typicalSpeed=820; + airFriction=-0.00102329; ACE_caliber=7.925; ACE_bulletLength=28.956; ACE_bulletMass=9.8496; @@ -406,9 +312,7 @@ class CfgAmmo { }; class B_762x54_Tracer_Green; class ACE_762x54_Ball_7T2 : B_762x54_Tracer_Green { - airFriction=-0.00103989; - caliber=1.5; - hit=15; + airFriction=-0.00106104; typicalSpeed=800; tracerStartTime=0.073; // Based on the 7T2 which burns three seconds tracerEndTime=3; @@ -423,27 +327,8 @@ class CfgAmmo { ACE_muzzleVelocities[]={680, 750, 798, 800}; ACE_barrelLengths[]={406.4, 508.0, 609.6, 660.4}; }; - class ACE_762x35_Ball : B_762x51_Ball { - airFriction=-0.00128942; - caliber=1.5; - hit=11; - typicalSpeed=790; - ACE_caliber=7.823; - ACE_bulletLength=29.286; - ACE_bulletMass=8.1; - ACE_ammoTempMuzzleVelocityShifts[]={-26.55, -25.47, -22.85, -20.12, -16.98, -12.80, -7.64, -1.53, 5.96, 15.17, 26.19}; - ACE_ballisticCoefficients[]={0.349, 0.338, 0.330, 0.310}; - ACE_velocityBoundaries[]={792, 610, 488}; - ACE_standardAtmosphere="ICAO"; - ACE_dragModel=1; - ACE_muzzleVelocities[]={620, 655, 675}; - ACE_barrelLengths[]={228.6, 406.4, 508.0}; - }; - class ACE_762x39_Ball : B_762x51_Ball { - airFriction=-0.00151621; - hit=12; - caliber=1.5; - typicalSpeed=716; + class B_762x39_Ball_F : BulletBase { + airFriction=-0.00154815; ACE_caliber=7.823; ACE_bulletLength=28.956; ACE_bulletMass=7.9704; @@ -455,29 +340,9 @@ class CfgAmmo { ACE_muzzleVelocities[]={650, 716, 750}; ACE_barrelLengths[]={254.0, 414.02, 508.0}; }; - class ACE_762x39_Ball_57N231P : B_762x54_Tracer_Green { - airFriction=-0.00151621; - hit=12; - caliber=1.5; - typicalSpeed=716; - tracerStartTime = 0.073; //57N231P tracer burns out to 800m - tracerEndTime = 2.082; //Time in seconds calculated with ballistics calculator - ACE_caliber=7.823; - ACE_bulletLength=28.956; - ACE_bulletMass=7.5816; - ACE_ammoTempMuzzleVelocityShifts[]={-26.55, -25.47, -22.85, -20.12, -16.98, -12.80, -7.64, -1.53, 5.96, 15.17, 26.19}; - ACE_ballisticCoefficients[]={0.275}; - ACE_velocityBoundaries[]={}; - ACE_standardAtmosphere="ICAO"; - ACE_dragModel=1; - ACE_muzzleVelocities[]={650, 716, 750}; - ACE_barrelLengths[]={254.0, 414.02, 508.0}; - }; class B_9x21_Ball : BulletBase { - airFriction=-0.00226847; - typicalSpeed=390; + airFriction=-0.00211064; tracerScale = 0.5; - hit=6; ACE_caliber=9.042; ACE_bulletLength=15.494; ACE_bulletMass=7.452; @@ -486,31 +351,14 @@ class CfgAmmo { ACE_velocityBoundaries[]={}; ACE_standardAtmosphere="ICAO"; ACE_dragModel=1; - ACE_muzzleVelocities[]={440, 460, 480}; - ACE_barrelLengths[]={101.6, 127.0, 228.6}; + ACE_muzzleVelocities[]={380, 390, 420, 435}; + ACE_barrelLengths[]={93.5, 101.6, 127.0, 228.6}; }; class B_9x21_Ball_Tracer_Green: B_9x21_Ball { tracerScale = 0.5; }; - class ACE_9x18_Ball_57N181S : B_9x21_Ball { - hit=5; - airFriction=-0.00190333; - typicalSpeed=298; - ACE_caliber=9.271; - ACE_bulletLength=15.494; - ACE_bulletMass=6.00048; - ACE_ammoTempMuzzleVelocityShifts[]={-2.655, -2.547, -2.285, -2.012, -1.698, -1.280, -0.764, -0.153, 0.596, 1.517, 2.619}; - ACE_ballisticCoefficients[]={0.125}; - ACE_velocityBoundaries[]={}; - ACE_standardAtmosphere="ICAO"; - ACE_dragModel=1; - ACE_muzzleVelocities[]={298, 330, 350}; - ACE_barrelLengths[]={96.52, 127.0, 228.6}; - }; class ACE_9x19_Ball : B_9x21_Ball { - airFriction=-0.0018577; - typicalSpeed=370; - hit=6; + airFriction=-0.00201185; ACE_caliber=9.017; ACE_bulletLength=15.494; ACE_bulletMass=8.0352; @@ -522,54 +370,8 @@ class CfgAmmo { ACE_muzzleVelocities[]={340, 370, 400}; ACE_barrelLengths[]={101.6, 127.0, 228.6}; }; - class ACE_10x25_Ball : B_9x21_Ball { - airFriction=-0.00181928; - typicalSpeed=425; - hit=7; - ACE_caliber=12.7; - ACE_bulletLength=19.406; - ACE_bulletMass=10.692; - ACE_ammoTempMuzzleVelocityShifts[]={-2.655, -2.547, -2.285, -2.012, -1.698, -1.280, -0.764, -0.153, 0.596, 1.517, 2.619}; - ACE_ballisticCoefficients[]={0.189}; - ACE_velocityBoundaries[]={}; - ACE_standardAtmosphere="ICAO"; - ACE_dragModel=1; - ACE_muzzleVelocities[]={360, 400, 430}; - ACE_barrelLengths[]={101.6, 117.094, 228.6}; - }; - class ACE_765x17_Ball: B_9x21_Ball { - airFriction=-0.00163356; - typicalSpeed=282; - hit=7; - ACE_caliber=7.938; - ACE_bulletLength=15.494; - ACE_bulletMass=4.212; - ACE_ammoTempMuzzleVelocityShifts[]={-2.655, -2.547, -2.285, -2.012, -1.698, -1.280, -0.764, -0.153, 0.596, 1.517, 2.619}; - ACE_ballisticCoefficients[]={0.118}; - ACE_velocityBoundaries[]={}; - ACE_standardAtmosphere="ASM"; - ACE_dragModel=1; - ACE_muzzleVelocities[]={282, 300, 320}; - ACE_barrelLengths[]={101.6, 127.0, 228.6}; - }; - class ACE_303_Ball : ACE_762x51_Ball_M118LR { - airFriction=-0.0008349; - typicalSpeed=761; - caliber=2.0; - ACE_caliber=7.899; - ACE_bulletLength=31.166; - ACE_bulletMass=11.2752; - ACE_ammoTempMuzzleVelocityShifts[]={-26.55, -25.47, -22.85, -20.12, -16.98, -12.80, -7.64, -1.53, 5.96, 15.17, 26.19}; - ACE_ballisticCoefficients[]={0.499, 0.493, 0.48}; - ACE_velocityBoundaries[]={671, 549}; - ACE_standardAtmosphere="ASM"; - ACE_dragModel=1; - ACE_muzzleVelocities[]={748, 761, 765}; - ACE_barrelLengths[]={508.0, 609.6, 660.4}; - }; class B_93x64_Ball : BulletBase { - airFriction=-0.00108571; - typicalSpeed=880; + airFriction=-0.00110727; ACE_caliber=9.296; ACE_bulletLength=34.29; ACE_bulletMass=14.904; @@ -583,39 +385,40 @@ class CfgAmmo { }; class B_408_Ball : BulletBase { timeToLive=10; - airFriction=-0.00038944; - typicalSpeed=910; - tracerScale = 1.3; //1.2; + airFriction=-0.00046249; + tracerScale = 1.3; ACE_caliber=10.363; - ACE_bulletLength=54.0; - ACE_bulletMass=26.568; + ACE_bulletLength=55.1942; + ACE_bulletMass=27.1507; // 419 gr ACE_transonicStabilityCoef=1; ACE_ammoTempMuzzleVelocityShifts[]={-26.55, -25.47, -22.85, -20.12, -16.98, -12.80, -7.64, -1.53, 5.96, 15.17, 26.19}; - ACE_ballisticCoefficients[]={0.97}; + ACE_ballisticCoefficients[]={0.434}; ACE_velocityBoundaries[]={}; - ACE_standardAtmosphere="ASM"; - ACE_dragModel=1; - ACE_muzzleVelocities[]={910}; + ACE_standardAtmosphere="ICAO"; + ACE_dragModel=7; + ACE_muzzleVelocities[]={867}; ACE_barrelLengths[]={736.6}; }; - class ACE_106x83mm_Ball : B_408_Ball { + class ACE_408_Ball : BulletBase { timeToLive=10; - airFriction=-0.00052047; - ACE_caliber=10.566; - ACE_bulletLength=53.061; - ACE_bulletMass=25.7904; + airFriction=-0.00065414; + typicalSpeed=1067; + tracerScale = 1.3; + ACE_caliber=10.363; + ACE_bulletLength=41.4528; + ACE_bulletMass=19.7637; // 305 gr + ACE_transonicStabilityCoef=1; ACE_ammoTempMuzzleVelocityShifts[]={-26.55, -25.47, -22.85, -20.12, -16.98, -12.80, -7.64, -1.53, 5.96, 15.17, 26.19}; - ACE_ballisticCoefficients[]={0.72}; + ACE_ballisticCoefficients[]={0.279}; ACE_velocityBoundaries[]={}; - ACE_standardAtmosphere="ASM"; - ACE_dragModel=1; - ACE_muzzleVelocities[]={960}; + ACE_standardAtmosphere="ICAO"; + ACE_dragModel=7; + ACE_muzzleVelocities[]={1067}; ACE_barrelLengths[]={736.6}; }; class B_338_Ball : BulletBase { timeToLive=10; - airFriction=-0.00059133; - typicalSpeed=915; + airFriction=-0.00060841; ACE_caliber=8.585; ACE_bulletLength=39.573; ACE_bulletMass=16.2; @@ -628,8 +431,7 @@ class CfgAmmo { ACE_barrelLengths[]={508.0, 660.4, 711.2}; }; class B_338_NM_Ball : BulletBase { - airFriction=-0.00052201; - typicalSpeed=820; + airFriction=-0.00053639; ACE_caliber=8.585; ACE_bulletLength=43.18; ACE_bulletMass=19.44; @@ -643,13 +445,13 @@ class CfgAmmo { }; class ACE_338_Ball : B_338_Ball { timeToLive=10; - airFriction=-0.00052190; + airFriction=-0.00055706; typicalSpeed=826; ACE_caliber=8.585; ACE_bulletLength=43.18; ACE_bulletMass=19.44; ACE_ammoTempMuzzleVelocityShifts[]={-26.55, -25.47, -22.85, -20.12, -16.98, -12.80, -7.64, -1.53, 5.96, 15.17, 26.19}; - ACE_ballisticCoefficients[]={0.381}; + ACE_ballisticCoefficients[]={0.368}; ACE_velocityBoundaries[]={}; ACE_standardAtmosphere="ICAO"; ACE_dragModel=7; @@ -658,26 +460,25 @@ class CfgAmmo { }; class ACE_338_Ball_API526 : B_338_Ball { timeToLive=10; - airFriction=-0.00069611; + airFriction=-0.0006922; caliber=2.8; typicalSpeed=895; ACE_caliber=8.585; ACE_bulletLength=38.989; ACE_bulletMass=16.3941242; ACE_ammoTempMuzzleVelocityShifts[]={-26.55, -25.47, -22.85, -20.12, -16.98, -12.80, -7.64, -1.53, 5.96, 15.17, 26.19}; - ACE_ballisticCoefficients[]={0.560}; + ACE_ballisticCoefficients[]={0.290}; ACE_velocityBoundaries[]={}; ACE_standardAtmosphere="ICAO"; - ACE_dragModel=1; - ACE_muzzleVelocities[]={880, 915, 925}; - ACE_barrelLengths[]={508.0, 660.4, 711.2}; + ACE_dragModel=7; + ACE_muzzleVelocities[]={880, 895, 900}; + ACE_barrelLengths[]={508.0, 685.8, 711.2}; }; class B_127x33_Ball: BulletBase { tracerScale = 1.3; //1.2; }; class B_127x54_Ball : BulletBase { - airFriction=-0.00019268; - typicalSpeed=300; + airFriction=-0.00019568; tracerScale = 1.3;// ACE_caliber=12.954; ACE_bulletLength=64.516; @@ -692,8 +493,7 @@ class CfgAmmo { }; class B_127x99_Ball : BulletBase { timeToLive=10; - airFriction=-0.00057503; - typicalSpeed=900; + airFriction=-0.00058679; tracerScale = 1.3; //1.2; ACE_caliber=12.954; ACE_bulletLength=58.674; @@ -706,10 +506,9 @@ class CfgAmmo { ACE_muzzleVelocities[]={900}; ACE_barrelLengths[]={736.6}; }; - class ACE_127x99_API : BulletBase { + class ACE_127x99_API : B_127x99_Ball { timeToLive=10; - airFriction=-0.00057503; - typicalSpeed=900; + airFriction=-0.00058679; tracerScale = 1.3;// hit=25; caliber=4.0; @@ -726,8 +525,7 @@ class CfgAmmo { }; class ACE_127x99_Ball_AMAX : B_127x99_Ball { timeToLive=10; - airFriction=-0.00036645; - typicalSpeed=860; + airFriction=-0.00037397; caliber=3.0; ACE_caliber=12.954; ACE_bulletLength=64.516; @@ -742,8 +540,7 @@ class CfgAmmo { }; class B_127x108_Ball : BulletBase { timeToLive=10; - airFriction=-0.00063800; - typicalSpeed=820; + airFriction=-0.00065098; tracerScale = 1.3; //1.5; ACE_caliber=12.979; ACE_bulletLength=64.008; @@ -756,9 +553,12 @@ class CfgAmmo { ACE_muzzleVelocities[]={820}; ACE_barrelLengths[]={728.98}; }; + class B_127x108_APDS: B_127x108_Ball { + typicalSpeed = 820; + airFriction = -0.00065098; + }; class B_45ACP_Ball : BulletBase { - airFriction=-0.00081221; - typicalSpeed=250; + airFriction=-0.00082143; tracerScale = 0.6; ACE_caliber=11.481; ACE_bulletLength=17.272; @@ -771,6 +571,19 @@ class CfgAmmo { ACE_muzzleVelocities[]={230, 250, 285}; ACE_barrelLengths[]={101.6, 127.0, 228.6}; }; + class B_50BW_Ball_F : BulletBase { + airFriction=-0.00205896; + ACE_caliber=12.7; + ACE_bulletLength=24.13; + ACE_bulletMass=21.7076; + ACE_ammoTempMuzzleVelocityShifts[]={-2.655, -2.547, -2.285, -2.012, -1.698, -1.280, -0.764, -0.153, 0.596, 1.517, 2.619}; + ACE_ballisticCoefficients[]={0.21}; + ACE_velocityBoundaries[]={}; + ACE_standardAtmosphere="ASM"; + ACE_dragModel=1; + ACE_muzzleVelocities[]={510, 550, 596}; + ACE_barrelLengths[]={304.8, 406.4, 609.6}; + }; class B_19mm_HE: BulletBase { tracerScale = 1; }; diff --git a/addons/ballistics/CfgMagazines.hpp b/addons/ballistics/CfgMagazines.hpp index 931a6c2309..2b9088408b 100644 --- a/addons/ballistics/CfgMagazines.hpp +++ b/addons/ballistics/CfgMagazines.hpp @@ -2,6 +2,15 @@ class CfgMagazines { class CA_Magazine; + class 30Rnd_580x42_Mag_F: CA_Magazine { + initSpeed = 930; + }; + class 100Rnd_580x42_Mag_F: 30Rnd_580x42_Mag_F { + initSpeed = 930; + }; + class 20Rnd_650x39_Cased_Mag_F: CA_Magazine { + initSpeed = 760; + }; class 30Rnd_65x39_caseless_mag: CA_Magazine { initSpeed = 760; }; @@ -47,6 +56,10 @@ class CfgMagazines { descriptionShort = CSTRING(30Rnd_65x39_caseless_green_mag_Tracer_DimDescription); }; + class 30Rnd_545x39_Mag_F: CA_Magazine { + initSpeed = 735; + }; + class 30Rnd_556x45_Stanag: CA_Magazine { }; class ACE_30Rnd_556x45_Stanag_M995_AP_mag: 30Rnd_556x45_Stanag { @@ -84,6 +97,14 @@ class CfgMagazines { picture = "\A3\weapons_f\data\ui\m_20stanag_red_ca.paa"; }; + class 200Rnd_556x45_Box_F: CA_Magazine { + initSpeed = 872; + }; + + class 30Rnd_762x39_Mag_F: CA_Magazine { + initSpeed = 715; + }; + class 20Rnd_762x51_Mag: CA_Magazine { initSpeed = 833; }; @@ -219,17 +240,35 @@ class CfgMagazines { class ACE_30Rnd_65x47_Scenar_mag: 30Rnd_65x39_caseless_mag { author = ECSTRING(common,ACETeam); ammo = "ACE_65x47_Ball_Scenar"; + initSpeed = 761; displayName = CSTRING(30Rnd_65x47_Scenar_mag_Name); displayNameShort = CSTRING(30Rnd_65x47_Scenar_mag_NameShort); descriptionShort = CSTRING(30Rnd_65x47_Scenar_mag_Description); }; + class ACE_20Rnd_65x47_Scenar_mag: 20Rnd_650x39_Cased_Mag_F { + author = ECSTRING(common,ACETeam); + ammo = "ACE_65x47_Ball_Scenar"; + initSpeed = 779; + displayName = CSTRING(20Rnd_65x47_Scenar_mag_Name); + displayNameShort = CSTRING(20Rnd_65x47_Scenar_mag_NameShort); + descriptionShort = CSTRING(20Rnd_65x47_Scenar_mag_Description); + }; class ACE_30Rnd_65_Creedmor_mag: 30Rnd_65x39_caseless_mag { author = ECSTRING(common,ACETeam); ammo = "ACE_65_Creedmor_Ball"; + initSpeed = 815; displayName = CSTRING(30Rnd_65_Creedmor_mag_Name); displayNameShort = CSTRING(30Rnd_65_Creedmor_mag_NameShort); descriptionShort = CSTRING(30Rnd_65_Creedmor_mag_Description); }; + class ACE_20Rnd_65_Creedmor_mag: 20Rnd_650x39_Cased_Mag_F { + author = ECSTRING(common,ACETeam); + ammo = "ACE_65_Creedmor_Ball"; + initSpeed = 808; + displayName = CSTRING(20Rnd_65_Creedmor_mag_Name); + displayNameShort = CSTRING(20Rnd_65_Creedmor_mag_NameShort); + descriptionShort = CSTRING(20Rnd_65_Creedmor_mag_Description); + }; class 10Rnd_338_Mag; class ACE_10Rnd_338_300gr_HPBT_Mag: 10Rnd_338_Mag { author = ECSTRING(common,ACETeam); @@ -247,8 +286,23 @@ class CfgMagazines { descriptionShort = CSTRING(10Rnd_338_API526_Mag_Description); initSpeed = 880; }; + + class 7Rnd_408_Mag: CA_Magazine { + initSpeed = 867; + }; + class ACE_7Rnd_408_305gr_Mag: 7Rnd_408_Mag { + author = ECSTRING(common,ACETeam); + ammo = "ACE_408_Ball"; + displayName = CSTRING(7Rnd_408_305gr_Mag_Name); + displayNameShort = CSTRING(7Rnd_408_305gr_Mag_NameShort); + descriptionShort = CSTRING(7Rnd_408_305gr_Mag_Description); + initSpeed = 1067; + }; class 5Rnd_127x108_Mag; + class 5Rnd_127x108_APDS_Mag: 5Rnd_127x108_Mag { + initSpeed = 820; + }; class ACE_5Rnd_127x99_Mag: 5Rnd_127x108_Mag { author = ECSTRING(common,ACETeam); ammo = "B_127x99_Ball"; @@ -276,7 +330,7 @@ class CfgMagazines { class 30Rnd_9x21_Mag: CA_Magazine { - initSpeed = 450; + initSpeed = 390; }; class ACE_30Rnd_9x19_mag: 30Rnd_9x21_Mag { author = ECSTRING(common,ACETeam); @@ -287,6 +341,10 @@ class CfgMagazines { initSpeed = 370; }; + class 10Rnd_50BW_Mag_F: CA_Magazine { + initSpeed = 552; + }; + class 11Rnd_45ACP_Mag: CA_Magazine { initSpeed = 250; }; @@ -308,7 +366,10 @@ class CfgMagazines { }; class 16Rnd_9x21_Mag: 30Rnd_9x21_Mag { - initSpeed = 450; + initSpeed = 390; + }; + class 10Rnd_9x21_Mag: 16Rnd_9x21_Mag { + initSpeed = 390; }; class ACE_16Rnd_9x19_mag: 16Rnd_9x21_Mag { author = ECSTRING(common,ACETeam); diff --git a/addons/ballistics/CfgVehicles.hpp b/addons/ballistics/CfgVehicles.hpp index bb50dcdc2e..c6a40301f2 100644 --- a/addons/ballistics/CfgVehicles.hpp +++ b/addons/ballistics/CfgVehicles.hpp @@ -13,7 +13,9 @@ class CfgVehicles { class NATO_Box_Base; class Box_NATO_Wps_F: NATO_Box_Base { class TransportMagazines { + MACRO_ADDMAGAZINE(ACE_20Rnd_65x47_Scenar_mag,4); MACRO_ADDMAGAZINE(ACE_30Rnd_65x47_Scenar_mag,4); + MACRO_ADDMAGAZINE(ACE_20Rnd_65_Creedmor_mag,4); MACRO_ADDMAGAZINE(ACE_30Rnd_65_Creedmor_mag,4); }; }; @@ -26,6 +28,7 @@ class CfgVehicles { MACRO_ADDMAGAZINE(ACE_30Rnd_556x45_Stanag_Tracer_Dim,1); MACRO_ADDMAGAZINE(ACE_10Rnd_338_300gr_HPBT_Mag,4); MACRO_ADDMAGAZINE(ACE_10Rnd_338_API526_Mag,4); + MACRO_ADDMAGAZINE(ACE_7Rnd_408_305gr_Mag,4); MACRO_ADDMAGAZINE(ACE_5Rnd_127x99_Mag,4); MACRO_ADDMAGAZINE(ACE_5Rnd_127x99_API_Mag,4); MACRO_ADDMAGAZINE(ACE_5Rnd_127x99_AMAX_Mag,4); @@ -34,7 +37,9 @@ class CfgVehicles { class Box_NATO_Ammo_F: NATO_Box_Base { class TransportMagazines { + MACRO_ADDMAGAZINE(ACE_20Rnd_65x47_Scenar_mag,4); MACRO_ADDMAGAZINE(ACE_30Rnd_65x47_Scenar_mag,4); + MACRO_ADDMAGAZINE(ACE_20Rnd_65_Creedmor_mag,4); MACRO_ADDMAGAZINE(ACE_30Rnd_65_Creedmor_mag,4); MACRO_ADDMAGAZINE(ACE_10Rnd_762x51_M118LR_Mag,4); MACRO_ADDMAGAZINE(ACE_20Rnd_762x51_M118LR_Mag,4); @@ -46,6 +51,7 @@ class CfgVehicles { MACRO_ADDMAGAZINE(ACE_20Rnd_762x51_Mag_Tracer_Dim,4); MACRO_ADDMAGAZINE(ACE_10Rnd_338_300gr_HPBT_Mag,4); MACRO_ADDMAGAZINE(ACE_10Rnd_338_API526_Mag,4); + MACRO_ADDMAGAZINE(ACE_7Rnd_408_305gr_Mag,4); MACRO_ADDMAGAZINE(ACE_5Rnd_127x99_Mag,4); MACRO_ADDMAGAZINE(ACE_5Rnd_127x99_API_Mag,4); MACRO_ADDMAGAZINE(ACE_5Rnd_127x99_AMAX_Mag,4); @@ -67,6 +73,7 @@ class CfgVehicles { MACRO_ADDMAGAZINE(ACE_20Rnd_762x51_M993_AP_Mag,4); MACRO_ADDMAGAZINE(ACE_10Rnd_338_300gr_HPBT_Mag,4); MACRO_ADDMAGAZINE(ACE_10Rnd_338_API526_Mag,4); + MACRO_ADDMAGAZINE(ACE_7Rnd_408_305gr_Mag,4); MACRO_ADDMAGAZINE(ACE_5Rnd_127x99_Mag,4); MACRO_ADDMAGAZINE(ACE_5Rnd_127x99_API_Mag,4); MACRO_ADDMAGAZINE(ACE_5Rnd_127x99_AMAX_Mag,4); @@ -76,7 +83,9 @@ class CfgVehicles { class ReammoBox_F; class B_supplyCrate_F: ReammoBox_F { class TransportMagazines { + MACRO_ADDMAGAZINE(ACE_20Rnd_65x47_Scenar_mag,4); MACRO_ADDMAGAZINE(ACE_30Rnd_65x47_Scenar_mag,4); + MACRO_ADDMAGAZINE(ACE_20Rnd_65_Creedmor_mag,4); MACRO_ADDMAGAZINE(ACE_30Rnd_65_Creedmor_mag,4); MACRO_ADDMAGAZINE(ACE_10Rnd_762x51_M118LR_Mag,4); MACRO_ADDMAGAZINE(ACE_20Rnd_762x51_M118LR_Mag,4); @@ -92,7 +101,9 @@ class CfgVehicles { class EAST_Box_Base; class Box_East_Wps_F: EAST_Box_Base { class TransportMagazines { + MACRO_ADDMAGAZINE(ACE_20Rnd_65x47_Scenar_mag,4); MACRO_ADDMAGAZINE(ACE_30Rnd_65x47_Scenar_mag,4); + MACRO_ADDMAGAZINE(ACE_20Rnd_65_Creedmor_mag,4); MACRO_ADDMAGAZINE(ACE_30Rnd_65_Creedmor_mag,4); MACRO_ADDMAGAZINE(ACE_10Rnd_762x54_Tracer_mag,4); }; @@ -102,7 +113,9 @@ class CfgVehicles { class TransportMagazines { MACRO_ADDMAGAZINE(ACE_30Rnd_556x45_Stanag_Tracer_Dim,1); MACRO_ADDMAGAZINE(ACE_30Rnd_65x39_caseless_green_mag_Tracer_Dim,4); + MACRO_ADDMAGAZINE(ACE_20Rnd_65x47_Scenar_mag,4); MACRO_ADDMAGAZINE(ACE_30Rnd_65x47_Scenar_mag,4); + MACRO_ADDMAGAZINE(ACE_20Rnd_65_Creedmor_mag,4); MACRO_ADDMAGAZINE(ACE_30Rnd_65_Creedmor_mag,4); MACRO_ADDMAGAZINE(ACE_10Rnd_762x54_Tracer_mag,4); }; @@ -110,7 +123,9 @@ class CfgVehicles { class Box_East_Ammo_F: EAST_Box_Base { class TransportMagazines { + MACRO_ADDMAGAZINE(ACE_20Rnd_65x47_Scenar_mag,4); MACRO_ADDMAGAZINE(ACE_30Rnd_65x47_Scenar_mag,4); + MACRO_ADDMAGAZINE(ACE_20Rnd_65_Creedmor_mag,4); MACRO_ADDMAGAZINE(ACE_30Rnd_65_Creedmor_mag,4); MACRO_ADDMAGAZINE(ACE_10Rnd_762x54_Tracer_mag,4); }; @@ -118,7 +133,9 @@ class CfgVehicles { class Box_East_Support_F: EAST_Box_Base { class TransportMagazines { - MACRO_ADDMAGAZINE(ACE_30Rnd_65x47_Scenar_mag,6); + MACRO_ADDMAGAZINE(ACE_20Rnd_65x47_Scenar_mag,4); + MACRO_ADDMAGAZINE(ACE_30Rnd_65x47_Scenar_mag,4); + MACRO_ADDMAGAZINE(ACE_20Rnd_65_Creedmor_mag,4); MACRO_ADDMAGAZINE(ACE_30Rnd_65_Creedmor_mag,4); MACRO_ADDMAGAZINE(ACE_10Rnd_762x54_Tracer_mag,4); }; @@ -182,7 +199,9 @@ class CfgVehicles { class C_supplyCrate_F: ReammoBox_F { class TransportMagazines { + MACRO_ADDMAGAZINE(ACE_20Rnd_65x47_Scenar_mag,4); MACRO_ADDMAGAZINE(ACE_30Rnd_65x47_Scenar_mag,4); + MACRO_ADDMAGAZINE(ACE_20Rnd_65_Creedmor_mag,4); MACRO_ADDMAGAZINE(ACE_30Rnd_65_Creedmor_mag,4); }; }; @@ -217,10 +236,13 @@ class CfgVehicles { MACRO_ADDMAGAZINE(ACE_30Rnd_65x39_caseless_green_mag_Tracer_Dim,4); MACRO_ADDMAGAZINE(ACE_100Rnd_65x39_caseless_mag_Tracer_Dim,4); MACRO_ADDMAGAZINE(ACE_200Rnd_65x39_cased_Box_Tracer_Dim,4); + MACRO_ADDMAGAZINE(ACE_20Rnd_65x47_Scenar_mag,4); MACRO_ADDMAGAZINE(ACE_30Rnd_65x47_Scenar_mag,4); + MACRO_ADDMAGAZINE(ACE_20Rnd_65_Creedmor_mag,4); MACRO_ADDMAGAZINE(ACE_30Rnd_65_Creedmor_mag,4); MACRO_ADDMAGAZINE(ACE_10Rnd_338_300gr_HPBT_Mag,4); MACRO_ADDMAGAZINE(ACE_10Rnd_338_API526_Mag,4); + MACRO_ADDMAGAZINE(ACE_7Rnd_408_305gr_Mag,4); MACRO_ADDMAGAZINE(ACE_5Rnd_127x99_Mag,4); MACRO_ADDMAGAZINE(ACE_5Rnd_127x99_API_Mag,4); MACRO_ADDMAGAZINE(ACE_5Rnd_127x99_AMAX_Mag,4); diff --git a/addons/ballistics/CfgWeapons.hpp b/addons/ballistics/CfgWeapons.hpp index 2446aeb3b3..f95408d6a6 100644 --- a/addons/ballistics/CfgWeapons.hpp +++ b/addons/ballistics/CfgWeapons.hpp @@ -27,6 +27,17 @@ class CfgWeapons { }; }; + class DMR_07_base_F: Rifle_Long_Base_F { + initSpeed = -1.06051; + ACE_barrelTwist = 228.6; + ACE_barrelLength = 640.0; + magazines[] = { + "20Rnd_650x39_Cased_Mag_F", + "ACE_20Rnd_65x47_Scenar_mag", + "ACE_20Rnd_65_Creedmor_mag" + }; + }; + class DMR_06_base_F: Rifle_Long_Base_F { class Single: Mode_SemiAuto { dispersion = 0.00029; // radians. Equal to 1.00 MOA. @@ -101,8 +112,8 @@ class CfgWeapons { "ACE_30Rnd_65x39_caseless_mag_Tracer_Dim" }; initSpeed = -1.0; - ACE_barrelTwist=228.6; - ACE_barrelLength=406.4; + ACE_barrelTwist = 228.6; + ACE_barrelLength = 406.4; }; class arifle_MXM_F: arifle_MX_Base_F { magazines[] = { @@ -112,9 +123,9 @@ class CfgWeapons { "ACE_30Rnd_65x47_Scenar_mag", "ACE_30Rnd_65_Creedmor_mag" }; - initSpeed = -1.018; - ACE_barrelTwist=228.6; - ACE_barrelLength=457.2; + initSpeed = -1.01842; + ACE_barrelTwist = 228.6; + ACE_barrelLength = 457.2; class Single: Single { dispersion = 0.000436; // radians. Equal to 1.50 MOA. }; @@ -142,6 +153,14 @@ class CfgWeapons { "ACE_30Rnd_556x45_Stanag_Mk318_mag", "ACE_30Rnd_556x45_Stanag_Tracer_Dim" }; + initSpeed = -0.859238; + ACE_barrelTwist = 177.8; + ACE_barrelLength = 264.0; + }; + class arifle_SPAR_02_base_F: Rifle_Base_F { + initSpeed = -0.934282; + ACE_barrelTwist = 177.8; + ACE_barrelLength = 368.0; }; class arifle_SPAR_03_base_F: Rifle_Base_F { magazines[] = { @@ -154,6 +173,9 @@ class CfgWeapons { "ACE_20Rnd_762x51_M993_AP_Mag", "ACE_20Rnd_762x51_Mag_SD" }; + initSpeed = -0.984394; + ACE_barrelTwist = 279.4; + ACE_barrelLength = 508.0; }; /* Other */ @@ -163,21 +185,26 @@ class CfgWeapons { "200Rnd_65x39_cased_Box_Tracer", "ACE_200Rnd_65x39_cased_Box_Tracer_Dim" }; - initSpeed = -0.9763; - ACE_barrelTwist=177.8; - ACE_barrelLength=317.5; + initSpeed = -0.976974; + ACE_barrelTwist = 177.8; + ACE_barrelLength = 317.5; }; class LMG_Zafir_F: Rifle_Long_Base_F { - initSpeed = -1.0; - ACE_barrelTwist=304.8; - ACE_barrelLength=459.74; + initSpeed = -1.00333; + ACE_barrelTwist = 304.8; + ACE_barrelLength = 459.74; + }; + class LMG_03_base_F: Rifle_Long_Base_F { + initSpeed = -1.02002; + ACE_barrelTwist = 177.8; + ACE_barrelLength = 414.02; }; class Tavor_base_F: Rifle_Base_F {}; class mk20_base_F: Rifle_Base_F {}; /* SMGs */ class SDAR_base_F: Rifle_Base_F { - initSpeed = -0.989; + initSpeed = -1.211; class Single: Mode_SemiAuto { dispersion = 0.0008727; // radians. Equal to 3 MOA. }; @@ -190,9 +217,6 @@ class CfgWeapons { dispersion = 0.0008727; // radians. Equal to 3 MOA. }; }; - class pdw2000_base_F: Rifle_Short_Base_F {}; - class SMG_01_Base: Rifle_Short_Base_F {}; - class SMG_02_base_F: Rifle_Base_F {}; /* Pistols */ @@ -200,38 +224,77 @@ class CfgWeapons { class Pistol_Base_F: Pistol {}; class hgun_P07_F: Pistol_Base_F { - initSpeed = -0.9778; - ACE_barrelTwist=254.0; - ACE_barrelLength=101.6; + initSpeed = -1.0; + ACE_barrelTwist = 254.0; + ACE_barrelLength = 101.6; }; class hgun_Rook40_F: Pistol_Base_F { - initSpeed = -1.0; - ACE_barrelTwist=254.0; - ACE_barrelLength=111.76; + initSpeed = -1.03077; + ACE_barrelTwist = 254.0; + ACE_barrelLength = 111.76; }; class hgun_ACPC2_F: Pistol_Base_F { initSpeed = -1.0; - ACE_barrelTwist=406.4; - ACE_barrelLength=127.0; + ACE_barrelTwist = 406.4; + ACE_barrelLength = 127.0; }; class hgun_Pistol_heavy_01_F: Pistol_Base_F { initSpeed = -0.96; - ACE_barrelTwist=406.4; - ACE_barrelLength=114.3; + ACE_barrelTwist = 406.4; + ACE_barrelLength = 114.3; }; class hgun_Pistol_heavy_02_F: Pistol_Base_F { initSpeed = -0.92; - ACE_barrelTwist=406.4; - ACE_barrelLength=76.2; + ACE_barrelTwist = 406.4; + ACE_barrelLength = 76.2; }; - class hgun_PDW2000_F: pdw2000_base_F { - initSpeed = -1.157; - ACE_barrelTwist=228.6; - ACE_barrelLength=177.8; + + class hgun_Pistol_01_F: Pistol_Base_F { + initSpeed = -0.974359; + ACE_barrelTwist = 254.0; + ACE_barrelLength = 93.5; + }; + + class pdw2000_base_F: Rifle_Short_Base_F { + initSpeed = -1.09615; + ACE_barrelTwist = 228.6; + ACE_barrelLength = 177.8; + }; + + /* Rifles */ + class arifle_AKS_base_F: Rifle_Base_F { + initSpeed = -1.0; + ACE_barrelTwist = 160.02; + ACE_barrelLength = 206.5; + }; + class arifle_AKM_base_F: Rifle_Base_F { + initSpeed = -1.0014; + ACE_barrelTwist = 199.898; + ACE_barrelLength = 414.02; + }; + class arifle_AK12_base_F: Rifle_Base_F { + initSpeed = -1.0014; + ACE_barrelTwist = 199.898; + ACE_barrelLength = 414.02; + }; + class arifle_CTAR_base_F: Rifle_Base_F { + initSpeed = -1.0; + ACE_barrelTwist = 244.0; + ACE_barrelLength = 463.0; + }; + class arifle_CTARS_base_F: Rifle_Base_F { + initSpeed = -1.04301; + ACE_barrelTwist = 244.0; + ACE_barrelLength = 600.0; + }; + class arifle_ARX_base_F: Rifle_Base_F { + initSpeed = -1.02052; + ACE_barrelTwist = 228.6; + ACE_barrelLength = 463.0; }; class arifle_Katiba_F: arifle_katiba_Base_F { magazines[] = { @@ -239,9 +302,9 @@ class CfgWeapons { "30Rnd_65x39_caseless_green_mag_Tracer", "ACE_30Rnd_65x39_caseless_green_mag_Tracer_Dim" }; - initSpeed = -1.08; - ACE_barrelTwist=203.2; - ACE_barrelLength=728.98; + initSpeed = -1.08355; + ACE_barrelTwist = 203.2; + ACE_barrelLength = 508.0; }; class arifle_Katiba_C_F: arifle_katiba_Base_F { magazines[] = { @@ -249,9 +312,9 @@ class CfgWeapons { "30Rnd_65x39_caseless_green_mag_Tracer", "ACE_30Rnd_65x39_caseless_green_mag_Tracer_Dim" }; - initSpeed = -1.07; - ACE_barrelTwist=203.2; - ACE_barrelLength=680.72; + initSpeed = -1.07105; + ACE_barrelTwist = 203.2; + ACE_barrelLength = 393.7; }; class arifle_Katiba_GL_F: arifle_katiba_Base_F { magazines[] = { @@ -259,9 +322,9 @@ class CfgWeapons { "30Rnd_65x39_caseless_green_mag_Tracer", "ACE_30Rnd_65x39_caseless_green_mag_Tracer_Dim" }; - initSpeed = -1.08; - ACE_barrelTwist=203.2; - ACE_barrelLength=728.98; + initSpeed = -1.08355; + ACE_barrelTwist = 203.2; + ACE_barrelLength = 508.0; }; class arifle_MX_F: arifle_MX_Base_F { magazines[] = { @@ -269,9 +332,9 @@ class CfgWeapons { "30Rnd_65x39_caseless_mag_Tracer", "ACE_30Rnd_65x39_caseless_mag_Tracer_Dim" }; - initSpeed = -0.99; - ACE_barrelTwist=228.6; - ACE_barrelLength=368.3; + initSpeed = -0.990132; + ACE_barrelTwist = 228.6; + ACE_barrelLength = 368.3; }; class arifle_MX_GL_F: arifle_MX_Base_F { magazines[] = { @@ -280,8 +343,8 @@ class CfgWeapons { "ACE_30Rnd_65x39_caseless_mag_Tracer_Dim" }; initSpeed = -0.99; - ACE_barrelTwist=228.6; - ACE_barrelLength=368.3; + ACE_barrelTwist = 228.6; + ACE_barrelLength = 368.3; }; /* class arifle_MX_SW_F: arifle_MX_Base_F { @@ -295,9 +358,9 @@ class CfgWeapons { "30Rnd_65x39_caseless_mag_Tracer", "ACE_30Rnd_65x39_caseless_mag_Tracer_Dim" }; - initSpeed = -0.965; - ACE_barrelTwist=203.2; - ACE_barrelLength=266.7; + initSpeed = -0.963816; + ACE_barrelTwist = 203.2; + ACE_barrelLength = 266.7; }; /* class arifle_MXM_F: arifle_MX_Base_F { @@ -320,13 +383,18 @@ class CfgWeapons { "ACE_30Rnd_556x45_Stanag_Tracer_Dim" }; initSpeed = -0.989; - ACE_barrelTwist=285.75; - ACE_barrelLength=457.2; + ACE_barrelTwist = 285.75; + ACE_barrelLength = 457.2; }; - class SMG_02_F: SMG_02_base_F { - initSpeed = -1.054; - ACE_barrelTwist=254.0; - ACE_barrelLength=195.58; + class SMG_02_base_F: Rifle_Short_Base_F { + initSpeed = -1.10288; + ACE_barrelTwist = 254.0; + ACE_barrelLength = 195.58; + }; + class SMG_05_base_F: Rifle_Short_Base_F { + initSpeed = -1.04058; + ACE_barrelTwist = 254.0; + ACE_barrelLength = 115.0; }; class arifle_TRG20_F: Tavor_base_F { magazines[] = { @@ -342,8 +410,8 @@ class CfgWeapons { "ACE_30Rnd_556x45_Stanag_Tracer_Dim" }; initSpeed = -0.95; - ACE_barrelTwist=177.8; - ACE_barrelLength=381.0; + ACE_barrelTwist = 177.8; + ACE_barrelLength = 381.0; }; class arifle_TRG21_F: Tavor_base_F { magazines[] = { @@ -358,9 +426,9 @@ class CfgWeapons { "ACE_30Rnd_556x45_Stanag_Mk318_mag", "ACE_30Rnd_556x45_Stanag_Tracer_Dim" }; - initSpeed = -0.989; - ACE_barrelTwist=177.8; - ACE_barrelLength=459.74; + initSpeed = -0.988043; + ACE_barrelTwist = 177.8; + ACE_barrelLength = 459.74; }; class arifle_TRG21_GL_F: arifle_TRG21_F { magazines[] = { @@ -375,9 +443,9 @@ class CfgWeapons { "ACE_30Rnd_556x45_Stanag_Mk318_mag", "ACE_30Rnd_556x45_Stanag_Tracer_Dim" }; - initSpeed = -0.989; - ACE_barrelTwist=177.8; - ACE_barrelLength=459.74; + initSpeed = -0.988043; + ACE_barrelTwist = 177.8; + ACE_barrelLength = 459.74; }; /* class LMG_Zafir_F: Rifle_Long_Base_F { @@ -398,9 +466,9 @@ class CfgWeapons { "ACE_30Rnd_556x45_Stanag_Mk318_mag", "ACE_30Rnd_556x45_Stanag_Tracer_Dim" }; - initSpeed = -0.98; - ACE_barrelTwist=177.8; - ACE_barrelLength=441.96; + initSpeed = -0.980978; + ACE_barrelTwist = 177.8; + ACE_barrelLength = 441.96; }; class arifle_Mk20C_F: mk20_base_F { magazines[] = { @@ -415,9 +483,9 @@ class CfgWeapons { "ACE_30Rnd_556x45_Stanag_Mk318_mag", "ACE_30Rnd_556x45_Stanag_Tracer_Dim" }; - initSpeed = -0.956; - ACE_barrelTwist=177.8; - ACE_barrelLength=406.4; + initSpeed = -0.962648; + ACE_barrelTwist = 177.8; + ACE_barrelLength = 406.4; }; class arifle_Mk20_GL_F: mk20_base_F { magazines[] = { @@ -432,14 +500,14 @@ class CfgWeapons { "ACE_30Rnd_556x45_Stanag_Mk318_mag", "ACE_30Rnd_556x45_Stanag_Tracer_Dim" }; - initSpeed = -0.956; - ACE_barrelTwist=177.8; - ACE_barrelLength=406.4; + initSpeed = -0.962648; + ACE_barrelTwist = 177.8; + ACE_barrelLength = 406.4; }; - class SMG_01_F: SMG_01_Base { - initSpeed = -1.016; - ACE_barrelTwist=406.4; - ACE_barrelLength=139.7; + class SMG_01_Base: Rifle_Short_Base_F { + initSpeed = -1.0175; + ACE_barrelTwist = 406.4; + ACE_barrelLength = 139.7; }; class srifle_DMR_01_F: DMR_01_base_F { magazines[] = { @@ -447,8 +515,8 @@ class CfgWeapons { "ACE_10Rnd_762x54_Tracer_mag" }; initSpeed = -1.025; - ACE_barrelTwist=241.3; - ACE_barrelLength=609.6; + ACE_barrelTwist = 241.3; + ACE_barrelLength = 609.6; }; class srifle_EBR_F: EBR_base_F { magazines[] = { @@ -461,9 +529,9 @@ class CfgWeapons { "ACE_20Rnd_762x51_M993_AP_Mag", "ACE_20Rnd_762x51_Mag_SD" }; - initSpeed = -0.9724; - ACE_barrelTwist=304.8; - ACE_barrelLength=457.2; + initSpeed = -0.972389; + ACE_barrelTwist = 304.8; + ACE_barrelLength = 457.2; }; /* class LMG_Mk200_F: Rifle_Long_Base_F { @@ -473,9 +541,13 @@ class CfgWeapons { }; */ class srifle_LRR_F: LRR_base_F { + magazines[] = { + "7Rnd_408_Mag", + "ACE_7Rnd_408_305gr_Mag" + }; initSpeed = -1.0; - ACE_barrelTwist=330.2; - ACE_barrelLength=736.6; + ACE_barrelTwist = 330.2; + ACE_barrelLength = 736.6; }; class srifle_GM6_F: GM6_base_F { magazines[] = { @@ -486,8 +558,8 @@ class CfgWeapons { "ACE_5Rnd_127x99_AMAX_Mag" }; initSpeed = -1.0; - ACE_barrelTwist=381.0; - ACE_barrelLength=730; + ACE_barrelTwist = 381.0; + ACE_barrelLength = 730; }; class srifle_DMR_02_F: DMR_02_base_F { magazines[] = { @@ -498,9 +570,9 @@ class CfgWeapons { "ACE_20Rnd_762x67_Mk248_Mod_1_Mag", "ACE_20Rnd_762x67_Berger_Hybrid_OTM_Mag" }; - initSpeed = -0.962; - ACE_barrelTwist=254.0; - ACE_barrelLength=508.0; + initSpeed = -0.961749; + ACE_barrelTwist = 254.0; + ACE_barrelLength = 508.0; }; class srifle_DMR_03_F: DMR_03_base_F { magazines[] = { @@ -513,19 +585,19 @@ class CfgWeapons { "ACE_20Rnd_762x51_M993_AP_Mag", "ACE_20Rnd_762x51_Mag_SD" }; - initSpeed = -0.9843; - ACE_barrelTwist=254.0; - ACE_barrelLength=508.0; + initSpeed = -0.984394; + ACE_barrelTwist = 254.0; + ACE_barrelLength = 508.0; }; class srifle_DMR_04_F: DMR_04_base_F { initSpeed = -1.0; - ACE_barrelTwist=203.2; - ACE_barrelLength=450.088; + ACE_barrelTwist = 203.2; + ACE_barrelLength = 450.088; }; class srifle_DMR_05_blk_F: DMR_05_base_F { initSpeed = -1.0; - ACE_barrelTwist=359.918; - ACE_barrelLength=620.014; + ACE_barrelTwist = 359.918; + ACE_barrelLength = 620.014; }; class srifle_DMR_06_camo_F: DMR_06_base_F { magazines[] = { @@ -538,19 +610,19 @@ class CfgWeapons { "ACE_20Rnd_762x51_M993_AP_Mag", "ACE_20Rnd_762x51_Mag_SD" }; - initSpeed = -0.9916; - ACE_barrelTwist=304.8; - ACE_barrelLength=558.8; + initSpeed = -0.992197; + ACE_barrelTwist = 304.8; + ACE_barrelLength = 558.8; }; class MMG_01_hex_F: MMG_01_base_F { - initSpeed = -1.0; - ACE_barrelTwist=359.918; - ACE_barrelLength=549.91; + initSpeed = -0.997073; + ACE_barrelTwist = 359.918; + ACE_barrelLength = 549.91; }; class MMG_02_camo_F: MMG_02_base_F { initSpeed = -1.0; - ACE_barrelTwist=234.95; - ACE_barrelLength=609.6; + ACE_barrelTwist = 234.95; + ACE_barrelLength = 609.6; }; class HMG_127 : LMG_RCWS { @@ -559,8 +631,8 @@ class CfgWeapons { }; class HMG_M2: HMG_01 { initSpeed = -1.0; - ACE_barrelTwist=304.8; - ACE_barrelLength=1143.0; + ACE_barrelTwist = 304.8; + ACE_barrelLength = 1143.0; }; /* Silencers */ diff --git a/addons/ballistics/stringtable.xml b/addons/ballistics/stringtable.xml index d7a4ea65b9..ad33b30704 100644 --- a/addons/ballistics/stringtable.xml +++ b/addons/ballistics/stringtable.xml @@ -1,6 +1,103 @@ - + + + + 6.5x47mm 20Rnd Mag (HPBT Scenar) + Ch. 6,5x47mm 20Cps (HPBT Scenar) + Cargador de 20 balas de 6.5x47mm (HPBT Scenar) + Magazynek 6,5x47mm 20rd (HPBT Scenar) + Магазин из 20-ти 6,5x47 мм (экспансивные Scenar) + 6,5x47mm 20-Patronen-Magazin (HPBT Scenar) + 6.5x47mm 20Rnd Mag (HPBT Scenar) + 6.5x47mm 20náb. Zásobník (HPBT Scenar) + Carregador 6.5x47mm com 20 cartuchos (HPBT Scenar) + 6,5x47mm 20-lövedékes tár (HPBT Scenar) + 6.5x47mm 20発入り 弾倉 (HPBT Scenar) + 20발들이 6.5x47mm (HPBT Scenar) + 6.5x47mm 20發 彈匣 (Lapua 空尖艇尾狙擊專用彈) + 6.5x47mm 20发 弹匣 (Lapua 空尖艇尾狙击专用弹) + + + 6.5mm Lapua + 6,5mm Lapua + 6.5mm Lapua + 6,5mm Lapua + 6,5 мм Lapua + 6,5mm Lapua + 6.5mm Lapua + 6.5mm Lapua + 6.5mm Lapua + 6,5mm Lapua + 6.5mm Lapua + 6.5mm Lapua + 6.5mm Lapua 空尖艇尾狙擊專用彈 + 6.5mm Lapua 空尖艇尾狙击专用弹 + + + Caliber: 6.5x47mm (HPBT Scenar)<br />Rounds: 20<br />Used in: QBU-88 + Calibre: 6,5x47mm (HPBT Scenar)<br />Cartouches: 20 + Calibre: 6.5x47mm (HPBT Scenar)<br />Balas: 20<br />Se usa en: QBU-88 + Kaliber: 6,5x47mm (HPBT Scenar)<br />Pociski: 20 + Калибр: 6,5x47 мм (экспансивные Scenar)<br />Патронов: 20<br />Используются с: QBU-88 + Kaliber: 6,5x47mm (HPBT Scenar)<br />Patronen: 20<br />Eingesetzt von: QBU-88 + Calibro: 6.5x47mm (HPBT Scenar)<br />Munizioni: 20<br />In uso su: QBU-88 + Ráže: 6.5x47mm (HPBT Scenar)<br />Nábojů: 20<br />Použití u: QBU-88 + Calibre: 6.5x47mm (HPBT Scenar)<br/>Cartuchos: 20<br/>Usado em: QBU-88 + Kaliber: 6,5x47mm (HPBT Scenar)<br />Lövedékek: 20<br />Használható: QBU-88 + 口径: 6.5x47mm (HPBT Scenar)<br />装填数: 20<br />次で使用: QBU-88 + 구경: 6.5x47mm (HPBT Scenar)<br />장탄수: 20<br />사용처: QBU-88 + 口徑: 6.5x47mm (Lapua 空尖艇尾狙擊專用彈)<br />發數: 20<br />使用於: QBU-88 + 口径: 6.5x47mm (Lapua 空尖艇尾狙击专用弹)<br />发数: 20<br />使用于: QBU-88 + + + 6.5mm Creedmor 20Rnd Mag + Magazynek 6,5mm Creedmor 20rd + 6.5mm Creedmor 20Rnd Mag + Магазин из 20-ти 6,5 мм Creedmor + 6,5mm Creedmor 20-Patronen-Magazin + Cargador de 20 balas Creedmor de 6.5mm + Ch. 6,5mm Creedmor 20Cps + 6.5mm Creedmor 20náb. Zásobník + Carregador 6.5mm com 20 cartuchos Creedmor + 6,5mm Creedmor 20-lövedékes tár + 6.5mm Creedmor 20発入り 弾倉 + 20발들이 6.5mm Creedmor 탄창 + 6.5mm 20發 彈匣 (Creedmor 狙擊專用彈) + 6.5mm 20发 弹匣 (Creedmor 狙击专用弹) + + + 6.5mm CM + 6,5mm CM + 6.5mm CM + 6,5mm CM + 6,5 мм CM + 6,5mm CM + 6.5mm CM + 6.5mm CM + 6.5mm CM + 6,5mm CM + 6.5mm CM + 6.5mm CM + 6.5mm CM 狙擊專用彈 + 6.5mm CM 狙击专用弹 + + + Caliber: 6.5x47mm Creedmor<br />Rounds: 20<br />Used in: QBU-88 + Kaliber: 6,5x47mm Creedmor<br />Pociski: 20<br />Używany w: QBU-88 + Kaliber: 6,5x47mm Creedmor<br />Patronen: 20<br />Eingesetzt von: QBU-88 + Calibre: 6,5x47mm Creedmor <br />Cartouches: 20<br />Utilisé avec: QBU-88 + Calibro: 6.5mm Creedmor<br />Munizioni: 20<br />In uso su: QBU-88 + Calibre: 6.5mm Creedmor<br />Balas: 20<br />Se usa en: QBU-88 + Калибр: 6,5x47мм Creedmor<br />Патронов: 20<br />Используются c: QBU-88 + Ráže: 6.5x47mm Creedmor<br />Nábojů: 20<br />Použití u: QBU-88 + Calibre: 6.5x47mm Creedmor<br/>Cartuchos: 20<br/>Usado em: QBU-88 + Kaliber: 6,5x47mm Creedmor<br />Lövedékek: 20<br />Használható: QBU-88 + 口径: 6.5x47mm Creedmor<br />装填数: 20<br />次で使用: QBU-88 + 구경: 6.5x47mm Creedmor<br />장탄수: 20<br />사용처: QBU-88 + 口徑: 6.5x47mm Creedmor 狙擊專用彈<br />發數: 20<br />使用於: QBU-88 + 口径: 6.5x47mm Creedmor 狙击专用弹<br />发数: 20<br />使用于: QBU-88 + 6.5mm 30Rnd Tracer IR-DIM Mag @@ -14,6 +111,9 @@ Caricatore 6.5mm 30Rnd Traccianti IR-DIM Магазин из 30-ти 6,5 мм ИК-трассирующих 6.5mm 30発入り IR-DIM曳光弾 弾倉 + 30발들이 6.5mm IR-DIM 예광탄 탄창 + 6.5mm 30發 低視度紅外線曳光彈 彈匣 + 6.5mm 30发 低视度红外线曳光弹 弹匣 6.5mm IR-DIM @@ -27,6 +127,9 @@ 6.5mm IR-DIM 6,5 мм ИК-трассирующие 6.5mm IR-DIM曳光弾 + 6.5mm IR-DIM 예광탄 + 6.5mm 低視紅外曳光彈 + 6.5mm 低视红外曳光弹 Caliber: 6.5x39mm Tracer IR-DIM<br />Rounds: 30<br />Used in: MX/C/M/SW/3GL @@ -39,7 +142,10 @@ Calibre: 6,5x39mm Traçante IR-DIM<br />Projéteis: 30<br />Usado em: MX/C/M/SW/3GL Calibro: 6.5x39mm Traccianti IR-DIM <br />Munizioni: 30<br />In uso su: MX/C/M/SW/3GL Калибр: 6,5x39 мм ИК-трассирующие<br />Патронов: 30<br />Используются с: MX/C/M/SW/3GL - 口径: 6.5x39mm 曳光弾 IR-DIM&lt;br /&gt;装填数: 30&lt;br /&gt;次で使用: MX/C/M/SW/3GL + 口径: 6.5x39mm 曳光弾 IR-DIM<br />装填数: 30<br />次で使用: MX/C/M/SW/3GL + 구경: 6.5x39mm IR-DIM 예광탄<br />장탄수: 30<br />사용처: MX/C/M/SW/3GL + 口徑: 6.5x39mm 低視度紅外線曳光彈<br />發數: 30<br />使用於: MX/C/M/SW/3GL + 口径: 6.5x39mm 低视度红外线曳光弹<br />发数: 30<br />使用于: MX/C/M/SW/3GL 6.5mm 30Rnd SD Mag @@ -53,6 +159,9 @@ Caricatore 6.5mm 30Rnd Sil. Магазин из 30-ти 6,5 мм дозвуковых 6.5mm 30発入り 亜音速弾 弾倉 + 30발들이 6.5mm 아음속탄 탄창 + 6.5mm 30發 消音彈 彈匣 + 6.5mm 30发 消音弹 弹匣 6.5mm SD @@ -66,6 +175,9 @@ 6.5mm Sil. 6,5 мм дозвуковые 6.5mm 亜音速弾 + 6.5mm 아음속탄 + 6.5mm 消音彈 + 6.5mm 消音弹 Caliber: 6.5x39mm SD<br />Rounds: 30<br />Used in: MX/C/M/SW/3GL @@ -78,7 +190,10 @@ Calibre: 6,5x39mm SD<br />Projéteis: 30<br />Usado em: MX/C/M/SW/3GL Calibro: 6.5x39mm Sil.<br />Munizioni: 30<br />In uso su: MX/C/M/SW/3GL Калибр: 6,5x39 мм дозвуковые<br />Патронов: 30<br />Используются с: MX/C/M/SW/3GL - 口径: 6.5x39mm 亜音速弾&lt;br /&gt;装填数: 30&lt;br /&gt;次で使用: MX/C/M/SW/3GL + 口径: 6.5x39mm 亜音速弾<br />装填数: 30<br />次で使用: MX/C/M/SW/3GL + 구경: 6.5x39mm SD<br />장탄수: 30<br />사용처: MX/C/M/SW/3GL + 口徑: 6.5x39mm 消音彈<br />發數: 30<br />使用於: MX/C/M/SW/3GL + 口径: 6.5x39mm 消音弹<br />发数: 30<br />使用于: MX/C/M/SW/3GL 6.5mm 30Rnd AP Mag @@ -92,6 +207,9 @@ Caricatore 6.5mm 30Rnd AP Магазин из 30-ти 6,5 мм бронебойных 6.5mm 30 発入り徹甲弾 弾倉 + 30발들이 6.5mm 철갑탄 탄창 + 6.5mm 30發 穿甲彈 彈匣 + 6.5mm 30发 穿甲弹 弹匣 6.5mm AP @@ -105,6 +223,9 @@ 6.5mm AP 6,5 мм бронебойные 6.5mm 徹甲弾 + 6.5mm 철갑탄 + 6.5mm 穿甲彈 + 6.5mm 穿甲弹 Caliber: 6.5x39mm AP<br />Rounds: 30<br />Used in: MX/C/M/SW/3GL @@ -117,7 +238,10 @@ Calibre: 6,5x39mm AP<br />Projéteis: 30<br />Usado em: MX/C/M/SW/3GL Calibro: 6.5x39mm AP<br />Munizioni: 30<br />In uso su: MX/C/M/SW/3GL Калибр: 6,5x39 мм бронебойные<br />Патронов: 30<br />Используются с: MX/C/M/SW/3GL - 口径: 6.5x39mm 徹甲弾&lt;br /&gt;装填数: 30&lt;br /&gt;次で使用: MX/C/M/SW/3GL + 口径: 6.5x39mm 徹甲弾<br />装填数: 30<br />次で使用: MX/C/M/SW/3GL + 구경: 6.5x39mm 철갑탄<br />장탄수: 30<br />사용처: MX/C/M/SW/3GL + 口徑: 6.5x39mm 穿甲彈<br />發數: 30<br />使用於: MX/C/M/SW/3GL + 口径: 6.5x39mm 穿甲弹<br />发数: 30<br />使用于: MX/C/M/SW/3GL @@ -132,6 +256,9 @@ Caricatore 6.5mm 30Rnd Traccianti IR-DIM Магазин из 30-ти 6,5 мм ИК-трассирующих 6.5mm 30発入り IR-DIM曳光弾 弾倉 + 30발들이 6.5mm IR-DIM 예광탄 탄창 + 6.5mm 30發 低視度紅外線曳光彈 彈匣 + 6.5mm 30发 低视度红外线曳光弹 弹匣 6.5mm IR-DIM @@ -145,6 +272,9 @@ 6.5mm IR-DIM 6,5 мм ИК-трассирующие 6.5mm IR-DIM曳光弾 + 6.5mm IR-DIM 예광탄 + 6.5mm 低視紅外曳光彈 + 6.5mm 低视红外曳光弹 Caliber: 6.5x39mm Tracer IR-DIM<br />Rounds: 30<br />Used in: Katiba @@ -157,7 +287,10 @@ Calibre: 6,5x39mm Traçante IR-DIM<br />Projéteis: 30<br />Usado em: Katiba Calibro: 6.5x39mm Tracciant IR-DIM<br />Munizioni: 30<br />In uso su: Katiba Калибр: 6,5x39 мм ИК-трассирующие<br />Патронов: 30<br />Используются с: Katiba - 口径: 6.5x39mm IR-DIM曳光弾&lt;br /&gt;装填数: 30&lt;br /&gt;次で使用: Katiba + 口径: 6.5x39mm IR-DIM曳光弾<br />装填数: 30<br />次で使用: Katiba + 구경: 6.5x39mm IR-DIM 예광탄<br />장탄수: 30<br />사용처: Katiba + 口徑: 6.5x39mm 低視度紅外線曳光彈<br />發數: 30<br />使用於: Katiba + 口径: 6.5x39mm 低视度红外线曳光弹<br />发数: 30<br />使用于: Katiba 6.5mm 30Rnd SD Mag @@ -171,6 +304,9 @@ Caricatore 6.5mm 30Rnd Sil. Магазин из 30-ти 6,5 мм дозвуковых 6.5mm 30発入り 亜音速弾 弾倉 + 30발들이 6.5mm 아음속탄 탄창 + 6.5mm 30發 消音彈 彈匣 + 6.5mm 30发 消音弹 弹匣 6.5mm SD @@ -184,6 +320,9 @@ 6.5mm Sil. 6,5 мм дозвуковые 6.5mm 亜音速弾 + 6.5mm 아음속탄 + 6.5mm 消音彈 + 6.5mm 消音弹 Caliber: 6.5x39mm SD<br />Rounds: 30<br />Used in: Katiba @@ -196,7 +335,10 @@ Calibre: 6,5x39mm SD<br />Projéteis: 30<br />Usado em: Katiba Calibro: 6.5x39mm Sil.<br />Munizioni: 30<br />In uso su: Katiba Калибр: 6,5x39 мм дозвуковые<br />Патронов: 30<br />Используются с: Katiba - 口径: 6.5x39mm 亜音速弾&lt;br /&gt;装填数: 30&lt;br /&gt;次で使用: Katiba + 口径: 6.5x39mm 亜音速弾<br />装填数: 30<br />次で使用: Katiba + 구경: 6.5x39mm 아음속탄<br />장탄수: 30<br />사용처: Katiba + 口徑: 6.5x39mm 消音彈<br />發數: 30<br />使用於: Katiba + 口径: 6.5x39mm 消音弹<br />发数: 30<br />使用于: Katiba 6.5mm 30Rnd AP Mag @@ -210,6 +352,9 @@ Caricatore 6.5mm 30Rnd AP Магазин из 30-ти 6,5 мм бронебойных 6.5mm 30 発入り徹甲弾 弾倉 + 30발들이 6.5mm 철갑탄 탄창 + 6.5mm 30發 穿甲彈 彈匣 + 6.5mm 30发 穿甲弹 弹匣 6.5mm AP @@ -223,6 +368,9 @@ 6.5mm AP 6,5 мм бронебойные 6.5mm 徹甲弾 + 6.5mm 철갑탄 + 6.5mm 穿甲彈 + 6.5mm 穿甲弹 Caliber: 6.5x39mm AP<br />Rounds: 30<br />Used in: Katiba @@ -235,7 +383,10 @@ Calibre: 6,5x39mm AP<br />Projéteis: 30<br />Usado em: Katiba Calibro: 6.5x39mm AP<br />Munizioni: 30<br />In uso su: Katiba Калибр: 6,5x39 мм бронебойные<br />Патронов: 30<br />Используются с: Katiba - 口径: 6.5x39mm 徹甲弾&lt;br /&gt;装填数: 30&lt;br /&gt;次で使用: Katiba + 口径: 6.5x39mm 徹甲弾<br />装填数: 30<br />次で使用: Katiba + 구경: 6.5x39mm 철갑탄<br />장탄수: 30<br />사용처: Katiba + 口徑: 6.5x39mm 穿甲彈<br />發數: 30<br />使用於: Katiba + 口径: 6.5x39mm 穿甲弹<br />发数: 30<br />使用于: Katiba @@ -250,6 +401,9 @@ Caricatore 5.56mm 30rnd Traccianti IR-DIM Магазин из 30-ти 5,56 мм ИК-трассирующих 5.56mm 30発入り IR-DIM曳光弾 弾倉 + 30발 들이 5.56mm IR-DIM 예광탄 탄창 + 5.56mm 30發 低視度紅外線曳光彈 彈匣 + 5.56mm 30发 低视度红外线曳光弹 弹匣 5.56mm IR-DIM @@ -263,6 +417,9 @@ 5.56mm IR-DIM 5,56 мм ИК-трассирующие 5.56mm IR-DIM曳光弾 + 5.56mm IR-DIM 예광탄 + 5.56mm 低視紅外曳光彈 + 5.56mm 低视红外曳光弹 Caliber: 5.56x45mm Tracer IR-DIM<br />Rounds: 30<br />Used in: TRG-20, TRG-21/EGLM, Mk20/C/EGLM, SDAR @@ -275,7 +432,10 @@ Calibre: 5,56x45mm Traçante IR-DIM<br />Projéteis: 30<br />Usado em: TRG-20, TRG-21/EGLM, Mk20/C/EGLM, SDAR Calibro: 5.56x45mm Traccianti IR-DIM<br />Munizioni: 30<br />In uso su: TRG-20, TRG-21/EGLM, Mk20/C/EGLM, SDAR Калибр: 5,56x45 мм ИК-трассирующие<br />Патронов: 30<br />Используются с: TRG-20, TRG-21/EGLM, Mk20/C/EGLM, SDAR - 口径: 5.56x45mm IR-DIM曳光弾&lt;br /&gt;装填数: 30&lt;br /&gt;次で使用: TRG-20, TRG-21/EGLM, Mk20/C/EGLM, SDAR + 口径: 5.56x45mm IR-DIM曳光弾<br />装填数: 30<br />次で使用: TRG-20, TRG-21/EGLM, Mk20/C/EGLM, SDAR + 구경: 5.56x45mm IR-DIM 예광탄<br />장탄수: 30<br />사용처: TRG-20, TRG-21/EGLM, Mk20/C/EGLM, SDAR + 口徑: 5.56x45mm 低視度紅外線曳光彈<br />發數: 30<br />使用於: TRG-20, TRG-21/EGLM, Mk20/C/EGLM, SDAR + 口径: 5.56x45mm 低视度红外线曳光弹<br />发数: 30<br />使用于: TRG-20, TRG-21/EGLM, Mk20/C/EGLM, SDAR @@ -290,6 +450,9 @@ Caricatore 7.62mm 20Rnd Traccianti Магазин из 20-ти 7,62 мм трассирующих 7.62mm 20発入り 曳光弾 + 20발들이 7.62mm 예광탄 탄창 + 7.62mm 20發 曳光彈 彈匣 + 7.62mm 20发 曳光弹 弹匣 7.62mm Tracer @@ -303,6 +466,9 @@ 7.62mm Traccianti 7,62 мм трассирущие 7.62mm 曳光弾 + 7.62mm 예광탄 + 7.62mm 曳光彈 + 7.62mm 曳光弹 Caliber: 7.62x51mm Tracer<br />Rounds: 20<br />Used in: Mk18 ABR @@ -315,7 +481,10 @@ Calibre: 7,62x51mm Traçante<br />Projéteis: 20<br />Usado em: Mk18 ABR Calibro: 7.62x51mm Traccianti<br />Munizioni: 20<br />In uso su: Mk18 ABR Калибр: 7,62x51 мм трассирующие<br />Патронов: 20<br />Используются с: Mk18 ABR - 口径: 7.62x51mm 曳光弾&lt;br /&gt;装填数: 20&lt;br /&gt;次で使用: Mk18 ABR + 口径: 7.62x51mm 曳光弾<br />装填数: 20<br />次で使用: Mk18 ABR + 구경: 7.62x51mm 예광탄<br />장탄수: 20<br />사용처: Mk18 ABR + 口徑: 7.62x51mm 曳光彈<br />發數: 20<br />使用於: Mk18 ABR + 口径: 7.62x51mm 曳光弹<br />发数: 20<br />使用于: Mk18 ABR 7.62mm 20rnd Tracer IR-DIM Mag @@ -329,6 +498,9 @@ Caricatore 7.62mm 20rnd Traccianti IR-DIM Магазин из 20-ти 7,62 мм ИК-трассирующих 7.62mm 20発入り IR-DIM曳光弾 + 20발들이 7.62mm IR-DIM 예광탄 탄창 + 7.62mm 20發 低視度紅外線曳光彈 彈匣 + 7.62mm 20发 低视度红外线曳光弹 弹匣 7.62mm IR-DIM @@ -342,6 +514,9 @@ 7.62mm IR-DIM 7,62 мм ИК-трассирующие 7.62mm IR-DIM曳光弾 + 7.62mm IR-DIM 예광탄 + 7.62mm 低視紅外曳光彈 + 7.62mm 低视红外曳光弹 Caliber: 7.62x51mm Tracer IR-DIM<br />Rounds: 20<br />Used in: Mk18 ABR @@ -354,7 +529,10 @@ Calibre: 7,62x51mm Traçante IR-DIM<br />Projéteis: 20<br />Usado em: Mk18 ABR Calibro: 7.62x51mm Traccianti IR-DIM<br />Munizioni: 20<br />In uso su: Mk18 ABR Калибр: 7,62x51 мм ИК-трассирующие<br />Патронов: 20<br />Используются с: Mk18 ABR - 口径: 7.62x51mm IR-DIM曳光弾&lt;br /&gt;装填数: 20&lt;br /&gt;次で使用: Mk18 ABR + 口径: 7.62x51mm IR-DIM曳光弾<br />装填数: 20<br />次で使用: Mk18 ABR + 구경: 7.62x51mm IR-DIM 예광탄<br />장탄수: 20<br />사용처: Mk18 ABR + 口徑: 7.62x51mm 低視度紅外線曳光彈<br />發數: 20<br />使用於: Mk18 ABR + 口径: 7.62x51mm 低视度红外线曳光弹<br />发数: 20<br />使用于: Mk18 ABR 7.62mm 20Rnd SD Mag @@ -368,6 +546,9 @@ Caricatore 7.62mm 20Rnd Sil. Магазин из 20-ти 7,62 мм дозвуковых 7.62mm 20発入り 亜音速弾 弾倉 + 20발들이 7.62mm 아음속탄 탄창 + 7.62mm 20發 消音彈 彈匣 + 7.62mm 20发 消音弹 弹匣 7.62mm SD @@ -381,6 +562,9 @@ 7.62mm Sil. 7,62 мм дозвуковые 7.62mm 亜音速弾 + 7.62mm 아음속탄 + 7.62mm 消音彈 + 7.62mm 消音弹 Caliber: 7.62x51mm SD<br />Rounds: 20<br />Used in: Mk18 ABR @@ -393,7 +577,10 @@ Calibre: 7,62x51mm SD<br />Projéteis: 20<br />Usado em: Mk18 ABR Calibro: 7.62x51mm Sil.<br />Munizioni: 20<br />In uso su: Mk18 ABR Калибр: 7,62x51 мм дозвуковые<br />Патронов: 20<br />Используются с: Mk18 ABR - 口径: 7.62x51mm 亜音速弾&lt;br /&gt;装填数: 20&lt;br /&gt;次で使用: Mk18 ABR + 口径: 7.62x51mm 亜音速弾<br />装填数: 20<br />次で使用: Mk18 ABR + 구경: 7.62x51mm SD<br />장탄수: 20<br />사용처: Mk18 ABR + 口徑: 7.62x51mm 消音彈<br />發數: 20<br />使用於: Mk18 ABR + 口径: 7.62x51mm 消音弹<br />发数: 20<br />使用于: Mk18 ABR @@ -408,6 +595,9 @@ Cinto de munição .338 NM com 130 cartuchos .338 NM 130-lövedékes nyomkövető heveder .338 NM 130発入り 曳光弾ベルト + 130발들이 .338 NM 예광탄 벨트 + .338 NM 130發 曳光彈 彈鏈 + .338 NM 130发 曳光弹 弹链 .338 NM Tracer @@ -421,6 +611,9 @@ .338 NM Traçante .338 NM nyomkövető .338 NM 曳光弾 + .338 NM 예광탄 + .338 NM 曳光彈 + .338 NM 曳光弹 Caliber: .338 Norma Magnum Tracer<br />Rounds: 130<br />Used in: SPMG @@ -433,7 +626,10 @@ Ráže: .338 Noma Magnum Svítící<br />Nábojů: 130<br />Použití u: LWMMG Calibre: .338 Norma Magnum Traçante<br />Cartuchos: 130<br />Usado em: SPMG Kaliber: .338 Norma Magnum nyomkövető<br />Lövedékek: 130<br />Használható: SPMG - 口径: .338 Norma Magnum 曳光弾&lt;br /&gt;装填数: 130&lt;br /&gt;次で使用: SPMG + 口径: .338 Norma Magnum 曳光弾<br />装填数: 130<br />次で使用: SPMG + 구경: .338 Norma 매그넘 예광탄<br />장탄수: 130<br />사용처: SPMG + 口徑: .338 Norma Magnum 曳光彈<br />發數: 130<br />使用於: SPMG + 口径: .338 Norma Magnum 曳光弹<br />发数: 130<br />使用于: SPMG .338 NM 130Rnd IR-DIM Belt @@ -447,6 +643,9 @@ Cinto de munição traçante .338 NM IR-DIM com 130 cartuchos .338 NM 130-lövedékes infravörös nyomkövető heveder .338 NM 130発入り IR-DIM曳光弾ベルト + 130발들이 .338 NM IR-DIM 예광탄 벨트 + .338 NM 130發 低視度紅外線曳光彈 彈鏈 + .338 NM 130发 低视度红外线曳光弹 弹链 .338 NM IR-DIM @@ -460,6 +659,9 @@ .338 NM IR-DIM .338 NM infravörös nyomkövető .338 NM IR-DIM曳光弾 + .338 NM IR-DIM 예광탄 + .338 NM 低視紅外曳光彈 + .338 NM 低视红外曳光弹 Caliber: .338 Norma Magnum Tracer IR-DIM<br />Rounds: 130<br />Used in: SPMG @@ -472,7 +674,10 @@ Ráže: .338 Noma Magnum Svítící IR-DIM<br />Nábojů: 130<br />Použití u: LWMMG Calibre: .338 Norma Magnum Traçante IR-DIM<br />Cartuchos: 130<br />Usado em: SPMG Kaliber: .338 Norma Magnum infravörös nyomkövető<br />Lövedékek: 130<br />Használható: SPMG - 口径: .338 Norma Magnum IR-DIM曳光弾&lt;br /&gt;装填数: 130&lt;br /&gt;次で使用: SPMG + 口径: .338 Norma Magnum IR-DIM曳光弾<br />装填数: 130<br />次で使用: SPMG + 구경: .338 Norma 매그넘 IR-DIM 예광탄<br />장탄수: 130<br />사용처: SPMG + 口徑: .338 Norma Magnum 低視度紅外線曳光彈<br />發數: 130<br />使用於: SPMG + 口径: .338 Norma Magnum 低视度红外线曳光弹<br />发数: 130<br />使用于: SPMG .338 NM 130Rnd AP Belt @@ -486,6 +691,9 @@ Cinto de munição .338 NM com 130 cartuchos AP .338 NM 130-lövedékes páncéltörő heveder .338 NM 130発入り 徹甲弾ベルト + 130발들이 .338 NM 철갑탄 벨트 + .338 NM 130發 穿甲彈 彈鏈 + .338 NM 130发 穿甲弹 弹链 .338 NM AP @@ -499,6 +707,9 @@ .338 NM AP .338 NM páncéltörő .338 NM 徹甲弾 + .338 NM 철갑탄 + .338 NM 穿甲彈 + .338 NM 穿甲弹 Caliber: .338 Norma Magnum AP<br />Rounds: 130<br />Used in: SPMG @@ -511,14 +722,17 @@ Ráže: .338 Noma Magnum AP<br />Nábojů: 130<br />Použití u: LWMMG Calibre: .338 Norma Magnum AP<br />Cartuchos: 130<br />Usado em: SPMG Kaliber: .338 Norma Magnum páncéltörő<br />Lövedékek: 130<br />Használható: SPMG - 口径: .338 Norma Magnum 徹甲弾&lt;br /&gt;装填数: 130&lt;br /&gt;次で使用: SPMG + 口径: .338 Norma Magnum 徹甲弾<br />装填数: 130<br />次で使用: SPMG + 구경: .338 Norma 매그넘 철갑탄<br />장탄수: 130<br />사용처: SPMG + 口徑: .338 Norma Magnum 穿甲彈<br />發數: 130<br />使用於: SPMG + 口径: .338 Norma Magnum 穿甲弹<br />发数: 130<br />使用于: SPMG 9.3mm 10Rnd Tracer Mag 9,3mm 10-Patronen-Magazin Leuchtspur Magazynek 9.3mm 10rd Smugacz - Ch. 9.3mm 10Cps Traçante + Ch. 9,3mm 10Cps Traçante Cargador de 10 balas trazadoras de 9.3mm Магазин из 10-ти 9,3 мм трассирующих 9.3mm 10Rnd Tracer Mag @@ -526,38 +740,47 @@ Carregador de 10 cartuchos 9.3mm traçantes 9,3mm 10-lövedékes nyomkövető tár 9.3mm 10発入り 曳光弾 弾倉 + 10발들이 9.3mm 예광탄 탄창 + 9.3mm 10發 曳光彈 彈匣 + 9.3mm 10发 曳光弹 弹匣 9.3mm Tracer 9,3mm Leuchtspur 9,3mm Smugacz 9.3mm Svítící - 9.3mm Traçante + 9,3mm Traçante 9.3mm Trazadora 9,3 мм трассирующие 9.3mm Tracer 9.3mm Traçante 9,3mm nyomkövető 9.3mm 曳光弾 + 9.3mm 예광탄 + 9.3mm 曳光彈 + 9.3mm 曳光弹 Caliber: 9.3x64mm Tracer<br />Rounds: 10<br />Used in: Cyrus Kaliber: 9,3x64mm Leuchtspur<br />Patronen: 10<br />Eingesetzt von: Cyrus Kaliber: 9,3x64mm Smugacz<br />Pociski: 10<br />Używany w: Cyrus - Calibre: 9.3x64mm Traçante<br />Cartouches: 10<br />Utilisé avec: Cyrus + Calibre: 9,3x64mm Traçante<br />Cartouches: 10<br />Utilisé avec: Cyrus Calibre: 9.3x64mm trazadora<br />Balas: 10<br />Se usa en: Cyrus Калибр: 9,3x64 мм трассирующие<br />Патронов: 10<br />Используются с: Cyrus Calibro: 9.3x64mm Tracer<br />Munizioni: 10<br />In uso su: Cyrus Ráže: 9.3x64mm Svítící<br />Nábojů: 10<br />Použití u: Cyrus Calibre: 9.3x64mm Traçante<br />Cartuchos: 10<br />Usado em: Cyrus Kaliber: 9,3x64mm nyomkövető<br />Lövedékek: 10<br />Használható: Cyrus - 口径: 9.3x64mm 曳光弾&lt;br /&gt;装填数: 10&lt;br /&gt;次で使用: Cyrus + 口径: 9.3x64mm 曳光弾<br />装填数: 10<br />次で使用: Cyrus + 구경: 9.3x64mm 예광탄<br />장탄수: 10<br />사용처: Cyrus + 口徑: 9.3x64mm 曳光彈<br />發數: 10<br />使用於: Cyrus + 口径: 9.3x64mm 曳光弹<br />发数: 10<br />使用于: Cyrus 9.3mm 10Rnd Tracer IR-DIM Mag 9,3mm 10-Patronen-Magazin Leuchtspur IR-DIM Magazynek 9,3mm 10rd Smugacz IR-DIM - Ch. 9.3mm 10Cps Traçante IR-DIM + Ch. 9,3mm 10Cps Traçante IR-DIM Cargador de 10 balas trazadoras IR-DIM de 9.3mm Магазин из 10-ти 9,3 мм ИК-трассирующих 9.3mm 10Rnd Tracciante IR-DIM Mag @@ -565,39 +788,48 @@ Carregador de 10 cartuchos 9.3mm traçantes IR-DIM 9,3mm 10-lövedékes infravörös nyomkövető tár 9.3mm 10発入り IR-DIM曳光弾 弾倉 + 10발들이 9.3mm IR-DIM 예광탄 탄창 + 9.3mm 10發 低視度紅外線曳光彈 彈匣 + 9.3mm 10发 低视度红外线曳光弹 弹匣 9.3mm IR-DIM 9,3mm IR-DIM 9,3mm IR-DIM 9.3mm IR-DIM - 9.3mm IR-DIM + 9,3mm IR-DIM 9.3mm IR-DIM 9,3 мм ИК-трассирующие 9.3mm IR-DIM 9.3mm IR-DIM 9,3mm infravörös nyomkövető 9.3mm IR-DIM曳光弾 + 9.3mm IR-DIM 예광탄 + 9.3mm 低視紅外曳光彈 + 9.3mm 低视红外曳光弹 Caliber: 9.3x64mm Tracer IR-DIM<br />Rounds: 10<br />Used in: Cyrus Kaliber: 9,3x64mm Leuchtspur IR-DIM<br />Patronen: 10<br />Eingesetzt von: Cyrus Kaliber: 9,3x64mm Smugacz IR-DIM<br />Pociski: 10<br />Używany w: Cyrus - Calibre: 9.3x64mm Traçante IR-DIM<br />Cartouches: 10<br />Utilisé avec: Cyrus + Calibre: 9,3x64mm Traçante IR-DIM<br />Cartouches: 10<br />Utilisé avec: Cyrus Calibre: 9.3x64mm trazadora IR-DIM<br />Balas: 10<br />Se usa en: Cyrus Калибр: 9,3x64 мм ИК-трассирующие<br />Патронов: 10<br />Используются с: Cyrus Calibro: 9.3x64mm Tracciante IR-DIM<br />Munizioni: 10<br />In uso su: Cyrus Ráže: 9.3x64mm Svítící IR-DIM<br />Nábojů: 10<br />Použití u: Cyrus Calibre: 9.3x64mm Traçante IR-DIM<br />Cartuchos: 10<br />Usado em: Cyrus Kaliber: 9,3x64mm infravörös nyomkövető<br />Lövedékek: 10<br /> Használható: Cyrus - 口径: 9.3x64mm IR-DIM曳光弾&lt;br /&gt;装填数: 10&lt;br /&gt;次で使用: Cyrus + 口径: 9.3x64mm IR-DIM曳光弾<br />装填数: 10<br />次で使用: Cyrus + 구경: 9.3x64mm IR-DIM 예광탄<br />장탄수: 10<br />사용처: Cyrus + 口徑: 9.3x64mm 低視度紅外線曳光彈<br />發數: 10<br />使用於: Cyrus + 口径: 9.3x64mm 低视度红外线曳光弹<br />发数: 10<br />使用于: Cyrus 9.3mm 150Rnd Tracer Belt 9,3mm 150-Patronen-Gurt Leuchtspur Taśma 9,3mm 150rd Smugacz - Bande 9.3mm 150Cps Traçante + Bande 9,3mm 150Cps Traçante Cinta de 150 balas trazadoras de 9.3mm Лента из 150-ти 9,3 мм трассирующих 9.3mm 150Rnd Tracer Belt @@ -605,38 +837,47 @@ Cinto de munição traçante 9.3mm com 150 cartuchos 9,3mm 150-lövedékes nyomkövető heveder 9.3mm 150発入り 曳光弾ベルト + 150발들이 9.3mm 예광탄 벨트 + 9.3mm 150發 曳光彈 彈鏈 + 9.3mm 150发 曳光弹 弹链 9.3mm Tracer 9,3mm Leuchtspur 9,3mm Smugacz 9.3mm Svítící - 9.3mm Traçante + 9,3mm Traçante 9.3mm Trazadora 9,3 мм трассирующие 9.3mm Tracciante 9.3mm Traçante 9,3mm nyomkövető 9.3mm 曳光弾 + 9.3mm 예광탄 + 9.3mm 曳光彈 + 9.3mm 曳光弹 Caliber: 9.3x64mm Tracer<br />Rounds: 150<br />Used in: Navid Kaliber: 9,3x64mm Leuchtspur<br />Patronen: 150<br />Eingesetzt von: Navid Kaliber: 9,3x64mm Smugacz<br />Pociski: 150<br />Używane w: Navid - Calibre: 9.3x64mm Traçante<br />Cartouches: 150<br />Utilisé avec: Navid + Calibre: 9,3x64mm Traçante<br />Cartouches: 150<br />Utilisé avec: Navid Calibre: 9.3x64mm trazadora<br />Balas: 150<br />Se usa en: Navid Калибр: 9,3x64 мм трассирующие<br />Патронов: 150<br />Используются с: Навид Calibro: 9.3x64mm Tracciante<br />Munizioni: 150<br />In uso su: Navid Ráže: 9.3x64mm Svítící<br />Nábojů: 150<br />Použití u: HK121 Calibre: 9.3x64mm Traçante<br />Cartuchos: 150<br />Usado em: Navid Kaliber: 9,3x64mm nyomkövető<br />Lövedékek: 150<br />Használható: Navid - 口径: 9.3x64mm 曳光弾&lt;br /&gt;装填数: 150&lt;br /&gt;次で使用: Navid + 口径: 9.3x64mm 曳光弾<br />装填数: 150<br />次で使用: Navid + 구경: 9.3x64mm 예광탄<br />장탄수: 150<br />사용처: Navid + 口徑: 9.3x64mm 曳光彈<br />發數: 150<br />使用於: Navid + 口径: 9.3x64mm 曳光弹<br />发数: 150<br />使用于: Navid 9.3mm 150Rnd Tracer IR-DIM Belt 9,3mm 150-Patronen-Gurt Leuchtspur IR-DIM Taśma 9,3mm 150rd Smugacz IR-DIM - Bande 9.3mm 150Cps Traçante IR-DIM + Bande 9,3mm 150Cps Traçante IR-DIM Cinta de 150 balas trazadoras IR-DIM de 9.3mm Лента из 150-ти 9,3 мм ИК-трассирующих 9.3mm 150Rnd Tracciante IR-DIM Belt @@ -644,38 +885,47 @@ Cinto de munição traçante 9.3mm IR-DIM com 150 cartuchos 9,3mm 150-lövedékes infravörös nyomkövető heveder 9.3mm 150発入り IR-DIM曳光弾ベルト + 150발들이 9.3mm IR-DIM 예광탄 벨트 + 9.3mm 150發 低視度紅外線曳光彈 彈鏈 + 9.3mm 150发 低视度红外线曳光弹 弹链 9.3mm IR-DIM 9,3mm IR-DIM 9,3mm IR-DIM 9.3mm IR-DIM - 9.3mm IR-DIM + 9,3mm IR-DIM 9.3mm IR-DIM 9,3 мм ИК-трассирующие 9.3mm IR-DIM 9.3mm IR-DIM 9,3mm infravörös nyomkövető 9.3mm IR-DIM曳光弾 + 9.3mm IR-DIM 예광탄 + 9.3mm 低視紅外曳光彈 + 9.3mm 低视红外曳光弹 Caliber: 9.3x64mm Tracer IR-DIM<br />Rounds: 150<br />Used in: Navid Kaliber: 9,3x64mm Leuchtspur IR-DIM<br />Patronen: 150<br />Eingesetzt von: Navid Kaliber: 9,3x64mm Smugacz IR-DIM<br />Pociski: 150<br />Używane w: Navid - Calibre: 9.3x64mm Traçante IR-DIM<br />Cartouches: 150<br />Utilisé avec: Navid + Calibre: 9,3x64mm Traçante IR-DIM<br />Cartouches: 150<br />Utilisé avec: Navid Calibre: 9.3x64mm trazadora IR-DIM<br />Balas: 150<br />Se usa en: Navid Калибр: 9,3x64 мм ИК-трассирующие<br />Патронов: 150<br />Используются с: Навид Calibro: 9.3x64mm Tracciante IR-DIM<br />Munizioni: 150<br />In uso su: Navid Ráže: 9.3x64mm Svítící IR-DIM<br />Nábojů: 150<br />Použití u: HK121 Calibre: 9.3x64mm Traçante IR-DIM<br />Cartuchos: 150<br />Usado em: Navid Kaliber: 9,3x64mm infravörös nyomkövető<br />Lövedékek: 150<br />Használható: Navid - 口径: 9.3x64mm IR-DIM曳光弾&lt;br /&gt;装填数: 150&lt;br /&gt;次で使用: Navid + 口径: 9.3x64mm IR-DIM曳光弾<br />装填数: 150<br />次で使用: Navid + 구경: 9.3x64mm IR-DIM 예광탄<br />장탄수: 150<br />사용처: Navid + 口徑: 9.3x64mm 低視度紅外線曳光彈<br />發數: 150<br />使用於: Navid + 口径: 9.3x64mm 低视度红外线曳光弹<br />发数: 150<br />使用于: Navid 9.3mm 150Rnd AP Belt 9,3mm 150-Patronen-Gurt Hartkern Taśma 9,3mm 150rd AP - Bande 9.3mm 150Cps AP + Bande 9,3mm 150Cps AP Cinta de 150 balas AP de 9.3mm Лента из 150-ти 9,3 мм бронебойных 9.3mm 150Rnd AP Belt @@ -683,32 +933,41 @@ Cinto de munição 9.3mm AP com 150 cartuchos 9,3mm 150-lövedékes páncéltörő heveder 9.3mm 150発入り 徹甲弾ベルト + 150발들이 9.3mm 철갑탄 벨트 + 9.3mm 150發 穿甲彈 彈鏈 + 9.3mm 150发 穿甲弹 弹链 9.3mm AP 9,3mm AP 9,3mm AP 9.3mm AP - 9.3mm AP + 9,3mm AP 9.3mm AP 9,3 мм бронебойные 9.3mm AP 9.3mm AP 9,3mm páncéltörő 9.3mm 徹甲弾 + 9.3mm 철갑탄 + 9.3mm 穿甲彈 + 9.3mm 穿甲弹 Caliber: 9.3x64mm AP<br />Rounds: 150<br />Used in: Navid Kaliber: 9,3x64mm Hartkern<br />Patronen: 150<br />Eingesetzt von: Navid Kaliber: 9,3x64mm AP<br />Pociski: 150<br />Używane w: Navid - Calibre: 9.3x64mm AP<br />Cartouches: 150<br />Utilisé avec: Navid + Calibre: 9,3x64mm AP<br />Cartouches: 150<br />Utilisé avec: Navid Calibre: 9.3x64mm AP<br />Balas: 150<br />Se usa en: Navid Калибр: 9,3x64 мм бронебойные<br />Патронов: 150<br />Используются с: Навид Calibro: 9.3x64mm AP<br />Munizioni: 150<br />In uso su: Navid Ráže: 9.3x64mm AP<br />Nábojů: 150<br />Použití u: HK121 Calibre: 9.3x64mm AP<br />Cartuchos: 150<br />Usado em: Navid Kaliber: 9,3x64mm páncéltörő<br />Lövedékek: 150<br />Használható: Navid - 口径: 9.3x64mm 徹甲弾&lt;br /&gt;装填数: 150&lt;br /&gt;次で使用: Navid + 口径: 9.3x64mm 徹甲弾<br />装填数: 150<br />次で使用: Navid + 구경: 9.3x64mm 철갑탄<br />장탄수: 150<br />사용처: Navid + 口徑: 9.3x64mm 穿甲彈<br />發數: 150<br />使用於: Navid + 口径: 9.3x64mm 穿甲弹<br />发数: 150<br />使用于: Navid 9x19mm 16Rnd Mag @@ -722,6 +981,9 @@ Carregador de 16 cartuchos 9x19mm 9x19mm 16-lövedékes tár 9x19mm 16発入り 弾倉 + 16발들이 9x19mm 탄창 + 9x19mm 16發 彈匣 + 9x19mm 16发 弹匣 9x19mm @@ -735,6 +997,9 @@ 9x19mm 9x19mm 9x19mm + 9x19mm + 9x19mm + 9x19mm 9x19mm 30Rnd Mag @@ -748,6 +1013,9 @@ Carregador de 16 cartuchos 9x19mm 9x19mm 16-lövedékes tár 9x19mm 30発入り 弾倉 + 30발들이 9x19mm 탄창 + 9x19mm 30發 彈匣 + 9x19mm 30发 弹匣 9x19mm 30Rnd Mag @@ -761,6 +1029,9 @@ Carregador de 30 cartuchos 9x19mm 9x19mm 30-lövedékes tár 9x19mm 30発入り 弾倉 + 30발들이 9x19mm 탄창 + 9x19mm 30發 彈匣 + 9x19mm 30发 弹匣 9x19mm @@ -774,6 +1045,9 @@ 9x19mm 9x19mm 9x19mm + 9x19mm + 9x19mm + 9x19mm 9x19mm 30Rnd Mag @@ -787,11 +1061,14 @@ Carregador de 30 cartuchos 9x19mm 9x19mm 30-lövedékes tár 9x19mm 30発入り 弾倉 + 30발들이 9x19mm 탄창 + 9x19mm 30發 彈匣 + 9x19mm 30发 弹匣 7.62x54mm 10Rnd Tracer Mag Magazynek 7,62x54mm 10rd Smugacz - Ch. 7.62x54mm 10Rnd Traçante + Ch. 7,62x54mm 10Cps Traçante Cargador de 10 balas trazadoras de 7.62x54mm Магазин из 10-ти 7,62 мм ИК-трассирующих 7,62x54mm 10-Patronen-Magazin Leuchtspur @@ -800,11 +1077,14 @@ Carregador com 10 cartuchos 7.62x54mm Traçante 7,62x54mm 10-lövedékes nyomkövető tár 7.62x54mm 10発入り 曳光弾 弾倉 + 10발들이 7.62x54mm 예광탄 탄창 + 7.62x54mm 10發 曳光彈 彈匣 + 7.62x54mm 10发 曳光弹 弹匣 7.62mm 7,62mm - 7.62mm + 7,62mm 7.62mm 7,62 мм 7,62mm @@ -813,11 +1093,14 @@ 7.62mm 7,62mm 7.62mm + 7.62mm + 7.62mm + 7.62mm 7.62x54mm 10Rnd Tracer Mag Magazynek 7,62x54mm 10rd Smugacz - Ch. 7.62x54mm 10Cps Traçante + Ch. 7,62x54mm 10Cps Traçante Cargador de 10 balas trazadoras de 7.62x54mm Магазин из 10-ти 7,62 мм ИК-трассирующих 7,62x54mm 10-Patronen-Magazin Leuchtspur @@ -826,11 +1109,14 @@ Carregador com 10 cartuchos 7.62x54mm Traçante 7,62x54mm 10-lövedékes nyomkövető tár 7.62x54mm 10発入り 曳光弾 弾倉 + 10발들이 7.62x54mm 예광탄 탄창 + 7.62x54mm 10發 曳光彈 彈匣 + 7.62x54mm 10发 曳光弹 弹匣 6.5mm 100Rnd Tracer IR-DIM Mag Magazynek 6,5mm 100rd Smugacz IR-DIM - Ch. 6.5mm 100Rnd Traçante IR-DIM + Ch. 6,5mm 100Cps Traçante IR-DIM Cargador de 100 balas trazadoras IR-DIM de 6.5mm Магазин из 100 6,5 мм ИК-трассирующих 6,5mm 100-Patronen-Magazin IR-DIM Leuchtspur @@ -839,11 +1125,14 @@ Carregador com 100 cartuchos 6.5mm IR-DIM Traçante 6,5mm 100-lövedékes infravörös nyomkövető tár 6.5mm 100発入り IR-DIM曳光弾 弾倉 + 100발들이 6.5mm IR-DIM 예광탄 탄창 + 6.5mm 100發 低視度紅外線曳光彈 彈匣 + 6.5mm 100发 低视度红外线曳光弹 弹匣 6.5mm IR-DIM 6,5mm IR-DIM - 6.5mm IR-DIM + 6,5mm IR-DIM 6.5mm IR-DIM 6,5 мм ИК-трассирующие 6,5mm IR-DIM @@ -852,11 +1141,14 @@ 6.5mm IR-DIM 6,5mm infravörös nyomkövető 6.5mm IR-DIM曳光弾 + 6.5mm IR-DIM 예광탄 + 6.5mm 低視紅外曳光彈 + 6.5mm 低视红外曳光弹 6.5mm 100Rnd Tracer IR-DIM Mag<br />Rounds: 100<br />Used in: MX LSW Magazynek 6,5mm 100rd Smugacz IR-DIM - Ch. 6.5mm 100Rnd Traçante IR-DIM<br />Cartouches: 100<br />Utilisé avec: MX LSW + Ch. 6,5mm 100Cps Traçante IR-DIM<br />Cartouches: 100<br />Utilisé avec: MX LSW Cargador de 100 balas trazadoras IR-DIM de 6.5mm Магазин из 100 6,5 мм ИК-трассирующих 6,5mm 100-Patronen-Magazin IR-DIM Leuchtspur<br />Patronen: 100<br />Eingesetzt von: MXLSW @@ -864,12 +1156,15 @@ 6.5mm 100náb. Svítící IR-DIM Zásobník<br />Nábojů: 100<br />Použití u: MX LSW Carregador 6.5mm 100 Cartuchos Traçantes IR-DIM<br />Cartuchos: 100<br />Usado em: MX LSW 6.5mm 100-lövedékes infravörös nyomkövető tár<br />Lövedékek: 100<br />Használható: MX LSW - 6.5mm 100発入り IR-DIM曳光弾 弾倉&lt;br /&gt;装填数: 100&lt;br /&gt;次で使用: MX LSW + 6.5mm 100発入り IR-DIM曳光弾 弾倉<br />装填数: 100<br />次で使用: MX LSW + 100발들이 6.5mm IR-DIM 예광탄 탄창<br />장탄수: 100<br />사용처: MX LSW + 6.5mm 100發 低視度紅外線曳光彈<br />發數: 100<br />使用於: MX LSW + 6.5mm 100发 低视度红外线曳光弹<br />发数: 100<br />使用于: MX LSW 6.5mm 200Rnd Tracer IR-DIM Belt Magazynek 6,5mm 200rd Smugacz IR-DIM - Bande 6.5mm 200Rnd Traçante IR-DIM + Bande 6,5mm 200Cps Traçante IR-DIM Cinta de 200 balas trazadoras IR-DIM de 6.5mm Магазин из 200-т 6,5 мм ИК-трассирующих 6,5mm 200-Patronen-Gurt IR-DIM Leuchtspur @@ -878,11 +1173,14 @@ Cinto de munição traçante 6.5mm IR-DIM com 200 cartuchos 6,5mm 200-lövedékes infravörös nyomkövető heveder 6.5mm 200発入り IR-DIM曳光弾ベルト + 200발들이 6.5mm IR-DIM 예광탄 탄창 + 6.5mm 200發 低視度紅外線曳光彈 彈鏈 + 6.5mm 200发 低视度红外线曳光弹 弹链 6.5mm IR-DIM 6,5mm IR-DIM - 6.5mm IR-DIM + 6,5mm IR-DIM 6.5mm IR-DIM 6,5 мм ИК-трассирующие 6,5mm IR-DIM @@ -891,6 +1189,9 @@ 6.5mm IR-DIM 6,5mm infravörös nyomkövető 6.5mm IR-DIM曳光弾 + 6.5mm IR-DIM 예광탄 + 6.5mm 低視紅外曳光彈 + 6.5mm 低视红外曳光弹 6.5mm 200Rnd Tracer IR-DIM Belt<br />Rounds: 200<br />Used in: Stoner 99 LMG @@ -903,12 +1204,15 @@ 6.5mm 200náb. Svítící IR-DIM Pás<br />Nábojů: 200<br />Použití u: Stoner 99 LMG Cinto de munição traçante 6.5mm IR-DIM com 200 cartuchos<br />Cartuchos: 200<br />Usado em: Stoner 99 LMG 6.5mm 200-lövedékes infravörös nyomkövető heveder<br />Lövedékek: 200<br />Használható: Stoner 99 LMG - 6.5mm 200発入り IR-DIM曳光弾ベルト&lt;br /&gt;装填数: 200&lt;br /&gt;次で使用: Stoner 99 LMG + 6.5mm 200発入り IR-DIM曳光弾ベルト<br />装填数: 200<br />次で使用: Stoner 99 LMG + 200발들이 6.5mm IR-DIM 예광탄 벨트<br />장탄수: 200<br />사용처: Stoner 99 LMG + 6.5mm 200發 低視度紅外線曳光彈<br />發數: 200<br />使用於: Stoner 99 LMG + 6.5mm 200发 低视度红外线曳光弹<br />发数: 200<br />使用于: Stoner 99 LMG 5.56mm 30Rnd Mag (Mk262) Magazynek 5,56mm 30rd Mk262 - 5.56mm 30Cps (Mk262) + 5,56mm 30Cps (Mk262) Cargador de 30 balas de 5.56mm (Mk262) Магазин из 30-ти 5.56 мм Mk262 5,56mm 30-Patronen-Magazin (Mk262) @@ -917,11 +1221,14 @@ Carregador 5.56mm com 30 cartuchos (Mk262) 5,56mm 30-lövedékes tár (Mk262) 5.56mm 30発入り 弾倉 (Mk262) + 30발들이 5.56mm 탄창 (Mk262) + 5.56mm 30發 彈匣 (Mk262 狙擊專用彈) + 5.56mm 30发 弹匣 (Mk262 狙击专用弹) 5.56mm Mk262 5,56mm Mk262 - 5.56mm Mk262 + 5,56mm Mk262 5.56mm Mk262 5,56 мм Mk262 5,56mm Mk262 @@ -930,11 +1237,14 @@ 5.56mm Mk262 5,56mm Mk262 5.56mm Mk262 + 5.56mm Mk262 + 5.56mm Mk262 狙擊專用彈 + 5.56mm Mk262 狙击专用弹 Caliber: 5.56x45mm NATO (Mk262)<br />Rounds: 30 Kaliber: 5,56x45mm NATO (Mk262)<br />Pociski: 30 - Calibre: 5.56x45mm NATO (Mk262)<br />Cartouches: 30 + Calibre: 5,56x45mm NATO (Mk262)<br />Cartouches: 30 Calibre: 5.56x45mm NATO (Mk262)<br />Balas: 30 Калибр: 5,56x45 мм NATO (Mk262)<br />Патронов: 30 Kaliber: 5,56x45mm NATO (Mk262)<br />Patronen: 30 @@ -942,12 +1252,15 @@ Ráže: 5.56x45mm NATO (Mk262)<br />Nábojů: 30 Calibre: 5.56x45mm NATO (Mk262)<br/>Cartuchos: 30 Kaliber: 5,56x45mm NATO (Mk262)<br />Lövedékek: 30 - 口径: 5.56x45mm NATO (Mk262)&lt;br /&gt;装填数: 30 + 口径: 5.56x45mm NATO (Mk262)<br />装填数: 30 + 구경: 5.56x45mm NATO (Mk262)<br />장탄수: 30 + 口徑: 5.56x45mm NATO標準 (Mk262 狙擊專用彈)<br />發數: 30 + 口径: 5.56x45mm NATO标准 (Mk262 狙击专用弹)<br />发数: 30 5.56mm 30Rnd Mag (Mk318) Magazynek 5,56mm 30rd (Mk318) - Ch. 5.56mm 30Cps (Mk318) + Ch. 5,56mm 30Cps (Mk318) Cargador de 30 balas de 5.56mm (Mk318) Магазин из 30-ти 5.56 мм (Mk318) 5,56mm 30-Patronen-Magazin (Mk318) @@ -956,11 +1269,14 @@ Carregador 5.56mm com 30 cartuchos (Mk318) 5,56mm 30-lövedékes tár (Mk318) 5.56mm 30発入り 弾倉 (Mk318) + 30발들이 5.56mm 탄창 (Mk318) + 5.56mm 30發 彈匣 (Mk318 特戰專用彈) + 5.56mm 30发 弹匣 (Mk318 特战专用弹) 5.56mm Mk318 5,56mm Mk318 - 5.56mm Mk318 + 5,56mm Mk318 5.56mm Mk318 5.56 мм Mk318 5,56mm Mk318 @@ -969,11 +1285,14 @@ 5.56mm Mk318 5,56mm Mk318 5.56mm Mk318 + 5.56mm Mk318 + 5.56mm Mk318 特戰專用彈 + 5.56mm Mk318 特战专用弹 Caliber: 5.56x45mm NATO (Mk318)<br />Rounds: 30 Kaliber: 5,56x45mm NATO (Mk318)<br />Pociski: 30 - Calibre: 5.56x45mm NATO (Mk318)<br />Cartouches: 30 + Calibre: 5,56x45mm NATO (Mk318)<br />Cartouches: 30 Calibre: 5.56x45mm NATO (Mk318)<br />Balas: 30 Калибр: 5,56x45 мм NATO (Mk318)<br />Патронов: 30 Kaliber: 5,56x45mm NATO (Mk318)<br />Patronen: 30 @@ -981,12 +1300,15 @@ Ráže: 5.56x45mm NATO (Mk318)<br />Nábojů: 30 Calibre: 5.56x45mm NATO (Mk318)<br/>Cartuchos: 30 Kaliber: 5,56x45mm NATO (Mk318)<br />Lövedékek: 30 - 口径: 5.56x45mm NATO (Mk318)&lt;br /&gt;装填数: 30 + 口径: 5.56x45mm NATO (Mk318)<br />装填数: 30 + 구경: 5.56x45mm NATO (Mk318)<br />장탄수: 30 + 口徑: 5.56x45mm NATO標準 (Mk318 特戰專用彈)<br />發數: 30 + 口径: 5.56x45mm NATO标准 (Mk318 特战专用弹)<br />发数: 30 5.56mm 30Rnd Mag (M995 AP) Magazynek 5,56mm 30rd (M995 AP) - Ch. 5.56mm 30Cps (M995 AP) + Ch. 5,56mm 30Cps (M995 AP) Cargador de 30 balas de 5.56mm (M995 AP) Магазин из 30-ти 5.56 мм (M995 бронебойные) 5,56mm 30-Patronen-Magazin (M995AP) @@ -995,11 +1317,14 @@ Carregador 5.56mm com 30 cartuchos (M995 AP) 5,56mm 30-lövedékes tár (M995 páncéltörő) 5.56mm 30発入り 弾倉 (M995 徹甲弾) + 30발들이 5.56mm 탄창 (Mk995 철갑탄) + 5.56mm 30發 彈匣 (M995 穿甲彈) + 5.56mm 30发 弹匣 (M995 穿甲弹) 5.56mm AP 5,56mm AP - 5.56mm AP + 5,56mm AP 5.56mm AP 5.56 мм бронебойные 5,56mm AP @@ -1008,11 +1333,14 @@ 5.56mm M995 AP 5,56mm páncéltörő 5.56mm 徹甲弾 + 5.56mm 철갑탄 + 5.56mm M995 穿甲彈 + 5.56mm M995 穿甲弹 Caliber: 5.56x45mm NATO (M995 AP)<br />Rounds: 30 Kaliber: 5,56x45mm NATO (M995 AP)<br />Pociski: 30 - Calibre: 5.56x45mm NATO (M995 AP)<br />Cartouches: 30 + Calibre: 5,56x45mm NATO (M995 AP)<br />Cartouches: 30 Calibre: 5.56x45mm NATO (M995 AP)<br />Balas: 30 Калибр: 5,56x45 мм NATO (M995 бронебойные)<br />Патронов: 30 Kaliber: 5,56x45mm NATO (M995 AP)<br />Patronen: 30 @@ -1020,12 +1348,15 @@ Ráže: 5.56x45mm NATO (M995 AP)<br />Nábojů: 30 Calibre: 5.56x45mm NATO (M995 AP)<br/>Cartuchos: 30 Kaliber: 5,56x45mm NATO (M995 páncéltörő)<br />Lövedékek: 30 - 口径: 5.56x45mm NATO (M995 徹甲弾)&lt;br /&gt;装填数: 30 + 口径: 5.56x45mm NATO (M995 徹甲弾)<br />装填数: 30 + 구경: 5.56x45mm NATO (Mk995 철갑탄)<br />장탄수: 30 + 口徑: 5.56x45mm NATO標準 (M995 穿甲彈)<br />發數: 30 + 口径: 5.56x45mm NATO标准 (M995 穿甲弹)<br />发数: 30 7.62mm 10Rnd Mag (M118LR) Magazynek 7,62mm 10rd (M118LR) - Ch. 7.62mm 10Cps (M118LR) + Ch. 7,62mm 10Cps (M118LR) Cargador de 10 balas de 7.62mm (M118LR) Магазин из 10-ти 7,62 мм (M118LR) 7,62mm 10-Patronen-Magazin (M118LR) @@ -1034,11 +1365,14 @@ Carregador 7.62mm com 10 cartuchos (M118LR) 7,62mm 10-lövedékes tár (M118LR) 7.62mm 10発入り 弾倉 (M118LR) + 10발들이 7.62mm 탄창 (M118LR) + 7.62mm 10發 彈匣 (M118LR 狙擊專用彈) + 7.62mm 10发 弹匣 (M118LR 狙击专用弹) 7.62mm M118LR 7,62mm M118LR - 7.62mm M118LR + 7,62mm M118LR 7.62mm M118LR 7,62 мм M118LR 7,62mm M118LR @@ -1047,11 +1381,14 @@ 7.62mm M118LR 7,62mm M118LR 7.62mm M118LR + 7.62mm M118LR + 7.62mm M118LR 狙擊專用彈 + 7.62mm M118LR 狙击专用弹 Caliber: 7.62x51mm NATO (M118LR)<br />Rounds: 10 Kaliber: 7,62x51mm NATO (M118LR)<br />Pociski: 10 - Calibre: 7.62x51mm NATO (M118LR)<br />Cartouches: 10 + Calibre: 7,62x51mm NATO (M118LR)<br />Cartouches: 10 Calibre: 7.62x51mm NATO (M118LR)<br />Balas: 10 Калибр: 7,62x51 мм NATO (M118LR)<br />Патронов: 10 Kaliber: 7,62x51mm NATO (M118LR)<br />Patronen: 10 @@ -1059,12 +1396,15 @@ Ráže: 7.62x51mm NATO (M118LR)<br />Nábojů: 10 Calibre: 7.26x51mm NATO (M118LR)<br/>Cartuchos: 10 Kaliber: 7,62x51mm NATO (M118LR)<br />Lövedékek: 10 - 口径: 7.62x51mm NATO (M118LR)&lt;br /&gt;装填数: 10 + 口径: 7.62x51mm NATO (M118LR)<br />装填数: 10 + 구경: 7.62x51mm NATO (M118LR)<br />장탄수: 10 + 口徑: 7.62x51mm NATO標準 (M118LR 狙擊專用彈)<br />發數: 10 + 口径: 7.62x51mm NATO标准 (M118LR 狙击专用弹)<br />发数: 10 7.62mm 20Rnd Mag (M118LR) Magazynek 7,62mm 20rd (M118LR) - Ch. 7.62mm 20Cps (M118LR) + Ch. 7,62mm 20Cps (M118LR) Cargador de 20 balas de 7.62mm (M118LR) Магазин из 20-ти 7,62 мм (M118LR) 7,62mm 20-Patronen-Magazin (M118LR) @@ -1073,11 +1413,14 @@ Carregador 7.62mm com 20 cartuchos (M118LR) 7,62mm 20-lövedékes tár (M118LR) 7.62mm 20発入り 弾倉 (M118LR) + 20발들이 7.62mm 탄창 (M118LR) + 7.62mm 20發 彈匣 (M118LR 狙擊專用彈) + 7.62mm 20发 弹匣 (M118LR 狙击专用弹) 7.62mm M118LR 7,62mm M118LR - 7.62mm M118LR + 7,62mm M118LR 7.62mm M118LR 7,62 мм M118LR 7,62mm M118LR @@ -1086,6 +1429,9 @@ 7.62mm M118LR 7,62mm M118LR 7.62mm M118LR + 7.62mm M118LR + 7.62mm M118LR 狙擊專用彈 + 7.62mm M118LR 狙击专用弹 Caliber: 7.62x51mm NATO (M118LR)<br />Rounds: 20 @@ -1098,12 +1444,15 @@ Ráže: 7.62x51mm NATO (M118LR)<br />Nábojů: 20 Calibre: 7.26x51mm NATO (M118LR)<br/>Cartuchos: 20 Kaliber: 7,62x51mm NATO (M118LR)<br />Lövedékek: 20 - 口径: 7.62x51mm NATO (M118LR)&lt;br /&gt;装填数: 20 + 口径: 7.62x51mm NATO (M118LR)<br />装填数: 20 + 구경: 7.62x51mm NATO (M118LR)<br />장탄수: 20 + 口徑: 7.62x51mm NATO標準 (M118LR 狙擊專用彈)<br />發數: 20 + 口径: 7.62x51mm NATO标准 (M118LR 狙击专用弹)<br />发数: 20 7.62mm 10Rnd Mag (Mk316 Mod 0) Magazynek 7,62mm 10rd (Mk316 Mod 0) - Ch. 7.62mm 10Cps (Mk316 Mod 0) + Ch. 7,62mm 10Cps (Mk316 Mod 0) Cargador de 10 balas de 7.62mm (Mk316 Mod 0) Магазин из 10-ти 7,62 мм (Mk316 Mod 0) 7,62mm 10-Patronen-Magazin (Mk316 Mod 0) @@ -1112,11 +1461,14 @@ Carregador 7.62mm com 10 cartuchos (Mk316 Mod 0) 7,62mm 10-lövedékes tár (Mk316 Mod 0) 7.62mm 10発入り 弾倉 (Mk316 Mod 0) + 10발들이 7.62mm 탄창 (Mk316 Mod 0) + 7.62mm 10發 彈匣 (Mk316 Mod 0 狙擊專用彈) + 7.62mm 10发 弹匣 (Mk316 Mod 0 狙击专用弹) 7.62mm Mk316 7,62mm Mk316 - 7.62mm Mk316 + 7,62mm Mk316 7.62mm Mk316 7,62 мм Mk316 7,62mm Mk316 @@ -1125,11 +1477,14 @@ 7.62mm Mk316 7,62mm Mk316 7.62mm Mk316 + 7.62mm Mk316 + 7.62mm Mk316 狙擊專用彈 + 7.62mm Mk316 狙击专用弹 Caliber: 7.62x51mm NATO (Mk316 Mod 0)<br />Rounds: 10 Kaliber: 7,62x51mm NATO (Mk316 Mod 0)<br />Pociski: 10 - Calibre: 7.62x51mm NATO (Mk316 Mod 0)<br />Cartouches: 10 + Calibre: 7,62x51mm NATO (Mk316 Mod 0)<br />Cartouches: 10 Calibre: 7.62x51mm NATO (Mk316 Mod 0)<br />Balas: 10 Калибр: 7,62x51 мм NATO (Mk316 Mod 0)<br />Патронов: 10 Kaliber: 7,62x51mm NATO (Mk316 Mod 0)<br />Patronen: 10 @@ -1137,12 +1492,15 @@ Ráže: 7.62x51mm NATO (Mk316 Mod 0)<br />Nábojů: 10 Calibre: 7.26x51mm NATO (Mk316 Mod 0)<br/>Cartuchos: 10 Kaliber: 7,62x51mm NATO (Mk316 Mod 0)<br />Lövedékek: 10 - 口径: 7.62x51mm NATO (Mk316 Mod 0)&lt;br /&gt;装填数: 10 + 口径: 7.62x51mm NATO (Mk316 Mod 0)<br />装填数: 10 + 구경: 7.62x51mm NATO (Mk316 Mod 0)<br />장탄수: 10 + 口徑: 7.62x51mm NATO標準 (Mk316 Mod 0 狙擊專用彈)<br />發數: 10 + 口径: 7.62x51mm NATO标准 (Mk316 Mod 0 狙击专用弹)<br />发数: 10 7.62mm 20Rnd Mag (Mk316 Mod 0) Magazynek 7,62mm 20rd (Mk316 Mod 0) - Ch. 7.62mm 20Cps (Mk316 Mod 0) + Ch. 7,62mm 20Cps (Mk316 Mod 0) Cargador de 20 balas de 7.62mm (Mk316 Mod 0) Магазин из 20-ти 7,62 мм (Mk316 Mod 0) 7,62mm 20-Patronen-Magazin (Mk316 Mod 0) @@ -1151,11 +1509,14 @@ Carregador 7.62mm com 20 cartuchos (Mk316 Mod 0) 7,62mm 20-lövedékes tár (Mk316 Mod 0) 7.62mm 20発入り 弾倉 (Mk316 Mod 0) + 20발들이 7.62mm 탄창 (Mk316 Mod 0) + 7.62mm 20發 彈匣 (Mk316 Mod 0 狙擊專用彈) + 7.62mm 20发 弹匣 (Mk316 Mod 0 狙击专用弹) 7.62mm Mk316 7,62mm Mk316 - 7.62mm Mk316 + 7,62mm Mk316 7.62mm Mk316 7,62 мм Mk316 7,62mm Mk316 @@ -1164,11 +1525,14 @@ 7.62mm Mk316 7,62mm Mk316 7.62mm Mk316 + 7.62mm Mk316 + 7.62mm Mk316 狙擊專用彈 + 7.62mm Mk316 狙击专用弹 Caliber: 7.62x51mm NATO (Mk316 Mod 0)<br />Rounds: 20 Kaliber: 7,62x51mm NATO (Mk316 Mod 0)<br />Pociski: 20 - Calibre: 7.62x51mm NATO (Mk316 Mod 0)<br />Cartouches: 20 + Calibre: 7,62x51mm NATO (Mk316 Mod 0)<br />Cartouches: 20 Calibre: 7.62x51mm NATO (Mk316 Mod 0)<br />Balas: 20 Калибр: 7,62x51 мм NATO (Mk316 Mod 0)<br />Патронов: 20 Kaliber: 7,62x51mm NATO (Mk316 Mod 0)<br />Patronen: 20 @@ -1176,12 +1540,15 @@ Ráže: 7.62x51mm NATO (Mk316 Mod 0)<br />Nábojů: 20 Calibre: 7.26x51mm NATO (Mk316 Mod 0)<br/>Cartuchos: 20 Kaliber: 7,62x51mm NATO (Mk316 Mod 0)<br />Lövedékek: 20 - 口径: 7.62x51mm NATO (Mk316 Mod 0)&lt;br /&gt;装填数: 20 + 口径: 7.62x51mm NATO (Mk316 Mod 0)<br />装填数: 20 + 구경: 7.62x51mm NATO (Mk316 Mod 0)<br />장탄수: 20 + 口徑: 7.62x51mm NATO標準 (Mk316 Mod 0 狙擊專用彈)<br />發數: 20 + 口径: 7.62x51mm NATO标准 (Mk316 Mod 0 狙击专用弹)<br />发数: 20 7.62mm 10Rnd Mag (Mk319 Mod 0) Magazynek 7,62mm 10rd (Mk319 Mod 0) - Ch. 7.62mm 10Cps (Mk319 Mod 0) + Ch. 7,62mm 10Cps (Mk319 Mod 0) Cargador de 10 balas de 7.62mm (Mk319 Mod 0) Магазин из 10-ти 7,62 мм (Mk319 Mod 0) 7,62mm 10-Patronen-Magazin (Mk319 Mod 0) @@ -1190,11 +1557,14 @@ Carregador 7.62mm com 10 cartuchos (Mk319 Mod 0) 7,62mm 10-lövedékes tár (Mk319 Mod 0) 7.62mm 10発入り 弾倉 (Mk319 Mod 0) + 10발들이 7.62mm 탄창 (Mk319 Mod 0) + 7.62mm 10發 彈匣 (Mk319 Mod 0 特戰專用彈) + 7.62mm 10发 弹匣 (Mk319 Mod 0 特战专用弹) 7.62mm Mk319 7,62mm Mk319 - 7.62mm Mk319 + 7,62mm Mk319 7.62mm Mk319 7,62 мм Mk319 7,62mm Mk319 @@ -1203,11 +1573,14 @@ 7.62mm Mk319 7,62mm Mk319 7.62mm Mk319 + 7.62mm Mk319 + 7.62mm Mk319 特戰專用彈 + 7.62mm Mk319 特战专用弹 Caliber: 7.62x51mm NATO (Mk319 Mod 0)<br />Rounds: 10 Kaliber: 7,62x51mm NATO (Mk319 Mod 0)<br />Pociski: 10 - Calibre: 7.62x51mm NATO (Mk319 Mod 0)<br />Cartouches: 10 + Calibre: 7,62x51mm NATO (Mk319 Mod 0)<br />Cartouches: 10 Calibre: 7.62x51mm NATO (Mk319 Mod 0)<br />Balas: 10 Калибр: 7,62x51 мм NATO (Mk319 Mod 0)<br />Патронов: 10 Kaliber: 7,62x51mm NATO (Mk319 Mod 0)<br />Patronen: 10 @@ -1215,12 +1588,15 @@ Ráže: 7.62x51mm NATO (Mk319 Mod 0)<br />Nábojů: 10 Calibre: 7.26x51mm NATO (Mk319 Mod 0)<br/>Cartuchos: 10 Kaliber: 7,62x51mm NATO (Mk319 Mod 0)<br />Lövedékek: 10 - 口径: 7.62x51mm NATO (Mk319 Mod 0)&lt;br /&gt;装填数: 10 + 口径: 7.62x51mm NATO (Mk319 Mod 0)<br />装填数: 10 + 구경: 7.62x51mm NATO (Mk319 Mod 0)<br />장탄수: 10 + 口徑: 7.62x51mm NATO標準 (Mk319 Mod 0 特戰專用彈)<br />發數: 10 + 口径: 7.62x51mm NATO标准 (Mk319 Mod 0 特战专用弹)<br />发数: 10 7.62mm 20Rnd Mag (Mk319 Mod 0) Magazynek 7,62mm 20rd (Mk319 Mod 0) - Ch. 7.62mm 20Cps (Mk319 Mod 0) + Ch. 7,62mm 20Cps (Mk319 Mod 0) Cargador de 20 balas de 7.62mm (Mk319 Mod 0) Магазин из 20-ти 7,62 мм (Mk319 Mod 0) 7,62mm 20-Patronen-Magazin (Mk319 Mod 0) @@ -1229,11 +1605,14 @@ Carregador 7.62mm com 20 cartuchos (Mk319 Mod 0) 7,62mm 20-lövedékes tár (Mk319 Mod 0) 7.62mm 20発入り 弾倉 (Mk319 Mod 0) + 20발들이 7.62mm 탄창 (Mk319 Mod 0) + 7.62mm 20發 彈匣 (Mk319 Mod 0 特戰專用彈) + 7.62mm 20发 弹匣 (Mk319 Mod 0 特战专用弹) 7.62mm Mk319 7,62mm Mk319 - 7.62mm Mk319 + 7,62mm Mk319 7.62mm Mk319 7,62 мм Mk319 7,62mm Mk319 @@ -1242,11 +1621,14 @@ 7.62mm Mk319 7,62mm Mk319 7.62mm Mk319 + 7.62mm Mk319 + 7.62mm Mk319 特戰專用彈 + 7.62mm Mk319 特战专用弹 Caliber: 7.62x51mm NATO (Mk319 Mod 0)<br />Rounds: 20 Kaliber: 7,62x51mm NATO (Mk319 Mod 0)<br />Pociski: 20 - Calibre: 7.62x51mm NATO (Mk319 Mod 0)<br />Cartouches: 20 + Calibre: 7,62x51mm NATO (Mk319 Mod 0)<br />Cartouches: 20 Calibre: 7.62x51mm NATO (Mk319 Mod 0)<br />Balas: 20 Калибр: 7,62x51 мм NATO (Mk319 Mod 0)<br />Патронов: 20 Kaliber: 7,62x51mm NATO (Mk319 Mod 0)<br />Patronen: 20 @@ -1254,12 +1636,15 @@ Ráže: 7.62x51mm NATO (Mk319 Mod 0)<br />Nábojů: 20 Calibre: 7.26x51mm NATO (Mk319 Mod 0)<br/>Cartuchos: 20 Kaliber: 7,62x51mm NATO (Mk319 Mod 0)<br />Lövedékek: 20 - 口径: 7.62x51mm NATO (Mk319 Mod 0)&lt;br /&gt;装填数: 20 + 口径: 7.62x51mm NATO (Mk319 Mod 0)<br />装填数: 20 + 구경: 7.62x51mm NATO (Mk319 Mod 0)<br />장탄수: 20 + 口徑: 7.62x51mm NATO標準 (Mk319 Mod 0 特戰專用彈)<br />發數: 20 + 口径: 7.62x51mm NATO标准 (Mk319 Mod 0 特战专用弹)<br />发数: 20 7.62mm 10Rnd Mag (M993 AP) Magazynek 7,62mm 10rd (M993 AP) - Ch. 7.62mm 10Cps (M993 AP) + Ch. 7,62mm 10Cps (M993 AP) Cargador de 10 balas de 7.62mm (M993 AP) Магазин из 10-ти 7,62 мм (M993 бронебойные) 7,62mm 10-Patronen-Magazin (M993 AP) @@ -1268,11 +1653,14 @@ Carregador 7.62mm com 10 cartuchos (M993 AP) 7,62mm 10-lövedékes tár (M993 páncéltörő) 7.62mm 10発入り 弾倉 (M993 徹甲弾) + 10발들이 7.62mm 탄창 (M993 철갑탄) + 7.62mm 10發 彈匣 (M993 穿甲專用彈) + 7.62mm 10发 弹匣 (M993 穿甲专用弹) 7.62mm AP 7,62mm AP - 7.62mm AP + 7,62mm AP 7.62mm AP 7,62mm бронебойные 7,62mm AP @@ -1281,11 +1669,14 @@ 7.62mm AP 7,62mm páncéltörő 7.62mm 徹甲弾 + 7.62mm 철갑탄 + 7.62mm M993 穿甲專用彈 + 7.62mm M993 穿甲专用弹 Caliber: 7.62x51mm NATO (M993 AP)<br />Rounds: 10 Kaliber: 7,62x51mm NATO (M993 AP)<br />Pociski: 10 - Calibre: 7.62x51mm NATO (M993 AP)<br />Cartouches: 10 + Calibre: 7,62x51mm NATO (M993 AP)<br />Cartouches: 10 Calibre: 7.62x51mm NATO (M993 AP)<br />Balas: 10 Калибр: 7,62x51 мм NATO (M993 бронебойные)<br />Патронов: 10 Kaliber: 7,62x51mm NATO (M993 AP)<br />Patronen: 10 @@ -1293,12 +1684,15 @@ Ráže: 7.62x51mm NATO (M993 AP)<br />Nábojů: 10 Calibre: 7.26x51mm NATO (M993 AP)<br/>Cartuchos: 10 Kaliber: 7,62x51mm NATO (M993 páncéltörő)<br />Lövedékek: 10 - 口径: 7.62x51mm NATO (Mk319 Mod 0)&lt;br /&gt;装填数: 10 + 口径: 7.62x51mm NATO (Mk319 Mod 0)<br />装填数: 10 + 구경: 7.62x51mm NATO (M993 철갑탄)<br />장탄수: 10 + 口徑: 7.62x51mm NATO標準 (M993 穿甲專用彈)<br />發數: 10 + 口径: 7.62x51mm NATO标准 (M993 穿甲专用弹)<br />发数: 10 7.62mm 20Rnd Mag (M993 AP) Magazynek 7,62mm 20rd (M993 AP) - Ch. 7.62mm 20Cps (M993 AP) + Ch. 7,62mm 20Cps (M993 AP) Cargador de 20 balas de 7.62mm (M993 AP) Магазин из 20-ти 7,62 мм (M993 бронебойные) 7,62mm 20-Patronen-Magazin (M993 AP) @@ -1307,11 +1701,14 @@ Carregador 7.62mm com 20 cartuchos (M993 AP) 7,62mm 20-lövedékes tár (M993 páncéltörő) 7.62mm 20発入り 弾倉 (M993 徹甲弾) + 20발들이 7.62mm 탄창 (M993 철갑탄) + 7.62mm 20發 彈匣 (M993 穿甲專用彈) + 7.62mm 20发 弹匣 (M993 穿甲专用弹) 7.62mm AP 7,62mm AP - 7.62mm AP + 7,62mm AP 7.62mm AP 7,62 мм бронебойные 7,62mm AP @@ -1320,11 +1717,14 @@ 7.62mm AP 7,62mm páncéltörő 7.62mm 徹甲弾 + 7.62mm 철갑탄 + 7.62mm M993 穿甲專用彈 + 7.62mm M993 穿甲专用弹 Caliber: 7.62x51mm NATO (M993 AP)<br />Rounds: 20 Kaliber: 7,62x51mm NATO (M993 AP)<br />Pociski: 20 - Calibre: 7.62x51mm NATO (M993 AP)<br />Cartouches: 20 + Calibre: 7,62x51mm NATO (M993 AP)<br />Cartouches: 20 Калибр: 7,62x51 мм NATO (M993 бронебойные)<br />Патронов: 20 Kaliber: 7,62x51mm NATO (M993 AP)<br />Patronen: 20 Calibro: 7.62x51 mm NATO (M993 AP)<br />Munizioni: 20 @@ -1332,12 +1732,15 @@ Ráže: 7.62x51mm NATO (M993 AP)<br />Nábojů: 20 Calibre: 7.26x51mm NATO (M993 AP)<br/>Cartuchos: 20 Kaliber: 7,62x51mm NATO (M993 páncéltörő)<br />Lövedékek: 20 - 口径: 7.62x51mm NATO (M993 徹甲弾)&lt;br /&gt;装填数: 20 + 口径: 7.62x51mm NATO (M993 徹甲弾)<br />装填数: 20 + 구경: 7.62x51mm NATO (M993 철갑탄)<br />장탄수: 20 + 口徑: 7.62x51mm NATO標準 (M993 穿甲專用彈)<br />發數: 20 + 口径: 7.62x51mm NATO标准 (M993 穿甲专用弹)<br />发数: 20 7.62mm 20Rnd Mag (Mk248 Mod 0) Magazynek 7,62mm 20rd (Mk248 Mod 0) - Ch. 7.62mm 20Cps (Mk248 Mod 0) + Ch. 7,62mm 20Cps (Mk248 Mod 0) Cargador de 20 balas de 7.62mm (Mk248 Mod 0) Магазин из 20-ти 7,62 мм (Mk248 Mod 0) 7,62mm 20-Patronen-Magazin (Mk248 Mod 0) @@ -1346,11 +1749,14 @@ Carregador 7.62mm com 20 cartuchos (Mk248 Mod 0) 7,62mm 20-lövedékes tár (Mk248 Mod 0) 7.62mm 20発入り 弾倉 (Mk248 Mod 0) + 20발들이 7.62mm 탄창 (Mk248 Mod 0) + 7.62mm 20發 彈匣 (Mk248 Mod 0 狙擊專用彈) + 7.62mm 20发 弹匣 (Mk248 Mod 0 狙击专用弹) 7.62mm Mk248 7,62mm Mk248 - 7.62mm Mk248 + 7,62mm Mk248 7.62mm Mk248 7,62 мм Mk248 7,62mm Mk248 @@ -1359,11 +1765,14 @@ 7.62mm Mk248 7,62mm Mk248 7.62mm Mk248 + 7.62mm Mk248 + 7.62mm Mk248 狙擊專用彈 + 7.62mm Mk248 狙击专用弹 Caliber: 7.62x67mm NATO (Mk248 Mod 0)<br />Rounds: 20 Kaliber: 7,62x67mm NATO (Mk248 Mod 0)<br />Pociski: 20 - Calibre: 7.62x67mm NATO (Mk248 Mod 0)<br />Cartouches: 20 + Calibre: 7,62x67mm NATO (Mk248 Mod 0)<br />Cartouches: 20 Calibre: 7.62x67mm NATO (Mk248 Mod 0)<br />Balas: 20 Калибр: 7,62x67 мм NATO (Mk248 Mod 0)<br />Патронов: 20 Kaliber: 7,62x51mm NATO (Mk248 Mod 0)<br />Patronen: 20 @@ -1371,12 +1780,15 @@ Ráže: 7.62x67mm NATO (Mk248 Mod 0)<br />Nábojů: 20 Calibre: 7.26x67mm NATO (Mk248 Mod 0)<br/>Cartuchos: 20 Kaliber: 7,62x51mm NATO (Mk248 Mod 0)<br />Lövedékek: 20 - 口径: 7.62x67mm NATO (Mk248 Mod 0)&lt;br /&gt;装填数: 20 + 口径: 7.62x67mm NATO (Mk248 Mod 0)<br />装填数: 20 + 구경: 7.62x51mm NATO (Mk248 Mod 0)<br />장탄수: 20 + 口徑: 7.62x67mm NATO標準 (Mk248 Mod 0 狙擊專用彈)<br />發數: 20 + 口径: 7.62x67mm NATO标准 (Mk248 Mod 0 狙击专用弹)<br />发数: 20 7.62mm 20Rnd Mag (Mk248 Mod 1) Magazynek 7,62mm 20rd (Mk248 Mod 1) - Ch. 7.62mm 20Cps (Mk248 Mod 1) + Ch. 7,62mm 20Cps (Mk248 Mod 1) Cargador de 20 balas de 7.62mm (Mk248 Mod 1) Магазин из 20-ти 7,62 мм (Mk248 Mod 1) 7,62mm 20-Patronen-Magazin (Mk248 Mod 1) @@ -1385,11 +1797,14 @@ Carregador 7.62mm com 20 cartuchos (Mk248 Mod 1) 7,62mm 20-lövedékes tár (Mk248 Mod 1) 7.62mm 20発入り 弾倉 (Mk248 Mod 1) + 20발들이 7.62mm 탄창 (Mk248 Mod 1) + 7.62mm 20發 彈匣 (Mk248 Mod 1 狙擊專用彈) + 7.62mm 20发 弹匣 (Mk248 Mod 1 狙击专用弹) 7.62mm Mk248 7,62mm Mk248 - 7.62mm Mk248 + 7,62mm Mk248 7.62mm Mk248 7,62 мм Mk248 7,62mm Mk248 @@ -1398,11 +1813,14 @@ 7.62mm Mk248 7,62mm Mk248 7.62mm Mk248 + 7.62mm Mk248 + 7.62mm Mk248 狙擊專用彈 + 7.62mm Mk248 狙击专用弹 Caliber: 7.62x67mm NATO (Mk248 Mod 1)<br />Rounds: 20 Kaliber: 7,62x67mm NATO (Mk248 Mod 1)<br />Pociski: 20 - Calibre: 7.62x67mm NATO (Mk248 Mod 1)<br />Cartouches: 20 + Calibre: 7,62x67mm NATO (Mk248 Mod 1)<br />Cartouches: 20 Calibre: 7.62x67mm NATO (Mk248 Mod 1)<br />Balas: 20 Калибр: 7,62x67 мм NATO (Mk248 Mod 1)<br />Патронов: 20 Kaliber: 7,62x51mm NATO (Mk248 Mod 1)<br />Patronen: 20 @@ -1410,12 +1828,15 @@ Ráže: 7.62x67mm NATO (Mk248 Mod 1)<br />Nábojů: 20 Calibre: 7.26x67mm NATO (Mk248 Mod 1)<br/>Cartuchos: 20 Kaliber: 7,62x51mm NATO (Mk248 Mod 1)<br />Lövedékek: 20 - 口径: 7.62x67mm NATO (Mk248 Mod 1)&lt;br /&gt;装填数: 20 + 口径: 7.62x67mm NATO (Mk248 Mod 1)<br />装填数: 20 + 구경: 7.62x51mm NATO (Mk248 Mod 1)<br />장탄수: 20 + 口徑: 7.62x67mm NATO標準 (Mk248 Mod 1 狙擊專用彈)<br />發數: 20 + 口径: 7.62x67mm NATO标准 (Mk248 Mod 1 狙击专用弹)<br />发数: 20 7.62mm 20Rnd Mag (Berger Hybrid OTM) Magazynek 7,62mm 20rd (Berger Hybrid OTM) - Ch. 7.62 20Cps (Berger Hybrid OTM) + Ch. 7,62 20Cps (Berger Hybrid OTM) Cargador de 20 balas de 7.62mm (Berger Hybrid OTM) Магазин из 20-ти 7,62 мм (Berger Hybrid OTM) 7,62mm 20-Patronen-Magazin (Berger Hybrid OTM) @@ -1424,11 +1845,14 @@ Carregador 7.62mm com 20 cartuchos (Berger Hybrid OTM) 7,62mm 20-lövedékes tár (Berger Hybrid OTM) 7.62mm 20発入り 弾倉 (Berger Hybrid OTM) + 20발들이 7.62mm 탄창 (Berger Hybrid OTM) + 7.62mm 20發 彈匣 (Berger Hybrid 空尖比賽專用彈) + 7.62mm 20发 弹匣 (Berger Hybrid 空尖比赛专用弹) 7.62mm OTM 7,62mm OTM - 7.62mm OTM + 7,62mm OTM 7.62mm OTM 7,62 мм OTM 7,62mm OTM @@ -1437,11 +1861,14 @@ 7.62mm OTM 7,62mm OTM 7.62mm OTM + 7.62mm OTM + 7.62mm 空尖比賽專用彈 + 7.62mm 空尖比赛专用弹 Caliber: 7.62x67mm NATO (Berger Hybrid OTM)<br />Rounds: 20 Kaliber: 7,62x67mm NATO (Berger Hybrid OTM)<br />Pociski: 20 - Calibre: 7.62x67mm NATO (Berger Hybrid OTM)<br />Cartouches: 20 + Calibre: 7,62x67mm NATO (Berger Hybrid OTM)<br />Cartouches: 20 Calibre: 7.62x67mm NATO (Berger Hybrid OTM)<br />Balas: 20 Калибр: 7,62x67 мм NATO (Berger Hybrid OTM)<br />Патронов: 20 Kaliber: 7,62x67mm NATO (Berger Hybrid OTM)<br />Patronen: 20 @@ -1449,11 +1876,14 @@ Ráže: 7.62x67mm NATO (Berger Hybrid OTM)<br />Nábojů: 20 Calibre: 7.26x67mm NATO (Berger Hybrid OTM)<br/>Cartuchos: 20 Kaliber: 7,62x67mm NATO (Berger Hybrid OTM)<br />Lövedékek: 20 - 口径: 7.62x67mm NATO (Berger Hybrid OTM)&lt;br /&gt;装填数: 20 + 口径: 7.62x67mm NATO (Berger Hybrid OTM)<br />装填数: 20 + 구경: 7.62x51mm NATO (Berger Hybrid OTM)<br />장탄수: 20 + 口徑: 7.62x67mm NATO標準 (Berger Hybrid 空尖比賽專用彈)<br />發數: 20 + 口径: 7.62x67mm NATO标准 (Berger Hybrid 空尖比赛专用弹)<br />发数: 20 6.5x47mm 30Rnd Mag (HPBT Scenar) - Ch. 6.5x47mm 30Cps (HPBT Scenar) + Ch. 6,5x47mm 30Cps (HPBT Scenar) Cargador de 30 balas de 6.5x47mm (HPBT Scenar) Magazynek 6,5x47mm 30rd (HPBT Scenar) Магазин из 30-ти 6,5x47 мм (экспансивные Scenar) @@ -1463,10 +1893,13 @@ Carregador 6.5x47mm com 30 cartuchos (HPBT Scenar) 6,5x47mm 30-lövedékes tár (HPBT Scenar) 6.5x47mm 30発入り 弾倉 (HPBT Scenar) + 30발들이 6.5x47mm 탄창 (HPBT Scenar) + 6.5x47mm 30發 彈匣 (Lapua 空尖艇尾狙擊專用彈) + 6.5x47mm 30发 弹匣 (Lapua 空尖艇尾狙击专用弹) 6.5mm Lapua - 6.5mm Lapua + 6,5mm Lapua 6.5mm Lapua 6,5mm Lapua 6,5 мм Lapua @@ -1476,10 +1909,13 @@ 6.5mm Lapua 6,5mm Lapua 6.5mm Lapua + 6.5mm Lapua + 6.5mm Lapua 空尖艇尾狙擊專用彈 + 6.5mm Lapua 空尖艇尾狙击专用弹 Caliber: 6.5x47mm (HPBT Scenar)<br />Rounds: 30<br />Used in: MXM - Calibre: 6.5x47mm (HPBT Scenar)<br />Cartouches: 30 + Calibre: 6,5x47mm (HPBT Scenar)<br />Cartouches: 30 Calibre: 6.5x47mm (HPBT Scenar)<br />Balas: 30<br />Se usa en: MXM Kaliber: 6,5x47mm (HPBT Scenar)<br />Pociski: 30 Калибр: 6,5x47 мм (экспансивные Scenar)<br />Патронов: 30<br />Используются с: MXM @@ -1488,7 +1924,10 @@ Ráže: 6.5x47mm (HPBT Scenar)<br />Nábojů: 30<br />Použití u: MXM Calibre: 6.5x47mm (HPBT Scenar)<br/>Cartuchos: 30<br/>Usado em: MXM Kaliber: 6,5x47mm (HPBT Scenar)<br />Lövedékek: 30<br />Használható: MXM - 口径: 6.5x47mm (HPBT Scenar)&lt;br /&gt;装填数: 30&lt;br /&gt;次で使用: MXM + 口径: 6.5x47mm (HPBT Scenar)<br />装填数: 30<br />次で使用: MXM + 구경: 6.5x47mm (HPBT Scenar)<br />장탄수: 30<br />사용처: MXM + 口徑: 6.5x47mm (Lapua 空尖艇尾狙擊專用彈)<br />發數: 30<br />使用於: MXM + 口径: 6.5x47mm (Lapua 空尖艇尾狙击专用弹)<br />发数: 30<br />使用于: MXM 6.5mm Creedmor 30Rnd Mag @@ -1497,15 +1936,18 @@ Магазин из 30-ти 6,5 мм Creedmor 6,5mm Creedmor 30-Patronen-Magazin Cargador de 30 balas Creedmor de 6.5mm - Ch. 6.5mm Creedmor 30Cps + Ch. 6,5mm Creedmor 30Cps 6.5mm Creedmor 30náb. Zásobník Carregador 6.5mm com 30 cartuchos Creedmor 6,5mm Creedmor 30-lövedékes tár 6.5mm Creedmor 30発入り 弾倉 + 30발들이 6.5mm Creedmor 탄창 + 6.5mm 30發 彈匣 (Creedmor 狙擊專用彈) + 6.5mm 30发 弹匣 (Creedmor 狙击专用弹) 6.5mm CM - 6.5mm CM + 6,5mm CM 6.5mm CM 6,5mm CM 6,5 мм CM @@ -1515,19 +1957,25 @@ 6.5mm CM 6,5mm CM 6.5mm CM + 6.5mm CM + 6.5mm CM 狙擊專用彈 + 6.5mm CM 狙击专用弹 Caliber: 6.5x47mm Creedmor<br />Rounds: 30<br />Used in: MXM Kaliber: 6,5x47mm Creedmor<br />Pociski: 30<br />Używany w: MXM Kaliber: 6,5x47mm Creedmor<br />Patronen: 30<br />Eingesetzt von: MXM - Calibre: 6.5x47mm Creedmor <br />Cartouches: 30<br />Utilisé avec: MXM + Calibre: 6,5x47mm Creedmor <br />Cartouches: 30<br />Utilisé avec: MXM Calibro: 6.5mm Creedmor<br />Munizioni: 30<br />In uso su: MXM Calibre: 6.5mm Creedmor<br />Balas: 30<br />Se usa en: MXM Калибр: 6,5x47мм Creedmor<br />Патронов: 30<br />Используются c: MXM Ráže: 6.5x47mm Creedmor<br />Nábojů: 30<br />Použití u: MXM Calibre: 6.5x47mm Creedmor<br/>Cartuchos: 30<br/>Usado em: MXM Kaliber: 6,5x47mm Creedmor<br />Lövedékek: 30<br />Használható: MXM - 口径: 6.5x47mm Creedmor&lt;br /&gt;装填数: 30&lt;br /&gt;次で使用: MXM + 口径: 6.5x47mm Creedmor<br />装填数: 30<br />次で使用: MXM + 구경: 6.5x47mm Creedmor<br />장탄수: 30<br />사용처: MXM + 口徑: 6.5x47mm Creedmor 狙擊專用彈<br />發數: 30<br />使用於: MXM + 口径: 6.5x47mm Creedmor 狙击专用弹<br />发数: 30<br />使用于: MXM .338 10Rnd Mag (300gr Sierra MatchKing HPBT) @@ -1541,6 +1989,9 @@ Carregador .338 (300gr Sierra MatchKing HPBT) com 10 cartuchos .338 10-lövedékes tár (300gr Sierra MatchKing HPBT) .338 10発入り 弾倉 (300gr Sierra MatchKing HPBT) + 10발들이 .338 탄창 (300gr Sierra MatchKing HPBT) + .338 10發 彈匣 (300公克 Sierra MatchKing 空尖艇尾比賽專用彈) + .338 10发 弹匣 (300公克 Sierra MatchKing 空尖艇尾比赛专用弹) .338 HPBT @@ -1554,10 +2005,13 @@ .338 HPBT .338 HPBT 338 HPBT + .338 HPBT + .338 空尖艇尾比賽專用彈 + .338 空尖艇尾比赛专用弹 Caliber: 8.6x70mm (300gr Sierra MatchKing HPBT)<br />Rounds: 10 - Calibre: 8.6x70mm (300gr Sierra MatchKing HPBT)<br />Cartouches: 10 + Calibre: 8,6x70mm (300gr Sierra MatchKing HPBT)<br />Cartouches: 10 Calibre: 8.6x70mm (300gr Sierra MatchKing HPBT)<br />Balas: 10 Kaliber: 8,6x70mm (300gr Sierra MatchKing HPBT)<br />Pociski: 10 Калибр: 8,6x70mm (300 гран Sierra MatchKing экспансивные)<br />Патронов: 10 @@ -1566,7 +2020,10 @@ Ráže: 8.6x70mm (300gr Sierra MatchKing HPBT)<br />Nábojů: 10 Calibre: 8.6x70mm (300gr Sierra MatchKing HPBT)<br/>Cartuchos: 10 Kaliber: 8,6x70mm (300gr Sierra MatchKing HPBT)<br />Lövedékek: 10 - 口径: 8.6x70mm (300gr Sierra MatchKing HPBT)&lt;br /&gt;装填数: 10 + 口径: 8.6x70mm (300gr Sierra MatchKing HPBT)<br />装填数: 10 + 구경: 8.6x70mm (300gr Sierra MatchKing HPBT)<br />장탄수: 10 + 口徑: 8.6x70mm (300公克 Sierra MatchKing 空尖艇尾比賽專用彈)<br />發數: 10 + 口径: 8.6x70mm (300公克 Sierra MatchKing 空尖艇尾比赛专用弹)<br />发数: 10 .338 10Rnd Mag (API526) @@ -1580,6 +2037,9 @@ Carregador .338 (API526) com 10 cartuchos .338 10-lövedékes tár (API526) .338 10発入り 弾倉 (API526) + 10발들이 .338 탄창 (API526) + .338 10發 彈匣 (API526 穿甲燃燒彈) + .338 10发 弹匣 (API526 穿甲燃烧弹) .338 AP @@ -1593,10 +2053,13 @@ .338 AP .338 páncéltörő .338 徹甲弾 + .338 철갑탄 + .338 API526 穿甲燃燒彈 + .338 API526 穿甲燃烧弹 Caliber: 8.6x70mm (API526)<br />Rounds: 10 - Calibre: 8.6x70mm (API526)<br />Cartouches: 10 + Calibre: 8,6x70mm (API526)<br />Cartouches: 10 Calibre: 8.6x70mm (API526)<br />Balas: 10 Kaliber: 8,6x70mm (API526)<br />Pociski: 10 Калибр: 8,6x70 мм (API526)<br />Патронов: 10 @@ -1605,11 +2068,62 @@ Ráže: 8.6x70mm (API526)<br />Nábojů: 10 Calibre: 8.6x70mm (API526)<br/>Cartuchos: 10 Kaliber: 8,6x70mm (API526)<br />Lövedékek: 10 - 口径: 8.6x70mm (API526)&lt;br /&gt;装填数: 10 + 口径: 8.6x70mm (API526)<br />装填数: 10 + 구경: 8.6x70mm (API526)<br />장탄수: 10 + 口徑: 8.6x70mm (API526 穿甲燃燒彈)<br />發數: 10 + 口径: 8.6x70mm (API526 穿甲燃烧弹)<br />发数: 10 + + + .408 7Rnd Mag (305gr) + Ch. .408 7Cps (305gr) + Cargador de 7 balas de .408 (305gr) + Magazynek .408 7rd (305gr) + Магазин из 7-ти .408 (305gr) + .408 7-Patronen-Magazin (305gr) + .408 7Rnd Mag (305gr) + .408 7náb. Zásobník (305gr) + Carregador .408 (305gr) com 7 cartuchos + .408 7-lövedékes tár (305gr) + .408 7発入り 弾倉 (305gr) + 7발들이 .408 탄창 (305gr) + .408 7發 彈匣 (305公克) + .408 7发 弹匣 (305公克) + + + .408 + .408 + .408 + .408 + .408 + .408 + .408 + .408 + .408 + .408 + .408 + .408 + .408 + .408 + + + Caliber: .408 CheyTac (305gr)<br />Rounds: 7 + Calibre: .408 CheyTac (305gr)<br />Cartouches: 7 + Calibre: .408 CheyTac (305gr)<br />Balas: 7 + Kaliber: .408 CheyTac (305gr)<br />Pociski: 7 + Калибр: .408 CheyTac (305gr)<br />Патронов: 7 + Kaliber: .408 CheyTac (305gr)<br />Patronen: 7 + Calibro: .408 CheyTac (305gr)<br />Munizioni: 7 + Ráže: .408 CheyTac (305gr)<br />Nábojů: 7 + Calibre: .408 CheyTac (305gr)<br/>Cartuchos: 7 + Kaliber: .408 CheyTac (305gr)<br />Lövedékek: 7 + 口径: .408 CheyTac (305gr)<br />装填数: 7 + 구경: .408 CheyTac (305gr)<br />장탄수: 7 + 口徑: .408 夏伊戰術狙擊彈 (305公克)<br />發數: 7 + 口径: .408 夏伊战术狙击弹 (305公克)<br />发数: 7 12.7x99mm 5Rnd Mag - Ch. 12.7x99mm 5Cps + Ch. 12,7x99mm 5Cps Cargador de 5 balas de 12.7x99mm Magazynek 12,7x99mm 5rd Магазин из 5-ти 12,7x99 мм @@ -1619,10 +2133,13 @@ Carregador 12.7x99mm com 5 cartuchos 12,7x99mm 5-lövedékes tár 12.7x99mm 5発入り 弾倉 + 5발들이 12.7x99mm 탄창 + 12.7x99mm 5發 彈匣 + 12.7x99mm 5发 弹匣 12.7mm - 12.7mm + 12,7mm 12.7mm 12,7mm 12,7 мм @@ -1632,6 +2149,9 @@ 12.7mm 12,7mm 12.7mm + 12.7mm + 12.7mm + 12.7mm Caliber: 12.7x99mm<br />Rounds: 5 @@ -1644,11 +2164,14 @@ Ráže: 12.7x99mm<br />Nábojů: 5 Calibre: 12.7x99mm<br/>Cartuchos: 5 Kaliber: 12,7x99mm<br />Lövedékek: 5 - 口径: 12.7x99mm&lt;br /&gt;装填数: 5 + 口径: 12.7x99mm<br />装填数: 5 + 구경: 12.7x99mm<br />장탄수: 5 + 口徑: 12.7x99mm<br />發數: 5 + 口径: 12.7x99mm<br />发数: 5 12.7x99mm API 5Rnd Mag - Ch. 12.7x99mm API 5Cps + Ch. 12,7x99mm API 5Cps Cargador de 5 balas de 12.7x99mm API Magazynek 12,7x99mm API 5rd 12.7x99mm API 5Rnd Mag @@ -1658,10 +2181,13 @@ Carregador 12.7x99mm API com 5 cartuchos 12,7x99mm 5-lövedékes tár (páncéltörő-gyújtó) 12.7x99mm 5発入り焼夷徹甲弾 弾倉 + 5발들이 12.7x99mm 철갑소이탄 탄창 + 12.7x99mm 穿甲燃燒彈 5發 彈匣 + 12.7x99mm 穿甲燃烧弹 5发 弹匣 12.7mm API - 12.7mm API + 12,7mm API 12.7mm API 12,7mm API 12.7mm API @@ -1671,10 +2197,13 @@ 12.7mm API 12,7mm páncéltörő-gyújtó 12.7mm 焼夷徹甲弾 + 12.7mm 철갑소이탄 + 12.7mm 穿甲燃燒彈 + 12.7mm 穿甲燃烧弹 Caliber: 12.7x99mm API<br />Rounds: 5 - Calibre: 12.7x99mm API<br />Cartouches: 5 + Calibre: 12,7x99mm API<br />Cartouches: 5 Calibre: 12.7x99mm API<br />Balas: 5 Kaliber: 12,7x99mm API<br />Pociski: 5 Калибр: 12,7x99 мм бронебойно-зажигательные<br />Патронов: 5 @@ -1683,11 +2212,14 @@ Ráže: 12.7x99mm API<br />Nábojů: 5 Calibre: 12.7x99mm API<br/>Cartuchos: 5 Kaliber: 12,7x99mm API<br />Lövedékek: 5 - 口径: 12.7x99mm 焼夷徹甲弾&lt;br /&gt;装填数: 5 + 口径: 12.7x99mm 焼夷徹甲弾<br />装填数: 5 + 구경: 12.7x99mm 철갑소이탄<br />장탄수: 5 + 口徑: 12.7x99mm 穿甲燃燒彈<br />發數: 5 + 口径: 12.7x99mm 穿甲燃烧弹<br />发数: 5 12.7x99mm 5Rnd Mag (AMAX) - Ch. 12.7x99mm 5Cps (AMAX) + Ch. 12,7x99mm 5Cps (AMAX) Cargador de 5 balas de 12.7x99mm (AMAX) Magazynek 12,7x99mm 5rd (AMAX) Магазин из 5-ти 12,7x99 мм (A-MAX) @@ -1697,10 +2229,13 @@ Carregador 12.7x99mm (AMAX) com 5 cartuchos 12,7x99mm 5-lövedékes tár (AMAX) 12.7x99mm 5発入り 弾倉 (AMAX) + 5발들이 12.7x99mm 탄창 (AMAX) + 12.7x99mm 5發 彈匣 (AMAX 比賽專用彈) + 12.7x99mm 5发 弹匣 (AMAX 比赛专用弹) 12.7mm - 12.7mm + 12,7mm 12.7mm 12,7mm 12,7 мм @@ -1710,10 +2245,13 @@ 12.7mm 12,7mm 12.7mm + 12.7mm + 12.7mm AMAX 比賽專用彈 + 12.7mm AMAX 比赛专用弹 Caliber: 12.7x99mm (AMAX)<br />Rounds: 5 - Calibre: 12.7x99mm (AMAX)<br />Cartouches: 5 + Calibre: 12,7x99mm (AMAX)<br />Cartouches: 5 Calibre: 12.7x99mm (AMAX)<br />Balas: 5 Kaliber: 12,7x99mm (AMAX)<br />Pociski: 5 Калибр: 12,7x99 мм (A-MAX)<br />Патронов: 5 @@ -1722,7 +2260,10 @@ Ráže: 12.7x99mm (AMAX)<br />Nábojů: 5 Calibre: 12.7x99mm (AMAX)<br/>Cartuchos: 5 Kaliber: 12,7x99mm (AMAX)<br />Lövedékek: 5 - 口径: 12.7x99mm (AMAX)&lt;br /&gt;装填数: 5 + 口径: 12.7x99mm (AMAX)<br />装填数: 5 + 구경: 12.7x99mm (AMAX)<br />장탄수: 5 + 口徑: 12.7x99mm (AMAX 比賽專用彈)<br />發數: 5 + 口径: 12.7x99mm (AMAX 比赛专用弹)<br />发数: 5 [ACE] Ammo Supply Crate @@ -1736,6 +2277,9 @@ [ACE] Ящик с боеприпасами [ACE] Cassa munizioni [ACE] 弾薬物資箱 + [ACE] 탄약 보급 상자 + [ACE] 彈藥補給箱 + [ACE] 弹药补给箱 - \ No newline at end of file + diff --git a/addons/captives/ACE_Settings.hpp b/addons/captives/ACE_Settings.hpp index 1d0ebbf491..40cda39b60 100644 --- a/addons/captives/ACE_Settings.hpp +++ b/addons/captives/ACE_Settings.hpp @@ -18,4 +18,10 @@ class ACE_Settings { typeName = "BOOL"; value = 1; }; + class GVAR(requireSurrenderAi) { + displayName = CSTRING(ModuleSettings_requireSurrenderAi_name); + description = CSTRING(ModuleSettings_requireSurrenderAi_description); + typeName = "BOOL"; + value = 0; + }; }; diff --git a/addons/captives/CfgEventHandlers.hpp b/addons/captives/CfgEventHandlers.hpp index e2e8df28f1..95453fe5d1 100644 --- a/addons/captives/CfgEventHandlers.hpp +++ b/addons/captives/CfgEventHandlers.hpp @@ -63,3 +63,11 @@ class Extended_Local_EventHandlers { }; }; }; + +class Extended_Killed_EventHandlers { + class CAManBase { + class ADDON { + killed = QUOTE(_this call FUNC(handleKilled)); + }; + }; +}; diff --git a/addons/captives/CfgVehicles.hpp b/addons/captives/CfgVehicles.hpp index 2afa1cfea4..45a3f323e6 100644 --- a/addons/captives/CfgVehicles.hpp +++ b/addons/captives/CfgVehicles.hpp @@ -2,14 +2,13 @@ class CfgVehicles { class Man; class CAManBase: Man { class ACE_Actions { - class ACE_ApplyHandcuffs { displayName = CSTRING(SetCaptive); selection = "righthand"; distance = 2; condition = QUOTE([ARR_2(_player, _target)] call FUNC(canApplyHandcuffs)); statement = QUOTE([ARR_2(_player, _target)] call FUNC(doApplyHandcuffs)); - exceptions[] = {}; + exceptions[] = {"isNotSwimming", "isNotInside"}; icon = QPATHTOF(UI\handcuff_ca.paa); }; @@ -20,7 +19,7 @@ class CfgVehicles { distance = 2; condition = QUOTE([ARR_2(_player, _target)] call FUNC(canRemoveHandcuffs)); statement = QUOTE([ARR_2(_player, _target)] call FUNC(doRemoveHandcuffs)); - exceptions[] = {}; + exceptions[] = {"isNotSwimming", "isNotInside"}; icon = QPATHTOF(UI\handcuff_ca.paa); }; class ACE_EscortCaptive { @@ -28,7 +27,7 @@ class CfgVehicles { distance = 4; condition = QUOTE([ARR_2(_player, _target)] call FUNC(canEscortCaptive)); statement = QUOTE([ARR_3(_player, _target, true)] call FUNC(doEscortCaptive)); - exceptions[] = {}; + exceptions[] = {"isNotSwimming"}; showDisabled = 0; icon = QPATHTOF(UI\captive_ca.paa); priority = 2.3; @@ -38,7 +37,7 @@ class CfgVehicles { distance = 4; condition = QUOTE([ARR_2(_player, _target)] call FUNC(canStopEscorting)); statement = QUOTE([ARR_3(_player,_target, false)] call FUNC(doEscortCaptive)); - exceptions[] = {"isNotEscorting"}; + exceptions[] = {"isNotEscorting", "isNotSwimming"}; showDisabled = 0; icon = QPATHTOF(UI\captive_ca.paa); priority = 2.3; @@ -48,16 +47,18 @@ class CfgVehicles { distance = 4; condition = QUOTE([ARR_3(_player, _target, objNull)] call FUNC(canLoadCaptive)); statement = QUOTE([ARR_3(_player, _target, objNull)] call FUNC(doLoadCaptive)); - exceptions[] = {"isNotEscorting"}; + exceptions[] = {"isNotEscorting", "isNotSwimming"}; showDisabled = 0; icon = QPATHTOF(UI\captive_ca.paa); priority = 2.2; + insertChildren = QUOTE(call DFUNC(addLoadCaptiveActions)); }; class GVAR(UnloadCaptive) { displayName = CSTRING(UnloadCaptive); distance = 4; condition = QUOTE([ARR_2(_player, _target)] call FUNC(canUnloadCaptive)); statement = QUOTE([ARR_2(_player, _target)] call FUNC(doUnloadCaptive)); + exceptions[] = {"isNotSwimming"}; priority = 1.2; }; }; @@ -68,7 +69,7 @@ class CfgVehicles { displayName = CSTRING(StopEscorting); condition = QUOTE([ARR_2(_player, objNull)] call FUNC(canStopEscorting)); statement = QUOTE([ARR_3(_player,objNull, false)] call FUNC(doEscortCaptive)); - exceptions[] = {"isNotEscorting"}; + exceptions[] = {"isNotEscorting", "isNotSwimming"}; showDisabled = 0; priority = 2.3; }; @@ -76,7 +77,7 @@ class CfgVehicles { displayName = CSTRING(StartSurrendering); condition = QUOTE([ARR_2(_player, true)] call FUNC(canSurrender)); statement = QUOTE([ARR_2(_player, true)] call FUNC(setSurrendered)); - exceptions[] = {}; + exceptions[] = {"isNotSwimming"}; showDisabled = 0; priority = 0; icon = QPATHTOF(UI\Surrender_ca.paa); @@ -85,7 +86,7 @@ class CfgVehicles { displayName = CSTRING(StopSurrendering); condition = QUOTE([ARR_2(_player, false)] call FUNC(canSurrender)); statement = QUOTE([ARR_2(_player, false)] call FUNC(setSurrendered)); - exceptions[] = {"isNotSurrendering"}; + exceptions[] = {"isNotSurrendering", "isNotSwimming"}; showDisabled = 0; priority = 0; icon = QPATHTOF(UI\Surrender_ca.paa); @@ -101,7 +102,7 @@ class CfgVehicles { distance = 4; \ condition = QUOTE([ARR_3(_player, objNull, _target)] call FUNC(canLoadCaptive)); \ statement = QUOTE([ARR_3(_player, objNull, _target)] call FUNC(doLoadCaptive)); \ - exceptions[] = {"isNotEscorting"}; \ + exceptions[] = {"isNotEscorting", "isNotSwimming"}; \ priority = 1.2; \ }; \ }; \ @@ -222,6 +223,12 @@ class CfgVehicles { }; }; }; + class requireSurrenderAi { + displayName = CSTRING(ModuleSettings_requireSurrenderAi_name); + description = CSTRING(ModuleSettings_requireSurrenderAi_description); + typeName = "BOOL"; + defaultValue = 0; + }; }; class ModuleDescription: ModuleDescription { description = CSTRING(ModuleSettings_Description); diff --git a/addons/captives/CfgWeapons.hpp b/addons/captives/CfgWeapons.hpp index 1b65a0a4bf..8f3ea1b4ed 100644 --- a/addons/captives/CfgWeapons.hpp +++ b/addons/captives/CfgWeapons.hpp @@ -1,6 +1,6 @@ class CfgWeapons { class ACE_ItemCore; - class InventoryItem_Base_F; + class CBA_MiscItem_ItemInfo; class ACE_CableTie: ACE_ItemCore { displayName = CSTRING(CableTie); @@ -8,7 +8,7 @@ class CfgWeapons { model = QPATHTOF(models\ace_cabletie.p3d); picture = QPATHTOF(UI\ace_cabletie_ca.paa); scope = 2; - class ItemInfo: InventoryItem_Base_F { + class ItemInfo: CBA_MiscItem_ItemInfo { mass = 1; }; }; diff --git a/addons/captives/XEH_PREP.hpp b/addons/captives/XEH_PREP.hpp index bfb1ade5e0..bf0b06a1db 100644 --- a/addons/captives/XEH_PREP.hpp +++ b/addons/captives/XEH_PREP.hpp @@ -1,4 +1,4 @@ - +PREP(addLoadCaptiveActions); PREP(canApplyHandcuffs); PREP(canEscortCaptive); PREP(canFriskPerson); @@ -18,6 +18,7 @@ PREP(handleAnimChangedHandcuffed); PREP(handleAnimChangedSurrendered); PREP(handleGetIn); PREP(handleGetOut); +PREP(handleKilled); PREP(handleLocal); PREP(handleOnUnconscious); PREP(handlePlayerChanged); diff --git a/addons/captives/XEH_postInit.sqf b/addons/captives/XEH_postInit.sqf index 25f41d1320..8917ba58f8 100644 --- a/addons/captives/XEH_postInit.sqf +++ b/addons/captives/XEH_postInit.sqf @@ -1,4 +1,5 @@ #include "script_component.hpp" +#include "\a3\editor_f\Data\Scripts\dikCodes.h" ["ace_settingsInitialized", { // Hold on a little bit longer to ensure anims will work @@ -35,6 +36,21 @@ if (isServer) then { if (!hasInterface) exitWith {}; +["ACE3 Common", QGVAR(captives), [(localize LSTRING(SetCaptive)), (localize LSTRING(KeyComb_description))], +{ + private _target = cursorObject; + if !([ACE_player, _target, []] call EFUNC(common,canInteractWith)) exitWith {false}; + if !(_target isKindOf "CAManBase" || {(_target distance ACE_player) > getNumber (configFile >> "CfgVehicles" >> "CAManBase" >> "ACE_Actions" >> "ACE_ApplyHandcuffs" >> "distance")}) exitWith {false}; + + if ([ACE_player, _target] call FUNC(canApplyHandcuffs)) exitWith { + [QGVAR(setHandcuffed), [_target, true], _target] call CBA_fnc_targetEvent; + true + }; + false +}, +{false}, +[DIK_F1, [true, false, false]], true] call CBA_fnc_addKeybind; // Shift + F1 + ["isNotEscorting", {!(GETVAR(_this select 0,GVAR(isEscorting),false))}] call EFUNC(common,addCanInteractWithCondition); ["isNotHandcuffed", {!(GETVAR(_this select 0,GVAR(isHandcuffed),false))}] call EFUNC(common,addCanInteractWithCondition); ["isNotSurrendering", {!(GETVAR(_this select 0,GVAR(isSurrendering),false))}] call EFUNC(common,addCanInteractWithCondition); diff --git a/addons/captives/XEH_preInit.sqf b/addons/captives/XEH_preInit.sqf index 81657a8960..641da1f5c8 100644 --- a/addons/captives/XEH_preInit.sqf +++ b/addons/captives/XEH_preInit.sqf @@ -2,7 +2,9 @@ ADDON = false; +PREP_RECOMPILE_START; #include "XEH_PREP.hpp" +PREP_RECOMPILE_END; GVAR(captivityEnabled) = false; diff --git a/addons/captives/functions/fnc_addLoadCaptiveActions.sqf b/addons/captives/functions/fnc_addLoadCaptiveActions.sqf new file mode 100644 index 0000000000..0c7adbda7a --- /dev/null +++ b/addons/captives/functions/fnc_addLoadCaptiveActions.sqf @@ -0,0 +1,25 @@ +/* + * Author: 654wak654 + * Adds child actions to the "load captive" action for near vehicles. + * + * Arguments: + * 0: Captive + * + * Return Value: + * Child actions + * + * Example: + * [kevin] call ace_medical_fnc_addLoadCaptiveActions + * + * Public: No + */ +#include "script_component.hpp" + +params ["_target"]; + +private _statement = { + params ["_target", "_player", "_vehicle"]; + [_player, _target, _vehicle] call FUNC(doLoadCaptive); +}; + +[_target call EFUNC(common,nearestVehiclesFreeSeat), _statement, _target] call EFUNC(interact_menu,createVehiclesActions) diff --git a/addons/captives/functions/fnc_canApplyHandcuffs.sqf b/addons/captives/functions/fnc_canApplyHandcuffs.sqf index f5fa666652..231970255b 100644 --- a/addons/captives/functions/fnc_canApplyHandcuffs.sqf +++ b/addons/captives/functions/fnc_canApplyHandcuffs.sqf @@ -25,7 +25,7 @@ params ["_unit", "_target"]; {!(_target getVariable [QGVAR(isHandcuffed), false])} && { (_target getVariable ["ACE_isUnconscious", false]) || //isUnconscious - {!([_target] call EFUNC(common,isPlayer))} || //is an AI (not a player) + {!GVAR(requireSurrenderAi) && {!([_target] call EFUNC(common,isPlayer))}} || //is an AI (not a player) and doesn't require surrendering {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_canLoadCaptive.sqf b/addons/captives/functions/fnc_canLoadCaptive.sqf index a59c2e3be6..782661ea1c 100644 --- a/addons/captives/functions/fnc_canLoadCaptive.sqf +++ b/addons/captives/functions/fnc_canLoadCaptive.sqf @@ -4,20 +4,23 @@ * * Arguments: * 0: Unit that wants to load a captive - * 1: A captive. ObjNull for the first escorted captive (may be null) - * 2: Vehicle to load the captive into. ObjNull for the nearest vehicle (may be null) + * 1: A captive. objNull for the first escorted captive + * 2: Vehicle to load the captive into. objNull for the nearest vehicle * * Return Value: - * The return value + * Can load captive * * Example: - * [player, bob, car] call ACE_captives_fnc_canLoadCaptive + * [bob, tom, car] call ace_captives_fnc_canLoadCaptive * * Public: No */ #include "script_component.hpp" -params ["_unit", "_target","_vehicle"]; +params ["_unit", "_target", "_vehicle"]; + +// Don't show "Load Captive" if unit is unconscious (already has "Load Patient") +if (_target getVariable ["ACE_isUnconscious", false]) exitWith {false}; if ((isNull _target) && {_unit getVariable [QGVAR(isEscorting), false]}) then { //Looking at a vehicle while escorting, get target from attached objects: @@ -27,20 +30,16 @@ if ((isNull _target) && {_unit getVariable [QGVAR(isEscorting), false]}) then { }; } forEach (attachedObjects _unit); }; -if ((isNull _target) || {(vehicle _target) != _target} || {!(_target getVariable [QGVAR(isHandcuffed), false])}) exitWith {false}; +if (isNull _target || {(vehicle _target) != _target} || {!(_target getVariable [QGVAR(isHandcuffed), false])}) exitWith {false}; if (isNull _vehicle) then { - //Looking at a captive unit, search for nearby vehicles with valid seats: - { - if ((_x emptyPositions "cargo") > 0) exitWith { - _vehicle = _x; - }; - } forEach (nearestObjects [_unit, ["Car", "Tank", "Helicopter", "Plane", "Ship"], 10]); + // Looking at a captive unit, get nearest vehicle with valid seat: + _vehicle = (_target call EFUNC(common,nearestVehiclesFreeSeat)) param [0, objNull]; } else { - //We have a vehicle picked, make sure it has empty seats: - if ((_vehicle emptyPositions "cargo") == 0) then { + // We have a vehicle picked, make sure it has empty seats: + if (_vehicle emptyPositions "cargo" == 0 && {_vehicle emptyPositions "gunner" == 0}) then { _vehicle = objNull; }; }; -(!isNull _vehicle) +!isNull _vehicle diff --git a/addons/captives/functions/fnc_canStopEscorting.sqf b/addons/captives/functions/fnc_canStopEscorting.sqf index cfafb5a0e8..181b16be94 100644 --- a/addons/captives/functions/fnc_canStopEscorting.sqf +++ b/addons/captives/functions/fnc_canStopEscorting.sqf @@ -1,13 +1,13 @@ /* * Author: PabstMirror - * Tests if player can stop escorting + * Tests if player can stop escorting. * * Arguments: - * 0: caller (player) - * 1: target + * 0: Caller (player) + * 1: Target (default: objNull) * * Return Value: - * The return value + * Can unit stop escorting another unit * * Example: * [player, bob] call ACE_captives_fnc_canStopEscorting diff --git a/addons/captives/functions/fnc_canUnloadCaptive.sqf b/addons/captives/functions/fnc_canUnloadCaptive.sqf index 82fc0a8429..0d8ec81b07 100644 --- a/addons/captives/functions/fnc_canUnloadCaptive.sqf +++ b/addons/captives/functions/fnc_canUnloadCaptive.sqf @@ -18,4 +18,5 @@ params ["_player", "_unit"]; -((vehicle _unit) != _unit) && {_unit getVariable [QGVAR(isHandcuffed), false]} +// Don't show "Unload Captive" if unit is unconscious (already has "Unload Patient") +(vehicle _unit != _unit) && {vehicle _player == _player} && {_unit getVariable [QGVAR(isHandcuffed), false]} && {!(_unit getVariable ["ACE_isUnconscious", false])} diff --git a/addons/captives/functions/fnc_doEscortCaptive.sqf b/addons/captives/functions/fnc_doEscortCaptive.sqf index e0d3ae8fa6..ad57dabcd7 100644 --- a/addons/captives/functions/fnc_doEscortCaptive.sqf +++ b/addons/captives/functions/fnc_doEscortCaptive.sqf @@ -30,7 +30,7 @@ if (_state) then { _unit setVariable [QGVAR(escortedUnit), _target, true]; //Add Actionmenu to release captive - _actionID = _unit addAction [format ["%1", localize LSTRING(StopEscorting)], + private _actionID = _unit addAction [format ["%1", localize LSTRING(StopEscorting)], {[(_this select 0), ((_this select 0) getVariable [QGVAR(escortedUnit), objNull]), false] call FUNC(doEscortCaptive);}, nil, 20, false, true, "", QUOTE(!isNull (GETVAR(_target,QGVAR(escortedUnit),objNull)))]; diff --git a/addons/captives/functions/fnc_doFriskPerson.sqf b/addons/captives/functions/fnc_doFriskPerson.sqf index d3ddecfd13..700fba4ffb 100644 --- a/addons/captives/functions/fnc_doFriskPerson.sqf +++ b/addons/captives/functions/fnc_doFriskPerson.sqf @@ -7,7 +7,7 @@ * 1: unit * * Return Value: - * Nothing + * None * * Example: * [player, bob] call ACE_captives_fnc_doFristPerson; diff --git a/addons/captives/functions/fnc_doLoadCaptive.sqf b/addons/captives/functions/fnc_doLoadCaptive.sqf index a06a569e12..c47cc389d4 100644 --- a/addons/captives/functions/fnc_doLoadCaptive.sqf +++ b/addons/captives/functions/fnc_doLoadCaptive.sqf @@ -4,42 +4,37 @@ * * Arguments: * 0: Unit that wants to load a captive - * 1: A captive. ObjNull for the first escorted captive - * 2: Vehicle to load the captive into. ObjNull for the nearest vehicle + * 1: A captive. objNull for the first escorted captive + * 2: Vehicle to load the captive into. objNull for the nearest vehicle * * Return Value: - * Nothing + * None * * Example: - * [bob, tom, car] call ACE_captives_fnc_doLoadCaptive + * [bob, tom, car] call ace_captives_fnc_doLoadCaptive * * Public: No */ #include "script_component.hpp" -params ["_unit", "_target","_vehicle"]; +params ["_unit", "_target", "_vehicle"]; -if ((isNull _target) && {_unit getVariable [QGVAR(isEscorting), false]}) then { - //Looking at a vehicle while escorting, get target from attached objects: +if (isNull _target && {_unit getVariable [QGVAR(isEscorting), false]}) then { + // Looking at a vehicle while escorting, get target from attached objects: { if (_x getVariable [QGVAR(isHandcuffed), false]) exitWith { _target = _x; }; } forEach (attachedObjects _unit); }; -if ((isNull _target) || {(vehicle _target) != _target} || {!(_target getVariable [QGVAR(isHandcuffed), false])}) exitWith {WARNING("");}; +if (isNull _target || {(vehicle _target) != _target} || {!(_target getVariable [QGVAR(isHandcuffed), false])}) exitWith {WARNING("");}; if (isNull _vehicle) then { - //Looking at a captive unit, search for nearby vehicles with valid seats: - { - // if (([_x] call FUNC(findEmptyNonFFVCargoSeat)) != -1) exitWith { - if ((_x emptyPositions "cargo") > 0) exitWith { - _vehicle = _x; - }; - } forEach (nearestObjects [_unit, ["Car", "Tank", "Helicopter", "Plane", "Ship"], 10]); + // Looking at a captive unit, get nearest vehicle with valid seat: + _vehicle = (_target call EFUNC(common,nearestVehiclesFreeSeat)) param [0, objNull]; } else { - // if (([_vehicle] call FUNC(findEmptyNonFFVCargoSeat)) == -1) then { - if ((_vehicle emptyPositions "cargo") == 0) then { + // We have a vehicle picked, make sure it has empty seats: + if (_vehicle emptyPositions "cargo" == 0 && {_vehicle emptyPositions "gunner" == 0}) then { _vehicle = objNull; }; }; diff --git a/addons/captives/functions/fnc_doUnloadCaptive.sqf b/addons/captives/functions/fnc_doUnloadCaptive.sqf index fd4375e4b7..93bdab114c 100644 --- a/addons/captives/functions/fnc_doUnloadCaptive.sqf +++ b/addons/captives/functions/fnc_doUnloadCaptive.sqf @@ -7,7 +7,7 @@ * 1: A captive loaded in a vehicle * * Return Value: - * Nothing + * None * * Example: * [bob, prisoner] call ACE_captives_fnc_doUnloadCaptive diff --git a/addons/captives/functions/fnc_findEmptyNonFFVCargoSeat.sqf b/addons/captives/functions/fnc_findEmptyNonFFVCargoSeat.sqf index 63792a7c55..91bb800c05 100644 --- a/addons/captives/functions/fnc_findEmptyNonFFVCargoSeat.sqf +++ b/addons/captives/functions/fnc_findEmptyNonFFVCargoSeat.sqf @@ -18,20 +18,18 @@ params ["_vehicle"]; TRACE_1("params", _vehicle); -private _vehicleConfig = configFile >> "CfgVehicles" >> (typeOf _vehicle); - scopeName "main"; { _x params ["_unit", "_role", "_cargoIndex", "_turretPath", "_isPersonTurret"]; - if ((isNull _unit) && {_role == "cargo"} && {_cargoIndex > -1} && {!_isPersonTurret}) then { + if (isNull _unit && {_role == "cargo"} && {_cargoIndex > -1} && {!_isPersonTurret}) then { [_cargoIndex, false] breakOut "main"; }; } forEach (fullCrew [_vehicle, "", true]); { _x params ["_unit", "_role", "_cargoIndex", "_turretPath", "_isPersonTurret"]; - if ((isNull _unit) && {_cargoIndex > -1}) then { + if (isNull _unit && {_cargoIndex > -1}) then { [_cargoIndex, true] breakOut "main"; }; } forEach (fullCrew [_vehicle, "", true]); diff --git a/addons/captives/functions/fnc_handleAnimChangedHandcuffed.sqf b/addons/captives/functions/fnc_handleAnimChangedHandcuffed.sqf index 2f55d51fc3..f71a3f04a3 100644 --- a/addons/captives/functions/fnc_handleAnimChangedHandcuffed.sqf +++ b/addons/captives/functions/fnc_handleAnimChangedHandcuffed.sqf @@ -6,9 +6,12 @@ * 0: The Unit * 1: New animation * - * ReturnValue: + * Return Value: * None * + * Example: + * [bob, "movearm"] call ACE_captives_fnc_handleAnimChangedHandcuffed + * * Public: No */ @@ -23,7 +26,7 @@ if (_unit == (vehicle _unit)) then { [_unit, "ACE_AmovPercMstpScapWnonDnon", 1] call EFUNC(common,doAnimation); }; } else { - _turretPath = []; + private _turretPath = []; { _x params ["_xUnit", "", "", "_xTurretPath"]; if (_unit == _xUnit) exitWith {_turretPath = _xTurretPath}; diff --git a/addons/captives/functions/fnc_handleAnimChangedSurrendered.sqf b/addons/captives/functions/fnc_handleAnimChangedSurrendered.sqf index cf17d8b873..304926600f 100644 --- a/addons/captives/functions/fnc_handleAnimChangedSurrendered.sqf +++ b/addons/captives/functions/fnc_handleAnimChangedSurrendered.sqf @@ -6,9 +6,12 @@ * 0: The Unit * 1: New animation * - * ReturnValue: + * Return Value: * None * + * Example: + * [bob, "movearm"] call ACE_captives_fnc_handleAnimChangedSurrendered + * * Public: No */ diff --git a/addons/captives/functions/fnc_handleGetIn.sqf b/addons/captives/functions/fnc_handleGetIn.sqf index d89049a031..60f1ecf9b9 100644 --- a/addons/captives/functions/fnc_handleGetIn.sqf +++ b/addons/captives/functions/fnc_handleGetIn.sqf @@ -31,7 +31,7 @@ if (local _unit) then { if (_unit getVariable [QGVAR(isHandcuffed), false]) then { //Need to force animation for FFV turrets - _turretPath = []; + private _turretPath = []; { _x params ["_xUnit", "", "", "_xTurretPath"]; if (_unit == _xUnit) exitWith {_turretPath = _xTurretPath}; diff --git a/addons/captives/functions/fnc_handleKilled.sqf b/addons/captives/functions/fnc_handleKilled.sqf new file mode 100644 index 0000000000..27963e460d --- /dev/null +++ b/addons/captives/functions/fnc_handleKilled.sqf @@ -0,0 +1,24 @@ +/* + * Author: Jonpas + * Called when a unit dies. + * + * Arguments: + * 0: Unit + * + * Return Value: + * None + * + * Example: + * [bob] call ace_captives_fnc_handleKilled + * + * Public: No + */ +#include "script_component.hpp" + +params ["_unit"]; +TRACE_1("handleKilled",_unit); + +// Remove handcuffs on a dead unit, removing them after unit goes into ragdoll causes a stand-up twitch and restarts the ragdoll +if (_unit getVariable [QGVAR(isHandcuffed), false]) then { + [_unit, false] call FUNC(setHandcuffed); +}; diff --git a/addons/captives/functions/fnc_handleLocal.sqf b/addons/captives/functions/fnc_handleLocal.sqf index 693eb844fd..ee11e74fcb 100644 --- a/addons/captives/functions/fnc_handleLocal.sqf +++ b/addons/captives/functions/fnc_handleLocal.sqf @@ -6,9 +6,12 @@ * 0: The Unit * 1: Is local * - * ReturnValue: + * Return Value: * None * + * Example: + * [bob, true] call ACE_captives_fnc_handleLocal + * * Public: No */ diff --git a/addons/captives/functions/fnc_handleOnUnconscious.sqf b/addons/captives/functions/fnc_handleOnUnconscious.sqf index 456161d9de..d89d18c506 100644 --- a/addons/captives/functions/fnc_handleOnUnconscious.sqf +++ b/addons/captives/functions/fnc_handleOnUnconscious.sqf @@ -7,7 +7,7 @@ * 0: Is Unconsisisiouses * * Return Value: - * Nothing + * None * * Example: * [bob, true] call ACE_captives_fnc_handleOnUnconscious diff --git a/addons/captives/functions/fnc_handleRespawn.sqf b/addons/captives/functions/fnc_handleRespawn.sqf index b95438fa22..2d6618c6d1 100644 --- a/addons/captives/functions/fnc_handleRespawn.sqf +++ b/addons/captives/functions/fnc_handleRespawn.sqf @@ -7,7 +7,7 @@ * 1: Corpse * * Return Value: - * Nothing + * None * * Example: * [alive, body] call ACE_captives_fnc_handleRespawn; @@ -17,6 +17,7 @@ #include "script_component.hpp" params ["_unit","_dead"]; +TRACE_2("handleRespawn",_unit,_dead); if (!local _unit) exitWith {}; @@ -46,7 +47,7 @@ if (_respawn > 3) then { }; [_unit, "setCaptive", QGVAR(Surrendered), false] call EFUNC(common,statusEffect_set); - if (_oldUnit getVariable [QGVAR(isEscorting), false]) then { - _oldUnit setVariable [QGVAR(isEscorting), false, true]; + if (_unit getVariable [QGVAR(isEscorting), false]) then { + _unit setVariable [QGVAR(isEscorting), false, true]; }; }; diff --git a/addons/captives/functions/fnc_handleZeusDisplayChanged.sqf b/addons/captives/functions/fnc_handleZeusDisplayChanged.sqf index 433c1fc259..bdb1450874 100644 --- a/addons/captives/functions/fnc_handleZeusDisplayChanged.sqf +++ b/addons/captives/functions/fnc_handleZeusDisplayChanged.sqf @@ -8,7 +8,7 @@ * 1: Display is now open * * Return Value: - * Nothing + * None * * Example: * [bob1, false] call ACE_captives_fnc_handleZeusDisplayChanged diff --git a/addons/captives/functions/fnc_moduleHandcuffed.sqf b/addons/captives/functions/fnc_moduleHandcuffed.sqf index b2e0b431b3..5b04696678 100644 --- a/addons/captives/functions/fnc_moduleHandcuffed.sqf +++ b/addons/captives/functions/fnc_moduleHandcuffed.sqf @@ -9,7 +9,7 @@ * 2: Activated * * Return Value: - * Nothing + * None * * Example: * [objNull, [player], true] call ace_captives_fnc_moduleHandcuffed diff --git a/addons/captives/functions/fnc_moduleSettings.sqf b/addons/captives/functions/fnc_moduleSettings.sqf index fc8c76721f..04ffc04f45 100644 --- a/addons/captives/functions/fnc_moduleSettings.sqf +++ b/addons/captives/functions/fnc_moduleSettings.sqf @@ -8,6 +8,9 @@ * Return Value: * None * + * Example: + * [LOGIC] call ace_captives_fnc_moduleSettings + * * Public: No */ @@ -18,3 +21,4 @@ params ["_logic"]; [_logic, QGVAR(allowHandcuffOwnSide), "allowHandcuffOwnSide"] call EFUNC(common,readSettingFromModule); [_logic, QGVAR(allowSurrender), "allowSurrender"] call EFUNC(common,readSettingFromModule); [_logic, QGVAR(requireSurrender), "requireSurrender"] call EFUNC(common,readSettingFromModule); +[_logic, QGVAR(requireSurrenderAi), "requireSurrenderAi"] call EFUNC(common,readSettingFromModule); diff --git a/addons/captives/functions/fnc_moduleSurrender.sqf b/addons/captives/functions/fnc_moduleSurrender.sqf index c4482ce904..9f3bd8cdf9 100644 --- a/addons/captives/functions/fnc_moduleSurrender.sqf +++ b/addons/captives/functions/fnc_moduleSurrender.sqf @@ -9,7 +9,7 @@ * 2: Activated * * Return Value: - * Nothing + * None * * Example: * [objNull, [player], true] call ace_captives_fnc_moduleSurrender diff --git a/addons/captives/functions/fnc_setHandcuffed.sqf b/addons/captives/functions/fnc_setHandcuffed.sqf index d2011b5292..9a713af0b4 100644 --- a/addons/captives/functions/fnc_setHandcuffed.sqf +++ b/addons/captives/functions/fnc_setHandcuffed.sqf @@ -7,7 +7,7 @@ * 1: True to take captive, false to release captive * * Return Value: - * Nothing + * None * * Example: * [bob, true] call ACE_captives_fnc_setHandcuffed; diff --git a/addons/captives/functions/fnc_setSurrendered.sqf b/addons/captives/functions/fnc_setSurrendered.sqf index 53e709bab7..a0551d0219 100644 --- a/addons/captives/functions/fnc_setSurrendered.sqf +++ b/addons/captives/functions/fnc_setSurrendered.sqf @@ -7,7 +7,7 @@ * 1: True to surrender, false to un-surrender * * Return Value: - * Nothing + * None * * Example: * [Pierre, true] call ACE_captives_fnc_setSurrendered; diff --git a/addons/captives/functions/fnc_vehicleCaptiveMoveIn.sqf b/addons/captives/functions/fnc_vehicleCaptiveMoveIn.sqf index 503d80de2c..fa1d920a0d 100644 --- a/addons/captives/functions/fnc_vehicleCaptiveMoveIn.sqf +++ b/addons/captives/functions/fnc_vehicleCaptiveMoveIn.sqf @@ -7,7 +7,7 @@ * 1: The Vehicle * * Return Value: - * Nothing + * None * * Example: * [bob, car1] call ACE_captives_fnc_vehicleCaptiveMoveIn; diff --git a/addons/captives/functions/fnc_vehicleCaptiveMoveOut.sqf b/addons/captives/functions/fnc_vehicleCaptiveMoveOut.sqf index ce44b5926f..329adc1740 100644 --- a/addons/captives/functions/fnc_vehicleCaptiveMoveOut.sqf +++ b/addons/captives/functions/fnc_vehicleCaptiveMoveOut.sqf @@ -6,7 +6,7 @@ * 0: Captive Unit being unloaded * * Return Value: - * Nothing + * None * * Example: * [bob] call ACE_captives_fnc_vehicleCaptiveMoveOut; diff --git a/addons/captives/stringtable.xml b/addons/captives/stringtable.xml index 042242ad61..92d500c27e 100644 --- a/addons/captives/stringtable.xml +++ b/addons/captives/stringtable.xml @@ -13,6 +13,9 @@ Foglyul ejtés Взять в плен 捕虜にする + 사로잡기 + 逮捕俘虜 + 逮捕俘虏 Free Prisoner @@ -26,6 +29,9 @@ Fogoly szabadon engedése Освободить пленника 捕虜を解放する + 풀어주기 + 釋放俘虜 + 释放俘虏 Escort Prisoner @@ -39,6 +45,9 @@ Fogoly kísérése Конвоировать пленника 捕虜を移動させる + 포로 호송하기 + 護送俘虜 + 护送俘虏 Release Prisoner @@ -52,6 +61,9 @@ Fogoly elengedése Прекратить конвоирование 捕虜を解放する + 포로 풀어주기 + 停止護送俘虜 + 停止护送俘虏 You need to take him as prisoner first! @@ -65,6 +77,9 @@ Először foglyul kell ejtened őt! Вы должны сначала взять его в плен! あなたは先に捕虜を取る必要があります。 + 먼저 포로로 만들어야합니다! + 你必須先逮捕他! + 你必须先逮捕他! Load Captive @@ -78,6 +93,9 @@ Embarcar Prisioneiro Fai salire il prigioniero 捕虜を乗せる + 포로 태우기 + 將俘虜放入載具 + 将俘虏放入载具 Unload Captive @@ -91,6 +109,9 @@ Desembarcar Prisioneiro Fai scendere il prigioniero 捕虜を降ろす + 포로 내리기 + 將俘虜帶出載具 + 将俘虏带出载具 Cable Tie @@ -104,6 +125,9 @@ Gyorskötöző Кабельная стяжка ケーブル タイ + 케이블 타이 + 束線帶 + 束线带 Cable ties that allow you to restrain prisoners. @@ -117,6 +141,9 @@ Gyorskötöző, emberek foglyulejtéséhez használható. Кабельные стяжки позволяют связывать пленников. ケーブル タイは捕虜を制圧できます。 + 케이블 타이는 포로를 구류시킬때 씁니다. + 束線帶可以綁住俘虜 + 束线带可以绑住俘虏 Inventory of frisked person @@ -130,6 +157,9 @@ Inventário da pessoa revistada Inventario della persona perquisita 捕虜の持ち物を確認する + 검문당한 사람의 소지품 + 搜身選單 + 搜身选单 Frisk person @@ -143,6 +173,9 @@ Revistar Perquisisci la persona 捕虜の持ち物 + 검문당한사람 + 搜身 + 搜身 Surrender @@ -156,6 +189,9 @@ Megadás Arrenditi 投降 + 투항 + 投降 + 投降 Stop Surrendering @@ -169,6 +205,9 @@ Megadás abbahagyása Smetti di arrenderti 投降をやめる + 투항하는것을 멈춤 + 停止投降 + 停止投降 Make Unit Surrender @@ -182,6 +221,9 @@ Заставить юнита сдаться Fai arrendere l'unità ユニットを投降させる + 투항시키기 + 使單位投降 + 使单位投降 Sync a unit to make them surrender. @@ -195,6 +237,9 @@ Синхронизируйте с юнитами, чтобы заставить их сдаться в плен. Sincronizza una unità per farla arrendere. 同期されたユニットを投降させます。 + 투항시키기 위해 동기화합니다. + 同步此模塊到一個單位,使該單位投降 + 同步此模块到一个单位,使该单位投降 Make Unit Handcuffed @@ -207,10 +252,13 @@ Hacer que la unidad esté esposada Rendre une unité captive ユニットを拘束する + 수갑을 채우기 + 使單位戴上手銬 + 使单位戴上手铐 Sync a unit to make them handcuffed. - Synchronisiere eine Einheit um sie in Handschellen zu legen. + Synchronisiere eine Einheit, um sie in Handschellen zu legen. Zsynchronizuj z jednostką, aby została skuta. Sincronizar uma unidade para deixá-la algemada. Синхронизируйте с юнитами, чтобы сделать их связанными. @@ -219,6 +267,9 @@ Sincroniza una unidad para hacer que esté esposada. Synchronisez une unité pour la rendre captive. 同期されたユニットを拘束させます。 + 수갑을 채우기 위해 동기화합니다. + 使單位戴上手銬 + 使单位戴上手铐 Captives Settings @@ -232,6 +283,9 @@ Настройки пленения Impostazioni Prigionieri 拘束の設定 + 포로 설정 + 俘虜設定 + 俘虏设定 Controls settings for surrender and cable ties @@ -245,6 +299,9 @@ Управляет настройками сдачи в плен и связывания Controlla le impostazioni per la resa e le manette 投降したユニットや拘束されたユニットの扱いを設定します。 + 투항과 케이블 타이에 관련한 설정 + 定義投降與束帶等設定 + 定义投降与束带等设定 Can handcuff own side @@ -257,20 +314,26 @@ Saját oldal megbilincselhető Связать союзника Puoi ammanettare unità alleate - 自陣営への拘束を可能に + 拘束ユニットを自陣営へ + 자기편에게 수갑을 채울 수 있게 합니다 + 可以銬住同陣營隊友 + 可以铐住同阵营队友 Can players cabletie units on their own side Czy gracze mogą skuwać sojuszników? Pueden los jugadores esposar unidades en su propio bando Mohou hráči spoutat jednotky na své straně - Spieler können 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 Разрешить игрокам связывать юнитов своей стороны I giocatori possono ammanettare unità alleate - プレイヤーがユニットを拘束し、彼らの陣営に変更できます。 + プレイヤーが拘束したユニットの陣営を自陣営に変更させます。 + 자기편에게 케이블타이를 사용할 수 있게합니다 + 玩家可以使用束線帶銬住同陣營隊友 + 玩家可以使用束线带铐住同阵营队友 Allow surrendering @@ -284,6 +347,9 @@ Сдаться в плен Permetti Resa 投降を許可 + 투항 활성화 + 允許投降 + 允许投降 Players can surrender after holstering their weapon @@ -296,7 +362,10 @@ A játékosok megadhatják magukat a fegyverük elrakása után Игроки могут сдаться в плен после того, как уберут оружие I giocatori possono arrendersi dopo aver messo via le proprie armi - プレイヤーは武器を収めたあとに投降できるようにします。 + プレイヤーは武器を収めたあと投降できるようにします。 + 비무장한 플레이어가 투항할 수 있게 합니다 + 玩家能在收起自己武器後投降 + 玩家能在收起自己武器后投降 Require surrendering @@ -309,6 +378,9 @@ Richiedi Resa Requiert la reddition 投降を必要とする + 투항 필요 + 要求目標投降 + 要求目标投降 Require Players to surrender before they can be arrested @@ -321,6 +393,9 @@ I giocatori devono arrendersi prima che possano essere arrestati Requiert la capitulation des joueurs avant qu'ils ne puissent être arrêtés プレイヤーは拘束される前に、投降する必要があります。 + 체포하기 전에 플레이어가 투항을 먼저해야만 합니다 + 玩家須先要求目標投降,才可以進行逮捕 + 玩家须先要求目标投降,才可以进行逮捕 Surrendering only @@ -333,6 +408,9 @@ Solo Resa Reddition seulement 投降中のみ + 투항 중에만 + 只能在投降狀態 + 只能在投降状态 Surrendering or No weapon @@ -345,6 +423,33 @@ Resa o senza armi Capitulation ou desarmé 投降中か非武装時 + 투항 중 혹은 비무장 + 投降或無武器狀態 + 投降或无武器状态 + + + Sets the unit under the cursor captive. + Nimmt die Einheit unter dem Cursor fest. + カーソル先のユニットを拘束 + Imposta l'unità nello stato di prigioniero. + 設置在游標下的單位成俘虜狀態。 + 设置在游标下的单位成俘虏状态。 + + + Require AI surrendering + Benötigt für KI Kapitulation + Necessita arresa AI + AI の投降を必要とする + 需要AI先行投降 + 需要AI先行投降 + + + Require AI to surrender before they can be arrested + KI muss sich erst ergeben, bevor sie gefangen genommen werden kann + Necessita che le AI si arrendano prima di essere arrestate + AI の拘束は AI が投降している場合に限り可能にします。 + 在逮捕AI之前該AI必須先進入投降狀態。 + 在逮捕AI之前该AI必须先进入投降状态。 - \ No newline at end of file + diff --git a/addons/cargo/ACE_Settings.hpp b/addons/cargo/ACE_Settings.hpp index 574000155e..595de28459 100644 --- a/addons/cargo/ACE_Settings.hpp +++ b/addons/cargo/ACE_Settings.hpp @@ -6,4 +6,11 @@ class ACE_Settings { value = 1; category = ECSTRING(OptionsMenu,CategoryLogistics); }; + class GVAR(paradropTimeCoefficent) { + displayName = CSTRING(paradropTimeCoefficent); + description = CSTRING(paradropTimeCoefficent_description); + typeName = "SCALAR"; + value = 2.5; + category = ECSTRING(OptionsMenu,CategoryLogistics); + }; }; diff --git a/addons/cargo/CfgEden.hpp b/addons/cargo/CfgEden.hpp new file mode 100644 index 0000000000..9144ba458b --- /dev/null +++ b/addons/cargo/CfgEden.hpp @@ -0,0 +1,37 @@ +class Cfg3DEN { + class Object { + class AttributeCategories { + class ace_attributes { + class Attributes { + class GVAR(space) { + displayName = CSTRING(space_edenName); + tooltip = CSTRING(space_edenDesc); + property = QGVAR(space); + control = "Edit"; + + expression = QUOTE([ARR_2(_this,_value)] call DFUNC(setSpace);); + defaultValue = QUOTE(GET_NUMBER(configFile >> 'CfgVehicles' >> typeOf _this >> QQGVAR(space),0)); + + validate = "number"; + condition = "objectHasInventoryCargo"; + typeName = "NUMBER"; + }; + class GVAR(size) { + displayName = CSTRING(size_edenName); + tooltip = CSTRING(size_edenDesc); + property = QGVAR(size); + control = "Edit"; + + // Expression only runs on the server, must handle actions for all machines and future JIPs (Why BI?!) + expression = QUOTE([ARR_2(_this,_value)] call DFUNC(setSize);); + defaultValue = QUOTE(GET_NUMBER(configFile >> 'CfgVehicles' >> typeOf _this >> QQGVAR(size),-1)); + + validate = "number"; + condition = "1-objectBrain"; + typeName = "NUMBER"; + }; + }; + }; + }; + }; +}; diff --git a/addons/cargo/CfgEventHandlers.hpp b/addons/cargo/CfgEventHandlers.hpp index 45f6d48997..823dc87470 100644 --- a/addons/cargo/CfgEventHandlers.hpp +++ b/addons/cargo/CfgEventHandlers.hpp @@ -24,52 +24,3 @@ class Extended_Killed_EventHandlers { }; }; }; - -//Need initPost or we have problems with setVariable with 'ACE_Cargo' -class Extended_InitPost_EventHandlers { - class ThingX { - class ADDON { - init = QUOTE(_this call DFUNC(initObject); _this call DFUNC(initVehicle)); - }; - }; - class Land_PaperBox_closed_F { - class ADDON { - init = QUOTE(_this call DFUNC(initObject); _this call DFUNC(initVehicle)); - }; - }; - class PlasticCase_01_base_F { - class ADDON { - init = QUOTE(_this call DFUNC(initObject); _this call DFUNC(initVehicle)); - }; - }; - class LandVehicle { - class ADDON { - init = QUOTE(_this call DFUNC(initVehicle)); - }; - }; - class Air { - class ADDON { - init = QUOTE(_this call DFUNC(initVehicle)); - }; - }; - class Ship_F { - class ADDON { - init = QUOTE(_this call DFUNC(initVehicle)); - }; - }; - class ACE_ConcertinaWireCoil { - class ADDON { - init = QUOTE(_this call DFUNC(initObject)); - }; - }; - class Land_PortableLight_single_F { - class ADDON { - init = QUOTE(_this call DFUNC(initObject)); - }; - }; - class StaticWeapon { - class ADDON { - init = QUOTE(_this call DFUNC(initObject)); - }; - }; -}; diff --git a/addons/cargo/CfgVehicles.hpp b/addons/cargo/CfgVehicles.hpp index 9d4c34182f..4d76ac8581 100644 --- a/addons/cargo/CfgVehicles.hpp +++ b/addons/cargo/CfgVehicles.hpp @@ -26,6 +26,12 @@ class CfgVehicles { typeName = "BOOL"; defaultValue = 1; }; + class paradropTimeCoefficent { + displayName = CSTRING(paradropTimeCoefficent); + description = CSTRING(paradropTimeCoefficent_description); + typeName = "SCALAR"; + defaultValue = 2.5; + }; }; class ModuleDescription { @@ -259,12 +265,17 @@ class CfgVehicles { GVAR(space) = 4; }; - // jets + // planes (off by default as most are attack jets) class Plane: Air { GVAR(space) = 0; GVAR(hasCargo) = 0; }; + class Plane_Base_F: Plane {}; + class Plane_Civil_01_base_F: Plane_Base_F { // Tanoa Civilian Prop Plane + GVAR(space) = 2; + GVAR(hasCargo) = 1; + }; class VTOL_Base_F; class VTOL_01_base_F: VTOL_Base_F { GVAR(space) = 4; @@ -274,12 +285,20 @@ class CfgVehicles { GVAR(space) = 4; GVAR(hasCargo) = 1; }; - - // autonomus + + // autonomous class UAV_01_base_F: Helicopter_Base_F { GVAR(space) = 0; GVAR(hasCargo) = 0; }; + class UAV_03_base_F: Helicopter_Base_F { + GVAR(space) = 0; + GVAR(hasCargo) = 0; + }; + class UAV_06_base_F: Helicopter_Base_F { + GVAR(space) = 0; + GVAR(hasCargo) = 0; + }; // boats class Ship; @@ -316,26 +335,6 @@ class CfgVehicles { GVAR(canLoad) = 1; }; - // Taru pods - class Pod_Heli_Transport_04_base_F; - class Land_Pod_Heli_Transport_04_ammo_F: Pod_Heli_Transport_04_base_F { - GVAR(space) = 8; - GVAR(hasCargo) = 1; - }; - class Land_Pod_Heli_Transport_04_box_F: Pod_Heli_Transport_04_base_F { - GVAR(space) = 20; - GVAR(hasCargo) = 1; - }; - class Land_Pod_Heli_Transport_04_repair_F: Pod_Heli_Transport_04_base_F { - GVAR(space) = 12; - GVAR(hasCargo) = 1; - }; - class Pod_Heli_Transport_04_crewed_base_F; - class Land_Pod_Heli_Transport_04_medevac_F: Pod_Heli_Transport_04_crewed_base_F { - GVAR(space) = 8; - GVAR(hasCargo) = 1; - }; - class StaticMortar; class Mortar_01_base_F: StaticMortar { GVAR(size) = 2; // 1 = small, 2 = large @@ -364,8 +363,57 @@ class CfgVehicles { class CargoNet_01_base_F: Slingload_base_F { //Slingload pallets GVAR(size) = 6; }; - class Slingload_01_Base_F: Slingload_base_F { //Huron 20ft containers + + //Huron 20ft containers + class Slingload_01_Base_F: Slingload_base_F { GVAR(canLoad) = 0; + GVAR(size) = -1; + }; + class B_Slingload_01_Cargo_F: Slingload_01_Base_F { // Huron Cargo + GVAR(space) = 20; + GVAR(hasCargo) = 1; + }; + class B_Slingload_01_Ammo_F: Slingload_01_Base_F { // Huron Ammo + GVAR(space) = 8; + GVAR(hasCargo) = 1; + }; + class B_Slingload_01_Medevac_F: Slingload_01_Base_F { // Huron Medevac + GVAR(space) = 8; + GVAR(hasCargo) = 1; + }; + class B_Slingload_01_Repair_F: Slingload_01_Base_F { // Huron Repair + GVAR(space) = 12; + GVAR(hasCargo) = 1; + }; + + // Taru pods + class Pod_Heli_Transport_04_base_F: Slingload_base_F { + GVAR(canLoad) = 0; + GVAR(size) = -1; + }; + class Land_Pod_Heli_Transport_04_ammo_F: Pod_Heli_Transport_04_base_F { + GVAR(space) = 8; + GVAR(hasCargo) = 1; + }; + class Land_Pod_Heli_Transport_04_box_F: Pod_Heli_Transport_04_base_F { + GVAR(space) = 20; + GVAR(hasCargo) = 1; + }; + class Land_Pod_Heli_Transport_04_repair_F: Pod_Heli_Transport_04_base_F { + GVAR(space) = 12; + GVAR(hasCargo) = 1; + }; + class Pod_Heli_Transport_04_crewed_base_F: StaticWeapon { + GVAR(canLoad) = 0; + GVAR(size) = -1; + }; + class Land_Pod_Heli_Transport_04_covered_F: Pod_Heli_Transport_04_crewed_base_F { + GVAR(space) = 8; + GVAR(hasCargo) = 1; + }; + class Land_Pod_Heli_Transport_04_medevac_F: Pod_Heli_Transport_04_crewed_base_F { + GVAR(space) = 8; + GVAR(hasCargo) = 1; }; //Plastic and metal case @@ -384,7 +432,14 @@ class CfgVehicles { GVAR(size) = 2; // 1 = small, 2 = large }; + // Fuel Canister (ace_refuel) + class Land_CanisterFuel_F: Items_base_F { + GVAR(size) = 1; + GVAR(canLoad) = 1; + }; + // objects + class Lamps_base_F; class RoadCone_F: ThingX { GVAR(size) = 1; GVAR(canLoad) = 1; @@ -392,7 +447,11 @@ class CfgVehicles { class RoadBarrier_F: RoadCone_F { GVAR(size) = 2; }; - + class Land_PortableLight_single_F: Lamps_base_F { + GVAR(size) = 1; + GVAR(canLoad) = 1; + }; + class Scrapyard_base_F; class Land_PaperBox_closed_F: Scrapyard_base_F { class EventHandlers { @@ -702,7 +761,7 @@ class CfgVehicles { GVAR(size) = 100; }; - // small + // Small class Land_CargoBox_V1_F: ThingX { class EventHandlers { class CBA_Extended_EventHandlers: CBA_Extended_EventHandlers {}; @@ -723,10 +782,55 @@ class CfgVehicles { }; }; }; - - class Lamps_base_F; - class Land_PortableLight_single_F: Lamps_base_F { + class Land_PaperBox_01_small_closed_base_F: Items_base_F { + GVAR(size) = 1; + GVAR(canLoad) = 1; + + maximumLoad = 1000; + transportMaxBackpacks = 12; + transportMaxMagazines = 64; + transportMaxWeapons = 12; + }; + class Box_UAV_06_base_F: Items_base_F { GVAR(size) = 1; GVAR(canLoad) = 1; }; + + // Aid items + class Land_FoodSack_01_full_base_F: Items_base_F { + GVAR(size) = 1; + GVAR(canLoad) = 1; + }; + class Land_FoodSack_01_cargo_base_F: Items_base_F { + GVAR(size) = 7; + GVAR(canLoad) = 1; + }; + class Land_FoodSack_01_large_base_F: Items_base_F { + GVAR(size) = 7; + GVAR(canLoad) = 1; + }; + class Land_FoodSack_01_small_base_F: Items_base_F { + GVAR(size) = 2; + GVAR(canLoad) = 1; + }; + class Land_PaperBox_01_open_boxes_F: Items_base_F { + GVAR(size) = 7; + GVAR(canLoad) = 1; + }; + class Land_PaperBox_01_open_water_F: Items_base_F { + GVAR(size) = 7; + GVAR(canLoad) = 1; + }; + class Land_PaperBox_01_open_empty_F: Items_base_F { + GVAR(size) = 7; + GVAR(canLoad) = 1; + }; + class Land_PaperBox_01_small_stacked_F: Items_base_F { + GVAR(size) = 7; + GVAR(canLoad) = 1; + }; + class Land_WaterBottle_01_stack_F: Items_base_F { + GVAR(size) = 7; + GVAR(canLoad) = 1; + }; }; diff --git a/addons/cargo/UI/Icon_load.paa b/addons/cargo/UI/Icon_load.paa deleted file mode 100644 index ccd77761e4..0000000000 Binary files a/addons/cargo/UI/Icon_load.paa and /dev/null differ diff --git a/addons/cargo/XEH_PREP.hpp b/addons/cargo/XEH_PREP.hpp index 8224ec0029..54db78ec79 100644 --- a/addons/cargo/XEH_PREP.hpp +++ b/addons/cargo/XEH_PREP.hpp @@ -1,9 +1,8 @@ PREP(addCargoItem); -PREP(canLoad); +PREP(addCargoVehiclesActions); PREP(canLoadItemIn); PREP(canUnloadItem); -PREP(findNearestVehicle); PREP(getCargoSpaceLeft); PREP(getSizeItem); PREP(handleDestroyed); @@ -15,6 +14,9 @@ PREP(moduleMakeLoadable); PREP(moduleSettings); PREP(onMenuOpen); PREP(paradropItem); +PREP(removeCargoItem); +PREP(setSize); +PREP(setSpace); PREP(startLoadIn); PREP(startUnload); PREP(unloadItem); diff --git a/addons/cargo/XEH_postInit.sqf b/addons/cargo/XEH_postInit.sqf index 6b7320d5ae..9d531a8e1a 100644 --- a/addons/cargo/XEH_postInit.sqf +++ b/addons/cargo/XEH_postInit.sqf @@ -50,4 +50,34 @@ _item hideObjectGlobal false; _item setPosASL (AGLtoASL _emptyPosAGL); + + if ((getText (configFile >> "CfgVehicles" >> (typeOf _item) >> "simulation")) == "carx") then { + TRACE_1("re-enabling car damage",_item); + [_item, "blockDamage", "ACE_cargo", false] call EFUNC(common,statusEffect_set); + }; }] call CBA_fnc_addEventHandler; + +// Private events to handle adding actions globally via public functions +[QGVAR(initObject), DFUNC(initObject)] call CBA_fnc_addEventHandler; +[QGVAR(initVehicle), DFUNC(initVehicle)] call CBA_fnc_addEventHandler; + +// Add all the vehicle init EHs (require initPost for set/get variables) +["LandVehicle", "initPost", DFUNC(initVehicle), nil, nil, true] call CBA_fnc_addClassEventHandler; +["Air", "initPost", DFUNC(initVehicle), nil, nil, true] call CBA_fnc_addClassEventHandler; +["Ship_F", "initPost", DFUNC(initVehicle), nil, nil, true] call CBA_fnc_addClassEventHandler; + +// Add all the object init EHs +["StaticWeapon", "initPost", DFUNC(initObject), nil, nil, true] call CBA_fnc_addClassEventHandler; +["Land_PortableLight_single_F", "initPost", DFUNC(initObject), nil, nil, true] call CBA_fnc_addClassEventHandler; +["ACE_ConcertinaWireCoil", "initPost", DFUNC(initObject), nil, nil, true] call CBA_fnc_addClassEventHandler; + +// Add all the vehicle/object init EHs +["ThingX", "initPost", { + _this call DFUNC(initObject); _this call DFUNC(initVehicle); +}, nil, nil, true] call CBA_fnc_addClassEventHandler; +["Land_PaperBox_closed_F", "initPost", { + _this call DFUNC(initObject); _this call DFUNC(initVehicle); +}, nil, nil, true] call CBA_fnc_addClassEventHandler; +["PlasticCase_01_base_F", "initPost", { + _this call DFUNC(initObject); _this call DFUNC(initVehicle); +}, nil, nil, true] call CBA_fnc_addClassEventHandler; diff --git a/addons/cargo/XEH_preInit.sqf b/addons/cargo/XEH_preInit.sqf index a24ce048b5..5ee6406a7d 100644 --- a/addons/cargo/XEH_preInit.sqf +++ b/addons/cargo/XEH_preInit.sqf @@ -2,9 +2,12 @@ ADDON = false; +PREP_RECOMPILE_START; #include "XEH_PREP.hpp" +PREP_RECOMPILE_END; GVAR(initializedItemClasses) = []; GVAR(initializedVehicleClasses) = []; +GVAR(cargoHolderTypes) = ["Car", "Air", "Tank", "Ship", "Cargo_base_F", "Land_PaperBox_closed_F"]; ADDON = true; diff --git a/addons/cargo/config.cpp b/addons/cargo/config.cpp index 1912740903..31f01ffd72 100644 --- a/addons/cargo/config.cpp +++ b/addons/cargo/config.cpp @@ -15,6 +15,7 @@ class CfgPatches { }; #include "ACE_Settings.hpp" +#include "CfgEden.hpp" #include "CfgEventHandlers.hpp" #include "CfgVehicles.hpp" #include "menu.hpp" diff --git a/addons/cargo/functions/fnc_addCargoVehiclesActions.sqf b/addons/cargo/functions/fnc_addCargoVehiclesActions.sqf new file mode 100644 index 0000000000..111407e3fe --- /dev/null +++ b/addons/cargo/functions/fnc_addCargoVehiclesActions.sqf @@ -0,0 +1,31 @@ +/* + * Author: Dystopian + * Create actions for nearest vehicles with cargo. + * + * Arguments: + * 0: Target + * + * Return Value: + * Child actions + * + * Example: + * [cursorObject] call ace_cargo_fnc_addCargoVehiclesActions + * + * Public: No + */ +#include "script_component.hpp" + +params ["_target"]; + +private _statement = { + params ["_target", "_player", "_vehicle"]; + [_player, _target, _vehicle] call FUNC(startLoadIn); +}; + +private _vehicles = (nearestObjects [_target, GVAR(cargoHolderTypes), MAX_LOAD_DISTANCE]) select { + private _hasCargoConfig = 1 == getNumber (configFile >> "CfgVehicles" >> typeOf _x >> QGVAR(hasCargo)); + private _hasCargoPublic = _x getVariable [QGVAR(hasCargo), false]; + (_hasCargoConfig || {_hasCargoPublic}) && {_x != _target} +}; + +[_vehicles, _statement, _target] call EFUNC(interact_menu,createVehiclesActions) diff --git a/addons/cargo/functions/fnc_canLoad.sqf b/addons/cargo/functions/fnc_canLoad.sqf deleted file mode 100644 index f576ea3e79..0000000000 --- a/addons/cargo/functions/fnc_canLoad.sqf +++ /dev/null @@ -1,36 +0,0 @@ -/* - * Author: Glowbal - * Check if player can load an item into the nearest vehicle. - * - * Arguments: - * 0: Player - * 1: Object to load - * - * Return Value: - * Can load - * - * Example: - * [player, object] call ace_cargo_fnc_canLoad - * - * Public: No - */ -#include "script_component.hpp" - -params ["_player", "_object"]; -TRACE_2("params",_player,_object); - -if (!([_player, _object, []] call EFUNC(common,canInteractWith))) exitWith {false}; - -private _nearestVehicle = [_player] call FUNC(findNearestVehicle); - -if (_nearestVehicle isKindOf "Cargo_Base_F" || isNull _nearestVehicle) then { - { - if ([_object, _x] call FUNC(canLoadItemIn)) exitWith {_nearestVehicle = _x}; - } forEach (nearestObjects [_player, ["Cargo_base_F", "Land_PaperBox_closed_F"], MAX_LOAD_DISTANCE]); -}; - -if (isNull _nearestVehicle) exitWith {false}; - -if ((locked _nearestVehicle) >= 2) exitWith {false}; - -[_object, _nearestVehicle] call FUNC(canLoadItemIn) diff --git a/addons/cargo/functions/fnc_canLoadItemIn.sqf b/addons/cargo/functions/fnc_canLoadItemIn.sqf index e2bb1ecc4d..092272f94f 100644 --- a/addons/cargo/functions/fnc_canLoadItemIn.sqf +++ b/addons/cargo/functions/fnc_canLoadItemIn.sqf @@ -20,6 +20,11 @@ params [["_item", "", [objNull,""]], "_vehicle"]; if (speed _vehicle > 1 || {((getPos _vehicle) select 2) > 3}) exitWith {TRACE_1("vehicle not stable",_vehicle); false}; +if (_item isEqualType objNull && {{alive _x && {getText (configFile >> "CfgVehicles" >> typeOf _x >> "simulation") != "UAVPilot"}} count crew _item > 0}) exitWith { + TRACE_1("item is occupied",_item); + false +}; + private _itemSize = [_item] call FUNC(getSizeItem); private _validItem = false; if (_item isEqualType "") then { @@ -35,4 +40,5 @@ if (_item isEqualType "") then { _validItem && {_itemSize > 0} && {alive _vehicle} && -{_itemSize <= ([_vehicle] call FUNC(getCargoSpaceLeft))} +{_itemSize <= ([_vehicle] call FUNC(getCargoSpaceLeft))} && +{locked _vehicle < 2} diff --git a/addons/cargo/functions/fnc_canUnloadItem.sqf b/addons/cargo/functions/fnc_canUnloadItem.sqf index 1e8753cc27..9f1722ad08 100644 --- a/addons/cargo/functions/fnc_canUnloadItem.sqf +++ b/addons/cargo/functions/fnc_canUnloadItem.sqf @@ -5,7 +5,7 @@ * Arguments: * 0: loaded Object * 1: Object - * 2: Unloader (player) + * 2: Unloader (player) (default: objNull) * * Return Value: * Can be unloaded diff --git a/addons/cargo/functions/fnc_findNearestVehicle.sqf b/addons/cargo/functions/fnc_findNearestVehicle.sqf deleted file mode 100644 index 6d5b7ce1a8..0000000000 --- a/addons/cargo/functions/fnc_findNearestVehicle.sqf +++ /dev/null @@ -1,35 +0,0 @@ -/* - * Author: Glowbal - * Get nearest vehicle from unit, priority: Car-Air-Tank-Ship. - * - * Arguments: - * 0: Unit - * - * Return Value: - * Vehicle in Distance - * - * Example: - * [unit] call ace_cargo_fnc_findNearestVehicle - * - * Public: No - */ -#include "script_component.hpp" - -params ["_unit"]; - -private _loadCar = nearestObject [_unit, "car"]; -if (_unit distance _loadCar <= MAX_LOAD_DISTANCE) exitWith {_loadCar}; - -private _loadHelicopter = nearestObject [_unit, "air"]; -if (_unit distance _loadHelicopter <= MAX_LOAD_DISTANCE) exitWith {_loadHelicopter}; - -private _loadTank = nearestObject [_unit, "tank"]; -if (_unit distance _loadTank <= MAX_LOAD_DISTANCE) exitWith {_loadTank}; - -private _loadShip = nearestObject [_unit, "ship"]; -if (_unit distance _loadShip <= MAX_LOAD_DISTANCE) exitWith {_loadShip}; - -private _loadContainer = nearestObject [_unit,"Cargo_base_F"]; -if (_unit distance _loadContainer <= MAX_LOAD_DISTANCE) exitWith {_loadContainer}; - -objNull diff --git a/addons/cargo/functions/fnc_getCargoSpaceLeft.sqf b/addons/cargo/functions/fnc_getCargoSpaceLeft.sqf index 7e8594ffe4..dc5f3ab073 100644 --- a/addons/cargo/functions/fnc_getCargoSpaceLeft.sqf +++ b/addons/cargo/functions/fnc_getCargoSpaceLeft.sqf @@ -18,4 +18,4 @@ params ["_object"]; // TRACE_1("params",_object); -_object getVariable [QGVAR(space), getNumber (configFile >> "CfgVehicles" >> typeOf _object >> QGVAR(space))] +(_object getVariable [QGVAR(space), getNumber (configFile >> "CfgVehicles" >> typeOf _object >> QGVAR(space))]) max 0 diff --git a/addons/cargo/functions/fnc_getSizeItem.sqf b/addons/cargo/functions/fnc_getSizeItem.sqf index c53c05ee28..32ec92a550 100644 --- a/addons/cargo/functions/fnc_getSizeItem.sqf +++ b/addons/cargo/functions/fnc_getSizeItem.sqf @@ -1,5 +1,5 @@ /* - * Author: Glowbal + * Author: Glowbal, SilentSpike * Get the cargo size of an object. * * Arguments: @@ -17,23 +17,13 @@ params ["_item"]; -scopeName "return"; - -private _isVirtual = (_item isEqualType ""); -private _itemClass = if (_isVirtual) then {_item} else {typeOf _item}; -private _config = (configFile >> "CfgVehicles" >> _itemClass >> QGVAR(size)); - -if (_isVirtual) then { - if (isNumber _config) then { - (getNumber _config) breakOut "return"; - }; +// Virtual items are much easier to deal with +if (_item isEqualType "") then { + CARGO_SIZE(_item) } else { - if (!isNil {_item getVariable QGVAR(size)}) then { - (_item getVariable QGVAR(size)) breakOut "return"; - }; - if (isNumber _config) then { - (getNumber _config) breakOut "return"; + if (isNil {_item getVariable QGVAR(size)}) then { + CARGO_SIZE(typeOf _item) + } else { + _item getVariable QGVAR(size) }; }; - --1 diff --git a/addons/cargo/functions/fnc_initObject.sqf b/addons/cargo/functions/fnc_initObject.sqf index 92403b8dd9..e291cc54f3 100644 --- a/addons/cargo/functions/fnc_initObject.sqf +++ b/addons/cargo/functions/fnc_initObject.sqf @@ -1,5 +1,5 @@ /* - * Author: Glowbal + * Author: Glowbal, SilentSpike * Initializes variables for loadable objects. Called from init EH. * * Arguments: @@ -19,28 +19,59 @@ params ["_object"]; private _type = typeOf _object; TRACE_2("params",_object,_type); -if ((_object getVariable [QGVAR(canLoad), getNumber (configFile >> "CfgVehicles" >> _type >> QGVAR(canLoad))]) != 1) exitWith {}; +// If object had size given to it via eden/public then override config canLoad setting +private _canLoadPublic = _object getVariable [QGVAR(canLoad), false]; +if (!(_canLoadPublic isEqualType false)) then { + WARNING_4("%1[%2] - Variable %3 is %4 - Should be bool",_object,_type,QGVAR(canLoad),_canLoadPublic); +}; +private _canLoadConfig = getNumber (configFile >> "CfgVehicles" >> _type >> QGVAR(canLoad)) == 1; -// do nothing if the class is already initialized +// Nothing to do here if object can't be loaded +if !(_canLoadConfig || {_canLoadPublic in [true, 1]}) exitWith {}; + +// Servers and HCs do not require action menus (beyond this point) +if !(hasInterface) exitWith {}; + +// Unnecessary to add actions to an object class that's already got them if (_type in GVAR(initializedItemClasses)) exitWith {}; -GVAR(initializedItemClasses) pushBack _type; +if (_object getVariable [QGVAR(initObject),false]) exitWith {}; -TRACE_1("Adding load cargo action to class", _type); +// Objects given size via eden have their actions added to the object +// So this function may run for multiple of the same class in that case +if (_canLoadConfig) then { + GVAR(initializedItemClasses) pushBack _type; + TRACE_1("Adding load cargo action to class", _type); +} else { + _object setVariable [QGVAR(initObject),true]; + TRACE_1("Adding load cargo action to object", _object); +}; +// Vehicles with passengers inside are prevented from being loaded in `fnc_canLoadItemIn` private _condition = { + //IGNORE_PRIVATE_WARNING ["_target", "_player"]; GVAR(enable) && - {(_target getVariable [QGVAR(canLoad), getNumber (configFile >> "CfgVehicles" >> (typeOf _target) >> QGVAR(canLoad))]) == 1} && + {(_target getVariable [QGVAR(canLoad), getNumber (configFile >> "CfgVehicles" >> (typeOf _target) >> QGVAR(canLoad))]) in [true, 1]} && {locked _target < 2} && {alive _target} && - {[_player, _target, []] call EFUNC(common,canInteractWith)} + {[_player, _target, ["isNotSwimming"]] call EFUNC(common,canInteractWith)} && + {0 < { + private _type = typeOf _x; + private _hasCargoPublic = _x getVariable [QGVAR(hasCargo), false]; + private _hasCargoConfig = getNumber (configFile >> "CfgVehicles" >> _type >> QGVAR(hasCargo)) == 1; + (_hasCargoPublic || _hasCargoConfig) && {_x != _target} + } count (nearestObjects [_player, GVAR(cargoHolderTypes), MAX_LOAD_DISTANCE])} }; private _statement = { params ["_target", "_player"]; [_player, _target] call FUNC(startLoadIn); }; private _text = localize LSTRING(loadObject); -private _icon = QPATHTOF(UI\Icon_load.paa); +private _icon = "a3\ui_f\data\IGUI\Cfg\Actions\loadVehicle_ca.paa"; -private _action = [QGVAR(load), _text, _icon, _statement, _condition] call EFUNC(interact_menu,createAction); -[_type, 0, ["ACE_MainActions"], _action] call EFUNC(interact_menu,addActionToClass); +private _action = [QGVAR(load), _text, _icon, _statement, _condition, {call FUNC(addCargoVehiclesActions)}] call EFUNC(interact_menu,createAction); +if (_canLoadConfig) then { + [_type, 0, ["ACE_MainActions"], _action] call EFUNC(interact_menu,addActionToClass); +} else { + [_object, 0, ["ACE_MainActions"], _action] call EFUNC(interact_menu,addActionToObject); +}; diff --git a/addons/cargo/functions/fnc_initVehicle.sqf b/addons/cargo/functions/fnc_initVehicle.sqf index c65a9bddbc..6d3709a329 100644 --- a/addons/cargo/functions/fnc_initVehicle.sqf +++ b/addons/cargo/functions/fnc_initVehicle.sqf @@ -20,8 +20,24 @@ TRACE_1("params", _vehicle); private _type = typeOf _vehicle; -if (getNumber (configFile >> "CfgVehicles" >> _type >> QGVAR(hasCargo)) != 1) exitWith {}; +// If vehicle had space given to it via eden/public then override config hasCargo setting +private _hasCargoPublic = _vehicle getVariable [QGVAR(hasCargo), false]; +private _hasCargoConfig = getNumber (configFile >> "CfgVehicles" >> _type >> QGVAR(hasCargo)) == 1; +// Nothing to do here if vehicle has no cargo space +if !(_hasCargoConfig || _hasCargoPublic) exitWith {}; + +// Check if cargo is in cargo holder types (checked when trying to search for loadable objects) +private _addCargoType = true; +{ + if (_type isKindOf _x) exitWith {_addCargoType = false}; +} forEach GVAR(cargoHolderTypes); +TRACE_2("",_addCargoType,_type); +if (_addCargoType) then { + GVAR(cargoHolderTypes) pushBack _type; +}; + +// Vehicle can have default ace cargo in its config if (isServer) then { { if (isClass _x) then { @@ -33,19 +49,33 @@ if (isServer) then { } count ("true" configClasses (configFile >> "CfgVehicles" >> _type >> "ACE_Cargo" >> "Cargo")); }; -// do nothing if the class is already initialized +// Servers and HCs do not require action menus (beyond this point) +if !(hasInterface) exitWith {}; + +// Unnecessary to add actions to a vehicle class that's already got them if (_type in GVAR(initializedVehicleClasses)) exitWith {}; -// set class as initialized -GVAR(initializedVehicleClasses) pushBack _type; +if (_vehicle getVariable [QGVAR(initVehicle),false]) exitWith {}; -if (!hasInterface) exitWith {}; - -TRACE_1("Adding unload cargo action to class", _type); +// Vehicles given cargo via eden have their actions added to the object +// So this function may run for multiple of the same class in that case +if (_hasCargoConfig) then { + GVAR(initializedVehicleClasses) pushBack _type; + TRACE_1("Adding unload cargo action to class", _type); +} else { + _vehicle setVariable [QGVAR(initVehicle),true]; + TRACE_1("Adding unload cargo action to object", _vehicle); +}; private _condition = { - GVAR(enable) && {locked _target < 2} && {alive _target} && {[_player, _target, ["isNotSwimming"]] call EFUNC(common,canInteractWith)} + //IGNORE_PRIVATE_WARNING ["_target", "_player"]; + GVAR(enable) && + {(_target getVariable [QGVAR(hasCargo), getNumber (configFile >> "CfgVehicles" >> (typeOf _target) >> QGVAR(hasCargo)) == 1])} && + {locked _target < 2} && + {alive _target} && + {[_player, _target, ["isNotSwimming"]] call EFUNC(common,canInteractWith)} }; private _statement = { + //IGNORE_PRIVATE_WARNING ["_target", "_player"]; GVAR(interactionVehicle) = _target; GVAR(interactionParadrop) = false; createDialog QGVAR(menu); @@ -54,11 +84,16 @@ private _text = localize LSTRING(openMenu); private _icon = ""; private _action = [QGVAR(openMenu), _text, _icon, _statement, _condition] call EFUNC(interact_menu,createAction); -[_type, 0, ["ACE_MainActions"], _action] call EFUNC(interact_menu,addActionToClass); +if (_hasCargoConfig) then { + [_type, 0, ["ACE_MainActions"], _action] call EFUNC(interact_menu,addActionToClass); +} else { + [_vehicle, 0, ["ACE_MainActions"], _action] call EFUNC(interact_menu,addActionToObject); +}; // Add the paradrop self interaction for planes and helicopters if (_vehicle isKindOf "Air") then { private _condition = { + //IGNORE_PRIVATE_WARNING ["_target", "_player"]; GVAR(enable) && {[_player, _target, []] call EFUNC(common,canInteractWith)} && { private _turretPath = _player call CBA_fnc_turretPath; (_player == (driver _target)) || // pilot @@ -66,6 +101,7 @@ if (_vehicle isKindOf "Air") then { {_turretPath in (getArray (configFile >> "CfgVehicles" >> (typeOf _target) >> QGVAR(loadmasterTurrets)))}} // loadMaster turret from config }; private _statement = { + //IGNORE_PRIVATE_WARNING ["_target", "_player"]; GVAR(interactionVehicle) = _target; GVAR(interactionParadrop) = true; createDialog QGVAR(menu); @@ -74,5 +110,9 @@ if (_vehicle isKindOf "Air") then { private _icon = ""; private _action = [QGVAR(openMenu), _text, _icon, _statement, _condition] call EFUNC(interact_menu,createAction); - [_type, 1, ["ACE_SelfActions"], _action] call EFUNC(interact_menu,addActionToClass); // self action on the vehicle + if (_hasCargoConfig) then { + [_type, 1, ["ACE_SelfActions"], _action] call EFUNC(interact_menu,addActionToClass); // self action on the vehicle + } else { + [_vehicle, 1, ["ACE_SelfActions"], _action] call EFUNC(interact_menu,addActionToObject); + }; }; diff --git a/addons/cargo/functions/fnc_loadItem.sqf b/addons/cargo/functions/fnc_loadItem.sqf index 1d59cc1e64..f8b00478e6 100644 --- a/addons/cargo/functions/fnc_loadItem.sqf +++ b/addons/cargo/functions/fnc_loadItem.sqf @@ -13,7 +13,7 @@ * Example: * [object, vehicle] call ace_cargo_fnc_loadItem * - * Public: No + * Public: Yes */ #include "script_component.hpp" @@ -36,6 +36,12 @@ if (_item isEqualType objNull) then { detach _item; _item attachTo [_vehicle,[0,0,-100]]; [QEGVAR(common,hideObjectGlobal), [_item, true]] call CBA_fnc_serverEvent; + + // Cars below water will take engine damage over time and eventualy become "water logged" and unfixable (because of negative z attach) + if ((getText (configFile >> "CfgVehicles" >> (typeOf _item) >> "simulation")) == "carx") then { + TRACE_1("disabling car damage",_item); + [_item, "blockDamage", "ACE_cargo", true] call EFUNC(common,statusEffect_set); + }; }; true diff --git a/addons/cargo/functions/fnc_makeLoadable.sqf b/addons/cargo/functions/fnc_makeLoadable.sqf index 6bd962398a..4d2aac21f0 100644 --- a/addons/cargo/functions/fnc_makeLoadable.sqf +++ b/addons/cargo/functions/fnc_makeLoadable.sqf @@ -17,6 +17,13 @@ */ #include "script_component.hpp" +// Only run this after the settings are initialized +if !(EGVAR(common,settingsInitFinished)) exitWith { + EGVAR(common,runAtSettingsInitialized) pushBack [FUNC(makeLoadable), _this]; +}; + +ACE_DEPRECATED(QFUNC(makeLoadable),"3.12.0",QFUNC(setSize)); + params [["_object", objNull, [objNull]], ["_canLoad", true, [false, 0]], ["_setSize", 1, [0]]]; TRACE_3("params",_object,_canLoad,_setSize); @@ -25,7 +32,7 @@ private _type = typeOf _object; private _cfgCanLoad = getNumber (configFile >> "CfgVehicles" >> _type >> QGVAR(canLoad)); private _curSize = [_object] call FUNC(getSizeItem); -_canLoad = [0, 1] select _canLoad; //convert true/false to scalar +_canLoad = [0, 1] select _canLoad; // Convert true/false to scalar if ((_canLoad == 1) && {_setSize <= 0}) exitWith { ERROR("ace_cargo_fnc_makeLoadable (size <= 0) when making loadable"); @@ -33,7 +40,7 @@ if ((_canLoad == 1) && {_setSize <= 0}) exitWith { TRACE_2("setVar if different from config",_canLoad,_cfgCanLoad); if (_canLoad != _cfgCanLoad) then { - _object setVariable [QGVAR(canLoad), _canLoad]; + _object setVariable [QGVAR(canLoad), _canLoad == 1]; }; TRACE_2("setVar if different from config",_setSize,_curSize); diff --git a/addons/cargo/functions/fnc_moduleMakeLoadable.sqf b/addons/cargo/functions/fnc_moduleMakeLoadable.sqf index 9c7fb06742..9a9e21a22d 100644 --- a/addons/cargo/functions/fnc_moduleMakeLoadable.sqf +++ b/addons/cargo/functions/fnc_moduleMakeLoadable.sqf @@ -20,6 +20,8 @@ params ["_logic", "_objects", "_activated"]; TRACE_3("params",_logic,_objects,_activated); +ACE_DEPRECATED(QFUNC(moduleMakeLoadable),"3.12.0","Eden editor object attributes"); + if ((isNull _logic) || {!_activated}) exitWith {}; if (_objects isEqualTo []) exitWith { WARNING_1("ace_cargo_fnc_moduleMakeLoadable has no synced objects [%1]", _logic); diff --git a/addons/cargo/functions/fnc_moduleSettings.sqf b/addons/cargo/functions/fnc_moduleSettings.sqf index 0374152a5a..b7af19c76a 100644 --- a/addons/cargo/functions/fnc_moduleSettings.sqf +++ b/addons/cargo/functions/fnc_moduleSettings.sqf @@ -24,5 +24,6 @@ params ["_logic", "", "_activated"]; if (!_activated) exitWith {}; [_logic, QGVAR(enable), "enable"] call EFUNC(common,readSettingFromModule); +[_logic, QGVAR(paradropTimeCoefficent), "paradropTimeCoefficent"] call EFUNC(common,readSettingFromModule); INFO("Cargo Module Initialized."); diff --git a/addons/cargo/functions/fnc_onMenuOpen.sqf b/addons/cargo/functions/fnc_onMenuOpen.sqf index 852729e529..8b3847993d 100644 --- a/addons/cargo/functions/fnc_onMenuOpen.sqf +++ b/addons/cargo/functions/fnc_onMenuOpen.sqf @@ -44,7 +44,13 @@ if (GVAR(interactionParadrop)) then { lbClear _ctrl; { private _class = if (_x isEqualType "") then {_x} else {typeOf _x}; - _ctrl lbAdd (getText(configfile >> "CfgVehicles" >> _class >> "displayName")); + private _displayName = getText (configfile >> "CfgVehicles" >> _class >> "displayName"); + if (GVAR(interactionParadrop)) then { + _ctrl lbAdd format ["%1 (%2s)", _displayName, GVAR(paradropTimeCoefficent) * ([_class] call FUNC(getSizeItem))]; + } else { + _ctrl lbAdd _displayName; + }; + true } count _loaded; diff --git a/addons/cargo/functions/fnc_paradropItem.sqf b/addons/cargo/functions/fnc_paradropItem.sqf index 2eb59fee1d..0f74787723 100644 --- a/addons/cargo/functions/fnc_paradropItem.sqf +++ b/addons/cargo/functions/fnc_paradropItem.sqf @@ -6,7 +6,7 @@ * 0: Object * 1: Vehicle * - * Return value: + * Return Value: * Object unloaded * * Example: @@ -32,9 +32,9 @@ private _itemSize = [_item] call FUNC(getSizeItem); _vehicle setVariable [QGVAR(space), (_cargoSpace + _itemSize), true]; (boundingBoxReal _vehicle) params ["_bb1", "_bb2"]; -private _distBehind = ((_bb1 select 1) min (_bb2 select 1)) - 3; // 3 meters behind max bounding box +private _distBehind = ((_bb1 select 1) min (_bb2 select 1)) - 4; // 4 meters behind max bounding box TRACE_1("",_distBehind); -private _posBehindVehicleAGL = _vehicle modelToWorld [0, _distBehind, -1]; +private _posBehindVehicleAGL = _vehicle modelToWorld [0, _distBehind, -2]; private _itemObject = if (_item isEqualType objNull) then { @@ -49,7 +49,7 @@ private _itemObject = if (_item isEqualType objNull) then { _newItem }; -_itemObject setVelocity ((velocity _vehicle) vectorAdd ((vectorNormalized (vectorDir _vehicle)) vectorMultiply 10)); +_itemObject setVelocity ((velocity _vehicle) vectorAdd ((vectorNormalized (vectorDir _vehicle)) vectorMultiply -5)); // open parachute and ir light effect [{ @@ -90,6 +90,15 @@ _itemObject setVelocity ((velocity _vehicle) vectorAdd ((vectorNormalized (vecto }, 1, [_itemObject]] call CBA_fnc_addPerFrameHandler; +[ + [ + LSTRING(UnloadedItem), + getText (configFile >> "CfgVehicles" >> typeOf _itemObject >> "displayName"), + getText (configFile >> "CfgVehicles" >> typeOf _vehicle >> "displayName") + ], + 3 +] call EFUNC(common,displayTextStructured); + // Invoke listenable event ["ace_cargoUnloaded", [_item, _vehicle, "paradrop"]] call CBA_fnc_globalEvent; diff --git a/addons/cargo/functions/fnc_removeCargoItem.sqf b/addons/cargo/functions/fnc_removeCargoItem.sqf new file mode 100644 index 0000000000..22d73866f8 --- /dev/null +++ b/addons/cargo/functions/fnc_removeCargoItem.sqf @@ -0,0 +1,70 @@ +/* + * Author: 654wak654 + * Removes a cargo item from the vehicle. + * + * Arguments: + * 0: Item or + * 1: Vehicle + * 2: Amount (default: 1) + * + * Return Value: + * Number of items removed + * + * Example: + * ["ACE_Wheel", vehicle, 2] call ace_cargo_fnc_removeCargoItem + * [crate_7, truck] call ace_cargo_fnc_removeCargoItem + * + * Public: Yes + */ +#include "script_component.hpp" + +params ["_item", "_vehicle", ["_amount", 1]]; +TRACE_3("params",_item,_vehicle,_amount); + +private _loaded = _vehicle getVariable [QGVAR(loaded), []]; + +private _addedSpace = 0; +private _itemClass = _item; +private _itemsRemoved = 0; + +private _continue = if (_item isEqualType objNull) then { + if !(_item in _loaded) exitWith {false}; + _addedSpace = [_item] call FUNC(getSizeItem); + _loaded deleteAt (_loaded find _item); + _itemClass = typeOf _item; + deleteVehicle _item; + _itemsRemoved = 1; + true +} else { + { + if (_itemsRemoved == _amount) exitWith {}; + + if ( + (_x isEqualType "" && {_x == _item}) || // Check for classname, case-insensitive + {_x isEqualType objNull && {typeOf _x isEqualTo _item}} + ) then { + INC(_itemsRemoved); + ADD(_addedSpace,[_x] call FUNC(getSizeItem)); + + if (_x isEqualType objNull) then { + deleteVehicle _x; + }; + _loaded set [_forEachIndex, nil]; + }; + } forEach _loaded; + + FILTER(_loaded,_x != nil); + true +}; + +if (!_continue) exitWith {0}; + +_vehicle setVariable [QGVAR(loaded), _loaded, true]; + +private _space = [_vehicle] call FUNC(getCargoSpaceLeft); +_vehicle setVariable [QGVAR(space), _space + _addedSpace, true]; + +// Invoke listenable event +["ace_cargoRemoved", [_itemClass, _vehicle, _amount, _itemsRemoved]] call CBA_fnc_globalEvent; + +_itemsRemoved diff --git a/addons/cargo/functions/fnc_setSize.sqf b/addons/cargo/functions/fnc_setSize.sqf new file mode 100644 index 0000000000..660131045a --- /dev/null +++ b/addons/cargo/functions/fnc_setSize.sqf @@ -0,0 +1,57 @@ +/* + * Author: SilentSpike + * Set the cargo size of any object. Has global effect. + * Adds the load action menu if necessary. + * Negative size makes unloadable. + * + * Arguments: + * 0: Object + * 1: Cargo size + * + * Return Value: + * None + * + * Example: + * [cursorTarget, 3] call ace_cargo_fnc_setSize + * + * Public: Yes + */ +#include "script_component.hpp" + +// Only run this after the settings are initialized +if !(EGVAR(common,settingsInitFinished)) exitWith { + EGVAR(common,runAtSettingsInitialized) pushBack [FUNC(setSize), _this]; +}; + +params [ + ["_object",objNull,[objNull]], + ["_size",nil,[0]] // Default can't be a number since all are valid +]; +TRACE_2("setSize",_object,_size); + +// Nothing to do here +if ( + (isNil "_size") || + {isNull _object} || + {_size == _object getVariable [QGVAR(size), CARGO_SIZE(typeOf _object)]} +) exitWith {}; + +// Apply new size globally +// Necessary to update value, even if unloadable, as API could be used again +_object setVariable [QGVAR(canLoad), _size >= 0, true]; +_object setVariable [QGVAR(size), _size, true]; + +// If no size no need for load action +if (_size < 0) exitWith {}; + +// If an existing ID is present, load action has already been added globally +private _jipID = _object getVariable QGVAR(setSize_jipID); + +// Actions should be added to all future JIP players too +if (isNil "_jipID") then { + _jipID = [QGVAR(initObject), [_object]] call CBA_fnc_globalEventJIP; + [_jipID, _object] call CBA_fnc_removeGlobalEventJIP; + + // Store the ID for any future calls to this function + _object setVariable [QGVAR(setSize_jipID), _jipID, true]; +}; diff --git a/addons/cargo/functions/fnc_setSpace.sqf b/addons/cargo/functions/fnc_setSpace.sqf new file mode 100644 index 0000000000..156b0aa085 --- /dev/null +++ b/addons/cargo/functions/fnc_setSpace.sqf @@ -0,0 +1,56 @@ +/* + * Author: SilentSpike + * Set the cargo space of any object. Has global effect. + * Adds the cargo action menu if necessary. + * + * Arguments: + * 0: Object + * 1: Cargo space + * + * Return Value: + * None + * + * Example: + * [vehicle player, 20] call ace_cargo_fnc_setSpace + * + * Public: Yes + */ +#include "script_component.hpp" + +// Only run this after the settings are initialized +if !(EGVAR(common,settingsInitFinished)) exitWith { + EGVAR(common,runAtSettingsInitialized) pushBack [FUNC(setSpace), _this]; +}; + +params [ + ["_vehicle",objNull,[objNull]], + ["_space",nil,[0]] // Default can't be a number since all are valid +]; +TRACE_2("setSpace",_vehicle,_size); + +// Nothing to do here +if ( + (isNil "_space") || + {isNull _vehicle} || + {_space == _vehicle getVariable [QGVAR(space), CARGO_SPACE(typeOf _vehicle)]} +) exitWith {}; + +// Apply new space globally +// Necessary to update value, even if no space, as API could be used again +_vehicle setVariable [QGVAR(hasCargo), _space > 0, true]; +_vehicle setVariable [QGVAR(space), _space, true]; + +// If no cargo space no need for cargo menu +if (_space <= 0) exitWith {}; + +// If an existing ID is present, cargo menu has already been added globally +private _jipID = _vehicle getVariable QGVAR(setSpace_jipID); + +// Cargo menu should be added to all future JIP players too +if (isNil "_jipID") then { + _jipID = [QGVAR(initVehicle), [_vehicle]] call CBA_fnc_globalEventJIP; + [_jipID, _vehicle] call CBA_fnc_removeGlobalEventJIP; + + // Store the ID for any future calls to this function + _vehicle setVariable [QGVAR(setSpace_jipID), _jipID, true]; +}; diff --git a/addons/cargo/functions/fnc_startLoadIn.sqf b/addons/cargo/functions/fnc_startLoadIn.sqf index 466471c375..447c679df0 100644 --- a/addons/cargo/functions/fnc_startLoadIn.sqf +++ b/addons/cargo/functions/fnc_startLoadIn.sqf @@ -5,6 +5,7 @@ * Arguments: * 0: Player * 1: Object + * 2: Vehicle (Optional) * * Return Value: * Load ProgressBar Started @@ -16,15 +17,14 @@ */ #include "script_component.hpp" -params ["_player", "_object"]; -TRACE_2("params",_player,_object); +params ["_player", "_object", ["_cargoVehicle", objNull]]; +TRACE_3("params",_player,_object,_cargoVehicle); -private _vehicle = [_player] call FUNC(findNearestVehicle); - -if ((isNull _vehicle) || {_vehicle isKindOf "Cargo_Base_F"}) then { +private _vehicle = _cargoVehicle; +if (isNull _vehicle) then { { if ([_object, _x] call FUNC(canLoadItemIn)) exitWith {_vehicle = _x}; - } forEach (nearestObjects [_player, ["Cargo_base_F", "Land_PaperBox_closed_F"], MAX_LOAD_DISTANCE]); + } forEach (nearestObjects [_player, GVAR(cargoHolderTypes), MAX_LOAD_DISTANCE]); }; if (isNull _vehicle) exitWith { @@ -42,7 +42,9 @@ if ([_object, _vehicle] call FUNC(canLoadItemIn)) then { [_object,_vehicle], {["ace_loadCargo", _this select 0] call CBA_fnc_localEvent}, {}, - localize LSTRING(LoadingItem) + localize LSTRING(LoadingItem), + {true}, + ["isNotSwimming"] ] call EFUNC(common,progressBar); _return = true; } else { diff --git a/addons/cargo/functions/fnc_startUnload.sqf b/addons/cargo/functions/fnc_startUnload.sqf index 8631449b9e..27ebe9e952 100644 --- a/addons/cargo/functions/fnc_startUnload.sqf +++ b/addons/cargo/functions/fnc_startUnload.sqf @@ -28,13 +28,18 @@ private _ctrl = _display displayCtrl 100; private _selected = (lbCurSel _ctrl) max 0; if (count _loaded <= _selected) exitWith {}; -private _item = _loaded select _selected; //This can be an object or a classname string +private _item = _loaded select _selected; // This can be an object or a classname string if (GVAR(interactionParadrop)) exitWith { + // If drop time is 0 don't show a progress bar + if (GVAR(paradropTimeCoefficent) == 0) exitWith { + [QGVAR(paradropItem), [_item, GVAR(interactionVehicle)]] call CBA_fnc_localEvent; + }; + // Start progress bar - paradrop private _size = [_item] call FUNC(getSizeItem); [ - 2.5 * _size, + GVAR(paradropTimeCoefficent) * _size, [_item, GVAR(interactionVehicle), ACE_player], { (_this select 0) params ["_item", "_target", "_player"]; diff --git a/addons/cargo/functions/fnc_unloadItem.sqf b/addons/cargo/functions/fnc_unloadItem.sqf index 47ff3ba36e..20fde5d631 100644 --- a/addons/cargo/functions/fnc_unloadItem.sqf +++ b/addons/cargo/functions/fnc_unloadItem.sqf @@ -5,14 +5,15 @@ * Arguments: * 0: Item * 1: Vehicle + * 2: Unloader (default: objNull) * * Return Value: - * Object unloaded + * Object was unloaded * * Example: * [object, vehicle] call ace_cargo_fnc_unloadItem * - * Public: No + * Public: Yes */ #include "script_component.hpp" diff --git a/addons/cargo/script_component.hpp b/addons/cargo/script_component.hpp index 4a1305a160..3ae6331f91 100644 --- a/addons/cargo/script_component.hpp +++ b/addons/cargo/script_component.hpp @@ -17,3 +17,9 @@ #include "\z\ace\addons\main\script_macros.hpp" #define MAX_LOAD_DISTANCE 10 + +#define GET_NUMBER(config,default) (if (isNumber (config)) then {getNumber (config)} else {default}) + +// Default cargo size is -1 as 0 is a valid size +#define CARGO_SIZE(classname) GET_NUMBER(configFile >> "CfgVehicles" >> (classname) >> QGVAR(size),-1) +#define CARGO_SPACE(classname) GET_NUMBER(configFile >> "CfgVehicles" >> (classname) >> QGVAR(space),0) diff --git a/addons/cargo/stringtable.xml b/addons/cargo/stringtable.xml index 51ab414120..1b6e780cc7 100644 --- a/addons/cargo/stringtable.xml +++ b/addons/cargo/stringtable.xml @@ -1,4 +1,4 @@ - + @@ -12,6 +12,9 @@ Carica Charger 積み込む + 싣기 + 裝載 + 装载 Unload @@ -24,6 +27,9 @@ Scarica Décharger 下ろす + 내리기 + 卸載 + 卸载 Cargo @@ -36,6 +42,9 @@ Cargo Cargaison カーゴ + 화물 + 貨物 + 货物 Cargo Menu @@ -48,6 +57,9 @@ Menù Cargo Menu de cargaison カーゴ メニュー + 화물 메뉴 + 貨物選單 + 货物选单 Cargo space left: %1 @@ -59,7 +71,10 @@ Espacio de carga restante: %1 Spazio cargo rimanente: %1 Espace de cargaison restant : %1 - カーゴの空き容量は: %1 + カーゴの空き容量: %1 + 선적 공간 남음: %1 + 貨物剩餘空間: %1 + 货物剩余空间: %1 Enable Cargo @@ -72,6 +87,9 @@ Abilita Cargo Activer la mise en cargaison カーゴを有効化 + 화물 활성화 + 啟用貨物裝載 + 启用货物装载 Enable the load in cargo module @@ -84,6 +102,9 @@ Abilita il modulo di caricamento in cargo Active le chargement de cargaison dans un vehicule カーゴ モジュールで積み込みを有効化 + 화물 모듈에 싣기를 활성화합니다 + 啟用貨物裝載功能 + 启用货物装载功能 Cargo Settings @@ -96,6 +117,9 @@ Impostazioni Cargo Paramètres de cargaison カーゴ設定 + 화물 설정 + 貨物設定 + 货物设定 Configure the cargo module settings @@ -108,6 +132,9 @@ Configura le impostazioni del modulo cargo Configure les paramètres du module de cargaison カーゴ モジュールの設定を構成 + 화물 모듈의 환경 설정을 바꿉니다 + 配置貨物模塊設定 + 配置货物模块设定 %1<br/>loaded into<br/>%2 @@ -120,7 +147,10 @@ %1<br/>caricato su<br/>%2 %1<br/>berakodva ide:<br/>%2 %1<br/>загружен в<br/>%2 - %1&lt;br/&gt; は &lt;br/&gt;%2 へ積み込まれた + %1<br/>は<br/>%2へ積み込まれた + %1<br/>는<br/>%2 에 실림 + %1<br/>裝載至<br/>%2 + %1<br/>装载至<br/>%2 Unloaded<br/>%1 from<br/>%2 @@ -133,7 +163,10 @@ Hai scaricato<br/>%1 da<br/>%2 1%<br/>kirakodva ebből:<br/>%2 %1<br/>разгружен из<br/>%2 - &lt;br/&gt;%2 から &lt;br/&gt;%1 が下ろされた + <br/>%1が<br/>%2から降ろされた + %1<br/>는<br/>%2 에서 내려짐 + 從<br/>%2卸載<br/>%1 + 从<br/>%2卸载<br/>%1 Loading Cargo @@ -146,6 +179,9 @@ Cargando Chargement de la cargaison カーゴへ積み込んでいる + 화물 싣기 + 裝載貨物中 + 装载货物中 Unloading Cargo @@ -157,7 +193,10 @@ Scaricando Descargando Déchargement de la cargaison - カーゴから下ろしている + カーゴから降ろしている + 화물 내리기 + 卸載貨物中 + 卸载货物中 %1<br/>could not be loaded @@ -169,7 +208,10 @@ %1<br/>non può essere caricato %1<br/>no pudo ser cargado %1<br /> n'a pas pu être chargé - %1&lt;br/&gt;は積み込めなかった + %1<br/>は積み込めなかった + %1<br/>이 실릴 수가 없습니다 + %1<br/>無法被裝載 + %1<br/>无法被装载 %1<br/>could not be unloaded @@ -181,11 +223,14 @@ %1<br/>non può essere scaricato %1<br/>no pudo ser descargado %1<br /> n'a pas pu être déchargé - %1&lt;br/&gt;は下ろせなかった + %1<br/>は降ろせなかった + %1<br/>이 내려질 수가 없습니다 + %1<br/>無法被卸載 + %1<br/>无法被卸载 Make Object Loadable - Füge Objekt zum Frachtsystem hinzu + Objekt ein/entladbar machen Ustaw jako ładowalny Rendi oggetto caricabile Hacer objeto cargable @@ -194,10 +239,13 @@ Fazer objeto carregável Сделать объект загружаемым オブジェクトを積載可能に + 물체를 화물화시키기 + 使物件可裝載 + 使物件可装载 Sets the synced object as loadable by the cargo system. - Das synchronisierte Objekt wird dem Frachtsystem hinzugefügt und ist be- und entladbar. + Das synchronisierte Objekt wird dem Frachtsystem hinzugefügt und ist ein- und entladbar. Ustawia zsynchronizowany obiekt jako możliwy do załadowania poprzez system cargo Imposta l'oggetto sincronizzato come caricabile dal sistema cargo Sincronizar un objecto para hacerlo cargable. @@ -206,6 +254,9 @@ Seta o objeto sincronizado como carregável Делает синхронизированный объект загружаемым для модуля перевозки грузов. オブジェクトを同期させると、カーゴ システムによる積載が可能になります。 + 물체를 화물 시스템과 동기화시켜 실을 수 있게 합니다 + 使用同步線來使該物件可被裝載. + 使用同步线来使该物件可被装载. Object's Size @@ -218,18 +269,87 @@ Tamanho do objeto Размер объекта オブジェクトの大きさ + 물체 크기 + 物件的大小 + 物件的大小 + + + Cargo Space + Frachtraum + Spazio Cargo + カーゴ スペース + 貨物空間 + 货物空间 + Przestrzeń ładunkowa + + + The cargo space available in this vehicle/container + Verfügbarer Frachtraum in diesem Fahrzeug/Container + Lo spazio disponibile in questo veicolo/container + この車両/コンテナでカーゴ スペースを使えるようにします + 設定此載具/集裝箱可裝載多少貨物 + 设定此载具/集装箱可装载多少货物 + Dostępna przestrzeń ładunkowa w tym pojeździe/kontenerze + + + Cargo Size + Frachtgröße + Dimensioni Cargo + カーゴ サイズ + 貨物的大小 + 货物的大小 + Wielkość ładunku + + + The cargo space required to hold this object (-1 for unloadable) + Frachtraumgröße, welche zum Einladen dieses Objektes benötigt wird (-1 nicht einladbar) + Lo spazio del cargo necessita di mantenere questo oggetto (-1 per scaricabile) + このオブジェクトを積載するのに必要なカーゴ スペース (-1 で積載不可) + 此貨物會佔掉多少空間(設定-1的話此貨物就不能被裝載) + 此货物会占掉多少空间(设定-1的话此货物就不能被装载) + Wymagana przestrzeń ładunkowa dla tego obiektu (-1 dla niemożliwych do załadowania) Airdrop Türlast 空中投下 Zrzut zaopatrzenia + 공중 투하 + Largage aérien + Lancio Aereo + 空投 + 空投 Unlevel Flight Schieflage 機体が水平ではありません Nierówny lot + 기체가 수평이 아닙니다 + Rétablir l'assiette + Volo non Livellato + 此架飛機並無保持水平飛行 + 此架飞机并无保持水平飞行 + + + Paradrop Time Coffecient + Türlast Zeitfaktor + 空中投下までの時間係数 + Coefficente Tempo Lancio Paracadute + Coefficient Temps de largage de cargaison + 空投時間係數 + 空投时间系数 + Współczynnik czasu zrzutu + + + Modifier for how long it takes to paradrop a cargo item. + Beeinflusst die zusätzliche Zeit für Türlastabwürfe. + カーゴ アイテムを空中投下するまでの時間を変更します。 + Modificato per quanto tempo ci impiega a paracadutare un oggetto cargo. + Modifier le temps qu'il faut pour larguer la cargaison. + 設定空投所需消耗的時間. + 设定空投所需消耗的时间. + Modyfikator wskazujący jak dużo czasu potrzeba by zrzucić przedmiot na spadochronie. diff --git a/addons/chemlights/CfgVehicles.hpp b/addons/chemlights/CfgVehicles.hpp index 62aee70724..8e5fe8789e 100644 --- a/addons/chemlights/CfgVehicles.hpp +++ b/addons/chemlights/CfgVehicles.hpp @@ -12,7 +12,7 @@ class CfgVehicles { icon = "\a3\ui_f\data\gui\cfg\Hints\chemlights_ca.paa"; condition = QUOTE(count ([ACE_player] call FUNC(getShieldComponents)) > 0); statement = "true"; - exceptions[] = {"isNotDragging", "notOnMap", "isNotInside", "isNotSitting"}; + exceptions[] = {"isNotDragging", "isNotSwimming", "notOnMap", "isNotInside", "isNotSitting"}; insertChildren = QUOTE(_this call DFUNC(compileChemlightMenu)); showDisabled = 0; priority = 99; @@ -20,10 +20,10 @@ class CfgVehicles { }; }; }; - + class Thing; class ThingX; - + class ACE_Chemlight_IR_Marker: Thing { author = ECSTRING(common,ACETeam); displayName = "ACE Chemlight IR Marker"; @@ -49,7 +49,7 @@ class CfgVehicles { useFlare = 0; }; }; - + class ACE_Chemlight_IR_Dummy: ThingX { ACE_Attachable = "ACE_G_Chemlight_IR"; author = ECSTRING(common,ACETeam); @@ -62,7 +62,7 @@ class CfgVehicles { class CBA_Extended_EventHandlers: CBA_Extended_EventHandlers {}; }; }; - + class Item_Base_F; class ACE_Item_Chemlight_Shield: Item_Base_F { @@ -78,7 +78,7 @@ class CfgVehicles { }; }; }; - + class ACE_Item_Chemlight_Shield_Green: Item_Base_F { scope = 2; scopeCurator = 2; @@ -92,7 +92,7 @@ class CfgVehicles { }; }; }; - + class ACE_Item_Chemlight_Shield_Red: ACE_Item_Chemlight_Shield_Green { displayName = CSTRING(Shield_Red_DisplayName); class TransportItems { @@ -102,7 +102,7 @@ class CfgVehicles { }; }; }; - + class ACE_Item_Chemlight_Shield_Blue: ACE_Item_Chemlight_Shield_Green { displayName = CSTRING(Shield_Blue_DisplayName); class TransportItems { @@ -112,7 +112,7 @@ class CfgVehicles { }; }; }; - + class ACE_Item_Chemlight_Shield_Yellow: ACE_Item_Chemlight_Shield_Green { displayName = CSTRING(Shield_Yellow_DisplayName); class TransportItems { @@ -122,7 +122,7 @@ class CfgVehicles { }; }; }; - + class ACE_Item_Chemlight_Shield_Orange: ACE_Item_Chemlight_Shield_Green { displayName = CSTRING(Shield_Orange_DisplayName); class TransportItems { @@ -132,7 +132,7 @@ class CfgVehicles { }; }; }; - + class ACE_Item_Chemlight_Shield_White: ACE_Item_Chemlight_Shield_Green { displayName = CSTRING(Shield_White_DisplayName); class TransportItems { @@ -154,13 +154,13 @@ class CfgVehicles { MACRO_ADDITEM(ACE_Chemlight_Shield,12); }; }; - + class Box_NATO_Support_F: NATO_Box_Base { class TransportItems { MACRO_ADDITEM(ACE_Chemlight_Shield,12); }; }; - + class B_supplyCrate_F: ReammoBox_F { class TransportItems { MACRO_ADDITEM(ACE_Chemlight_Shield,12); @@ -172,13 +172,13 @@ class CfgVehicles { MACRO_ADDITEM(ACE_Chemlight_Shield,12); }; }; - + class Box_East_Support_F: EAST_Box_Base { class TransportItems { MACRO_ADDITEM(ACE_Chemlight_Shield,12); }; }; - + class O_supplyCrate_F: B_supplyCrate_F { class TransportItems { MACRO_ADDITEM(ACE_Chemlight_Shield,12); @@ -190,13 +190,13 @@ class CfgVehicles { MACRO_ADDITEM(ACE_Chemlight_Shield,12); }; }; - + class Box_IND_Support_F: IND_Box_Base { class TransportItems { MACRO_ADDITEM(ACE_Chemlight_Shield,12); }; }; - + class I_supplyCrate_F: B_supplyCrate_F { class TransportItems { MACRO_ADDITEM(ACE_Chemlight_Shield,12); @@ -208,19 +208,19 @@ class CfgVehicles { MACRO_ADDITEM(ACE_Chemlight_Shield,12); }; }; - + class IG_supplyCrate_F: ReammoBox_F { class TransportItems { MACRO_ADDITEM(ACE_Chemlight_Shield,12); }; }; - + class C_supplyCrate_F: ReammoBox_F { class TransportItems { MACRO_ADDITEM(ACE_Chemlight_Shield,12); }; }; - + class ACE_Box_Misc: Box_NATO_Support_F { class TransportItems { MACRO_ADDITEM(ACE_Chemlight_Shield,12); @@ -235,7 +235,7 @@ class CfgVehicles { MACRO_ADDMAGAZINE(ACE_Chemlight_IR,20); }; }; - + class ACE_Box_Chemlights: NATO_Box_Base { scope = 2; accuracy = 1; @@ -246,11 +246,11 @@ class CfgVehicles { transportMaxItems = 9002; maximumload = 9002; model = "\A3\weapons_F\AmmoBoxes\WpnsBox_large_F"; - + class TransportItems { MACRO_ADDITEM(ACE_Chemlight_Shield,20); }; - + class TransportMagazines { MACRO_ADDMAGAZINE(Chemlight_red,20); MACRO_ADDMAGAZINE(Chemlight_blue,20); @@ -264,7 +264,7 @@ class CfgVehicles { MACRO_ADDMAGAZINE(ACE_Chemlight_HiWhite,10); MACRO_ADDMAGAZINE(ACE_Chemlight_IR,20); }; - + class AnimationSources { class Ammo_source { source = "user"; diff --git a/addons/chemlights/CfgWeapons.hpp b/addons/chemlights/CfgWeapons.hpp index de5fc8aea5..5214c7e689 100644 --- a/addons/chemlights/CfgWeapons.hpp +++ b/addons/chemlights/CfgWeapons.hpp @@ -36,7 +36,7 @@ class CfgWeapons { }; class ACE_ItemCore; - class InventoryItem_Base_F; + class CBA_MiscItem_ItemInfo; class ACE_Chemlight_Shield: ACE_ItemCore { author = ECSTRING(common,ACETeam); @@ -44,8 +44,8 @@ class CfgWeapons { descriptionShort = CSTRING(Shield_Empty_DescriptionShort); model = "\A3\weapons_F\ammo\mag_univ.p3d"; picture = QPATHTOF(UI\ace_chemlight_shield_x_ca.paa); - scope = 1; - class ItemInfo: InventoryItem_Base_F { + scope = 2; + class ItemInfo: CBA_MiscItem_ItemInfo { mass = 1; }; }; @@ -58,7 +58,7 @@ class CfgWeapons { model = "\A3\weapons_F\ammo\mag_univ.p3d"; picture = QPATHTOF(UI\ace_chemlight_shield_green_x_ca.paa); scope = 1; - class ItemInfo: InventoryItem_Base_F { + class ItemInfo: CBA_MiscItem_ItemInfo { mass = 1; class FlashLight { ACE_Flashlight_Colour = "green"; @@ -73,7 +73,7 @@ class CfgWeapons { displayName = CSTRING(Shield_Red_DisplayName); descriptionShort = CSTRING(Shield_Red_DescriptionShort); picture = QPATHTOF(UI\ace_chemlight_shield_red_x_ca.paa); - class ItemInfo: InventoryItem_Base_F { + class ItemInfo: CBA_MiscItem_ItemInfo { mass = 1; class FlashLight { ACE_Flashlight_Colour = "red"; @@ -88,7 +88,7 @@ class CfgWeapons { displayName = CSTRING(Shield_Blue_DisplayName); descriptionShort = CSTRING(Shield_Blue_DescriptionShort); picture = QPATHTOF(UI\ace_chemlight_shield_blue_x_ca.paa); - class ItemInfo: InventoryItem_Base_F { + class ItemInfo: CBA_MiscItem_ItemInfo { mass = 1; class FlashLight { ACE_Flashlight_Colour = "blue"; @@ -103,7 +103,7 @@ class CfgWeapons { displayName = CSTRING(Shield_Yellow_DisplayName); descriptionShort = CSTRING(Shield_Yellow_DescriptionShort); picture = QPATHTOF(UI\ace_chemlight_shield_yellow_x_ca.paa); - class ItemInfo: InventoryItem_Base_F { + class ItemInfo: CBA_MiscItem_ItemInfo { mass = 1; class FlashLight { ACE_Flashlight_Colour = "yellow"; @@ -118,7 +118,7 @@ class CfgWeapons { displayName = CSTRING(Shield_Orange_DisplayName); descriptionShort = CSTRING(Shield_Orange_DescriptionShort); picture = QPATHTOF(UI\ace_chemlight_shield_orange_x_ca.paa); - class ItemInfo: InventoryItem_Base_F { + class ItemInfo: CBA_MiscItem_ItemInfo { mass = 1; class FlashLight { ACE_Flashlight_Colour = "orange"; @@ -133,7 +133,7 @@ class CfgWeapons { displayName = CSTRING(Shield_White_DisplayName); descriptionShort = CSTRING(Shield_White_DescriptionShort); picture = QPATHTOF(UI\ace_chemlight_shield_white_x_ca.paa); - class ItemInfo: InventoryItem_Base_F { + class ItemInfo: CBA_MiscItem_ItemInfo { mass = 1; class FlashLight { ACE_Flashlight_Colour = "white"; diff --git a/addons/chemlights/XEH_preInit.sqf b/addons/chemlights/XEH_preInit.sqf index 7d00e938cf..7fe826a174 100644 --- a/addons/chemlights/XEH_preInit.sqf +++ b/addons/chemlights/XEH_preInit.sqf @@ -3,6 +3,8 @@ ADDON = false; LOG(MSG_INIT); +PREP_RECOMPILE_START; #include "XEH_PREP.hpp" +PREP_RECOMPILE_END; ADDON = true; diff --git a/addons/chemlights/functions/fnc_compileChemlightMenu.sqf b/addons/chemlights/functions/fnc_compileChemlightMenu.sqf index 74b0a154c9..c87c4247ec 100644 --- a/addons/chemlights/functions/fnc_compileChemlightMenu.sqf +++ b/addons/chemlights/functions/fnc_compileChemlightMenu.sqf @@ -7,7 +7,7 @@ * 1: Player * 2: Parameters * - * Return value: + * Return Value: * None * * Example: @@ -29,7 +29,7 @@ private _chemlights = [_player] call FUNC(getShieldComponents); private _icon = getText (_config >> "picture"); private _shieldClass = getText (_config >> "ACE_Chemlight_Shield"); private _displayName = getText (configFile >> "CfgWeapons" >> _shieldClass >> "displayName"); - + _displayName = format [localize LSTRING(Action_Prepare), _displayName]; private _statement = {_this call FUNC(prepShield)}; diff --git a/addons/chemlights/functions/fnc_getShieldComponents.sqf b/addons/chemlights/functions/fnc_getShieldComponents.sqf index be089b261c..6055070351 100644 --- a/addons/chemlights/functions/fnc_getShieldComponents.sqf +++ b/addons/chemlights/functions/fnc_getShieldComponents.sqf @@ -5,7 +5,7 @@ * Arguments: * 0: Unit to check * - * Return value: + * Return Value: * List of carried chemlight classnames * * Example: diff --git a/addons/chemlights/functions/fnc_prepShield.sqf b/addons/chemlights/functions/fnc_prepShield.sqf index 52623d6488..b4861da080 100644 --- a/addons/chemlights/functions/fnc_prepShield.sqf +++ b/addons/chemlights/functions/fnc_prepShield.sqf @@ -7,7 +7,7 @@ * 1: Activator Unit (player) * 2: Chemlight class, chemlight shield class * - * Return value: + * Return Value: * None * * Example: diff --git a/addons/chemlights/functions/fnc_throwIR.sqf b/addons/chemlights/functions/fnc_throwIR.sqf index 7d97c99f8e..5d29ccde67 100644 --- a/addons/chemlights/functions/fnc_throwIR.sqf +++ b/addons/chemlights/functions/fnc_throwIR.sqf @@ -5,13 +5,13 @@ * Arguments: * 0: Original throw projectile * 1: Class of projectile - * 2: Adv throw (default: false) + * 2: Adv throw (default: false) * * Return Value: * None * * Example: - * [_projectile, _ammoType] call ace_chemlights_fnc_throwIR; + * [_projectile, _ammoType] call ace_chemlights_fnc_throwIR * * Public: No */ diff --git a/addons/chemlights/stringtable.xml b/addons/chemlights/stringtable.xml index 72ac033d3e..eeac958a6d 100644 --- a/addons/chemlights/stringtable.xml +++ b/addons/chemlights/stringtable.xml @@ -5,208 +5,446 @@ Chemlights ケミライト Świetliki + Knicklichter + 켐라이트 + Cyalumes + Luce chimica + 螢光棒 + 萤光棒 Prepare %1 %1 をつかう Przygotuj %1 + %1 vorbereiten + %1 준비 + Prépare %1 + Prepara %1 + 使用%1 + 使用%1 %1<br/>Prepared - %1&lt;br/&gt; をつかった + %1<br/>をつかった %1<br/>Przygotowany + %1<br/>vorbereitet + %1<br/>준비됨 + %1<br/>prêt + %1 <br/> Preparata + %1<br/>已使用 + %1<br/>已使用 No inventory space Kein Platz im Inventar Sin espacio en inventario Brak miejsca w ekwipunku - Pas de place dans l'inventaire + Pas de place Nedostatek místa v inventáři Sem espaço no inventário - Non hai più spazio + Nessuno spazio nell'inventario Nincs több hely В инвентаре нет места インベントリに空きがありません + 소지품 공간이 없음 + 已無存放空間 + 已无存放空间 [ACE] Chemlights [ACE] ケミライト [ACE] Świetliki + [ACE] Knicklichter + [ACE] 켐라이트 + [ACE] Cyalume + [ACE] Luci chimiche + [ACE] 螢光棒 + [ACE] 萤光棒 Chemlight (Orange) ケミライト (オレンジ) Świetlik (pomarańczowy) + Knicklicht (orange) + 켐라이트 (주황) + Cyalume (orange) + Luce chimica (Arancione) + 螢光棒 (橘色) + 萤光棒 (橘色) Orange Light オレンジ色 Pomarańczowe światło + Oranges Knicklicht + 주황색 + Lum. orange + Luce Arancione + 橘色光 + 橘色光 Type: Light - Orange<br />Rounds: 1<br />Used in: Hand - 種類: 照明 - オレンジ&lt;br /&gt;装填数: 1&lt;br /&gt;次で使用: 携帯 + 種類: 照明 - オレンジ<br />装填数: 1<br />次で使用: 携帯 Typ: Światło - pomarańczowe<br/>Pociski: 1<br/>Używany w: ręce + Typ: Licht - orange<br />Anzahl: 1<br />Benutzt in: Hand + 종류:밝은 오렌지<br />수량: 1<br />사용처: 손 + Type: Lumière - orange<br />Nbre: 1<br /> À main + Tipo: Luce - Arancione<br/>Rimanenti: 1<br/>Usata in: Mano + 類型: 光 - 橘色<br />發數: 1<br />使用於: 手 + 类型: 光 - 橘色<br />发数: 1<br />使用于: 手 Chemlight (White) ケミライト (白) Świetlik (biały) + Knicklicht (weiß) + 켐라이트 (하양) + Cyalume (blanc) + Luce chimica (Bianca) + 螢光棒 (白色) + 萤光棒 (白色) White Light 白色 Białe światło + Weißes Knicklicht + 하얀색 + Lum. blanche + Luce Bianca + 白色光 + 白色光 Type: Light - White<br />Rounds: 1<br />Used in: Hand - 種類: 照明 - 白&lt;br /&gt;装填数: 1&lt;br /&gt;次で使用: 携帯 + 種類: 照明 - 白<br />装填数: 1<br />次で使用: 携帯 Typ: Światło - białe<br/>Pociski: 1<br/>Używany w: ręce + Typ: Licht - weiß<br />Anzahl: 1<br />Benutzt in: Hand + 종류:하얀색<br />수량: 1<br />사용처: 손 + Type: Lumière - blanche<br />Nbre: 1<br /> À main + Tipo: Luce - Bianca<br/>Rimanenti: 1<br/>Usata in: Mano + 類型: 光 - 白色<br />發數: 1<br />使用於: 手 + 类型: 光 - 白色<br />发数: 1<br />使用于: 手 Chemlight (Hi Red) ケミライト (高輝度 赤) Świetlik (jaskrawy czerwony) + Knicklicht (rot, hell) + 켐라이트 (밝은 빨간색) + Cyalume (Hi rouge) + Luce chimica (Hi Rossa) + 螢光棒 (超亮紅色) + 萤光棒 (超亮红色) Red Hi Light 高輝度の赤色 Jaskrawe czerwone światło + Helles, rotes Knicklicht + 밝은 빨간색 + Lum. rouge haute intensité + Luce Hi Rossa + 超亮紅色光 + 超亮红色光 Type: Light - Red Hi (5 minute)<br />Rounds: 1<br />Used in: Hand - 種類: 照明 - 高輝度 赤 (5分間)&lt;br /&gt;装填数: 1&lt;br /&gt;次で使用: 携帯 + 種類: 照明 - 高輝度 赤 (5分間)<br />装填数: 1<br />次で使用: 携帯 Typ: Światło - jaskrawe czerwone (5 minut)<br/>Pociski: 1<br/>Używany w: ręce + Typ: Licht - rot, hell (5 Minuten)<br />Anzahl: 1<br />Benutzt in: Hand + 종류: 밝은 빨간색 (5분)<br />수량: 1<br />사용처: 손 + Type: Lumière - rouge Hi (5 minutes)<br />Nbre: 1<br /> À main + Tipo: Luce - Rossa Hi (5 minuti)<br />Rimanenti: 1<br/>Usata in: Mano + 類型: 光 - 超亮紅色 (5分鐘)<br />發數: 1<br />使用於: 手 + 类型: 光 - 超亮红色 (5分钟)<br />发数: 1<br />使用于: 手 Chemlight (Hi Yellow) ケミライト (高輝度 黄) Świetlik (jaskrawy żółty) + Knicklicht (gelb, hell) + 켐라이트 (밝은 노란색) + Cyalume (Hi jaune) + Luce chimica (Hi Gialla) + 螢光棒 (超亮黃色) + 萤光棒 (超亮黄色) Yellow Hi Light 高輝度の黄色 Jaskrawe żółte światło + Helles, gelbes Knicklicht + 밝은 노란색 + Lum. jaune haute intensité + Luce Hi Gialla + 超亮黃色光 + 超亮黄色光 Type: Light - Yellow Hi (5 minute)<br />Rounds: 1<br />Used in: Hand - 種類: 照明 - 高輝度 黄 (5分間)&lt;br /&gt;装填数: 1&lt;br /&gt;次で使用: 携帯 + 種類: 照明 - 高輝度 黄 (5分間)<br />装填数: 1<br />次で使用: 携帯 Typ: Światło - jaskrawe żółte (5 minut)<br/>Pociski: 1<br/>Używany w: ręce + Typ: Licht - gelb, hell (5 Minuten)<br />Anzahl: 1<br />Benutzt in: Hand + 종류:밝은 노란색 (5분)<br />수량: 1<br />사용처: Hand + Type: Lumière - Jaune Hi (5 minutes)Nbre: 1<br /> À main + Tipo: Luce - Gialla Hi (5 minuti)<br />Rimanenti: 1<br/>Usata in: Mano + 類型: 光 - 超亮黃色 (5分鐘)<br />發數: 1<br />使用於: 手 + 类型: 光 - 超亮黄色 (5分钟)<br />发数: 1<br />使用于: 手 Chemlight (Hi Orange) ケミライト (高輝度 オレンジ) Świetlik (jaskrawy pomarańczowy) + Knicklicht (orange, hell) + 켐라이트 (밝은 주황색) + Cyalume (Hi orange) + Luce chimica (Hi Arancione) + 螢光棒 (超亮橘色) + 萤光棒 (超亮橘色) Orange Hi Light 高輝度のオレンジ Jaskrawe pomarańczowe światło + Helles, oranges Knicklicht + 밝은 주황색 + Lum. orange haute intensité + Luce Hi Arancione + 超亮橘色光 + 超亮橘色光 Type: Light - Orange Hi (5 minute)<br />Rounds: 1<br />Used in: Hand - 種類: 照明 - 高輝度 オレンジ (5分間)&lt;br /&gt;装填数: 1&lt;br /&gt;次で使用: 携帯 + 種類: 照明 - 高輝度 オレンジ (5分間)<br />装填数: 1<br />次で使用: 携帯 Typ: Światło - jaskrawe pomarańczowe (5 minut)<br/>Pociski: 1<br/>Używany w: ręce + Typ: Licht - orange, hell (5 Minuten)<br />Anzahl: 1<br />Benutzt in: Hand + 종류: 밝은 주황색 (5분)<br />수량: 1<br />사용처: 손 + Type: Lumière - orange Hi (5 minutes)<br />Nbre: 1<br /> À main + Tipo: Luce - Arancione Hi (5 minuti)<br />Rimanenti: 1<br/>Usata in: Mano + 類型: 光 - 超亮橘色 (5分鐘)<br />發數: 1<br />使用於: 手 + 类型: 光 - 超亮橘色 (5分钟)<br />发数: 1<br />使用于: 手 Chemlight (Hi White) ケミライト (高輝度 白) Świetlik (jaskrawy biały) + Knicklicht (weiß, hell) + 켐라이트 (밝은 하얀색) + Cyalume (Hi blanc) + Luce chimica (Hi Bianca) + 螢光棒 (超亮白色) + 萤光棒 (超亮白色) White Hi Light 高輝度の白色 Jaskrawe białe światło + Helles, weißes Knicklicht + 밝은 하얀색 + Lum. blanche haute intensité + Luce Hi Bianca + 超亮白色光 + 超亮白色光 Type: Light - White Hi (5 minute)<br />Rounds: 1<br />Used in: Hand - 種類: 照明 - 高輝度 白 (5分間)&lt;br /&gt;装填数: 1&lt;br /&gt;次で使用: 携帯 + 種類: 照明 - 高輝度 白 (5分間)<br />装填数: 1<br />次で使用: 携帯 Typ: Światło - jaskrawe białe (5 minut)<br/>Pociski: 1<br/>Używany w: ręce + Typ: Licht - weiß, hell (5 Minuten)<br />Anzahl: 1<br />Benutzt in: Hand + 종류: 밝은 하얀색 (5분)<br />수량: 1<br />사용처: 손 + Type: Lumière - blanche Hi (5 minutes)<br />Nbre: 1<br /> À main + Tipo: Luce - Bianca Hi (5 minuti)<br />Rimanenti: 1<br/>Usata in: Mano + 類型: 光 - 超亮白色 (5分鐘)<br />發數: 1<br />使用於: 手 + 类型: 光 - 超亮白色 (5分钟)<br />发数: 1<br />使用于: 手 Chemlight (IR) ケミライト (IR) Świetlik (podczerwony) + Knicklicht (IR) + 켐라이트 (적외선) + Cyalume (IR) + Luce chimica (IR) + 螢光棒 (紅外線) + 萤光棒 (红外线) IR Light 赤外線光 Światło podczerwone + IR-Knicklicht + 적외선 켐라이트 + Lumière IR + Luce IR + 紅外線光 + 红外线光 Type: Light - Infrared<br />Rounds: 1<br />Used in: Hand - 種類: 照明 - 赤外線&lt;br /&gt;装填数: 1&lt;br /&gt;次で使用: 携帯 + 種類: 照明 - 赤外線<br />装填数: 1<br />次で使用: 携帯 Typ: Światło - podczerwone<br/>Pociski: 1<br/>Używany w: ręce + Typ: Licht - infrarot<br />Anzahl: 1<br />Benutzt in: Hand + 종류: 적외선<br />수량: 1<br />사용처: 손 + Type: Lumière - infrarouge<br />Nbre: 1<br /> À main + Tipo: Luce - Infrarossi<br />Usata in: Mano + 類型: 光 - 紅外線<br />發數: 1<br />使用於: 手 + 类型: 光 - 红外线<br />发数: 1<br />使用于: 手 Chemlight Shield (Empty) ケミライト シールド (空) Osłona na świetlik (pusta) + Knicklicht-Abschirmung (leer) + 켐라이트 쉴드 (비어있음) + Étui cyalume (vide) + Scudo Luce chimica (Vuoto) + 螢光棒保護殼 (空) + 萤光棒保护壳 (空) Shield for chemlights. Combine with chemlight to prepare reading light. ケミライトを入れられます。シールドとケミライトを組み合わせることで、照明にもなりえます。 Osłona na świetliki. Połącz ją ze świetlikiem by stworzyć lampkę do czytania. + Abschirmung für Knicklichter. Mit Knicklicht kombinieren, um Leselicht zu erhalten. + 켐라이트를 위한 가림막입니다. 켐라이트와 같이 사용하여 읽을 때 씁니다. + Étui pour cyalume. Combiné avec un cyalume pour obtennir un lampe de lecture. + Scudo per luci chimiche. Combina con una luce chimica per una luce da lettura. + 螢光棒的保護殼. 與螢光棒結合後可充當閱讀燈. + 萤光棒的保护壳. 与萤光棒结合后可充当阅读灯. Chemlight Shield (Green) ケミライト シールド (緑) Osłona na świetlik (zielona) + Knicklicht-Abschirmung (grün) + 켐라이트 쉴드 (초록) + Étui cyalume (vert) + Scudo Luce Chimica (Verde) + 螢光棒保護殼 (綠色) + 萤光棒保护壳 (绿色) Green reading light. 緑色の照明。 Zielona lampka. + Grünes Leselicht. + 초록빛 조명 + Lampe d'orientation verte. + Luce da lettura Verde. + 綠色閱讀燈。 + 绿色阅读灯。 Chemlight Shield (Red) ケミライト シールド (赤) Osłona na świetlik (czerwona) + Knicklicht-Abschirmung (rot) + 켐라이트 쉴드 (빨강) + Étui cyalume (rouge) + Scudo Luce Chimica (Rossa) + 螢光棒保護殼 (紅色) + 萤光棒保护壳 (红色) Red reading light. 赤色の照明。 Czerwona lampka. + Rotes Leselicht. + 빨간색 조명 + Lampe d'orientation rouge. + Luce da lettura Rossa. + 紅色閱讀燈。 + 红色阅读灯。 Chemlight Shield (Blue) ケミライト シールド (青) Osłona na świetlik (niebieska) + Knicklicht-Abschirmung (blau) + 켐라이트 쉴드 (파랑) + Étui cyalume (bleu) + Scudo Luce Chimica (Blu) + 螢光棒保護殼 (藍色) + 萤光棒保护壳 (蓝色) Blue reading light. 青色の照明。 Niebieska lampka. + Blaues Leselicht. + 파란색 조명 + Lampe d'orientation bleue. + Luce da lettura Blu. + 藍色閱讀燈。 + 蓝色阅读灯。 Chemlight Shield (Yellow) ケミライト シールド (黄) Osłona na świetlik (żółta) + Knicklicht-Abschirmung (gelb) + 켐라이트 쉴드 (노랑) + Étui cyalume (jaune) + Scudo Luce Chimica (Gialla) + 螢光棒保護殼 (黃色) + 萤光棒保护壳 (黄色) Yellow reading light. 黄色の照明。 Żółta lampka. + Gelbes Leselicht. + 노란색 조명 + Lampe d'orientation jaune. + Luce da lettura Gialla. + 黃色閱讀燈。 + 黄色阅读灯。 Chemlight Shield (Orange) ケミライト シールド (オレンジ) Osłona na świetlik (pomarańczowa) + Knicklicht-Abschirmung (orange) + 켐라이트 쉴드 (주황) + Étui cyalume (orange) + Scudo Luce Chimica (Arancione) + 螢光棒保護殼 (橘色) + 萤光棒保护壳 (橘色) Orange reading light. オレンジの照明。 Pomarańczowa lampka. + Oranges Leselicht. + 주황색 조명 + Lampe d'orientation orange. + Luce da lettura Arancione. + 橘色閱讀燈。 + 橘色阅读灯。 Chemlight Shield (White) ケミライト シールド (白) Osłona na świetlik (biała) + Knicklicht-Abschirmung (weiß) + 켐라이트 쉴드 (하양) + Étui cyalume (blanc) + Scudo Luce Chimica (Bianca) + 螢光棒保護殼 (白色) + 萤光棒保护壳 (白色) White reading light. 白の照明。 + Biała lampka. + Weißes Leselicht. + 주황색 조명 + Lampe d'orientation blanche. + Luce da lettura Bianca. + 白色閱讀燈。 + 白色阅读灯。 diff --git a/addons/common/CfgLocationTypes.hpp b/addons/common/CfgLocationTypes.hpp index 15b56c120c..163c1e5a88 100644 --- a/addons/common/CfgLocationTypes.hpp +++ b/addons/common/CfgLocationTypes.hpp @@ -4,7 +4,7 @@ class CfgLocationTypes { class ACE_HashLocation { color[] = {0,0,0,0}; - drawStyle = "bananas"; + drawStyle = "WARNING-ACE_HashLocation_is_deprecated"; // Replaced by CBA_fnc_createNamespace font = "RobotoCondensed"; importance = 5; name = "HashLocation"; diff --git a/addons/common/CfgWeapons.hpp b/addons/common/CfgWeapons.hpp index 488d4210c4..09a828e475 100644 --- a/addons/common/CfgWeapons.hpp +++ b/addons/common/CfgWeapons.hpp @@ -1,11 +1,8 @@ class CfgWeapons { - class ItemCore; - class ACE_ItemCore: ItemCore { - type = 4096;//4; - detectRange = -1; - simulation = "ItemMineDetector"; - }; + class CBA_MiscItem; + class CBA_MiscItem_ItemInfo; + class ACE_ItemCore: CBA_MiscItem {}; class Rifle; class Rifle_Base_F: Rifle { @@ -28,7 +25,6 @@ class CfgWeapons { }; }; - class InventoryItem_Base_F; class ACE_Banana: ACE_ItemCore { author = CSTRING(ACETeam); scope = 2; @@ -38,7 +34,7 @@ class CfgWeapons { picture = QPATHTOF(data\icon_banana_ca.paa); icon = "iconObject_circle"; mapSize = 0.034; - class ItemInfo: InventoryItem_Base_F { + class ItemInfo: CBA_MiscItem_ItemInfo { mass = 1; }; }; diff --git a/addons/common/ProgressScreen.hpp b/addons/common/ProgressScreen.hpp index 57454dec78..9b55ae33a3 100644 --- a/addons/common/ProgressScreen.hpp +++ b/addons/common/ProgressScreen.hpp @@ -12,7 +12,6 @@ class GVAR(ProgressBar_Dialog) { text = ""; sizeEx = 0; lineSpacing = 0; - access = 0; type = 0; style = 0; size = 1; @@ -64,7 +63,6 @@ class GVAR(DisableMouse_Dialog) { text = ""; sizeEx = 0; lineSpacing = 0; - access = 0; type = 0; style = 0; size = 1; diff --git a/addons/common/UI/blank_CO.paa b/addons/common/UI/blank_CO.paa deleted file mode 100644 index c1109c748c..0000000000 Binary files a/addons/common/UI/blank_CO.paa and /dev/null differ diff --git a/addons/magazinerepack/UI/repack_ca.paa b/addons/common/UI/repack_ca.paa similarity index 100% rename from addons/magazinerepack/UI/repack_ca.paa rename to addons/common/UI/repack_ca.paa diff --git a/addons/common/XEH_PREP.hpp b/addons/common/XEH_PREP.hpp index 44e6010b4e..4a7b336ac0 100644 --- a/addons/common/XEH_PREP.hpp +++ b/addons/common/XEH_PREP.hpp @@ -13,6 +13,7 @@ PREP(ASLToPosition); PREP(binarizeNumber); PREP(blurScreen); PREP(cachedCall); +PREP(canDig); PREP(canGetInPosition); PREP(canInteractWith); PREP(changeProjectileDirection); @@ -36,6 +37,7 @@ PREP(displayTextPicture); PREP(displayTextStructured); PREP(doAnimation); PREP(doGesture); +PREP(dummy); PREP(dropBackpack); PREP(endRadioTransmission); PREP(eraseCache); @@ -65,6 +67,7 @@ PREP(getMGRSdata); PREP(getName); PREP(getNumberMagazinesIn); PREP(getPitchBankYaw); +PREP(getPylonTurret); PREP(getSettingData); PREP(getStaminaBarControl); PREP(getTargetAzimuthAndInclination); @@ -75,6 +78,7 @@ PREP(getTurretDirection); PREP(getUavControlPosition); PREP(getVehicleCargo); PREP(getVehicleCodriver); +PREP(getVehicleIcon); PREP(getVersion); PREP(getWeaponAzimuthAndInclination); PREP(getWeaponIndex); @@ -97,8 +101,10 @@ PREP(isEngineer); PREP(isEOD); PREP(isFeatureCameraActive); PREP(isInBuilding); +PREP(isMedic); PREP(isModLoaded); PREP(isPlayer); +PREP(isSwimming); PREP(isUnderwater); PREP(lightIntensityFromObject); PREP(loadPerson); @@ -111,6 +117,7 @@ PREP(moduleLSDVehicles); PREP(muteUnit); PREP(muteUnitHandleInitPost); PREP(muteUnitHandleRespawn); +PREP(nearestVehiclesFreeSeat); PREP(numberToDigits); PREP(numberToDigitsString); PREP(numberToString); @@ -131,6 +138,7 @@ PREP(requestCallback); PREP(resetAllDefaults); PREP(restoreVariablesJIP); PREP(runAfterSettingsInit); +PREP(runTests); PREP(sanitizeString); PREP(sendRequest); PREP(serverLog); @@ -141,6 +149,7 @@ PREP(setHearingCapability); PREP(setName); PREP(setParameter); PREP(setPitchBankYaw); +PREP(setPlayerOwner); PREP(setProne); PREP(setSetting); PREP(setSettingFromConfig); @@ -157,7 +166,6 @@ PREP(statusEffect_sendEffects); PREP(statusEffect_set); PREP(stringCompare); PREP(stringToColoredText); -PREP(stringRemoveWhiteSpace); PREP(switchToGroupSide); PREP(throttledPublicVariable); PREP(toBin); diff --git a/addons/common/XEH_postInit.sqf b/addons/common/XEH_postInit.sqf index 68920a7a5c..0e5b578362 100644 --- a/addons/common/XEH_postInit.sqf +++ b/addons/common/XEH_postInit.sqf @@ -22,7 +22,7 @@ ["forceWalk", false, ["ACE_SwitchUnits", "ACE_Attach", "ACE_dragging", "ACE_Explosives", "ACE_Ladder", "ACE_Sandbag", "ACE_refuel", "ACE_rearm", "ACE_dragging"]] call FUNC(statusEffect_addType); ["blockSprint", false, []] call FUNC(statusEffect_addType); ["setCaptive", true, [QEGVAR(captives,Handcuffed), QEGVAR(captives,Surrendered), "ace_unconscious"]] call FUNC(statusEffect_addType); -["blockDamage", false, ["fixCollision"]] call FUNC(statusEffect_addType); +["blockDamage", false, ["fixCollision", "ACE_cargo"]] call FUNC(statusEffect_addType); ["blockEngine", false, ["ACE_Refuel"]] call FUNC(statusEffect_addType); [QGVAR(forceWalk), { @@ -123,6 +123,7 @@ if (isServer) then { [QGVAR(switchMove), {(_this select 0) switchMove (_this select 1)}] call CBA_fnc_addEventHandler; [QGVAR(setVectorDirAndUp), {(_this select 0) setVectorDirAndUp (_this select 1)}] call CBA_fnc_addEventHandler; [QGVAR(setVanillaHitPointDamage), {(_this select 0) setHitPointDamage (_this select 1)}] call CBA_fnc_addEventHandler; +[QGVAR(addWeaponItem), {(_this select 0) addWeaponItem [(_this select 1), (_this select 2)]}] call CBA_fnc_addEventHandler; // Request framework [QGVAR(requestCallback), FUNC(requestCallback)] call CBA_fnc_addEventHandler; @@ -133,6 +134,7 @@ if (isServer) then { if (isServer) then { [QGVAR(hideObjectGlobal), {(_this select 0) hideObjectGlobal (_this select 1)}] call CBA_fnc_addEventHandler; [QGVAR(enableSimulationGlobal), {(_this select 0) enableSimulationGlobal (_this select 1)}] call CBA_fnc_addEventHandler; + [QGVAR(setShotParents), {(_this select 0) setShotParents [_this select 1, _this select 2]}] call CBA_fnc_addEventHandler; ["ace_setOwner", {(_this select 0) setOwner (_this select 1)}] call CBA_fnc_addEventHandler; [QGVAR(serverLog), FUNC(serverLog)] call CBA_fnc_addEventHandler; }; @@ -282,11 +284,11 @@ enableCamShake true; params ["_newPlayer","_oldPlayer"]; if (alive _newPlayer) then { - [_newPlayer] call FUNC(setName); + [FUNC(setName), [_newPlayer]] call CBA_fnc_execNextFrame; }; if (alive _oldPlayer) then { - [_oldPlayer] call FUNC(setName); + [FUNC(setName), [_oldPlayer]] call CBA_fnc_execNextFrame; }; }] call CBA_fnc_addPlayerEventHandler; @@ -295,18 +297,10 @@ enableCamShake true; // Set up numerous eventhanders for player controlled units ////////////////////////////////////////////////// -// It is possible that CBA_fnc_addPlayerEventHandler has allready been called and run -// We will NOT get any events for the initial state, so manually set ACE_player -if (!isNull (missionNamespace getVariable ["cba_events_oldUnit", objNull])) then { - // INFO("CBA_fnc_addPlayerEventHandler has already run - manually setting ace_player"); //ToDo CBA 3.1 - diag_log text "[ACE-Common - CBA_fnc_addPlayerEventHandler has already run - manually setting ace_player"; - ACE_player = cba_events_oldUnit; -}; - -// "playerChanged" event +TRACE_1("adding unit playerEH to set ace_player",isNull cba_events_oldUnit); ["unit", { ACE_player = (_this select 0); -}] call CBA_fnc_addPlayerEventHandler; +}, true] call CBA_fnc_addPlayerEventHandler; GVAR(OldIsCamera) = false; @@ -324,6 +318,49 @@ GVAR(OldIsCamera) = false; END_COUNTER(stateChecker); }, 0.5, []] call CBA_fnc_addPerFrameHandler; +// Add event handler for UAV control change +ACE_controlledUAV = [objNull, objNull, [], ""]; +addMissionEventHandler ["PlayerViewChanged", { + // On non-server client this command is semi-broken + // arg index 5 should be the controlled UAV, but it will often be objNull (delay from locality switching?) + // On PlayerViewChanged event, start polling for new uav state for a few seconds (should be done within a few frames) + + params ["", "", "", "", "_newCameraOn", "_UAV"]; + TRACE_2("PlayerViewChanged",_newCameraOn,_UAV); + + [{ + if (isNull player) exitWith {true}; + private _UAV = getConnectedUAV player; + if (!alive player) then {_UAV = objNull;}; + private _position = (UAVControl _UAV) param [1, ""]; + private _seatAI = objNull; + private _turret = []; + switch (toLower _position) do { + case (""): { + _UAV = objNull; // set to objNull if not actively controlling + }; + case ("driver"): { + _turret = [-1]; + _seatAI = driver _UAV; + }; + case ("gunner"): { + _turret = [0]; + _seatAI = gunner _UAV; + }; + }; + + private _newArray = [_UAV, _seatAI, _turret, _position]; + if (_newArray isEqualTo ACE_controlledUAV) exitWith {false}; // no change yet + + TRACE_2("Seat Change",_newArray,ACE_controlledUAV); + ACE_controlledUAV = _newArray; + ["ACE_controlledUAV", _newArray] call CBA_fnc_localEvent; + + // stay in the loop as we might switch from gunner -> driver, and there may be a empty position event in-between + false + }, {}, [], 3, {TRACE_1("timeout",_this);}] call CBA_fnc_waitUntilAndExecute; +}]; + ////////////////////////////////////////////////// // Eventhandlers for player controlled machines @@ -362,7 +399,9 @@ GVAR(OldIsCamera) = false; // Players can always interact with his vehicle {vehicle _unit == _target} || // Players can always interact with passengers of the same vehicle - {_unit != _target && {vehicle _unit == vehicle _target}} + {_unit != _target && {vehicle _unit == vehicle _target}} || + // Players can always interact with connected UAV + {!(isNull (ACE_controlledUAV select 0))} }] call FUNC(addCanInteractWithCondition); ["isNotInZeus", {isNull curatorCamera}] call FUNC(addCanInteractWithCondition); @@ -380,7 +419,9 @@ GVAR(isReloading) = false; private _weapon = currentWeapon ACE_player; if (_weapon != "") then { - private _gesture = getText (configfile >> "CfgWeapons" >> _weapon >> "reloadAction"); + private _muzzle = currentMuzzle ACE_player; + private _wpnConfig = configFile >> "CfgWeapons" >> _weapon; + private _gesture = getText ([_wpnConfig >> _muzzle, _wpnConfig] select (_weapon isEqualTo _muzzle) >> "reloadAction"); if (_gesture == "") exitWith {}; //Ignore weapons with no reload gesture (binoculars) private _isLauncher = _weapon isKindOf ["Launcher", configFile >> "CfgWeapons"]; private _config = ["CfgGesturesMale", "CfgMovesMaleSdr"] select _isLauncher; @@ -465,8 +506,8 @@ GVAR(deviceKeyCurrentIndex) = -1; ["ACE3 Equipment", QGVAR(cycleDevice), (localize "STR_ACE_Common_cycleHandheldDevices"), { [1] call FUNC(deviceKeyFindValidIndex); if (GVAR(deviceKeyCurrentIndex) == -1) exitWith {false}; - _displayName = ((GVAR(deviceKeyHandlingArray) select GVAR(deviceKeyCurrentIndex)) select 0); - _iconImage = ((GVAR(deviceKeyHandlingArray) select GVAR(deviceKeyCurrentIndex)) select 1); + private _displayName = ((GVAR(deviceKeyHandlingArray) select GVAR(deviceKeyCurrentIndex)) select 0); + private _iconImage = ((GVAR(deviceKeyHandlingArray) select GVAR(deviceKeyCurrentIndex)) select 1); [_displayName, _iconImage] call FUNC(displayTextPicture); true }, diff --git a/addons/common/XEH_preInit.sqf b/addons/common/XEH_preInit.sqf index eca1aebf36..355ffb2a7d 100644 --- a/addons/common/XEH_preInit.sqf +++ b/addons/common/XEH_preInit.sqf @@ -3,7 +3,9 @@ ADDON = false; +PREP_RECOMPILE_START; #include "XEH_PREP.hpp" +PREP_RECOMPILE_END; GVAR(syncedEvents) = [] call CBA_fnc_hashCreate; GVAR(showHudHash) = [] call CBA_fnc_hashCreate; diff --git a/addons/common/config.cpp b/addons/common/config.cpp index 2cddf76bd8..76258ca0cb 100644 --- a/addons/common/config.cpp +++ b/addons/common/config.cpp @@ -45,7 +45,6 @@ class ACE_Rsc_Control_Base { idc = 1; type = 0; style = 48; - access = 0; lineSpacing = 0; moving = 1; text = ""; @@ -90,3 +89,8 @@ class CfgUIGrids { class ACE_Extensions { extensions[] = {}; }; + +class ACE_Tests { + vehicleTransportInventory = QPATHTOF(dev\test_vehicleInventory.sqf); + mapConfigs = QPATHTOF(dev\test_mapConfigs.sqf); +}; diff --git a/addons/common/define.hpp b/addons/common/define.hpp index 6c7a90fea9..f25892b6d7 100644 --- a/addons/common/define.hpp +++ b/addons/common/define.hpp @@ -94,7 +94,6 @@ class ACE_gui_backgroundBase { }; class ACE_gui_editBase { - access = 0; type = 2; x = 0; y = 0; @@ -290,7 +289,6 @@ class ACE_gui_listBoxBase : RscListBox{ class ACE_gui_listNBox { - access = 0; type = CT_LISTNBOX;// 102; style =ST_MULTI; w = 0.4; diff --git a/addons/common/dev/test_mapConfigs.sqf b/addons/common/dev/test_mapConfigs.sqf new file mode 100644 index 0000000000..1b114d79e3 --- /dev/null +++ b/addons/common/dev/test_mapConfigs.sqf @@ -0,0 +1,49 @@ +// PabstMirror +// ["mapConfigs"] call ace_common_fnc_runTests; +// execVM "z\ace\addons\common\dev\test_mapConfigs.sqf"; + +#include "\z\ace\addons\common\script_component.hpp" + +diag_log text format ["--- Checking Map Configs ---"]; + +private _testPass = true; + +private _maps = configProperties [configFile >> "CfgWorldList", "(isClass _x)", true]; +{ + private _mapConfigName = configName _x; + private _worldConfig = configFile >> "CfgWorlds" >> _mapConfigName; + private _mapDescription = getText (_worldConfig >> "description"); + + // Check if custom latitude/elevation in lookup table (ace_common_fnc_getMapData) + private _getMapData = [_mapConfigName] call FUNC(getMapData); + if (_getMapData isEqualTo []) then { + diag_log text format ["%1 [%2] - Not in getMapData",_mapDescription,_mapConfigName]; + diag_log text format [" - Using map's config [latitude: %1] [elevationOffset: %2]", getNumber (_worldConfig >> "latitude"), getNumber (_worldConfig >> "elevationOffset")]; + }; + + // Test MGRS grid step size (from ace_common_fnc_getMapGridData) + private _zoomMax = 1e99; + private _formatX = ""; + private _formatY = ""; + private _stepX = 1e10; + private _stepY = 1e10; + { + private _zoom = getnumber (_x >> "zoomMax"); + if (_zoom < _zoomMax) then { + _zoomMax = _zoom; + _formatX = getText (_x >> "formatX"); + _formatY = getText (_x >> "formatY"); + _stepX = getNumber (_x >> "stepX"); + _stepY = getNumber (_x >> "stepY"); + }; + } forEach configProperties [(_worldConfig >> "Grid"), "isClass _x", false]; + private _stepXat5 = _stepX * 10 ^ ((count _formatX) - 5); + private _stepYat5 = -1 * _stepY * 10 ^ ((count _formatY) - 5); + if (_stepYat5 < 0) then {diag_log text format ["%1 [%2] - Northing is reversed.",_mapDescription,_mapConfigName];}; + if (_stepXat5 != 1) then {diag_log text format ["%1 [%2] - MGRS 10 digit grid does not equal 1 meter: (%3) for x.",_mapDescription,_mapConfigName,_stepXat5];}; + if (_stepYat5 != 1 && {_stepYat5 != -1}) then {diag_log text format ["%1 [%2] - MGRS 10 digit grid does not equal 1 meter: (%3) for y.",_mapDescription,_mapConfigName,_stepXat5];}; + +} forEach _maps; + +// Always return true, these are just warnings +_testPass diff --git a/addons/common/dev/test_vehicleInventory.sqf b/addons/common/dev/test_vehicleInventory.sqf new file mode 100644 index 0000000000..fced35a987 --- /dev/null +++ b/addons/common/dev/test_vehicleInventory.sqf @@ -0,0 +1,47 @@ +// PabstMirror +// ["vehicleTransportInventory"] call ace_common_fnc_runTests; +// execVM "z\ace\addons\common\dev\test_vehicleInventory.sqf"; + +private _testPass = true; + +private _vehicles = configProperties [configFile >> "CfgVehicles", "(isClass _x)", true]; +{ + private _vehType = configName _x; + { + private _name = getText (_x >> "name"); + if (_name != "MineDetector") then { // Vanilla mixes up mineDetector alot? + private _weaponConfig = configFile >> "CfgWeapons" >> _name; + private _glassesConfig = configFile >> "CfgGlasses" >> _name; + if (((!isClass _weaponConfig) || {(getNumber (_weaponConfig >> "type")) in [1,2,4]}) && {!isClass _glassesConfig}) then { + diag_log text format ["%1 -> TransportItems -> %2 = Bad", _vehType, _name]; + _testPass = false; + }; + }; + } forEach (configProperties [_x >> "TransportItems", "isClass _x", true]); + { + private _name = getText (_x >> "weapon"); + private _weaponConfig = configFile >> "CfgWeapons" >> _name; + if ((!isClass _weaponConfig) || {!((getNumber (_weaponConfig >> "type")) in [1,2,4])}) then { + diag_log text format ["%1 -> TransportWeapons -> %2 = Bad", _vehType, _name]; + _testPass = false; + }; + } forEach (configProperties [_x >> "TransportWeapons", "isClass _x", true]); + { + private _name = getText (_x >> "magazine"); + private _magConfig = configFile >> "CfgMagazines" >> _name; + if ((!isClass _magConfig)) then { + diag_log text format ["%1 -> TransportMagazines -> %2 = Bad", _vehType, _name]; + _testPass = false; + }; + } forEach (configProperties [_x >> "TransportMagazines", "isClass _x", true]); + { + private _name = getText (_x >> "backpack"); + private _vehConfig = configFile >> "CfgVehicles" >> _name; + if ((!isClass _vehConfig)) then { + diag_log text format ["%1 -> TransportBackpacks -> %2 = Bad", _vehType, _name]; + _testPass = false; + }; + } forEach (configProperties [_x >> "TransportBackpacks", "isClass _x", true]); +} forEach _vehicles; + +_testPass diff --git a/addons/common/functions/fnc_ASLToPosition.sqf b/addons/common/functions/fnc_ASLToPosition.sqf index a5afb1db75..0f745cd2bb 100644 --- a/addons/common/functions/fnc_ASLToPosition.sqf +++ b/addons/common/functions/fnc_ASLToPosition.sqf @@ -10,6 +10,9 @@ * Return Value: * None * + * Example: + * [1, 2, 3] call ace_common_fnc_ASLToPosition + * * Public: No */ #include "script_component.hpp" diff --git a/addons/common/functions/fnc__handleRequestAllSyncedEvents.sqf b/addons/common/functions/fnc__handleRequestAllSyncedEvents.sqf index 763874de82..e41436078c 100644 --- a/addons/common/functions/fnc__handleRequestAllSyncedEvents.sqf +++ b/addons/common/functions/fnc__handleRequestAllSyncedEvents.sqf @@ -8,6 +8,9 @@ * Return Value: * Event is successed * + * Example: + * [bob] call ace_common_fnc__handleRequestAllSyncedEvents + * * Public: No */ #include "script_component.hpp" @@ -15,6 +18,7 @@ params ["_client"]; [GVAR(syncedEvents), { + //IGNORE_PRIVATE_WARNING ["_key", "_value"]; _value params ["", "_eventLog"]; ["ACEs", [_key, _eventLog], _client] call CBA_fnc_targetEvent; diff --git a/addons/common/functions/fnc__handleRequestSyncedEvent.sqf b/addons/common/functions/fnc__handleRequestSyncedEvent.sqf index f3fd2e241d..61711eb0b0 100644 --- a/addons/common/functions/fnc__handleRequestSyncedEvent.sqf +++ b/addons/common/functions/fnc__handleRequestSyncedEvent.sqf @@ -2,17 +2,21 @@ * Author: jaynus * Receives either requests for synchronization from clients, or the synchronization data from the server. * - * Arguments [Client] : + * Arguments [Client]: * 0: eventName * 1: eventLog * - * Arguments [Server] : + * Arguments [Server]: * 0: eventName * 1: client * * Return Value: * Event is successed * + * Example: + * ["name", [LOG]] call ace_common_fnc__handleRequestSyncedEvent //Client + * ["name", bob] call ace_common_fnc__handleRequestSyncedEvent//Server + * * Public: No */ #include "script_component.hpp" diff --git a/addons/common/functions/fnc__handleSyncedEvent.sqf b/addons/common/functions/fnc__handleSyncedEvent.sqf index d773e424fd..f59c8a6535 100644 --- a/addons/common/functions/fnc__handleSyncedEvent.sqf +++ b/addons/common/functions/fnc__handleSyncedEvent.sqf @@ -2,7 +2,7 @@ * Author: jaynus * Handles synced events being received. Server will log them, and server/client will execute them. * - * Arguments [Client] : + * Arguments: [Client] * 0: eventName * 1: arguments * 2: ttl @@ -10,6 +10,9 @@ * Return Value: * Boolean of success * + * Example: + * [bob] call ace_common_fnc__handleSyncedEvent + * * Public: No */ #include "script_component.hpp" diff --git a/addons/common/functions/fnc_addActionEventHandler.sqf b/addons/common/functions/fnc_addActionEventHandler.sqf index 56d2de16db..18d337225f 100644 --- a/addons/common/functions/fnc_addActionEventHandler.sqf +++ b/addons/common/functions/fnc_addActionEventHandler.sqf @@ -11,6 +11,9 @@ * Return Value: * ID of the action (used to remove it later) * + * Example: + * [bob, "DefaultAction", "condition", "execute"] call ace_common_fnc_addActionEventHandler + * * Public: No */ #include "script_component.hpp" diff --git a/addons/common/functions/fnc_addActionMenuEventHandler.sqf b/addons/common/functions/fnc_addActionMenuEventHandler.sqf index c86cf45f17..94028b9aea 100644 --- a/addons/common/functions/fnc_addActionMenuEventHandler.sqf +++ b/addons/common/functions/fnc_addActionMenuEventHandler.sqf @@ -15,6 +15,9 @@ * Return Value: * ID of the action (used to remove it later) * + * Example: + * [bob, "Title", "DefaultAction", "condition", "execute", "conditionmenu", "executemenu", 5] call ace_common_fnc_addActionMenuEventHandler + * * Public: No */ #include "script_component.hpp" diff --git a/addons/common/functions/fnc_addCanInteractWithCondition.sqf b/addons/common/functions/fnc_addCanInteractWithCondition.sqf index 294dac1c72..7c2bc3591b 100644 --- a/addons/common/functions/fnc_addCanInteractWithCondition.sqf +++ b/addons/common/functions/fnc_addCanInteractWithCondition.sqf @@ -9,6 +9,9 @@ * Return Value: * None * + * Example: + * ["ID", {Condition}] call ace_common_fnc_addCanInteractWithCondition + * * Public: No */ #include "script_component.hpp" diff --git a/addons/common/functions/fnc_addLineToDebugDraw.sqf b/addons/common/functions/fnc_addLineToDebugDraw.sqf index f0a643e922..46f015c5e0 100644 --- a/addons/common/functions/fnc_addLineToDebugDraw.sqf +++ b/addons/common/functions/fnc_addLineToDebugDraw.sqf @@ -7,42 +7,41 @@ * 1: End point ASL * 2: Color * + * Return Value: * None * + * Example: + * [[0,0,0], [1,1,0], [1,0,0,1]] call ace_common_fnc_addLineToDebugDraw; + * * Public: No */ #include "script_component.hpp" +params ["_startASL", "_endASL", "_color"]; + if (isNil QGVAR(debugLines)) then { GVAR(debugLines) = []; GVAR(debugLinesIndex) = 0; }; if (count GVAR(debugLines) < 100) then { - GVAR(debugLines) pushBack _this; + GVAR(debugLines) pushBack [ASLtoAGL _startASL, ASLtoAGL _endASL, _color]; GVAR(debugLinesIndex) = 0; } else { - GVAR(debugLines) set [GVAR(debugLinesIndex), _this]; + GVAR(debugLines) set [GVAR(debugLinesIndex), [ASLtoAGL _startASL, ASLtoAGL _endASL, _color]]; GVAR(debugLinesIndex) = (GVAR(debugLinesIndex) + 1) mod 100; }; if (isNil QGVAR(debugDrawHandler)) then { GVAR(debugDrawHandler) = addMissionEventHandler ["Draw3D", { - if (count GVAR(debugLines) == 0) exitWith { + if (GVAR(debugLines) isEqualTo []) exitWith { removeMissionEventHandler ["Draw3D", GVAR(debugDrawHandler)]; GVAR(debugDrawHandler) = nil; }; { - _p0 = _x select 0; - if (!surfaceIsWater _p0) then { - _p0 = ASLtoATL _p0; - }; - _p1 = _x select 1; - if (!surfaceIsWater _p1) then { - _p1 = ASLtoATL _p1; - }; - drawLine3D [_p0, _p1, _x select 2]; + _x params ["_start", "_end", "_color"]; + drawLine3D [_start, _end, _color]; } forEach GVAR(debugLines); }]; }; diff --git a/addons/common/functions/fnc_addMapMarkerCreatedEventHandler.sqf b/addons/common/functions/fnc_addMapMarkerCreatedEventHandler.sqf index 2201426e48..1b82b9fedf 100644 --- a/addons/common/functions/fnc_addMapMarkerCreatedEventHandler.sqf +++ b/addons/common/functions/fnc_addMapMarkerCreatedEventHandler.sqf @@ -8,6 +8,9 @@ * Return Value: * ID of the event script (used to remove it later). * + * Example: + * ["bob"] call ace_common_fnc_addMapMarkerCreatedEventHandler + * * Public: Yes */ #include "script_component.hpp" diff --git a/addons/common/functions/fnc_addSetting.sqf b/addons/common/functions/fnc_addSetting.sqf index c4b97ddcce..0e5d391b1a 100644 --- a/addons/common/functions/fnc_addSetting.sqf +++ b/addons/common/functions/fnc_addSetting.sqf @@ -16,6 +16,9 @@ * Return Value: * None * + * Example: + * ["bob", "type", true, "bob", "person", [1,2,3], true, 5] call ace_common_fnc_addSettings + * * Public: No */ #include "script_component.hpp" diff --git a/addons/common/functions/fnc_addToInventory.sqf b/addons/common/functions/fnc_addToInventory.sqf index 187a218382..d7193cfd23 100644 --- a/addons/common/functions/fnc_addToInventory.sqf +++ b/addons/common/functions/fnc_addToInventory.sqf @@ -12,6 +12,9 @@ * 0: Added to player * 1: weaponholder * + * Example: + * [bob, "classname", "", 5] call ace_common_fnc_addToInventory + * * Public: Yes */ #include "script_component.hpp" @@ -20,7 +23,8 @@ params ["_unit", "_classname", ["_container", ""], ["_ammoCount", -1]]; private _type = _classname call FUNC(getItemType); -private ["_canAdd", "_addedToUnit"]; +private _canAdd = false; +private _addedToUnit = false; switch (_container) do { case "vest": { diff --git a/addons/common/functions/fnc_ambientBrightness.sqf b/addons/common/functions/fnc_ambientBrightness.sqf index 4ec2840e47..276d7aa5c3 100644 --- a/addons/common/functions/fnc_ambientBrightness.sqf +++ b/addons/common/functions/fnc_ambientBrightness.sqf @@ -8,6 +8,9 @@ * Return Value: * Ambient brightness * + * Example: + * [] call ace_common_fnc_ambientBrightness + * * Public: Yes */ #include "script_component.hpp" diff --git a/addons/common/functions/fnc_arithmeticGetResult.sqf b/addons/common/functions/fnc_arithmeticGetResult.sqf index d3fb67b1af..3dae9b23a0 100644 --- a/addons/common/functions/fnc_arithmeticGetResult.sqf +++ b/addons/common/functions/fnc_arithmeticGetResult.sqf @@ -8,7 +8,7 @@ * 2: Operation (sum, product, min, max, avg) * * Return Value: - * + * Value * * Example: * [ace_player, "ace_aimCoefficents", "product"] call ace_common_fnc_arithmeticGetResult diff --git a/addons/common/functions/fnc_arithmeticSetSource.sqf b/addons/common/functions/fnc_arithmeticSetSource.sqf index 1cb156bcc3..a11cb29527 100644 --- a/addons/common/functions/fnc_arithmeticSetSource.sqf +++ b/addons/common/functions/fnc_arithmeticSetSource.sqf @@ -9,7 +9,7 @@ * 3: Code that returns a number (can access var _namespace) [use {} to remove] * * Return Value: - * Nothing + * None * * Example: * [missionNameSpace, "ace_hearing", "myMission", {0.5}] call ace_common_fnc_arithmeticSetSource diff --git a/addons/common/functions/fnc_assignedItemFix.sqf b/addons/common/functions/fnc_assignedItemFix.sqf index 9a4ac5bf47..f7fe02f30c 100644 --- a/addons/common/functions/fnc_assignedItemFix.sqf +++ b/addons/common/functions/fnc_assignedItemFix.sqf @@ -8,7 +8,10 @@ * Return Value: * None * - * Public : No + * Example: + * call ace_common_fnc_assignedItemFix + * + * Public: No */ #include "script_component.hpp" diff --git a/addons/common/functions/fnc_binarizeNumber.sqf b/addons/common/functions/fnc_binarizeNumber.sqf index 0945afa770..82494e39d6 100644 --- a/addons/common/functions/fnc_binarizeNumber.sqf +++ b/addons/common/functions/fnc_binarizeNumber.sqf @@ -9,6 +9,9 @@ * Return Value: * Booleans * + * Example: + * [5, 5] call ace_common_fnc_binarizeNumber + * * Public: Yes */ #include "script_component.hpp" diff --git a/addons/common/functions/fnc_blurScreen.sqf b/addons/common/functions/fnc_blurScreen.sqf index 4a6c0d3cb4..0995c957d9 100644 --- a/addons/common/functions/fnc_blurScreen.sqf +++ b/addons/common/functions/fnc_blurScreen.sqf @@ -4,7 +4,7 @@ * * Arguments: * 0: ID - * 1: Show? + * 1: Show? * * Return Value: * None diff --git a/addons/common/functions/fnc_cachedCall.sqf b/addons/common/functions/fnc_cachedCall.sqf index c0b858e58a..8636ffff84 100644 --- a/addons/common/functions/fnc_cachedCall.sqf +++ b/addons/common/functions/fnc_cachedCall.sqf @@ -13,6 +13,9 @@ * Return Value: * Result of the function * + * Example: + * [[array]], {dothings}, NAMESPACE, "UID", 5, "clear"] call ace_common_fnc_cachedCall + * * Public: No */ #include "script_component.hpp" @@ -33,11 +36,12 @@ if ((_namespace getVariable [_uid, [-99999]]) select 0 < diag_tickTime) then { missionNamespace setVariable [_varName, _cacheList]; [_event, { - // _eventName is defined on the function that calls the event #ifdef DEBUG_MODE_FULL INFO_1("Clear cached variables on event: %1",_eventName); #endif // Get the list of caches to clear + //IGNORE_PRIVATE_WARNING ["_eventName"]; + // _eventName is defined on the function that calls the event private _varName = format [QGVAR(clearCache_%1), _eventName]; private _cacheList = missionNamespace getVariable [_varName, []]; // Erase all the cached results diff --git a/addons/common/functions/fnc_canDig.sqf b/addons/common/functions/fnc_canDig.sqf new file mode 100644 index 0000000000..8fe157becd --- /dev/null +++ b/addons/common/functions/fnc_canDig.sqf @@ -0,0 +1,31 @@ +/* + * Author: Ruthberg, commy2 + * Checks if the player can dig on the surface below (enough dust). + * + * Arguments: + * 0: Unit + * + * Return Value: + * Can Dig + * + * Example: + * [ACE_player] call ace_common_fnc_canDig + * + * Public: No + */ +#include "script_component.hpp" + +params ["_unit"]; + +private _posASL = getPosASL _unit; + +if ((getPosATL _unit) select 2 > 0.05 || // Walking on objects, such as buildings, pavements, etc. + {surfaceIsWater _posASL} // posATL in low water (not as low to allow awalking) is negative +) exitWith {false}; + +private _surfaceClass = (surfaceType _posASL) select [1]; +private _surfaceType = getText (configFile >> "CfgSurfaces" >> _surfaceClass >> "soundEnviron"); +private _surfaceDust = getNumber (configFile >> "CfgSurfaces" >> _surfaceClass >> "dust"); +TRACE_2("Surface",_surfaceType,_surfaceDust); + +!(_surfaceType in DIG_SURFACE_BLACKLIST) && {(_surfaceDust >= 0.1) || {_surfaceType in DIG_SURFACE_WHITELIST}} diff --git a/addons/common/functions/fnc_canGetInPosition.sqf b/addons/common/functions/fnc_canGetInPosition.sqf index c470337d6a..c0379c861a 100644 --- a/addons/common/functions/fnc_canGetInPosition.sqf +++ b/addons/common/functions/fnc_canGetInPosition.sqf @@ -7,12 +7,14 @@ * 1: The vehicle to be entered * 2: Position. Can be "Driver", "Pilot", "Gunner", "Commander", "Copilot", "Turret", "FFV", "Codriver" or "Cargo" * 3: Check current distance to vehicles memory point? (default: false) - * 4: Index. "Turret", "FFV", "Codriver" and "Cargo" support this optional parameter. Which position should be taken. - * Note: This index is diffrent from Armas "cargoIndex". (default: next free index) + * 4: Index. "Turret", "FFV", "Codriver" and "Cargo" support this optional parameter. Which position should be taken. Note: This index is different from Armas "cargoIndex". (default: next free index) * * Return Value: * None * + * Example: + * [bob, car, "Pilot", true, "Turret"] call ace_common_fnc_canGetInPosition + * * Public: No */ #include "script_component.hpp" diff --git a/addons/common/functions/fnc_canInteractWith.sqf b/addons/common/functions/fnc_canInteractWith.sqf index 7603452965..a94ba6d9d1 100644 --- a/addons/common/functions/fnc_canInteractWith.sqf +++ b/addons/common/functions/fnc_canInteractWith.sqf @@ -8,7 +8,10 @@ * 2: Exceptions. What general conditions are to skip? (default: []) * * Return Value: - * Unit can interact? + * Unit can interact? + * + * Example: + * [bob, target, []] call ace_common_fnc_canInteractWith * * Public: Yes */ diff --git a/addons/common/functions/fnc_changeProjectileDirection.sqf b/addons/common/functions/fnc_changeProjectileDirection.sqf index 89a8988306..6e42ee332a 100644 --- a/addons/common/functions/fnc_changeProjectileDirection.sqf +++ b/addons/common/functions/fnc_changeProjectileDirection.sqf @@ -11,6 +11,9 @@ * Return Value: * None * + * Example: + * [bullet, 2, 5, 3] call ace_common_fnc_changeProjectileDirection + * * Public: No */ #include "script_component.hpp" diff --git a/addons/common/functions/fnc_checkFiles.sqf b/addons/common/functions/fnc_checkFiles.sqf index a3ad83459b..480cdab9a9 100644 --- a/addons/common/functions/fnc_checkFiles.sqf +++ b/addons/common/functions/fnc_checkFiles.sqf @@ -8,6 +8,9 @@ * Return Value: * None * + * Example: + * call ace_common_fnc_checkFiles + * * Public: No */ #include "script_component.hpp" @@ -41,18 +44,29 @@ private _addons = "true" configClasses (configFile >> "CfgPatches");// _addons = _addons apply {toLower configName _x};// _addons = _addons select {_x find "ace_" == 0}; +private _oldCompats = []; { if (getText (configFile >> "CfgPatches" >> _x >> "versionStr") != _version) then { private _errorMsg = format ["File %1.pbo is outdated.", _x]; ERROR(_errorMsg); - if (hasInterface) then { - ["[ACE] ERROR", _errorMsg, {findDisplay 46 closeDisplay 0}] call FUNC(errorMessage); + if ((_x select [0, 10]) != "ace_compat") then { + if (hasInterface) then { + ["[ACE] ERROR", _errorMsg, {findDisplay 46 closeDisplay 0}] call FUNC(errorMessage); + }; + } else { + _oldCompats pushBack _x; // Don't block game if it's just an old compat pbo }; }; false } count _addons; +if (!(_oldCompats isEqualTo [])) then { + [{ + // Lasts for ~10 seconds + ERROR_WITH_TITLE_1("The following ACE compatiblity PBOs are outdated", "%1", _this); + }, _oldCompats, 1] call CBA_fnc_waitAndExecute; +}; /////////////// // check dlls @@ -111,7 +125,7 @@ if (isMultiplayer) then { _addons = _addons - GVAR(ServerAddons); if !(_addons isEqualTo []) then { - _errorMsg = format ["Client/Server Addon Mismatch. Client has extra addons: %1.",_addons]; + private _errorMsg = format ["Client/Server Addon Mismatch. Client has extra addons: %1.",_addons]; ERROR(_errorMsg); diff --git a/addons/common/functions/fnc_checkPBOs.sqf b/addons/common/functions/fnc_checkPBOs.sqf index 886ae3b5ca..2504d73dc1 100644 --- a/addons/common/functions/fnc_checkPBOs.sqf +++ b/addons/common/functions/fnc_checkPBOs.sqf @@ -14,6 +14,9 @@ * Return Value: * None * + * Example: + * [0, false, ""] call ace_common_fnc_checkPBOs + * * Public: Yes */ #include "script_component.hpp" diff --git a/addons/common/functions/fnc_claim.sqf b/addons/common/functions/fnc_claim.sqf index b3fe3d5544..79237d725b 100644 --- a/addons/common/functions/fnc_claim.sqf +++ b/addons/common/functions/fnc_claim.sqf @@ -10,6 +10,9 @@ * Return Value: * None * + * Example: + * [bob, flag, true] call ace_common_fnc_claim + * * Public: No */ #include "script_component.hpp" diff --git a/addons/common/functions/fnc_codeToString.sqf b/addons/common/functions/fnc_codeToString.sqf index 62e4cb5698..ff4597f7bb 100644 --- a/addons/common/functions/fnc_codeToString.sqf +++ b/addons/common/functions/fnc_codeToString.sqf @@ -8,6 +8,9 @@ * Return Value: * Code * + * Example: + * ["bob"] call ace_common_fnc_codeToString + * * Public: Yes */ #include "script_component.hpp" diff --git a/addons/common/functions/fnc_createOrthonormalReference.sqf b/addons/common/functions/fnc_createOrthonormalReference.sqf index e45bf269aa..cb443de15b 100644 --- a/addons/common/functions/fnc_createOrthonormalReference.sqf +++ b/addons/common/functions/fnc_createOrthonormalReference.sqf @@ -2,7 +2,7 @@ * Author: esteldunedain * Returns a orthonormal system of reference aligned with the supplied vector * - * Arguments: + * Arguments: * Vector to align the coordinate system with * * Return Value: @@ -10,6 +10,9 @@ * 1: Normalized Cross Product Vector * 2: Vector Cross Product * + * Example: + * [[0,0,0]] call ace_common_fnc_createOrthonormalReference + * * Public: Yes */ #include "script_component.hpp" diff --git a/addons/common/functions/fnc_currentChannel.sqf b/addons/common/functions/fnc_currentChannel.sqf index a78e2b0204..0844ebd881 100644 --- a/addons/common/functions/fnc_currentChannel.sqf +++ b/addons/common/functions/fnc_currentChannel.sqf @@ -8,6 +8,9 @@ * Return Value: * The current channel ("group", "side", "global", "command", "vehicle", "direct", "custom_X") * + * Example: + * [] call ace_common_fnc_currentChannel + * * Public: Yes */ #include "script_component.hpp" diff --git a/addons/common/functions/fnc_debug.sqf b/addons/common/functions/fnc_debug.sqf index 019ce2abff..a825c82523 100644 --- a/addons/common/functions/fnc_debug.sqf +++ b/addons/common/functions/fnc_debug.sqf @@ -9,6 +9,9 @@ * Return Value: * Message is Printed * + * Example: + * [bob, 2] call ace_common_fnc_debug + * * Public: Yes */ #include "script_component.hpp" diff --git a/addons/common/functions/fnc_debugModule.sqf b/addons/common/functions/fnc_debugModule.sqf index 125887183e..c4fa7b8547 100644 --- a/addons/common/functions/fnc_debugModule.sqf +++ b/addons/common/functions/fnc_debugModule.sqf @@ -8,6 +8,9 @@ * Return Value: * None * + * Example: + * call ace_common_fnc_debugModule + * * Public: No */ #include "script_component.hpp" diff --git a/addons/common/functions/fnc_defineVariable.sqf b/addons/common/functions/fnc_defineVariable.sqf index 35a1e96d31..7c1a694aeb 100644 --- a/addons/common/functions/fnc_defineVariable.sqf +++ b/addons/common/functions/fnc_defineVariable.sqf @@ -13,6 +13,9 @@ * Return Value: * None * + * Example: + * ["bob", 1, true, "category", 1, true] call ace_common_fnc_defineVariable + * * Public: Yes */ #include "script_component.hpp" diff --git a/addons/common/functions/fnc_deviceKeyFindValidIndex.sqf b/addons/common/functions/fnc_deviceKeyFindValidIndex.sqf index 02135e59db..aeacf940cc 100644 --- a/addons/common/functions/fnc_deviceKeyFindValidIndex.sqf +++ b/addons/common/functions/fnc_deviceKeyFindValidIndex.sqf @@ -3,7 +3,7 @@ * Finds next valid index for the device array. * * Arguments: - * 0: Offset from currentIndex (use 1 to find next valid after current) or a displayName string (default: 0) + * 0: Offset from currentIndex (use 1 to find next valid after current) or a displayName string (default: 0) * * Return Value: * The new index (-1 if no valid) @@ -28,7 +28,7 @@ if (_searchOffsetOrName isEqualType "") then { } forEach GVAR(deviceKeyHandlingArray); } else { if (count GVAR(deviceKeyHandlingArray) > 0) then { - _baseIndex = [GVAR(deviceKeyCurrentIndex) + _searchOffsetOrName, 0] select (GVAR(deviceKeyCurrentIndex) == -1); + private _baseIndex = [GVAR(deviceKeyCurrentIndex) + _searchOffsetOrName, 0] select (GVAR(deviceKeyCurrentIndex) == -1); for "_offset" from _baseIndex to (count GVAR(deviceKeyHandlingArray) - 1 + _baseIndex) do { private _realIndex = _offset % (count GVAR(deviceKeyHandlingArray)); diff --git a/addons/common/functions/fnc_disableUserInput.sqf b/addons/common/functions/fnc_disableUserInput.sqf index 8e28edc5f0..729da9b504 100644 --- a/addons/common/functions/fnc_disableUserInput.sqf +++ b/addons/common/functions/fnc_disableUserInput.sqf @@ -8,6 +8,9 @@ * Return Value: * None * + * Example: + * [true] call ace_common_fnc_disableUserInput + * * Public: No */ #include "script_component.hpp" diff --git a/addons/common/functions/fnc_displayText.sqf b/addons/common/functions/fnc_displayText.sqf index ee22f6949a..fdd1f960d5 100644 --- a/addons/common/functions/fnc_displayText.sqf +++ b/addons/common/functions/fnc_displayText.sqf @@ -11,6 +11,9 @@ * Return Value: * None * + * Example: + * ["Message", true, 5, 2] call ace_common_fnc_displayText + * * Public: Yes */ #include "script_component.hpp" diff --git a/addons/common/functions/fnc_displayTextStructured.sqf b/addons/common/functions/fnc_displayTextStructured.sqf index e952fce9a4..ee2c6a9f3f 100644 --- a/addons/common/functions/fnc_displayTextStructured.sqf +++ b/addons/common/functions/fnc_displayTextStructured.sqf @@ -1,23 +1,25 @@ /* - * Author: commy2, Glowbal + * Author: commy2, Glowbal, GitHawk * Display a structured text. * * Arguments: * 0: Text * 1: Size of the textbox (default: 1.5) * 2: Target Unit. Will only display if target is the player controlled object (default: ACE_player) + * 3: Custom Width (default: 10) * * Return Value: * None * * Example: - * + * [["Test: %1", 123], 1.5] call ace_common_fnc_displayTextStructured + * ["wow", 1, ace_player, 3] call ace_common_fnc_displayTextStructured * * Public: Yes */ #include "script_component.hpp" -params [["_text", ""], ["_size", 1.5, [0]], ["_target", ACE_player, [objNull]]]; +params [["_text", ""], ["_size", 1.5, [0]], ["_target", ACE_player, [objNull]], ["_width", 10, [0]]]; if (_target != ACE_player) exitWith {}; @@ -55,9 +57,9 @@ private _wPos = profilenamespace getVariable ["IGUI_GRID_ACE_displayText_W", (10 private _hPos = profilenamespace getVariable ["IGUI_GRID_ACE_displayText_H", (2 *((((safezoneW / safezoneH) min 1.2) / 1.2) / 25))]; */ -private _xPos = ((safezoneX + safezoneW) - (10 *(((safezoneW / safezoneH) min 1.2) / 40)) - 2.9 *(((safezoneW / safezoneH) min 1.2) / 40)); +private _xPos = ((safezoneX + safezoneW) - (_width *(((safezoneW / safezoneH) min 1.2) / 40)) - 2.9 *(((safezoneW / safezoneH) min 1.2) / 40)); private _yPos = safeZoneY + 0.175 * safezoneH; -private _wPos = (10 *(((safezoneW / safezoneH) min 1.2) / 40)); +private _wPos = (_width *(((safezoneW / safezoneH) min 1.2) / 40)); private _hPos = (2 *((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)); // Zeus Interface Open and Display would be under the "CREATE" list diff --git a/addons/common/functions/fnc_dropBackpack.sqf b/addons/common/functions/fnc_dropBackpack.sqf index b0d77af7d5..dcbb9a3f70 100644 --- a/addons/common/functions/fnc_dropBackpack.sqf +++ b/addons/common/functions/fnc_dropBackpack.sqf @@ -8,6 +8,9 @@ * Return Value: * Ground wepaon holder with backpack * + * Example: + * [unit] call ace_common_fnc_dropBackpack + * * Public: Yes */ #include "script_component.hpp" diff --git a/addons/common/functions/fnc_dummy.sqf b/addons/common/functions/fnc_dummy.sqf new file mode 100644 index 0000000000..a70fed35c0 --- /dev/null +++ b/addons/common/functions/fnc_dummy.sqf @@ -0,0 +1,12 @@ +/* + * Author: SilentSpike + * A dummy function which does nothing. Can be useful. + * + * Arguments: + * None + * + * Return Value: + * None + * + * Public: No + */ diff --git a/addons/common/functions/fnc_dumpArray.sqf b/addons/common/functions/fnc_dumpArray.sqf index b274f1119e..6c1caf7908 100644 --- a/addons/common/functions/fnc_dumpArray.sqf +++ b/addons/common/functions/fnc_dumpArray.sqf @@ -4,7 +4,7 @@ * * Arguments: * 0: Array to be dumped - * 1: Depth + * 1: Depth (default: 0) * * Return Value: * None diff --git a/addons/common/functions/fnc_dumpPerformanceCounters.sqf b/addons/common/functions/fnc_dumpPerformanceCounters.sqf index ec6f225ce4..a6bcc1d29c 100644 --- a/addons/common/functions/fnc_dumpPerformanceCounters.sqf +++ b/addons/common/functions/fnc_dumpPerformanceCounters.sqf @@ -8,6 +8,9 @@ * Return Value: * None * + * Example: + * call ace_common_fnc_dumpPerformanceCounters + * * Public: No */ #include "script_component.hpp" diff --git a/addons/common/functions/fnc_endRadioTransmission.sqf b/addons/common/functions/fnc_endRadioTransmission.sqf index 4597426d67..ead1ec29c6 100644 --- a/addons/common/functions/fnc_endRadioTransmission.sqf +++ b/addons/common/functions/fnc_endRadioTransmission.sqf @@ -9,6 +9,9 @@ * Return Value: * None * + * Example: + * call ace_common_fnc_endRadioTransmission + * * Public: No */ #include "script_component.hpp" diff --git a/addons/common/functions/fnc_eraseCache.sqf b/addons/common/functions/fnc_eraseCache.sqf index ae988ced28..0bcfab1dd4 100644 --- a/addons/common/functions/fnc_eraseCache.sqf +++ b/addons/common/functions/fnc_eraseCache.sqf @@ -9,6 +9,9 @@ * Return Value: * None * + * Example: + * [NAMESPACE, "UID"] call ace_common_fnc_eraseCache + * * Public: No */ #include "script_component.hpp" diff --git a/addons/common/functions/fnc_errorMessage.sqf b/addons/common/functions/fnc_errorMessage.sqf index 88e0a3b90f..8ccd7c22fb 100644 --- a/addons/common/functions/fnc_errorMessage.sqf +++ b/addons/common/functions/fnc_errorMessage.sqf @@ -8,6 +8,9 @@ * Return Value: * None * + * Example: + * call ace_common_fnc_errorMessage + * * Public: No */ #include "script_component.hpp" diff --git a/addons/common/functions/fnc_findUnloadPosition.sqf b/addons/common/functions/fnc_findUnloadPosition.sqf index c3b0dc3f34..85818cbda1 100644 --- a/addons/common/functions/fnc_findUnloadPosition.sqf +++ b/addons/common/functions/fnc_findUnloadPosition.sqf @@ -1,20 +1,20 @@ /* * Author: PabstMirror, ViperMaul - * Find a safe place near a vehicle to unload something - * Handles Normal Terrain, In Water or On Buildings (Pier, StaticShip) + * Find a safe place near a vehicle to unload something. + * Handles Normal Terrain, In Water or On Buildings (Pier, StaticShip). * * Arguments: * 0: Source Vehicle * 1: Cargo Classname - * 2: Unloader (player) - * 3: Max Distance (meters) - * 4: Check Vehicle is Stable + * 2: Unloader (player) (default: objNull) + * 3: Max Distance (meters) (default: 10) + * 4: Check Vehicle is Stable (default: true) * * Return Value: - * Unload PositionAGL (Can Be [] if no valid pos found) + * Unload PositionAGL (can Be [] if no valid pos found) * * Example: - * [theCar, "CAManBase", player, 10, true] call ace_common_fnc_findUnloadPosition; + * [theCar, "CAManBase", player, 10, true] call ace_common_fnc_findUnloadPosition * * Public: No */ diff --git a/addons/common/functions/fnc_firedEH.sqf b/addons/common/functions/fnc_firedEH.sqf index 29e58a4c6a..cbf49f626b 100644 --- a/addons/common/functions/fnc_firedEH.sqf +++ b/addons/common/functions/fnc_firedEH.sqf @@ -14,6 +14,9 @@ * Return Value: * None * + * Example: + * [bob, "gun", "muzzle", "single", "ammo", "magazine", "bullet"] call ace_common_fnc_firedEH + * * Public: No */ #include "script_component.hpp" diff --git a/addons/common/functions/fnc_fixCollision.sqf b/addons/common/functions/fnc_fixCollision.sqf index 3b3b16a9f9..569d7d1e87 100644 --- a/addons/common/functions/fnc_fixCollision.sqf +++ b/addons/common/functions/fnc_fixCollision.sqf @@ -8,6 +8,9 @@ * Return Value: * None * + * Example: + * [bob] call ace_common_fnc_fixCollision + * * Public: No */ #include "script_component.hpp" diff --git a/addons/common/functions/fnc_fixFloating.sqf b/addons/common/functions/fnc_fixFloating.sqf index 5a00aa3863..dc7608f9fe 100644 --- a/addons/common/functions/fnc_fixFloating.sqf +++ b/addons/common/functions/fnc_fixFloating.sqf @@ -9,6 +9,9 @@ * Return Value: * None * + * Example: + * [object] call ace_common_fnc_fixFloating + * * Public: No */ #include "script_component.hpp" diff --git a/addons/common/functions/fnc_fixLoweredRifleAnimation.sqf b/addons/common/functions/fnc_fixLoweredRifleAnimation.sqf index 9e230b00ad..f804b087d2 100644 --- a/addons/common/functions/fnc_fixLoweredRifleAnimation.sqf +++ b/addons/common/functions/fnc_fixLoweredRifleAnimation.sqf @@ -6,7 +6,7 @@ * 0: Unit * * Return Value: - * Nothing + * None * * Example: * [ACE_player] call ace_common_fnc_fixLoweredRifleAnimation diff --git a/addons/common/functions/fnc_fixPosition.sqf b/addons/common/functions/fnc_fixPosition.sqf index 883a502c4e..b00c08f25a 100644 --- a/addons/common/functions/fnc_fixPosition.sqf +++ b/addons/common/functions/fnc_fixPosition.sqf @@ -1,6 +1,5 @@ /* - * Author: commy2 - * + * Author: commy2, Jonpas * Fixes position of an object. E.g. moves object above ground and adjusts to terrain slope. Requires local object. * * Arguments: @@ -9,6 +8,9 @@ * Return Value: * None * + * Example: + * bob call ace_common_fnc_fixPosition + * * Public: No */ #include "script_component.hpp" @@ -16,25 +18,28 @@ // setVectorUp requires local object if (!local _this) exitWith {}; -if ((getText (configFile >> "CfgVehicles" >> (typeOf _this) >> "simulation")) == "house") then { - //Houses don't have gravity/physics, so make sure they are not floating - private _posAbove = (getPos _this) select 2; +// Objects with disabled simulation and objects with simulation type "house" don't have gravity/physics, so make sure they are not floating +private _hasGravity = simulationEnabled _this && {!(getText (configFile >> "CfgVehicles" >> typeOf _this >> "simulation") == "house")}; + +if (!_hasGravity) then { + private _posAbove = (getPosATL _this) select 2; TRACE_2("house",_this,_posAbove); if (_posAbove > 0.1) then { - private _newPosASL = (getPosASL _this) vectorDiff [0,0,_posAbove]; - _this setPosASL _newPosASL; + private _newPosATL = (getPosATL _this) vectorDiff [0, 0, _posAbove]; + _this setPosATL _newPosATL; }; }; -private _position = getPos _this; +private _position = getPosATL _this; -// don't place the object below the ground +// Don't place the object below the ground if (_position select 2 < -0.1) then { _position set [2, -0.1]; - _this setPos _position; + _this setPosATL _position; }; -// adjust position to sloped terrain, if placed on ground -if (getPosATL _this select 2 == _position select 2) then { +// Adjust position to sloped terrain, if placed on ground +// Object without gravity/physics may have negative height when placed on slope, but those objects are definitely on the ground +if (!_hasGravity || {getPosATL _this select 2 == _position select 2}) then { _this setVectorUp surfaceNormal _position; }; diff --git a/addons/common/functions/fnc_getAllDefinedSetVariables.sqf b/addons/common/functions/fnc_getAllDefinedSetVariables.sqf index a5d973767f..fd94ae8024 100644 --- a/addons/common/functions/fnc_getAllDefinedSetVariables.sqf +++ b/addons/common/functions/fnc_getAllDefinedSetVariables.sqf @@ -14,6 +14,9 @@ * 3: publicFlag * 4: peristentFlag * + * Example: + * [bob, ""] call ace_common_fnc_getAllDefinedSetVariables + * * Public: Yes */ #include "script_component.hpp" diff --git a/addons/common/functions/fnc_getChildren.sqf b/addons/common/functions/fnc_getChildren.sqf index f2930b015d..56bc5d779c 100644 --- a/addons/common/functions/fnc_getChildren.sqf +++ b/addons/common/functions/fnc_getChildren.sqf @@ -7,6 +7,9 @@ * * Return Value: * Parent Entry Class Children + + * Example: + * [bob] call ace_common_fnc_getChildren * * Public: Yes */ diff --git a/addons/common/functions/fnc_getConfigCommander.sqf b/addons/common/functions/fnc_getConfigCommander.sqf index d4a53905b8..45d7d6389c 100644 --- a/addons/common/functions/fnc_getConfigCommander.sqf +++ b/addons/common/functions/fnc_getConfigCommander.sqf @@ -7,6 +7,9 @@ * * Return Value: * Commander config + + * Example: + * [car] call ace_common_fnc_getConfigCommander * * Public: Yes */ diff --git a/addons/common/functions/fnc_getConfigGunner.sqf b/addons/common/functions/fnc_getConfigGunner.sqf index abbbd5f014..c14eb85ed5 100644 --- a/addons/common/functions/fnc_getConfigGunner.sqf +++ b/addons/common/functions/fnc_getConfigGunner.sqf @@ -8,6 +8,9 @@ * Return Value: * Gunner config * + * Example: + * [car] call ace_common_fnc_getConfigGunner + * * Public: Yes */ #include "script_component.hpp" diff --git a/addons/common/functions/fnc_getDefinedVariable.sqf b/addons/common/functions/fnc_getDefinedVariable.sqf index 32a75edb5e..98267ab18f 100644 --- a/addons/common/functions/fnc_getDefinedVariable.sqf +++ b/addons/common/functions/fnc_getDefinedVariable.sqf @@ -9,6 +9,9 @@ * Return Value: * Value of variable or default value, if the variable is undefined * + * Example: + * [bob, "var"] call ace_common_fnc_getDefinedVariable + * * Public: No */ #include "script_component.hpp" diff --git a/addons/common/functions/fnc_getDefinedVariableDefault.sqf b/addons/common/functions/fnc_getDefinedVariableDefault.sqf index c6f4f7711c..88199f8ad3 100644 --- a/addons/common/functions/fnc_getDefinedVariableDefault.sqf +++ b/addons/common/functions/fnc_getDefinedVariableDefault.sqf @@ -8,6 +8,9 @@ * Return Value: * Default value of variable * + * Example: + * ["name"] call ace_common_fnc_getDefinedVariableDefault + * * Public: Yes */ #include "script_component.hpp" diff --git a/addons/common/functions/fnc_getDefinedVariableInfo.sqf b/addons/common/functions/fnc_getDefinedVariableInfo.sqf index adcb70c6ee..e22ba193f6 100644 --- a/addons/common/functions/fnc_getDefinedVariableInfo.sqf +++ b/addons/common/functions/fnc_getDefinedVariableInfo.sqf @@ -8,6 +8,9 @@ * Return Value: * Variable Metadata * + * Example: + * ["var"] call ace_common_fnc_getDefinedVariableInfo + * * Public: No */ #include "script_component.hpp" diff --git a/addons/common/functions/fnc_getDisplayConfigName.sqf b/addons/common/functions/fnc_getDisplayConfigName.sqf index 1660bbf804..d61800e5ce 100644 --- a/addons/common/functions/fnc_getDisplayConfigName.sqf +++ b/addons/common/functions/fnc_getDisplayConfigName.sqf @@ -8,6 +8,9 @@ * Return Value: * Display Classnames * + * Example: + * [5] call ace_common_fnc_getDisplayConfigName + * * Public: Yes * * Note: Really slow due to iteration through whole config. Meant for debugging. diff --git a/addons/common/functions/fnc_getDoorTurrets.sqf b/addons/common/functions/fnc_getDoorTurrets.sqf index 533e2a7489..cfb0369d63 100644 --- a/addons/common/functions/fnc_getDoorTurrets.sqf +++ b/addons/common/functions/fnc_getDoorTurrets.sqf @@ -8,6 +8,9 @@ * Return Value: * All turret indecies of the Vehicle * + * Example: + * [car] call ace_common_fnc_getDoorTurrets + * * Public: Yes */ #include "script_component.hpp" @@ -23,7 +26,7 @@ private _doorTurrets = []; _config = [_config, _x] call FUNC(getTurretConfigPath); - if (getNumber (_config >> "isCopilot" == 0) && {count getArray (_config >> "weapons") > 0}) then { + if (((getNumber (_config >> "isCopilot")) == 0) && {count getArray (_config >> "weapons") > 0}) then { _doorTurrets pushBack _x; }; false diff --git a/addons/common/functions/fnc_getFirstObjectIntersection.sqf b/addons/common/functions/fnc_getFirstObjectIntersection.sqf index c4cc46ab9b..951f48ad16 100644 --- a/addons/common/functions/fnc_getFirstObjectIntersection.sqf +++ b/addons/common/functions/fnc_getFirstObjectIntersection.sqf @@ -11,6 +11,9 @@ * 0: Intersects * 1: Intersection Position ASL * + * Example: + * [[1,2,3], [0,0,5], 5] call ace_common_fnc_getFirstObjectIntersection + * * Public: Yes */ #include "script_component.hpp" diff --git a/addons/common/functions/fnc_getFirstTerrainIntersection.sqf b/addons/common/functions/fnc_getFirstTerrainIntersection.sqf index 27a6f3c613..cfb2397c95 100644 --- a/addons/common/functions/fnc_getFirstTerrainIntersection.sqf +++ b/addons/common/functions/fnc_getFirstTerrainIntersection.sqf @@ -11,6 +11,9 @@ * 0: Intersects * 1: Intersection Position ASL * + * Example: + * [[1,2,3], [0,0,5], 5] call ace_common_fnc_getFirstTerrainIntersection + * * Public: Yes */ #include "script_component.hpp" diff --git a/addons/common/functions/fnc_getGunner.sqf b/addons/common/functions/fnc_getGunner.sqf index c11f2882ca..85f4cef199 100644 --- a/addons/common/functions/fnc_getGunner.sqf +++ b/addons/common/functions/fnc_getGunner.sqf @@ -9,6 +9,9 @@ * Return Value: * Gunner * + * Example: + * [car, "gun"] call ace_common_fnc_getGunner + * * Public: Yes */ #include "script_component.hpp" diff --git a/addons/common/functions/fnc_getInPosition.sqf b/addons/common/functions/fnc_getInPosition.sqf index 5d6e5d71b5..a19a150704 100644 --- a/addons/common/functions/fnc_getInPosition.sqf +++ b/addons/common/functions/fnc_getInPosition.sqf @@ -1,16 +1,19 @@ /* * Author: commy2 * Move unit into given vehicle position or switch to that position if the unit is already inside the vehicle. - * - * Arguments: + * + * Arguments: * 0: Unit * 1: Vehicle * 2: Position ("Driver", "Pilot", "Gunner", "Commander", "Copilot", "Turret", "FFV", "Codriver", "Cargo") * 3: Index (only applies to "Turret", "FFV", "Codriver", "Cargo") (default: next free index) - * - * Return Value: + * + * Return Value: * None * + * Example: + * [unit, vehicle, "Driver", 5] call ace_common_fnc_getInPosition + * * Public: Yes */ #include "script_component.hpp" diff --git a/addons/common/functions/fnc_getItemType.sqf b/addons/common/functions/fnc_getItemType.sqf index eb5015e20a..33d9d267e4 100644 --- a/addons/common/functions/fnc_getItemType.sqf +++ b/addons/common/functions/fnc_getItemType.sqf @@ -9,6 +9,9 @@ * 0: Type ("weapon", "item", "magazine", "") * 1: Item Description * + * Example: + * ["tire"] call ace_common_fnc_getItemType + * * Public: Yes */ #include "script_component.hpp" diff --git a/addons/common/functions/fnc_getLightProperties.sqf b/addons/common/functions/fnc_getLightProperties.sqf index a376dff841..ffaddfaf87 100644 --- a/addons/common/functions/fnc_getLightProperties.sqf +++ b/addons/common/functions/fnc_getLightProperties.sqf @@ -13,6 +13,9 @@ * 3: Light inner angle * 4: Light outer angle * + * Example: + * [car, "light"] call ace_common_fnc_getLightProperties + * * Public: Yes */ #include "script_component.hpp" diff --git a/addons/common/functions/fnc_getLightPropertiesWeapon.sqf b/addons/common/functions/fnc_getLightPropertiesWeapon.sqf index 44c866e67f..dfcd483304 100644 --- a/addons/common/functions/fnc_getLightPropertiesWeapon.sqf +++ b/addons/common/functions/fnc_getLightPropertiesWeapon.sqf @@ -12,6 +12,9 @@ * 3: Light inner angle * 4: Light outer angle * + * Example: + * ["flashlight"] call ace_common_fnc_getLightPropertiesWeapon + * * Public: Yes */ #include "script_component.hpp" diff --git a/addons/common/functions/fnc_getMGRSdata.sqf b/addons/common/functions/fnc_getMGRSdata.sqf index 6b29b6625a..4b4906aba3 100644 --- a/addons/common/functions/fnc_getMGRSdata.sqf +++ b/addons/common/functions/fnc_getMGRSdata.sqf @@ -12,6 +12,9 @@ * 1: 100km square * 2: GZD + 100km sq. as a single string * + * Example: + * ["worldName"] call ace_common_fnc_getMGRSdata + * * Public: No */ #include "script_component.hpp" @@ -19,15 +22,15 @@ params [["_map", worldName]]; private _long = getNumber (configFile >> "CfgWorlds" >> _map >> "longitude"); -private _lat = getNumber (configFile >> "CfgWorlds" >> _map >> "latitude"); +private _lat = -1 * getNumber (configFile >> "CfgWorlds" >> _map >> "latitude"); // latitude is reversed in arma (negative config values in north) private _altitude = getNumber (configFile >> "CfgWorlds" >> _map >> "elevationOffset"); private _mapData = _map call FUNC(getMapData); if (!(_mapData isEqualTo [])) then { _lat = _mapData select 0; - _alt = _mapData select 1; + _altitude = _mapData select 1; }; -TRACE_2("Latitude and Altitude",_lat,_alt); +TRACE_2("Latitude and Altitude",_lat,_altitude); private _UTM = [_long, _lat] call BIS_fnc_posDegToUTM; private _easting = _UTM select 0; diff --git a/addons/common/functions/fnc_getMapData.sqf b/addons/common/functions/fnc_getMapData.sqf index 7d7bef817f..b4cb56d75f 100644 --- a/addons/common/functions/fnc_getMapData.sqf +++ b/addons/common/functions/fnc_getMapData.sqf @@ -9,6 +9,9 @@ * 0: Latitude * 1: Altitude * + * Example: + * ["altis"] call ace_common_fnc_getMapData + * * Public: No */ @@ -21,72 +24,91 @@ _map = toLower _map; if (_map in ["tanoa"]) exitWith { [-18, 0] }; if (_map in ["altis"]) exitWith { [40, 0] }; if (_map in ["stratis"]) exitWith { [40, 0] }; +if (_map in ["malden", "abel"]) exitWith { [38.8, 0] }; // 1.72 Malden and CWR2 Malden -if (_map in ["abbottabad"]) exitWith { [34, 1256] }; //Abbottabad elevation 1256m (Wikipedia) -if (_map in ["abel"]) exitWith { [39, 0] }; //CWR2 Malden +if (_map in ["abbottabad"]) exitWith { [34, 1256] }; // Abbottabad elevation 1256m (Wikipedia) if (_map in ["abramia"]) exitWith { [60, 0] }; if (_map in ["af_kandahar_province"]) exitWith { [42, 0] }; if (_map in ["angel"]) exitWith { [38, 0] }; if (_map in ["anim_helvantis_v2"]) exitWith { [50, 0] }; +if (_map in ["anim_starokovka"]) exitWith { [50, 0] }; if (_map in ["australia"]) exitWith { [-25, 0] }; +if (_map in ["baranow", "ivachev", "panavo", "staszow"]) exitWith { [50, 148.1] }; // IFA3LITE - default elevationOffset +if (_map in ["beketov"]) exitWith { [55, 0] }; +if (_map in ["blud_cordelia"]) exitWith { [12, 5] }; // Trung Si if (_map in ["bootcamp_acr"]) exitWith { [50, 0] }; if (_map in ["bornholm"]) exitWith { [55, 0] }; if (_map in ["bozcaada"]) exitWith { [40, 0] }; -if (_map in ["cain"]) exitWith { [40, 0] }; //CWR2 Kolgujev +if (_map in ["cain"]) exitWith { [40, 0] }; // CWR2 Kolgujev if (_map in ["caribou"]) exitWith { [68, 0] }; -if (_map in ["cartercity"]) exitWith { [43, 130] }; //Pecher, based on Grozny (1995 - 1996) elevation 130m (Wikipedia) +if (_map in ["cartercity"]) exitWith { [43, 130] }; // Pecher, based on Grozny (1995 - 1996) elevation 130m (Wikipedia) if (_map in ["catalina"]) exitWith { [33, 0] }; if (_map in ["chernarus", "chernarus_summer", "chernarus_winter"]) exitWith { [50, 0] }; if (_map in ["chernobylzone", "chernobylzonea2"]) exitWith { [51, 0] }; if (_map in ["clafghan"]) exitWith { [34, 640] }; -if (_map in ["dakrong"]) exitWith { [16, 0] }; //Unsung Mod +if (_map in ["colleville"]) exitWith { [49, 0] }; // IFA3LITE, Omaha Beach 1944 +if (_map in ["csj_lawlands", "uns_dong_ha"]) exitWith { [12, 0] }; // Unsung Mod +if (_map in ["csj_sea"]) exitWith { [15, 0] }; // Unsung Mod +if (_map in ["dakrong"]) exitWith { [16, 0] }; // Unsung Mod if (_map in ["desert_e"]) exitWith { [40, 800] }; -if (_map in ["desert_island"]) exitWith { [40, 0] }; //CWR2 Desert Island -if (_map in ["dya"]) exitWith { [34, 110] }; //Diyala Iraq - default elevationOffset -if (_map in ["eden"]) exitWith { [45, 0] }; //CWR2 Everon +if (_map in ["desert_island"]) exitWith { [40, 0] }; // CWR2 Desert Island +if (_map in ["dya"]) exitWith { [34, 110] }; // Diyala Iraq - default elevationOffset +if (_map in ["eden"]) exitWith { [45, 0] }; // CWR2 Everon if (_map in ["esseker"]) exitWith { [43, 2000] }; -if (_map in ["evergreen"]) exitWith { [41, 0] }; //Burgazada, Turkey - default elevationOffset +if (_map in ["evergreen"]) exitWith { [41, 0] }; // Burgazada, Turkey - default elevationOffset if (_map in ["fallujah"]) exitWith { [33, 0] }; if (_map in ["fata"]) exitWith { [33, 1347] }; if (_map in ["gorgona"]) exitWith { [43, 0] }; -if (_map in ["hellskitchen", "hellskitchens"]) exitWith { [32, 900] }; //Sangin summer, Sangin winter - Sangin elevation 888m (Wikipedia) +if (_map in ["hellskitchen", "hellskitchens"]) exitWith { [32, 900] }; // Sangin summer, Sangin winter - Sangin elevation 888m (Wikipedia) if (_map in ["hindukush"]) exitWith { [36, 0] }; +if (_map in ["i44_omaha_v2"]) exitWith { [49, 0] }; if (_map in ["imrali", "imralispring"]) exitWith { [40, 0] }; if (_map in ["intro"]) exitWith { [40, 0] }; if (_map in ["isladuala3"]) exitWith { [-19, 0] }; -if (_map in ["jacobi"]) exitWith { [34, 2000] }; //default elevationOffset +if (_map in ["jacobi"]) exitWith { [34, 2000] }; // default elevationOffset if (_map in ["kapaulio"]) exitWith { [0, 0] }; -if (_map in ["kerama"]) exitWith { [26, 0] }; //Kerama Islands, Japan - default elevationOffset +if (_map in ["kerama"]) exitWith { [26, 0] }; // Kerama Islands, Japan - default elevationOffset +if (_map in ["khe_sanh"]) exitWith { [17, 0] }; // Unsung Mod if (_map in ["kholm"]) exitWith { [36, 0] }; -if (_map in ["kidal"]) exitWith { [18, 0] }; //Kidal, Mali - default elevationOffset +if (_map in ["kidal"]) exitWith { [18, 0] }; // Kidal, Mali - default elevationOffset if (_map in ["koplic"]) exitWith { [42, 0] }; if (_map in ["kunduz"]) exitWith { [37, 0] }; -if (_map in ["lingor", "lingor3"]) exitWith { [-4, 0] }; +if (_map in ["lingor", "lingor3", "dingor"]) exitWith { [-4, 0] }; if (_map in ["lost", "lostw"]) exitWith { [60, 0] }; +if (_map in ["lythium"]) exitWith { [34, 0] }; if (_map in ["malvinas"]) exitWith { [-52, 0] }; +if (_map in ["marenice"]) exitWith { [51, 0] }; // CSA38 Mod (Czechoslovak army 1938 - Munich crisis), Lisatian Mountains. if (_map in ["mcn_aliabad"]) exitWith { [36, 0] }; +if (_map in ["mcn_neaville", "mcn_neaville_winter"]) exitWith { [45, 0] }; // I44: Neaville, I44: Neaville (Winter) if (_map in ["mef_alaska"]) exitWith { [60, 5] }; +if (_map in ["mog"]) exitWith { [2, 0] }; // Mogadishu, Somalia if (_map in ["mountains_acr"]) exitWith { [35, 2000] }; +if (_map in ["mske"]) exitWith { [35, 0] }; // MSKE 2017 +if (_map in ["nam2"]) exitWith { [14, 0] }; if (_map in ["namalsk"]) exitWith { [65, 0] }; if (_map in ["napf", "napfwinter"]) exitWith { [47, 0] }; -if (_map in ["newyork_lumnuon"]) exitWith { [41, 5] }; //Governer´s Island, New York - default elevationOffset -if (_map in ["noe"]) exitWith { [45, 0] }; //CWR2 Nogova -if (_map in ["panthera3"]) exitWith { [46, 0] }; -if (_map in ["pianosa_aut"]) exitWith { [43, 0] }; //Pianosa, Italy - default elevationOffset -if (_map in ["pja305"]) exitWith { [0, 0] }; //G.O.S N'Ziwasogo -if (_map in ["pja306"]) exitWith { [35, 0] }; //G.O.S Kalu Khan -if (_map in ["pja307"]) exitWith { [17, 0] }; //F.S.F Daryah -if (_map in ["pja308"]) exitWith { [36, 0] }; //G.O.S Gunkizli -if (_map in ["pja310"]) exitWith { [36, 0] }; //G.O.S Al Rayak -if (_map in ["pja312"]) exitWith { [16, 0] }; //G.O.S Song Bin Tanh +if (_map in ["newyork_lumnuon"]) exitWith { [41, 5] }; // Governer´s Island, New York - default elevationOffset +if (_map in ["noe"]) exitWith { [45, 0] }; // CWR2 Nogova +if (_map in ["panthera3", "winthera3"]) exitWith { [46, 0] }; +if (_map in ["phu_bai", "rockwall", "us101_cao_bang"]) exitWith { [14, 0] }; // Unsung Mod +if (_map in ["pianosa_aut"]) exitWith { [43, 0] }; // Pianosa, Italy - default elevationOffset +if (_map in ["pja305"]) exitWith { [0, 0] }; // G.O.S N'Ziwasogo +if (_map in ["pja306"]) exitWith { [35, 0] }; // G.O.S Kalu Khan +if (_map in ["pja307"]) exitWith { [17, 0] }; // F.S.F Daryah +if (_map in ["pja308"]) exitWith { [36, 0] }; // G.O.S Gunkizli +if (_map in ["pja310"]) exitWith { [36, 0] }; // G.O.S Al Rayak +if (_map in ["pja312"]) exitWith { [16, 0] }; // G.O.S Song Bin Tanh +if (_map in ["pja314"]) exitWith { [46, 0] }; // G.O.S Leskovets +if (_map in ["pja319"]) exitWith { [20, 0] }; // G.O.S N'Djenahoud, Ennedi Massif (Republic of Chad) +if (_map in ["plr_bulge"]) exitWith { [49, 0] }; // I44: Battle of the Bulge if (_map in ["porquerolles"]) exitWith { [43, 0] }; if (_map in ["porto"]) exitWith { [40, 0] }; if (_map in ["provinggrounds_pmc"]) exitWith { [35, 100] }; if (_map in ["reshmaan"]) exitWith { [35, 2000] }; -if (_map in ["rungsat"]) exitWith { [10, 0] }; //Unsung Mod +if (_map in ["rungsat"]) exitWith { [10, 0] }; // Unsung Mod if (_map in ["sara", "sara_dbe1"]) exitWith { [40, 0] }; if (_map in ["saralite"]) exitWith { [40, 0] }; -if (_map in ["sb3"]) exitWith { [53, 25] }; //TrpUebPl Einfelde Nord (Munster North Training Area, Germany) - default elevationOffset +if (_map in ["sb3"]) exitWith { [53, 25] }; // TrpUebPl Einfelde Nord (Munster North Training Area, Germany) - default elevationOffset if (_map in ["sfp_sturko"]) exitWith { [56, 0] }; if (_map in ["sfp_wamako"]) exitWith { [14, 0] }; if (_map in ["shapur_baf"]) exitWith { [35, 100] }; @@ -94,14 +116,17 @@ if (_map in ["sugarlake"]) exitWith { [29, 0] }; if (_map in ["takistan"]) exitWith { [35, 2000] }; if (_map in ["thirsk"]) exitWith { [65, 0] }; if (_map in ["tilos"]) exitWith { [36, 0] }; +if (_map in ["uhao"]) exitWith { [21, 0] }; +if (_map in ["uns_idv", "uns_ptv"]) exitWith { [13, 0] }; // Unsung Mod if (_map in ["utes"]) exitWith { [50, 0] }; -if (_map in ["vt5"]) exitWith { [61, 100] }; //Vt5, Suomi Finland - default elevationOffset +if (_map in ["vt5"]) exitWith { [61, 100] }; // Valtatie 5, Finland - default elevationOffset if (_map in ["wake"]) exitWith { [19, 0] }; if (_map in ["waziristan"]) exitWith { [33, 0] }; -if (_map in ["wintermap"]) exitWith { [61, 0] }; //Nordkvingo - default elevationOffset -if (_map in ["wintertown", "wintertowna3"]) exitWith { [39, 600] }; //U.S. state Kansas mean elevation 610m (Wikipedia) +if (_map in ["wintermap"]) exitWith { [61, 0] }; // Nordkvingo - default elevationOffset +if (_map in ["wintertown", "wintertowna3"]) exitWith { [39, 600] }; // U.S. state Kansas mean elevation 610m (Wikipedia) if (_map in ["woodland_acr"]) exitWith { [50, 0] }; if (_map in ["xcam_prototype"]) exitWith { [35, 0] }; +if (_map in ["xcam_taunus"]) exitWith { [50, 0] }; if (_map in ["zargabad"]) exitWith { [35, 2000] }; [] //Return empty array if we have no specific data for the map diff --git a/addons/common/functions/fnc_getMapGridData.sqf b/addons/common/functions/fnc_getMapGridData.sqf index bda9288635..a33e49e7d0 100644 --- a/addons/common/functions/fnc_getMapGridData.sqf +++ b/addons/common/functions/fnc_getMapGridData.sqf @@ -64,19 +64,17 @@ while {_startGrid == _originGrid} do { private _realOffsetY = (parseNumber (_originGrid select [count _formatX, count _formatY])) * _stepY + _heightOffset - 1; //Calculate MGRS 10digit step - they should both be 1 meter: -_stepXat5 = _stepX * 10 ^ ((count _formatX) - 5); -_stepYat5 = -1 * _stepY * 10 ^ ((count _formatY) - 5); +private _stepXat5 = _stepX * 10 ^ ((count _formatX) - 5); +private _stepYat5 = -1 * _stepY * 10 ^ ((count _formatY) - 5); if (_stepYat5 < 0) then { - WARNING_1("Map Grid Warning (%1) - Northing is reversed.",worldName); + TRACE_1("Northing is reversed",worldName); }; - if (_stepXat5 != 1) then { - WARNING_2("Map Grid Warning (%1) - MGRS 10 digit grid does not equal 1 meter: (%2) for x.",worldName,_stepXat5); + TRACE_2("MGRS 10 digit grid does not equal 1 meter",_stepXat5,worldName); }; - if (_stepYat5 != 1 && {_stepYat5 != -1}) then { - WARNING_2("Map Grid Warning (%1) - MGRS 10 digit grid does not equal 1 meter: (%2) for y.",worldName,_stepXat5); + TRACE_2("MGRS 10 digit grid does not equal 1 meter",_stepYat5,worldName); }; GVAR(mapGridData) = [_offsetX, _realOffsetY, _stepXat5, _stepYat5]; diff --git a/addons/common/functions/fnc_getMapPosFromGrid.sqf b/addons/common/functions/fnc_getMapPosFromGrid.sqf index a148679fa9..18599f4ef4 100644 --- a/addons/common/functions/fnc_getMapPosFromGrid.sqf +++ b/addons/common/functions/fnc_getMapPosFromGrid.sqf @@ -6,7 +6,7 @@ * 0: Grid Cords * 1: Grid center (true), Grid Bottom Right (false) (default: true) * - * Return values: + * Return Value: * Position * * Example: diff --git a/addons/common/functions/fnc_getMarkerType.sqf b/addons/common/functions/fnc_getMarkerType.sqf index 0da7f1a46e..3d5864cf08 100644 --- a/addons/common/functions/fnc_getMarkerType.sqf +++ b/addons/common/functions/fnc_getMarkerType.sqf @@ -3,11 +3,14 @@ * Get the apropriate marker for a group. * * Arguments: - * 0: Group + * 0: Group * * Return Value: * Marker Type * + * Example: + * ["GROUP"] call ace_common_fnc_getmarkerType + * * Public: No */ #include "script_component.hpp" diff --git a/addons/common/functions/fnc_getNumberMagazinesIn.sqf b/addons/common/functions/fnc_getNumberMagazinesIn.sqf index 87f92979eb..dd02d055e0 100644 --- a/addons/common/functions/fnc_getNumberMagazinesIn.sqf +++ b/addons/common/functions/fnc_getNumberMagazinesIn.sqf @@ -9,6 +9,9 @@ * Return Value: * Magazine amount * + * Example: + * [bob, "magazine"] call ace_common_fnc_getNumberMagazinesIn + * * Public: No */ #include "script_component.hpp" @@ -21,11 +24,14 @@ if (_unit isKindOf "CAManBase") then { _return = {_x == _magazine} count magazines _unit; } else { { - _return = _return + {_x == _magazine} count magazines _x; + _return = _return + ({_x == _magazine} count magazines _x); false } count crew _unit; - _return = _return + ({_x == _magazine} count getMagazineCargo _unit); + (getMagazineCargo _unit) params [["_magNames", []], ["_magCount", []]]; + { + if (_magazine == _x) exitWith {_return = _return + (_magCount select _forEachIndex)}; + } forEach _magNames; }; _return diff --git a/addons/common/functions/fnc_getPitchBankYaw.sqf b/addons/common/functions/fnc_getPitchBankYaw.sqf index 89fab8d92b..2a7a5c43e8 100644 --- a/addons/common/functions/fnc_getPitchBankYaw.sqf +++ b/addons/common/functions/fnc_getPitchBankYaw.sqf @@ -10,6 +10,9 @@ * 1: bank * 2: yaw * + * Example: + * [plane] call ace_common_fnc_getPitchBankYaw + * * Public: Yes */ #include "script_component.hpp" diff --git a/addons/common/functions/fnc_getPylonTurret.sqf b/addons/common/functions/fnc_getPylonTurret.sqf new file mode 100644 index 0000000000..ff343173dd --- /dev/null +++ b/addons/common/functions/fnc_getPylonTurret.sqf @@ -0,0 +1,64 @@ +/* + * Author: PabstMirror + * Finds turret owner of a pylon. + * + * Arguments: + * 0: Vehicle + * 1: Pylon Index (starting at 0) + * + * Return Value: + * * Turret index (either [-1] or [0]) + * + * Example: + * [cursorObject, 0] call ace_common_fnc_getPylonTurret + * + * Public: No + */ +// #define DEBUG_MODE_FULL +#include "script_component.hpp" + +params ["_vehicle", "_pylonIndex"]; + +// See if index is in ace_pylonTurrets setVar on vehicle +private _pylonTurrets = _vehicle getVariable ["ace_pylonTurrets", []]; +private _returnValue = _pylonTurrets param [_pylonIndex, []]; + +if (!(_returnValue isEqualTo [])) then { + TRACE_1("Using ace_pylonTurrets value",_returnValue); +} else { + // Attempt to determine turret owner based on magazines in the vehicle + private _pyMags = getPylonMagazines _vehicle; + private _pylonConfigs = configProperties [configFile >> "CfgVehicles" >> typeOf _vehicle >> "Components" >> "TransportPylonsComponent" >> "Pylons", "isClass _x"]; + if (_pylonIndex >= (count _pyMags)) exitWith {ERROR("out of bounds");}; + if (_pylonIndex >= (count _pylonConfigs)) exitWith {ERROR("out of bounds");}; + + private _targetMag = _pyMags select _pylonIndex; + private _inPilot = _targetMag in (_vehicle magazinesTurret [-1]); + private _inGunner = _targetMag in (_vehicle magazinesTurret [0]); + + if (_inPilot) then { + if (_inGunner) then { + TRACE_3("ambiguous - in both",_targetMag,_inPilot,_inGunner); + } else { + TRACE_3("Pilot Mag",_targetMag,_inPilot,_inGunner); + _returnValue = [-1]; + }; + } else { + if (_inGunner) then { + TRACE_3("Gunner Mag",_targetMag,_inPilot,_inGunner); + _returnValue = [0]; + } else { + TRACE_3("ambiguous - in neither",_targetMag,_inPilot,_inGunner); + }; + }; + + if (_returnValue isEqualTo []) then { // If not sure, just use config value + _returnValue = getArray ((_pylonConfigs select _pylonIndex) >> "turret"); + if (_returnValue isEqualTo []) then { + _returnValue = [-1]; + }; + }; +}; + +TRACE_3("",_vehicle,_pylonIndex,_returnValue); +_returnValue diff --git a/addons/common/functions/fnc_getReflectorsWithSelections.sqf b/addons/common/functions/fnc_getReflectorsWithSelections.sqf index 248050486c..d166818494 100644 --- a/addons/common/functions/fnc_getReflectorsWithSelections.sqf +++ b/addons/common/functions/fnc_getReflectorsWithSelections.sqf @@ -12,6 +12,9 @@ * 0: Light Hitpoints * 1: Selections * + * Example: + * [car] call ace_common_fnc_getReflectorsWithSelections + * * Public: Yes */ #include "script_component.hpp" diff --git a/addons/common/functions/fnc_getSelectionsWithoutHitPoints.sqf b/addons/common/functions/fnc_getSelectionsWithoutHitPoints.sqf index b46ec308ec..028024a94e 100644 --- a/addons/common/functions/fnc_getSelectionsWithoutHitPoints.sqf +++ b/addons/common/functions/fnc_getSelectionsWithoutHitPoints.sqf @@ -4,10 +4,15 @@ * Returns all damageable selections without hitpoints of any vehicle. * * Arguments: - * 0: A vehicle, not the classname (Object) + * 0: A vehicle, not the classname * * Return Value: - * The selections without hitpoints, i.e. reflectors. (Array) + * The selections without hitpoints, i.e. reflectors. + * + * Example: + * [car] call ace_common_fnc_getSelectionsWithoutHitPoints + * + * Public: No */ #include "script_component.hpp" diff --git a/addons/common/functions/fnc_getSettingData.sqf b/addons/common/functions/fnc_getSettingData.sqf index ae9dd5351e..0eb76d9b7b 100644 --- a/addons/common/functions/fnc_getSettingData.sqf +++ b/addons/common/functions/fnc_getSettingData.sqf @@ -6,7 +6,7 @@ * 0: Setting Name * * Return Value: - * Setting Data (Array) + * Setting Data * 0: Name * 1: Type Name * 2: Is Client Settable @@ -17,6 +17,9 @@ * 7: Default Value * 8: Localized Category * + * Example: + * ["setting"] call ace_common_fnc_getSettingData + * * Public: No */ #include "script_component.hpp" diff --git a/addons/common/functions/fnc_getStaminaBarControl.sqf b/addons/common/functions/fnc_getStaminaBarControl.sqf index 1fa747fef6..cfdef5bb35 100644 --- a/addons/common/functions/fnc_getStaminaBarControl.sqf +++ b/addons/common/functions/fnc_getStaminaBarControl.sqf @@ -8,6 +8,9 @@ * Return Value: * Stamina Bar control * + * Example: + * call ace_common_fnc_getStaminaBarControl + * * Public: No */ #include "script_component.hpp" diff --git a/addons/common/functions/fnc_getTargetAzimuthAndInclination.sqf b/addons/common/functions/fnc_getTargetAzimuthAndInclination.sqf index 0d2343bec9..98e7a5e3b2 100644 --- a/addons/common/functions/fnc_getTargetAzimuthAndInclination.sqf +++ b/addons/common/functions/fnc_getTargetAzimuthAndInclination.sqf @@ -9,6 +9,9 @@ * 0: Azimuth * 1: Inclination * + * Example: + * [] call ace_common_fnc_getTargetAzimuthAndInclination + * * Public: Yes */ #include "script_component.hpp" diff --git a/addons/common/functions/fnc_getTargetDistance.sqf b/addons/common/functions/fnc_getTargetDistance.sqf index 000f0ae31d..c93941eb12 100644 --- a/addons/common/functions/fnc_getTargetDistance.sqf +++ b/addons/common/functions/fnc_getTargetDistance.sqf @@ -10,6 +10,9 @@ * Return Value: * Distance in meters * + * Example: + * [5,20000,56] call ace_common_fnc_getTargetDistance + * * Public: Yes */ #include "script_component.hpp" diff --git a/addons/common/functions/fnc_getTargetObject.sqf b/addons/common/functions/fnc_getTargetObject.sqf index ed757dedf4..9ee1d26ff3 100644 --- a/addons/common/functions/fnc_getTargetObject.sqf +++ b/addons/common/functions/fnc_getTargetObject.sqf @@ -8,6 +8,9 @@ * Return Value: * Nearest object in line of sight, objNull if none are found * + * Example: + * [56] call ace_common_fnc_getTargetObject + * * Public: Yes */ #include "script_component.hpp" diff --git a/addons/common/functions/fnc_getTurnedOnLights.sqf b/addons/common/functions/fnc_getTurnedOnLights.sqf index a996e146d2..f95a4bbf19 100644 --- a/addons/common/functions/fnc_getTurnedOnLights.sqf +++ b/addons/common/functions/fnc_getTurnedOnLights.sqf @@ -8,6 +8,9 @@ * Return Value: * All burning lights * + * Example: + * [car] call ace_common_fnc_getTurnedOnLights + * * Public: Yes */ #include "script_component.hpp" diff --git a/addons/common/functions/fnc_getTurretCommander.sqf b/addons/common/functions/fnc_getTurretCommander.sqf index 3e7f09215f..2f832438b5 100644 --- a/addons/common/functions/fnc_getTurretCommander.sqf +++ b/addons/common/functions/fnc_getTurretCommander.sqf @@ -8,6 +8,9 @@ * Return Value: * Vehicle commander turrent indecies * + * Example: + * [car] call ace_common_fnc_getTurretCommander + * * Public: Yes */ #include "script_component.hpp" diff --git a/addons/common/functions/fnc_getTurretConfigPath.sqf b/addons/common/functions/fnc_getTurretConfigPath.sqf index 95d0773fd3..6af9aa62e3 100644 --- a/addons/common/functions/fnc_getTurretConfigPath.sqf +++ b/addons/common/functions/fnc_getTurretConfigPath.sqf @@ -9,6 +9,9 @@ * Return Value: * Turret config * + * Example: + * [CfgVehicle, [Array]] call ace_common_fnc_getTurretConfigPath + * * Public: Yes */ #include "script_component.hpp" diff --git a/addons/common/functions/fnc_getTurretCopilot.sqf b/addons/common/functions/fnc_getTurretCopilot.sqf index 49002cc40e..ef52200f6e 100644 --- a/addons/common/functions/fnc_getTurretCopilot.sqf +++ b/addons/common/functions/fnc_getTurretCopilot.sqf @@ -8,6 +8,9 @@ * Return Value: * Vehicle Copilot Turret indecies * + * Example: + * [car] call ace_common_fnc_getTurretCopilot + * * Public: Yes */ #include "script_component.hpp" diff --git a/addons/common/functions/fnc_getTurretDirection.sqf b/addons/common/functions/fnc_getTurretDirection.sqf index 5861586402..7bec5cf3e6 100644 --- a/addons/common/functions/fnc_getTurretDirection.sqf +++ b/addons/common/functions/fnc_getTurretDirection.sqf @@ -10,6 +10,9 @@ * 0: Position ASL * 1: Direction * + * Example: + * [car, [5,6,5]] call ace_common_fnc_getTurretDirection + * * Public: Yes */ #include "script_component.hpp" diff --git a/addons/common/functions/fnc_getTurretGunner.sqf b/addons/common/functions/fnc_getTurretGunner.sqf index 4a26e2c03d..e1846f96de 100644 --- a/addons/common/functions/fnc_getTurretGunner.sqf +++ b/addons/common/functions/fnc_getTurretGunner.sqf @@ -8,6 +8,9 @@ * Return Value: * Vehicle Gunner Turret indecies * + * Example: + * [car] call ace_common_fnc_getTurretGunner + * * Public: Yes */ #include "script_component.hpp" diff --git a/addons/common/functions/fnc_getTurretsFFV.sqf b/addons/common/functions/fnc_getTurretsFFV.sqf index 5c36e20197..885396b2bf 100644 --- a/addons/common/functions/fnc_getTurretsFFV.sqf +++ b/addons/common/functions/fnc_getTurretsFFV.sqf @@ -8,6 +8,9 @@ * Return Value: * Vehicle FFV Turret indecies * + * Example: + * [car] call ace_common_fnc_getTurretsFFV + * * Public: Yes */ #include "script_component.hpp" diff --git a/addons/common/functions/fnc_getTurretsOther.sqf b/addons/common/functions/fnc_getTurretsOther.sqf index ef2a1278dc..04750e98fd 100644 --- a/addons/common/functions/fnc_getTurretsOther.sqf +++ b/addons/common/functions/fnc_getTurretsOther.sqf @@ -8,6 +8,9 @@ * Return Value: * Vehicle Other Turret indecies * + * Example: + * [car] call ace_common_fnc_getTurretsOther + * * Public: Yes */ #include "script_component.hpp" diff --git a/addons/common/functions/fnc_getVehicleCargo.sqf b/addons/common/functions/fnc_getVehicleCargo.sqf index 68599c919b..5279825008 100644 --- a/addons/common/functions/fnc_getVehicleCargo.sqf +++ b/addons/common/functions/fnc_getVehicleCargo.sqf @@ -8,6 +8,9 @@ * Return Value: * Vehicle cargo positions * + * Example: + * [car] call ace_common_fnc_getVehicleCargo + * * Public: Yes */ #include "script_component.hpp" diff --git a/addons/common/functions/fnc_getVehicleCodriver.sqf b/addons/common/functions/fnc_getVehicleCodriver.sqf index a1cc5814e1..8b0fd3be29 100644 --- a/addons/common/functions/fnc_getVehicleCodriver.sqf +++ b/addons/common/functions/fnc_getVehicleCodriver.sqf @@ -8,6 +8,9 @@ * Return Value: * Vehicle codriver positions * + * Example: + * ["car"] call ace_common_fnc_getVehicleCodriver + * * Public: Yes */ #include "script_component.hpp" diff --git a/addons/common/functions/fnc_getVehicleCrew.sqf b/addons/common/functions/fnc_getVehicleCrew.sqf index adb0e9701a..f0377671e9 100644 --- a/addons/common/functions/fnc_getVehicleCrew.sqf +++ b/addons/common/functions/fnc_getVehicleCrew.sqf @@ -9,6 +9,9 @@ * Return Value: * Crew * + * Example: + * [car, ["driver"]] call ace_common_fnc_getVehicleCrew + * * Public: Yes */ #include "script_component.hpp" diff --git a/addons/common/functions/fnc_getVehicleIcon.sqf b/addons/common/functions/fnc_getVehicleIcon.sqf new file mode 100644 index 0000000000..1974c57b71 --- /dev/null +++ b/addons/common/functions/fnc_getVehicleIcon.sqf @@ -0,0 +1,50 @@ +/* + * Author: AACO + * Function used to get the vehicle icon for provided object (cached for repeat use) + * + * Arguments: + * 0: Object to get icon of + * + * Return Value: + * Icon of vehicle + * + * Examples: + * ["B_Soldier_F"] call ace_common_fnc_getVehicleIcon; + * + * Public: Yes + */ + +#include "script_component.hpp" +#define DEFAULT_TEXTURE "\A3\ui_f\data\Map\VehicleIcons\iconVehicle_ca.paa" + +params [["_object", objNull, [objNull, ""]]]; + +if ((_object isEqualType objNull && {isNull _object}) || {_object isEqualType "" && {_object == ""}}) exitWith { DEFAULT_TEXTURE }; + +ISNILS(GVAR(vehicleIconCache),call CBA_fnc_createNamespace); + +private _objectType = if (_object isEqualType objNull) then { + typeOf _object +} else { + _object +}; +private _cachedValue = GVAR(vehicleIconCache) getVariable _objectType; + +if (isNil "_cachedValue") then { + private _vehicleValue = getText (configfile >> "CfgVehicles" >> _objectType >> "icon"); + private _vehicleIconValue = getText (configfile >> "CfgVehicleIcons" >> _vehicleValue); + + if (_vehicleIconValue == "") then { + if (_vehicleValue != "" && {((toLower _vehicleValue) find ".paa") > -1}) then { + _cachedValue = _vehicleValue; + } else { + _cachedValue = DEFAULT_TEXTURE; + }; + } else { + _cachedValue = _vehicleIconValue; + }; + + GVAR(vehicleIconCache) setVariable [_objectType, _cachedValue]; +}; + +_cachedValue diff --git a/addons/common/functions/fnc_getVehicleUAVCrew.sqf b/addons/common/functions/fnc_getVehicleUAVCrew.sqf index 2b2281ed10..9804a14b68 100644 --- a/addons/common/functions/fnc_getVehicleUAVCrew.sqf +++ b/addons/common/functions/fnc_getVehicleUAVCrew.sqf @@ -8,6 +8,9 @@ * Return Value: * UAV Dummy Crew * + * Example: + * [car] call ace_common_fnc_getVehicleUAVCrew + * * Public: Yes */ #include "script_component.hpp" diff --git a/addons/common/functions/fnc_getVersion.sqf b/addons/common/functions/fnc_getVersion.sqf index 24773240b7..e0f2ab9f6d 100644 --- a/addons/common/functions/fnc_getVersion.sqf +++ b/addons/common/functions/fnc_getVersion.sqf @@ -8,6 +8,9 @@ * Return Value: * ACE Version * + * Example: + * [] call ace_common_fnc_getVersion + * * Public: Yes */ #include "script_component.hpp" diff --git a/addons/common/functions/fnc_getWeaponAzimuthAndInclination.sqf b/addons/common/functions/fnc_getWeaponAzimuthAndInclination.sqf index f7c7909e01..604a89b9f8 100644 --- a/addons/common/functions/fnc_getWeaponAzimuthAndInclination.sqf +++ b/addons/common/functions/fnc_getWeaponAzimuthAndInclination.sqf @@ -9,6 +9,9 @@ * 0: Azimuth * 1: Inclination * + * Example: + * ["gun"] call ace_common_fnc_getWeaponAzimuthAndInclination + * * Public: Yes */ #include "script_component.hpp" diff --git a/addons/common/functions/fnc_getWeaponIndex.sqf b/addons/common/functions/fnc_getWeaponIndex.sqf index 0e24f190a5..a881233469 100644 --- a/addons/common/functions/fnc_getWeaponIndex.sqf +++ b/addons/common/functions/fnc_getWeaponIndex.sqf @@ -13,6 +13,9 @@ * 2 = handgun * -1 = other * + * Example: + * [bob, "gun"] call ace_common_fnc_getWeaponIndex + * * Public: Yes */ #include "script_component.hpp" diff --git a/addons/common/functions/fnc_getWeaponModes.sqf b/addons/common/functions/fnc_getWeaponModes.sqf index 48755d3a9b..ede86ac842 100644 --- a/addons/common/functions/fnc_getWeaponModes.sqf +++ b/addons/common/functions/fnc_getWeaponModes.sqf @@ -8,6 +8,9 @@ * Return Value: * Firing Modes * + * Example: + * ["gun"] call ace_common_fnc_getWeaponModes + * * Public: Yes */ #include "script_component.hpp" diff --git a/addons/common/functions/fnc_getWeaponMuzzles.sqf b/addons/common/functions/fnc_getWeaponMuzzles.sqf index e252d879f9..b0b0533721 100644 --- a/addons/common/functions/fnc_getWeaponMuzzles.sqf +++ b/addons/common/functions/fnc_getWeaponMuzzles.sqf @@ -8,6 +8,9 @@ * Return Value: * All weapon muzzles * + * Example: + * ["gun"] call ace_common_fnc_getWeaponMuzzles + * * Public: Yes */ #include "script_component.hpp" diff --git a/addons/common/functions/fnc_getWeaponState.sqf b/addons/common/functions/fnc_getWeaponState.sqf index 73e5897236..772a5058b9 100644 --- a/addons/common/functions/fnc_getWeaponState.sqf +++ b/addons/common/functions/fnc_getWeaponState.sqf @@ -12,6 +12,9 @@ * 2: Magazines * 3: Ammo * + * Example: + * [bob, "gun"] call ace_common_fnc_getWeaponState + * * Public: Yes */ #include "script_component.hpp" @@ -42,4 +45,4 @@ private _ammo = _muzzles apply {0}; false } count magazinesAmmoFull _unit; -[_attachments, _muzzles, _magazines, _ammo]; +[_attachments, _muzzles, _magazines, _ammo]; diff --git a/addons/common/functions/fnc_getWeaponType.sqf b/addons/common/functions/fnc_getWeaponType.sqf index 5666ea5bc0..b53f23d514 100644 --- a/addons/common/functions/fnc_getWeaponType.sqf +++ b/addons/common/functions/fnc_getWeaponType.sqf @@ -12,6 +12,9 @@ * 3 = handgun * -1 = other * + * Example: + * ["gun"] call ace_common_fnc_getWeaponType + * * Public: Yes */ #include "script_component.hpp" diff --git a/addons/common/functions/fnc_getWindDirection.sqf b/addons/common/functions/fnc_getWindDirection.sqf index 7341ea9c1d..f35047fc30 100644 --- a/addons/common/functions/fnc_getWindDirection.sqf +++ b/addons/common/functions/fnc_getWindDirection.sqf @@ -8,6 +8,9 @@ * Return Value: * Wind cardinal direction * + * Example: + * [] call ace_common_fnc_getWindDirection + * * Public: Yes */ #include "script_component.hpp" diff --git a/addons/common/functions/fnc_getZoom.sqf b/addons/common/functions/fnc_getZoom.sqf index f4113198a7..9c3f7987a4 100644 --- a/addons/common/functions/fnc_getZoom.sqf +++ b/addons/common/functions/fnc_getZoom.sqf @@ -8,10 +8,13 @@ * Return Value: * Zoom * + * Example: + * [] call ace_common_fnc_getZoom + * * Public: Yes */ #include "script_component.hpp" if (!hasInterface) exitWith {0}; -(0.5 - ((worldToScreen positionCameraToWorld [0, 1, 1]) select 1)) * (getResolution select 5) +(0.5 - ((worldToScreen positionCameraToWorld [0, 1, 1]) select 1)) * (getResolution select 5) diff --git a/addons/common/functions/fnc_goKneeling.sqf b/addons/common/functions/fnc_goKneeling.sqf index 9e7aed708a..5d45a3f400 100644 --- a/addons/common/functions/fnc_goKneeling.sqf +++ b/addons/common/functions/fnc_goKneeling.sqf @@ -1,6 +1,6 @@ /* * Author: commy2 - * Move unit to kneeling position (only if not yet prone). + * Move unit to kneeling position (only if not yet prone and not underwater). * * Arguments: * 0: Unit @@ -8,6 +8,9 @@ * Return Value: * None * + * Example: + * [bob] call ace_common_fnc_goKneeling + * * Public: No */ #include "script_component.hpp" @@ -15,7 +18,7 @@ params ["_unit"]; // Animation changes even inside vehicle post-1.60 -if (stance _unit == "PRONE" || {vehicle ACE_player != ACE_player}) exitWith {}; +if (stance _unit == "PRONE" || {vehicle _unit != _unit} || {_unit call EFUNC(common,isSwimming)}) exitWith {}; [ _unit, diff --git a/addons/common/functions/fnc_hadamardProduct.sqf b/addons/common/functions/fnc_hadamardProduct.sqf index cdaf707395..20173e7d0b 100644 --- a/addons/common/functions/fnc_hadamardProduct.sqf +++ b/addons/common/functions/fnc_hadamardProduct.sqf @@ -10,6 +10,9 @@ * Return Value: * Hadamard Product * + * Example: + * [[0,0,0], [1,1,1]] call ace_common_fnc_hadamardProduct + * * Public: Yes */ #include "script_component.hpp" diff --git a/addons/common/functions/fnc_handleEngine.sqf b/addons/common/functions/fnc_handleEngine.sqf index 829ad5bb49..55696a679e 100644 --- a/addons/common/functions/fnc_handleEngine.sqf +++ b/addons/common/functions/fnc_handleEngine.sqf @@ -9,6 +9,9 @@ * Return Value: * None * + * Example: + * [bob, "running"] call ace_common_fnc_handleEngine + * * Public: No */ #include "script_component.hpp" diff --git a/addons/common/functions/fnc_handleModifierKey.sqf b/addons/common/functions/fnc_handleModifierKey.sqf index bfb7e84931..094ec278f4 100644 --- a/addons/common/functions/fnc_handleModifierKey.sqf +++ b/addons/common/functions/fnc_handleModifierKey.sqf @@ -8,7 +8,10 @@ * Return Value: * None * - * Public : No + * Example: + * call ace_common_fnc_handleModifierKey + * + * Public: No */ #include "script_component.hpp" diff --git a/addons/common/functions/fnc_handleModifierKeyUp.sqf b/addons/common/functions/fnc_handleModifierKeyUp.sqf index ffa5855115..97df636050 100644 --- a/addons/common/functions/fnc_handleModifierKeyUp.sqf +++ b/addons/common/functions/fnc_handleModifierKeyUp.sqf @@ -8,7 +8,10 @@ * Return Value: * None * - * Public : No + * Example: + * call ace_common_fnc_handleModifierKeyUp + * + * Public: No */ #include "script_component.hpp" diff --git a/addons/common/functions/fnc_hasHatch.sqf b/addons/common/functions/fnc_hasHatch.sqf index e39c52f897..b750d01b85 100644 --- a/addons/common/functions/fnc_hasHatch.sqf +++ b/addons/common/functions/fnc_hasHatch.sqf @@ -8,6 +8,9 @@ * Return Value: * Unit has a hatch? * + * Example: + * [bob] call ace_common_fnc_hasHatch + * * Public: Yes */ #include "script_component.hpp" diff --git a/addons/common/functions/fnc_hasItem.sqf b/addons/common/functions/fnc_hasItem.sqf index 8ca785d78e..9d5d79b1a5 100644 --- a/addons/common/functions/fnc_hasItem.sqf +++ b/addons/common/functions/fnc_hasItem.sqf @@ -1,20 +1,21 @@ /* * Author: Glowbal - * Check if unit has item + * Check if unit has item. Note: case-sensitive. * * Arguments: * 0: Unit * 1: Item Classname * * Return Value: - * has Item + * Unit has Item * - * Public: yes + * Example: + * [bob, "item"] call ace_common_fnc_hasItem * - * Note: Case sensitive + * Public: Yes */ #include "script_component.hpp" params [["_unit", objNull, [objNull]], ["_item", "", [""]]]; -_item in items _unit // return +_item in items _unit diff --git a/addons/common/functions/fnc_hasMagazine.sqf b/addons/common/functions/fnc_hasMagazine.sqf index eaa9bc0556..4ad40bf959 100644 --- a/addons/common/functions/fnc_hasMagazine.sqf +++ b/addons/common/functions/fnc_hasMagazine.sqf @@ -9,6 +9,9 @@ * Return Value: * has Magazine * + * Example: + * [bob, "magazine"] call ace_common_fnc_hasMagazine + * * Public: yes * * Note: Case sensitive diff --git a/addons/common/functions/fnc_headBugFix.sqf b/addons/common/functions/fnc_headBugFix.sqf index 07a1652b1b..fca04c234b 100644 --- a/addons/common/functions/fnc_headBugFix.sqf +++ b/addons/common/functions/fnc_headBugFix.sqf @@ -8,6 +8,9 @@ * Return Value: * None * + * Example: + * [] call ace_common_fnc_headBugFix + * * Public: Yes * * Note: Has to be spawned not called diff --git a/addons/common/functions/fnc_hideUnit.sqf b/addons/common/functions/fnc_hideUnit.sqf index e0adb201c3..838bd4246e 100644 --- a/addons/common/functions/fnc_hideUnit.sqf +++ b/addons/common/functions/fnc_hideUnit.sqf @@ -7,7 +7,7 @@ * 1: Reason to hide the unit * * Return Value: - * nil + * None * * Example: * [ACE_Player, "SpectatorMode"] call ace_common_fnc_hideUnit diff --git a/addons/common/functions/fnc_inTransitionAnim.sqf b/addons/common/functions/fnc_inTransitionAnim.sqf index fd90291d73..a127fad005 100644 --- a/addons/common/functions/fnc_inTransitionAnim.sqf +++ b/addons/common/functions/fnc_inTransitionAnim.sqf @@ -3,10 +3,13 @@ * Check if given unit is in a transitional animation * * Arguments: - * 0: A soldier + * 0: A soldier * * Return Value: - * + * Boolean + * + * Example: + * [bob] call ace_common_fnc_inTransitionAnim * * Public: Yes */ diff --git a/addons/common/functions/fnc_interpolateFromArray.sqf b/addons/common/functions/fnc_interpolateFromArray.sqf index 07207071e7..9c63a9798c 100644 --- a/addons/common/functions/fnc_interpolateFromArray.sqf +++ b/addons/common/functions/fnc_interpolateFromArray.sqf @@ -9,6 +9,9 @@ * Return Value: * Interpolation result * + * Example: + * [[0,1], 5] call ace_common_fnc_interpolateFromArray + * * Public: Yes */ #include "script_component.hpp" @@ -18,4 +21,4 @@ params ["_array", "_value"]; private _min = _array select floor _value; private _max = _array select ceil _value; -_min + (_max - _min) * (_value % 1) // return +linearConversion [0, 1, _value % 1, _min, _max] // return diff --git a/addons/common/functions/fnc_isAwake.sqf b/addons/common/functions/fnc_isAwake.sqf index 1179ced02f..d7f0b79149 100644 --- a/addons/common/functions/fnc_isAwake.sqf +++ b/addons/common/functions/fnc_isAwake.sqf @@ -8,6 +8,9 @@ * Return Value: * if unit is awake * + * Example: + * [bob] call ace_common_fnc_isAwake + * * Public: Yes */ #include "script_component.hpp" diff --git a/addons/common/functions/fnc_isEOD.sqf b/addons/common/functions/fnc_isEOD.sqf index ee82cf2068..2a6e04247c 100644 --- a/addons/common/functions/fnc_isEOD.sqf +++ b/addons/common/functions/fnc_isEOD.sqf @@ -20,4 +20,4 @@ params ["_unit"]; -_unit getVariable ["ACE_isEOD", getNumber (configFile >> "CfgVehicles" >> typeOf _unit >> "canDeactivateMines") == 1] // return +_unit getVariable ["ACE_isEOD", _unit getUnitTrait "explosiveSpecialist"] // return diff --git a/addons/common/functions/fnc_isEngineer.sqf b/addons/common/functions/fnc_isEngineer.sqf index 01eabfc0b3..96a00970f6 100644 --- a/addons/common/functions/fnc_isEngineer.sqf +++ b/addons/common/functions/fnc_isEngineer.sqf @@ -17,7 +17,7 @@ params ["_unit"]; -private _isEngineer = _unit getVariable ["ACE_isEngineer", getNumber (configFile >> "CfgVehicles" >> typeOf _unit >> "engineer") == 1]; +private _isEngineer = _unit getVariable ["ACE_isEngineer", _unit getUnitTrait "engineer"]; //Handle ace_repair modules setting this to a number if (_isEngineer isEqualType 0) then {_isEngineer = _isEngineer > 0}; diff --git a/addons/common/functions/fnc_isFeatureCameraActive.sqf b/addons/common/functions/fnc_isFeatureCameraActive.sqf index 7d282109b2..b0870408af 100644 --- a/addons/common/functions/fnc_isFeatureCameraActive.sqf +++ b/addons/common/functions/fnc_isFeatureCameraActive.sqf @@ -25,7 +25,7 @@ !( isNull curatorCamera && // Curator - {isNull (GETMVAR(EGVAR(spectator,camera),objNull))} && // ACE Spectator + {!(GETMVAR(EGVAR(spectator,isSet),false))} && // ACE Spectator {isNull (GETUVAR(BIS_fnc_arsenal_cam, objNull))} && // Arsenal camera {isNull (GETMVAR(BIS_fnc_establishingShot_fakeUAV, objNull))} && // Establishing shot camera {isNull (GETMVAR(BIS_fnc_camera_cam, objNull))} && // Splendid camera diff --git a/addons/common/functions/fnc_isInBuilding.sqf b/addons/common/functions/fnc_isInBuilding.sqf index d4a9307cd6..98f092e762 100644 --- a/addons/common/functions/fnc_isInBuilding.sqf +++ b/addons/common/functions/fnc_isInBuilding.sqf @@ -8,6 +8,9 @@ * Return Value: * Is the unit in a building? * + * Example: + * [bob] call ace_common_fnc_isInBuilding + * * Public: Yes */ #include "script_component.hpp" diff --git a/addons/common/functions/fnc_isMedic.sqf b/addons/common/functions/fnc_isMedic.sqf new file mode 100644 index 0000000000..2a0d0dc520 --- /dev/null +++ b/addons/common/functions/fnc_isMedic.sqf @@ -0,0 +1,23 @@ +/* + * Author: SilentSpike + * Check if a unit is a medic + * + * Arguments: + * 0: The Unit + * + * ReturnValue: + * Unit is medic + * + * Example: + * [player] call ace_common_fnc_isMedic + * + * Public: Yes + */ + +#include "script_component.hpp" + +params ["_unit"]; + +private _isMedic = _unit getVariable [QEGVAR(medical,medicClass), getNumber (configFile >> "CfgVehicles" >> typeOf _unit >> "attendant")]; + +_isMedic > 0 diff --git a/addons/common/functions/fnc_isModLoaded.sqf b/addons/common/functions/fnc_isModLoaded.sqf index 46e1bc03a8..f740f58b0b 100644 --- a/addons/common/functions/fnc_isModLoaded.sqf +++ b/addons/common/functions/fnc_isModLoaded.sqf @@ -8,6 +8,9 @@ * Return Value: * if modification is loaded * + * Example: + * ["class"] call ace_common_fnc_isModLoaded + * * Public: Yes */ #include "script_component.hpp" diff --git a/addons/common/functions/fnc_isSwimming.sqf b/addons/common/functions/fnc_isSwimming.sqf new file mode 100644 index 0000000000..8aee92ad81 --- /dev/null +++ b/addons/common/functions/fnc_isSwimming.sqf @@ -0,0 +1,20 @@ +/* + * Author: das attorney, Jonpas + * Check if unit is swimming (surface swimming or diving). + * + * Arguments: + * 0: Unit + * + * Return Value: + * If unit is swimming + * + * Example: + * [bob] call ace_common_fnc_isSwimming + * + * Public: Yes + */ +#include "script_component.hpp" + +params [["_unit", objNull, [objNull]]]; + +((animationState _unit) select [1, 3]) in ["bdv","bsw","dve","sdv","ssw","swm"] diff --git a/addons/common/functions/fnc_isUnderwater.sqf b/addons/common/functions/fnc_isUnderwater.sqf index 637ed49f3d..0d7d1e50a1 100644 --- a/addons/common/functions/fnc_isUnderwater.sqf +++ b/addons/common/functions/fnc_isUnderwater.sqf @@ -8,10 +8,15 @@ * Return Value: * If unit's head is underwater * + * Example: + * [bob] call ace_common_fnc_isUnderwater + * * Public: Yes */ #include "script_component.hpp" +ACE_DEPRECATED(QFUNC(isUnderwater),"3.13.0","underwater OBJECT"); + params [["_unit", objNull, [objNull]]]; private _return = false; diff --git a/addons/common/functions/fnc_lightIntensityFromObject.sqf b/addons/common/functions/fnc_lightIntensityFromObject.sqf index a495897dea..6725a71580 100644 --- a/addons/common/functions/fnc_lightIntensityFromObject.sqf +++ b/addons/common/functions/fnc_lightIntensityFromObject.sqf @@ -7,7 +7,10 @@ * 1: Object that emits light * * Return Value: - * Brightest light level + * Brightest light level + * + * Example: + * [reciever, giver] call ace_common_fnc_lightIntensityFromObject * * Public: Yes */ diff --git a/addons/common/functions/fnc_loadPerson.sqf b/addons/common/functions/fnc_loadPerson.sqf index f8a4456b96..4fc6245b5a 100644 --- a/addons/common/functions/fnc_loadPerson.sqf +++ b/addons/common/functions/fnc_loadPerson.sqf @@ -1,13 +1,17 @@ /* * Author: Glowbal - * Loads a specified unit into any nearby vehicle + * Loads a specified unit into any nearby vehicle, or _vehicle parameter. * * Arguments: * 0: Unit that will load * 1: Unit to be loaded + * 2: Vehicle that the unit will be loaded in (default: objNull) * * Return Value: - * the vehicle that the unitToBeloaded has been loaded in. Returns ObjNull if function failed + * Vehicle that the unitToBeloaded has been loaded in. Returns objNull if function failed + * + * Example: + * [bob, kevin] call ace_common_fnc_loadPerson * * Public: Yes */ @@ -15,20 +19,14 @@ #define GROUP_SWITCH_ID QFUNC(loadPerson) -params ["_caller", "_unit"]; +params ["_caller", "_unit", ["_vehicle", objNull]]; -private _vehicle = objNull; +if (!([_caller, _unit, ["isNotDragging", "isNotCarrying", "isNotSwimming"]] call FUNC(canInteractWith)) || {_caller == _unit}) exitWith {_vehicle}; -if (!([_caller, _unit, ["isNotDragging", "isNotCarrying"]] call FUNC(canInteractWith)) || {_caller == _unit}) exitWith {_vehicle}; - -private _nearVehicles = nearestObjects [_unit, ["Car", "Air", "Tank", "Ship_F"], 10]; - -{ - TRACE_1("",_x); - if ((_x emptyPositions "cargo" > 0) || {_x emptyPositions "gunner" > 0}) exitWith { - _vehicle = _x; - }; -} forEach _nearVehicles; +// Try to use nearest vehicle if a vehicle hasn't been supplied +if (isNull _vehicle) then { + _vehicle = ([_unit] call FUNC(nearestVehiclesFreeSeat)) param [0, objNull]; +}; if (!isNull _vehicle) then { [_unit, true, GROUP_SWITCH_ID, side group _caller] call FUNC(switchToGroupSide); diff --git a/addons/common/functions/fnc_loadPersonLocal.sqf b/addons/common/functions/fnc_loadPersonLocal.sqf index db0248a901..90cbd7da03 100644 --- a/addons/common/functions/fnc_loadPersonLocal.sqf +++ b/addons/common/functions/fnc_loadPersonLocal.sqf @@ -10,6 +10,9 @@ * Return Value: * None * + * Example: + * [bob, car, kevin] call ace_common_fnc_loadPersonLocal + * * Public: Yes */ #include "script_component.hpp" diff --git a/addons/common/functions/fnc_loadSettingsFromProfile.sqf b/addons/common/functions/fnc_loadSettingsFromProfile.sqf index 46b0134740..9151d79cce 100644 --- a/addons/common/functions/fnc_loadSettingsFromProfile.sqf +++ b/addons/common/functions/fnc_loadSettingsFromProfile.sqf @@ -9,6 +9,9 @@ * Return Value: * None * + * Example: + * call ace_common_fnc_loadSettingsFromProfile + * * Public: No */ #include "script_component.hpp" diff --git a/addons/common/functions/fnc_loadSettingsLocalizedText.sqf b/addons/common/functions/fnc_loadSettingsLocalizedText.sqf index 3fe182b7e3..7ceffa04e7 100644 --- a/addons/common/functions/fnc_loadSettingsLocalizedText.sqf +++ b/addons/common/functions/fnc_loadSettingsLocalizedText.sqf @@ -8,6 +8,9 @@ * Return Value: * None * + * Example: + * call ace_common_fnc_loadSettingsLocalizedText + * * Public: No */ #include "script_component.hpp" diff --git a/addons/common/functions/fnc_loadSettingsOnServer.sqf b/addons/common/functions/fnc_loadSettingsOnServer.sqf index 4498c9d058..eaeac7d51d 100644 --- a/addons/common/functions/fnc_loadSettingsOnServer.sqf +++ b/addons/common/functions/fnc_loadSettingsOnServer.sqf @@ -9,6 +9,9 @@ * Return Value: * None * + * Example: + * call ace_common_fnc_loadSettingsOnServer + * * Public: No */ #include "script_component.hpp" diff --git a/addons/common/functions/fnc_moduleCheckPBOs.sqf b/addons/common/functions/fnc_moduleCheckPBOs.sqf index 23c9b7ffd3..f3a8c0902c 100644 --- a/addons/common/functions/fnc_moduleCheckPBOs.sqf +++ b/addons/common/functions/fnc_moduleCheckPBOs.sqf @@ -10,6 +10,9 @@ * Return Value: * None * + * Example: + * [LOGIC, [bob, kevin], true] call ace_common_fnc_moduleCheckPBOs + * * Public: No */ #include "script_component.hpp" diff --git a/addons/common/functions/fnc_moduleLSDVehicles.sqf b/addons/common/functions/fnc_moduleLSDVehicles.sqf index a8e7c8c055..cecc8983a1 100644 --- a/addons/common/functions/fnc_moduleLSDVehicles.sqf +++ b/addons/common/functions/fnc_moduleLSDVehicles.sqf @@ -8,6 +8,9 @@ * Return Value: * None * + * Example: + * [bob, target, []] call ace_common_fnc_moduleLSDVehicles + * * Public: No */ #include "script_component.hpp" diff --git a/addons/common/functions/fnc_monitor.sqf b/addons/common/functions/fnc_monitor.sqf index 8aef62895c..591e923d1b 100644 --- a/addons/common/functions/fnc_monitor.sqf +++ b/addons/common/functions/fnc_monitor.sqf @@ -8,6 +8,9 @@ * Return Value: * None * + * Example: + * [{code}] call ace_common_fnc_monitor + * * Public: Yes */ #include "script_component.hpp" diff --git a/addons/common/functions/fnc_muteUnit.sqf b/addons/common/functions/fnc_muteUnit.sqf index 11c18aedd7..25106c979f 100644 --- a/addons/common/functions/fnc_muteUnit.sqf +++ b/addons/common/functions/fnc_muteUnit.sqf @@ -9,6 +9,9 @@ * Return Value: * None * + * Example: + * [bob, "because"] call ace_common_fnc_muteUnit + * * Public: Yes */ #include "script_component.hpp" diff --git a/addons/common/functions/fnc_muteUnitHandleInitPost.sqf b/addons/common/functions/fnc_muteUnitHandleInitPost.sqf index 53e8d4d5b7..4e6ac7cbaf 100644 --- a/addons/common/functions/fnc_muteUnitHandleInitPost.sqf +++ b/addons/common/functions/fnc_muteUnitHandleInitPost.sqf @@ -8,6 +8,9 @@ * Return Value: * None * + * Example: + * [bob] call ace_common_fnc_muteUnitHandleInitPost + * * Public: No */ #include "script_component.hpp" diff --git a/addons/common/functions/fnc_muteUnitHandleRespawn.sqf b/addons/common/functions/fnc_muteUnitHandleRespawn.sqf index ceb0614116..6e93e40ef6 100644 --- a/addons/common/functions/fnc_muteUnitHandleRespawn.sqf +++ b/addons/common/functions/fnc_muteUnitHandleRespawn.sqf @@ -8,6 +8,9 @@ * Return Value: * None * + * Example: + * [bob] call ace_common_fnc_muteUnitHandleRespawn + * * Public: No */ #include "script_component.hpp" diff --git a/addons/common/functions/fnc_nearestVehiclesFreeSeat.sqf b/addons/common/functions/fnc_nearestVehiclesFreeSeat.sqf new file mode 100644 index 0000000000..080499d9cf --- /dev/null +++ b/addons/common/functions/fnc_nearestVehiclesFreeSeat.sqf @@ -0,0 +1,22 @@ +/* + * Author: 654wak654 + * Returns a list of vehicles near given unit that the unit can be a passenger in. + * + * Arguments: + * 0: Unit + * 1: Distance + * + * Return Value: + * Nearest vehicles with a free seat + * + * Example: + * [bob] call ace_common_fnc_nearestVehiclesFreeSeat + * + * Public: Yes + */ +#include "script_component.hpp" + +params ["_unit", ["_distance", 10]]; + +private _nearVehicles = nearestObjects [_unit, ["Car", "Air", "Tank", "Ship_F", "Pod_Heli_Transport_04_crewed_base_F"], _distance]; +_nearVehicles select {(_x emptyPositions "cargo" > 0) || {_x emptyPositions "gunner" > 0}} diff --git a/addons/common/functions/fnc_numberToDigits.sqf b/addons/common/functions/fnc_numberToDigits.sqf index b90f0eefd7..d9aceb2426 100644 --- a/addons/common/functions/fnc_numberToDigits.sqf +++ b/addons/common/functions/fnc_numberToDigits.sqf @@ -9,6 +9,9 @@ * Return Value: * Digits. The maximum count is six digits. * + * Example: + * [5, 5] call ace_common_fnc_numberToDigits + * * Public: Yes */ #include "script_component.hpp" diff --git a/addons/common/functions/fnc_numberToDigitsString.sqf b/addons/common/functions/fnc_numberToDigitsString.sqf index 7e2c78f8b4..9f19cfe3dc 100644 --- a/addons/common/functions/fnc_numberToDigitsString.sqf +++ b/addons/common/functions/fnc_numberToDigitsString.sqf @@ -4,11 +4,14 @@ * * Arguments: * 0: Number to 'digitize' - * 1: Set the minimal length of the returned string. Useful for getting left hand zeroes. (Number, optional) + * 1: Set the minimal length of the returned string. Useful for getting left hand zeroes. (Optional) * * Return Value: * Digits. The maximum length is six digits. * + * Example: + * [5, 5] call ace_common_fnc_numberToDigitsString + * * Public: Yes */ #include "script_component.hpp" diff --git a/addons/common/functions/fnc_numberToString.sqf b/addons/common/functions/fnc_numberToString.sqf index 1cb2f521f8..8ca22bca88 100644 --- a/addons/common/functions/fnc_numberToString.sqf +++ b/addons/common/functions/fnc_numberToString.sqf @@ -8,6 +8,9 @@ * Return Value: * The number as string * + * Example: + * [5] call ace_common_fnc_numberToString + * * Public: Yes */ #include "script_component.hpp" diff --git a/addons/common/functions/fnc_onAnswerRequest.sqf b/addons/common/functions/fnc_onAnswerRequest.sqf index 8c77719256..38f35f1968 100644 --- a/addons/common/functions/fnc_onAnswerRequest.sqf +++ b/addons/common/functions/fnc_onAnswerRequest.sqf @@ -3,10 +3,15 @@ * N/A * * Arguments: - * ? + * 0: Unit + * 1: ID? + * 2: Accepted * * Return Value: - * ? + * None + * + * Example: + * [bob, "ID", true] call ace_common_fnc_onAnswerRequest * * Public: No */ diff --git a/addons/common/functions/fnc_owned.sqf b/addons/common/functions/fnc_owned.sqf index e352795c5e..a8c3f737e7 100644 --- a/addons/common/functions/fnc_owned.sqf +++ b/addons/common/functions/fnc_owned.sqf @@ -6,7 +6,10 @@ * 0: Any object. * * Return Value: - * Is this object claimed by someone? + * Is this object claimed by someone? + * + * Example: + * [bob] call ace_common_fnc_owned * * Public: No */ diff --git a/addons/common/functions/fnc_playConfigSound3D.sqf b/addons/common/functions/fnc_playConfigSound3D.sqf index 236802538e..b347cffca8 100644 --- a/addons/common/functions/fnc_playConfigSound3D.sqf +++ b/addons/common/functions/fnc_playConfigSound3D.sqf @@ -11,9 +11,12 @@ * Return Value: * None * + * Example: + * ["sound", [0,0,0], 5, 5] call ace_common_fnc_playConfigSound3D + * * Public: Yes */ -#define DEBUG_MODE_FULL +// #define DEBUG_MODE_FULL #include "script_component.hpp" params ["_soundClass", "_posASL", "_volume", "_distance"]; diff --git a/addons/common/functions/fnc_player.sqf b/addons/common/functions/fnc_player.sqf index 1a268515a7..54510be05e 100644 --- a/addons/common/functions/fnc_player.sqf +++ b/addons/common/functions/fnc_player.sqf @@ -9,6 +9,9 @@ * Return Value: * Player controlled unit * + * Example: + * [] call ace_common_fnc_player + * * Public: Yes */ #include "script_component.hpp" diff --git a/addons/common/functions/fnc_playerSide.sqf b/addons/common/functions/fnc_playerSide.sqf index 3a7ce5bba9..dd6b7e8b2f 100644 --- a/addons/common/functions/fnc_playerSide.sqf +++ b/addons/common/functions/fnc_playerSide.sqf @@ -8,6 +8,9 @@ * Return Value: * current local side * + * Example: + * [] call ace_common_fnc_playerSide + * * Public: Yes */ #include "script_component.hpp" diff --git a/addons/common/functions/fnc_positionToASL.sqf b/addons/common/functions/fnc_positionToASL.sqf index 267bbf2353..297e89ee2b 100644 --- a/addons/common/functions/fnc_positionToASL.sqf +++ b/addons/common/functions/fnc_positionToASL.sqf @@ -10,6 +10,9 @@ * Return Value: * None * + * Example: + * [1, 1, 1] call ace_common_fnc_positionToASL + * * Public: Yes */ #include "script_component.hpp" diff --git a/addons/common/functions/fnc_progressBar.sqf b/addons/common/functions/fnc_progressBar.sqf index 7103dd08e4..37fb17190a 100644 --- a/addons/common/functions/fnc_progressBar.sqf +++ b/addons/common/functions/fnc_progressBar.sqf @@ -4,16 +4,16 @@ * Finish/Failure/Conditional are all passed [_args, _elapsedTime, _totalTime, _errorCode] * * Arguments: - * 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. - * 4: STRING - (Optional) Localized Title - * 5: CODE - (Optional) Code to check each frame - * 6: ARRAY - (Optional) Exceptions for checking EFUNC(common,canInteractWith) + * 0: Total Time (in game "time" seconds) + * 1: Arguments, passed to condition, fail and finish + * 2: On Finish: Code called or STRING raised as event. + * 3: On Failure: Code called or STRING raised as event. + * 4: (Optional) Localized Title + * 5: Code to check each frame (Optional) + * 6: Exceptions for checking EFUNC(common,canInteractWith) (Optional) * * Return Value: - * Nothing + * None * * Example: * [5, [], {Hint "Finished!"}, {hint "Failure!"}, "My Title"] call ace_common_fnc_progressBar diff --git a/addons/common/functions/fnc_readSettingFromModule.sqf b/addons/common/functions/fnc_readSettingFromModule.sqf index b08ceb1bcd..21e7dc7e4b 100644 --- a/addons/common/functions/fnc_readSettingFromModule.sqf +++ b/addons/common/functions/fnc_readSettingFromModule.sqf @@ -11,6 +11,9 @@ * Return Value: * None * + * Example: + * [MODULE, "Param", "paramname"] call ace_common_fnc_readSettingFromModule + * * Public: No */ #include "script_component.hpp" diff --git a/addons/common/functions/fnc_receiveRequest.sqf b/addons/common/functions/fnc_receiveRequest.sqf index 1bb48428df..a3f10550af 100644 --- a/addons/common/functions/fnc_receiveRequest.sqf +++ b/addons/common/functions/fnc_receiveRequest.sqf @@ -3,11 +3,18 @@ * N/A * * Arguments: - * ? + * 0: caller + * 1: target + * 2: requestID + * 3: Message + * 4: callback (NOT USED) * * Return Value: * None * + * Example: + * [bob, kevin, "ID", "Message", {Callback}] call ace_common_fnc_recieveRequest + * * Public: No */ #include "script_component.hpp" diff --git a/addons/common/functions/fnc_removeActionEventHandler.sqf b/addons/common/functions/fnc_removeActionEventHandler.sqf index 60e551590d..db711b77f4 100644 --- a/addons/common/functions/fnc_removeActionEventHandler.sqf +++ b/addons/common/functions/fnc_removeActionEventHandler.sqf @@ -10,6 +10,9 @@ * Return Value: * None * + * Example: + * [bob, "DefaultAction", 5] call ace_common_fnc_removeActionEventHandler + * * Public: No */ #include "script_component.hpp" diff --git a/addons/common/functions/fnc_removeActionMenuEventHandler.sqf b/addons/common/functions/fnc_removeActionMenuEventHandler.sqf index 943e3b4e22..9fb8ee6588 100644 --- a/addons/common/functions/fnc_removeActionMenuEventHandler.sqf +++ b/addons/common/functions/fnc_removeActionMenuEventHandler.sqf @@ -10,6 +10,9 @@ * Return Value: * None * + * Example: + * [bob, "DefaultAction", 5] call ace_common_fnc_removeActionMenuEventHandler + * * Public: No */ #include "script_component.hpp" diff --git a/addons/common/functions/fnc_removeCanInteractWithCondition.sqf b/addons/common/functions/fnc_removeCanInteractWithCondition.sqf index b267e84557..8c7c72d861 100644 --- a/addons/common/functions/fnc_removeCanInteractWithCondition.sqf +++ b/addons/common/functions/fnc_removeCanInteractWithCondition.sqf @@ -8,6 +8,9 @@ * Return Value: * None * + * Example: + * ["ID"] call ace_common_fnc_removeCanInteractWithCondition + * * Public: No */ #include "script_component.hpp" diff --git a/addons/common/functions/fnc_removeMapMarkerCreatedEventHandler.sqf b/addons/common/functions/fnc_removeMapMarkerCreatedEventHandler.sqf index 825281c3e0..bda7877a70 100644 --- a/addons/common/functions/fnc_removeMapMarkerCreatedEventHandler.sqf +++ b/addons/common/functions/fnc_removeMapMarkerCreatedEventHandler.sqf @@ -8,6 +8,9 @@ * Return Value: * None * + * Example: + * [5] call ace_common_fnc_removeMapMarkerCreatedEventHandler + * * Public: Yes */ #include "script_component.hpp" diff --git a/addons/common/functions/fnc_removeSpecificMagazine.sqf b/addons/common/functions/fnc_removeSpecificMagazine.sqf index 4ca5eec6d7..73fe910673 100644 --- a/addons/common/functions/fnc_removeSpecificMagazine.sqf +++ b/addons/common/functions/fnc_removeSpecificMagazine.sqf @@ -10,6 +10,9 @@ * Return Value: * None * + * Example: + * [bob, "magazine", 5] call ace_common_fnc_removeSpecificMagazine + * * Public: No */ #include "script_component.hpp" diff --git a/addons/common/functions/fnc_removeSyncedEventHandler.sqf b/addons/common/functions/fnc_removeSyncedEventHandler.sqf index 090ecf4320..f256c21203 100644 --- a/addons/common/functions/fnc_removeSyncedEventHandler.sqf +++ b/addons/common/functions/fnc_removeSyncedEventHandler.sqf @@ -6,7 +6,10 @@ * 0: Name * * Return Value: - * Boolean of success + * Boolean of success + * + * Example: + * ["bob"] call ace_common_fnc_removeSyncedEventHandler * * Public: No */ diff --git a/addons/common/functions/fnc_requestCallback.sqf b/addons/common/functions/fnc_requestCallback.sqf index 399f50466d..e28ff9439f 100644 --- a/addons/common/functions/fnc_requestCallback.sqf +++ b/addons/common/functions/fnc_requestCallback.sqf @@ -3,10 +3,13 @@ * N/A * * Arguments: - * ? + * ? * * Return Value: - * ? + * ? + * + * Example: + * [bob] call ace_common_fnc_requestCallback * * Public: No */ diff --git a/addons/common/functions/fnc_requestSyncedEvent.sqf b/addons/common/functions/fnc_requestSyncedEvent.sqf index e35c1e3645..fd277c4b36 100644 --- a/addons/common/functions/fnc_requestSyncedEvent.sqf +++ b/addons/common/functions/fnc_requestSyncedEvent.sqf @@ -6,7 +6,10 @@ * 0: eventName * * Return Value: - * Boolean of success + * Boolean of success + * + * Example: + * ["event"] call ace_common_fnc_requestSyncedEvent * * Public: No */ diff --git a/addons/common/functions/fnc_resetAllDefaults.sqf b/addons/common/functions/fnc_resetAllDefaults.sqf index 6432f3759e..367c72d5e9 100644 --- a/addons/common/functions/fnc_resetAllDefaults.sqf +++ b/addons/common/functions/fnc_resetAllDefaults.sqf @@ -3,10 +3,13 @@ * reset all variables that have been defined * * Arguments: - * ? + * 0: Unit * * Return Value: - * ? + * ? + * + * Example: + * [bob] call ace_common_fnc_resetAllDefaults * * Public: No */ diff --git a/addons/common/functions/fnc_restoreVariablesJIP.sqf b/addons/common/functions/fnc_restoreVariablesJIP.sqf index 39626514bb..921be28165 100644 --- a/addons/common/functions/fnc_restoreVariablesJIP.sqf +++ b/addons/common/functions/fnc_restoreVariablesJIP.sqf @@ -8,6 +8,9 @@ * Return Value: * None * + * Example: + * [bob] call ace_common_fnc_restoreVariablesJIP + * * Public: No */ #include "script_component.hpp" diff --git a/addons/common/functions/fnc_runTests.sqf b/addons/common/functions/fnc_runTests.sqf new file mode 100644 index 0000000000..538f321765 --- /dev/null +++ b/addons/common/functions/fnc_runTests.sqf @@ -0,0 +1,48 @@ +/* + * Author: PabstMirror + * Run test functions. + * + * Arguments: + * 0: Specific test to run (default is to run all) (default: #all) + * + * Return Value: + * None + * + * Example: + * [] call ace_common_fnc_runTests + * ["fcs"] call ace_common_fnc_runTests + * + * Public: Yes + */ +#include "script_component.hpp" + +params [["_specificTest", "#all", [""]]]; + +private _startTime = diag_tickTime; +private _fails = []; +private _total = 0; + +INFO_1("ace_common_fnc_runTests starting for [%1]", _specificTest); + +{ + private _testName = configName _x; + if ((_specificTest == "#all") || {_specificTest == _testName}) then { + _total = _total + 1; + private _testFile = getText _x; + diag_log text format ["----- Starting Testing %1 [%2] -----", _testName, _testFile]; + private _return = ([nil] apply (compile preProcessFileLineNumbers _testFile)) select 0; + if ((isNil "_return") || {!(_return isEqualTo true)}) then { + systemChat format ["Test [%1] Failed", _testName]; + diag_log text format ["----- Finished Testing %1 [Failed] -----", _testName]; + _fails pushBack _testName; + } else { + diag_log text format ["----- Finished Testing %1 [Passed] -----", _testName]; + }; + }; +} forEach (configProperties [configFile >> "ACE_Tests"]); + +INFO_1("ace_common_fnc_runTests finished in %1 ms", (1000 * (diag_tickTime - _startTime)) toFixed 1); +INFO_2("[%1 / %2] Tests Passed", (_total - (count _fails)), _total); +if (!(_fails isEqualTo [])) then { + INFO_1("Failed: %1", _fails); +}; diff --git a/addons/common/functions/fnc_sendRequest.sqf b/addons/common/functions/fnc_sendRequest.sqf index a0c505c575..55a3da9873 100644 --- a/addons/common/functions/fnc_sendRequest.sqf +++ b/addons/common/functions/fnc_sendRequest.sqf @@ -5,13 +5,16 @@ * Arguments: * 0: caller * 1: target - * 2: requestID (STRING) - * 3: requestMessage Will be localized for other target object. (STRING) - * 4: callback Code called upon accept or decline. (CODE) + * 2: requestID + * 3: requestMessage Will be localized for other target object. + * 4: callback Code called upon accept or decline. * * Return Value: * None * + * Example: + * [bob, kevin, "ID", "Message", {callback}] call ace_common_fnc_sendRequest + * * Public: Yes */ #include "script_component.hpp" diff --git a/addons/common/functions/fnc_setApproximateVariablePublic.sqf b/addons/common/functions/fnc_setApproximateVariablePublic.sqf index 549dea9eb4..e888efe3c2 100644 --- a/addons/common/functions/fnc_setApproximateVariablePublic.sqf +++ b/addons/common/functions/fnc_setApproximateVariablePublic.sqf @@ -9,7 +9,7 @@ * 3: Absolute tolerance * * Return Value: - * Nothing. + * None * * Example: * [player, "balls", 2, 0.1] call ace_common_fnc_setApproximateVariablePublic; diff --git a/addons/common/functions/fnc_setDefinedVariable.sqf b/addons/common/functions/fnc_setDefinedVariable.sqf index 6f1f0c2e58..70b8ef42e3 100644 --- a/addons/common/functions/fnc_setDefinedVariable.sqf +++ b/addons/common/functions/fnc_setDefinedVariable.sqf @@ -10,6 +10,9 @@ * Return Value: * None * + * Example: + * [bob, "var", 5] call ace_common_fnc_setDefinedVariable + * * Public: Yes */ #include "script_component.hpp" diff --git a/addons/common/functions/fnc_setDisableUserInputStatus.sqf b/addons/common/functions/fnc_setDisableUserInputStatus.sqf index ec475f744f..b217570dac 100644 --- a/addons/common/functions/fnc_setDisableUserInputStatus.sqf +++ b/addons/common/functions/fnc_setDisableUserInputStatus.sqf @@ -9,6 +9,9 @@ * Return Value: * None * + * Example: + * ["id", true] call ace_common_fnc_setDisableUserInputStatus + * * Public: Yes */ #include "script_component.hpp" diff --git a/addons/common/functions/fnc_setName.sqf b/addons/common/functions/fnc_setName.sqf index 1b2b515ec2..e93e09c0f0 100644 --- a/addons/common/functions/fnc_setName.sqf +++ b/addons/common/functions/fnc_setName.sqf @@ -8,11 +8,15 @@ * Return Value: * None * + * Example: + * [bob] call ace_common_fnc_setName + * * Public: No */ #include "script_component.hpp" params ["_unit"]; +TRACE_3("setName",_unit,alive _unit,name _unit); if (isNull _unit || {!alive _unit}) exitWith {}; diff --git a/addons/common/functions/fnc_setParameter.sqf b/addons/common/functions/fnc_setParameter.sqf index b24e2506b5..723d49ea0c 100644 --- a/addons/common/functions/fnc_setParameter.sqf +++ b/addons/common/functions/fnc_setParameter.sqf @@ -4,11 +4,14 @@ * * Arguments: * 0: Parameter name - * 1: Value + * 1: Value * * Return Value: * None * + * Example: + * ["Name", 5] call ace_common_fnc_setParameter + * * Public: Yes * * Deprecated diff --git a/addons/common/functions/fnc_setPitchBankYaw.sqf b/addons/common/functions/fnc_setPitchBankYaw.sqf index fecc16208c..1b986c6445 100644 --- a/addons/common/functions/fnc_setPitchBankYaw.sqf +++ b/addons/common/functions/fnc_setPitchBankYaw.sqf @@ -11,6 +11,9 @@ * Return Value: * None * + * Example: + * [bob, 1, 2, 3] call ace_common_fnc_setPitchBankYaw + * * Public: Yes */ #include "script_component.hpp" diff --git a/addons/common/functions/fnc_setPlayerOwner.sqf b/addons/common/functions/fnc_setPlayerOwner.sqf new file mode 100644 index 0000000000..5b21db0190 --- /dev/null +++ b/addons/common/functions/fnc_setPlayerOwner.sqf @@ -0,0 +1,54 @@ +/* + * Author: PabstMirror + * Sets the player's owner id as a variable on his player ojbect. + * Should be called on all machines (including server) + * Note: Needs to wait for CBA_clientID to be recieved from server. + * + * Arguments: + * None + * + * Return Value: + * None + * + * Example: + * [] call ace_common_fnc_setPlayerOwner + * + * Public: No + */ + +// #define DEBUG_MODE_FULL +#include "script_component.hpp" + +if (missionNameSpace getVariable [QGVAR(setPlayerOwnerRunning), false]) exitWith {}; +GVAR(setPlayerOwnerRunning) = true; + +if (isServer) then { + addMissionEventHandler ["HandleDisconnect", { + params ["_dcPlayer"]; + TRACE_1("HandleDisconnect eh",_dcPlayer); + if (!isNil {_dcPlayer getVariable QGVAR(playerOwner)}) then { + _dcPlayer setVariable [QGVAR(playerOwner), nil, true]; + }; + }]; +}; + +if (hasInterface) then { + [{ + (!isNil "CBA_clientID") && {CBA_clientID > -1} + }, { + TRACE_1("CBA_clientID ready",CBA_clientID); + + ["unit", { + params ["_newUnit", "_oldUnit"]; + TRACE_2("unit changed",_newUnit,_oldUnit); + if ((_oldUnit getVariable [QGVAR(playerOwner), -1]) == CBA_clientID) then { + _oldUnit setVariable [QGVAR(playerOwner), nil, true]; + }; + if (alive _newUnit) then { + _newUnit setVariable [QGVAR(playerOwner), CBA_clientID, true]; + }; + }, true] call CBA_fnc_addPlayerEventHandler; + + }, []] call CBA_fnc_waitUntilAndExecute; +}; + diff --git a/addons/common/functions/fnc_setProne.sqf b/addons/common/functions/fnc_setProne.sqf index c40b0de254..8df8a4d900 100644 --- a/addons/common/functions/fnc_setProne.sqf +++ b/addons/common/functions/fnc_setProne.sqf @@ -8,6 +8,9 @@ * Return Value: * None * + * Example: + * [bob] call ace_common_fnc_setProne + * * Public: Yes */ #include "script_component.hpp" diff --git a/addons/common/functions/fnc_setSettingFromConfig.sqf b/addons/common/functions/fnc_setSettingFromConfig.sqf index ac7a0f4875..6308438ac8 100644 --- a/addons/common/functions/fnc_setSettingFromConfig.sqf +++ b/addons/common/functions/fnc_setSettingFromConfig.sqf @@ -8,6 +8,9 @@ * Return Value: * None * + * Example: + * [CONFIG] call ace_common_fnc_setSettingFromConfig + * * Public: No */ #include "script_component.hpp" diff --git a/addons/common/functions/fnc_setVariableJIP.sqf b/addons/common/functions/fnc_setVariableJIP.sqf index 35e8c0d116..151d7b9925 100644 --- a/addons/common/functions/fnc_setVariableJIP.sqf +++ b/addons/common/functions/fnc_setVariableJIP.sqf @@ -10,6 +10,9 @@ * Return Value: * None * + * Example: + * [bob, "varname", 5] call ace_common_fnc_setVariableJIP + * * Public: No */ #include "script_component.hpp" diff --git a/addons/common/functions/fnc_setVariablePublic.sqf b/addons/common/functions/fnc_setVariablePublic.sqf index 5eeff87aee..2eac69f6ce 100644 --- a/addons/common/functions/fnc_setVariablePublic.sqf +++ b/addons/common/functions/fnc_setVariablePublic.sqf @@ -9,7 +9,7 @@ * 3: Embargo delay (Optional. Default: 1) * * Return Value: - * Nothing. + * None * * Example: * [player, "balls", 2, 1] call ace_common_fnc_setVariablePublic; @@ -48,6 +48,7 @@ TRACE_2("Starting Embargo", _varName, _delay); //If value at start of embargo doesn't equal current, then broadcast and start new embargo if (!(_value isEqualTo _curValue)) then { + _this set [2, _curValue]; _this call FUNC(setVariablePublic); }; }, _this, _delay] call CBA_fnc_waitAndExecute; diff --git a/addons/common/functions/fnc_setVolume.sqf b/addons/common/functions/fnc_setVolume.sqf index 37e1f04cfa..5d7f349ce1 100644 --- a/addons/common/functions/fnc_setVolume.sqf +++ b/addons/common/functions/fnc_setVolume.sqf @@ -8,6 +8,9 @@ * Return Value: * None * + * Example: + * [true] call ace_common_fnc_setVolume + * * Public: Yes * * Note: Uses player diff --git a/addons/common/functions/fnc_showHud.sqf b/addons/common/functions/fnc_showHud.sqf index 7c91ab3592..4fe088d3a8 100644 --- a/addons/common/functions/fnc_showHud.sqf +++ b/addons/common/functions/fnc_showHud.sqf @@ -1,11 +1,11 @@ /* * Author: PabstMirror - * Allows multiple sources to not overwrite showHud command - * Bitwise AND Logic (a single false in a mask will make it false) + * Allows multiple sources to not overwrite showHud command. + * Bitwise AND Logic (a single false in a mask will make it false). * * Arguments: - * 0: Source ID - * 1: Show Hud Bool Array (8 to set, empty to remove) + * 0: Source ID (default: "") + * 1: Show Hud Bool Array (8 to set, empty to remove) (default: []) * - [hud, info, radar, compass, direction, menu, group, cursors] * - hud: Boolean - show scripted HUD (same as normal showHUD true/false) * - info: Boolean - show vehicle + soldier info (hides weapon info from the HUD as well) diff --git a/addons/common/functions/fnc_showUser.sqf b/addons/common/functions/fnc_showUser.sqf index 2e7af12a3f..6c78e03f97 100644 --- a/addons/common/functions/fnc_showUser.sqf +++ b/addons/common/functions/fnc_showUser.sqf @@ -8,6 +8,9 @@ * Return Value: * None * + * Example: + * [bob] call ace_common_fnc_showUser + * * Public: No */ #include "script_component.hpp" diff --git a/addons/common/functions/fnc_statusEffect_addType.sqf b/addons/common/functions/fnc_statusEffect_addType.sqf index 2934f4ae98..c423db2393 100644 --- a/addons/common/functions/fnc_statusEffect_addType.sqf +++ b/addons/common/functions/fnc_statusEffect_addType.sqf @@ -8,7 +8,7 @@ * 2: Common Effect Reaons to pre-seed durring init * * Return Value: - * Nothing + * None * * Example: * ["setCaptive", true, []] call ace_common_fnc_statusEffect_addType diff --git a/addons/common/functions/fnc_statusEffect_localEH.sqf b/addons/common/functions/fnc_statusEffect_localEH.sqf index 5490029a3b..84f3e0e9a2 100644 --- a/addons/common/functions/fnc_statusEffect_localEH.sqf +++ b/addons/common/functions/fnc_statusEffect_localEH.sqf @@ -4,9 +4,10 @@ * * Arguments: * 0: vehicle that it will be attached to (player or vehicle) + * 1: isLocal * * Return Value: - * Nothing + * None * * Example: * [player, true] call ace_common_fnc_statusEffect_localEH @@ -19,7 +20,7 @@ params ["_object", "_isLocal"]; TRACE_2("params",_object,_isLocal); -//Only run this after the settings are initialized +//Only run this after the settings are initialized //Need to wait for all EH to be installed (local event will happen between pre and post init) if !(GVAR(settingsInitFinished)) exitWith { TRACE_1("pushing to runAtSettingsInitialized", _this); diff --git a/addons/common/functions/fnc_statusEffect_resetVariables.sqf b/addons/common/functions/fnc_statusEffect_resetVariables.sqf index 2a307c84e5..7f638bcbef 100644 --- a/addons/common/functions/fnc_statusEffect_resetVariables.sqf +++ b/addons/common/functions/fnc_statusEffect_resetVariables.sqf @@ -6,7 +6,7 @@ * 0: vehicle that it will be attached to (player or vehicle) * * Return Value: - * Nothing + * None * * Example: * [player, true] call ace_common_fnc_statusEffect_resetVariables diff --git a/addons/common/functions/fnc_statusEffect_respawnEH.sqf b/addons/common/functions/fnc_statusEffect_respawnEH.sqf index 92717b68c7..ba3058be19 100644 --- a/addons/common/functions/fnc_statusEffect_respawnEH.sqf +++ b/addons/common/functions/fnc_statusEffect_respawnEH.sqf @@ -6,7 +6,7 @@ * 0: vehicle that it will be attached to (player or vehicle) * * Return Value: - * Nothing + * None * * Example: * [player, objNull] call ace_common_fnc_statusEffect_respawnEH @@ -19,7 +19,7 @@ params ["_object"]; TRACE_1("params",_object); -//Only run this after the settings are initialized +//Only run this after the settings are initialized //Need to wait for all EH to be installed (local event will happen between pre and post init) if !(GVAR(settingsInitFinished)) exitWith { TRACE_1("pushing to runAtSettingsInitialized", _this); diff --git a/addons/common/functions/fnc_statusEffect_sendEffects.sqf b/addons/common/functions/fnc_statusEffect_sendEffects.sqf index f82ab10427..0945fc3424 100644 --- a/addons/common/functions/fnc_statusEffect_sendEffects.sqf +++ b/addons/common/functions/fnc_statusEffect_sendEffects.sqf @@ -7,7 +7,7 @@ * 1: Effect name (or "" to send all) * * Return Value: - * Nothing + * None * * Example: * [player, ""] call ace_common_fnc_statusEffect_sendEffects diff --git a/addons/common/functions/fnc_statusEffect_set.sqf b/addons/common/functions/fnc_statusEffect_set.sqf index a0be8d8719..4908da5395 100644 --- a/addons/common/functions/fnc_statusEffect_set.sqf +++ b/addons/common/functions/fnc_statusEffect_set.sqf @@ -9,7 +9,7 @@ * 3: Is Set (true adds/false removes) * * Return Value: - * Nothing + * None * * Example: * [player, "setCaptive", "reason1", true] call ace_common_fnc_statusEffect_set diff --git a/addons/common/functions/fnc_stringCompare.sqf b/addons/common/functions/fnc_stringCompare.sqf index ad3073eb1e..b14eedb653 100644 --- a/addons/common/functions/fnc_stringCompare.sqf +++ b/addons/common/functions/fnc_stringCompare.sqf @@ -7,7 +7,10 @@ * 1: stringB * * Return Value: - * Number of matching characters >NUMBER> + * Number of matching characters + * + * Example: + * ["a", "b"] call ace_common_fnc_stringCompare * * Public: Yes */ diff --git a/addons/common/functions/fnc_stringRemoveWhiteSpace.sqf b/addons/common/functions/fnc_stringRemoveWhiteSpace.sqf deleted file mode 100644 index 51d43d71a9..0000000000 --- a/addons/common/functions/fnc_stringRemoveWhiteSpace.sqf +++ /dev/null @@ -1,22 +0,0 @@ -/* - * Author: Glowbal - * Removes whitespace from a string. - * - * Arguments: - * 0: String - * - * Return Value: - * String Without Whitespace - * - * Example: - * _stringWithoutWhitespace = ["String with whitespace"] call ace_common_fnc_stringRemoveWhiteSpace - * - * Public: Yes - */ -#include "script_component.hpp" - -params ["_string"]; - -ACE_DEPRECATED(QFUNC(stringRemoveWhiteSpace),"3.10.0","CBA_fnc_removeWhitespace"); - -(_string splitString " ") joinString "" diff --git a/addons/common/functions/fnc_stringToColoredText.sqf b/addons/common/functions/fnc_stringToColoredText.sqf index e6e19e4869..c072da9253 100644 --- a/addons/common/functions/fnc_stringToColoredText.sqf +++ b/addons/common/functions/fnc_stringToColoredText.sqf @@ -9,6 +9,9 @@ * Return Value: * Text * + * Example: + * ["text", [0, 1, 2]] call ace_common_fnc_stringToColoredText + * * Public: Yes */ #include "script_component.hpp" diff --git a/addons/common/functions/fnc_switchToGroupSide.sqf b/addons/common/functions/fnc_switchToGroupSide.sqf index 3a559a7a65..914c12034f 100644 --- a/addons/common/functions/fnc_switchToGroupSide.sqf +++ b/addons/common/functions/fnc_switchToGroupSide.sqf @@ -11,11 +11,14 @@ * Return Value: * None * + * Example: + * [bob, true, "id", SIDE] call ace_common_fnc_switchToGroupSide + * * Public: Yes */ #include "script_component.hpp" -params [["_unit", objNull], ["_switch", false], ["_id", ""], ["_side", side _unit]]; +params [["_unit", objNull], ["_switch", false], ["_id", ""], ["_side", sideUnknown]]; private _previousGroupsList = _unit getVariable [QGVAR(previousGroupSwitchTo), []]; diff --git a/addons/common/functions/fnc_syncedEvent.sqf b/addons/common/functions/fnc_syncedEvent.sqf index 4a364bf730..a6a7fb30e3 100644 --- a/addons/common/functions/fnc_syncedEvent.sqf +++ b/addons/common/functions/fnc_syncedEvent.sqf @@ -10,6 +10,9 @@ * Return Value: * Boolean of success * + * Example: + * ["bob", [args], 5] call ace_common_fnc_syncedEvent + * * Public: No */ #include "script_component.hpp" diff --git a/addons/common/functions/fnc_syncedEventPFH.sqf b/addons/common/functions/fnc_syncedEventPFH.sqf index 8fcd143536..c35be73d5c 100644 --- a/addons/common/functions/fnc_syncedEventPFH.sqf +++ b/addons/common/functions/fnc_syncedEventPFH.sqf @@ -1,5 +1,5 @@ /* - * Author: ? + * Author: ACE-Team * * ? * @@ -7,9 +7,12 @@ * ? * * Return Value: - * ? + * None * - * Public: ? + * Example: + * [?] call ace_common_fnc_syncedEventPFH + * + * Public: No */ #include "script_component.hpp" diff --git a/addons/common/functions/fnc_throttledPublicVariable.sqf b/addons/common/functions/fnc_throttledPublicVariable.sqf index 3aaa3c8f47..7d86a75a29 100644 --- a/addons/common/functions/fnc_throttledPublicVariable.sqf +++ b/addons/common/functions/fnc_throttledPublicVariable.sqf @@ -27,7 +27,7 @@ if (isNil QGVAR(publishSchedId)) then { GVAR(publishSchedId) = [{ if (diag_tickTime > GVAR(publishNextTime)) then { { - _x params [_unit, _varName]; + _x params ["_unit", "_varName"]; _unit setVariable [_varName, _unit getVariable _varName, true]; false } count GVAR(publishVarNames); diff --git a/addons/common/functions/fnc_toBin.sqf b/addons/common/functions/fnc_toBin.sqf index f8ec0bac68..f3e08711a7 100644 --- a/addons/common/functions/fnc_toBin.sqf +++ b/addons/common/functions/fnc_toBin.sqf @@ -8,6 +8,9 @@ * Return Value: * A binary number as string * + * Example: + * [5] call ace_common_fnc_toBin + * * Public: Yes */ #include "script_component.hpp" diff --git a/addons/common/functions/fnc_toBitmask.sqf b/addons/common/functions/fnc_toBitmask.sqf index 333e5c737b..ac5b7f056e 100644 --- a/addons/common/functions/fnc_toBitmask.sqf +++ b/addons/common/functions/fnc_toBitmask.sqf @@ -8,6 +8,9 @@ * Return Value: * Bitmask * + * Example: + * [[true, false]] call ace_common_fnc_toBitmask + * * Public: Yes */ #include "script_component.hpp" diff --git a/addons/common/functions/fnc_toHex.sqf b/addons/common/functions/fnc_toHex.sqf index c558aab04b..2c82c1c4a3 100644 --- a/addons/common/functions/fnc_toHex.sqf +++ b/addons/common/functions/fnc_toHex.sqf @@ -8,6 +8,9 @@ * Return Value: * A hexadecimal number as string * + * Example: + * [154] call ace_common_fnc_toHex + * * Public: Yes */ #include "script_component.hpp" diff --git a/addons/common/functions/fnc_toNumber.sqf b/addons/common/functions/fnc_toNumber.sqf index c375dfb02e..eeede0813b 100644 --- a/addons/common/functions/fnc_toNumber.sqf +++ b/addons/common/functions/fnc_toNumber.sqf @@ -6,7 +6,7 @@ * 0: Value to attempt to convert to number or if number simply return number. * * Return Value: - * + * Number * * Example: * number = ["102"] call ace_common_fnc_toNumber; diff --git a/addons/common/functions/fnc_translateToModelSpace.sqf b/addons/common/functions/fnc_translateToModelSpace.sqf index 309387086f..0d7a5551fc 100644 --- a/addons/common/functions/fnc_translateToModelSpace.sqf +++ b/addons/common/functions/fnc_translateToModelSpace.sqf @@ -1,14 +1,17 @@ /* - * Author: ? + * Author: ACE-Team * ? * * Arguments: - * ? + * * * Return Value: - * ? + * Something * - * Public: ? + * Example: + * [UNKNOWN] call ace_common_fnc_translateToModelSpace + * + * Public: No */ #include "script_component.hpp" diff --git a/addons/common/functions/fnc_translateToWeaponSpace.sqf b/addons/common/functions/fnc_translateToWeaponSpace.sqf index fab3fe6a3c..af3abddb74 100644 --- a/addons/common/functions/fnc_translateToWeaponSpace.sqf +++ b/addons/common/functions/fnc_translateToWeaponSpace.sqf @@ -1,14 +1,17 @@ /* - * Author: ? + * Author: ACE-Team * ? * * Arguments: - * ? + * * * Return Value: - * ? + * Unknown * - * Public: ? + * Example: + * [UNKOWN] call ace_common_fnc_translateToWeaponSpace + * + * Public: No */ #include "script_component.hpp" diff --git a/addons/common/functions/fnc_uniqueElements.sqf b/addons/common/functions/fnc_uniqueElements.sqf index 471ba47457..62a68a71ff 100644 --- a/addons/common/functions/fnc_uniqueElements.sqf +++ b/addons/common/functions/fnc_uniqueElements.sqf @@ -8,6 +8,9 @@ * Return Value: * Copy of original array * + * Example: + * [[array]] call ace_common_fnc_uniqueElements + * * Public: Yes */ #include "script_component.hpp" diff --git a/addons/common/functions/fnc_unloadPersonLocal.sqf b/addons/common/functions/fnc_unloadPersonLocal.sqf index dbc28dc977..762b643bc1 100644 --- a/addons/common/functions/fnc_unloadPersonLocal.sqf +++ b/addons/common/functions/fnc_unloadPersonLocal.sqf @@ -3,12 +3,15 @@ * Unload a person from a vehicle, local * * Arguments: - * 0: unit to unload + * 0: Unit to unload * 1: Vehicle - * 2: Unloader (player) + * 2: Unloader (player) (default: objNull) * * Return Value: - * Returns true if succesfully unloaded person + * Succesfully unloaded person + * + * Example: + * [bob, car, bob] call ace_common_fnc_unloadpersonLocal * * Public: No */ diff --git a/addons/common/functions/fnc_unmuteUnit.sqf b/addons/common/functions/fnc_unmuteUnit.sqf index b6d673cfd5..7d81ae7346 100644 --- a/addons/common/functions/fnc_unmuteUnit.sqf +++ b/addons/common/functions/fnc_unmuteUnit.sqf @@ -9,6 +9,9 @@ * Return Value: * None * + * Example: + * [bob, "because"] call ace_common_fnc_unmuteUnit + * * Public: Yes */ #include "script_component.hpp" diff --git a/addons/common/functions/fnc_useItem.sqf b/addons/common/functions/fnc_useItem.sqf index 2d2116b38f..3accecc429 100644 --- a/addons/common/functions/fnc_useItem.sqf +++ b/addons/common/functions/fnc_useItem.sqf @@ -9,6 +9,9 @@ * Return Value: * if item has been used. * + * Example: + * [bob, "gun"] call ace_common_fnc_useItem + * * Public: Yes */ #include "script_component.hpp" diff --git a/addons/common/functions/fnc_useMagazine.sqf b/addons/common/functions/fnc_useMagazine.sqf index 4dc6136fa6..646d461d21 100644 --- a/addons/common/functions/fnc_useMagazine.sqf +++ b/addons/common/functions/fnc_useMagazine.sqf @@ -9,6 +9,9 @@ * Return Value: * if magazine has been used. * + * Example: + * [bob, "magazine"] call ace_common_fnc_useMagazine + * * Public: Yes */ #include "script_component.hpp" diff --git a/addons/common/functions/fnc_watchVariable.sqf b/addons/common/functions/fnc_watchVariable.sqf index 931450bd22..012a726a6c 100644 --- a/addons/common/functions/fnc_watchVariable.sqf +++ b/addons/common/functions/fnc_watchVariable.sqf @@ -1,27 +1,27 @@ /* * Author: PabstMirror - * Shows multiple watched variables on the main display (for easy debugging) + * Shows multiple watched variables on the main display (for easy debugging). * * Arguments: - * 0: Title (var name) - * 1: Code to generate result (passed nothing, can return any) - * 2: Array containing modifiers + * 0: Title (var name) (default: "") + * 1: Code to generate result (passed nothing, can return any) (default: {}) + * 2: Array containing modifiers (default: []) * For Numbers: - * 0: Show Delta change (default: true) - * 1: Slider Min Value (default: 0) - * 1: Slider Max Value (default: 0) + * 0: Show Delta change (default: true) + * 1: Slider Min Value (default: 0) + * 1: Slider Max Value (default: 0) * For Anything else: - * 0: Number of structured text lines (default: 1) + * 0: Number of structured text lines (default: 1) * * Return Value: - * Nothing + * None * * Example: - * ["CBA_missionTime"] call ace_common_fnc_watchVariable; // Uses title as code - * ["diag_frameNo", {diag_frameNo}, [false]] call ace_common_fnc_watchVariable; // Won't show delta - * ["blood", {player getVariable "ace_medical_bloodVolume"}, [true, 0, 100]] call ace_common_fnc_watchVariable; // Shows slider - * ["multiLine text", {"Line 1
Line 2"}, [2]] call ace_common_fnc_watchVariable; - * ["player names", {allPlayers apply {name _x}}, [5]] call ace_common_fnc_watchVariable; // handles any data types + * ["CBA_missionTime"] call ace_common_fnc_watchVariable // Uses title as code + * ["diag_frameNo", {diag_frameNo}, [false]] call ace_common_fnc_watchVariable // Won't show delta + * ["blood", {player getVariable "ace_medical_bloodVolume"}, [true, 0, 100]] call ace_common_fnc_watchVariable // Shows slider + * ["multiLine text", {"Line 1
Line 2"}, [2]] call ace_common_fnc_watchVariable + * ["player names", {allPlayers apply {name _x}}, [5]] call ace_common_fnc_watchVariable // handles any data types * * Public: Yes */ diff --git a/addons/common/functions/fnc_waveHeightAt.sqf b/addons/common/functions/fnc_waveHeightAt.sqf index c140b1ce94..1a9049b491 100644 --- a/addons/common/functions/fnc_waveHeightAt.sqf +++ b/addons/common/functions/fnc_waveHeightAt.sqf @@ -3,11 +3,13 @@ * Gets the wave height at a specific location. Uses a logic, so may be performance iffy * * Arguments: - * 0: Position ASL to get height at + * 0: Position ASL to get height at * * Return Value: - * Wave height in meters + * Wave height in meters * + * Example: + * [[5, 2, 5]]] call ace_common_fnc_waveHeightAt * * Public: No */ diff --git a/addons/common/functions/fnc_worldToScreenBounds.sqf b/addons/common/functions/fnc_worldToScreenBounds.sqf index 65b0164ca0..42ffa27317 100644 --- a/addons/common/functions/fnc_worldToScreenBounds.sqf +++ b/addons/common/functions/fnc_worldToScreenBounds.sqf @@ -19,6 +19,9 @@ * 2: Maximal X * 3: Maximal Y * + * Example: + * [bob, [5, 5, 5], [6, 6, 6]] call ace_common_fnc_worldToScreenBounds + * * Public: No */ #include "script_component.hpp" @@ -38,13 +41,13 @@ _bounds params ["_boundsMin", "_boundsMax"]; _boundsMin params ["_boundsMinX", "_boundsMinY", "_boundsMinZ"]; _boundsMax params ["_boundsMaxX", "_boundsMaxY", "_boundsMaxZ"]; -_boundsMinX = _boundsMinX - _marginsX + _offsetsX; -_boundsMinY = _boundsMinY - _marginsY + _offsetsY; -_boundsMinZ = _boundsMinZ - _marginsZ + _offsetsZ; +_boundsMinX = ((_boundsMinX - _marginsX) min 0) + _offsetsX; +_boundsMinY = ((_boundsMinY - _marginsY) min 0) + _offsetsY; +_boundsMinZ = ((_boundsMinZ - _marginsZ) min 0) + _offsetsZ; -_boundsMaxX = _boundsMaxX + _marginsX + _offsetsX; -_boundsMaxY = _boundsMaxY + _marginsY + _offsetsY; -_boundsMaxZ = _boundsMaxZ + _marginsZ + _offsetsZ; +_boundsMaxX = ((_boundsMaxX + _marginsX) max 0) + _offsetsX; +_boundsMaxY = ((_boundsMaxY + _marginsY) max 0) + _offsetsY; +_boundsMaxZ = ((_boundsMaxZ + _marginsZ) max 0) + _offsetsZ; private _boundsCorners = [ [_boundsMinX, _boundsMinY, _boundsMinZ], diff --git a/addons/common/script_component.hpp b/addons/common/script_component.hpp index af8e0a5229..aaa0045a41 100644 --- a/addons/common/script_component.hpp +++ b/addons/common/script_component.hpp @@ -19,3 +19,18 @@ #define VERSION_CONFIG_COMMON VERSION_CONFIG;\ versionDesc = "ACE 3";\ versionAct = QUOTE(call COMPILE_FILE(init_versionTooltip)) + + +#define DIG_SURFACE_BLACKLIST [ \ + "concrete", "concrete_exp", "concrete_int", "int_concrete", "int_concrete_exp", \ + "pavement_exp", "int_pavement_exp", \ + "tiling", "tiles_int", "int_tiles", \ + "roof_tin", "roof_tiles", "rooftiles_exp", \ + "tarmac", "asphalt_exp", \ + "stones_exp", "rock", "stony", \ + "metal", "gridmetal_exp", "metalplate_exp", "int_metalplate_exp", "metal_int", "wavymetal", "wavymetal_exp", "int_metal", "steel_exp", \ + "lino_exp", "int_lino_exp", "int_mat_exp", \ + "wood", "wood_int", "int_wood", "softwood_exp", "int_softwood_exp", "int_solidwood_exp" \ +] + +#define DIG_SURFACE_WHITELIST ["grass"] diff --git a/addons/common/scripts/checkVersionNumber.sqf b/addons/common/scripts/checkVersionNumber.sqf index 6267ed08b2..b4858d38bf 100644 --- a/addons/common/scripts/checkVersionNumber.sqf +++ b/addons/common/scripts/checkVersionNumber.sqf @@ -1,9 +1,7 @@ // by commy2 #include "script_component.hpp" -private ["_client", "_clientVersion", "_count", "_error", "_files", "_index", "_missingAddon", "_missingAddonServer", "_missingAddons", "_missingAddonsServer", "_oldVersionClient", "_oldVersionServer", "_oldVersionsClient", "_oldVersionsServer", "_serverFiles", "_serverVersion", "_serverVersions", "_string", "_version", "_versions"]; - -_files = []; +private _files = []; { if (_x find "a3_" != 0 && {_x find "ace_" != 0} && {!(toLower _x in (missionNamespace getVariable ["ACE_Version_Whitelist", []]))}) then { @@ -11,9 +9,9 @@ _files = []; }; } forEach activatedAddons; -_versions = []; +private _versions = []; { - _version = parseNumber getText (configFile >> "CfgPatches" >> _x >> "version"); + private _version = parseNumber getText (configFile >> "CfgPatches" >> _x >> "version"); _versions set [_forEachIndex, _version]; } forEach _files; @@ -32,27 +30,27 @@ if (!isServer) then { !isNil "ACE_Version_ClientVersions" && {!isNil "ACE_Version_ServerVersions"} }; - _client = profileName; + private _client = profileName; _files = ACE_Version_ClientVersions select 0; _versions = ACE_Version_ClientVersions select 1; - _serverFiles = ACE_Version_ServerVersions select 0; - _serverVersions = ACE_Version_ServerVersions select 1; + private _serverFiles = ACE_Version_ServerVersions select 0; + private _serverVersions = ACE_Version_ServerVersions select 1; // Compare client and server files and versions - _missingAddons = []; - _oldVersionsClient = []; - _oldVersionsServer = []; + private _missingAddons = []; + private _oldVersionsClient = []; + private _oldVersionsServer = []; { - _serverVersion = _serverVersions select _forEachIndex; + private _serverVersion = _serverVersions select _forEachIndex; - _index = _files find _x; + private _index = _files find _x; if (_index == -1) then { if (_x != "ace_server") then {_missingAddons pushBack _x;}; } else { - _clientVersion = _versions select _index; + private _clientVersion = _versions select _index; if (_clientVersion < _serverVersion) then { _oldVersionsClient pushBack [_x, _clientVersion, _serverVersion]; @@ -65,20 +63,20 @@ if (!isServer) then { } forEach _serverFiles; // find client files which the server doesn't have - _missingAddonsServer = []; + private _missingAddonsServer = []; { - _index = _serverFiles find _x; + private _index = _serverFiles find _x; if (_index == -1) then { _missingAddonsServer pushBack _x; } } forEach _files; // display and log error messages - _fnc_cutComma = { - _string = _this; + private _fnc_cutComma = { + private _string = _this; _string = toArray _string; - _count = count _string; + private _count = count _string; _string set [_count - 2, toArray "." select 0]; _string set [_count - 1, -1]; _string = _string - [-1]; @@ -86,11 +84,11 @@ if (!isServer) then { toString _string; }; - _missingAddon = false; + private _missingAddon = false; if (count _missingAddons > 0) then { _missingAddon = true; - _error = format ["[ACE] %1: ERROR missing addon(s): ", _client]; + private _error = format ["[ACE] %1: ERROR missing addon(s): ", _client]; { _error = _error + format ["%1, ", _x]; @@ -103,11 +101,11 @@ if (!isServer) then { [QGVAR(systemChatGlobal), _error] call CBA_fnc_globalEvent; }; - _missingAddonServer = false; + private _missingAddonServer = false; if (count _missingAddonsServer > 0) then { _missingAddonServer = true; - _error = format ["[ACE] %1: ERROR missing server addon(s): ", _client]; + private _error = format ["[ACE] %1: ERROR missing server addon(s): ", _client]; { _error = _error + format ["%1, ", _x]; @@ -120,11 +118,11 @@ if (!isServer) then { [QGVAR(systemChatGlobal), _error] call CBA_fnc_globalEvent; }; - _oldVersionClient = false; + private _oldVersionClient = false; if (count _oldVersionsClient > 0) then { _oldVersionClient = true; - _error = format ["[ACE] %1: ERROR outdated addon(s): ", _client]; + private _error = format ["[ACE] %1: ERROR outdated addon(s): ", _client]; { _error = _error + format ["%1 (client: %2, server: %3), ", _x select 0, _x select 1, _x select 2]; @@ -137,11 +135,11 @@ if (!isServer) then { [QGVAR(systemChatGlobal), _error] call CBA_fnc_globalEvent; }; - _oldVersionServer = false; + private _oldVersionServer = false; if (count _oldVersionsServer > 0) then { _oldVersionServer = true; - _error = format ["[ACE] %1: ERROR outdated server addon(s): ", _client]; + private _error = format ["[ACE] %1: ERROR outdated server addon(s): ", _client]; { _error = _error + format ["%1 (client: %2, server: %3), ", _x select 0, _x select 1, _x select 2]; diff --git a/addons/common/stringtable.xml b/addons/common/stringtable.xml index 620d2066a2..8e6cfdaab5 100644 --- a/addons/common/stringtable.xml +++ b/addons/common/stringtable.xml @@ -12,7 +12,10 @@ ACE-Team ACE-Team ACE-Team - ACE-Team + ACE-チーム + ACE-Team + ACE-製作團隊 + ACE-制作团队 Save @@ -26,6 +29,9 @@ Mentés Salva 保存 + 저장 + 儲存 + 储存 Cancel @@ -39,6 +45,9 @@ Mégse Annulla 中止 + 취소 + 取消 + 取消 ACE Options @@ -52,6 +61,9 @@ ACE Beállítások Opzioni ACE ACE オプション + ACE 옵션 + ACE設定選項 + ACE设定选项 @@ -65,7 +77,10 @@ N É N - N + + + + NNE @@ -78,7 +93,10 @@ NNE ÉÉK NNE - NNE + 北北東 + 북북동 + 北北東 + 北北东 NE @@ -91,7 +109,10 @@ NE ÉK NE - NE + 北東 + 북동 + 東北 + 东北 ENE @@ -104,7 +125,10 @@ LNE KÉK ENE - ENE + 東北東 + 동북동 + 東北東 + 东北东 E @@ -117,7 +141,10 @@ L K E - E + + + + ESE @@ -130,7 +157,10 @@ LSE KDK ESE - ESE + 東南東 + 동남동 + 東南東 + 东南东 SE @@ -143,7 +173,10 @@ SE DK SE - SE + 南東 + 남동 + 東南 + 东南 SSE @@ -156,7 +189,10 @@ SSE DDK SSE - SSE + 南南東 + 남남동 + 南南東 + 南南东 S @@ -169,7 +205,10 @@ S D S - S + + + + SSW @@ -182,7 +221,10 @@ SSO DDNy SSO - SSW + 南南西 + 남남서 + 南南西 + 南南西 SW @@ -195,7 +237,10 @@ SO DNy SO - SW + 南西 + 남서 + 西南 + 西南 WSW @@ -208,7 +253,10 @@ OSO NyDNy OSO - WSW + 西南西 + 서남서 + 西南西 + 西南西 W @@ -221,7 +269,10 @@ O Ny O - W + 西 + + 西 + 西 WNW @@ -234,7 +285,10 @@ ONO NyÉNy ONO - WNW + 北北西 + 서북서 + 西北西 + 西北西 NW @@ -247,7 +301,10 @@ NO ÉNy NO - NW + 北西 + 북서 + 西北 + 西北 NNW @@ -260,7 +317,10 @@ NNO ÉÉNy NNO - NNW + 北北西 + 북북서 + 北北西 + 北北西 Action cancelled. @@ -274,6 +334,9 @@ Művelet megszakítva. Azione cancellata. 動作を中止した。 + 행동 취소됨. + 動作已被取消 + 动作已被取消 [ACE] Miscellaneous Items @@ -287,6 +350,9 @@ [ACE] Egyéb tárgyak [ACE] Oggetti vari [ACE] その他のアイテム + [ACE] 기타 물품. + [ACE] 雜項 + [ACE] 杂项 Disable Command Menu @@ -300,6 +366,9 @@ Disabilita menù di comando Desabilitar menu de comando 指揮メニューを無効化 + 지휘 메뉴 종료 + 關閉命令選單 + 关闭命令选单 Unknown @@ -313,6 +382,9 @@ Inconnu Desconhecido 不明 + 알 수 없음 + 未知的 + 未知的 No Voice @@ -326,6 +398,9 @@ Pas de voix Sem voz 音声なし + 무음 + 沒聲音 + 没声音 Accept Requests @@ -339,6 +414,9 @@ Aceitar Pedido Accetta la richiesta 要求を受け入れ + 요청 수락 + 接受請求 + 接受请求 Decline Requests @@ -352,6 +430,9 @@ Rejeitar pedido Rifiuta la richiesta 要求を拒否 + 요청 거부 + 拒絕請求 + 拒绝请求 Accept Requests send by other players. These can be requests to use / share equipment, perform certain actions. @@ -365,6 +446,9 @@ Más játékosok általi kérések elfogadása. Ezek a kérések vonatkozhatnak a felszerelés használatára/megosztására, valamint különböző cselekményekre. Aceitar pedidos enviados por outros jogadores. Podem ser pedidos para usar/ compartilhar equipamento, realizar certas ações. 他プレイヤからの要求を許可します。他プレイヤは装備を共有し、使うなど特定の動作を行えます。 + 다른 플레이어가 보내온 요청을 수락합니다. 이것은 장비 사용 / 공유 요청, 특정 작업 수행 등이 될 수 있습니다. + 接受由其他玩家送出的請求。包含使用/共享裝備與執行特定動作。 + 接受由其他玩家送出的请求。包含使用/共享装备与执行特定动作。 Decline Requests send by other players. These can be requests to use / share equipment, perform certain actions. @@ -378,6 +462,9 @@ Más játékosok általi kérések elutasítása. Ezek a kérések vonatkozhatnak a felszerelés használatára/megosztására, valamint különböző cselekményekre. Rejeita pedidos enviados por outros jogadores. Podem ser pedidos para usar/ compartilhar equipamento, realizar certas ações. 他プレイヤからの要求を拒否します。他プレイヤは装備を共有し、使うなど特定の動作をできません。 + 다른 플레이어가 보내온 요청을 거부합니다. 이것은 장비 사용 / 공유 요청, 특정 작업 수행 등이 될 수 있습니다. + 拒絕由其他玩家送出的請求。包含使用/共享裝備與執行特定動作。 + 拒绝由其他玩家送出的请求。包含使用/共享装备与执行特定动作。 Feedback icons @@ -391,6 +478,9 @@ Visszajelző ikonok Ícones de Feedback フィードバック アイコン + 피드백 아이콘 + 回饋圖標 + 回馈图标 Select the position of or disable the feedback icons on your screen. These icons will show to provide extra feedback on your character status and actions performed. @@ -404,6 +494,9 @@ Itt beállítható a visszajelző ikonok képernyőn lévő helyzete és jelenléte. Ezek az ikonok extra visszajelzést biztosítanak a karaktered állapotán és végrehajtott cselekvésein. Selecione a posição ou disabilite a posição dos ícones de feedback na sua tela. Esses ícones irão aparecer para mostrar feedback extra do status do seu personagem e ações realizadas. 画面上に表示するフィードバック アイコンの位置や無効化を選択できます。このアイコンは自キャラクター状態や動作の状況をフィードバックするために表示されています。 + 피드백 아이콘의 위치를 설정하거나 비활성화합니다. 피드백 아이콘은 캐릭터의 상세정보와 행동을 보여줍니다. + 選擇位置或取消回饋圖標顯示在螢幕上。這些圖標將顯示出你角色額外的狀態與行動等資訊。 + 选择位置或取消回馈图标显示在荧幕上。这些图标将显示出你角色额外的状态与行动等资讯。 Progress bar location @@ -417,6 +510,9 @@ Állapotjelző sáv helyzete Local da barra de progresso プログレス バーの位置 + 진행 막대의 위치 + 進度欄位置 + 进度栏位置 Set the desired location of the progress bar on your screen. @@ -430,6 +526,9 @@ Itt beállítható az állapotjelző sáv képernyődön lévő helyzete. Define o local desejado da barra de progresso na sua tela. 画面上に表示されるプログレス バーの位置を設定できます。 + 진행 막대를 원하는 곳에 배치합니다. + 設定進度欄在畫面中的位置 + 设定进度栏在画面中的位置 Hint Background color @@ -443,6 +542,9 @@ Súgó háttérszíne Cor do fundo da hint ヒントの背景色 + 힌트 배경색 + 提示的背景顏色 + 提示的背景颜色 The color of the background from the ACE hints. @@ -456,6 +558,9 @@ Az ACE-súgók hátterének színe. A cor de fundo das hints do ACE. ACE によるヒントの背景色を指定します。 + ACE힌트의 배경색을 정합니다. + 設定ACE提示的背景顏色. + 设定ACE提示的背景颜色. Hint text font color @@ -469,6 +574,9 @@ Súgószöveg betűinek színe Cor do do texto da hint ヒント文章の色 + 힌트 글씨색 + 提示文字的顏色 + 提示文字的颜色 The color of the text font from the ACE hints. This color is the default color for all text displayed through the ACE Hint system, if the hint text has no other color specified. @@ -482,6 +590,9 @@ Az ACE-súgók betűkészletének színek. Ez a szín alapértelmezett az összes szövegre az ACE-súgórendszerben, ha a súgószöveg maga nem ad meg más színt. A cor do texto das hints do ACE. Essa cor é a cor default para todos os texos exibidos pelo sistema de hints do ACE , caso o texto da hint não tem outra cor especificada. ACE によるヒントの文章へ、色を設定できます。この色は ACE ヒント システムを介して表示される全文章の色と標準でなっており、特定の色を設定していても、標準色になります。 + ACE 힌트에 쓰이는 글씨 색입니다. 힌트 글씨의 색이 정해지지 않을경우 모든 힌트의 색은 기본으로 설정됩니다. + 設定ACE提示文字的顏色。若提示字體並無指定其他顏色,將會自動選用ACE系統的預設顏色。 + 设定ACE提示文字的颜色。若提示字体并无指定其他颜色,将会自动选用ACE系统的预设颜色。 Banana @@ -495,6 +606,9 @@ Banán Banana 甘蕉 + 바나나 + 香蕉 + 香蕉 A banana is an edible fruit, botanically a berry, produced by several kinds of large herbaceous flowering plants in the genus Musa. @@ -508,6 +622,9 @@ Une banane est un fruit qui, d'un point de vue botanique, fait partie du groupe des baies. Produite par plusieurs sortes de grandes plantes à fleurs herbacées du type Musa. A banana é uma fruta comestível, botanicamente uma baga, produzida por vários tipos de plantas herbáceas grandes do genero Musa. 甘蕉は食べられる果物でバショウ科バショウ属のうち、果実を食用とする品種群の総称。また、その果実のこと。いくつかの原種から育種された多年草。種によっては熟すまでは毒を持つものもある。 + 바나나는 식용 과일로써 식물학적으로 열매류이며 여러 종류의 개화가능한 초본의 파초과로 부터 생산됩니다. + 香蕉(學名: Musa × paradisiaca),為芭蕉科芭蕉屬小果野蕉及野蕉的人工栽培雜交種,為多年生草本植物。果實長有棱; 果皮黃色,果肉白色,味道香甜。主要生長在熱帶、亞熱帶地區。原產於亞洲東南部熱帶、亞熱帶地區。 + 香蕉(学名: Musa × paradisiaca),为芭蕉科芭蕉属小果野蕉及野蕉的人工栽培杂交种,为多年生草本植物。果实长有棱; 果皮黄色,果肉白色,味道香甜。主要生长在热带、亚热带地区。原产于亚洲东南部热带、亚热带地区。 Check PBOs @@ -521,6 +638,9 @@ Проверка аддонов Controlla PBO PBO を検査 + PBO 검사 + 檢查PBO檔 + 检查PBO档 Check addon integrity with server and do selected action if an addon is missing. @@ -533,6 +653,9 @@ Ce module contrôle si les PBOs de chaque joueur sont corrects Controlla l'integrità degli addon con il server ed esegui l'azione selezionata se un addon è mancante サーバがアドオンの整合性を検査し、もし不備があれば実行する動作を選択できます。 + 서버 에드온의 무결성을 검사하고 사라진 에드온이 있을경우 행동을 선택합니다. + 檢查客戶端與伺服器端的模組清單是否一致且完整,並提供訊息表示遺失的模組。 + 检查客户端与伺服器端的模组清单是否一致且完整,并提供讯息表示遗失的模组。 Action @@ -546,6 +669,9 @@ Действие Azione 動作 + 작동 + 動作 + 动作 What to do with people who do not have the right PBOs? @@ -559,6 +685,9 @@ Что делать с игроками с неправильными аддонами? Cosa fare con giocatori che non hanno i PBO corretti? プレイヤーが正しい PBO を持っていない場合は? + 올바르지 않는 PBO를 가진 사람을 어떻게 할까요? + 若玩家沒有正確的PBO檔時,將採取何種動作? + 若玩家没有正确的PBO档时,将采取何种动作? Warn once @@ -572,6 +701,9 @@ Предупредить один раз Avverti una volta 一度の警告 + 경고 한 번 + 警告 (一次) + 警告 (一次) Warn (permanent) @@ -585,6 +717,9 @@ Предупреждать (постоянно) Avverti (permanente) 警告(永久的) + 경고 (영구적) + 警告 (持續) + 警告 (持续) Kick @@ -598,6 +733,9 @@ Кикнуть Kick 排除 + 추방 + 踢除 + 踢除 Check all addons @@ -611,6 +749,9 @@ Проверять все аддоны Controlla tutti gli addon 全アドオンを検査 + 모든 에드온 검사 + 檢查所有模組 + 检查所有模组 Check all addons instead of only those of ACE? @@ -624,6 +765,9 @@ Проверять все аддоны, а не только ACE? Controlla tutti gli addon invece dei soli addon ACE? ACE MOD の代わりに全アドオンを検査しますか? + ACE를 제외한 모든 모드를 검사할까요? + 檢查包含ACE之外的其他模組? + 检查包含ACE之外的其他模组? Whitelist @@ -637,6 +781,9 @@ Вайтлист доп. аддонов Lista Bianca 許可制 + 화이트리스트 + 白名單 + 白名单 What addons are allowed regardless? @@ -650,6 +797,9 @@ Какие аддоны дополнительно разрешены? Quali addon sono permessi in ogni caso? どのようなアドオンを許可しますか? + 허가되는 에드온은 어느것입니까? + 哪些模組是可被允許/忽略的? + 哪些模组是可被允许/忽略的? LSD Vehicles @@ -663,6 +813,9 @@ Транспорт под LSD Veicoli LSD LSD 車両 + LSD 차량 + 迷幻載具 + 迷幻载具 Adds LSD effect to synchronized vehicle @@ -676,6 +829,9 @@ Добавляет эффект LSD (мигание всеми цветами радуги) синхронизированным транспортным средствам Aggiunge effetti LSD ai veicoli sincronizzati 同期されたオブジェクトに LSD の効果を追加します + 동기화된 차량에 LSD효과를 추가합니다. + 使被同步的載具產生瘋狂的迷幻效果。(後果自負) + 使被同步的载具产生疯狂的迷幻效果。(后果自负) Toggle Handheld Device @@ -689,6 +845,9 @@ Включить портативное устройство Apri dispositivo palmare デバイスを常に表示 + 휴대장치 토글 + 切換手持裝備 + 切换手持装备 Close Handheld Device @@ -702,6 +861,9 @@ Закрыть портативное устройство Chiudi dispositivo palmare デバイスを閉じる + 휴대장치 닫기 + 關閉手持裝備 + 关闭手持装备 Cycle Handheld Devices @@ -715,6 +877,9 @@ Следующее портативное устройство Cicla tra dispositivi palmari 表示するデバイスを変える + 휴대장치 순환 + 循環切換手持裝備 + 循环切换手持装备 Disabled @@ -727,6 +892,9 @@ Откл. Desactivado 無効化 + 비활성화 + 停用 + 停用 Enabled @@ -739,6 +907,9 @@ Вкл. Activado 有効化 + 활성화 + 啟用 + 启用 Yes @@ -752,6 +923,9 @@ Sim Si はい + + + No @@ -765,6 +939,9 @@ Não No いいえ + 아니오 + + Vehicles only @@ -777,6 +954,9 @@ Solo veicoli Vehicules seulement 車両のみ + 차량 전용 + 只有載具 + 只有载具 Do Not Force @@ -789,6 +969,9 @@ Non forzare Ne pas forcer 強制しない + 강제하지 말것 + 不要強行 + 不要强行 ACE3 Equipment @@ -801,6 +984,9 @@ Equipaggiamento ACE3 ACE3 Equipement ACE3 装備 + ACE3 장비 + ACE3 裝備按鍵 + ACE3 装备按键 ACE3 Common @@ -813,6 +999,9 @@ Comune ACE3 ACE3 Commun ACE3 全般 + ACE3 일반 + ACE3 通用按鍵 + ACE3 通用按键 ACE3 Weapons @@ -825,6 +1014,9 @@ Armi ACE3 ACE3 Armes ACE3 武器 + ACE3 무기 + ACE3 武器按鍵 + ACE3 武器按键 ACE3 Movement @@ -837,6 +1029,9 @@ Movimento ACE3 ACE3 Mouvement ACE3 移動 + ACE3 움직임 + ACE3 動作按鍵 + ACE3 动作按键 ACE3 Scope Adjustment @@ -849,6 +1044,9 @@ Regolazione Ottiche ACE3 ACE3 Ajustement de la lunette ACE3 スコープ調節 + ACE3 조준경 조정 + ACE3 瞄準鏡調節按鍵 + ACE3 瞄准镜调节按键 ACE3 Vehicles @@ -861,6 +1059,9 @@ Veicoli ACE3 ACE3 Vehicules ACE3 車両 + ACE3 차량 + ACE3 載具按鍵 + ACE3 载具按键 No Room to unload @@ -873,6 +1074,25 @@ Sem espaço para descarregar Нет места для выгрузки 降ろすための空間がありません + 沒有空間可卸載 + 没有空间可卸载 + 언로드 할 공간이 없습니다. + + + Toggle + переключить + переключить + Basculer + Cambiar + Cambia + Umschalten + pecek + přep. + alternar + 切り替え + 토글 + 切換 + 切换 - \ No newline at end of file + diff --git a/addons/concertina_wire/XEH_init.sqf b/addons/concertina_wire/XEH_init.sqf index dc6424f172..b24353b4df 100644 --- a/addons/concertina_wire/XEH_init.sqf +++ b/addons/concertina_wire/XEH_init.sqf @@ -1,3 +1,3 @@ #include "script_component.hpp" params ["_wire"]; -_wire addEventHandler ["HandleDamage", FUNC(handleDamage)]; +_wire addEventHandler ["HandleDamage", {call FUNC(handleDamage)}]; diff --git a/addons/concertina_wire/XEH_preInit.sqf b/addons/concertina_wire/XEH_preInit.sqf index a7feade1c3..b47cf6628d 100644 --- a/addons/concertina_wire/XEH_preInit.sqf +++ b/addons/concertina_wire/XEH_preInit.sqf @@ -2,6 +2,8 @@ ADDON = false; +PREP_RECOMPILE_START; #include "XEH_PREP.hpp" +PREP_RECOMPILE_END; ADDON = true; diff --git a/addons/concertina_wire/functions/fnc_deploy.sqf b/addons/concertina_wire/functions/fnc_deploy.sqf index 67b3584de2..6dc05b365d 100644 --- a/addons/concertina_wire/functions/fnc_deploy.sqf +++ b/addons/concertina_wire/functions/fnc_deploy.sqf @@ -10,11 +10,14 @@ * Return Value: * None * + * Example: + * [coil, bob] call ace_concertina_wire_fnc_deploy + * * Public: No */ #include "script_component.hpp" -PARAMS_2(_wirecoil,_unit); +params ["_wirecoil", "_unit"]; private _wireNoGeo = "ACE_ConcertinaWireNoGeo" createVehicle [0,0,0]; { diff --git a/addons/concertina_wire/functions/fnc_dismount.sqf b/addons/concertina_wire/functions/fnc_dismount.sqf index 9dcd50cc4a..ef32431292 100644 --- a/addons/concertina_wire/functions/fnc_dismount.sqf +++ b/addons/concertina_wire/functions/fnc_dismount.sqf @@ -10,6 +10,9 @@ * Return Value: * None * + * Example: + * [wire, bob] call ace_concertina_wire_fnc_dismount + * * Public: No */ #include "script_component.hpp" @@ -23,7 +26,7 @@ if (uiNamespace getVariable [QEGVAR(interact_menu,cursorMenuOpened),false]) exit params ["_wire", "_unit"]; private _config = (configFile >> "CfgVehicles" >> typeOf _unit); -private _delay = [120, 60] select (getNumber (_config >> "engineer") == 1 || {getNumber (_config >> "canDeactivateMines") == 1}); +private _delay = [45, 30] select ([_unit] call EFUNC(common,isEngineer) || {[_unit] call EFUNC(common,isEOD)}); // TODO: Animation? [ diff --git a/addons/concertina_wire/functions/fnc_dismountSuccess.sqf b/addons/concertina_wire/functions/fnc_dismountSuccess.sqf index a3f5081271..76ee768504 100644 --- a/addons/concertina_wire/functions/fnc_dismountSuccess.sqf +++ b/addons/concertina_wire/functions/fnc_dismountSuccess.sqf @@ -9,11 +9,14 @@ * Return Value: * None * + * Example: + * [wire] call ace_concertina_wire_fnc_dismountSuccess + * * Public: No */ #include "script_component.hpp" -PARAMS_1(_wire); +params ["_wire"]; { _wire animate [_x, 1]; @@ -24,12 +27,11 @@ PARAMS_1(_wire); _args params ["_wire"]; if (_wire animationPhase "wire_2" == 1) then { - private ["_dir", "_pos", "_wirecoil"]; - _dir = getDir _wire; - _pos = getPosASL _wire; + private _dir = getDir _wire; + private _pos = getPosASL _wire; - _wirecoil = "ACE_ConcertinaWireCoil" createvehicle [0, 0, 0]; + private _wirecoil = "ACE_ConcertinaWireCoil" createvehicle [0, 0, 0]; deleteVehicle _wire; diff --git a/addons/concertina_wire/functions/fnc_handleDamage.sqf b/addons/concertina_wire/functions/fnc_handleDamage.sqf index 43a04641dd..d4f2555546 100644 --- a/addons/concertina_wire/functions/fnc_handleDamage.sqf +++ b/addons/concertina_wire/functions/fnc_handleDamage.sqf @@ -13,6 +13,9 @@ * Return Value: * None * + * Example: + * [wire, "selection", 5, source, "scrap"] call ace_concertina_wire_fnc_handleDamage + * * Public: No */ #include "script_component.hpp" diff --git a/addons/concertina_wire/functions/fnc_handleKilled.sqf b/addons/concertina_wire/functions/fnc_handleKilled.sqf index 7fb5ef6e1b..6649f5c3b6 100644 --- a/addons/concertina_wire/functions/fnc_handleKilled.sqf +++ b/addons/concertina_wire/functions/fnc_handleKilled.sqf @@ -10,6 +10,9 @@ * Return Value: * None * + * Example: + * [wire, car] call ace_concertina_wire_fnc_handleKilled + * * Public: No */ #include "script_component.hpp" diff --git a/addons/concertina_wire/functions/fnc_vehicleDamage.sqf b/addons/concertina_wire/functions/fnc_vehicleDamage.sqf index e5732f7000..dd3504f031 100644 --- a/addons/concertina_wire/functions/fnc_vehicleDamage.sqf +++ b/addons/concertina_wire/functions/fnc_vehicleDamage.sqf @@ -9,15 +9,16 @@ * Return Value: * None * + * Example: + * [wire, car] call ace_concertina_wire_fnc_vehicleDamage + * * Public: No */ #include "script_component.hpp" params ["_wire", "_vehicle"]; -private ["_type", "_mode", "_anim", "_parts", "_selectionPart", "_selection", "_pos_w", "_dir_w"]; - -_type = typeOf _wire; -_mode = switch (_type) do { +private _type = typeOf _wire; +private _mode = switch (_type) do { case "ACE_ConcertinaWire": { 0 }; case "Land_Razorwire_F": { 1 }; default { -1 }; @@ -35,16 +36,16 @@ if (_mode == -1) exitWith {}; //9.78744 (10) _type = typeOf _wire; -_anim = _wire animationPhase "wire_2"; -_pos_w = getPos _wire; -_dir_w = getDir _wire; +private _anim = _wire animationPhase "wire_2"; +private _pos_w = getPos _wire; +private _dir_w = getDir _wire; if (_mode == 0) then { - private ["_x", "_y", "_found", "_wireCheckPosAr", "_no"]; + private _found = false; _pos_w params ["_x","_y"]; // Check if two Single coils are placed next to each other (i.e playes have built a big wire obstacle) - _wireCheckPosAr = [ + private _wireCheckPosAr = [ [_x + (sin (_dir_w + 90) * 1.5),_y + (cos (_dir_w + 90) * 1.5)], [(_x-(sin _dir_w)) + (sin (_dir_w + 90) * 1.5),(_y-(cos _dir_w)) + (cos (_dir_w + 90) * 1.5)], [_x + (sin (_dir_w - 90) * 1.5),_y + (cos (_dir_w - 90) * 1.5)], @@ -52,7 +53,7 @@ if (_mode == 0) then { ]; { _found = false; - _no = nearestObjects [_x, [typeOf _wire], 3]; //diag_log _no; diag_log "....."; + private _no = nearestObjects [_x, [typeOf _wire], 3]; //diag_log _no; diag_log "....."; _no = _no - [_wire]; //diag_log _no; if (count _no > 0) exitWith { _found = true; //diag_log "found"; @@ -73,6 +74,8 @@ if (_mode == 0) then { }; }; +private _parts = []; + if (_mode == 1) then { switch (true) do { case (_vehicle isKindOf "Tank"): { @@ -92,9 +95,9 @@ if (_mode == 1) then { if (canMove _vehicle) then { { - _selectionPart = "hit" + _x; + private _selectionPart = "hit" + _x; if (isText(configFile >> "CfgVehicles" >> typeOf _vehicle >> "hitpoints" >> _selectionPart >> "name")) then { - _selection = getText(configFile >> "CfgVehicles" >> typeOf _vehicle >> "hitpoints" >> _selectionPart >> "name"); + private _selection = getText(configFile >> "CfgVehicles" >> typeOf _vehicle >> "hitpoints" >> _selectionPart >> "name"); // TODO: Only the tires that have touched the wire should burst. _vehicle setHit [_selection, 1]; }; @@ -104,14 +107,13 @@ if (canMove _vehicle) then { if (_mode == 1) then { if (_vehicle isKindOf "StaticWeapon") exitWith {}; [{ - PARAMS_2(_vehicle,_wire); + params ["_vehicle", "_wire"]; _vehicle setVelocity ((velocity _vehicle) vectorMultiply 0.75); - private ["_vPos", "_vDir"]; // Set vehicle back in front of wire, since the wire will make the vehicle jump, and a wire with no geometry lod is undestructible and not recognizeable - _vPos = getPosASL _vehicle; - _vDir = getDir _vehicle; + private _vPos = getPosASL _vehicle; + private _vDir = getDir _vehicle; _vehicle setPosASL (_vPos vectorAdd [-0.35 * sin(_vDir), -0.35 * cos(_vDir), 0]); // TODO: Needs to be placed in safe distance to wire, so we do not constantly re - spawn new wires }, [_vehicle, _wire], 0.1] call CBA_fnc_waitAndExecute; diff --git a/addons/concertina_wire/stringtable.xml b/addons/concertina_wire/stringtable.xml index f0925a73c0..6c510c56b7 100644 --- a/addons/concertina_wire/stringtable.xml +++ b/addons/concertina_wire/stringtable.xml @@ -1,4 +1,4 @@ - + @@ -13,6 +13,9 @@ Concertina wire Arame farpado 鉄条網 + 철조망 + 鐵絲網 + 铁丝网 Concertina Wire Coil @@ -26,6 +29,9 @@ Concertina wire coil Bobina de arame farpado 鉄条網コイル + 윤형 철조망 + 鐵絲網捲 + 铁丝网卷 Dismount Concertina Wire @@ -39,6 +45,9 @@ Dismount Concertina wire Desmontar arame farpado 鉄条網をほどく + 철조망 해체 + 卸下鐵絲網 + 卸下铁丝网 Deploy Concertina Wire @@ -52,6 +61,9 @@ Deploy Concertina wire Colocar arame farpado 鉄条網を置く + 철조망 배치 + 佈署鐵絲網 + 布署铁丝网 - \ No newline at end of file + diff --git a/addons/cookoff/ACE_Settings.hpp b/addons/cookoff/ACE_Settings.hpp index d77a828fad..13ef915ffb 100644 --- a/addons/cookoff/ACE_Settings.hpp +++ b/addons/cookoff/ACE_Settings.hpp @@ -12,10 +12,16 @@ class ACE_Settings { value = 1; typeName = "BOOL"; }; - class GVAR(enableAmmoCookoff) { + class GVAR(enableAmmoCookoff) { // For CBA Setting Switch: we can eliminate and just use (ammoCookoffDuration == 0) displayName = CSTRING(enableAmmoCookoff_name); description = CSTRING(enableAmmoCookoff_tooltip); value = 1; typeName = "BOOL"; }; + class GVAR(ammoCookoffDuration) { + displayName = CSTRING(ammoCookoffDuration_name); + description = CSTRING(ammoCookoffDuration_tooltip); + value = 1; + typeName = "SCALAR"; + }; }; diff --git a/addons/cookoff/CfgEden.hpp b/addons/cookoff/CfgEden.hpp index 1cc406463f..aa550a9228 100644 --- a/addons/cookoff/CfgEden.hpp +++ b/addons/cookoff/CfgEden.hpp @@ -11,7 +11,7 @@ class Cfg3DEN { tooltip = CSTRING(enable_tooltip); expression = QUOTE(if !(_value) then {_this setVariable [ARR_3('%s',_value,true)];};); typeName = "BOOL"; - condition = "objectVehicle"; + condition = "objectHasInventoryCargo"; defaultValue = "(true)"; // fix pbo project preprocessing bug }; }; diff --git a/addons/cookoff/CfgSFX.hpp b/addons/cookoff/CfgSFX.hpp index 0e10644729..0d670ead86 100644 --- a/addons/cookoff/CfgSFX.hpp +++ b/addons/cookoff/CfgSFX.hpp @@ -1,9 +1,18 @@ class CfgSFX { - class GVAR(CookOff) { - name = QGVAR(cookoff); - sounds[] = {QGVAR(cookoff)}; - GVAR(cookoff)[] = {PATHTOF(sounds\cookoff.wss),6,1.8,400,1,0,0,0}; + class GVAR(CookOff_low) { + name = QGVAR(cookoff_low); + sound[] = {QPATHTOF(sounds\cookoff_low_pressure.ogg),6,1,400,1,0,0,0}; + sounds[] = {"sound"}; + titles[] = {}; empty[] = {"",0,0,0,0,0,0,0}; }; + class GVAR(CookOff_mid): GVAR(CookOff_low) { + name = QGVAR(cookoff_mid); + sound[] = {QPATHTOF(sounds\cookoff_mid_pressure.ogg),6,1,400,1,0,0,0}; + }; + class GVAR(CookOff_high): GVAR(CookOff_low) { + name = QGVAR(cookoff_high); + sound[] = {QPATHTOF(sounds\cookoff_high_pressure.ogg),6,1,400,1,0,0,0}; + }; }; diff --git a/addons/cookoff/CfgVehicles.hpp b/addons/cookoff/CfgVehicles.hpp index 26453ef286..7d82d97c12 100644 --- a/addons/cookoff/CfgVehicles.hpp +++ b/addons/cookoff/CfgVehicles.hpp @@ -1,11 +1,18 @@ class CfgVehicles { class Sound; - class GVAR(Sound): Sound { + class GVAR(Sound_low): Sound { author = ECSTRING(common,ACETeam); _generalMacro = QGVAR(Sound); scope = 1; - sound = QGVAR(CookOff); + sound = QGVAR(CookOff_low); + }; + + class GVAR(Sound_mid): GVAR(Sound_low) { + sound = QGVAR(CookOff_mid); + }; + class GVAR(Sound_high): GVAR(Sound_low) { + sound = QGVAR(CookOff_high); }; class ThingX; @@ -28,20 +35,16 @@ class CfgVehicles { class Tank; class Tank_F: Tank { - GVAR(ammoLocation) = "HitTurret"; + GVAR(ammoLocation) = "HitHull"; GVAR(cookoffSelections)[] = {"poklop_gunner","poklop_commander"}; }; - - class MBT_01_base_F: Tank_F { - GVAR(ammoLocation) = "HitHull"; - }; - class APC_Tracked_01_base_F: Tank_F { - GVAR(ammoLocation) = "HitHull"; + class MBT_02_base_F: Tank_F { + GVAR(ammoLocation) = "HitTurret"; }; class Car_F; class Wheeled_APC_F: Car_F { - GVAR(ammoLocation) = "HitTurret"; + GVAR(ammoLocation) = "HitHull"; GVAR(cookoffSelections)[] = {"poklop_gunner","poklop_commander"}; // big explosions for wheeled APCs (same as for tanks) diff --git a/addons/cookoff/XEH_PREP.hpp b/addons/cookoff/XEH_PREP.hpp index 897fb10153..f1deb8eaed 100644 --- a/addons/cookoff/XEH_PREP.hpp +++ b/addons/cookoff/XEH_PREP.hpp @@ -4,5 +4,5 @@ PREP(engineFire); PREP(cookOff); PREP(cookOffBox); PREP(blowOffTurret); -PREP(secondaryExplosions); PREP(detonateAmmunition); +PREP(getVehicleAmmo); diff --git a/addons/cookoff/XEH_postInit.sqf b/addons/cookoff/XEH_postInit.sqf index 1e17e20893..b7bed03475 100644 --- a/addons/cookoff/XEH_postInit.sqf +++ b/addons/cookoff/XEH_postInit.sqf @@ -36,6 +36,22 @@ GVAR(cacheTankDuplicates) = call CBA_fnc_createNamespace; ["Wheeled_APC_F", "init", { params ["_vehicle"]; + private _typeOf = typeOf _vehicle; + + if (isNil {GVAR(cacheTankDuplicates) getVariable _typeOf}) then { + private _hitpoints = (getAllHitPointsDamage _vehicle param [0, []]) apply {toLower _x}; + private _duplicateHitpoints = []; + + { + if ((_x != "") && {_x in (_hitpoints select [0,_forEachIndex])}) then { + _duplicateHitpoints pushBack _forEachIndex; + }; + } forEach _hitpoints; + + TRACE_2("dupes",_typeOf,_duplicateHitpoints); + GVAR(cacheTankDuplicates) setVariable [_typeOf, _duplicateHitpoints]; + }; + _vehicle addEventHandler ["HandleDamage", { if ((_this select 0) getVariable [QGVAR(enable), GVAR(enable)]) then { ["tank", _this] call FUNC(handleDamage); @@ -55,7 +71,7 @@ GVAR(cacheTankDuplicates) = call CBA_fnc_createNamespace; ["ReammoBox_F", "init", { (_this select 0) addEventHandler ["HandleDamage", { - if (GVAR(enableAmmobox)) then { + if ((_this select 0) getVariable [QGVAR(enable), GVAR(enableAmmobox)]) then { ["box", _this] call FUNC(handleDamage); }; }]; @@ -64,11 +80,10 @@ GVAR(cacheTankDuplicates) = call CBA_fnc_createNamespace; // secondary explosions ["AllVehicles", "killed", { params ["_vehicle"]; - if (_vehicle getVariable [QGVAR(enable),GVAR(enable)]) then { - _vehicle call FUNC(secondaryExplosions); - if (_vehicle getVariable [QGVAR(enableAmmoCookoff), GVAR(enableAmmoCookoff)]) then { - [_vehicle, magazinesAmmo _vehicle] call FUNC(detonateAmmunition); - }; + if (_vehicle getVariable [QGVAR(enableAmmoCookoff), GVAR(enableAmmoCookoff)]) then { + if (GVAR(ammoCookoffDuration) == 0) exitWith {}; + ([_vehicle] call FUNC(getVehicleAmmo)) params ["_mags", "_total"]; + [_vehicle, _mags, _total] call FUNC(detonateAmmunition); }; }, nil, ["Man","StaticWeapon"]] call CBA_fnc_addClassEventHandler; diff --git a/addons/cookoff/XEH_preInit.sqf b/addons/cookoff/XEH_preInit.sqf index a7feade1c3..b47cf6628d 100644 --- a/addons/cookoff/XEH_preInit.sqf +++ b/addons/cookoff/XEH_preInit.sqf @@ -2,6 +2,8 @@ ADDON = false; +PREP_RECOMPILE_START; #include "XEH_PREP.hpp" +PREP_RECOMPILE_END; ADDON = true; diff --git a/addons/cookoff/functions/fnc_cookOff.sqf b/addons/cookoff/functions/fnc_cookOff.sqf index 890bbff557..a86564e74d 100644 --- a/addons/cookoff/functions/fnc_cookOff.sqf +++ b/addons/cookoff/functions/fnc_cookOff.sqf @@ -9,7 +9,7 @@ * None * * Example: - * (vehicle player) call ace_cookoff_fnc_cookOff + * [(vehicle player)] call ace_cookoff_fnc_cookOff * * Public: No */ @@ -91,7 +91,9 @@ if (local _vehicle) then { } forEach _positions; if (isServer) then { - private _sound = createSoundSource [QGVAR(Sound), position _vehicle, [], 0]; + private _soundName = selectRandomWeighted [QGVAR(Sound_low), 0.1, QGVAR(Sound_mid), 0.25, QGVAR(Sound_high), 0.65]; + // TODO - Players in the vehicle hear no sound (even after exiting the vehicle) + private _sound = createSoundSource [_soundName, position _vehicle, [], 0]; _effects pushBack _sound; }; @@ -107,15 +109,19 @@ if (local _vehicle) then { DEC(_counter); if (_counter > 0) then { - [_fnc_FlameEffect, [_vehicle, _fnc_FlameEffect, _counter], 0.4] call CBA_fnc_waitAndExecute + [_fnc_FlameEffect, [_vehicle, _fnc_FlameEffect, _counter], FLAME_EFFECT_DELAY] call CBA_fnc_waitAndExecute }; }; - [_vehicle, _fnc_FlameEffect, 12] call _fnc_FlameEffect; // recursive function + // Recursive function, occurs for duration of cookoff + [_vehicle, _fnc_FlameEffect, ceil(COOKOFF_TIME/FLAME_EFFECT_DELAY)] call _fnc_FlameEffect; + + private _randomPosition = _vehicle getPos [100, random 360]; { if (local _x && {!(_x call EFUNC(common,isPlayer))}) then { - _x action ["Eject", _vehicle]; + _x leaveVehicle _vehicle; + _x doMove _randomPosition; }; } forEach crew _vehicle; @@ -129,6 +135,6 @@ if (local _vehicle) then { if (local _vehicle) then { _vehicle setDamage 1; }; - }, [_vehicle, _effects], 4 + random 20] call CBA_fnc_waitAndExecute; - }, [_vehicle, _effects, _positions], 3 + random 15] call CBA_fnc_waitAndExecute; -}, _vehicle, 0.5 + random 5] call CBA_fnc_waitAndExecute; + }, [_vehicle, _effects], COOKOFF_TIME] call CBA_fnc_waitAndExecute; // TODO: Randomise cook off time with locality in mind + }, [_vehicle, _effects, _positions], SMOKE_TIME] call CBA_fnc_waitAndExecute; +}, _vehicle, IGNITE_TIME] call CBA_fnc_waitAndExecute; diff --git a/addons/cookoff/functions/fnc_cookOffBox.sqf b/addons/cookoff/functions/fnc_cookOffBox.sqf index 3c040b5f72..4e509e3194 100644 --- a/addons/cookoff/functions/fnc_cookOffBox.sqf +++ b/addons/cookoff/functions/fnc_cookOffBox.sqf @@ -20,7 +20,7 @@ params ["_box"]; if (_box getVariable [QGVAR(isCookingOff), false]) exitWith {}; _box setVariable [QGVAR(isCookingOff), true]; -if (local _vehicle) then { +if (local _box) then { [QGVAR(cookOffBox), _box] call CBA_fnc_remoteEvent; }; @@ -44,9 +44,10 @@ if (local _vehicle) then { // These functions are smart and do all the cooking off work if (local _box) then { - _box call FUNC(secondaryExplosions); if (_box getVariable [QGVAR(enableAmmoCookoff), GVAR(enableAmmoCookoff)]) then { - [_box, magazinesAmmo _box] call FUNC(detonateAmmunition); + if (GVAR(ammoCookoffDuration) == 0) exitWith {}; + ([_box] call FUNC(getVehicleAmmo)) params ["_mags", "_total"]; + [_box, _mags, _total] call FUNC(detonateAmmunition); }; // This shit is busy being on fire, magazines aren't accessible/usable @@ -70,6 +71,6 @@ if (local _vehicle) then { if (local _box) then { _box setDamage 1; }; - }, [_box, _effects], 45 + random 75] call CBA_fnc_waitAndExecute; // Give signifcant time for ammo cookoff to occur (perhaps keep the box alive until all cooked off?) - }, [_box, _effects], 3 + random 15] call CBA_fnc_waitAndExecute; -}, _box, 0.5 + random 5] call CBA_fnc_waitAndExecute; + }, [_box, _effects], COOKOFF_TIME_BOX] call CBA_fnc_waitAndExecute; // TODO: Change so that box is alive until no ammo left, with locality in mind + }, [_box, _effects], SMOKE_TIME] call CBA_fnc_waitAndExecute; +}, _box, IGNITE_TIME] call CBA_fnc_waitAndExecute; diff --git a/addons/cookoff/functions/fnc_detonateAmmunition.sqf b/addons/cookoff/functions/fnc_detonateAmmunition.sqf index 211e359bb3..c5c0a64549 100644 --- a/addons/cookoff/functions/fnc_detonateAmmunition.sqf +++ b/addons/cookoff/functions/fnc_detonateAmmunition.sqf @@ -4,6 +4,10 @@ * * Arguments: * 0: vehicle + * 1: Ammo Array + * 0: Magazine Classname + * 1: Ammo Count + * 2: Total Ammo Count * * Return Value: * None @@ -16,7 +20,7 @@ #include "script_component.hpp" #define MAX_TIME_BETWEEN_AMMO_DET 25 -params ["_vehicle", "_magazines"]; +params ["_vehicle", "_magazines", "_totalAmmo"]; if (isNull _vehicle) exitWith {}; // vehicle got deleted if (_magazines isEqualTo []) exitWith {}; // nothing to detonate anymore @@ -27,21 +31,23 @@ private _magazine = _magazines select _magazineIndex; _magazine params ["_magazineClassname", "_amountOfMagazines"]; if (_amountOfMagazines > 0) exitWith { - private _newMagCount = _amountOfMagazines - floor(1 + random(6)); - if (_newMagCount <= 0) then { + private _removed = _amountOfMagazines min floor(1 + random(6 / GVAR(ammoCookoffDuration))); + + _amountOfMagazines = _amountOfMagazines - _removed; + if (_amountOfMagazines <= 0) then { _magazines deleteAt _magazineIndex; } else { - _magazine set [1, _newMagCount]; // clear out the magazine + _magazine set [1, _amountOfMagazines]; // clear out the magazine }; - private _ammo = getText (configFile >> "CfgMagazines" >> _magazineClassname >> "ammo"); + private _timeBetweenAmmoDetonation = (((random 10) / (sqrt _totalAmmo)) min MAX_TIME_BETWEEN_AMMO_DET) max 0.1; + TRACE_2("",_totalAmmo,_timeBetweenAmmoDetonation); + _totalAmmo = _totalAmmo - _removed; - private _timeBetweenAmmoDetonation = (random 7) * (1 / random (_amountOfMagazines)) min MAX_TIME_BETWEEN_AMMO_DET; - _timeBetweenAmmoDetonation = _timeBetweenAmmoDetonation max 0.1; + private _ammo = getText (configFile >> "CfgMagazines" >> _magazineClassname >> "ammo"); + private _ammoCfg = configFile >> "CfgAmmo" >> _ammo; private _speedOfAmmo = getNumber (configFile >> "CfgMagazines" >> _magazineClassname >> "initSpeed"); - private _simulationTime = getNumber (configFile >> "CfgAmmo" >> _ammo >> "simulation"); - private _caliber = getNumber (configFile >> "CfgAmmo" >> _ammo >> "caliber"); - private _simType = getText (configFile >> "CfgAmmo" >> _ammo >> "simulation"); + private _simType = getText (_ammoCfg >> "simulation"); private _effect2pos = _vehicle selectionPosition "destructionEffect2"; @@ -52,14 +58,13 @@ if (_amountOfMagazines > 0) exitWith { if (_spawnPos select 2 < 0) then { _spawnPos set [2, 0]; }; - private _projectile = _ammo createVehicle [0,0,0]; - _projectile setPos _spawnPos; + + private _projectile = createVehicle [_ammo, _spawnPos, [], 0, "CAN_COLLIDE"]; if (_flyAway) then { private _vectorAmmo = [(-1 + (random 2)), (-1 + (random 2)), -0.2 + (random 1)]; private _velVec = _vectorAmmo vectorMultiply _speed; _projectile setVectorDir _velVec; _projectile setVelocity _velVec; - [ACE_player, _projectile, [1,0,0,1]] call EFUNC(frag,addTrack); } else { _projectile setDamage 1; }; @@ -91,22 +96,38 @@ if (_amountOfMagazines > 0) exitWith { }; [_vehicle, _ammo, _speed, random 1 < 0.5] call _spawnProjectile; }; - if (toLower _simType == "shotrocket" || {toLower _simType == "shotmissile"}) then { + if (toLower _simType in ["shotrocket", "shotmissile", "shotsubmunitions"]) then { if (random 1 < 0.1) then { private _sound = selectRandom [QUOTE(PATHTO_R(sounds\cannon_crack_close.wss)), QUOTE(PATHTO_R(sounds\cannon_crack_close_filtered.wss))]; playSound3D [_sound, objNull, false, (getPosASL _vehicle), 3, 1, 1600]; [_vehicle, _ammo, _speed, random 1 < 0.3] call _spawnProjectile; } else { - "ACE_ammoExplosionLarge" createvehicle (_vehicle modelToWorld _effect2pos); + createvehicle ["ACE_ammoExplosionLarge", (_vehicle modelToWorld _effect2pos), [], 0 , "CAN_COLLIDE"]; }; }; - if (toLower _simType in ["shotdirectionalbomb", "shotilluminating", "shotmine"]) then { + if (toLower _simType in ["shotdirectionalbomb", "shotmine"]) then { if (random 1 < 0.5) then { - [_vehicle, _ammo, 0, false] call _spawnProjectile; + // Not all explosives detonate on destruction, some have scripted alternatives + private _scripted = getNumber (_ammoCfg >> "triggerWhenDestroyed") == 1; + if !(_scripted) then { + _ammo = getText (_ammoCfg >> "ace_explosives_Explosive"); + }; + + // If a scripted alternative doesn't exist use generic explosion + if (_ammo != "") then { + [_vehicle, _ammo, 0, false] call _spawnProjectile; + } else { + createvehicle ["SmallSecondary", (_vehicle modelToWorld _effect2pos), [], 0 , "CAN_COLLIDE"]; + }; + }; + }; + if (toLower _simType == "shotilluminating") then { + if (random 1 < 0.15) then { + [_vehicle, _ammo, _speed, random 1 < 0.3] call _spawnProjectile; }; }; - [FUNC(detonateAmmunition), [_vehicle, _magazines], _timeBetweenAmmoDetonation] call CBA_fnc_waitAndExecute; + [FUNC(detonateAmmunition), [_vehicle, _magazines, _totalAmmo], _timeBetweenAmmoDetonation] call CBA_fnc_waitAndExecute; }; -[FUNC(detonateAmmunition), [_vehicle, _magazines], random 3] call CBA_fnc_waitAndExecute; +ERROR_1("mag with no ammo - %1", _magazine); diff --git a/addons/cookoff/functions/fnc_getVehicleAmmo.sqf b/addons/cookoff/functions/fnc_getVehicleAmmo.sqf new file mode 100644 index 0000000000..78d13ee301 --- /dev/null +++ b/addons/cookoff/functions/fnc_getVehicleAmmo.sqf @@ -0,0 +1,61 @@ +/* + * Author: PabstMirror + * Gets all magazines inside of a vehicle. + * + * Arguments: + * 0: Vehicle + * + * Return Value: + * 0: Ammo Array + * 0: Magazine Classname + * 1: Ammo Count + * 1: Total Ammo Count + * + * Example: + * [vehicle player] call ace_cookoff_fnc_getVehicleAmmo + * + * Public: No + */ +#include "script_component.hpp" + +params ["_vehicle"]; +TRACE_1("getVehicleAmmo",_vehicle); + +private _ammoToDetonate = []; +private _totalAmmo = 0; + +// Get ammo from turrets +{ + _x params ["_mag", "", "_count"]; + if (_count > 0) then { + private _ammo = getText (configFile >> "CfgMagazines" >> _mag >> "ammo"); + private _model = getText (configFile >> "CfgAmmo" >> _ammo >> "model"); + if (_model == "\A3\weapons_f\empty") exitWith {TRACE_3("skipping",_mag,_ammo,_model);}; + _ammoToDetonate pushBack [_mag, _count]; + _totalAmmo = _totalAmmo + _count; + }; +} forEach (magazinesAllTurrets _vehicle); + +// Get ammo from cargo space +{ + _x params ["_mag", "_count"]; + if (_count > 0) then { + _ammoToDetonate pushBack [_mag, _count]; + _totalAmmo = _totalAmmo + _count; + }; +} forEach (magazinesAmmoCargo _vehicle); + +// Get ammo from transportAmmo / ace_rearm +private _vehCfg = configFile >> "CfgVehicles" >> typeOf _vehicle; + +private _configSupply = (getNumber (_vehCfg >> "transportAmmo")) max (getNumber (_vehCfg >> QEGVAR(rearm,defaultSupply))); +if (_vehicle getVariable [QEGVAR(rearm,isSupplyVehicle), (_configSupply > 0)]) then { + TRACE_1("transportAmmo vehicle - adding virtual ammo",typeOf _vehicle); + + _ammoToDetonate pushBack ["2000Rnd_65x39_belt", 2000]; + _totalAmmo = _totalAmmo + 2000; + _ammoToDetonate pushBack ["20Rnd_105mm_HEAT_MP", 100]; + _totalAmmo = _totalAmmo + 100; +}; + +[_ammoToDetonate, _totalAmmo] diff --git a/addons/cookoff/functions/fnc_handleDamage.sqf b/addons/cookoff/functions/fnc_handleDamage.sqf index 331c1d177a..a1724db961 100644 --- a/addons/cookoff/functions/fnc_handleDamage.sqf +++ b/addons/cookoff/functions/fnc_handleDamage.sqf @@ -3,10 +3,10 @@ * Handles all incoming damage for tanks (including wheeled APCs). * * Arguments: - * HandleDamage EH + * HandleDamage EH * * Return Value: - * Damage to be inflicted. + * Damage to be inflicted. * * Example: * _this call ace_cookoff_fnc_handleDamage @@ -29,7 +29,7 @@ if (_hitIndex != -1) then { }; // get change in damage -private "_oldDamage"; +private _oldDamage = 0; if (_hitpoint isEqualTo "#structural") then { _oldDamage = damage _vehicle; diff --git a/addons/cookoff/functions/fnc_secondaryExplosions.sqf b/addons/cookoff/functions/fnc_secondaryExplosions.sqf deleted file mode 100644 index 01a2fa3b3f..0000000000 --- a/addons/cookoff/functions/fnc_secondaryExplosions.sqf +++ /dev/null @@ -1,64 +0,0 @@ -/* - * Author: Maddmatt, commy2 - * Generate an amount of secondary explosions - * - * Arguments: - * 0: Vehicle - * 1: Amount - * - * Return Value: - * None - * - * Public: No - */ -#include "script_component.hpp" - -#define SECONDARIES_DELAY (1 + random 45) - -params ["_vehicle", "_amount"]; - -if (isNil "_amount") then { - // calculate amount of secondary explosions if not specified - _amount = 0; - - { - _x params ["_magazine", "_count"]; - - private _ammo = getText (_magazine call CBA_fnc_getItemConfig >> "ammo"); - - if (IS_EXPLOSIVE_AMMO(_ammo)) then { - if (_ammo isKindOf "ShellBase") then { - ADD(_amount,_count); - } else { - ADD(_amount,_count/50); - }; - }; - } forEach magazinesAmmo _vehicle; -}; - -if (_amount <= 0) exitWith {}; - -private _fnc_secondaryExplosion = { - params ["_vehicle", "_amount", "_fnc_secondaryExplosion"]; - - private _position = _vehicle modelToWorld (_vehicle selectionPosition "destructionEffect2"); - - // these CfgAmmo objects are always global - "SmallSecondary" createVehicle _position; - - DEC(_amount); - - if (!isNull _vehicle && {_amount > 0}) then { - [_fnc_secondaryExplosion, [_vehicle, _amount, _fnc_secondaryExplosion], SECONDARIES_DELAY] call CBA_fnc_waitAndExecute; - }; -}; - -[_fnc_secondaryExplosion, [_vehicle, _amount, _fnc_secondaryExplosion], SECONDARIES_DELAY] call CBA_fnc_waitAndExecute; - -nil - -/*SencondaryExplosion - SecondaryExp - SecondarySmoke - GrenadeExploLight -*/ diff --git a/addons/cookoff/script_component.hpp b/addons/cookoff/script_component.hpp index 7a9468c50c..5daa0e8330 100644 --- a/addons/cookoff/script_component.hpp +++ b/addons/cookoff/script_component.hpp @@ -17,3 +17,13 @@ #include "\z\ace\addons\main\script_macros.hpp" #define IS_EXPLOSIVE_AMMO(ammo) (getNumber (ammo call CBA_fnc_getObjectConfig >> "explosive") > 0.5) + +// Stages of cookoff in order (in seconds) +// Should be no un-synced randomness in these as the effects must be ran on each client +#define IGNITE_TIME 3 +#define SMOKE_TIME 10.5 +#define COOKOFF_TIME 14 // Cook off time should be 20s at most due to length of sound files +#define COOKOFF_TIME_BOX 82.5 // Cook off time for boxes should be significant to allow time for ammo to burn + +// Delay between flame effect for players in a cooking off vehicle +#define FLAME_EFFECT_DELAY 0.4 diff --git a/addons/cookoff/sounds/cookoff.wss b/addons/cookoff/sounds/cookoff.wss deleted file mode 100644 index 11b9d55194..0000000000 Binary files a/addons/cookoff/sounds/cookoff.wss and /dev/null differ diff --git a/addons/cookoff/sounds/cookoff_high_pressure.ogg b/addons/cookoff/sounds/cookoff_high_pressure.ogg new file mode 100644 index 0000000000..ebcffaf9ce Binary files /dev/null and b/addons/cookoff/sounds/cookoff_high_pressure.ogg differ diff --git a/addons/cookoff/sounds/cookoff_low_pressure.ogg b/addons/cookoff/sounds/cookoff_low_pressure.ogg new file mode 100644 index 0000000000..89439e21a7 Binary files /dev/null and b/addons/cookoff/sounds/cookoff_low_pressure.ogg differ diff --git a/addons/cookoff/sounds/cookoff_mid_pressure.ogg b/addons/cookoff/sounds/cookoff_mid_pressure.ogg new file mode 100644 index 0000000000..b82cbcf4e1 Binary files /dev/null and b/addons/cookoff/sounds/cookoff_mid_pressure.ogg differ diff --git a/addons/cookoff/stringtable.xml b/addons/cookoff/stringtable.xml index 21ddb96a7a..c75961708e 100644 --- a/addons/cookoff/stringtable.xml +++ b/addons/cookoff/stringtable.xml @@ -1,21 +1,31 @@ - + Enable cook off - Cook-off ermöglichen + Selbstzündung ermöglichen Povolit explozi munice Включить воспламенение 誘爆を有効化 - Aktywuj efekty zapłonu + 쿡오프 현상 활성화 + Aktywuj efekty samozapłonu amunicji + Active le cook-off + Abilita Esplosione + 開啟殉爆效果 + 开启殉爆效果 Enables cook off and related vehicle destruction effects. - Ermöglicht Cook-off und zugehörige Fahrzeug-Zerstörungseffekte. + Ermöglicht Selbstzündung und zugehörige Fahrzeug-Zerstörungseffekte. Povolí explozi munice a její následné ničivé efekty. Включает воспламенение и сопутствующие эффекты повреждения техники. 誘爆を有効化し、車両が誘爆によって破壊されていきます。 - Aktywuje efekt zapłonu na zniszczonych pojazdach. + 쿡오프 현상을 활성화 하고 관련된 차량에 폭발 이펙트를 적용합니다. + Aktywuje efekt samozapłonu amunicji na zniszczonych pojazdach. + Active le cook-off (autocombustion des munitions) et les effets de destruction liés. + Abilita l'esplosione e i relativi effetti di distruzione del veicolo. + 開啟此功能後,將使有關載具在損毀時有殉爆的效果。 + 开启此功能后,将使有关载具在损毁时有殉爆的效果。 Wreck (Turret) @@ -30,18 +40,74 @@ Ruínas (torre) 잔해(포탑) 残骸(タレット) + 殘骸 (砲塔) + 残骸 (炮塔) - + Enable ammo box cook off + 弾薬箱に誘爆を有効化 + Selbstzündung für Munitionskisten ermöglichen + 탄약 상자 쿡오프 현상 활성화 + Aktywuj samozapłon skrzyń z amunicją + Cook-off caisses de munitions + Abilita esplosione cassa munizioni + 開啟彈藥箱殉爆效果 + 开启弹药箱殉爆效果 - + Enables cooking off of ammo boxes. + 弾薬箱が誘爆するようになります。 + Ermöglicht Selbstzündung von Munitionskisten. + 탄약 상자에 쿡오프 현상을 적용합니다. + Aktywuje samozapłon skrzyń z amunicją + Active le cook-off sur toutes les caisses de munitions. + Abilita l'esplosione della cassa di munizioni. + 開啟彈藥箱殉爆效果 + 开启弹药箱殉爆效果 Enable Ammunition cook off + 弾薬の誘爆を有効化 + Selbstzündung für Munition ermöglichen + 탄약 쿡오프 현상 활성화 + Aktywuj samozapłon amunicji + Active le cook-off des munitions + Abilita Esplosione munizioni + 開啟彈藥殉爆效果 + 开启弹药殉爆效果 Enables Ammunition cook off. Fires ammunition projectiles while vehicle is on fire and has ammunition. + 弾薬が誘爆します。車両が燃えると、搭載している弾薬が激しく燃え上がりす。 + Ermöglicht Selbstzündung von Munition. Feuert Projektile der Munition ab, solange das Fahrzeug brennt und Munition besitzt. + Aktywuje samozapłon amunicji. Wystrzeliwuje pociski podczas gdy pojazd płonie i posiada amunicję. + Mets à feu les munitions lorsqu'un véhicule est en feu et contient des munitions. + Abilita l'esplosione delle munizioni. Spara munizioni di proiettili quando il veicolo va a fuoco e contiene munizioni. + 開啟彈藥殉爆效果。當一台載有彈藥的載具起火時, 將會有殉爆的效果。 + 开启弹药殉爆效果。当一台载有弹药的载具起火时, 将会有殉爆的效果。 + 쿡오프 현상을 활성화 합니다. 이것은 탄약에 불이 붙어있는 동안 주변에 발사체를 발사합니다. + + + Ammunition cook off duration + Munitionsselbstzündungdauer + Czas trwania samozapłonu amunicji + 弾薬の誘爆持続時間 + Durée cook-off des munitions + Durata esplosione munizioni + 彈藥殉爆效果持續時間 + 弹药殉爆效果持续时间 + 쿡오프 지속 시간 + + + Multiplier for how long cook off lasts [Setting to 0 will disable ammo cookoff] + Faktor für die Munitionsselbstzündungdauer [0 zum Deaktivieren] + Multiplicateur de la durée du cook-off des munitions [Une valeur de 0 désactive l'effet] + Mnożnik decydujący jak długo ma trwać samozapłon amunicji [Ustawienie na 0 spowoduje wyłącznie samozapłonu] + 誘爆の持続時間を乗数で設定。[0 に設定で誘爆を無効化] + Moltiplicatore della durata dell'esplosione [Impostare 0 disabiliterà l'esplosione delle munizioni] + 設定彈藥殉爆效果會持續多久時間 [輸入0來關閉殉爆效果] + 设定弹药殉爆效果会持续多久时间 [输入0来关闭殉爆效果] + 쿡오프 지속 시간의 배수 [0 이면 비활성] diff --git a/addons/dagr/CfgWeapons.hpp b/addons/dagr/CfgWeapons.hpp index b6601e094c..0d6ec3951f 100644 --- a/addons/dagr/CfgWeapons.hpp +++ b/addons/dagr/CfgWeapons.hpp @@ -1,7 +1,7 @@ class CfgWeapons { class ACE_ItemCore; - class InventoryItem_Base_F; + class CBA_MiscItem_ItemInfo; class ACE_DAGR: ACE_ItemCore { author[] = {$STR_ACE_Common_ACETeam, "Ruthberg"}; @@ -12,7 +12,7 @@ class CfgWeapons { picture = QPATHTOF(UI\DAGR_Icon.paa); icon = "iconObject_circle"; mapSize = 0.034; - class ItemInfo: InventoryItem_Base_F { + class ItemInfo: CBA_MiscItem_ItemInfo { mass = 10; }; }; diff --git a/addons/dagr/XEH_preInit.sqf b/addons/dagr/XEH_preInit.sqf index a7feade1c3..b47cf6628d 100644 --- a/addons/dagr/XEH_preInit.sqf +++ b/addons/dagr/XEH_preInit.sqf @@ -2,6 +2,8 @@ ADDON = false; +PREP_RECOMPILE_START; #include "XEH_PREP.hpp" +PREP_RECOMPILE_END; ADDON = true; diff --git a/addons/dagr/functions/fnc_handleRangeFinderData.sqf b/addons/dagr/functions/fnc_handleRangeFinderData.sqf index 59e10a1711..6d932e5e0d 100644 --- a/addons/dagr/functions/fnc_handleRangeFinderData.sqf +++ b/addons/dagr/functions/fnc_handleRangeFinderData.sqf @@ -8,7 +8,7 @@ * 2: Inclination (Degrees) * * Return Value: - * Nothing + * None * * Example: * [1000, 45, 1] call ace_dagr_fnc_handleRangeFinderData @@ -19,7 +19,7 @@ #define EMP_RF_ACC 5 // Rangefinder Accuracy -PARAMS_3(_slopeDistance,_azimuth,_inclination); +params ["_slopeDistance", "_azimuth", "_inclination"]; if (GVAR(vectorConnected)) then { GVAR(LAZPOS) = (eyePos player) vectorAdd ([_slopeDistance, _azimuth, _inclination] call CBA_fnc_polar2vect); diff --git a/addons/dagr/functions/fnc_menuInit.sqf b/addons/dagr/functions/fnc_menuInit.sqf index c4aa989854..b061717c58 100644 --- a/addons/dagr/functions/fnc_menuInit.sqf +++ b/addons/dagr/functions/fnc_menuInit.sqf @@ -3,10 +3,10 @@ * Creates the DAGR menu dialog * * Arguments: - * Nothing + * None * * Return Value: - * Nothing + * None * * Example: * diff --git a/addons/dagr/functions/fnc_outputData.sqf b/addons/dagr/functions/fnc_outputData.sqf index 0fcc3ccbda..edabf6209c 100644 --- a/addons/dagr/functions/fnc_outputData.sqf +++ b/addons/dagr/functions/fnc_outputData.sqf @@ -3,12 +3,13 @@ * DAGR data output loop * * Arguments: - * Nothing + * None * * Return Value: - * Nothing + * None * * Example: + * call ace_dagr_fnc_outputData * * Public: No */ @@ -30,8 +31,6 @@ __background ctrlSetText QPATHTOF(UI\dagr_gps.paa); 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; @@ -40,30 +39,30 @@ GVAR(outputPFH) = [{ }; // GRID - _gridArray = [(getPos ACE_player), false] call EFUNC(common,getMapGridFromPos); + private _gridArray = [(getPos ACE_player), false] call EFUNC(common,getMapGridFromPos); _gridArray params ["_gridArrayX","_gridArrayY"]; - _dagrGrid = format ["%1 %2", ((_gridArrayX) select [0,4]), ((_gridArrayY) select [0,4])]; + private _dagrGrid = format ["%1 %2", ((_gridArrayX) select [0,4]), ((_gridArrayY) select [0,4])]; // SPEED - _speed = speed (vehicle ACE_player); + private _speed = speed (vehicle ACE_player); _speed = floor (_speed * 10) / 10; _speed = abs(_speed); _dagrspeed = str _speed + "kph"; // Elevation - _elevation = getPosASL ACE_player; + private _elevation = getPosASL ACE_player; _elevation = floor ((_elevation select 2) + EGVAR(common,mapAltitude)); - _dagrElevation = str _elevation + "m"; + private _dagrElevation = str _elevation + "m"; // Heading - _dagrHeading = if (!GVAR(useDegrees)) then { + private _dagrHeading = if (!GVAR(useDegrees)) then { floor (DEG_TO_MIL(direction (vehicle ACE_player))) } else { floor (direction (vehicle ACE_player)) }; // Time - _dagrTime = [daytime, "HH:MM"] call bis_fnc_timeToString; + private _dagrTime = [daytime, "HH:MM"] call bis_fnc_timeToString; // Output __gridControl ctrlSetText format ["%1", _dagrGrid]; diff --git a/addons/dagr/functions/fnc_outputVector.sqf b/addons/dagr/functions/fnc_outputVector.sqf index 23996c46b4..12716f0e5b 100644 --- a/addons/dagr/functions/fnc_outputVector.sqf +++ b/addons/dagr/functions/fnc_outputVector.sqf @@ -1,20 +1,20 @@ -/* +/* * Author: Rosuto * DAGR vector output loop * * Arguments: - * Nothing + * None * * Return Value: - * Nothing + * None * * Example: + * call ace_dagr_fnc_outputVector * * Public: No */ -#include "script_component.hpp" -private ["_xGrid", "_yGrid", "_dagrGrid", "_bearing", "_dagrDist", "_dagrElevation", "_dagrTime", "_elevation", "_xCoord", "_yCoord"]; +#include "script_component.hpp" 135471 cutRsc ["DAGR_DISPLAY", "plain down"]; @@ -37,7 +37,7 @@ if (_lazPosX < 0) then { _lazPosX = _lazPosX + 99999;}; if (_lazPosY < 0) then {_lazPosY = _lazPosY + 99999;}; // Find laser position -_xGrid = toArray Str(round _lazPosX); +private _xGrid = toArray Str(round _lazPosX); while {count _xGrid < 5} do { _xGrid = [48] + _xGrid; @@ -46,7 +46,7 @@ _xGrid resize 4; _xGrid = toString _xGrid; _xGrid = parseNumber _xGrid; -_yGrid = toArray Str(round _lazPosY); +private _yGrid = toArray Str(round _lazPosY); while {count _yGrid < 5} do { _yGrid = [48] + _yGrid; }; @@ -54,37 +54,37 @@ _yGrid resize 4; _yGrid = toString _yGrid; _yGrid = parseNumber _yGrid; -_xCoord = switch true do { +private _xCoord = switch true do { case (_xGrid >= 1000): { "" + Str(_xGrid) }; case (_xGrid >= 100): { "0" + Str(_xGrid) }; case (_xGrid >= 10): { "00" + Str(_xGrid) }; default { "000" + Str(_xGrid) }; }; -_yCoord = switch true do { +private _yCoord = switch true do { case (_yGrid >= 1000): { "" + Str(_yGrid) }; case (_yGrid >= 100): { "0" + Str(_yGrid) }; case (_yGrid >= 10): { "00" + Str(_yGrid) }; default { "000" + Str(_yGrid) }; }; -_dagrGrid = _xCoord + " " + _yCoord; +private _dagrGrid = _xCoord + " " + _yCoord; // Find target elevation -_elevation = floor ((_lazPosZ) + EGVAR(common,mapAltitude)); -_dagrElevation = str _elevation + "m"; +private _elevation = floor ((_lazPosZ) + EGVAR(common,mapAltitude)); +private _dagrElevation = str _elevation + "m"; // Time -_dagrTime = [daytime, "HH:MM"] call bis_fnc_timeToString; +private _dagrTime = [daytime, "HH:MM"] call bis_fnc_timeToString; // Bearing -_bearing = GVAR(LAZHEADING); +private _bearing = GVAR(LAZHEADING); if (_bearing >= 360) then {_bearing = _bearing - 360;}; if (!GVAR(useDegrees)) then {_bearing = DEG_TO_MIL(_bearing)}; _bearing = floor (_bearing); // Distance -_dagrDist = str GVAR(LAZDIST) + "m"; +private _dagrDist = str GVAR(LAZDIST) + "m"; // Put grid into variable so DAGR menu can access it GVAR(vectorGrid) = _dagrGrid; diff --git a/addons/dagr/functions/fnc_outputWP.sqf b/addons/dagr/functions/fnc_outputWP.sqf index d36f222a51..0b6a77db7d 100644 --- a/addons/dagr/functions/fnc_outputWP.sqf +++ b/addons/dagr/functions/fnc_outputWP.sqf @@ -1,14 +1,15 @@ -/* +/* * Author: Rosuto * DAGR waypoint output loop * * Arguments: - * Nothing + * None * * Return Value: - * Nothing + * None * * Example: + * call ace_dagr_fnc_outputWP * * Public: No */ @@ -30,8 +31,6 @@ __background ctrlSetText QPATHTOF(UI\dagr_wp.paa); 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; @@ -40,13 +39,13 @@ GVAR(outputPFH) = [{ }; // GRID - _gridArray = [(getPos ACE_player), false] call EFUNC(common,getMapGridFromPos); + private _gridArray = [(getPos ACE_player), false] call EFUNC(common,getMapGridFromPos); _gridArray params ["_gridArrayX","_gridArrayY"]; - _dagrGrid = format ["%1 %2", (_gridArrayX select [0,4]), (_gridArrayY select [0,4])]; + private _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; + private _xGrid2 = floor (DAGR_WP_INFO / 10000); + private _yGrid2 = DAGR_WP_INFO - _xGrid2 * 10000; _xCoord2 = switch true do { case (_xGrid2 >= 1000): { "" + Str(_xGrid2) }; @@ -65,21 +64,25 @@ GVAR(outputPFH) = [{ _dagrGrid2 = _xCoord2 + " " + _yCoord2; // Distance - _WPpos = [_dagrGrid2, true] call EFUNC(common,getMapPosFromGrid); - _MYpos = [_dagrGrid, true] call EFUNC(common,getMapPosFromGrid); - _distance = _MYpos distance _WPpos; + private _WPpos = [_dagrGrid2, true] call EFUNC(common,getMapPosFromGrid); + private _MYpos = [_dagrGrid, true] call EFUNC(common,getMapPosFromGrid); + private _distance = _MYpos distance _WPpos; _distance = floor (_distance * 10) / 10; - _dagrDistance = str _distance + "m"; + private _dagrDistance = str _distance + "m"; // Heading - _dagrHeading = floor (if (GVAR(useDegrees)) then { + private _dagrHeading = floor (if (GVAR(useDegrees)) then { direction (vehicle ACE_player) } else { DEG_TO_MIL(direction (vehicle ACE_player)) }); // WP Heading - _bearing = floor ((_WPpos vectorDiff _MYpos) call CBA_fnc_vectDir); + private _bearing = floor (if (GVAR(useDegrees)) then { + ((_WPpos vectorDiff _MYpos) call CBA_fnc_vectDir) + } else { + DEG_TO_MIL(((_WPpos vectorDiff _MYpos) call CBA_fnc_vectDir)) + }); // Output __gridControl ctrlSetText format ["%1", _dagrGrid]; diff --git a/addons/dagr/functions/fnc_toggleOverlay.sqf b/addons/dagr/functions/fnc_toggleOverlay.sqf index d48a83ae51..af9909efda 100644 --- a/addons/dagr/functions/fnc_toggleOverlay.sqf +++ b/addons/dagr/functions/fnc_toggleOverlay.sqf @@ -3,12 +3,13 @@ * Toggles the DAGR overlay * * Arguments: - * Nothing + * None * * Return Value: - * Nothing + * None * * Example: + * call ace_dagr_fnc_toggleOverlay * * Public: No */ diff --git a/addons/dagr/initKeybinds.sqf b/addons/dagr/initKeybinds.sqf index 74a522e87f..d99e0f15c7 100644 --- a/addons/dagr/initKeybinds.sqf +++ b/addons/dagr/initKeybinds.sqf @@ -1,5 +1,5 @@ -["ACE3 Equipment", QGVAR(MenuKey), "Configure DAGR", +["ACE3 Equipment", QGVAR(MenuKey), localize LSTRING(ConfigureDAGR), { // Conditions: canInteract if !([ACE_player, objNull, ["notOnMap", "isNotInside", "isNotSitting"]] call EFUNC(common,canInteractWith)) exitWith {false}; @@ -16,7 +16,7 @@ {false}, [0, [false, true, false]], false] call CBA_fnc_addKeybind; // (empty default key) -["ACE3 Equipment", QGVAR(ToggleKey), "Toggle DAGR", +["ACE3 Equipment", QGVAR(ToggleKey), localize LSTRING(ToggleDAGR), { // Conditions: canInteract if !([ACE_player, objNull, ["notOnMap", "isNotInside", "isNotSitting"]] call EFUNC(common,canInteractWith)) exitWith {false}; @@ -30,11 +30,10 @@ [0, [false, false, false]], false] call CBA_fnc_addKeybind; // (empty default key) //Add deviceKey entry: -private ["_conditonCode", "_toggleCode", "_closeCode"]; -_conditonCode = { +private _conditonCode = { ([ACE_player, "ACE_DAGR"] call EFUNC(common,hasItem)); }; -_toggleCode = { +private _toggleCode = { // Conditions: canInteract if !([ACE_player, objNull, []] call EFUNC(common,canInteractWith)) exitWith {}; @@ -44,7 +43,7 @@ _toggleCode = { [] call FUNC(menuInit); }; }; -_closeCode = { +private _closeCode = { // Statement if (GVAR(run)) then { //If dispaly is open, close it: diff --git a/addons/dagr/stringtable.xml b/addons/dagr/stringtable.xml index e0c03e63f0..c364eedabe 100644 --- a/addons/dagr/stringtable.xml +++ b/addons/dagr/stringtable.xml @@ -1,4 +1,4 @@ - + @@ -12,6 +12,9 @@ DAGR DAGR DAGR + DAGR + 軍用GPS接收器 + 军用GPS接收器 Configure DAGR @@ -24,6 +27,9 @@ Configura DAGR Configurer le DAGR DAGR を設定 + DAGR 설정 + 設定軍用GPS接收器 + 设定军用GPS接收器 Toggle DAGR @@ -36,6 +42,9 @@ Apri DAGR Activer/Desactiver le DAGR DAGR を常に表示 + DAGR 토글 + 切換軍用GPS接收器 + 切换军用GPS接收器 Defense Advanced GPS Receiver @@ -48,6 +57,9 @@ Defense Advanced GPS Receiver Defense Advanced GPS Receiver アドバンスド DAGR の受信を定義します + 국방 고급위성항법시스템 수신기 + 軍用高級防禦GPS接收器 + 军用高级防御GPS接收器 - \ No newline at end of file + diff --git a/addons/disarming/CfgVehicles.hpp b/addons/disarming/CfgVehicles.hpp index 1d04bb157c..189c118bce 100644 --- a/addons/disarming/CfgVehicles.hpp +++ b/addons/disarming/CfgVehicles.hpp @@ -8,8 +8,8 @@ class CfgVehicles { distance = 3.5; condition = QUOTE([ARR_2(_player,_target)] call FUNC(canPlayerDisarmUnit)); statement = QUOTE([ARR_2(_player,_target)] call FUNC(openDisarmDialog)); + exceptions[] = {"isNotSwimming"}; icon = QPATHTOF(UI\disarm.paa); - exceptions[] = {}; }; }; }; diff --git a/addons/disarming/CfgWeapons.hpp b/addons/disarming/CfgWeapons.hpp index 4e7122ba41..94f1bd8a2c 100644 --- a/addons/disarming/CfgWeapons.hpp +++ b/addons/disarming/CfgWeapons.hpp @@ -1,13 +1,13 @@ class CfgWeapons { class ACE_ItemCore; - class InventoryItem_Base_F; + class CBA_MiscItem_ItemInfo; class ACE_DebugPotato: ACE_ItemCore { displayName = "ACE Potato (debug)"; descriptionShort = "Glorious Potato
If you see this in game it means someone fucked up"; picture = QPATHTOF(UI\potato_ca.paa); scope = 1; - class ItemInfo: InventoryItem_Base_F { + class ItemInfo: CBA_MiscItem_ItemInfo { mass = 1; }; }; diff --git a/addons/disarming/XEH_preInit.sqf b/addons/disarming/XEH_preInit.sqf index a7feade1c3..b47cf6628d 100644 --- a/addons/disarming/XEH_preInit.sqf +++ b/addons/disarming/XEH_preInit.sqf @@ -2,6 +2,8 @@ ADDON = false; +PREP_RECOMPILE_START; #include "XEH_PREP.hpp" +PREP_RECOMPILE_END; ADDON = true; diff --git a/addons/disarming/functions/fnc_canBeDisarmed.sqf b/addons/disarming/functions/fnc_canBeDisarmed.sqf index 9be20db7f4..7e45c42ce0 100644 --- a/addons/disarming/functions/fnc_canBeDisarmed.sqf +++ b/addons/disarming/functions/fnc_canBeDisarmed.sqf @@ -16,16 +16,14 @@ */ #include "script_component.hpp" -private ["_animationStateCfgMoves", "_putDownAnim"]; - params ["_target"]; //Check animationState for putDown anim //This ensures the unit doesn't have to actualy do any animation to drop something //This should always be true for the 3 possible status effects that allow disarming -_animationStateCfgMoves = getText (configFile >> "CfgMovesMaleSdr" >> "States" >> (animationState _target) >> "actions"); +private _animationStateCfgMoves = getText (configFile >> "CfgMovesMaleSdr" >> "States" >> (animationState _target) >> "actions"); if (_animationStateCfgMoves == "") exitWith { false }; -_putDownAnim = getText (configFile >> "CfgMovesBasic" >> "Actions" >> _animationStateCfgMoves >> "PutDown"); +private _putDownAnim = getText (configFile >> "CfgMovesBasic" >> "Actions" >> _animationStateCfgMoves >> "PutDown"); if (_putDownAnim != "") exitWith { false }; diff --git a/addons/disarming/functions/fnc_canPlayerDisarmUnit.sqf b/addons/disarming/functions/fnc_canPlayerDisarmUnit.sqf index 34f1a10d32..3c375c8ddf 100644 --- a/addons/disarming/functions/fnc_canPlayerDisarmUnit.sqf +++ b/addons/disarming/functions/fnc_canPlayerDisarmUnit.sqf @@ -20,4 +20,4 @@ params ["_player", "_target"]; ([_target] call FUNC(canBeDisarmed)) && -{([_player, _target, []] call EFUNC(common,canInteractWith))} +{([_player, _target, ["isNotSwimming"]] call EFUNC(common,canInteractWith))} diff --git a/addons/disarming/functions/fnc_disarmDropItems.sqf b/addons/disarming/functions/fnc_disarmDropItems.sqf index c9eb920084..fe362aedd0 100644 --- a/addons/disarming/functions/fnc_disarmDropItems.sqf +++ b/addons/disarming/functions/fnc_disarmDropItems.sqf @@ -4,13 +4,13 @@ * Makes a unit drop items * * Arguments: - * 0: caller (player) - * 1: target - * 2: classnamess - * 3: Do Not Drop Ammo + * 0: Caller (player) + * 1: Target + * 2: Classnames + * 3: Do Not Drop Ammo (default: false) * * Return Value: - * Nothing + * None * * Example: * [player, cursorTarget, ["ace_bandage"]] call ace_disarming_fnc_disarmDropItems @@ -21,12 +21,10 @@ #define TIME_MAX_WAIT 5 -private ["_fncSumArray", "_return", "_holder", "_dropPos", "_targetMagazinesStart", "_holderMagazinesStart", "_xClassname", "_xAmmo", "_targetMagazinesEnd", "_holderMagazinesEnd", "_holderItemsStart", "_targetItemsStart", "_addToCrateClassnames", "_addToCrateCount", "_index", "_holderItemsEnd", "_targetItemsEnd", "_holderIsEmpty"]; - params ["_caller", "_target", "_listOfItemsToRemove", ["_doNotDropAmmo", false, [false]]]; //By default units drop all weapon mags when dropping a weapon -_fncSumArray = { - _return = 0; +private _fncSumArray = { + private _return = 0; {_return = _return + _x;} count (_this select 0); _return }; @@ -39,7 +37,7 @@ if (_doNotDropAmmo && {({_x in _listOfItemsToRemove} count (magazines _target)) [_caller, _target, "Debug: Trying to drop magazine with _doNotDropAmmo flag"] call FUNC(eventTargetFinish); }; -_holder = objNull; +private _holder = objNull; //If not dropping ammo, don't use an existing container if (!_doNotDropAmmo) then { @@ -52,7 +50,7 @@ if (!_doNotDropAmmo) then { //Create a new weapon holder if (isNull _holder) then { - _dropPos = _target modelToWorld [0.4, 0.75, 0]; //offset someone unconscious isn't lying over it + private _dropPos = _target modelToWorld [0.4, 0.75, 0]; //offset someone unconscious isn't lying over it _dropPos set [2, ((getPosASL _target) select 2)]; _holder = createVehicle [DISARM_CONTAINER, _dropPos, [], 0, "CAN_COLLIDE"]; _holder setPosASL _dropPos; @@ -73,19 +71,19 @@ _holder setVariable [QGVAR(holderInUse), true]; //Remove Magazines -_targetMagazinesStart = magazinesAmmo _target; -_holderMagazinesStart = magazinesAmmoCargo _holder; +private _targetMagazinesStart = magazinesAmmo _target; +private _holderMagazinesStart = magazinesAmmoCargo _holder; { - EXPLODE_2_PVT(_x,_xClassname,_xAmmo); + _x params ["_xClassname", "_xAmmo"]; if ((_xClassname in _listOfItemsToRemove) && {(getNumber (configFile >> "CfgMagazines" >> _xClassname >> "ACE_isUnique")) == 0}) then { _holder addMagazineAmmoCargo [_xClassname, 1, _xAmmo]; _target removeMagazine _xClassname; }; } forEach _targetMagazinesStart; -_targetMagazinesEnd = magazinesAmmo _target; -_holderMagazinesEnd = magazinesAmmoCargo _holder; +private _targetMagazinesEnd = magazinesAmmo _target; +private _holderMagazinesEnd = magazinesAmmoCargo _holder; //Verify Mags dropped from unit: if (({((_x select 0) in _listOfItemsToRemove) && {(getNumber (configFile >> "CfgMagazines" >> (_x select 0) >> "ACE_isUnique")) == 0}} count _targetMagazinesEnd) != 0) exitWith { @@ -100,14 +98,14 @@ if (!([_targetMagazinesStart, _targetMagazinesEnd, _holderMagazinesStart, _holde }; //Remove Items, Assigned Items and NVG -_holderItemsStart = getitemCargo _holder; -_targetItemsStart = (assignedItems _target) + (items _target) - (weapons _target); +private _holderItemsStart = getitemCargo _holder; +private _targetItemsStart = (assignedItems _target) + (items _target) - (weapons _target); if ((headgear _target) != "") then {_targetItemsStart pushBack (headgear _target);}; if ((goggles _target) != "") then {_targetItemsStart pushBack (goggles _target);}; -_addToCrateClassnames = []; -_addToCrateCount = []; +private _addToCrateClassnames = []; +private _addToCrateCount = []; { if (_x in _listOfItemsToRemove) then { if (_x in (items _target)) then { @@ -115,7 +113,7 @@ _addToCrateCount = []; } else { _target unlinkItem _x; }; - _index = _addToCrateClassnames find _x; + private _index = _addToCrateClassnames find _x; if (_index != -1) then { _addToCrateCount set [_index, ((_addToCrateCount select _index) + 1)]; } else { @@ -130,8 +128,8 @@ _addToCrateCount = []; _holder addItemCargoGlobal [(_addToCrateClassnames select _forEachIndex), (_addToCrateCount select _forEachIndex)]; } forEach _addToCrateClassnames; -_holderItemsEnd = getitemCargo _holder; -_targetItemsEnd = (assignedItems _target) + (items _target) - (weapons _target); +private _holderItemsEnd = getitemCargo _holder; +private _targetItemsEnd = (assignedItems _target) + (items _target) - (weapons _target); if ((headgear _target) != "") then {_targetItemsEnd pushBack (headgear _target);}; if ((goggles _target) != "") then {_targetItemsEnd pushBack (goggles _target);}; @@ -158,7 +156,7 @@ if (((vest _target) != "") && {(vest _target) in _listOfItemsToRemove} && {(vest //If holder is still empty, it will be 'garbage collected' while we wait for the drop 'action' to take place //So add a dummy item and just remove at the end -_holderIsEmpty = ([_holder] call FUNC(getAllGearContainer)) isEqualTo [[],[]]; +private _holderIsEmpty = ([_holder] call FUNC(getAllGearContainer)) isEqualTo [[],[]]; if (_holderIsEmpty) then { TRACE_1("Debug: adding dummy item to holder",_holder); _holder addItemCargoGlobal [DUMMY_ITEM, 1]; @@ -166,16 +164,14 @@ if (_holderIsEmpty) then { //Start the PFEH to do the actions (which could take >1 frame) [{ - private ["_needToRemoveWeapon", "_needToRemoveMagazines", "_needToRemoveBackpack", "_needToRemoveVest", "_needToRemoveUniform", "_error", "_magsToPickup", "_index", "_magazinesInHolder"]; + params ["_args", "_pfID"]; + _args params ["_caller", "_target", "_listOfItemsToRemove", "_holder", "_holderIsEmpty", "_maxWaitTime", "_doNotDropAmmo", "_startingMagazines"]; - PARAMS_2(_args,_pfID); - EXPLODE_8_PVT(_args,_caller,_target,_listOfItemsToRemove,_holder,_holderIsEmpty,_maxWaitTime,_doNotDropAmmo,_startingMagazines); - - _needToRemoveWeapon = ({_x in _listOfItemsToRemove} count (weapons _target)) > 0; - _needToRemoveMagazines = ({_x in _listOfItemsToRemove} count (magazines _target)) > 0; - _needToRemoveBackpack = ((backPack _target) != "") && {(backPack _target) in _listOfItemsToRemove}; - _needToRemoveVest = ((vest _target) != "") && {(vest _target) in _listOfItemsToRemove}; - _needToRemoveUniform = ((uniform _target) != "") && {(uniform _target) in _listOfItemsToRemove}; + private _needToRemoveWeapon = ({_x in _listOfItemsToRemove} count (weapons _target)) > 0; + private _needToRemoveMagazines = ({_x in _listOfItemsToRemove} count (magazines _target)) > 0; + private _needToRemoveBackpack = ((backPack _target) != "") && {(backPack _target) in _listOfItemsToRemove}; + private _needToRemoveVest = ((vest _target) != "") && {(vest _target) in _listOfItemsToRemove}; + private _needToRemoveUniform = ((uniform _target) != "") && {(uniform _target) in _listOfItemsToRemove}; if ((CBA_missionTime < _maxWaitTime) && {[_target] call FUNC(canBeDisarmed)} && {_needToRemoveWeapon || _needToRemoveMagazines || _needToRemoveBackpack}) then { //action drop weapons (keeps loaded magazine and attachements) @@ -198,18 +194,18 @@ if (_holderIsEmpty) then { [_pfID] call CBA_fnc_removePerFrameHandler; if (_doNotDropAmmo) then { - _error = false; + private _error = false; - _magsToPickup = +_startingMagazines; + private _magsToPickup = +_startingMagazines; { - _index = _magsToPickup find _x; + private _index = _magsToPickup find _x; if (_index == -1) exitWith {_error = true; ERROR("More mags than when we started?")}; _magsToPickup deleteAt _index; } forEach (magazinesAmmo _target); - _magazinesInHolder = magazinesAmmoCargo _holder; + private _magazinesInHolder = magazinesAmmoCargo _holder; { - _index = _magazinesInHolder find _x; + private _index = _magazinesInHolder find _x; if (_index == -1) exitWith {_error = true; ERROR("Missing mag not in holder")}; _magazinesInHolder deleteAt _index; } forEach _magsToPickup; diff --git a/addons/disarming/functions/fnc_eventTargetFinish.sqf b/addons/disarming/functions/fnc_eventTargetFinish.sqf index d71d93d254..f700cb6f79 100644 --- a/addons/disarming/functions/fnc_eventTargetFinish.sqf +++ b/addons/disarming/functions/fnc_eventTargetFinish.sqf @@ -10,7 +10,7 @@ * 2: errorMsg * * Return Value: - * Nothing + * None * * Example: * [player1, player2, "Someting fucked up"] call ace_disarming_fnc_eventTargetFinish diff --git a/addons/disarming/functions/fnc_eventTargetStart.sqf b/addons/disarming/functions/fnc_eventTargetStart.sqf index 77dfd9d271..8490c17be1 100644 --- a/addons/disarming/functions/fnc_eventTargetStart.sqf +++ b/addons/disarming/functions/fnc_eventTargetStart.sqf @@ -10,10 +10,10 @@ * 2: type of disarm * * Return Value: - * Nothing + * None * * Example: - * eventTargetStart + * [bob, kevin, "disarm"] call ace_disarming_fnc_eventTargetStart * * Public: No */ diff --git a/addons/disarming/functions/fnc_getAllGearUnit.sqf b/addons/disarming/functions/fnc_getAllGearUnit.sqf index bdd1ff0bf9..30d263fd27 100644 --- a/addons/disarming/functions/fnc_getAllGearUnit.sqf +++ b/addons/disarming/functions/fnc_getAllGearUnit.sqf @@ -18,9 +18,7 @@ params ["_target"]; -private ["_allItems", "_classnamesCount", "_index", "_uniqueClassnames"]; - -_allItems = (((items _target) + (assignedItems _target)) - (weapons _target)) + (weapons _target) + (magazines _target); +private _allItems = (((items _target) + (assignedItems _target)) - (weapons _target)) + (weapons _target) + (magazines _target); if ((backpack _target) != "") then { _allItems pushBack (backpack _target); @@ -39,11 +37,11 @@ if ((goggles _target) != "") then { _allItems pushBack (goggles _target); }; -_uniqueClassnames = []; -_classnamesCount = []; +private _uniqueClassnames = []; +private _classnamesCount = []; //Filter unique and count { - _index = _uniqueClassnames find _x; + private _index = _uniqueClassnames find _x; if (_index != -1) then { _classnamesCount set [_index, ((_classnamesCount select _index) + 1)]; } else { diff --git a/addons/disarming/functions/fnc_openDisarmDialog.sqf b/addons/disarming/functions/fnc_openDisarmDialog.sqf index 6763f9a9fa..0490598231 100644 --- a/addons/disarming/functions/fnc_openDisarmDialog.sqf +++ b/addons/disarming/functions/fnc_openDisarmDialog.sqf @@ -48,7 +48,6 @@ GVAR(disarmTarget) = _target; //Setup PFEH [{ - private ["_groundContainer", "_targetContainer", "_playerName", "_icon", "_rankPicture", "_targetUniqueItems", "_holderUniqueItems", "_holder"]; disableSerialization; params ["_args", "_idPFH"]; _args params ["_player", "_target", "_display"]; @@ -62,13 +61,13 @@ GVAR(disarmTarget) = _target; if (!isNull _display) then { closeDialog 0; }; //close dialog if still open } else { - _groundContainer = _display displayCtrl 632; - _targetContainer = _display displayCtrl 633; - _playerName = _display displayCtrl 111; - _rankPicture = _display displayCtrl 1203; + private _groundContainer = _display displayCtrl 632; + private _targetContainer = _display displayCtrl 633; + private _playerName = _display displayCtrl 111; + private _rankPicture = _display displayCtrl 1203; //Show rank and name (just like BIS's inventory) - _icon = format [DEFUALTPATH, toLower (rank _target)]; + private _icon = format [DEFUALTPATH, toLower (rank _target)]; if (_icon isEqualTo DEFUALTPATH) then {_icon = ""}; _rankPicture ctrlSetText _icon; _playerName ctrlSetText ([GVAR(disarmTarget), false, true] call EFUNC(common,getName)); @@ -78,11 +77,11 @@ GVAR(disarmTarget) = _target; lbClear _targetContainer; //Show the items in the ground disarmTarget's inventory - _targetUniqueItems = [GVAR(disarmTarget)] call FUNC(getAllGearUnit); + private _targetUniqueItems = [GVAR(disarmTarget)] call FUNC(getAllGearUnit); [_targetContainer, _targetUniqueItems] call FUNC(showItemsInListbox); //Try to find a holder that the target is using to drop items into: - _holder = objNull; + private _holder = objNull; { if ((_x getVariable [QGVAR(disarmUnit), objNull]) == _target) exitWith { _holder = _x; @@ -91,7 +90,7 @@ GVAR(disarmTarget) = _target; //If a holder exists, show it's inventory if (!isNull _holder) then { - _holderUniqueItems = [_holder] call FUNC(getAllGearContainer); + private _holderUniqueItems = [_holder] call FUNC(getAllGearContainer); [_groundContainer, _holderUniqueItems] call FUNC(showItemsInListbox); }; }; diff --git a/addons/disarming/functions/fnc_showItemsInListbox.sqf b/addons/disarming/functions/fnc_showItemsInListbox.sqf index 82b9645850..741a67aa6c 100644 --- a/addons/disarming/functions/fnc_showItemsInListbox.sqf +++ b/addons/disarming/functions/fnc_showItemsInListbox.sqf @@ -8,7 +8,7 @@ * 1: ItemArray [["itemClassnames"],[counts]] * * Return Value: - * Nothing + * None * * Example: * [theListBox, [["ace_bandage"],[2]]] call ace_disarming_fnc_showItemsInListbox @@ -26,7 +26,7 @@ params ["_listBoxCtrl", "_itemsCountArray"]; private _count = (_itemsCountArray select 1) select _forEachIndex; if ((_classname != DUMMY_ITEM) && {_classname != "ACE_FakePrimaryWeapon"}) then { //Don't show the dummy potato or fake weapon - private "_configPath"; + private _configPath = configNull; private _displayName = ""; private _picture = ""; switch (true) do { diff --git a/addons/disarming/functions/fnc_verifyMagazinesMoved.sqf b/addons/disarming/functions/fnc_verifyMagazinesMoved.sqf index c324ab5268..5dddec5339 100644 --- a/addons/disarming/functions/fnc_verifyMagazinesMoved.sqf +++ b/addons/disarming/functions/fnc_verifyMagazinesMoved.sqf @@ -21,7 +21,7 @@ */ #include "script_component.hpp" -PARAMS_4(_startA,_endA,_startB,_endB); +params ["_startA", "_endA", "_startB", "_endB"]; //Quick Lazy Count Check if (((count _startA) + (count _startB)) != ((count _endA) + (count _endB))) exitWith { diff --git a/addons/disarming/stringtable.xml b/addons/disarming/stringtable.xml index f28fadead2..30f9fa4b85 100644 --- a/addons/disarming/stringtable.xml +++ b/addons/disarming/stringtable.xml @@ -1,4 +1,4 @@ - + @@ -13,6 +13,9 @@ Felszerelés megtekintése Abrir inventário インベントリを開く + 소지품 열기 + 開啟裝備 + 开启装备 - \ No newline at end of file + diff --git a/addons/disposable/CfgMagazines.hpp b/addons/disposable/CfgMagazines.hpp index d9ad0508db..dd1b799a0f 100644 --- a/addons/disposable/CfgMagazines.hpp +++ b/addons/disposable/CfgMagazines.hpp @@ -5,7 +5,7 @@ class CfgMagazines { scope = 1; scopeArsenal = 1; displayName = CSTRING(PreloadedMissileDummy); - picture = QPATHTOEF(common,UI\blank_CO.paa); + picture = "a3\ui_f\data\IGUI\Cfg\Targeting\Empty_ca.paa"; weaponPoolAvailable = 0; mass = 0; }; diff --git a/addons/disposable/CfgWeapons.hpp b/addons/disposable/CfgWeapons.hpp index 0ca6763d63..731910b704 100644 --- a/addons/disposable/CfgWeapons.hpp +++ b/addons/disposable/CfgWeapons.hpp @@ -5,6 +5,7 @@ class CfgWeapons { magazines[] = {"ACE_PreloadedMissileDummy"}; // The dummy magazine }; class ACE_launch_NLAW_Used_F: launch_NLAW_F { // the used tube should be a sub class of the disposable launcher + EGVAR(nlaw,enabled) = 0; // disable guidance for the disposabled tube scope = 1; ACE_isUsedLauncher = 1; author = ECSTRING(common,ACETeam); diff --git a/addons/disposable/XEH_preInit.sqf b/addons/disposable/XEH_preInit.sqf index a7feade1c3..b47cf6628d 100644 --- a/addons/disposable/XEH_preInit.sqf +++ b/addons/disposable/XEH_preInit.sqf @@ -2,6 +2,8 @@ ADDON = false; +PREP_RECOMPILE_START; #include "XEH_PREP.hpp" +PREP_RECOMPILE_END; ADDON = true; diff --git a/addons/disposable/functions/fnc_replaceATWeapon.sqf b/addons/disposable/functions/fnc_replaceATWeapon.sqf index 58c58a6056..d94944bfde 100644 --- a/addons/disposable/functions/fnc_replaceATWeapon.sqf +++ b/addons/disposable/functions/fnc_replaceATWeapon.sqf @@ -6,7 +6,7 @@ * None. Parameters inherited from EFUNC(common,firedEH) * * Return Value: - * Nothing + * None * * Example: * [fromBisFiredEH] call ace_disposable_fnc_replaceATWeapon; diff --git a/addons/disposable/stringtable.xml b/addons/disposable/stringtable.xml index cc9b43ab7c..f41b2cad88 100644 --- a/addons/disposable/stringtable.xml +++ b/addons/disposable/stringtable.xml @@ -1,4 +1,4 @@ - + @@ -10,9 +10,12 @@ Lanzador utilizado Elhasznált kilövőcső Отстрелянная труба - Tubo usato + Lanciatore usato Tubo utilizado 使用済み + 사용함 + 使用過的火箭筒 + 使用过的火箭筒 Used disposable rocket launcher @@ -26,6 +29,9 @@ Lanciarazzi monouso già utilizzato Lança foguetes descartável utilizado 使い終わったロケット ランチャーの筒部分 + 사용한 일회용 발사관 + 使用過的一次性火箭發射器 + 使用过的一次性火箭发射器 Preloaded Missile Dummy @@ -39,6 +45,9 @@ Missile inerte precaricato Míssel inerte pré-carregado 仮置きのミサイルをあらかじめ装填 + 임시로 미사일을 미리 장전 + 預裝訓練導彈 + 预装训练导弹 - \ No newline at end of file + diff --git a/addons/dogtags/CfgVehicles.hpp b/addons/dogtags/CfgVehicles.hpp index f2e0fc6ad7..170f1fb074 100644 --- a/addons/dogtags/CfgVehicles.hpp +++ b/addons/dogtags/CfgVehicles.hpp @@ -6,6 +6,7 @@ class CfgVehicles { displayName = CSTRING(itemName); condition = QUOTE([ARR_2(_player,_target)] call FUNC(canTakeDogtag)); statement = ""; + exceptions[] = {"isNotSwimming", "isNotInside"}; showDisabled = 0; distance = 1.75; icon = QPATHTOF(data\dogtag_icon_ca.paa); @@ -14,6 +15,7 @@ class CfgVehicles { displayName = CSTRING(checkDogtag); condition = QUOTE([ARR_2(_player,_target)] call FUNC(canCheckDogtag)); statement = QUOTE([ARR_2(_player,_target)] call FUNC(checkDogtag)); + exceptions[] = {"isNotSwimming", "isNotInside"}; showDisabled = 0; priority = 3; icon = QPATHTOF(data\dogtag_icon_ca.paa); @@ -22,6 +24,7 @@ class CfgVehicles { displayName = CSTRING(takeDogtag); condition = QUOTE([ARR_2(_player,_target)] call FUNC(canTakeDogtag)); statement = QUOTE([ARR_2(_player,_target)] call FUNC(takeDogtag)); + exceptions[] = {"isNotSwimming", "isNotInside"}; showDisabled = 0; priority = 3; icon = QPATHTOF(data\dogtag_icon_ca.paa); @@ -34,6 +37,7 @@ class CfgVehicles { displayName = CSTRING(checkItem); condition = "true"; statement = ""; + exceptions[] = {"isNotSwimming", "isNotInside", "isNotSitting"}; insertChildren = QUOTE(_this call DFUNC(addDogtagActions)); }; }; diff --git a/addons/dogtags/CfgWeapons.hpp b/addons/dogtags/CfgWeapons.hpp index a0ce4b0132..ec8d9e6ee4 100644 --- a/addons/dogtags/CfgWeapons.hpp +++ b/addons/dogtags/CfgWeapons.hpp @@ -10,7 +10,7 @@ class CfgWeapons { class ACE_ItemCore; - class InventoryItem_Base_F; + class CBA_MiscItem_ItemInfo; class ACE_dogtag: ACE_ItemCore { author = ECSTRING(common,ACETeam); @@ -18,7 +18,7 @@ class CfgWeapons { displayName = CSTRING(itemName); model = QUOTE(PATHTOF(data\ace_dogtag.p3d)); picture = QUOTE(PATHTOF(data\dogtagSingle.paa)); - class ItemInfo: InventoryItem_Base_F { + class ItemInfo: CBA_MiscItem_ItemInfo { mass = 0; //too small to for 1 ? }; }; diff --git a/addons/dogtags/XEH_PREP.hpp b/addons/dogtags/XEH_PREP.hpp index 33e42ba191..5917600139 100644 --- a/addons/dogtags/XEH_PREP.hpp +++ b/addons/dogtags/XEH_PREP.hpp @@ -1,3 +1,4 @@ + PREP(addDogtagActions); PREP(addDogtagItem); PREP(bloodType); @@ -11,3 +12,4 @@ PREP(sendDogtagData); PREP(showDogtag); PREP(ssn); PREP(takeDogtag); +PREP(disableFactionDogtags); diff --git a/addons/dogtags/XEH_postInit.sqf b/addons/dogtags/XEH_postInit.sqf index b0352c39ef..6a50ce61cf 100644 --- a/addons/dogtags/XEH_postInit.sqf +++ b/addons/dogtags/XEH_postInit.sqf @@ -45,3 +45,6 @@ if (["ACE_Medical"] call EFUNC(common,isModLoaded)) then { }] call CBA_fnc_addEventHandler; }; }; + +// disable dogtags for civilians +"CIV_F" call FUNC(disableFactionDogtags); diff --git a/addons/dogtags/XEH_preInit.sqf b/addons/dogtags/XEH_preInit.sqf index a7feade1c3..a7a080b91e 100644 --- a/addons/dogtags/XEH_preInit.sqf +++ b/addons/dogtags/XEH_preInit.sqf @@ -2,6 +2,10 @@ ADDON = false; +PREP_RECOMPILE_START; #include "XEH_PREP.hpp" +PREP_RECOMPILE_END; +GVAR(disabledFactions) = [] call CBA_fnc_createNamespace; + ADDON = true; diff --git a/addons/dogtags/functions/fnc_addDogtagActions.sqf b/addons/dogtags/functions/fnc_addDogtagActions.sqf index 05f136830c..988f909775 100644 --- a/addons/dogtags/functions/fnc_addDogtagActions.sqf +++ b/addons/dogtags/functions/fnc_addDogtagActions.sqf @@ -32,8 +32,7 @@ private _unitDogtagIDs = []; //Create action children for all dogtags private _actions = []; { - private _tagID = _unitDogtagIDs select _forEachIndex; - private _displayName = format ["%1 #%2", getText (configFile >> "CfgWeapons" >> _x >> "displayName"), _tagID]; + private _displayName = getText (configFile >> "CfgWeapons" >> _x >> "displayName"); private _picture = getText (configFile >> "CfgWeapons" >> _x >> "picture"); private _action = [_x, _displayName, _picture, {_this call FUNC(checkDogtagItem)}, {true}, {}, _x] call EFUNC(interact_menu,createAction); diff --git a/addons/dogtags/functions/fnc_canCheckDogtag.sqf b/addons/dogtags/functions/fnc_canCheckDogtag.sqf index 66a25c94b0..b31911a0c6 100644 --- a/addons/dogtags/functions/fnc_canCheckDogtag.sqf +++ b/addons/dogtags/functions/fnc_canCheckDogtag.sqf @@ -20,4 +20,7 @@ params ["_player", "_target"]; if (isNull _target) exitWith {false}; +// check if disabled for faction +if ([GVAR(disabledFactions) getVariable faction _target] param [0, false]) exitWith {false}; + (!alive _target) || {_target getVariable ["ACE_isUnconscious", false]} diff --git a/addons/dogtags/functions/fnc_canTakeDogtag.sqf b/addons/dogtags/functions/fnc_canTakeDogtag.sqf index 33a3ef055f..37163f68c7 100644 --- a/addons/dogtags/functions/fnc_canTakeDogtag.sqf +++ b/addons/dogtags/functions/fnc_canTakeDogtag.sqf @@ -20,4 +20,7 @@ params ["_player", "_target"]; if (isNull _target) exitWith {false}; +// check if disabled for faction +if ([GVAR(disabledFactions) getVariable faction _target] param [0, false]) exitWith {false}; + (!alive _target) || {_target getVariable ["ACE_isUnconscious", false]} diff --git a/addons/dogtags/functions/fnc_disableFactionDogtags.sqf b/addons/dogtags/functions/fnc_disableFactionDogtags.sqf new file mode 100644 index 0000000000..2418b31f4e --- /dev/null +++ b/addons/dogtags/functions/fnc_disableFactionDogtags.sqf @@ -0,0 +1,20 @@ +/* + * Author: commy2 + * Disable this faction from using dogtags. + * + * Arguments: + * 0: Faction + * + * Return Value: + * None + * + * Example: + * "CIV_F" call ace_dogtags_fnc_disableFactionDogtags + * + * Public: Yes + */ +#include "script_component.hpp" + +params [["_faction", "", [""]]]; + +GVAR(disabledFactions) setVariable [_faction, true]; diff --git a/addons/dogtags/functions/fnc_ssn.sqf b/addons/dogtags/functions/fnc_ssn.sqf index 330d4c00d2..257f47a790 100644 --- a/addons/dogtags/functions/fnc_ssn.sqf +++ b/addons/dogtags/functions/fnc_ssn.sqf @@ -17,8 +17,10 @@ params ["_name"]; -private _length = count _name; private _chars = toArray _name; +private _length = count _chars; +// Warning, for strings containing non-latin characters, `_count _name` != `_count _chars` + _chars pushBack _length; _length = _length + 1; diff --git a/addons/dogtags/stringtable.xml b/addons/dogtags/stringtable.xml index 7f57e75026..e47a0ae1b7 100644 --- a/addons/dogtags/stringtable.xml +++ b/addons/dogtags/stringtable.xml @@ -1,4 +1,4 @@ - + @@ -7,6 +7,12 @@ Жетон Identifikační známka ドッグ タグ + Hundemarke + 군번줄 + Plaque d'identification + Piastrina + 兵籍牌 + 兵籍牌 Check Dog Tag @@ -14,6 +20,12 @@ Проверить жетон Zkontrolovat známku ドッグ タグを見る + Hundemarke prüfen + 군번줄 확인 + Vérifier les plaques d'identification + Controlla Piastrina + 檢查兵籍牌 + 检查兵籍牌 Check @@ -21,6 +33,12 @@ Проверить Zkontroluj 見る + Prüfen + 확인 + Vérifier + Controlla + 檢查 + 检查 Take @@ -28,6 +46,12 @@ Взять Vezmi 取る + Nehmen + 회수 + Prendre + Prendi + 拿取 + 拿取 Dogtag taken from %1... @@ -35,6 +59,12 @@ Жетон снят с %1... Sebral jsem známku od %1... %1からドッグ タグを取っている・・・ + Hundemarke von %1 genommen ... + %1로부터 군번줄을 회수했습니다... + Plaque d'identification pris sur %1... + Piastrina presa da %1... + 從%1身上拿取兵籍牌... + 从%1身上拿取兵籍牌... Somebody else has already taken the dogtag... @@ -42,6 +72,12 @@ Кто-то уже забрал жетон... Někdo jiný už vzal identifikační známku... すでに誰かがドッグ タグを取っているようだ・・・ + Jemand anderes hat bereits die Hundemarke genommen ... + 누군가 이미 군번줄을 회수해갔습니다... + Quelqu'un d'autre a déjâ pris les plaques d'identification... + Qualcun altro ha già preso la piastrina... + 已經有人把他的兵籍牌拿走了... + 已经有人把他的兵籍牌拿走了... - \ No newline at end of file + diff --git a/addons/dragging/CfgVehicles.hpp b/addons/dragging/CfgVehicles.hpp index c8e3c7284a..8808ea9030 100644 --- a/addons/dragging/CfgVehicles.hpp +++ b/addons/dragging/CfgVehicles.hpp @@ -30,6 +30,21 @@ class CfgVehicles { GVAR(dragDirection) = 0; }; + // Big 1.70 Autonomous AA Turrets + class StaticMGWeapon; + class AAA_System_01_base_F: StaticMGWeapon { // Praetorian 1C (aka Phalanx CIWS) + GVAR(canCarry) = 0; + GVAR(canDrag) = 0; + }; + class SAM_System_01_base_F: StaticMGWeapon { // Mk49 Spartan + GVAR(canCarry) = 0; + GVAR(canDrag) = 0; + }; + class SAM_System_02_base_F: StaticMGWeapon { // Mk21 Centurion + GVAR(canCarry) = 0; + GVAR(canDrag) = 0; + }; + // ammo boxes class ThingX; class Items_base_F; @@ -52,6 +67,10 @@ class CfgVehicles { GVAR(canCarry) = 0; GVAR(canDrag) = 0; }; + class Pod_Heli_Transport_04_crewed_base_F: StaticWeapon { + GVAR(canCarry) = 0; + GVAR(canDrag) = 0; + }; class EAST_Box_Base: ReammoBox_F { GVAR(canCarry) = 1; @@ -188,7 +207,24 @@ class CfgVehicles { GVAR(dragPosition[]) = {0,1.5,0}; GVAR(dragDirection) = 90; }; + class Land_PaperBox_01_small_closed_base_F: Items_base_F { + GVAR(canCarry) = 1; + GVAR(carryPosition[]) = {0,1,1}; + GVAR(carryDirection) = 0; + GVAR(canDrag) = 1; + GVAR(dragPosition[]) = {0,1.5,0}; + GVAR(dragDirection) = 90; + }; + class Box_UAV_06_base_F: Items_base_F { + GVAR(canCarry) = 1; + GVAR(carryPosition[]) = {0,1,1}; + GVAR(carryDirection) = 0; + + GVAR(canDrag) = 1; + GVAR(dragPosition[]) = {0,1.5,0}; + GVAR(dragDirection) = 0; + }; class ACE_RepairItem_Base: ThingX {}; class ACE_Track: ACE_RepairItem_Base { diff --git a/addons/dragging/XEH_preInit.sqf b/addons/dragging/XEH_preInit.sqf index a7feade1c3..b47cf6628d 100644 --- a/addons/dragging/XEH_preInit.sqf +++ b/addons/dragging/XEH_preInit.sqf @@ -2,6 +2,8 @@ ADDON = false; +PREP_RECOMPILE_START; #include "XEH_PREP.hpp" +PREP_RECOMPILE_END; ADDON = true; diff --git a/addons/dragging/functions/fnc_canDrag.sqf b/addons/dragging/functions/fnc_canDrag.sqf index b45a7d1d14..31c9810aba 100644 --- a/addons/dragging/functions/fnc_canDrag.sqf +++ b/addons/dragging/functions/fnc_canDrag.sqf @@ -18,7 +18,7 @@ params ["_unit", "_target"]; -if !([_unit, _target, []] call EFUNC(common,canInteractWith)) exitWith {false}; +if !([_unit, _target, ["isNotSwimming"]] call EFUNC(common,canInteractWith)) exitWith {false}; // a static weapon has to be empty for dragging (ignore UAV AI) if ((typeOf _target) isKindOf "StaticWeapon" && {{(getText (configFile >> "CfgVehicles" >> (typeOf _x) >> "simulation")) != "UAVPilot"} count crew _target > 0}) exitWith {false}; diff --git a/addons/dragging/functions/fnc_canDrop.sqf b/addons/dragging/functions/fnc_canDrop.sqf index b9a6170bf2..286f6de3a9 100644 --- a/addons/dragging/functions/fnc_canDrop.sqf +++ b/addons/dragging/functions/fnc_canDrop.sqf @@ -18,6 +18,6 @@ params ["_unit", "_target"]; -if !([_unit, _target, ["isNotDragging"]] call EFUNC(common,canInteractWith)) exitWith {false}; +if !([_unit, _target, ["isNotDragging", "isNotSwimming"]] call EFUNC(common,canInteractWith)) exitWith {false}; _unit getVariable [QGVAR(draggedObject), objNull] == _target diff --git a/addons/dragging/functions/fnc_dropObject.sqf b/addons/dragging/functions/fnc_dropObject.sqf index f060c8d088..007f54adef 100644 --- a/addons/dragging/functions/fnc_dropObject.sqf +++ b/addons/dragging/functions/fnc_dropObject.sqf @@ -58,7 +58,7 @@ if (_inBuilding) then { _unit setVariable [QGVAR(isDragging), false, true]; _unit setVariable [QGVAR(draggedObject), objNull, true]; -// make object accesable for other units +// make object accessible for other units [objNull, _target, true] call EFUNC(common,claim); if !(_target isKindOf "CAManBase") then { diff --git a/addons/dragging/functions/fnc_getWeight.sqf b/addons/dragging/functions/fnc_getWeight.sqf index ac2db86ad0..2c63d220fa 100644 --- a/addons/dragging/functions/fnc_getWeight.sqf +++ b/addons/dragging/functions/fnc_getWeight.sqf @@ -31,6 +31,7 @@ private _totalWeight = 0; } forEach _item; true } count [ + //IGNORE_PRIVATE_WARNING ["_x"]; [getMagazineCargo _object, {configFile >> "CfgMagazines" >> _x}], [getBackpackCargo _object, {configFile >> "CfgVehicles" >> _x}], [getItemCargo _object, {configFile >> "CfgWeapons" >> _x >> "ItemInfo"}], diff --git a/addons/dragging/functions/fnc_handleAnimChanged.sqf b/addons/dragging/functions/fnc_handleAnimChanged.sqf index 935a6d3652..2a531ea67c 100644 --- a/addons/dragging/functions/fnc_handleAnimChanged.sqf +++ b/addons/dragging/functions/fnc_handleAnimChanged.sqf @@ -16,6 +16,8 @@ */ #include "script_component.hpp" +//IGNORE_PRIVATE_WARNING ["_thisArgs", "_thisID"]; // From CBA_fnc_addBISEventHandler; + params ["_unit", "_anim"]; _thisArgs params ["_realUnit"]; TRACE_4("params",_unit,_anim,_realUnit,_thisID); @@ -28,7 +30,7 @@ if (_unit != _realUnit) exitWith { if (_unit getVariable [QGVAR(isDragging), false]) then { // drop dragged object when not in valid animation - if !(_anim in DRAG_ANIMATIONS) then { + if (!(_anim in DRAG_ANIMATIONS) && {!(_unit call EFUNC(common,isSwimming))}) then { private _draggedObject = _unit getVariable [QGVAR(draggedObject), objNull]; if (!isNull _draggedObject) then { diff --git a/addons/dragging/functions/fnc_handleScrollWheel.sqf b/addons/dragging/functions/fnc_handleScrollWheel.sqf index e3a30ea9e0..22a19627c0 100644 --- a/addons/dragging/functions/fnc_handleScrollWheel.sqf +++ b/addons/dragging/functions/fnc_handleScrollWheel.sqf @@ -30,15 +30,19 @@ private _carriedItem = _unit getVariable [QGVAR(carriedObject), objNull]; //disabled for persons if (_carriedItem isKindOf "CAManBase") exitWith {false}; -private _position = getPosATL _carriedItem; -private _maxHeight = (_unit modelToWorldVisual [0,0,0]) select 2; +private _position = getPosASL _carriedItem; +private _maxHeight = (_unit modelToWorldVisualWorld [0, 0, 0]) select 2; _position set [2, ((_position select 2) + _scrollAmount min (_maxHeight + 1.5)) max _maxHeight]; // move up/down object and reattach at current position detach _carriedItem; -_carriedItem setPosATL _position; -_carriedItem attachTo [_unit]; + +// Uses this method of selecting position because setPosATL did not have immediate effect +private _positionChange = _position vectorDiff (getPosASL _carriedItem); +private _selectionPosition = _unit worldToModel (ASLtoAGL getPosWorld _carriedItem); +_selectionPosition = _selectionPosition vectorAdd _positionChange; +_carriedItem attachTo [_unit, _selectionPosition]; //reset the carry direction private _direction = _carriedItem getVariable [QGVAR(carryDirection), 0]; diff --git a/addons/dragging/functions/fnc_isObjectOnObject.sqf b/addons/dragging/functions/fnc_isObjectOnObject.sqf index cec6ce764e..00c2823e4a 100644 --- a/addons/dragging/functions/fnc_isObjectOnObject.sqf +++ b/addons/dragging/functions/fnc_isObjectOnObject.sqf @@ -6,9 +6,9 @@ * 0: Object * * Return Value: - * + * Boolean * - * Example; + * Example: * [player] call ace_dragging_fnc_isObjectOnObject * * Public: No diff --git a/addons/dragging/functions/fnc_setDraggable.sqf b/addons/dragging/functions/fnc_setDraggable.sqf index 1fbcb995dc..ce47f8a829 100644 --- a/addons/dragging/functions/fnc_setDraggable.sqf +++ b/addons/dragging/functions/fnc_setDraggable.sqf @@ -5,8 +5,8 @@ * Arguments: * 0: Any object * 1: true to enable dragging, false to disable - * 2: Position offset for attachTo command (Array, optinal; default: [0,0,0]) - * 3: Direction in degree to rotate the object after attachTo (Number, optional; default: 0) + * 2: Position offset for attachTo command (optinal; default: [0,0,0]) + * 3: Direction in degree to rotate the object after attachTo (optional; default: 0) * * Return Value: * None @@ -18,7 +18,7 @@ */ #include "script_component.hpp" -//IGNORE_PRIVATE_WARNING("_player", "_target"); +//IGNORE_PRIVATE_WARNING ["_player", "_target"]; params ["_object", "_enableDrag", "_position", "_direction"]; if (isNil "_position") then { diff --git a/addons/dragging/functions/fnc_startCarry.sqf b/addons/dragging/functions/fnc_startCarry.sqf index 1890dbac1a..7a5341b8a8 100644 --- a/addons/dragging/functions/fnc_startCarry.sqf +++ b/addons/dragging/functions/fnc_startCarry.sqf @@ -51,7 +51,7 @@ if (_target isKindOf "CAManBase") then { } else { // select no weapon and stop sprinting - _unit action ["SwitchWeapon", _unit, _unit, 99]; + _unit action ["SwitchWeapon", _unit, _unit, 299]; [_unit, "AmovPercMstpSnonWnonDnon", 0] call EFUNC(common,doAnimation); [_unit, "forceWalk", "ACE_dragging", true] call EFUNC(common,statusEffect_set); diff --git a/addons/dragging/functions/fnc_startDrag.sqf b/addons/dragging/functions/fnc_startDrag.sqf index cf08074d94..378128862a 100644 --- a/addons/dragging/functions/fnc_startDrag.sqf +++ b/addons/dragging/functions/fnc_startDrag.sqf @@ -39,9 +39,11 @@ _unit selectWeapon primaryWeapon _unit; [_unit, _target, true] call EFUNC(common,claim); // can't play action that depends on weapon if it was added the same frame -[{ - [_this, "grabDrag"] call EFUNC(common,doGesture); -}, _unit] call CBA_fnc_execNextFrame; +if !(_unit call EFUNC(common,isSwimming)) then { + [{ + [_this, "grabDrag"] call EFUNC(common,doGesture); + }, _unit] call CBA_fnc_execNextFrame; +}; // move a bit closer and adjust direction when trying to pick up a person if (_target isKindOf "CAManBase") then { diff --git a/addons/dragging/functions/fnc_startDragPFH.sqf b/addons/dragging/functions/fnc_startDragPFH.sqf index c7843cfdc9..a5bab835b7 100644 --- a/addons/dragging/functions/fnc_startDragPFH.sqf +++ b/addons/dragging/functions/fnc_startDragPFH.sqf @@ -50,7 +50,7 @@ if (CBA_missionTime > _timeOut) exitWith { }; // unit is ready to start dragging -if (animationState _unit in DRAG_ANIMATIONS) exitWith { +if (animationState _unit in DRAG_ANIMATIONS || {_unit call EFUNC(common,isSwimming)}) exitWith { TRACE_4("Start Dragging",_unit,_target,_timeOut,CBA_missionTime); [_unit, _target] call FUNC(dragObject); diff --git a/addons/dragging/script_component.hpp b/addons/dragging/script_component.hpp index 7a82a9ed3a..01b466972f 100644 --- a/addons/dragging/script_component.hpp +++ b/addons/dragging/script_component.hpp @@ -2,7 +2,7 @@ #define COMPONENT_BEAUTIFIED Dragging #include "\z\ace\addons\main\script_mod.hpp" -//#define DEBUG_ENABLED_DRAGGING +// #define DEBUG_ENABLED_DRAGGING // #define DEBUG_MODE_FULL // #define DISABLE_COMPILE_CACHE // #define ENABLE_PERFORMANCE_COUNTERS diff --git a/addons/dragging/stringtable.xml b/addons/dragging/stringtable.xml index 555c757cbd..767ae3fd73 100644 --- a/addons/dragging/stringtable.xml +++ b/addons/dragging/stringtable.xml @@ -1,4 +1,4 @@ - + @@ -13,6 +13,9 @@ Trascina Húzás 引きずる + 끌기 + 拖拉 + 拖拉 Release @@ -26,6 +29,9 @@ Lascia Elengedés はなす + 놓기 + 放開 + 放开 Drag/Release Object @@ -39,6 +45,9 @@ Trascina/Lascia Oggetto Húzás/Elengedés Objektum オブジェクトを引きずる/はなす + 물건 끌기/놓기 + 拖拉/放開物品 + 拖拉/放开物品 Item too heavy @@ -52,6 +61,9 @@ Předmět je moc těžký Az objektum túl nehéz アイテムが重すぎる + 물체가 너무 무겁습니다 + 此物品過重 + 此物品过重 Carry @@ -65,6 +77,9 @@ Trasporta Нести 運ぶ + 업기 + 背起 + 背起 Raise/Lower @@ -77,6 +92,9 @@ Subir/Bajar Lever/Baisser 上げる/下げる + 높이기/낮추기 + 提高/下降 + 提高/下降 - \ No newline at end of file + diff --git a/addons/explosives/ACE_Triggers.hpp b/addons/explosives/ACE_Triggers.hpp index 145ae0804e..b62e593261 100644 --- a/addons/explosives/ACE_Triggers.hpp +++ b/addons/explosives/ACE_Triggers.hpp @@ -44,7 +44,7 @@ onSetup parameters: isAttachable = 0; displayName = CSTRING(IRSensor); picture = QPATHTOF(Data\UI\PressurePlate.paa); - onPlace = "false"; + onPlace = QUOTE(false); }; class Timer { isAttachable = 1; @@ -57,6 +57,6 @@ onSetup parameters: isAttachable = 0; displayName = CSTRING(TripWire); picture = QPATHTOF(Data\UI\Tripwire.paa); - onPlace = "false"; + onPlace = QUOTE(false); }; }; diff --git a/addons/explosives/CfgAmmo.hpp b/addons/explosives/CfgAmmo.hpp index 05780b706a..65b1ca3fad 100644 --- a/addons/explosives/CfgAmmo.hpp +++ b/addons/explosives/CfgAmmo.hpp @@ -27,10 +27,13 @@ class CfgAmmo { class PipeBombCore: TimeBombCore; class PipeBombBase: PipeBombCore; */ + // GVAR(size) = 0; is small size + // GVAR(size) = 1; is large size class DirectionalBombBase; class ClaymoreDirectionalMine_Remote_Ammo: DirectionalBombBase { GVAR(magazine) = "ClaymoreDirectionalMine_Remote_Mag"; GVAR(Explosive) = "ClaymoreDirectionalMine_Remote_Ammo_Scripted"; + GVAR(size) = 0; GVAR(defuseObjectPosition)[] = {0, 0, 0.038}; soundActivation[] = {"", 0, 0, 0}; soundDeactivation[] = {"", 0, 0, 0}; @@ -39,6 +42,7 @@ class CfgAmmo { class APERSTripMine_Wire_Ammo: DirectionalBombBase { GVAR(defuseObjectPosition)[] = {-1.415, 0, 0.12}; + GVAR(size) = 0; }; class ACE_FlareTripMine_Wire_Ammo: APERSTripMine_Wire_Ammo { @@ -58,16 +62,18 @@ class CfgAmmo { distance = 0; }; }; - + class F_20mm_Red; class ACE_TripFlare_FlareEffect: F_20mm_Red { triggerTime = 0.1; + GVAR(size) = 0; }; class SLAMDirectionalMine_Wire_Ammo: DirectionalBombBase { indirectHitRange = 20; GVAR(explodeOnDefuseChance) = 1; GVAR(magazine) = "SLAMDirectionalMine_Wire_Mag"; + GVAR(size) = 0; }; class ACE_SLAMDirectionalMine_Command_Ammo: SLAMDirectionalMine_Wire_Ammo { mineTrigger = "RemoteTrigger"; @@ -88,7 +94,8 @@ class CfgAmmo { class PipeBombBase; class DemoCharge_Remote_Ammo: PipeBombBase { GVAR(magazine) = "DemoCharge_Remote_Mag"; - GVAR(Explosive) = "DemoCharge_Remote_Ammo_Scripted"; + GVAR(Explosive) = "DemoCharge_Remote_Ammo_Scripted"; // can probably remove as base ammo now has triggerWhenDestroyed + GVAR(size) = 0; GVAR(defuseObjectPosition)[] = {0.07, 0, 0.055}; soundActivation[] = {"", 0, 0, 0}; soundDeactivation[] = {"", 0, 0, 0}; @@ -98,7 +105,8 @@ class CfgAmmo { }; class SatchelCharge_Remote_Ammo: PipeBombBase { GVAR(magazine) = "SatchelCharge_Remote_Mag"; - GVAR(Explosive) = "SatchelCharge_Remote_Ammo_Scripted"; + GVAR(Explosive) = "SatchelCharge_Remote_Ammo_Scripted"; // can probably remove as base ammo now has triggerWhenDestroyed + GVAR(size) = 0; GVAR(defuseObjectPosition)[] = {0.1, 0.1, 0.05}; soundActivation[] = {"", 0, 0, 0}; soundDeactivation[] = {"", 0, 0, 0}; @@ -110,6 +118,7 @@ class CfgAmmo { triggerWhenDestroyed = 1; GVAR(explodeOnDefuseChance) = 0.02; GVAR(magazine) = "IEDUrbanBig_Remote_Mag"; + GVAR(size) = 1; soundTrigger[] = {"A3\Sounds_F\weapons\mines\mech_trigger_1", 0.8, 1, 40}; }; class ACE_IEDUrbanBig_Command_Ammo: IEDUrbanBig_Remote_Ammo { @@ -123,6 +132,7 @@ class CfgAmmo { triggerWhenDestroyed = 1; GVAR(explodeOnDefuseChance) = 0.02; GVAR(magazine) = "IEDUrbanSmall_Remote_Mag"; + GVAR(size) = 0; soundTrigger[] = {"A3\Sounds_F\weapons\mines\mech_trigger_1", 0.8, 1, 40}; }; class ACE_IEDUrbanSmall_Command_Ammo: IEDUrbanSmall_Remote_Ammo { @@ -136,6 +146,7 @@ class CfgAmmo { triggerWhenDestroyed = 1; GVAR(explodeOnDefuseChance) = 0.02; GVAR(magazine) = "IEDLandBig_Remote_Mag"; + GVAR(size) = 1; soundTrigger[] = {"A3\Sounds_F\weapons\mines\mech_trigger_1", 0.8, 1, 40}; }; class ACE_IEDLandBig_Command_Ammo: IEDLandBig_Remote_Ammo { @@ -149,6 +160,7 @@ class CfgAmmo { triggerWhenDestroyed = 1; GVAR(explodeOnDefuseChance) = 0.02; GVAR(magazine) = "IEDLandSmall_Remote_Mag"; + GVAR(size) = 0; soundTrigger[] = {"A3\Sounds_F\weapons\mines\mech_trigger_1", 0.8, 1, 40}; }; class ACE_IEDLandSmall_Command_Ammo: IEDLandSmall_Remote_Ammo { @@ -157,4 +169,18 @@ class CfgAmmo { class ACE_IEDLandSmall_Range_Ammo: IEDLandBig_Remote_Ammo { mineTrigger = "RangeTriggerShort"; }; + + // Orange DLC: + class APERSMineDispenser_Ammo: PipeBombBase { + GVAR(magazine) = "APERSMineDispenser_Mag"; + GVAR(Explosive) = "APERSMineDispenser_Ammo_Scripted"; // triggerWhenDestroyed = 1; + GVAR(size) = 0; + GVAR(defuseObjectPosition)[] = {0.0, -0.05, 0.15}; + }; + class APERSMine_Range_Ammo; + class TrainingMine_Ammo: APERSMine_Range_Ammo { + GVAR(magazine) = "TrainingMine_Mag"; + GVAR(size) = 0; + GVAR(defuseObjectPosition)[] = {0, 0, 0.15}; + }; }; diff --git a/addons/explosives/CfgMagazines.hpp b/addons/explosives/CfgMagazines.hpp index 698ed79fcb..1784e80433 100644 --- a/addons/explosives/CfgMagazines.hpp +++ b/addons/explosives/CfgMagazines.hpp @@ -170,4 +170,29 @@ class CfgMagazines { }; }; }; + + + // Orange DLC: + class APERSMineDispenser_Mag: SatchelCharge_Remote_Mag { + GVAR(SetupObject) = "ACE_Explosives_Place_APERSMineDispenser"; + class ACE_Triggers { + SupportedTriggers[] = {"Timer", "Command", "MK16_Transmitter"}; + class Timer { + FuseTime = 0.5; + }; + class Command { + FuseTime = 0.5; + }; + class MK16_Transmitter: Command {}; + }; + }; + class TrainingMine_Mag: APERSMine_Range_Mag { + GVAR(SetupObject) = "ACE_Explosives_Place_TrainingMine"; + class ACE_Triggers { + SupportedTriggers[] = {"PressurePlate"}; + class PressurePlate { + digDistance = 0.02; + }; + }; + }; }; diff --git a/addons/explosives/CfgVehicles.hpp b/addons/explosives/CfgVehicles.hpp index f2b6ece8db..8d03856e50 100644 --- a/addons/explosives/CfgVehicles.hpp +++ b/addons/explosives/CfgVehicles.hpp @@ -60,11 +60,11 @@ class CfgVehicles { icon = QPATHTOF(UI\Defuse_ca.paa); }; }; - }; + }; class ACE_DefuseObject_Large: ACE_DefuseObject { class ACE_Actions: ACE_Actions { class ACE_Defuse: ACE_Defuse { - distance = 1.5; + distance = 2; }; }; }; @@ -164,6 +164,27 @@ class CfgVehicles { }; }; + // Orange DLC: + class ACE_Explosives_Place_APERSMineDispenser: ACE_Explosives_Place { + displayName = "APERSMineDispenser"; + model = "\A3\Weapons_F_Orange\Explosives\APERSmineDispenser"; + class ACE_Actions: ACE_Actions { + class ACE_MainActions: ACE_MainActions { + position = "[0.0, -0.05, 0.15]"; + }; + }; + }; + class ACE_Explosives_Place_TrainingMine: ACE_Explosives_Place { + displayName = "TrainingMine"; + model = "\A3\Weapons_F_Orange\Explosives\TrainingMine_F"; + class ACE_Actions: ACE_Actions { + class ACE_MainActions: ACE_MainActions { + position = "[0, 0, 0.15]"; + }; + }; + }; + + class ACE_Explosives_Place_SLAM: ACE_Explosives_Place { displayName = "SLAM"; model = "\A3\Weapons_F\Explosives\mine_SLAM_directional"; diff --git a/addons/explosives/CfgWeapons.hpp b/addons/explosives/CfgWeapons.hpp index a3f3b32d4c..4eca355909 100644 --- a/addons/explosives/CfgWeapons.hpp +++ b/addons/explosives/CfgWeapons.hpp @@ -1,8 +1,17 @@ class CfgWeapons { - class ACE_ItemCore; - class InventoryItem_Base_f; + class Default; + class Put: Default { + muzzles[] += {QGVAR(muzzle)}; + class PutMuzzle: Default{}; + class GVAR(muzzle): PutMuzzle { + magazines[] = {"ACE_FlareTripMine_Mag"}; + }; + }; - class ACE_ExplosiveItem: InventoryItem_Base_f { + class ACE_ItemCore; + class CBA_MiscItem_ItemInfo; + + class ACE_ExplosiveItem: CBA_MiscItem_ItemInfo { allowedSlots[] = {801,701,901}; //type = 201; }; diff --git a/addons/explosives/ExplosivesUI.hpp b/addons/explosives/ExplosivesUI.hpp index cf97794d8f..7b0b2c6629 100644 --- a/addons/explosives/ExplosivesUI.hpp +++ b/addons/explosives/ExplosivesUI.hpp @@ -80,7 +80,7 @@ class RscACE_SelectTimeUI { y = 0.06; w = 0.49; h = 0.025; - onSliderPosChanged = "private ['_mins', '_secs'];_mins = floor((_this select 1)/60);_secs=floor((_this select 1) - (_mins*60));ctrlSetText [8870, format[localize 'STR_ACE_Explosives_TimerMenu',_mins, _secs]];"; + onSliderPosChanged = "_mins = floor((_this select 1)/60);_secs=floor((_this select 1) - (_mins*60));ctrlSetText [8870, format[localize 'STR_ACE_Explosives_TimerMenu',_mins, _secs]];"; }; class cancelBtn: RscButton { idc = 8855; diff --git a/addons/explosives/XEH_PREP.hpp b/addons/explosives/XEH_PREP.hpp index b43953d8fd..17558ee54c 100644 --- a/addons/explosives/XEH_PREP.hpp +++ b/addons/explosives/XEH_PREP.hpp @@ -2,6 +2,7 @@ PREP(addCellphoneIED); PREP(addClacker); PREP(addDetonateActions); +PREP(addDetonateHandler); PREP(addExplosiveActions); PREP(addToSpeedDial); PREP(addTransmitterActions); diff --git a/addons/explosives/XEH_postInit.sqf b/addons/explosives/XEH_postInit.sqf index 1ddd52cc53..7cc99bf921 100644 --- a/addons/explosives/XEH_postInit.sqf +++ b/addons/explosives/XEH_postInit.sqf @@ -22,6 +22,19 @@ //When getting knocked out in medical, trigger deadman explosives: //Event is global, only run on server (ref: ace_medical_fnc_setUnconscious) if (isServer) then { + [QGVAR(detonate), { + params ["_unit", "_explosive", "_delay"]; + TRACE_3("server detonate EH",_unit,_explosive,_delay); + _explosive setShotParents [_unit, _unit]; + [{ + params ["_explosive"]; + TRACE_1("exploding",_explosive); + if (!isNull _explosive) then { + _explosive setDamage 1; + }; + }, _explosive, _delay] call CBA_fnc_waitAndExecute; + }] call CBA_fnc_addEventHandler; + ["ace_unconscious", { params ["_unit", "_isUnconscious"]; if (!_isUnconscious) exitWith {}; diff --git a/addons/explosives/XEH_preInit.sqf b/addons/explosives/XEH_preInit.sqf index 16a9a4124b..3a4d9a5aea 100644 --- a/addons/explosives/XEH_preInit.sqf +++ b/addons/explosives/XEH_preInit.sqf @@ -17,10 +17,14 @@ ADDON = false; +PREP_RECOMPILE_START; #include "XEH_PREP.hpp" +PREP_RECOMPILE_END; if (isServer) then { GVAR(explosivesOrientations) = [] }; +GVAR(detonationHandlers) = []; + ADDON = true; diff --git a/addons/explosives/functions/fnc_addCellphoneIED.sqf b/addons/explosives/functions/fnc_addCellphoneIED.sqf index df198fafb3..beca3d3246 100644 --- a/addons/explosives/functions/fnc_addCellphoneIED.sqf +++ b/addons/explosives/functions/fnc_addCellphoneIED.sqf @@ -21,23 +21,21 @@ params ["_unit", "_explosive", "_magazineClass", "_extra"]; TRACE_4("params",_unit,_explosive,_magazineClass,_extra); -private ["_config", "_detonators", "_hasRequired", "_requiredItems", "_code", "_count", "_codeSet"]; - // Config is the last item in the list of passed in items. -_config = (_this select 3) select (count (_this select 3) - 1); +private _config = (_this select 3) select (count (_this select 3) - 1); -_requiredItems = getArray(_config >> "requires"); -_hasRequired = true; -_detonators = [_unit] call FUNC(getDetonators); +private _requiredItems = getArray(_config >> "requires"); +private _hasRequired = true; +private _detonators = [_unit] call FUNC(getDetonators); { if !(_x in _detonators) exitWith{ _hasRequired = false; }; } count _requiredItems; -_codeSet = false; +private _codeSet = false; while {!_codeSet} do { - _code = str(round (random 9999)); + private _code = str(round (random 9999)); _count = 4 - count (toArray _code); while {_count > 0} do { _code = "0" + _code; @@ -48,7 +46,7 @@ while {!_codeSet} do { if (isNil QGVAR(CellphoneIEDs)) then { GVAR(CellphoneIEDs) = []; }; -_count = GVAR(CellphoneIEDs) pushBack [_explosive,_code,GetNumber(ConfigFile >> "CfgMagazines" >> _magazineClass >> "ACE_Triggers" >> "Cellphone" >> "FuseTime")]; +private _count = GVAR(CellphoneIEDs) pushBack [_explosive,_code,GetNumber(ConfigFile >> "CfgMagazines" >> _magazineClass >> "ACE_Triggers" >> "Cellphone" >> "FuseTime")]; _count = _count + 1; publicVariable QGVAR(CellphoneIEDs); diff --git a/addons/explosives/functions/fnc_addClacker.sqf b/addons/explosives/functions/fnc_addClacker.sqf index f8301f73fb..49915dc836 100644 --- a/addons/explosives/functions/fnc_addClacker.sqf +++ b/addons/explosives/functions/fnc_addClacker.sqf @@ -21,14 +21,12 @@ params ["_unit", "_explosive", "_magazineClass"]; TRACE_3("params",_unit,_explosive,_magazineClass); -private ["_clacker", "_config", "_requiredItems", "_hasRequired", "_detonators"]; - // Config is the last item in the list of passed in items. -_config = (_this select 3) select (count (_this select 3) - 1); +private _config = (_this select 3) select (count (_this select 3) - 1); -_requiredItems = getArray(_config >> "requires"); -_hasRequired = true; -_detonators = [_unit] call FUNC(getDetonators); +private _requiredItems = getArray(_config >> "requires"); +private _hasRequired = true; +private _detonators = [_unit] call FUNC(getDetonators); { if !(_x in _detonators) exitWith{ _hasRequired = false; @@ -36,9 +34,9 @@ _detonators = [_unit] call FUNC(getDetonators); } count _requiredItems; if !(_hasRequired) exitWith {}; -_config = ConfigFile >> "CfgMagazines" >> _magazineClass >> "ACE_Triggers" >> configName _config; +private _config = ConfigFile >> "CfgMagazines" >> _magazineClass >> "ACE_Triggers" >> configName _config; -_clacker = _unit getVariable [QGVAR(Clackers), []]; +private _clacker = _unit getVariable [QGVAR(Clackers), []]; GVAR(PlacedCount) = GVAR(PlacedCount) + 1; _clacker pushBack [_explosive, getNumber(_config >> "FuseTime"), format [localize LSTRING(DetonateCode), diff --git a/addons/explosives/functions/fnc_addDetonateActions.sqf b/addons/explosives/functions/fnc_addDetonateActions.sqf index f88abc29d3..9c8d632253 100644 --- a/addons/explosives/functions/fnc_addDetonateActions.sqf +++ b/addons/explosives/functions/fnc_addDetonateActions.sqf @@ -19,18 +19,16 @@ params ["_unit", "_detonator"]; TRACE_2("params",_unit,_detonator); -private ["_result", "_item", "_children", "_range", "_required","_explosivesList"]; +private _range = getNumber (ConfigFile >> "CfgWeapons" >> _detonator >> QGVAR(Range)); -_range = getNumber (ConfigFile >> "CfgWeapons" >> _detonator >> QGVAR(Range)); - -_result = [_unit] call FUNC(getPlacedExplosives); -_children = []; -_explosivesList = []; +private _result = [_unit] call FUNC(getPlacedExplosives); +private _children = []; +private _explosivesList = []; { if (!isNull(_x select 0)) then { - _required = getArray (ConfigFile >> "ACE_Triggers" >> (_x select 4) >> "requires"); + private _required = getArray (ConfigFile >> "ACE_Triggers" >> (_x select 4) >> "requires"); if (_detonator in _required) then { - _item = ConfigFile >> "CfgMagazines" >> (_x select 3); + private _item = ConfigFile >> "CfgMagazines" >> (_x select 3); _explosivesList pushBack _x; @@ -43,7 +41,7 @@ _explosivesList = []; {(_this select 2) call FUNC(detonateExplosive);}, {true}, {}, - [_unit,_range,_x] + [_unit,_range,_x,_detonator] ] call EFUNC(interact_menu,createAction), [], _unit @@ -62,7 +60,7 @@ if (_detonator != "ACE_DeadManSwitch") then { {(_this select 2) call FUNC(detonateExplosiveAll);}, {true}, {}, - [_unit,_range,_explosivesList] + [_unit,_range,_explosivesList, _detonator] ] call EFUNC(interact_menu,createAction), [], _unit diff --git a/addons/explosives/functions/fnc_addDetonateHandler.sqf b/addons/explosives/functions/fnc_addDetonateHandler.sqf new file mode 100644 index 0000000000..2058b24502 --- /dev/null +++ b/addons/explosives/functions/fnc_addDetonateHandler.sqf @@ -0,0 +1,24 @@ +/* + * Author: PabstMirror + * Add a explosive detonation handler. + * Should be called on all machines. + * Code needs to return BOOL: true(allowed) / false(blocked) + * See https://ace3mod.com/wiki/framework/explosives-framework.html for an example. + * + * Arguments: + * 0: Code + * - Passed [Unit, MaxRange , Explosive , FuzeTime , TriggerItem ] + * + * Return Value: + * None + * + * Example: + * [{false}] call ace_explosives_fnc_addDetonateHandler; + * + * Public: Yes + */ +#include "script_component.hpp" + +params [["_code", {true}, [{}]]]; + +GVAR(detonationHandlers) pushBack _code; diff --git a/addons/explosives/functions/fnc_addExplosiveActions.sqf b/addons/explosives/functions/fnc_addExplosiveActions.sqf index 0ee3ca9f78..9ef789345a 100644 --- a/addons/explosives/functions/fnc_addExplosiveActions.sqf +++ b/addons/explosives/functions/fnc_addExplosiveActions.sqf @@ -6,7 +6,10 @@ * 0: Unit * * Return Value: - * Actions + * Actions + * + * Example: + * [bob] call ace_explosives_fnc_addExplosiveActions * * Public: No */ @@ -15,15 +18,13 @@ params ["_unit"]; TRACE_1("params",_unit); -private ["_mags", "_item", "_index", "_children", "_itemCount", "_list"]; - -_mags = magazines _unit; -_list = []; -_itemCount = []; +private _mags = magazines _unit; +private _list = []; +private _itemCount = []; { - _item = ConfigFile >> "CfgMagazines" >> _x; + private _item = ConfigFile >> "CfgMagazines" >> _x; if (getNumber(_item >> QGVAR(Placeable)) == 1) then { - _index = _list find _item; + private _index = _list find _item; if (_index != -1) then { _itemCount set [_index, (_itemCount select _index) + 1]; } else { @@ -33,7 +34,7 @@ _itemCount = []; }; } forEach _mags; -_children = []; +private _children = []; { private _name = getText (_x >> "displayNameShort"); diff --git a/addons/explosives/functions/fnc_addToSpeedDial.sqf b/addons/explosives/functions/fnc_addToSpeedDial.sqf index 7ad0fe76da..db0a1c0ca5 100644 --- a/addons/explosives/functions/fnc_addToSpeedDial.sqf +++ b/addons/explosives/functions/fnc_addToSpeedDial.sqf @@ -19,10 +19,8 @@ params ["_name", "_code"]; TRACE_2("params",_name,_code); -private ["_speedDial", "_found"]; - -_speedDial = ace_player getVariable [QGVAR(SpeedDial), []]; -_found = false; +private _speedDial = ace_player getVariable [QGVAR(SpeedDial), []]; +private _found = false; if ((_code) == "") exitWith { [_name] call FUNC(removeFromSpeedDial); diff --git a/addons/explosives/functions/fnc_addTransmitterActions.sqf b/addons/explosives/functions/fnc_addTransmitterActions.sqf index 4397e743a0..f23d7005a6 100644 --- a/addons/explosives/functions/fnc_addTransmitterActions.sqf +++ b/addons/explosives/functions/fnc_addTransmitterActions.sqf @@ -6,7 +6,7 @@ * 0: Unit * * Return Value: - * Nothing + * None * * Example: * [player] call ACE_Explosives_fnc_addTransmitterActions; @@ -18,12 +18,10 @@ params ["_unit"]; TRACE_1("params",_unit); -private ["_children", "_config", "_detonators"]; - -_detonators = [_unit] call FUNC(getDetonators); -_children = []; +private _detonators = [_unit] call FUNC(getDetonators); +private _children = []; { - _config = ConfigFile >> "CfgWeapons" >> _x; + private _config = ConfigFile >> "CfgWeapons" >> _x; _children pushBack [ [ diff --git a/addons/explosives/functions/fnc_addTriggerActions.sqf b/addons/explosives/functions/fnc_addTriggerActions.sqf index ca444a4e31..cdee713ecb 100644 --- a/addons/explosives/functions/fnc_addTriggerActions.sqf +++ b/addons/explosives/functions/fnc_addTriggerActions.sqf @@ -19,16 +19,14 @@ params ["_magazine", "_explosive"]; TRACE_2("params",_magazine,_explosive); -private ["_hasRequiredItems","_triggerTypes", "_children", "_detonators", "_required", "_magTriggers", "_isAttached"]; - -_isAttached = !isNull (attachedTo _explosive); -_detonators = [ACE_player] call FUNC(getDetonators); -_triggerTypes = [_magazine] call FUNC(triggerType); -_magTriggers = ConfigFile >> "CfgMagazines" >> _magazine >> "ACE_Triggers"; -_children = []; +private _isAttached = !isNull (attachedTo _explosive); +private _detonators = [ACE_player] call FUNC(getDetonators); +private _triggerTypes = [_magazine] call FUNC(triggerType); +private _magTriggers = ConfigFile >> "CfgMagazines" >> _magazine >> "ACE_Triggers"; +private _children = []; { - _required = getArray (_x >> "requires"); - _hasRequiredItems = true; + private _required = getArray (_x >> "requires"); + private _hasRequiredItems = true; { if !(_x in _detonators) exitWith { _hasRequiredItems = false; diff --git a/addons/explosives/functions/fnc_defuseExplosive.sqf b/addons/explosives/functions/fnc_defuseExplosive.sqf index b98b992f8e..a6d0e82a6b 100644 --- a/addons/explosives/functions/fnc_defuseExplosive.sqf +++ b/addons/explosives/functions/fnc_defuseExplosive.sqf @@ -21,7 +21,7 @@ TRACE_2("params",_unit,_explosive); if (GVAR(ExplodeOnDefuse) && {(random 1.0) < (getNumber (ConfigFile >> "CfgAmmo" >> typeOf _explosive >> QGVAR(explodeOnDefuseChance)))}) exitWith { TRACE_1("exploding on defuse",_explosive); - [_unit, -1, [_explosive, 1], true] call FUNC(detonateExplosive); + [_unit, -1, [_explosive, 1], "#ExplodeOnDefuse"] call FUNC(detonateExplosive); [QGVAR(explodeOnDefuse), [_explosive, _unit]] call CBA_fnc_globalEvent; }; diff --git a/addons/explosives/functions/fnc_detonateExplosive.sqf b/addons/explosives/functions/fnc_detonateExplosive.sqf index b7f4893e52..3e0f3bdf6f 100644 --- a/addons/explosives/functions/fnc_detonateExplosive.sqf +++ b/addons/explosives/functions/fnc_detonateExplosive.sqf @@ -8,47 +8,53 @@ * 2: Explosive * 0: Explosive * 1: Fuse time + * 3: Trigger Item Classname * * Return Value: * None * * Example: - * [player, 100, [Explosive, 1]] call ACE_Explosives_fnc_detonateExplosive; // has to be within range - * [player, -1, [Explosive, 1]] call ACE_Explosives_fnc_detonateExplosive; // range ignored. + * [player, 100, [Explosive, 1], "ACE_Clacker"] call ACE_Explosives_fnc_detonateExplosive; // has to be within range + * [player, -1, [Explosive, 1], "ACE_Cellphone"] call ACE_Explosives_fnc_detonateExplosive; // range ignored. * * Public: Yes */ #include "script_component.hpp" -params ["_unit", "_range", "_item"]; -TRACE_3("params",_unit,_range,_item); - -private ["_result", "_ignoreRange", "_pos"]; - -_ignoreRange = (_range == -1); -_result = true; +params ["_unit", "_range", "_item", ["_triggerClassname", "#unknown", [""]]]; +TRACE_4("detonateExplosive",_unit,_range,_item,_triggerClassname); +private _ignoreRange = (_range == -1); if (!_ignoreRange && {(_unit distance (_item select 0)) > _range}) exitWith {TRACE_1("out of range",_range); false}; +private _result = true; +{ + // Pass [Unit, MaxRange , Explosive , FuzeTime , TriggerItem ] + private _handlerResult = [_unit, _range, _item select 0, _item select 1, _triggerClassname] call _x; + if (_handlerResult isEqualTo false) then {TRACE_1("Handler Failed",_forEachIndex); _result = false}; +} forEach GVAR(detonationHandlers); +if (!_result) exitWith {false}; + if (getNumber (ConfigFile >> "CfgAmmo" >> typeOf (_item select 0) >> "TriggerWhenDestroyed") == 0) then { - private ["_exp", "_previousExp"]; - _previousExp = _item select 0; - _exp = getText (ConfigFile >> "CfgAmmo" >> typeOf (_previousExp) >> QGVAR(Explosive)); + private _previousExp = _item select 0; + private _exp = getText (ConfigFile >> "CfgAmmo" >> typeOf (_previousExp) >> QGVAR(Explosive)); if (_exp != "") then { _exp = createVehicle [_exp, [0,0,15001], [], 0, "NONE"]; _exp setDir (getDir _previousExp); _item set [0, _exp]; - _pos = getPosASL _previousExp; + private _pos = getPosASL _previousExp; deleteVehicle _previousExp; _exp setPosASL _pos; }; }; -[{ - params ["_explosive"]; - TRACE_1("exploding",_explosive); - if (!isNull _explosive) then { - _explosive setDamage 1; - }; -}, [_item select 0], (_item select 1)] call CBA_fnc_waitAndExecute; + +if (isNull (_item select 0)) then { + WARNING_1("Explosive is null [%1]",_this); +}; +if ((getNumber (configFile >> "CfgAmmo" >> (typeOf (_item select 0)) >> "triggerWhenDestroyed")) != 1) then { + WARNING_1("Explosive is not triggerWhenDestroyed [%1]",typeOf (_item select 0)); +}; + +[QGVAR(detonate), [_unit, _item select 0, _item select 1]] call CBA_fnc_serverEvent; _result diff --git a/addons/explosives/functions/fnc_detonateExplosiveAll.sqf b/addons/explosives/functions/fnc_detonateExplosiveAll.sqf index 377dc0b93a..468183a003 100644 --- a/addons/explosives/functions/fnc_detonateExplosiveAll.sqf +++ b/addons/explosives/functions/fnc_detonateExplosiveAll.sqf @@ -8,20 +8,21 @@ * 2: Explosives to detonate * 0: Explosive * 1: Fuse time + * 3: Trigger Item Classname * * Return Value: * None * * Example: - * [player, -1, [[c4,0.5]]] call ACE_Explosives_fnc_detonateExplosiveAll; + * [player, -1, [[c4,0.5]], "ACE_Clacker"] call ACE_Explosives_fnc_detonateExplosiveAll; * * Public: No */ #include "script_component.hpp" -params ["_unit", "_range", "_explosivesList"]; -TRACE_3("Params",_unit,_range,_explosivesList); +params ["_unit", "_range", "_explosivesList", "_triggerClassname"]; +TRACE_4("Params",_unit,_range,_explosivesList,_triggerClassname); { - [_unit,_range,_x] call FUNC(detonateExplosive); + [_unit,_range,_x,_triggerClassname] call FUNC(detonateExplosive); } forEach _explosivesList; diff --git a/addons/explosives/functions/fnc_dialPhone.sqf b/addons/explosives/functions/fnc_dialPhone.sqf index e205f9b381..f4bdd68279 100644 --- a/addons/explosives/functions/fnc_dialPhone.sqf +++ b/addons/explosives/functions/fnc_dialPhone.sqf @@ -19,28 +19,25 @@ params ["_unit", "_code"]; TRACE_2("params",_unit,_code); -private ["_arr", "_ran", "_i"]; - if (_unit getVariable [QGVAR(Dialing),false]) exitWith {}; if !(alive _unit) exitWith {}; _unit setVariable [QGVAR(Dialing), true, true]; -_ran = (ceil(random 8)) + 1; -_arr = []; -for [{_i=0}, {_i<_ran}, {_i=_i + 1}] do { +private _ran = (ceil(random 8)) + 1; +private _arr = []; +for "_i" from 1 to _ran do { _arr = _arr + ['.','..','...','']; }; if (_unit == ace_player) then { ctrlSetText [1400,"Calling"]; [FUNC(dialingPhone), 0.25, [_unit,4,_arr,_code]] call CALLSTACK(CBA_fnc_addPerFrameHandler); } else { - private ["_explosive"]; - _explosive = [_code] call FUNC(getSpeedDialExplosive); + private _explosive = [_code] call FUNC(getSpeedDialExplosive); if ((count _explosive) > 0) then { [{ playSound3D [QUOTE(PATHTO_R(Data\Audio\Cellphone_Ring.wss)),objNull, false, getPosASL (_this select 1),3.16228,1,75]; (_this select 0) setVariable [QGVAR(Dialing), false, true]; }, [_unit,_explosive select 0], 0.25 * (count _arr - 4)] call CBA_fnc_waitAndExecute; - [_explosive select 0,(0.25 * (count _arr - 1)) + (_explosive select 2)] call FUNC(startTimer); + [_explosive select 0,(0.25 * (count _arr - 1)) + (_explosive select 2), "ACE_Cellphone"] call FUNC(startTimer); }; }; diff --git a/addons/explosives/functions/fnc_dialingPhone.sqf b/addons/explosives/functions/fnc_dialingPhone.sqf index aa20ebf4b0..9cafa01a5e 100644 --- a/addons/explosives/functions/fnc_dialingPhone.sqf +++ b/addons/explosives/functions/fnc_dialingPhone.sqf @@ -31,7 +31,7 @@ private _explosive = [_code] call FUNC(getSpeedDialExplosive); if (_i >= (count _arr + 2)) then { [_pfID] call CALLSTACK(CBA_fnc_removePerFrameHandler); if ((count _explosive) > 0) then { - [_unit, -1, [_explosive select 0, _explosive select 2]] call FUNC(detonateExplosive); + [_unit, -1, [_explosive select 0, _explosive select 2], "ACE_Cellphone"] call FUNC(detonateExplosive); }; _unit setVariable [QGVAR(Dialing), false, true]; if (_unit == ace_player) then { diff --git a/addons/explosives/functions/fnc_getPlacedExplosives.sqf b/addons/explosives/functions/fnc_getPlacedExplosives.sqf index e2e56824ec..beb24d559d 100644 --- a/addons/explosives/functions/fnc_getPlacedExplosives.sqf +++ b/addons/explosives/functions/fnc_getPlacedExplosives.sqf @@ -21,16 +21,14 @@ params ["_unit"]; TRACE_1("params",_unit); -private ["_clackerList", "_adjustedList", "_list", "_filter"]; - -_filter = nil; +private _filter = nil; if (count _this > 1) then { _filter = ConfigFile >> "ACE_Triggers" >> (_this select 1); }; -_clackerList = []; -_adjustedList = false; +private _clackerList = []; +private _adjustedList = false; _clackerList = _unit getVariable [QGVAR(Clackers), []]; -_list = []; +private _list = []; { if (isNull (_x select 0)) then { _clackerList set [_forEachIndex, "X"]; diff --git a/addons/explosives/functions/fnc_getSpeedDialExplosive.sqf b/addons/explosives/functions/fnc_getSpeedDialExplosive.sqf index b6bd9b6e6f..1c98ca853d 100644 --- a/addons/explosives/functions/fnc_getSpeedDialExplosive.sqf +++ b/addons/explosives/functions/fnc_getSpeedDialExplosive.sqf @@ -18,10 +18,8 @@ params ["_code"]; TRACE_1("params",_code); -private ["_explosive"]; - if (isNil QGVAR(CellphoneIEDs)) exitWith {[]}; -_explosive = []; +private _explosive = []; { if ((_x select 1) == _code) exitWith { _explosive = _x; diff --git a/addons/explosives/functions/fnc_hasExplosives.sqf b/addons/explosives/functions/fnc_hasExplosives.sqf index c9da5e59d1..f86c928ca3 100644 --- a/addons/explosives/functions/fnc_hasExplosives.sqf +++ b/addons/explosives/functions/fnc_hasExplosives.sqf @@ -18,10 +18,8 @@ params ["_unit"]; TRACE_1("params",_unit); -private ["_result", "_magazines"]; - -_result = false; -_magazines = magazines _unit; +private _result = false; +private _magazines = magazines _unit; { if (getNumber (ConfigFile >> "CfgMagazines" >> _x >> QGVAR(Placeable)) == 1) exitWith { _result = true; diff --git a/addons/explosives/functions/fnc_interactEH.sqf b/addons/explosives/functions/fnc_interactEH.sqf index c8486adc09..b42acd5cec 100644 --- a/addons/explosives/functions/fnc_interactEH.sqf +++ b/addons/explosives/functions/fnc_interactEH.sqf @@ -7,7 +7,7 @@ * Interact Menu Type (0 - world, 1 - self) * * Return Value: - * Nothing + * None * * Example: * [0] call ace_explosives_fnc_interactEH @@ -41,15 +41,17 @@ if (!("ACE_DefusalKit" in (items ACE_player))) exitWith {}; //If player moved >5 meters from last pos, then rescan if (((getPosASL ace_player) distance _setPosition) > 5) then { { - if (((_x distance ACE_player) < 15) && {!(_x in _minesHelped)}) then { - TRACE_3("Making Defuse Helper",(_x),(typeOf _x),(_x isKindOf "UnderwaterMine_Range_Ammo")); - private _defuseHelper = if (_x isKindOf "UnderwaterMine_Range_Ammo") then { - "ACE_DefuseObject_Large" createVehicleLocal (getPos _x); - } else { - "ACE_DefuseObject" createVehicleLocal (getPos _x); - }; + if (((_x distance ACE_player) < 15) && {!(_x in _minesHelped)} && {(getModelInfo _x) select 0 != "empty.p3d"}) then { private _config = configFile >> "CfgAmmo" >> typeOf _x; + private _size = getNumber (_config >> QGVAR(size)); + TRACE_3("Making Defuse Helper",(_x),(typeOf _x),(_size == 1)); + private _defuseHelper = objNull; + if (_size == 1) then { + _defuseHelper = "ACE_DefuseObject_Large" createVehicleLocal (getPos _x); + } else { + _defuseHelper = "ACE_DefuseObject" createVehicleLocal (getPos _x); + }; private _defuseObjectPosition = getArray (_config >> QGVAR(defuseObjectPosition)); if (_defuseObjectPosition isEqualTo []) then { diff --git a/addons/explosives/functions/fnc_onIncapacitated.sqf b/addons/explosives/functions/fnc_onIncapacitated.sqf index 6bbf6152d3..6f9a9f498a 100644 --- a/addons/explosives/functions/fnc_onIncapacitated.sqf +++ b/addons/explosives/functions/fnc_onIncapacitated.sqf @@ -19,11 +19,14 @@ params ["_unit"]; TRACE_1("params",_unit); -private ["_deadman"]; +// Exit if no item: +if (({_x == "ACE_DeadManSwitch"} count (items _unit)) == 0) exitWith {}; -_deadman = [_unit, "DeadManSwitch"] call FUNC(getPlacedExplosives); +private _range = getNumber (configFile >> "CfgWeapons" >> "ACE_DeadManSwitch" >> QGVAR(range)); +private _deadman = [_unit, "DeadManSwitch"] call FUNC(getPlacedExplosives); +TRACE_2("placed",_deadman,_range); { - [_unit, -1, _x, true] call FUNC(detonateExplosive); + [_unit, _range, _x, "ACE_DeadManSwitch"] call FUNC(detonateExplosive); } forEach _deadman; //Handle deadman connected to explosive in inventory @@ -44,5 +47,5 @@ if (_connectedInventoryExplosive != "") then { private _explosive = createVehicle [_ammo, (getPos _unit), [], 0, "NONE"]; _explosive setPosASL (getPosASL _unit); - [_unit, -1, [_explosive, -1]] call FUNC(detonateExplosive); //Explode, ignoring range, with a random 0-1 second delay + [_unit, -1, [_explosive, 0.5], "ACE_DeadManSwitch"] call FUNC(detonateExplosive); //Explode, ignoring range, with a 0.5 second delay }; diff --git a/addons/explosives/functions/fnc_onInventoryChanged.sqf b/addons/explosives/functions/fnc_onInventoryChanged.sqf index 889e9e2186..185fdef6c3 100644 --- a/addons/explosives/functions/fnc_onInventoryChanged.sqf +++ b/addons/explosives/functions/fnc_onInventoryChanged.sqf @@ -21,17 +21,14 @@ params ["_receiver", "_giver", "_item"]; TRACE_3("params",_receiver,_giver,_item); -private ["_config", "_detonators"]; +if ((_receiver != ace_player) && {_giver != ace_player}) exitWith {}; -if (_receiver != ace_player) exitWith {}; - -_config = ConfigFile >> "CfgWeapons" >> _item; +private _config = ConfigFile >> "CfgWeapons" >> _item; if (isClass _config && {getNumber(_config >> QGVAR(Detonator)) == 1}) then { - private ["_clackerItems"]; - _clackerItems = _giver getVariable [QGVAR(Clackers), []]; + private _clackerItems = _giver getVariable [QGVAR(Clackers), []]; _receiver setVariable [QGVAR(Clackers), (_receiver getVariable [QGVAR(Clackers), []]) + _clackerItems, true]; - _detonators = [_giver] call FUNC(getDetonators); + private _detonators = [_giver] call FUNC(getDetonators); if (count _detonators == 0) then { _giver setVariable [QGVAR(Clackers), nil, true]; }; diff --git a/addons/explosives/functions/fnc_placeExplosive.sqf b/addons/explosives/functions/fnc_placeExplosive.sqf index 5114f907ac..d0d93df4c1 100644 --- a/addons/explosives/functions/fnc_placeExplosive.sqf +++ b/addons/explosives/functions/fnc_placeExplosive.sqf @@ -1,6 +1,6 @@ /* * Author: Garth 'L-H' de Wet - * Places an explosive at the requested position + * Places an explosive at the requested position. * * Arguments: * 0: Unit @@ -9,14 +9,13 @@ * 3: Magazine class * 4: Config of trigger * 5: Variables required for the trigger type - * 6: Explosive placeholder + * 6: Explosive placeholder (default: objNull) * * Return Value: * Placed explosive * * Example: - * _explosive = [player, player modelToWorldVisual [0,0.5, 0.1], 134, - * "SatchelCharge_Remote_Mag", "Command", []] call ACE_Explosives_fnc_placeExplosive; + * _explosive = [player, player modelToWorldVisual [0,0.5, 0.1], 134, "SatchelCharge_Remote_Mag", "Command", []] call ace_explosives_fnc_placeExplosive * * Public: Yes */ @@ -25,11 +24,9 @@ params ["_unit", "_pos", "_dir", "_magazineClass", "_triggerConfig", "_triggerSpecificVars", ["_setupPlaceholderObject", objNull]]; TRACE_7("params",_unit,_pos,_dir,_magazineClass,_triggerConfig,_triggerSpecificVars,_setupPlaceholderObject); -private ["_ammo", "_explosive", "_attachedTo", "_magazineTrigger", "_pitch", "_digDistance", "_canDigDown", "_soundEnviron", "_surfaceType"]; - [_unit, "PutDown"] call EFUNC(common,doGesture); -_attachedTo = objNull; +private _attachedTo = objNull; if (!isNull _setupPlaceholderObject) then { _attachedTo = attachedTo _setupPlaceholderObject; deleteVehicle _setupPlaceholderObject; @@ -40,7 +37,7 @@ if (isNil "_triggerConfig") exitWith { objNull }; -_magazineTrigger = ConfigFile >> "CfgMagazines" >> _magazineClass >> "ACE_Triggers" >> _triggerConfig; +private _magazineTrigger = ConfigFile >> "CfgMagazines" >> _magazineClass >> "ACE_Triggers" >> _triggerConfig; _triggerConfig = ConfigFile >> "ACE_Triggers" >> _triggerConfig; if (isNil "_triggerConfig") exitWith { @@ -48,7 +45,7 @@ if (isNil "_triggerConfig") exitWith { objNull }; -_ammo = getText(ConfigFile >> "CfgMagazines" >> _magazineClass >> "ammo"); +private _ammo = getText(ConfigFile >> "CfgMagazines" >> _magazineClass >> "ammo"); if (isText(_magazineTrigger >> "ammo")) then { _ammo = getText (_magazineTrigger >> "ammo"); }; @@ -56,14 +53,14 @@ _triggerSpecificVars pushBack _triggerConfig; //Dig the explosive down into the ground (usually on "pressurePlate") if (isNumber (_magazineTrigger >> "digDistance")) then { - _digDistance = getNumber (_magazineTrigger >> "digDistance"); + private _digDistance = getNumber (_magazineTrigger >> "digDistance"); //Get Surface Type: - _canDigDown = true; - _surfaceType = surfaceType _pos; + private _canDigDown = true; + private _surfaceType = surfaceType _pos; if ((_surfaceType select [0,1]) == "#") then {_surfaceType = _surfaceType select [1, 99];}; if ((_surfaceType != "") || {isClass (configFile >> "CfgSurfaces" >> _surfaceType >> "soundEnviron")}) then { - _soundEnviron = getText (configFile >> "CfgSurfaces" >> _surfaceType >> "soundEnviron"); + private _soundEnviron = getText (configFile >> "CfgSurfaces" >> _surfaceType >> "soundEnviron"); TRACE_2("Dig Down Surface",_surfaceType,_soundEnviron); _canDigDown = !(_soundEnviron in ["road", "tarmac", "concrete", "concrete_int", "int_concrete", "concrete_ext"]); }; @@ -76,7 +73,7 @@ if (isNumber (_magazineTrigger >> "digDistance")) then { }; }; -_explosive = createVehicle [_ammo, _pos, [], 0, "NONE"]; +private _explosive = createVehicle [_ammo, _pos, [], 0, "NONE"]; _explosive setPosATL _pos; if (!isNull _attachedTo) then { @@ -92,7 +89,7 @@ if (isText(_triggerConfig >> "onPlace") && {[_unit,_explosive,_magazineClass,_tr //TODO: placing explosives on hills looks funny -_pitch = getNumber (_magazineTrigger >> "pitch"); +private _pitch = getNumber (_magazineTrigger >> "pitch"); //Globaly set the position and angle: [QGVAR(place), [_explosive, _dir, _pitch, _unit]] call CBA_fnc_globalEvent; diff --git a/addons/explosives/functions/fnc_scriptedExplosive.sqf b/addons/explosives/functions/fnc_scriptedExplosive.sqf index 6a554ac09c..5c27e35e60 100644 --- a/addons/explosives/functions/fnc_scriptedExplosive.sqf +++ b/addons/explosives/functions/fnc_scriptedExplosive.sqf @@ -1,24 +1,24 @@ /* * Author: VKing - * Detonate explosives via script, for use in triggers or mission scripts to - * detonate editor-placed explosives. + * Detonate explosives via script, for use in triggers or mission scripts to detonate editor-placed explosives. * * Arguments: * 0: Explosives objects to detonate - * 1: Fuze delay (for each explosive; use negative number for random time up to value) + * 1: Fuze delay (for each explosive; use negative number for random time up to value) (default: 0) + * 2: Trigger Item Classname (default: "#scripted") * * Return Value: * None * * Example: - * [[charge1, charge2, charge3], -1] call ACE_Explosives_fnc_scriptedExplosive; - * [[claymore1, claymore2]] call ACE_Explosives_fnc_scriptedExplosive; + * [[charge1, charge2, charge3], -1] call ace_explosives_fnc_scriptedExplosive + * [[claymore1, claymore2]] call ace_explosives_fnc_scriptedExplosive * * Public: Yes */ #include "script_component.hpp" -params [["_explosiveArr", [], [[], objNull]], ["_fuzeTime", 0, [0]]]; +params [["_explosiveArr", [], [[], objNull]], ["_fuzeTime", 0, [0]], ["_triggerClassname", "#scripted", [""]]]; if (_explosiveArr isEqualType objNull) then { _explosiveArr = [_explosiveArr]; @@ -26,5 +26,5 @@ if (_explosiveArr isEqualType objNull) then { { private _detTime = if (_fuzeTime < 0) then {random abs _fuzeTime} else {_fuzeTime}; - [objNull, -1, [_x, _detTime]] call FUNC(detonateExplosive); + [objNull, -1, [_x, _detTime], _triggerClassname] call FUNC(detonateExplosive); } forEach _explosiveArr; diff --git a/addons/explosives/functions/fnc_setupExplosive.sqf b/addons/explosives/functions/fnc_setupExplosive.sqf index 47608d03e5..33d304609e 100644 --- a/addons/explosives/functions/fnc_setupExplosive.sqf +++ b/addons/explosives/functions/fnc_setupExplosive.sqf @@ -24,12 +24,10 @@ params ["_vehicle", "_unit", "_magClassname"]; TRACE_3("params",_vehicle,_unit,_magClassname); -private ["_isAttachable", "_setupObjectClass", "_supportedTriggers", "_p3dModel"]; - //Get setup object vehicle and model: -_setupObjectClass = getText(ConfigFile >> "CfgMagazines" >> _magClassname >> QGVAR(SetupObject)); +private _setupObjectClass = getText(ConfigFile >> "CfgMagazines" >> _magClassname >> QGVAR(SetupObject)); if (!isClass (configFile >> "CfgVehicles" >> _setupObjectClass)) exitWith {ERROR("Bad Vehicle");}; -_p3dModel = getText (configFile >> "CfgVehicles" >> _setupObjectClass >> "model"); +private _p3dModel = getText (configFile >> "CfgVehicles" >> _setupObjectClass >> "model"); if (_p3dModel == "") exitWith {ERROR("No Model");}; //"" - will crash game! [_unit, "forceWalk", "ACE_Explosives", true] call EFUNC(common,statusEffect_set); @@ -44,8 +42,8 @@ _unit setVariable [QGVAR(cancelActionEH), [_unit, "zoomtemp", {true}, {GVAR(plac ((uiNamespace getVariable [QGVAR(virtualAmmoDisplay), displayNull]) displayCtrl 800851) ctrlSetModel _p3dModel; //Make sure it has a trigger that works when attached (eg, no tripwires that only do pressurePlate) -_isAttachable = false; -_supportedTriggers = getArray (configFile >> "CfgMagazines" >> _magClassname >> "ACE_Triggers" >> "SupportedTriggers"); +private _isAttachable = false; +private _supportedTriggers = getArray (configFile >> "CfgMagazines" >> _magClassname >> "ACE_Triggers" >> "SupportedTriggers"); { if ((getNumber (configFile >> "ACE_Triggers" >> _x >> "isAttachable")) == 1) exitWith {_isAttachable = true;}; } forEach _supportedTriggers; @@ -62,10 +60,8 @@ GVAR(TweakedAngle) = 0; params ["_args", "_pfID"]; _args params ["_unit", "_magClassname", "_setupObjectClass", "_isAttachable"]; - private ["_angle", "_attachVehicle", "_badPosition", "_basePosASL", "_cameraAngle", "_distanceFromBase", "_expSetupVehicle", "_index", "_intersectsWith", "_lookDirVector", "_max", "_min", "_modelDir", "_modelOffset", "_modelUp", "_placeAngle", "_realDistance", "_return", "_screenPos", "_testBase", "_testPos", "_testPositionIsValid", "_virtualPosASL"]; - - _lookDirVector = ((positionCameraToWorld [0,0,0]) call EFUNC(common,positionToASL)) vectorFromTo ((positionCameraToWorld [0,0,10]) call EFUNC(common,positionToASL)); - _basePosASL = (eyePos _unit); + private _lookDirVector = ((positionCameraToWorld [0,0,0]) call EFUNC(common,positionToASL)) vectorFromTo ((positionCameraToWorld [0,0,10]) call EFUNC(common,positionToASL)); + private _basePosASL = (eyePos _unit); if (cameraView == "EXTERNAL") then { //If external, show explosive over the right shoulder _basePosASL = _basePosASL vectorAdd ((positionCameraToWorld [0.3,0,0]) vectorDiff (positionCameraToWorld [0,0,0])); }; @@ -74,13 +70,13 @@ GVAR(TweakedAngle) = 0; _basePosASL set [2, ((_basePosASL select 2) - 0.3)]; _lookDirVector = ((positionCameraToWorld [0,0,0]) call EFUNC(common,positionToASL)) vectorFromTo ((positionCameraToWorld [0,3,10]) call EFUNC(common,positionToASL)); }; - _cameraAngle = (_lookDirVector select 0) atan2 (_lookDirVector select 1); + private _cameraAngle = (_lookDirVector select 0) atan2 (_lookDirVector select 1); - _testPositionIsValid = { - _testBase = _basePosASL vectorAdd (_lookDirVector vectorMultiply (_this select 0)); - _return = true; + private _testPositionIsValid = { + private _testBase = _basePosASL vectorAdd (_lookDirVector vectorMultiply (_this select 0)); + private _return = true; { - _testPos = _testBase vectorAdd [0.1 * (_x select 0) * (cos _cameraAngle), 0.1 * (_x select 0) * (sin _cameraAngle), 0.1 * (_x select 1)]; + private _testPos = _testBase vectorAdd [0.1 * (_x select 0) * (cos _cameraAngle), 0.1 * (_x select 0) * (sin _cameraAngle), 0.1 * (_x select 1)]; #ifdef DEBUG_MODE_FULL drawLine3d [(eyePos _unit) call EFUNC(common,ASLToPosition), (_testPos) call EFUNC(common,ASLToPosition), [1,0,0,1]]; #endif @@ -89,22 +85,22 @@ GVAR(TweakedAngle) = 0; _return }; - _distanceFromBase = PLACE_RANGE_MAX; - _badPosition = !([_distanceFromBase] call _testPositionIsValid); - _attachVehicle = objNull; + private _distanceFromBase = PLACE_RANGE_MAX; + private _badPosition = !([_distanceFromBase] call _testPositionIsValid); + private _attachVehicle = objNull; if (_isAttachable && _badPosition) then { _attachVehicle = objNull; - _testBase = _basePosASL vectorAdd _lookDirVector; + private _testBase = _basePosASL vectorAdd _lookDirVector; { - _testPos = _testBase vectorAdd [0.1 * (_x select 0) * (cos _cameraAngle), 0.1 * (_x select 0) * (sin _cameraAngle), 0.1 * (_x select 1)]; - _intersectsWith = lineIntersectsWith [eyePos _unit, _testPos, _unit]; + private _testPos = _testBase vectorAdd [0.1 * (_x select 0) * (cos _cameraAngle), 0.1 * (_x select 0) * (sin _cameraAngle), 0.1 * (_x select 1)]; + private _intersectsWith = lineIntersectsWith [eyePos _unit, _testPos, _unit]; if (count _intersectsWith == 1) exitWith {_attachVehicle = (_intersectsWith select 0);}; } forEach [[0,0], [-1,-1], [1,-1], [-1,1], [1,1]]; if ((!isNull _attachVehicle) && {[PLACE_RANGE_MIN] call _testPositionIsValid} && {(_attachVehicle isKindOf "Car") || {_attachVehicle isKindOf "Tank"} || {_attachVehicle isKindOf "Air"} || {_attachVehicle isKindOf "Ship"}}) then { - _min = PLACE_RANGE_MIN; - _max = PLACE_RANGE_MAX; + private _min = PLACE_RANGE_MIN; + private _max = PLACE_RANGE_MAX; for "_index" from 0 to 6 do { _distanceFromBase = (_min + _max) / 2; if ([_distanceFromBase] call _testPositionIsValid) then { @@ -120,7 +116,7 @@ GVAR(TweakedAngle) = 0; }; }; - _virtualPosASL = _basePosASL vectorAdd (_lookDirVector vectorMultiply _distanceFromBase); + private _virtualPosASL = _basePosASL vectorAdd (_lookDirVector vectorMultiply _distanceFromBase); //Update mouse hint: if (_badPosition) then { @@ -160,8 +156,8 @@ GVAR(TweakedAngle) = 0; (QGVAR(virtualAmmo) call BIS_fnc_rscLayer) cutText ["", "PLAIN"]; if (GVAR(placeAction) == PLACE_APPROVE) then { - _placeAngle = 0; - _expSetupVehicle = _setupObjectClass createVehicle (_virtualPosASL call EFUNC(common,ASLToPosition)); + private _placeAngle = 0; + private _expSetupVehicle = _setupObjectClass createVehicle (_virtualPosASL call EFUNC(common,ASLToPosition)); TRACE_1("Planting Mass", (getMass _expSetupVehicle)); //If the object is too heavy, it can kill a player if it colides @@ -173,7 +169,7 @@ GVAR(TweakedAngle) = 0; _expSetupVehicle setDir _placeAngle; _placeAngle = _placeAngle + 180; //CfgAmmos seem to be 180 for some reason } else { - _modelOffset = _attachVehicle worldToModel (_virtualPosASL call EFUNC(common,ASLToPosition)); + private _modelOffset = _attachVehicle worldToModel (_virtualPosASL call EFUNC(common,ASLToPosition)); _placeAngle = _cameraAngle - (getDir _attachVehicle) + 180; _expSetupVehicle attachTo [_attachVehicle, _modelOffset]; _expSetupVehicle setVectorDirAndUp [[0,0,-1],[(sin _placeAngle),(cos _placeAngle),0]]; @@ -191,21 +187,21 @@ GVAR(TweakedAngle) = 0; }; } else { - _screenPos = worldToScreen (_virtualPosASL call EFUNC(common,ASLToPosition)); + private _screenPos = worldToScreen (_virtualPosASL call EFUNC(common,ASLToPosition)); if (_badPosition || {_screenPos isEqualTo []}) then { ((uiNamespace getVariable [QGVAR(virtualAmmoDisplay), displayNull]) displayCtrl 800851) ctrlShow false; } else { //Show the model on the hud in aprox the same size/location as it will be placed: ((uiNamespace getVariable [QGVAR(virtualAmmoDisplay), displayNull]) displayCtrl 800851) ctrlShow true; - _realDistance = ((_virtualPosASL call EFUNC(common,ASLToPosition)) distance (positionCameraToWorld [0,0,0])) / ((call CBA_fnc_getFov) select 1); + private _realDistance = ((_virtualPosASL call EFUNC(common,ASLToPosition)) distance (positionCameraToWorld [0,0,0])) / ((call CBA_fnc_getFov) select 1); _screenPos = [(_screenPos select 0), _realDistance, (_screenPos select 1)]; ((uiNamespace getVariable [QGVAR(virtualAmmoDisplay), displayNull]) displayCtrl 800851) ctrlSetPosition _screenPos; - _modelDir = [0,0,-1]; - _modelUp = [0,-1,0]; + private _modelDir = [0,0,-1]; + private _modelUp = [0,-1,0]; if (isNull _attachVehicle) then { - _angle = acos (_lookDirVector select 2); + private _angle = acos (_lookDirVector select 2); _modelUp = [0, (cos _angle), (sin _angle)]; _modelDir = [cos GVAR(TweakedAngle), sin GVAR(TweakedAngle), 0] vectorCrossProduct _modelUp; }; diff --git a/addons/explosives/functions/fnc_spawnFlare.sqf b/addons/explosives/functions/fnc_spawnFlare.sqf index acd5dc2a99..79f105b67b 100644 --- a/addons/explosives/functions/fnc_spawnFlare.sqf +++ b/addons/explosives/functions/fnc_spawnFlare.sqf @@ -21,3 +21,5 @@ TRACE_3("Params",_posX,_posY,_posZ); private _flare = "ACE_TripFlare_FlareEffect" createVehicle [_posX,_posY,_posZ]; TRACE_1("",_flare); + +nil diff --git a/addons/explosives/functions/fnc_startDefuse.sqf b/addons/explosives/functions/fnc_startDefuse.sqf index 95e258696c..ebc290f4ab 100644 --- a/addons/explosives/functions/fnc_startDefuse.sqf +++ b/addons/explosives/functions/fnc_startDefuse.sqf @@ -7,7 +7,7 @@ * 1: Target explosive * * Return Value: - * Nothing + * None * * Example: * [player, ACE_Interaction_Target] call ACE_Explosives_fnc_StartDefuse; @@ -19,15 +19,12 @@ params ["_unit", "_target"]; TRACE_2("params",_unit,_target); -private ["_actionToPlay", "_defuseTime", "_isEOD"]; - _target = attachedTo (_target); -_fnc_DefuseTime = { +private _fnc_DefuseTime = { params ["_specialist", "_target"]; TRACE_2("defuseTime",_specialist,_target); - private ["_defuseTime"]; - _defuseTime = 5; + private _defuseTime = 5; if (isNumber(ConfigFile >> "CfgAmmo" >> typeOf (_target) >> QGVAR(DefuseTime))) then { _defuseTime = getNumber(ConfigFile >> "CfgAmmo" >> typeOf (_target) >> QGVAR(DefuseTime)); }; @@ -36,7 +33,7 @@ _fnc_DefuseTime = { }; _defuseTime }; -_actionToPlay = "MedicOther"; +private _actionToPlay = "MedicOther"; if (STANCE _unit == "Prone") then { _actionToPlay = "PutDown"; }; @@ -49,7 +46,7 @@ if (ACE_player != _unit) then { [_unit, _actionToPlay] call EFUNC(common,doGesture); _unit disableAI "MOVE"; _unit disableAI "TARGET"; - _defuseTime = [[_unit] call EFUNC(Common,isEOD), _target] call _fnc_DefuseTime; + private _defuseTime = [[_unit] call EFUNC(Common,isEOD), _target] call _fnc_DefuseTime; [{ params ["_unit", "_target"]; TRACE_2("defuse finished",_unit,_target); @@ -60,8 +57,8 @@ if (ACE_player != _unit) then { }; } else { [_unit, _actionToPlay] call EFUNC(common,doGesture); - _isEOD = [_unit] call EFUNC(Common,isEOD); - _defuseTime = [_isEOD, _target] call _fnc_DefuseTime; + private _isEOD = [_unit] call EFUNC(Common,isEOD); + private _defuseTime = [_isEOD, _target] call _fnc_DefuseTime; if (_isEOD || {!GVAR(RequireSpecialist)}) then { [_defuseTime, [_unit,_target], {(_this select 0) call FUNC(defuseExplosive)}, {}, (localize LSTRING(DefusingExplosive)), {true}, ["isNotSwimming"]] call EFUNC(common,progressBar); }; diff --git a/addons/explosives/functions/fnc_startTimer.sqf b/addons/explosives/functions/fnc_startTimer.sqf index 1f529d9765..737e6a6586 100644 --- a/addons/explosives/functions/fnc_startTimer.sqf +++ b/addons/explosives/functions/fnc_startTimer.sqf @@ -5,24 +5,25 @@ * Arguments: * 0: Explosive * 1: Time till detonate + * 2: Trigger Item Classname (default: "#timer") * * Return Value: * None * * Example: - * [_explosive, 10] call ACE_Explosives_fnc_startTimer; + * [_explosive, 10] call ace_explosives_fnc_startTimer * * Public: Yes */ #include "script_component.hpp" -params ["_explosive", "_delay"]; -TRACE_2("params",_explosive,_delay); +params ["_explosive", "_delay", ["_triggerClassname", "#timer", [""]]]; +TRACE_3("startTimer",_explosive,_delay,_triggerClassname); [{ - params ["_explosive"]; + params ["_explosive", "_triggerClassname"]; TRACE_1("Explosive Going Boom",_explosive); if (!isNull _explosive) then { - [_explosive, -1, [_explosive, 0]] call FUNC(detonateExplosive); + [_explosive, -1, [_explosive, 0], _triggerClassname] call FUNC(detonateExplosive); }; -}, [_explosive], _delay] call CBA_fnc_waitAndExecute; +}, [_explosive, _triggerClassname], _delay] call CBA_fnc_waitAndExecute; diff --git a/addons/explosives/functions/fnc_triggerType.sqf b/addons/explosives/functions/fnc_triggerType.sqf index 7f763dbdea..b704e56466 100644 --- a/addons/explosives/functions/fnc_triggerType.sqf +++ b/addons/explosives/functions/fnc_triggerType.sqf @@ -18,11 +18,9 @@ params ["_magazineClassname"]; TRACE_1("params",_magazineClassname); -private ["_result", "_config", "_count", "_index"]; - -_result = []; -_config = getArray (ConfigFile >> "CfgMagazines" >> _magazineClassname >> "ACE_Triggers" >> "SupportedTriggers"); -_count = count _config; +private _result = []; +private _config = getArray (ConfigFile >> "CfgMagazines" >> _magazineClassname >> "ACE_Triggers" >> "SupportedTriggers"); +private _count = count _config; for "_index" from 0 to (_count - 1) do { _result set [_index, ConfigFile >> "ACE_Triggers" >> (_config select _index)]; diff --git a/addons/explosives/stringtable.xml b/addons/explosives/stringtable.xml index ecc97a4d7e..56b73d0d4e 100644 --- a/addons/explosives/stringtable.xml +++ b/addons/explosives/stringtable.xml @@ -1,4 +1,4 @@ - + @@ -13,6 +13,9 @@ Explosivos Взрывчатка 爆発物 + 폭발물 + 炸药 + 炸藥 Place @@ -26,6 +29,9 @@ Colocar Установить 設置 + 설치 + 放置 + 放置 Detonate @@ -39,6 +45,9 @@ Detonar Подрыв 点火 + 폭파 + 引爆 + 引爆 Detonate All @@ -51,6 +60,9 @@ Tout détoner Detonar Tudo すべて点火 + 모두 폭파 + 引爆全部 + 引爆全部 Explosive code: %1 @@ -64,6 +76,9 @@ Код подрыва: %1 Codice esplosivo: %1 爆破コード: %1 + 폭파 코드: %1 + 炸药代码: %1 + 炸藥代碼: %1 Place @@ -77,6 +92,9 @@ Colocar Установить 設置 + 설치 + 放置 + 放置 Attach @@ -90,6 +108,9 @@ Hozzácsatolás Прикрепить 取り付け + 부착 + 连接 + 連接 Blocked @@ -102,6 +123,9 @@ Blockiert Bloqué 取り付けできない + 막힘 + 断开 + 斷開 Cancel @@ -115,6 +139,9 @@ Cancelar Отмена 中止 + 취소 + 取消 + 取消 Rotate @@ -128,6 +155,9 @@ Rotaciona Bращать 向きを変える + 회전 + 旋转 + 旋轉 Turn On Thor III @@ -141,6 +171,9 @@ Ativar Thor III Активировать Thor III Thor III を使う + Thor III 켜기 + 开启索尔三型 + 開啟索爾三型 Turn Off Thor III @@ -154,6 +187,9 @@ Desativar Thor III Деактивировать Thor III Thor III を止める + Thor III 끄기 + 关闭索尔三型 + 關閉索爾三型 Cellphone @@ -167,6 +203,9 @@ Celular Сотовый телефон 携帯電話 + 휴대전화 + 手机 + 手機 Used to remotely trigger explosives @@ -180,6 +219,9 @@ Usado para acionar explosivos remotamente Используется для удаленной детонации СВУ 爆発物を遠隔で起爆させるのに使います + 원격으로 폭발물을 폭파시킬때 씁니다. + 用于远端引爆炸药 + 用於遠端引爆炸藥 M57 Firing Device @@ -193,6 +235,9 @@ M57 Dispositivo de Detonação Взрыватель M57 M57 起爆装置 + M57 격발기 + M57 引爆装置 + M57 引爆裝置 Used to remotely trigger explosives @@ -206,6 +251,9 @@ Usado para acionar explosivos remotamente Используется для удаленной детонации зарядов 爆発物を遠隔で起爆させるのに使います + 원격으로 폭발물을 폭파시킬때 씁니다. + 用于远端引爆炸药 + 用於遠端引爆炸藥 M152 Firing Device @@ -219,6 +267,9 @@ M152 Dispositivo de Detonação Взрыватель M152 M152 起爆装置 + M152 격발기 + M152 引爆装置 + M152 引爆裝置 M152 RAMS @@ -232,6 +283,9 @@ M152 RAMS M152 RAMS M152 RAMS + M152 RAMS + M152 远端炸药引爆系统 + M152 遠端炸藥引爆系統 Defusal Kit @@ -245,6 +299,9 @@ Kit de desarme Комплект разминирования 解除キット + 해체 장비 + 拆弹工具 + 拆彈工具 Allows defusing of explosives @@ -258,6 +315,9 @@ Permite o desarme de explosivos Позволяет обезвреживать взрывчатку 爆発物を無力化できます + 폭발물을 해체할 수 있게 해줍니다 + 可以用来拆除炸弹 + 可以用來拆除炸彈 Add to Speed Dial @@ -271,6 +331,9 @@ Adicionar à ligação rápida Добавить в быстрый вызов 短縮ダイアルに追加 + 단축키에 지정 + 增加到快速拨号 + 增加到快速撥號 Clear @@ -284,6 +347,9 @@ Limpar Очистить 消去 + 삭제 + 清除 + 清除 Dial @@ -297,6 +363,9 @@ Discar Hабрать ダイアル + 다이얼 + 拨号 + 撥號 Up @@ -310,6 +379,9 @@ Cima Вызов 上へ + + + Down @@ -323,6 +395,9 @@ Baixo Сброс 下へ + 아래 + + Cancel @@ -336,6 +411,9 @@ Cancelar Отмена 中止 + 취소 + 取消 + 取消 Detonate Menu @@ -349,6 +427,9 @@ Menu de detonação Меню подрыва 点火メニュー + 폭파 메뉴 + 引爆选单 + 引爆選單 Place Menu @@ -362,6 +443,9 @@ Menu de posicionamento Меню установки 設置メニュー + 설치 메뉴 + 放置选单 + 放置選單 Defuse @@ -375,6 +459,9 @@ Desarmar Обезвредить 無力化 + 해체 + 拆除 + 拆除 Defusing Explosive... @@ -388,6 +475,9 @@ Desarmando Explosivo... Обезвреживание... 爆発物を無力化中・・・ + 폭발물 해체중... + 炸弹拆除中... + 炸彈拆除中... Timer @@ -401,6 +491,9 @@ Timer Таймер タイマー + 타이머 + 计时器 + 計時器 Time: %1m %2s @@ -414,6 +507,9 @@ Tempo: %1m %2s Время: %1m %2c 設定時間: %1分 %2秒 + 시간: %1분 %2초 + 时间: %1分%2秒 + 時間: %1分%2秒 Set Time @@ -427,6 +523,9 @@ Configurar Tempo Установить время 時間を設定 + 시간 설정 + 设定时间 + 設定時間 Select a Trigger @@ -440,6 +539,9 @@ Selecionar um Gatilho Выберите детонатор 点火装置を選択 + 작동방식 선택 + 选择一个触发器 + 選擇一個觸發器 Select @@ -453,6 +555,9 @@ Selecionar Выбрать 選択 + 선택 + 选择 + 選擇 Pressure Plate @@ -466,6 +571,9 @@ Placa de pressão Нажимная плита 圧力感知式 + 압력식 + 压力盘 + 壓力盤 Tripwire @@ -479,6 +587,9 @@ Linha de tração Растяжка 仕掛け線 + 인계철선 + 绊线 + 絆線 IR Sensor @@ -492,6 +603,9 @@ Sensor IV ИК сенсор 赤外線感知式 + 적외선 센서 + 红外线感应器 + 紅外線感應器 No triggers available for %1 @@ -505,6 +619,9 @@ Nenhum gatilho disponível para %1 Нет доступных взрывателей для %1 %1 につかえる点火装置がありません + %1(을)를 작동할 장치가 없습니다. + 没有适合%1的触发器 + 沒有適合%1的觸發器 IR Sensor (Side Attack) @@ -518,6 +635,9 @@ Sensor infravermelho (ataque lateral) ИК сенсор (детонация вбок) 赤外線感知式 (横からの攻撃) + 적외선 센서 (측면 공격) + 红外线感应器 (侧边攻击) + 紅外線感應器 (側邊攻擊) Magnetic Influence Sensor (Bottom Attack) @@ -531,6 +651,9 @@ Influência magnética (ataque inferior) Магнитный сенсор (детонация вверх) 磁気感知式 (下からの攻撃) + 자기장 감지센서 (바닥 공격) + 磁性感应器 (底部攻击) + 磁性感應器 (底部攻擊) No explosives on trigger. @@ -544,6 +667,9 @@ Nenhum explosivo no gatilho. Взрыватель не подсоединён к взрывчатке 点火装置に爆発物がありません。 + 격발기에 등록된 폭발물이 없습니다. + 触发器上并没有炸药 + 觸發器上並沒有炸藥 Dead Man's Switch @@ -557,6 +683,9 @@ Кнопка мертвеца Detonatore a rilascio 自爆装置 + 자폭 장치 + 自杀炸弹客引爆器 + 自殺炸彈客引爆器 Used to remotely trigger explosives when released. @@ -570,6 +699,9 @@ Используется для дистанционного подрыва, после смерти оператора. Usato per attivare a distanza esplosivi al momento del rilascio 点火装置を離すと遠隔で起爆したいときに使います。 + 압력이 해제될때 원격으로 폭발시킵니다. + 当放开按钮时, 将会引爆炸弹. + 當放開按鈕時, 將會引爆炸彈. Pick up @@ -583,6 +715,9 @@ Raccogli Pegar 拾う + 줍기 + 捡起 + 撿起 Explosive System @@ -596,6 +731,9 @@ Взрывные устройства Sistema Esplosivi 爆発システム + 폭발물 시스템 + 炸药系统 + 炸藥系統 Require specialists? @@ -609,6 +747,9 @@ Требуется специалист? Richiedi specialisti? 特技兵を必要としますか? + 전문가가 필요합니까? + 需要专家? + 需要專家? Require explosive specialists to disable explosives? Default: No @@ -621,7 +762,10 @@ Szükséges-e egy specialista a robbanóanyagok hatástalanításához? Alapértelmezett: Nem Требуется ли специалист по минному делу для обезвреживания взрывчатки? По-умолчанию: Нет Richiedi specialisti esplosivi per disabilitare esplosivi? Default: No - 爆発物を無効化するには、爆発物の特技兵を必要としますか?標準:いいえ + 爆発物を無効化するには、爆発物の特技兵を必要としますか?標準: いいえ + 폭발물을 해제하기 위해서는 전문가가 필요합니까? 기본설정: 아니요 + 需要炸弹专家才能拆除炸弹? 预设: 否 + 需要炸彈專家才能拆除炸彈? 預設: 否 Punish non-specialists? @@ -635,6 +779,9 @@ Штраф не-специалистам? Punisci non-specialisti? 非特技兵へ足かせを与えますか? + 비-전문가에 불이익을 줍니까? + 折磨非专业人员? + 折磨非專業人員? Increase the time it takes to complete actions for non-specialists? Default: Yes @@ -647,7 +794,10 @@ Nem-specialisták esetén több ideig tartson a cselekvés befejezése? Alapértelmezett: Igen Увеличивать время завершения действий для не-специалистов? По-умолчанию: Нет Aumenta il tempo richiesto per completare azioni per non-specialisti? Default: Si - 非特技兵は動作を完了する必要を増加させますか?標準:はい + 非特技兵へ動作完了までの時間を増加させますか?標準: はい + 비-전문가가 폭발물을 해제시 더욱 많은 시간을 소요합니까? 기본설정: 예 + 增加非专业人员相关操作的时间? 预设: 是 + 增加非專業人員相關操作的時間? 預設: 是 Explode on defusal? @@ -660,7 +810,10 @@ Robbanás hatástalanításkor? Взрыв при разминир.? Fai esplodere quando disarmato? - 解除時に爆発させますか? + 解除中に爆発させますか? + 해제시 폭발합니까? + 拆除时引爆? + 拆除時引爆? Enable certain explosives to explode on defusal? Default: Yes @@ -673,7 +826,10 @@ Meghatározott robbanóanyagok felrobbanjanak-e hatástalanításkor? Alapértelmezett: Igen Разрешить определенным взрывным устройствам взрываться при разминировании? По-умолчанию: Да Abilita alcuni esplosivi per esplosione al disarmo? Default: Si - 特定の爆発物へ、解除時に爆発させますか?標準:はい + 特定の爆発物を解除中に爆発させますか?標準: はい + 특정 폭발물이 해제시 폭발하게 합니까? 기본설정: 예 + 启用后, 某些炸弹会在拆除时引爆? 预设: 是 + 啟用後, 某些炸彈會在拆除時引爆? 預設: 是 This module adjusts the settings related to explosives. @@ -687,6 +843,9 @@ Este módulo ajusta las configuraciones relacionadas con explosivos. Questo modulo cambia le impostazioni relative agli esplosivi このモジュールを調節し爆発物に設定を反映させます。 + 이 모듈은 폭발물에 관한 설정을 수정할 수 있게합니다. + 此模块用来调整炸药的相关设定 + 此模塊用來調整炸藥的相關設定 M6 SLAM Mine (Bottom Attack) @@ -706,6 +865,9 @@ Mina M6 SLAM (Ataque Inferior) Мина M6 SLAM (направлена вверх) M6 SLAM 地雷 (下からの攻撃) + M6 SLAM 지뢰 (바닥 공격) + M6指向性反装甲地雷 (底部攻击) + M6指向性反裝甲地雷 (底部攻擊) M6 SLAM Mine (Side Attack) @@ -725,6 +887,9 @@ Mina M6 SLAM (Ataque Lateral) Мина M6 SLAM (направлена вбок) M6 SLAM 地雷 (横からの攻撃) + M6 SLAM 지뢰 (측면 공격) + M6指向性反装甲地雷 (侧边攻击) + M6指向性反裝甲地雷 (側邊攻擊) Large IED (Urban, Pressure Plate) @@ -744,6 +909,9 @@ IED Grande (Urbano, Placa de pressão) Большое СВУ (городское, нажимного действия) 大きな IED (市街地用、圧力感知) + 대형 급조폭발물 (시가지, 압력식) + 大型简易爆炸装置 (地表上, 压力盘) + 大型簡易爆炸裝置 (地表上, 壓力盤) Large IED (Dug-in, Pressure Plate) @@ -763,6 +931,9 @@ IED Grande (Enterrado, Placa de pressão) Большое СВУ (закопанное, нажимного действия) 大きな IED (埋め込み型、圧力感知) + 대형 급조폭발물 (묻힘, 압력식) + 大型简易爆炸装置 (地表下, 压力盘) + 大型簡易爆炸裝置 (地表下, 壓力盤) Small IED (Urban, Pressure Plate) @@ -782,6 +953,9 @@ IED Pequeno(Urbano, Placa de pressão) Малое СВУ (городское, нажимного действия) 小さな IED (市街地用、圧力感知) + 소형 급조폭발물 (시가지, 압력식) + 小型简易爆炸装置 (地表上, 压力盘) + 小型簡易爆炸裝置 (地表上, 壓力盤) Small IED (Dug-in, Pressure Plate) @@ -801,6 +975,9 @@ IED Pequeno (Enterrado, Placa de pressão) Малое СВУ (закопанное, нажимного действия) 小さな IED (埋め込み型、圧力感知) + 소형 급조폭발물 (묻힘, 압력식) + 小型简易爆炸装置 (地表下, 压力盘) + 小型簡易爆炸裝置 (地表下, 壓力盤) Connect to %1 @@ -814,18 +991,33 @@ Collega a %1 Conectar à %1 %1 へ接続 + %1에 연결중 + 连接到%1 + 連接到%1 Tripwire Flare Сигнальная растяжка 仕掛け型照明地雷 Flara na linkę + Stolperdraht-Leuchtrakete + 조명지뢰 + Fusée éclairante avec fil de détente + Cavo d'innesco + 绊线闪光地雷 + 絆線閃光地雷 Type: Tripwire flare - Ignites a non-lethal flare when triggered.<br />Rounds: 1<br />Used on: Ground Тип: Сигнальная растяжка - При срабатывании выпускает несмертельную сгнальную вспышку.<br />Зарядов: 1<br />Используется на: Земле 種類: 仕掛け型照明地雷 - 発動したとき、非致死性の照明を発炎します。<br />装填数: 1<br />次で使用: 地表 Typ: Flara na linkę - Wystrzeliwuje nieszkodliwą flarę przy nadepnięciu linki.<br/>Pociski: 1<br/>Używane na: ziemia + Typ: Stolperdraht-Leuchtrakete - Schießt bei Auslösung eine nicht-tödliche Leuchtrakete ab.<br />Ladungen: 1<br />Benutzt auf: Boden + 종류: 조명지뢰 - 작동시 무해한 조명을 사출합니다.<br />장탄수: 1<br />사용처: 지면 + Type : Fusée éclairante avec fil de détente - Allume une fusée éclairante lorsque déclenché. <br />Coups : 1<br />Utilisé sur : le sol + Tipo: Cavo d'innesco - Sfocio un abbaglio non letale quanto attivato. <br />Rimanenti: 1<br />Usato: A terra + 类型: 绊线闪光地雷 - 触发后产生非致命性的强光.<br />发数: 1<br />使用于: 地面 + 類型: 絆線閃光地雷 - 觸發後產生非致命性的強光.<br />發數: 1<br />使用於: 地面 diff --git a/addons/fastroping/CfgVehicles.hpp b/addons/fastroping/CfgVehicles.hpp index 23517bffca..6338ce813d 100644 --- a/addons/fastroping/CfgVehicles.hpp +++ b/addons/fastroping/CfgVehicles.hpp @@ -45,6 +45,13 @@ class CfgVehicles { showDisabled = 0; priority = 1; }; + class ACE_stowFRIES { + displayName = CSTRING(Interaction_stowFRIES); + condition = QUOTE([vehicle _player] call FUNC(canStowFRIES)); + statement = QUOTE([vehicle _player] call FUNC(stowFRIES)); + showDisabled = 0; + priority = 1; + }; class ACE_deployRopes { displayName = CSTRING(Interaction_deployRopes); condition = QUOTE([ARR_2(_player, vehicle _player)] call FUNC(canDeployRopes)); @@ -156,6 +163,8 @@ class CfgVehicles { class ACE_Actions {}; class Turrets {}; class TransportItems {}; + EGVAR(cargo,hasCargo) = 0; + EGVAR(cargo,space) = 0; }; class Helicopter_Base_H; diff --git a/addons/fastroping/XEH_PREP.hpp b/addons/fastroping/XEH_PREP.hpp index 99e1c8b817..1ad995c598 100644 --- a/addons/fastroping/XEH_PREP.hpp +++ b/addons/fastroping/XEH_PREP.hpp @@ -3,6 +3,7 @@ PREP(canCutRopes); PREP(canDeployRopes); PREP(canFastRope); PREP(canPrepareFRIES); +PREP(canStowFRIES); PREP(checkVehicleThread); PREP(cutRopes); PREP(deployAI); @@ -16,3 +17,4 @@ PREP(onCutCommon); PREP(onPrepareCommon); PREP(onRopeBreak); PREP(prepareFRIES); +PREP(stowFRIES); diff --git a/addons/fastroping/XEH_postInit.sqf b/addons/fastroping/XEH_postInit.sqf index 2752e2dcde..72ded1b267 100644 --- a/addons/fastroping/XEH_postInit.sqf +++ b/addons/fastroping/XEH_postInit.sqf @@ -8,7 +8,21 @@ [FUNC(fastRopeServerPFH), 0, _this] call CBA_fnc_addPerFrameHandler; }] call CBA_fnc_addEventHandler; +// Keybinds +["ACE3 Vehicles", QGVAR(fastRope), localize LSTRING(Interaction_fastRope), { + if ((vehicle ACE_player) == ACE_player) exitWith {false}; + if (!([ACE_player, vehicle ACE_player, []] call EFUNC(common,canInteractWith))) exitWith {false}; + if ([ACE_player, vehicle ACE_player] call FUNC(canFastRope)) then { + [ACE_player, vehicle ACE_player] call FUNC(fastRope); + true + } else { + false + }; +}, ""] call CBA_fnc_addKeybind; + ["ACE3 Vehicles", QGVAR(cutRopes), localize LSTRING(Interaction_cutRopes), { + if ((vehicle ACE_player) == ACE_player) exitWith {false}; + if (!([ACE_player, vehicle ACE_player, []] call EFUNC(common,canInteractWith))) exitWith {false}; if ([vehicle ACE_player] call FUNC(canCutRopes)) then { [vehicle ACE_player] call FUNC(cutRopes); true @@ -16,3 +30,23 @@ false }; }, {false}] call CBA_fnc_addKeybind; + + +#ifdef DRAW_FASTROPE_INFO +addMissionEventHandler ["Draw3D", { + if (!(cursorObject isKindOf "Helicopter")) exitWith {}; + private _config = configFile >> "CfgVehicles" >> (typeOf cursorObject); + private _enabled = getNumber (_config >> QGVAR(enabled)); + drawIcon3D ["", [.5,.5,1,1], (ASLtoAGL getPosASL cursorObject), 0.5, 0.5, 0, format ["%1 = %2", typeOf cursorObject, _enabled], 0.5, 0.025, "TahomaB"]; + if (_enabled > 0) then { + { + private _hookAttachment = cursorObject getVariable [QGVAR(FRIES), cursorObject]; + private _ropeOrigin = if (_x isEqualType []) then {_x} else {_hookAttachment selectionPosition _x}; + drawIcon3D ["", [1,.5,.5,1], (_hookAttachment modelToWorld _ropeOrigin), 0.5, 0.5, 0, format ["Rope: %1", _forEachIndex], 0.5, 0.025, "TahomaB"]; + } forEach (getArray (_config >> QGVAR(ropeOrigins))); + }; + if (_enabled == 2) then { + drawIcon3D ["", [.5,1,.5,1], (cursorObject modelToWorld getArray (_config >> QGVAR(friesAttachmentPoint))), 0.5, 0.5, 0, format ["Fries: %1", getText (_config >> QGVAR(friesType))], 0.5, 0.025, "TahomaB"]; + }; +}]; +#endif diff --git a/addons/fastroping/XEH_preInit.sqf b/addons/fastroping/XEH_preInit.sqf index a7feade1c3..b47cf6628d 100644 --- a/addons/fastroping/XEH_preInit.sqf +++ b/addons/fastroping/XEH_preInit.sqf @@ -2,6 +2,8 @@ ADDON = false; +PREP_RECOMPILE_START; #include "XEH_PREP.hpp" +PREP_RECOMPILE_END; ADDON = true; diff --git a/addons/fastroping/anim/model.cfg b/addons/fastroping/anim/model.cfg new file mode 100644 index 0000000000..be41a523a8 --- /dev/null +++ b/addons/fastroping/anim/model.cfg @@ -0,0 +1,124 @@ +class cfgSkeletons +{ + class OFP2_ManSkeleton + { + isDiscrete = 0; + skeletonInherit = ""; + SkeletonBones[]= + { + "Pelvis","", + "Spine","Pelvis", + "Spine1","Spine", + "Spine2","Spine1", + "Spine3","Spine2", + "camera","Pelvis",// case has changed for arma3 + "weapon","Spine1", + "launcher","Spine1", + //Head skeleton in hierarchy + "Neck","Spine3", + "Neck1","Neck", + "Head","Neck1", + + //Left upper side + "LeftShoulder","Spine3", + "LeftArm","LeftShoulder", + "LeftArmRoll","LeftArm", + "LeftForeArm","LeftArmRoll", + "LeftForeArmRoll","LeftForeArm", + "LeftHand","LeftForeArmRoll", + "LeftHandRing","LeftHand", + "LeftHandRing1","LeftHandRing", + "LeftHandRing2","LeftHandRing1", + "LeftHandRing3","LeftHandRing2", + "LeftHandPinky1","LeftHandRing", + "LeftHandPinky2","LeftHandPinky1", + "LeftHandPinky3","LeftHandPinky2", + "LeftHandMiddle1","LeftHand", + "LeftHandMiddle2","LeftHandMiddle1", + "LeftHandMiddle3","LeftHandMiddle2", + "LeftHandIndex1","LeftHand", + "LeftHandIndex2","LeftHandIndex1", + "LeftHandIndex3","LeftHandIndex2", + "LeftHandThumb1","LeftHand", + "LeftHandThumb2","LeftHandThumb1", + "LeftHandThumb3","LeftHandThumb2", + //Right upper side + "RightShoulder","Spine3", + "RightArm","RightShoulder", + "RightArmRoll","RightArm", + "RightForeArm","RightArmRoll", + "RightForeArmRoll","RightForeArm", + "RightHand","RightForeArmRoll", + "RightHandRing","RightHand", + "RightHandRing1","RightHandRing", + "RightHandRing2","RightHandRing1", + "RightHandRing3","RightHandRing2", + "RightHandPinky1","RightHandRing", + "RightHandPinky2","RightHandPinky1", + "RightHandPinky3","RightHandPinky2", + "RightHandMiddle1","RightHand", + "RightHandMiddle2","RightHandMiddle1", + "RightHandMiddle3","RightHandMiddle2", + "RightHandIndex1","RightHand", + "RightHandIndex2","RightHandIndex1", + "RightHandIndex3","RightHandIndex2", + "RightHandThumb1","RightHand", + "RightHandThumb2","RightHandThumb1", + "RightHandThumb3","RightHandThumb2", + //Left lower side + "LeftUpLeg","Pelvis", + "LeftUpLegRoll","LeftUpLeg", + "LeftLeg","LeftUpLegRoll", + "LeftLegRoll","LeftLeg", + "LeftFoot","LeftLegRoll", + "LeftToeBase","LeftFoot", + //Right lower side + "RightUpLeg","Pelvis", + "RightUpLegRoll","RightUpLeg", + "RightLeg","RightUpLegRoll", + "RightLegRoll","RightLeg", + "RightFoot","RightLegRoll", + "RightToeBase","RightFoot", + + //New facial features arma3 only + "Face_Hub","Head", + "Face_Jawbone","Face_Hub", + "Face_Jowl","Face_Jawbone", + "Face_chopRight","Face_Jawbone", + "Face_chopLeft","Face_Jawbone", + "Face_LipLowerMiddle","Face_Jawbone", + "Face_LipLowerLeft","Face_Jawbone", + "Face_LipLowerRight","Face_Jawbone", + "Face_Chin","Face_Jawbone", + "Face_Tongue","Face_Jawbone", + "Face_CornerRight","Face_Hub", + "Face_CheekSideRight","Face_CornerRight", + "Face_CornerLeft","Face_Hub", + "Face_CheekSideLeft","Face_CornerLeft", + "Face_CheekFrontRight","Face_Hub", + "Face_CheekFrontLeft","Face_Hub", + "Face_CheekUpperRight","Face_Hub", + "Face_CheekUpperLeft","Face_Hub", + "Face_LipUpperMiddle","Face_Hub", + "Face_LipUpperRight","Face_Hub", + "Face_LipUpperLeft","Face_Hub", + "Face_NostrilRight","Face_Hub", + "Face_NostrilLeft","Face_Hub", + "Face_Forehead","Face_Hub", + "Face_BrowFrontRight","Face_Forehead", + "Face_BrowFrontLeft","Face_Forehead", + "Face_BrowMiddle","Face_Forehead", + "Face_BrowSideRight","Face_Forehead", + "Face_BrowSideLeft","Face_Forehead", + "Face_Eyelids","Face_Hub", + "Face_EyelidUpperRight","Face_Hub", + "Face_EyelidUpperLeft","Face_Hub", + "Face_EyelidLowerRight","Face_Hub", + "Face_EyelidLowerLeft","Face_Hub", + "EyeLeft","Face_Hub", + "EyeRight","Face_Hub" + };// end of skeleton array + // location of pivot points (local axes) for hierarchical animation + pivotsModel="Samples_F\TemplateRTM\ManSkeleton_Pivots.p3d"; + }; +}; diff --git a/addons/fastroping/functions/fnc_canCloseRamp.sqf b/addons/fastroping/functions/fnc_canCloseRamp.sqf index 58827cb29b..253cb241b5 100644 --- a/addons/fastroping/functions/fnc_canCloseRamp.sqf +++ b/addons/fastroping/functions/fnc_canCloseRamp.sqf @@ -11,7 +11,7 @@ * Able to close ramp * * Example: - * [_player, _vehicle] call ace_fastroping_fnc_canCloseRamp + * [_vehicle, _door, _turretPaths] call ace_fastroping_fnc_canCloseRamp * * Public: No */ diff --git a/addons/fastroping/functions/fnc_canCutRopes.sqf b/addons/fastroping/functions/fnc_canCutRopes.sqf index 9775b155bb..84239db671 100644 --- a/addons/fastroping/functions/fnc_canCutRopes.sqf +++ b/addons/fastroping/functions/fnc_canCutRopes.sqf @@ -19,4 +19,5 @@ params ["_vehicle"]; private _deployedRopes = _vehicle getVariable [QGVAR(deployedRopes), []]; -!(_deployedRopes isEqualTo []) +!(_deployedRopes isEqualTo []) && +{{(_x select 5)} count (_deployedRopes) == 0} diff --git a/addons/fastroping/functions/fnc_canDeployRopes.sqf b/addons/fastroping/functions/fnc_canDeployRopes.sqf index 6c8f1d28ed..cfc2aecc8a 100644 --- a/addons/fastroping/functions/fnc_canDeployRopes.sqf +++ b/addons/fastroping/functions/fnc_canDeployRopes.sqf @@ -17,11 +17,10 @@ #include "script_component.hpp" params ["_unit", "_vehicle"]; -private ["_config", "_enabled", "_deploymentStage"]; -_config = configFile >> "CfgVehicles" >> typeOf _vehicle; -_enabled = getNumber (_config >> QGVAR(enabled)); -_deploymentStage = _vehicle getVariable [QGVAR(deploymentStage), 0]; +private _config = configFile >> "CfgVehicles" >> typeOf _vehicle; +private _enabled = getNumber (_config >> QGVAR(enabled)); +private _deploymentStage = _vehicle getVariable [QGVAR(deploymentStage), 0]; (driver _vehicle != _unit) && {getPos _vehicle select 2 > 2} && diff --git a/addons/fastroping/functions/fnc_canFastRope.sqf b/addons/fastroping/functions/fnc_canFastRope.sqf index 33c6bc2839..5bf5c07d03 100644 --- a/addons/fastroping/functions/fnc_canFastRope.sqf +++ b/addons/fastroping/functions/fnc_canFastRope.sqf @@ -10,7 +10,7 @@ * Able to fast ropes * * Example: - * [_player, _vehicle] call ace_fastroping_fnc_canDeployRopes + * [_player, _vehicle] call ace_fastroping_fnc_canFastRope * * Public: No */ diff --git a/addons/fastroping/functions/fnc_canStowFRIES.sqf b/addons/fastroping/functions/fnc_canStowFRIES.sqf new file mode 100644 index 0000000000..655d5776b8 --- /dev/null +++ b/addons/fastroping/functions/fnc_canStowFRIES.sqf @@ -0,0 +1,23 @@ +/* + * Author: BaerMitUmlaut + * Checks if the unit can stow the helicopters FRIES. + * + * Arguments: + * 0: The helicopter itself + * + * Return Value: + * Able to stow FRIES + * + * Example: + * [_vehicle] call ace_fastroping_fnc_canStowFRIES + * + * Public: No + */ + +#include "script_component.hpp" +params ["_vehicle"]; + +private _config = configFile >> "CfgVehicles" >> typeOf _vehicle; + +(_vehicle getVariable [QGVAR(deploymentStage), 0]) == 2 && +{getText (_config >> QGVAR(onCut)) != ""} diff --git a/addons/fastroping/functions/fnc_cutRopes.sqf b/addons/fastroping/functions/fnc_cutRopes.sqf index d619a24297..2b3aaa8a8d 100644 --- a/addons/fastroping/functions/fnc_cutRopes.sqf +++ b/addons/fastroping/functions/fnc_cutRopes.sqf @@ -16,9 +16,8 @@ #include "script_component.hpp" params ["_vehicle"]; -private ["_deployedRopes", "_config", "_waitTime"]; -_deployedRopes = _vehicle getVariable [QGVAR(deployedRopes), []]; +private _deployedRopes = _vehicle getVariable [QGVAR(deployedRopes), []]; { _x params ["", "_ropeTop", "_ropeBottom", "_dummy", "_hook", "_occupied"]; @@ -40,14 +39,4 @@ _deployedRopes = _vehicle getVariable [QGVAR(deployedRopes), []]; } count _deployedRopes; _vehicle setVariable [QGVAR(deployedRopes), [], true]; -_vehicle setVariable [QGVAR(deploymentStage), 1, true]; - -_config = configFile >> "CfgVehicles" >> typeOf _vehicle; -_waitTime = 0; -if (isText (_config >> QGVAR(onCut))) then { - _waitTime = [_vehicle] call (missionNamespace getVariable (getText (_config >> QGVAR(onCut)))); -}; - -[{ - _this setVariable [QGVAR(deploymentStage), 0, true]; -}, _vehicle, _waitTime] call CBA_fnc_waitAndExecute; +_vehicle setVariable [QGVAR(deploymentStage), 2, true]; diff --git a/addons/fastroping/functions/fnc_deployAI.sqf b/addons/fastroping/functions/fnc_deployAI.sqf index 646b171526..d88e07929e 100644 --- a/addons/fastroping/functions/fnc_deployAI.sqf +++ b/addons/fastroping/functions/fnc_deployAI.sqf @@ -18,7 +18,6 @@ #include "script_component.hpp" params [["_vehicle", objNull, [objNull]], ["_deploySpecial", false, [true]], ["_createDeploymentGroup", true, [true]]]; -private ["_config", "_configEnabled", "_deployTime", "_unitsToDeploy", "_deployGroup"]; if (isNull _vehicle || {!(_vehicle isKindOf "Helicopter")}) exitWith { if (hasInterface) then { @@ -28,8 +27,8 @@ if (isNull _vehicle || {!(_vehicle isKindOf "Helicopter")}) exitWith { ERROR('FUNC(deployAI): deployAI was called with an invalid or non-existant vehicle.'); }; -_config = configFile >> "CfgVehicles" >> typeOf _vehicle; -_configEnabled = getNumber (_config >> QGVAR(enabled)); +private _config = configFile >> "CfgVehicles" >> typeOf _vehicle; +private _configEnabled = getNumber (_config >> QGVAR(enabled)); if (_configEnabled == 0) exitWith { if (hasInterface) then { [format ["You cannot fast rope from a ""%1"" helicopter.", getText (_config >> "DisplayName")], QFUNC(deployAI)] spawn BIS_fnc_guiMessage; @@ -44,7 +43,7 @@ if (_configEnabled == 2 && {isNull (_vehicle getVariable [QGVAR(FRIES), objNull] ERROR_1('FUNC(deployAI): "%1" requires a FRIES for fastroping but has not been equipped with one.',getText (_config >> "DisplayName")); }; -_unitsToDeploy = crew _vehicle; +private _unitsToDeploy = crew _vehicle; if (_deploySpecial) then { _unitsToDeploy deleteAt (_unitsToDeploy find driver _vehicle); } else { @@ -56,11 +55,11 @@ if (_unitsToDeploy isEqualTo []) exitWith { }; if (_createDeploymentGroup) then { - _deployGroup = createGroup side (_unitsToDeploy select 0); + private _deployGroup = createGroup side (_unitsToDeploy select 0); _unitsToDeploy joinSilent _deployGroup; }; -_deployTime = 0; +private _deployTime = 0; if (getText (_config >> QGVAR(onPrepare)) != "") then { _deployTime = [_vehicle] call (missionNamespace getVariable (getText (_config >> QGVAR(onPrepare)))); }; diff --git a/addons/fastroping/functions/fnc_deployAIWaypoint.sqf b/addons/fastroping/functions/fnc_deployAIWaypoint.sqf index 9d8f4a03e2..4df221c80e 100644 --- a/addons/fastroping/functions/fnc_deployAIWaypoint.sqf +++ b/addons/fastroping/functions/fnc_deployAIWaypoint.sqf @@ -7,7 +7,7 @@ * 1: Waypoint position * * Return Value: - * true + * true * * Example: * [_group, [6560, 12390, 0]] call ace_fastroping_fnc_deployAIWayoint @@ -17,11 +17,10 @@ #include "script_component.hpp" params [["_group", grpNull, [grpNull]], ["_position", [0, 0, 0], [[]], 3]]; -private ["_vehicle", "_commander", "_speedMode"]; -_vehicle = vehicle leader _group; -_commander = effectiveCommander _vehicle; -_speedMode = speedMode _group; +private _vehicle = vehicle leader _group; +private _commander = effectiveCommander _vehicle; +private _speedMode = speedMode _group; // - Approach ----------------------------------------------------------------- if (_vehicle distance2D _position > 50) then { diff --git a/addons/fastroping/functions/fnc_equipFRIES.sqf b/addons/fastroping/functions/fnc_equipFRIES.sqf index 6d714611be..1cc3202619 100644 --- a/addons/fastroping/functions/fnc_equipFRIES.sqf +++ b/addons/fastroping/functions/fnc_equipFRIES.sqf @@ -16,14 +16,13 @@ #include "script_component.hpp" params ["_vehicle"]; -private ["_config", "_fries"]; -_config = configFile >> "CfgVehicles" >> typeOf _vehicle; +private _config = configFile >> "CfgVehicles" >> typeOf _vehicle; if !(isNumber (_config >> QGVAR(enabled))) then { ["%1 has not been configured for ACE_Fastroping.", getText (_config >> "DisplayName")] call BIS_fnc_error; } else { if (getNumber (_config >> QGVAR(enabled)) == 2) then { - _fries = (getText (_config >> QGVAR(friesType))) createVehicle [0, 0, 0]; + private _fries = (getText (_config >> QGVAR(friesType))) createVehicle [0, 0, 0]; _fries attachTo [_vehicle, (getArray (_config >> QGVAR(friesAttachmentPoint)))]; _vehicle setVariable [QGVAR(FRIES), _fries, true]; _vehicle addEventHandler ["Killed", { diff --git a/addons/fastroping/functions/fnc_fastRope.sqf b/addons/fastroping/functions/fnc_fastRope.sqf index 0db73f4fce..ab78f122e5 100644 --- a/addons/fastroping/functions/fnc_fastRope.sqf +++ b/addons/fastroping/functions/fnc_fastRope.sqf @@ -17,12 +17,11 @@ #include "script_component.hpp" params ["_unit", "_vehicle"]; -private ["_deployedRopes", "_usableRope", "_usableRopeIndex"]; //Select unoccupied rope -_deployedRopes = _vehicle getVariable [QGVAR(deployedRopes), []]; -_usableRope = _deployedRopes select 0; -_usableRopeIndex = 0; +private _deployedRopes = _vehicle getVariable [QGVAR(deployedRopes), []]; +private _usableRope = _deployedRopes select 0; +private _usableRopeIndex = 0; { if !(_x select 5) exitWith { _usableRope = _x; diff --git a/addons/fastroping/functions/fnc_fastRopeLocalPFH.sqf b/addons/fastroping/functions/fnc_fastRopeLocalPFH.sqf index 72177bce00..d7d49dd11f 100644 --- a/addons/fastroping/functions/fnc_fastRopeLocalPFH.sqf +++ b/addons/fastroping/functions/fnc_fastRopeLocalPFH.sqf @@ -17,13 +17,22 @@ #include "script_component.hpp" params ["_arguments", "_pfhHandle"]; -_arguments params ["_unit", "_vehicle", "_rope", "_ropeIndex", "_timeToPlayRopeSound"]; -_rope params ["_attachmentPoint", "_ropeTop", "_ropeBottom", "_dummy", "_hook", "_occupied"]; -private ["_vectorUp", "_vectorDir", "_origin"]; +_arguments params ["_unit", "", "_rope", "", "_timeToPlayRopeSound"]; +_rope params ["", "", "", "_dummy", "_hook"]; //Wait until the unit is actually outside of the helicopter if (vehicle _unit != _unit) exitWith {}; +// dummy lost hook +if (isNull _hook) exitWith { + TRACE_1("Hook lost, dropping and exiting pfeh",_unit); + + [_unit, "", 2] call EFUNC(common,doAnimation); + _unit setVectorUp [0, 0, 1]; + + [_pfhHandle] call CBA_fnc_removePerFrameHandler; +}; + //Start fast roping if (animationState _unit != "ACE_FastRoping") exitWith { _unit disableCollisionWith _dummy; diff --git a/addons/fastroping/functions/fnc_fastRopeServerPFH.sqf b/addons/fastroping/functions/fnc_fastRopeServerPFH.sqf index 2ebffe680e..8c4b347494 100644 --- a/addons/fastroping/functions/fnc_fastRopeServerPFH.sqf +++ b/addons/fastroping/functions/fnc_fastRopeServerPFH.sqf @@ -18,18 +18,23 @@ #include "script_component.hpp" params ["_arguments", "_pfhHandle"]; _arguments params ["_unit", "_vehicle", "_rope", "_ropeIndex", "_hasBeenAttached"]; -_rope params ["_attachmentPoint", "_ropeTop", "_ropeBottom", "_dummy", "_hook", "_occupied"]; -private ["_vectorUp", "_vectorDir", "_origin"]; +_rope params ["_attachmentPoint", "_ropeTop", "_ropeBottom", "_dummy", "_hook"]; //Wait until the unit is actually outside of the helicopter if (vehicle _unit != _unit) exitWith {}; +//Prevent teleport if hook has been deleted due to rope cut +if (isNull _hook) exitWith { + detach _unit; //Does not matter if unit was not attached yet + [_pfhHandle] call CBA_fnc_removePerFrameHandler; +}; + //Start fast roping if (getMass _dummy != 80) exitWith { //Fix for twitchyness _dummy setMass 80; _dummy setCenterOfMass [0, 0, -2]; - _origin = getPosASL _hook; + private _origin = getPosASL _hook; _dummy setPosASL (_origin vectorAdd [0, 0, -2]); _dummy setVectorUp [0, 0, 1]; @@ -53,14 +58,19 @@ if (_hasBeenAttached && {isNull attachedTo _unit}) exitWith { _dummy setVelocity [0,0,-6]; //Check if fast rope is finished -if (((getPos _unit select 2) < 0.2) || {ropeLength _ropeTop == 34.5} || {vectorMagnitude (velocity _vehicle) > 5} || {!(alive _unit)} || {captive _unit}) exitWith { +if ( + ((getPos _unit select 2) < 0.2) + || {ropeLength _ropeTop == 34.5} + || {vectorMagnitude (velocity _vehicle) > 5} + || {!([_unit] call EFUNC(common,isAwake))} +) exitWith { detach _unit; //Reset rope deleteVehicle _ropeTop; deleteVehicle _ropeBottom; - _origin = getPosASL _hook; + private _origin = getPosASL _hook; _dummy setPosASL (_origin vectorAdd [0, 0, -1]); //Restore original mass and center of mass @@ -74,7 +84,7 @@ if (((getPos _unit select 2) < 0.2) || {ropeLength _ropeTop == 34.5} || {vectorM _ropeBottom addEventHandler ["RopeBreak", {[_this, "bottom"] call FUNC(onRopeBreak)}]; //Update deployedRopes array - _deployedRopes = _vehicle getVariable [QGVAR(deployedRopes), []]; + private _deployedRopes = _vehicle getVariable [QGVAR(deployedRopes), []]; _deployedRopes set [_ropeIndex, [_attachmentPoint, _ropeTop, _ropeBottom, _dummy, _hook, false]]; _vehicle setVariable [QGVAR(deployedRopes), _deployedRopes, true]; diff --git a/addons/fastroping/functions/fnc_onCutCommon.sqf b/addons/fastroping/functions/fnc_onCutCommon.sqf index 004c176b65..1c074a1e01 100644 --- a/addons/fastroping/functions/fnc_onCutCommon.sqf +++ b/addons/fastroping/functions/fnc_onCutCommon.sqf @@ -1,6 +1,6 @@ /* * Author: BaerMitUmlaut - * Function for opening doors and extending the hook for most vanilla helos. + * Function for closing doors and retracting the hook for most vanilla and older Arma helos. * * Arguments: * 0: Helicopter @@ -19,28 +19,17 @@ params ["_vehicle"]; private _fries = _vehicle getVariable [QGVAR(FRIES), objNull]; if !(isNull _fries) then { - _fries animate ["extendHookRight", 0]; - _fries animate ["extendHookLeft", 0]; + {_fries animate [_x, 0]} forEach ANIMS_HOOK; [{ - _this animateDoor ["door_R", 0]; - _this animateDoor ["door_L", 0]; - _this animateDoor ["CargoRamp_Open", 0]; - _this animateDoor ["Door_rear_source", 0]; - _this animateDoor ["Door_6_source", 0]; - _this animate ["dvere1_posunZ", 0]; - _this animate ["dvere2_posunZ", 0]; + {_this animateDoor [_x, 0]} forEach ANIMS_ANIMATEDOOR; + {_this animate [_x, 0]} forEach ANIMS_ANIMATE; _this setVariable [QGVAR(doorsLocked), false, true]; }, _vehicle, 2] call CBA_fnc_waitAndExecute; 4 } else { - _vehicle animateDoor ["door_R", 0]; - _vehicle animateDoor ["door_L", 0]; - _vehicle animateDoor ["CargoRamp_Open", 0]; - _vehicle animateDoor ["Door_rear_source", 0]; - _vehicle animateDoor ["Door_6_source", 0]; - _vehicle animate ["dvere1_posunZ", 0]; - _vehicle animate ["dvere2_posunZ", 0]; + {_vehicle animateDoor [_x, 0]} forEach ANIMS_ANIMATEDOOR; + {_vehicle animate [_x, 0]} forEach ANIMS_ANIMATE; _vehicle setVariable [QGVAR(doorsLocked), false, true]; 2 diff --git a/addons/fastroping/functions/fnc_onPrepareCommon.sqf b/addons/fastroping/functions/fnc_onPrepareCommon.sqf index 37eb6c7eb8..40603a6527 100644 --- a/addons/fastroping/functions/fnc_onPrepareCommon.sqf +++ b/addons/fastroping/functions/fnc_onPrepareCommon.sqf @@ -1,6 +1,6 @@ /* * Author: BaerMitUmlaut - * Function for closing doors and retracting the hook for most vanilla helos. + * Function for opening doors and extending the hook for most vanilla and older Arma helos. * * Arguments: * 0: Helicopter @@ -16,25 +16,18 @@ #include "script_component.hpp" params ["_vehicle"]; -private ["_fries", "_waitTime"]; -_waitTime = 2; +private _waitTime = 2; -_vehicle animateDoor ["door_R", 1]; -_vehicle animateDoor ["door_L", 1]; -_vehicle animateDoor ["CargoRamp_Open", 1]; -_vehicle animateDoor ["Door_rear_source", 1]; -_vehicle animateDoor ["Door_6_source", 1]; -_vehicle animate ["dvere1_posunZ", 1]; -_vehicle animate ["dvere2_posunZ", 1]; +{_vehicle animateDoor [_x, 1]} forEach ANIMS_ANIMATEDOOR; +{_vehicle animate [_x, 1]} forEach ANIMS_ANIMATE; _vehicle setVariable [QGVAR(doorsLocked), true, true]; -_fries = _vehicle getVariable [QGVAR(FRIES), objNull]; +private _fries = _vehicle getVariable [QGVAR(FRIES), objNull]; if !(isNull _fries) then { [{ - _this animate ["extendHookRight", 1]; - _this animate ["extendHookLeft", 1]; + {_this animate [_x, 1]} forEach ANIMS_HOOK; }, _fries, 2] call CBA_fnc_waitAndExecute; _waitTime = 4; }; diff --git a/addons/fastroping/functions/fnc_onRopeBreak.sqf b/addons/fastroping/functions/fnc_onRopeBreak.sqf index ed5f8bf1c8..3c83daea30 100644 --- a/addons/fastroping/functions/fnc_onRopeBreak.sqf +++ b/addons/fastroping/functions/fnc_onRopeBreak.sqf @@ -9,26 +9,28 @@ * Return Value: * None * + * Example: + * [[array]], "top"] call ace_fastroping_fnc_onRopeBreak + * * Public: No */ #include "script_component.hpp" params ["_ehArgs", "_part"]; _ehArgs params ["_rope", "_helper1", "_helper2"]; -private ["_vehicle", "_deployedRopes", "_brokenRope", "_unit"]; if (_part == "bottom") then { _helper2 = (ropeAttachedObjects _helper1) select 0; }; -_vehicle = attachedTo _helper2; +private _vehicle = attachedTo _helper2; if (isNil "_vehicle") exitWith {}; //Exit when vehicle got destroyed if (_vehicle isKindOf "ACE_friesBase") then { _vehicle = attachedTo _vehicle; }; -_deployedRopes = _vehicle getVariable [QGVAR(deployedRopes), []]; -_brokenRope = []; +private _deployedRopes = _vehicle getVariable [QGVAR(deployedRopes), []]; +private _brokenRope = []; { if ((_x select 1 == _rope) || {(_x select 2 == _rope)}) exitWith { _brokenRope = _x; @@ -37,7 +39,7 @@ _brokenRope = []; _brokenRope set [5, true]; _vehicle setVariable [QGVAR(deployedRopes), _deployedRopes, true]; -_unit = { +private _unit = { if (_x isKindOf "CAManBase") exitWith {_x}; } forEach (attachedObjects (_brokenRope select 3)); diff --git a/addons/fastroping/functions/fnc_prepareFRIES.sqf b/addons/fastroping/functions/fnc_prepareFRIES.sqf index e4bce8458c..7b98b5ff63 100644 --- a/addons/fastroping/functions/fnc_prepareFRIES.sqf +++ b/addons/fastroping/functions/fnc_prepareFRIES.sqf @@ -16,13 +16,12 @@ #include "script_component.hpp" params ["_vehicle"]; -private ["_config", "_waitTime"]; -//Stage indicator: 0 - travel mode; 1 - preparing FRIES; 2 - FRIES ready; 3 - ropes deployed +//Stage indicator: 0 - travel mode; 1 - preparing/stowing FRIES; 2 - FRIES ready; 3 - ropes deployed _vehicle setVariable [QGVAR(deploymentStage), 1, true]; -_config = configFile >> "CfgVehicles" >> typeOf _vehicle; -_waitTime = 0; +private _config = configFile >> "CfgVehicles" >> typeOf _vehicle; +private _waitTime = 0; if (isText (_config >> QGVAR(onPrepare))) then { _waitTime = [_vehicle] call (missionNamespace getVariable (getText (_config >> QGVAR(onPrepare)))); }; diff --git a/addons/fastroping/functions/fnc_stowFRIES.sqf b/addons/fastroping/functions/fnc_stowFRIES.sqf new file mode 100644 index 0000000000..18813295d8 --- /dev/null +++ b/addons/fastroping/functions/fnc_stowFRIES.sqf @@ -0,0 +1,31 @@ +/* + * Author: BaerMitUmlaut + * Stows the helicopters FRIES. + * + * Arguments: + * 0: A helicopter with prepared FRIES + * + * Return Value: + * None + * + * Example: + * [_vehicle] call ace_fastroping_fnc_stowFRIES + * + * Public: No + */ + +#include "script_component.hpp" +params ["_vehicle"]; + +//Stage indicator: 0 - travel mode; 1 - preparing/stowing FRIES; 2 - FRIES ready; 3 - ropes deployed +_vehicle setVariable [QGVAR(deploymentStage), 1, true]; + +private _config = configFile >> "CfgVehicles" >> typeOf _vehicle; +private _waitTime = 0; +if (isText (_config >> QGVAR(onCut))) then { + _waitTime = [_vehicle] call (missionNamespace getVariable (getText (_config >> QGVAR(onCut)))); +}; + +[{ + _this setVariable [QGVAR(deploymentStage), 0, true]; +}, _vehicle, _waitTime] call CBA_fnc_waitAndExecute; diff --git a/addons/fastroping/script_component.hpp b/addons/fastroping/script_component.hpp index 323d1c801c..77c8168f8d 100644 --- a/addons/fastroping/script_component.hpp +++ b/addons/fastroping/script_component.hpp @@ -2,6 +2,7 @@ #define COMPONENT_BEAUTIFIED Fastroping #include "\z\ace\addons\main\script_mod.hpp" +// #define DRAW_FASTROPE_INFO // #define DEBUG_MODE_FULL // #define DISABLE_COMPILE_CACHE // #define ENABLE_PERFORMANCE_COUNTERS @@ -15,3 +16,8 @@ #endif #include "\z\ace\addons\main\script_macros.hpp" + + +#define ANIMS_HOOK ["extendHookRight", "extendHookLeft"] +#define ANIMS_ANIMATEDOOR ["door_R", "door_L", "CargoRamp_Open", "Door_rear_source", "Door_6_source", "CargoDoorR", "CargoDoorL"] +#define ANIMS_ANIMATE ["dvere1_posunZ", "dvere2_posunZ", "doors"] diff --git a/addons/fastroping/stringtable.xml b/addons/fastroping/stringtable.xml index 9719c58053..e0d4d8667d 100644 --- a/addons/fastroping/stringtable.xml +++ b/addons/fastroping/stringtable.xml @@ -7,11 +7,14 @@ Wyposaż FRIES Equiper le FRIES Equipar FRIES - Equipaggia la FRIES + Equipaggia il FRIES Vybavit FRIES Equipar FRIES Десантирование по канатам FRIES を装備 + FRIES 장착 + 启用快速绳降及撤离系统 + 啟用快速繩降及撤離系統 Equips compatible helicopters with a Fast Rope Insertion Extraction System. @@ -19,15 +22,18 @@ Wyposaża kompatybilne helikoptery w zestaw Fast Rope Insertion Extraction System. Equipe les hélicoptères compatibles avec un Module Fast Rope Insertion Extraction System. Equipar helicoptero compatible con un Sistema de Inserción Extracción Fast Rope. - Equipagga l'elicottero compatibile con il Fast Rope Insertion Exstraction System + Equipagga l'elicottero compatibile con il Fast Rope Insertion Extraction System Vybavit kompatibilní vrtulníky systémem Fast Rope Insertion Extraction (FRIES). Equipa um helicóptero compatível com o Fast Rope Insertion Exctraction System. Снаряжает совместимые вертолеты оборудованием для спуска десанта по канатам. ヘリコプターで Fast Rope Insertion Extraction System を使えるようにします + 패스트로프 투입 및 탈출 시스템을 호환되는 헬리콥터에 적용합니다. + 使可相容的直升机启用快速绳降及撤离系统 + 使可相容的直升機啟用快速繩降及撤離系統 Prepare fast roping system - Bereite Fast Roping System vor + Bereite "Fast Roping"-System vor Przygotuj system zjazdu na linach Préparer le système de corde lisse Preparar el sistema fast roping @@ -36,6 +42,17 @@ Prepara sistema de descida rápida Подготовить канаты ファスト ロープのシステムを準備 + 패스트로프 준비 + 准备快速绳降系统 + 準備快速繩降系統 + + + Stow fast roping system + Verstaue "Fast Roping"-System + Arrotola le corde + ファスト ロープのシステムを収容 + 收起快速繩降系統 + 收起快速绳降系统 Deploy ropes @@ -48,6 +65,9 @@ Jogar cordas Зацепить канаты ロープを展開 + 줄 배치 + 部属绳索 + 部屬繩索 Fast rope @@ -55,11 +75,14 @@ Zjedź na linie Descendre à la corde Descender por la cuerda - Scendi sulla corda + Scendi dalla corda SLANIT Descida rápida Спуститься по канату ファスト ロープをする + 강하하기 + 快速绳降 + 快速繩降 Cut ropes @@ -72,6 +95,9 @@ Cortar cordas Обрезать канаты ロープを切断 + 줄 자르기 + 剪掉绳索 + 剪掉繩索 Equip helicopter with FRIES @@ -79,11 +105,14 @@ Wyposaż helikopter w FRIES Equiper l'hélicoptère avec le FRIES Equipar helicoptero con FRIES - Equipaggia l'elicottero con FRIES + Equipaggia l'elicottero con il FRIES Vybavit vrtulník pomocí FRIES Equipar helicóptero com FRIES Снарядить вертолет канатами для спуска ヘリコプターへ FRIES を装備 + 헬리콥터에 FRIES 장착 + 启用快速绳降及撤离系统给指定的直升机 + 啟用快速繩降及撤離系統給指定的直升機 Equips the selected helicopter with a Fast Rope Insertion Extraction System @@ -96,6 +125,9 @@ Equipa um helicóptero selecionado com um sistema de Fast Rope Insertion Extraction System Снаряжает выбранный вертолет оборудованием для спуска десанта по канатам 選択されたヘリコプターで Fast Rope Insertion Extraction System を使えるようにします。 + 선택된 헬리콥터에 패스트로프 투입 및 탈출 시스템을 장착합니다. + 使指定的直升机启用快速绳降及撤离系统 + 使指定的直升機啟用快速繩降及撤離系統 LET UNITS FAST ROPE @@ -106,6 +138,9 @@ ДЕСАНТИРОВАНИЕ ПО КАНАТУ ユニットへファスト ロープをさせる ZJAZD NA LINACH + 让单位快速绳降 + 讓單位快速繩降 + 패스트 로프를 놓음 diff --git a/addons/fcs/CfgEventHandlers.hpp b/addons/fcs/CfgEventHandlers.hpp index b477f93d6a..9c5c368307 100644 --- a/addons/fcs/CfgEventHandlers.hpp +++ b/addons/fcs/CfgEventHandlers.hpp @@ -17,7 +17,7 @@ class Extended_PostInit_EventHandlers { }; }; -class Extended_Init_EventHandlers { +class Extended_InitPost_EventHandlers { class Tank { class ADDON { serverInit = QUOTE(_this call FUNC(vehicleInit)); diff --git a/addons/fcs/CfgOptics.hpp b/addons/fcs/CfgOptics.hpp index aa68a6f68a..f8770d7327 100644 --- a/addons/fcs/CfgOptics.hpp +++ b/addons/fcs/CfgOptics.hpp @@ -11,110 +11,13 @@ h = 0; \ }; +class RscText; class RscControlsGroup; class RscMapControl; class RscInGameUI { class RscUnitInfo; - class RscUnitInfo_AH64D_gunner { - controls[] = {"CA_Distance","ACE_CA_Distance"}; - MACRO_RANGEFINDER - }; - class RscWeaponRangeFinder { - controls[] = {"CA_Distance","ACE_CA_Distance"}; - MACRO_RANGEFINDER - }; - class RscWeaponRangeFinderPAS13 { - MACRO_RANGEFINDER - }; - class RscOptics_Rangefinder: RscUnitInfo { - class CA_IGUI_elements_group: RscControlsGroup { - class controls { - MACRO_RANGEFINDER - }; - }; - }; - class RscWeaponRangeFinderMAAWS { - class CA_IGUI_elements_group: RscControlsGroup { - class controls { - MACRO_RANGEFINDER - }; - }; - }; - class RscWeaponRangeFinderAbramsCom { - controls[] = {"CA_Distance","ACE_CA_Distance"}; - MACRO_RANGEFINDER - }; - class RscWeaponRangeFinderAbramsGun { - controls[] = {"CA_Distance","ACE_CA_Distance"}; - MACRO_RANGEFINDER - }; - class RscWeaponRangeFinderStrykerMGSGun { - controls[] = {"CA_Distance","ACE_CA_Distance"}; - MACRO_RANGEFINDER - }; - class RscOptics_crows: RscUnitInfo { - class CA_IGUI_elements_group: RscControlsGroup { - class controls { - MACRO_RANGEFINDER - }; - }; - }; - class RscOptics_strider_commander { - class CA_IGUI_elements_group: RscControlsGroup { - class controls { - MACRO_RANGEFINDER - }; - }; - }; - - class RscWeaponRangeZeroing: RscUnitInfo { - controls[] = {"CA_Zeroing", "CA_DistanceText", "CA_Distance","ACE_CA_Distance", "ACE_Rangehelper"}; - MACRO_RANGEFINDER - }; - class RscOptics_sos: RscUnitInfo { - class CA_IGUI_elements_group: RscControlsGroup { - class controls { - MACRO_RANGEFINDER - }; - }; - }; - class RscOptics_nightstalker: RscUnitInfo { - class CA_IGUI_elements_group: RscControlsGroup { - class controls { - MACRO_RANGEFINDER - }; - }; - }; - class RscOptics_tws: RscUnitInfo { - class CA_IGUI_elements_group: RscControlsGroup { - class controls { - MACRO_RANGEFINDER - }; - }; - }; - class RscOptics_punisher { - class CA_IGUI_elements_group: RscControlsGroup { - class controls { - MACRO_RANGEFINDER - }; - }; - }; - class RscOptics_tws_sniper: RscUnitInfo { - class CA_IGUI_elements_group: RscControlsGroup { - class controls { - MACRO_RANGEFINDER - }; - }; - }; - class RscOptics_SDV_periscope { - class CA_IGUI_elements_group: RscControlsGroup { - class controls { - MACRO_RANGEFINDER - }; - }; - }; class RscOptics_Heli_Attack_02_gunner: RscUnitInfo { class CA_IGUI_elements_group: RscControlsGroup { class controls { @@ -122,7 +25,7 @@ class RscInGameUI { }; }; }; - class Rsc_ACE_Helo_UI_Turret: RscUnitInfo { + class Rsc_ACE_Helo_UI_Turret: RscUnitInfo { // RscOptics_Heli_Attack_01_gunner onLoad = "[""onLoad"",_this,""RscUnitInfo"",'IGUI'] call (uinamespace getvariable 'BIS_fnc_initDisplay'); uiNamespace setVariable ['ACE_dlgRangefinder', _this select 0]; ((_this select 0) displayCtrl 151) ctrlSetTextColor [0, 0, 0, 0];"; class CA_IGUI_elements_group: RscControlsGroup { class controls { @@ -130,103 +33,30 @@ class RscInGameUI { }; }; }; - class RscOptics_Heli_Attack_01_gunner: RscUnitInfo { - class CA_IGUI_elements_group: RscControlsGroup { - class controls { - MACRO_RANGEFINDER - }; - }; - }; - class RscOptics_UAV_gunner: RscUnitInfo { - class CA_IGUI_elements_group: RscControlsGroup { - class controls { - MACRO_RANGEFINDER - }; - }; - }; - class RscOptics_UGV_gunner: RscUnitInfo { - class CA_IGUI_elements_group: RscControlsGroup { - class controls { - MACRO_RANGEFINDER - }; - }; - }; + class RscOptics_APC_Tracked_01_gunner: RscUnitInfo { class CA_IGUI_elements_group: RscControlsGroup { class controls { - MACRO_RANGEFINDER + class CA_Distance: RscText {}; }; }; }; - class RscOptics_APC_Tracked_03_gunner: RscUnitInfo { - class CA_IGUI_elements_group: RscControlsGroup { - class controls { - MACRO_RANGEFINDER - }; - }; - }; - class RscOptics_APC_Wheeled_01_gunner: RscUnitInfo { - class CA_IGUI_elements_group: RscControlsGroup { - class controls { - MACRO_RANGEFINDER - }; - }; - }; - class RscOptics_APC_Wheeled_03_commander: RscUnitInfo { - class CA_IGUI_elements_group: RscControlsGroup { - class controls { - MACRO_RANGEFINDER - }; - }; - }; - class RscOptics_APC_Wheeled_03_gunner: RscUnitInfo { - class CA_IGUI_elements_group: RscControlsGroup { - class controls { - MACRO_RANGEFINDER - }; - }; - }; - class RscOptics_MBT_01_commander: RscUnitInfo { - class CA_IGUI_elements_group: RscControlsGroup { - class controls { - MACRO_RANGEFINDER - }; - }; - }; - class RscOptics_MBT_01_gunner: RscUnitInfo { - class CA_IGUI_elements_group: RscControlsGroup { - class controls { - MACRO_RANGEFINDER - }; - }; - }; - class RscOptics_MBT_02_commander: RscUnitInfo { - class CA_IGUI_elements_group: RscControlsGroup { - class controls { - MACRO_RANGEFINDER - }; - }; - }; - class RscOptics_MBT_02_gunner: RscUnitInfo { - class CA_IGUI_elements_group: RscControlsGroup { - class controls { - MACRO_RANGEFINDER - }; - }; - }; - class RscOptics_MBT_03_gunner: RscUnitInfo { - class CA_IGUI_elements_group: RscControlsGroup { - class controls { - MACRO_RANGEFINDER - }; - }; - }; - - // marksmen - class RscOptics_LaserDesignator_02 { - class CA_IGUI_elements_group: RscControlsGroup { - class controls { - MACRO_RANGEFINDER + class ACE_RscOptics_APC_Tracked_01_gunner: RscOptics_APC_Tracked_01_gunner { + class CA_IGUI_elements_group: CA_IGUI_elements_group { + class controls: controls { + // MACRO_RANGEFINDER + modify IDC of CA_Distance + class CA_Distance: CA_Distance { + idc = 151; + }; + class ACE_CA_Distance: CA_Distance { + idc = 1713151; + text = "----"; + }; + class ACE_Rangehelper: RscMapControl { + onDraw = "((ctrlParent (_this select 0)) displayCtrl 1713151) ctrlShow (cameraView == 'GUNNER');"; + w = 0; + h = 0; + }; }; }; }; diff --git a/addons/fcs/CfgVehicles.hpp b/addons/fcs/CfgVehicles.hpp index 82572f2c68..5b5935506e 100644 --- a/addons/fcs/CfgVehicles.hpp +++ b/addons/fcs/CfgVehicles.hpp @@ -47,396 +47,53 @@ class CfgVehicles { }; }; class Turrets { - class MainTurret: NewTurret { - GVAR(Enabled) = 1; // all tracked vehicles get one by default - class Turrets { - class CommanderOptics; - }; - }; + class MainTurret: NewTurret {}; }; }; class Tank_F: Tank { class Turrets { - class MainTurret: NewTurret { - GVAR(Enabled) = 1; // all tracked vehicles get one by default - class Turrets { - class CommanderOptics;//: CommanderOptics {}; - }; - }; + class MainTurret: NewTurret {}; }; }; - class Car_F: Car { - class Turrets { - class MainTurret; - }; - }; - - class Wheeled_APC_F: Car_F { - class Turrets { - class MainTurret: NewTurret { - class Turrets { - class CommanderOptics;//: CommanderOptics {}; - }; - }; - }; - }; - - class MRAP_01_base_F: Car_F {}; - - class MRAP_01_gmg_base_F: MRAP_01_base_F { - class Turrets: Turrets { - class MainTurret: MainTurret { - GVAR(Enabled) = 1; - GVAR(MaxDistance) = 2000; - discreteDistance[] = {}; - discreteDistanceInitIndex = 0; - }; - }; - }; - - class MRAP_01_hmg_base_F: MRAP_01_gmg_base_F { - /*class Turrets: Turrets { - class MainTurret: MainTurret {}; - };*/ - }; - - class B_MRAP_01_F: MRAP_01_base_F { - class Turrets; - }; - - class MRAP_02_base_F: Car_F {}; - - class MRAP_02_hmg_base_F: MRAP_02_base_F { - class Turrets: Turrets { - class MainTurret: MainTurret { - GVAR(Enabled) = 1; - GVAR(MaxDistance) = 2000; - discreteDistance[] = {}; - discreteDistanceInitIndex = 0; - }; - }; - }; - - class MRAP_02_gmg_base_F: MRAP_02_hmg_base_F { - /*class Turrets: Turrets { - class MainTurret: MainTurret {}; - };*/ - }; - - class O_MRAP_02_F: MRAP_02_base_F { - class Turrets; - }; - - class MRAP_03_base_F: Car_F { - class Turrets: Turrets { - class CommanderTurret: MainTurret { - GVAR(Enabled) = 0; - }; - }; - }; - - class MRAP_03_hmg_base_F: MRAP_03_base_F { - class Turrets: Turrets { - class MainTurret: MainTurret { - GVAR(Enabled) = 1; - GVAR(MaxDistance) = 2000; - discreteDistance[] = {}; - discreteDistanceInitIndex = 0; - }; - class CommanderTurret: CommanderTurret { - GVAR(Enabled) = 0; - }; - }; - }; - - class MRAP_03_gmg_base_F: MRAP_03_hmg_base_F { - /*class Turrets: Turrets { - class MainTurret: MainTurret {}; - class CommanderTurret: CommanderTurret {}; - };*/ - }; - - class APC_Wheeled_01_base_F: Wheeled_APC_F { - /*class Turrets: Turrets { - class MainTurret: MainTurret { - class Turrets: Turrets { - class CommanderOptics: CommanderOptics {}; - }; - }; - };*/ - }; - - class B_APC_Wheeled_01_base_F: APC_Wheeled_01_base_F {}; - - class B_APC_Wheeled_01_cannon_F: B_APC_Wheeled_01_base_F { - class Turrets: Turrets { - class MainTurret: MainTurret { - GVAR(Enabled) = 1; - discreteDistance[] = {}; - discreteDistanceInitIndex = 0; - }; - }; - }; - - class APC_Wheeled_02_base_F: Wheeled_APC_F { - class Turrets: Turrets { - class MainTurret: MainTurret { - GVAR(Enabled) = 1; - GVAR(MaxDistance) = 2000; - discreteDistance[] = {}; - discreteDistanceInitIndex = 0; - }; - - // class CommanderOptics: CommanderOptics {}; - }; - }; - - class APC_Wheeled_03_base_F: Wheeled_APC_F { - class Turrets: Turrets { - class MainTurret: MainTurret { - GVAR(Enabled) = 1; - discreteDistance[] = {}; - discreteDistanceInitIndex = 0; - - /*class Turrets: Turrets { - class CommanderOptics: CommanderOptics {}; - };*/ - }; - }; - }; - - class I_APC_Wheeled_03_base_F: APC_Wheeled_03_base_F {}; - - class I_APC_Wheeled_03_cannon_F: I_APC_Wheeled_03_base_F { - /*class Turrets: Turrets { - class MainTurret: MainTurret {}; - };*/ - }; - class APC_Tracked_01_base_F: Tank_F { - /*class Turrets: Turrets { - class MainTurret: MainTurret { - class Turrets; - }; - };*/ - }; - - class B_APC_Tracked_01_base_F: APC_Tracked_01_base_F { - /*class Turrets: Turrets { - class MainTurret: MainTurret {}; - };*/ - }; - - class B_APC_Tracked_01_rcws_F: B_APC_Tracked_01_base_F { class Turrets: Turrets { - class MainTurret: MainTurret { - GVAR(Enabled) = 1; - GVAR(MaxDistance) = 2000; - discreteDistance[] = {}; - discreteDistanceInitIndex = 0; - }; - class CommanderOptics: CommanderOptics {}; + class MainTurret: MainTurret {}; }; }; - class B_APC_Tracked_01_CRV_F: B_APC_Tracked_01_base_F { - //GVAR(Enabled) = 0; @todo - }; + class B_APC_Tracked_01_base_F: APC_Tracked_01_base_F {}; class B_APC_Tracked_01_AA_F: B_APC_Tracked_01_base_F { class Turrets: Turrets { class MainTurret: MainTurret { + GVAR(Enabled) = 1; + turretinfotype = "ACE_RscOptics_APC_Tracked_01_gunner"; + GVAR(MaxDistance) = 2000; discreteDistance[] = {}; discreteDistanceInitIndex = 0; magazines[] += {"ACE_120Rnd_35mm_ABM_shells_Tracer_Red"}; - - /*class Turrets: Turrets { - class CommanderOptics: CommanderOptics {}; - };*/ }; }; }; class APC_Tracked_02_base_F: Tank_F { - /*class Turrets: Turrets { - class MainTurret: MainTurret { - class Turrets: Turrets { - class CommanderOptics: CommanderOptics {}; - }; - }; - };*/ + class Turrets: Turrets { + class MainTurret: MainTurret {}; + }; }; class O_APC_Tracked_02_base_F: APC_Tracked_02_base_F {}; - - class O_APC_Tracked_02_cannon_F: O_APC_Tracked_02_base_F { - /*class Turrets: Turrets { - class MainTurret: MainTurret {}; - };*/ - }; - class O_APC_Tracked_02_AA_F: O_APC_Tracked_02_base_F { class Turrets: Turrets { class MainTurret: MainTurret { + GVAR(Enabled) = 1; + turretinfotype = "ACE_RscOptics_APC_Tracked_01_gunner"; + GVAR(MaxDistance) = 2000; + discreteDistance[] = {}; + discreteDistanceInitIndex = 0; magazines[] += {"ACE_120Rnd_35mm_ABM_shells_Tracer_Green"}; - - /*class Turrets: Turrets { - class CommanderOptics: CommanderOptics {}; - };*/ - }; - }; - }; - - class APC_Tracked_03_base_F: Tank_F { - class Turrets: Turrets { - class MainTurret: MainTurret { - discreteDistance[] = {}; - discreteDistanceInitIndex = 0; - - /*class Turrets: Turrets { - class CommanderOptics: CommanderOptics {}; - };*/ - }; - }; - }; - - class MBT_01_base_F: Tank_F { - class Turrets: Turrets { - class MainTurret: MainTurret { - discreteDistance[] = {}; - discreteDistanceInitIndex = 0; - - /*class Turrets: Turrets { - class CommanderOptics: CommanderOptics {}; - };*/ - }; - }; - }; - - class B_MBT_01_base_F: MBT_01_base_F {}; - - class B_MBT_01_cannon_F: B_MBT_01_base_F {}; - - class B_MBT_01_TUSK_F: B_MBT_01_cannon_F { - class Turrets: Turrets { - class MainTurret: MainTurret { - discreteDistance[] = {}; - discreteDistanceInitIndex = 0; - - class Turrets: Turrets { - class CommanderOptics: CommanderOptics { - GVAR(Enabled) = 1; - discreteDistance[] = {}; - discreteDistanceInitIndex = 0; - }; - }; - }; - }; - }; - - class MBT_01_arty_base_F: MBT_01_base_F { - class Turrets: Turrets { - class MainTurret: MainTurret { - GVAR(Enabled) = 0; - - class Turrets: Turrets { - class CommanderOptics: CommanderOptics { - GVAR(Enabled) = 1; - GVAR(MaxDistance) = 2000; - discreteDistance[] = {}; - discreteDistanceInitIndex = 0; - }; - }; - }; - }; - }; - - class MBT_01_mlrs_base_F: MBT_01_base_F { - class Turrets: Turrets { - class MainTurret: MainTurret { - GVAR(Enabled) = 0; - //class Turrets; - }; - }; - }; - - class MBT_02_base_F: Tank_F { - class Turrets: Turrets { - class MainTurret: MainTurret { - discreteDistance[] = {}; - discreteDistanceInitIndex = 0; - - class Turrets: Turrets { - class CommanderOptics: CommanderOptics { - GVAR(Enabled) = 1; - discreteDistance[] = {}; - discreteDistanceInitIndex = 0; - }; - }; - }; - }; - }; - - class MBT_02_arty_base_F: MBT_02_base_F { - class Turrets: Turrets { - class MainTurret: MainTurret { - GVAR(Enabled) = 0; - - class Turrets: Turrets { - class CommanderOptics: CommanderOptics { - GVAR(Enabled) = 1; - GVAR(MaxDistance) = 2000; - discreteDistance[] = {}; - discreteDistanceInitIndex = 0; - }; - }; - }; - }; - }; - - class MBT_03_base_F: Tank_F { - class Turrets: Turrets { - class MainTurret: MainTurret { - discreteDistance[] = {}; - discreteDistanceInitIndex = 0; - - class Turrets: Turrets { - class CommanderOptics: CommanderOptics { - GVAR(Enabled) = 1; - discreteDistance[] = {}; - discreteDistanceInitIndex = 0; - }; - }; - }; - }; - }; - - // SHIPS - class Ship: AllVehicles { - class Turrets { - class MainTurret; - }; - }; - - class Ship_F: Ship {}; - - class Boat_F: Ship_F {}; - - class Boat_Armed_01_base_F: Boat_F { - class Turrets: Turrets { - class FrontTurret: NewTurret { - GVAR(enabled) = 1; - GVAR(minDistance) = 100; - GVAR(maxDistance) = 2000; - GVAR(distanceInterval) = 5; - discreteDistance[] = {}; - discreteDistanceInitIndex = 0; - }; - class RearTurret: FrontTurret { - discreteDistance[] = {100,200,300,400,600,800,1000,1200}; // Originally inherited from FrontTurret - discreteDistanceInitIndex = 4; }; }; }; @@ -450,51 +107,7 @@ class CfgVehicles { }; }; - class Plane: Air {}; - - class Helicopter_Base_F: Helicopter { - class Turrets: Turrets { - class CopilotTurret; - }; - }; - - class Helicopter_Base_H: Helicopter_Base_F { - class Turrets: Turrets { - class CopilotTurret; - }; - }; - - class Heli_Light_01_base_F: Helicopter_Base_H { - /*class Turrets: Turrets { - class CopilotTurret: CopilotTurret {}; - };*/ - }; - - class Heli_Light_01_unarmed_base_F: Heli_Light_01_base_F {}; - - class B_Heli_Light_01_F: Heli_Light_01_unarmed_base_F { - /*class Turrets: Turrets { - class CopilotTurret: CopilotTurret {}; - };*/ - }; - - class Heli_Light_01_armed_base_F: Heli_Light_01_base_F { - /*class Turrets: Turrets { - class CopilotTurret: CopilotTurret {}; - };*/ - }; - - class Heli_Light_02_base_F: Helicopter_Base_H { - /*class Turrets: Turrets { - class CopilotTurret: CopilotTurret {}; - };*/ - }; - - class Plane_Base_F: Plane { - class Turrets { - class CopilotTurret; - }; - }; + class Helicopter_Base_F: Helicopter {}; class Heli_Attack_01_base_F: Helicopter_Base_F { class Turrets: Turrets { @@ -515,80 +128,4 @@ class CfgVehicles { }; }; }; - - class Heli_Transport_01_base_F: Helicopter_Base_H { - /*class Turrets: Turrets { - class CopilotTurret: CopilotTurret {}; - class MainTurret: MainTurret {}; - class RightDoorGun: MainTurret {}; - };*/ - }; - - class Heli_Transport_02_base_F: Helicopter_Base_H { - /*class Turrets: Turrets { - class CopilotTurret: CopilotTurret {}; - };*/ - }; - - class Heli_light_03_base_F; - class I_Heli_light_03_base_F: Heli_light_03_base_F { - /*class Turrets: Turrets { - class MainTurret: MainTurret {}; - };*/ - }; - class I_Heli_light_03_F: Heli_light_03_base_F { - /*class Turrets: Turrets { - class MainTurret: MainTurret {}; - };*/ - }; - - class Plane_CAS_01_base_F: Plane_Base_F { - class Turrets; - }; - - class Plane_CAS_02_base_F: Plane_Base_F { - class Turrets; - }; - - class Plane_Fighter_03_base_F: Plane_Base_F { - class Turrets; - }; - - // static weapons. - class StaticWeapon: LandVehicle { - class Turrets { - class MainTurret; //: NewTurret {}; - }; - }; - - class StaticMGWeapon: StaticWeapon {}; - - class HMG_01_base_F: StaticMGWeapon { - class Turrets: Turrets { - class MainTurret: MainTurret { - GVAR(Enabled) = 1; - GVAR(MinDistance) = 200; - GVAR(MaxDistance) = 2000; - GVAR(DistanceInterval) = 5; - discreteDistance[] = {}; - discreteDistanceInitIndex = 0; - }; - }; - }; - - class StaticGrenadeLauncher: StaticWeapon {}; - class GMG_TriPod: StaticGrenadeLauncher {}; - - class GMG_01_base_F: GMG_TriPod { - class Turrets: Turrets { - class MainTurret: MainTurret { - GVAR(Enabled) = 1; - GVAR(MinDistance) = 200; - GVAR(MaxDistance) = 2000; - GVAR(DistanceInterval) = 5; - discreteDistance[] = {}; - discreteDistanceInitIndex = 0; - }; - }; - }; }; diff --git a/addons/fcs/CfgWeapons.hpp b/addons/fcs/CfgWeapons.hpp index 760e39e2de..555060b119 100644 --- a/addons/fcs/CfgWeapons.hpp +++ b/addons/fcs/CfgWeapons.hpp @@ -1,15 +1,6 @@ class CfgWeapons { - // disable locking, so it doesn't interfere with our system class CannonCore; - class cannon_120mm: CannonCore { - canLock = 0; - ballisticsComputer = 0; - }; - class autocannon_Base_F: CannonCore { - canLock = 0; - ballisticsComputer = 0; - }; class autocannon_35mm: CannonCore { canLock = 0; ballisticsComputer = 4; //was "4 + 2", 2 is for manual zeroing, 4 is for the lead indicator - https://community.bistudio.com/wiki/A3_Locking_Review#ballisticsComputer diff --git a/addons/fcs/XEH_postInit.sqf b/addons/fcs/XEH_postInit.sqf index 02c9e72ae5..ef6e89d5cc 100644 --- a/addons/fcs/XEH_postInit.sqf +++ b/addons/fcs/XEH_postInit.sqf @@ -21,3 +21,7 @@ if (!hasInterface) exitWith {}; // Register event for global updates [QGVAR(forceUpdate), {[ACE_player] call FUNC(onForceUpdate)}] call CBA_fnc_addEventHandler; + +#ifdef DEBUG_MODE_FULL +call compile preprocessFileLineNumbers QPATHTOF(functions\dev_debugConfigs.sqf); +#endif diff --git a/addons/fcs/XEH_preInit.sqf b/addons/fcs/XEH_preInit.sqf index a7feade1c3..b47cf6628d 100644 --- a/addons/fcs/XEH_preInit.sqf +++ b/addons/fcs/XEH_preInit.sqf @@ -2,6 +2,8 @@ ADDON = false; +PREP_RECOMPILE_START; #include "XEH_PREP.hpp" +PREP_RECOMPILE_END; ADDON = true; diff --git a/addons/fcs/config.cpp b/addons/fcs/config.cpp index 29aba659b5..df849ec346 100644 --- a/addons/fcs/config.cpp +++ b/addons/fcs/config.cpp @@ -30,3 +30,7 @@ class CfgPatches { class ACE_Extensions { extensions[] += {"ace_fcs"}; }; + +class ACE_Tests { + fcs = QPATHTOF(dev\test_debugConfigs.sqf); +}; diff --git a/addons/fcs/dev/test_debugConfigs.sqf b/addons/fcs/dev/test_debugConfigs.sqf new file mode 100644 index 0000000000..89fa6b0d31 --- /dev/null +++ b/addons/fcs/dev/test_debugConfigs.sqf @@ -0,0 +1,97 @@ +// PabstMirror +// ["fcs"] call ace_common_fnc_runTests; +// execVM "z\ace\addons\fcs\dev\test_debugConfigs.sqf; + +private _testPass = true; + +diag_log text format ["[ACE_FCS] ---------------"]; +private _vehicles = configProperties [configFile >> "CfgVehicles", "(isClass _x) && {2 == getNumber (_x >> 'scope')}", true]; +private _problemUIs = []; +{ + private _vehicleType = configName _x; + { + private _turret = _x; + private _config = [_vehicleType, _turret] call CBA_fnc_getTurret; + if (!isNull _config) then { + private _aceFCS = (getNumber (_config >> "ACE_FCS_Enabled")) == 1; + + private _vanillaFCS = false; + private _weapons = getArray (_config >> "weapons"); + { + private _weapon = _x; + private _ballisticComputer = getNumber (configFile >> "CfgWeapons" >> _weapon >> "ballisticsComputer"); + _ballisticComputer = [_ballisticComputer, 5] call ace_common_fnc_toBin; + if ((_ballisticComputer select [(count _ballisticComputer) - 5, 1]) == "1") then { + _vanillaFCS = true; + if (_aceFCS) then { + _testPass = false; + diag_log text format ["%1 -> %2: ACE FCS Enabled CONFLICTS with vanilla FCS [%3]", _vehicleType, _weapon, _ballisticComputer]; + }; + }; + } forEach _weapons; + + if (!(_weapons isEqualTo [])) then { + private _fcsMsg = switch (true) do { + // case ((!_vanillaFCS) && {!_aceFCS}): {"No FCS"}; + // case ((_vanillaFCS) && {_aceFCS}): {"CONFLICT FCS"}; + // case (_vanillaFCS): {"Vanilla FCS"}; + // case (_aceFCS): {"ACE FCS"}; + default {""}; + }; + if (_fcsMsg != "") then {diag_log text format ["%1: %2", _vehicleType, _fcsMsg];}; + }; + + if (_vanillaFCS) then { + private _dd = getArray (_config >> "discreteDistance"); + if (_dd isEqualTo []) exitWith {diag_log format ["%1->%2: discreteDistance with vanillaFCS [%3]", _vehicleType, _turret, _config];}; + }; + + if (true) then { + private _turretInfo = getText (_config >> "turretInfoType"); + private _infoConfig = configFile >> "RscInGameUI" >> _turretInfo; + if (!isNull _infoConfig) then { + private _idcList = []; + + private _fncGetIDCS = { + params ["_subConfig"]; + if (!isClass _subConfig) exitWith {diag_log "err";}; + private _controlsArray = getArray (_subConfig >> "controls"); + { + [_subConfig >> _x] call _fncGetIDCS; + } forEach _controlsArray; + private _controlsConfig = configProperties [(_subConfig >> "controls"), "isClass _x", true]; + { + [_x] call _fncGetIDCS; + } forEach _controlsConfig; + _idcList pushBack getNumber (_subConfig >> "idc"); + }; + [_infoConfig] call _fncGetIDCS; + + if (_aceFCS && {!(1713151 in _idcList)}) then { + _problemUIs pushBackUnique format ["%1: ACE_FCS, but missing ACE_CA_DIST", _turretInfo]; + }; + if (_aceFCS && {(198 in _idcList)}) then { + _problemUIs pushBackUnique format ["%1: ACE_FCS, but NEW Lazr CA_DIST", _turretInfo, _vehicleType]; + }; + if ((!_aceFCS) && {(1713151 in _idcList)}) then { + _problemUIs pushBackUnique format ["%1: Not ACE but has ACE_CA_DIST", _turretInfo, _vehicleType]; + }; + if (_vanillaFCS && {!(198 in _idcList)}) then { + _problemUIs pushBackUnique format ["%1: vanillaFCS but missing NEW Lazr CA_DIST [just a warning]", _turretInfo, _vehicleType]; + }; + }; + }; + }; + // } forEach [[0],[0,0]]; + } forEach [[0],[0,0], [1], [2]]; +} forEach _vehicles; + +_problemUIs sort true; + +diag_log text format ["[ACE_FCS] ------- Problem UIs --------"]; +{ + diag_log text format ["- %1", _x]; +} forEach _problemUIs; +diag_log text format ["[ACE_FCS] ---------------"]; + +_testPass diff --git a/addons/fcs/functions/fnc_adjustRange.sqf b/addons/fcs/functions/fnc_adjustRange.sqf index bed9389716..0f400a50fb 100644 --- a/addons/fcs/functions/fnc_adjustRange.sqf +++ b/addons/fcs/functions/fnc_adjustRange.sqf @@ -10,6 +10,9 @@ * Return Value: * None * + * Example: + * [bob, [], 5] call ace_fcs_fnc_adjustRange + * * Public: No */ #include "script_component.hpp" diff --git a/addons/fcs/functions/fnc_calculateSolution.sqf b/addons/fcs/functions/fnc_calculateSolution.sqf index 61bfbd8c58..f28a1c7048 100644 --- a/addons/fcs/functions/fnc_calculateSolution.sqf +++ b/addons/fcs/functions/fnc_calculateSolution.sqf @@ -3,20 +3,24 @@ * Calculate FCS solution * * Arguments: - * 0: Vehicle - * 1: Turret - * 2: Target distance - * 3: Azimuth offset + * 0: Vehicle + * 1: Turret + * 2: Target distance + * 3: Azimuth offset * * Return Value: * None * + * Example: + * [car, [turret], 5, ?] call ace_fcs_fnc_calculateSolution + * * Public: No */ #include "script_component.hpp" params ["_vehicle","_turret","_distance","_angleTarget"]; TRACE_4("params",_vehicle,_turret,_distance,_angleTarget); +private _FCSInitSpeed = []; private _FCSMagazines = []; private _FCSElevation = []; private _turretConfig = [configFile >> "CfgVehicles" >> typeOf _vehicle, _turret] call EFUNC(common,getTurretConfigPath); @@ -64,6 +68,7 @@ private _turretConfig = [configFile >> "CfgVehicles" >> typeOf _vehicle, _turret private _offset = "ace_fcs" callExtension format ["%1,%2,%3,%4", _initSpeed, _airFriction, _angleTarget, _distance]; _offset = parseNumber _offset; + _FCSInitSpeed pushBack _initSpeed; _FCSMagazines pushBack _magazine; _FCSElevation pushBack _offset; }; @@ -71,5 +76,6 @@ private _turretConfig = [configFile >> "CfgVehicles" >> typeOf _vehicle, _turret } count (_vehicle magazinesTurret _turret); [_vehicle, format ["%1_%2", QGVAR(Distance), _turret], _distance] call EFUNC(common,setVariablePublic); +[_vehicle, format ["%1_%2", QGVAR(InitSpeed), _turret], _FCSInitSpeed] call EFUNC(common,setVariablePublic); [_vehicle, format ["%1_%2", QGVAR(Magazines), _turret], _FCSMagazines] call EFUNC(common,setVariablePublic); [_vehicle, format ["%1_%2", QGVAR(Elevation), _turret], _FCSElevation] call EFUNC(common,setVariablePublic); diff --git a/addons/fcs/functions/fnc_canResetFCS.sqf b/addons/fcs/functions/fnc_canResetFCS.sqf index cf0dcf2674..8713357f3d 100644 --- a/addons/fcs/functions/fnc_canResetFCS.sqf +++ b/addons/fcs/functions/fnc_canResetFCS.sqf @@ -3,11 +3,14 @@ * Called from config. Can player reset FCS? * * Arguments: - * Nothing + * None * * Return Value: * Boolean * + * Example: + * call ace_fcs_fnc_canResetFCS + * * Public: No */ #include "script_component.hpp" diff --git a/addons/fcs/functions/fnc_canUseRangefinder.sqf b/addons/fcs/functions/fnc_canUseRangefinder.sqf index 7403c74ac1..a8b8239097 100644 --- a/addons/fcs/functions/fnc_canUseRangefinder.sqf +++ b/addons/fcs/functions/fnc_canUseRangefinder.sqf @@ -8,6 +8,9 @@ * Return Value: * Boolean * + * Example: + * call ace_fcs_fnc_canUseRangeFinder + * * Public: No */ #include "script_component.hpp" diff --git a/addons/fcs/functions/fnc_firedEH.sqf b/addons/fcs/functions/fnc_firedEH.sqf index 4c9b7d8b85..097722c958 100644 --- a/addons/fcs/functions/fnc_firedEH.sqf +++ b/addons/fcs/functions/fnc_firedEH.sqf @@ -8,6 +8,9 @@ * Return Value: * None * + * Example: + * call ace_fcs_fnc_firedEH + * * Public: No */ #include "script_component.hpp" @@ -19,17 +22,37 @@ private _FCSMagazines = _vehicle getVariable [format ["%1_%2", QGVAR(Magazines), if !(_magazine in _FCSMagazines) exitWith {}; +private _FCSInitSpeed = _vehicle getVariable format ["%1_%2", QGVAR(InitSpeed), _turret]; private _FCSElevation = _vehicle getVariable format ["%1_%2", QGVAR(Elevation), _turret]; -// GET ELEVATION OFFSET OF CURRENT MAGAZINE +// GET ELEVATION OFFSET AND INITSPEED OF CURRENT MAGAZINE private _offset = 0; - +private _initSpeed = 0; { if (_x == _magazine) exitWith { _offset = _FCSElevation select _forEachIndex; + _initSpeed = _FCSInitSpeed select _forEachIndex; }; } forEach _FCSMagazines; +// Calculate the correction due to vanilla zeroing +private _zeroDistance = currentZeroing _gunner; +if (_zeroDistance > 0) then { + private _weaponCombo = [_weapon, _magazine, _ammo, _zeroDistance]; + if !(_weaponCombo isEqualTo (_gunner getVariable [QGVAR(lastWeaponCombo), []])) then { + private _airFriction = getNumber (configFile >> "CfgAmmo" >> _ammo >> "airFriction"); + private _antiOffset = "ace_fcs" callExtension format ["%1,%2,%3,%4", _initSpeed, _airFriction, 0, _zeroDistance]; + _antiOffset = parseNumber _antiOffset; + + _gunner setVariable [QGVAR(lastWeaponCombo), _weaponCombo]; + _gunner setVariable [QGVAR(lastAntiOffset), _antiOffset]; + }; + private _antiOffset = _gunner getVariable QGVAR(lastAntiOffset); + + _offset = _offset - _antiOffset; + TRACE_4("fired",_gunner, currentZeroing _gunner, _antiOffset, _offset); +}; + [_projectile, (_vehicle getVariable format ["%1_%2", QGVAR(Azimuth), _turret]), _offset, 0] call EFUNC(common,changeProjectileDirection); // Remove the platform velocity @@ -44,7 +67,7 @@ if (vectorMagnitude velocity _vehicle > 2) then { if (!local _gunner) exitWith {}; if (getNumber (configFile >> "CfgAmmo" >> _ammo >> QGVAR(Airburst)) == 1) then { - private _zeroing = _vehicle getVariable [format ["%1_%2", QGVAR(Distance), _turret], currentZeroing _vehicle]; + private _zeroing = _vehicle getVariable [format ["%1_%2", QGVAR(Distance), _turret], currentZeroing _gunner]; if (_zeroing < 50) exitWith {}; if (_zeroing > 1500) exitWith {}; diff --git a/addons/fcs/functions/fnc_getAngle.sqf b/addons/fcs/functions/fnc_getAngle.sqf index d2c51a9542..d9e14a343b 100644 --- a/addons/fcs/functions/fnc_getAngle.sqf +++ b/addons/fcs/functions/fnc_getAngle.sqf @@ -14,6 +14,9 @@ * Return Value: * offset from the current angle necessary to hit the target * + * Example: + * [1, 2, 3, 4, 5, 6, 7] call ace_fcs_fnc_getAngle + * * Public: No */ #include "script_component.hpp" diff --git a/addons/fcs/functions/fnc_getRange.sqf b/addons/fcs/functions/fnc_getRange.sqf index ba49621047..829e4c9072 100644 --- a/addons/fcs/functions/fnc_getRange.sqf +++ b/addons/fcs/functions/fnc_getRange.sqf @@ -11,6 +11,9 @@ * Return Value: * Measured distance * + * Example: + * [5, 6, 7, true] call ace_fcs_fnc_getRange + * * Public: No */ #include "script_component.hpp" diff --git a/addons/fcs/functions/fnc_handleAirBurstAmmunitionPFH.sqf b/addons/fcs/functions/fnc_handleAirBurstAmmunitionPFH.sqf index aa166ece12..4c1c210994 100644 --- a/addons/fcs/functions/fnc_handleAirBurstAmmunitionPFH.sqf +++ b/addons/fcs/functions/fnc_handleAirBurstAmmunitionPFH.sqf @@ -8,6 +8,9 @@ * Return Value: * None * + * Example: + * [[array]] call ace_fcs_fnc_handleAirBurstAummunitionPFH + * * Public: No */ #include "script_component.hpp" diff --git a/addons/fcs/functions/fnc_keyDown.sqf b/addons/fcs/functions/fnc_keyDown.sqf index 3c4943badf..01795ce280 100644 --- a/addons/fcs/functions/fnc_keyDown.sqf +++ b/addons/fcs/functions/fnc_keyDown.sqf @@ -9,6 +9,9 @@ * Return Value: * None * + * Example: + * [car, [turret]] call ace_fcs_fnc_keyDown + * * Public: No */ #include "script_component.hpp" diff --git a/addons/fcs/functions/fnc_keyUp.sqf b/addons/fcs/functions/fnc_keyUp.sqf index a07f5d5d35..d35174a198 100644 --- a/addons/fcs/functions/fnc_keyUp.sqf +++ b/addons/fcs/functions/fnc_keyUp.sqf @@ -9,6 +9,9 @@ * Return Value: * None * + * Example: + * [car, [turret]] call ace_fcs_fnc_keyUp + * * Public: No */ #include "script_component.hpp" diff --git a/addons/fcs/functions/fnc_onForceUpdate.sqf b/addons/fcs/functions/fnc_onForceUpdate.sqf index 2c6d136300..1bbaee5b58 100644 --- a/addons/fcs/functions/fnc_onForceUpdate.sqf +++ b/addons/fcs/functions/fnc_onForceUpdate.sqf @@ -1,3 +1,19 @@ +/* + * Author: ACE-Team + * + * + * Arguments: + * Nothing + * + * Return Value: + * None + * + * Example: + * call ace_fcs_fnc_onForceUpdate + * + * Public: No + */ + #include "script_component.hpp" params ["_unit"]; diff --git a/addons/fcs/functions/fnc_reset.sqf b/addons/fcs/functions/fnc_reset.sqf index dcb1718b3f..9d4a5f65a0 100644 --- a/addons/fcs/functions/fnc_reset.sqf +++ b/addons/fcs/functions/fnc_reset.sqf @@ -7,7 +7,10 @@ * 1: Turret * * Return Value: - * none + * None + * + * Example: + * [car, [turret]] call ace_fcs_fnc_reset * * Public: No */ diff --git a/addons/fcs/functions/fnc_updateRangeHUD.sqf b/addons/fcs/functions/fnc_updateRangeHUD.sqf index 0bb15b2507..2e415b3f49 100644 --- a/addons/fcs/functions/fnc_updateRangeHUD.sqf +++ b/addons/fcs/functions/fnc_updateRangeHUD.sqf @@ -8,6 +8,9 @@ * Return Value: * None * + * Example: + * call ace_fcs_fnc_updateRangeHUD + * * Public: No */ #include "script_component.hpp" diff --git a/addons/fcs/functions/fnc_vehicleInit.sqf b/addons/fcs/functions/fnc_vehicleInit.sqf index 901e0477ab..8a60f31e2e 100644 --- a/addons/fcs/functions/fnc_vehicleInit.sqf +++ b/addons/fcs/functions/fnc_vehicleInit.sqf @@ -3,10 +3,13 @@ * Checks if a vehicle is equipped with an FCS and if so, adds the fired event handler. Execute on server. * * Arguments: - * 0: Vehicle + * 0: Vehicle * * Return Value: - * none + * None + * + * Example: + * [car] call ace_fcs_fnc_vehicleInit * * Public: No */ @@ -25,14 +28,13 @@ params ["_vehicle"]; // calculate offset between gunner camera and muzzle position if !(_vehicle isKindOf "Air") then { - private ["_gunBeg", "_gunnerView", "_gunBegPos", "_gunnerViewPos", "_viewDiff"]; - _gunBeg = getText (_turretConfig >> "gunBeg"); - _gunnerView = getText (_turretConfig >> "memoryPointGunnerOptics"); + private _gunBeg = getText (_turretConfig >> "gunBeg"); + private _gunnerView = getText (_turretConfig >> "memoryPointGunnerOptics"); - _gunBegPos = (_vehicle selectionPosition _gunBeg) select 0; - _gunnerViewPos = (_vehicle selectionPosition _gunnerView) select 0; - _viewDiff = _gunBegPos - _gunnerViewPos; + private _gunBegPos = (_vehicle selectionPosition _gunBeg) select 0; + private _gunnerViewPos = (_vehicle selectionPosition _gunnerView) select 0; + private _viewDiff = _gunBegPos - _gunnerViewPos; _vehicle setVariable [format ["%1_%2", QGVAR(ViewDiff), _x], _viewDiff, true]; } else { diff --git a/addons/fcs/stringtable.xml b/addons/fcs/stringtable.xml index 23967e1397..5c0b77d75b 100644 --- a/addons/fcs/stringtable.xml +++ b/addons/fcs/stringtable.xml @@ -1,4 +1,4 @@ - + @@ -13,10 +13,13 @@ Misura la distanza Marcar com laser / Medir Distância レーザー ターゲット / 計測距離 + 목표까지 거리를 레이저로 취득 + 雷射指示目标 / 测量距离 + 雷射指示目標 / 測量距離 Zeroed To - Haltepunkt + Genullt auf Ajustado a Wyzerowany na Nastaveno na @@ -26,6 +29,9 @@ Fixado em Azzeramento a 次にゼロイン + 영점 조절 + 归零到 + 歸零到 Adjust FCS Range (Up) @@ -39,6 +45,9 @@ Aumentare la distanza dell'FCS Диапазон СУО (Выше) FCS による距離を調節 (上げ) + 사통장치 거리 조정 (위로) + 调整火控系统距离 (上) + 調整火控系統距離 (上) Adjust FCS Range (Down) @@ -52,6 +61,9 @@ Ridurre la distanza dell'FCS Диапазон СУО (Ниже) FCS による距離を調節 (下げ) + 사통장치 거리 조정 (아래로) + 调整火控系统距离 (下) + 調整火控系統距離 (下) Reset FCS @@ -65,6 +77,9 @@ Azzeramento dell'FCS Обнулить СУО FCS を初期化 + 사통장치 초기화 + 重置火控系统 + 重置火控系統 FCS has been reset. @@ -78,6 +93,9 @@ L'FCS è stato azzerato СУО обнулен. FCS は初期化された + 사통장치 초기화됨 + 火控系统已被重置 + 火控系統已被重置 - \ No newline at end of file + diff --git a/addons/finger/XEH_preInit.sqf b/addons/finger/XEH_preInit.sqf index a7feade1c3..b47cf6628d 100644 --- a/addons/finger/XEH_preInit.sqf +++ b/addons/finger/XEH_preInit.sqf @@ -2,6 +2,8 @@ ADDON = false; +PREP_RECOMPILE_START; #include "XEH_PREP.hpp" +PREP_RECOMPILE_END; ADDON = true; diff --git a/addons/finger/functions/fnc_keyPress.sqf b/addons/finger/functions/fnc_keyPress.sqf index b9231fb17b..a9949f6ce3 100644 --- a/addons/finger/functions/fnc_keyPress.sqf +++ b/addons/finger/functions/fnc_keyPress.sqf @@ -18,7 +18,7 @@ if (!alive ACE_player) exitWith {false}; // Conditions: canInteract -if !([ACE_player, ACE_player, ["isNotInside"]] call EFUNC(common,canInteractWith)) exitWith {false}; +if !([ACE_player, ACE_player, ["isNotInside", "isNotSwimming"]] call EFUNC(common,canInteractWith)) exitWith {false}; //make sure player is dismounted or in a static weapon: if ((ACE_player != vehicle ACE_player) && {!((vehicle ACE_player) isKindOf "StaticWeapon")}) exitWith {false}; //Check camera view (not in GUNNER) @@ -60,6 +60,11 @@ TRACE_1("sending finger to",_sendFingerToPlayers); [QGVAR(fingered), [ACE_player, _fingerPosASL, _originASL vectorDistance _fingerPosASL], _sendFingerToPlayers] call CBA_fnc_targetEvent; -[ACE_player, "GestureGo"] call EFUNC(common,doGesture); +// BI gestures do not work underwater, play custom "point" gesture if loaded +if (["ace_gestures"] call EFUNC(common,isModLoaded)) then { + QEGVAR(gestures,point) call EFUNC(gestures,playSignal); // Works underwater +} else { + [ACE_player, "GestureGo"] call EFUNC(common,doGesture); // Does not work underwater +}; true diff --git a/addons/finger/functions/fnc_moduleSettings.sqf b/addons/finger/functions/fnc_moduleSettings.sqf index c5189f4562..4667e76c51 100644 --- a/addons/finger/functions/fnc_moduleSettings.sqf +++ b/addons/finger/functions/fnc_moduleSettings.sqf @@ -8,6 +8,9 @@ * Return Value: * None * + * Example: + * [logic] call ace_finger_fnc_moduleSettings + * * Public: No */ diff --git a/addons/finger/functions/fnc_perFrameEH.sqf b/addons/finger/functions/fnc_perFrameEH.sqf index 94ea4fe067..3c0d4a586f 100644 --- a/addons/finger/functions/fnc_perFrameEH.sqf +++ b/addons/finger/functions/fnc_perFrameEH.sqf @@ -17,13 +17,14 @@ if (!alive ACE_player) then {GVAR(fingersHash) = [] call CBA_fnc_hashCreate;}; // Conditions: canInteract -if !([ACE_player, ACE_player, ["isNotInside"]] call EFUNC(common,canInteractWith)) then {GVAR(fingersHash) = [] call CBA_fnc_hashCreate;}; +if !([ACE_player, ACE_player, ["isNotInside", "isNotSwimming"]] call EFUNC(common,canInteractWith)) then {GVAR(fingersHash) = [] call CBA_fnc_hashCreate;}; // Make sure player is dismounted or in a static weapon: if ((ACE_player != vehicle ACE_player) && {!((vehicle ACE_player) isKindOf "StaticWeapon")}) then {GVAR(fingersHash) = [] call CBA_fnc_hashCreate;}; private _iconSize = BASE_SIZE * 0.10713 * (call EFUNC(common,getZoom)); [+GVAR(fingersHash), { + //IGNORE_PRIVATE_WARNING ["_key", "_value"]; _value params ["_lastTime", "_pos", "_name"]; private _timeLeftToShow = _lastTime + FP_TIMEOUT - diag_tickTime; if (_timeLeftToShow <= 0) then { diff --git a/addons/finger/stringtable.xml b/addons/finger/stringtable.xml index 0516972647..1a2265694e 100644 --- a/addons/finger/stringtable.xml +++ b/addons/finger/stringtable.xml @@ -12,7 +12,10 @@ Mostrar el indicador de señalado a uno mismo Zobrazit ukázání směru pro sebe Mostra puntatore per te stesso - 自分にポインティング表記を表示する + 自分に指差し表記を表示する + 자신이 가리키는곳을 보여줍니다 + 显示指向指示器给自己 + 顯示指向指示器給自己 Render the indicator for the pointing player. This option doesn't affect whether the other players would see the indicator @@ -25,7 +28,10 @@ Muestra el indicador para el jugador que apunta. Esta opción no afecta si los otros jugadores verían el indicador Zobrazit infikátor, když ukážete prstem. Tato volba nemá vliv, zda ostatní hráči uvidí indikátor nebo ne. Mostra puntatore per il giocatore indicato. Questa opzione non influisce la possibilità che gli altri giocatori vedano il puntatore - プレイヤーへのポインティング表記を描画します。このオプションは他のプレイヤーの表記に影響しません。 + プレイヤーへの指差し表記を描画します。このオプションは他のプレイヤーの表記に影響しません。 + 대상이 가리키는곳을 보이게 합니다. + 显示指向指示器给玩家自己。此选项设定并不影响其他玩家能否看到指示器 + 顯示指向指示器給玩家自己。此選項設定並不影響其他玩家能否看到指示器 Pointing indicator @@ -38,7 +44,10 @@ Indicador de señalado Ukazování směru Indicatore di puntamento - ポインティング表記 + 指差し表記 + 가리키기 표시기 + 指向指示器 + 指向指示器 Color of the pointing indicator circle @@ -51,7 +60,10 @@ Color del círculo indicador que señala Barva kruhu pro ukázání směru Colore del cerchio dell'indicatore di puntamento - ポインティング表記の円の色 + 指差し表記の円の色 + 가리키기의 원형 색상 + 指向指示器颜色 + 指向指示器顏色 Action "point a finger at" @@ -64,7 +76,10 @@ Acción "apuntar con el dedo a" Akce "ukázat prstem na" Azione "punta il dito a" - "point a finger at"キー + "指差し"キー + "손가락으로 가리키기"행동 + 使"手指指向在" + 使"手指指向在" Points, and shows a virtual marker of where you are looking to nearby units. Can be held down. @@ -77,7 +92,10 @@ Señala y muestra un marcador virtual donde ustás apuntando para las unidades cercanas. Puede ser mantenido. Ukazuje virtuální značku kruhu ve směru, kterým se díváte pro všechny blízké jednotky. Punta e mostra un marker virtuale di dove stai guardando alle unità vicine. Può essere tenuto premuto. - ポイント、そして架空のマーカー表記は自ユニットの近くにいると表記されます。これは押しっぱなしにできます。 + 指差しが出すマーカー表記は自ユニットの近くにいると表記されます。これは押しっぱなしにできます。 + 당신이 보는것을 가상의 마커로 표시함으로서 다른 인원이 볼 수 있게 합니다. 누른채로 유지할 수 있습니다. + 当按下此按键后,你附近的单位即可看见一个虚拟图示,标明你正在指向的位置。此按键可以被按住来持续显示。 + 當按下此按鍵後,你附近的單位即可看見一個虛擬圖示,標明你正在指向的位置。此按鍵可以被按住來持續顯示。 Pointing Settings @@ -90,7 +108,10 @@ Ajustes de señalado Nastavení ukázování směru Impostazioni puntamento - ポインティング設定 + 指差し設定 + 가리키기 설정 + 指向设定 + 指向設定 Pointing Enabled @@ -103,7 +124,10 @@ Señalado habilitado Ukazování povoleno Puntamento abilitato - ポインティングを有効 + 指差しを有効 + 가리키기 활성화 + 指向系统启动 + 指向系統啟動 Pointing Max Range @@ -116,7 +140,10 @@ Distancia máxima de señalado Maximální dosah pro ukazování směru Raggio massimo puntamento - ポインティングの最大範囲 + 指差しの最大範囲 + 가리키기 최대 범위 + 指向指示器最大显示距离 + 指向指示器最大顯示距離 Max range between players to show the pointing indicator [default: 4 meters] @@ -129,7 +156,10 @@ Distancia máxima entre los jugadores para mostrar el indicador que señala [por defecto: 4 metros] Maximální vzdálenost mezi hráči pro ukázání směru [výchozí: 4 metry] Distanza massima tra giocatori per mostrare l'indicatore di puntamento [default: 4 metri] - ポインティング表記が他のプレイヤーに表示される範囲を決定できます。(標準 4 メートル) + 指差し表記が他のプレイヤーに表示される範囲を決定できます。(標準 4 メートル) + 플레이어 사이에서 가리키기 표시를 보이게 하는 최대거리를 설정합니다[기본설정: 4 미터] + 设定指向指示器最大显示距离。[预设: 4公尺] + 設定指向指示器最大顯示距離。[預設: 4公尺] - \ No newline at end of file + diff --git a/addons/flashlights/CfgWeapons.hpp b/addons/flashlights/CfgWeapons.hpp index a708e1eb74..e1a325595b 100644 --- a/addons/flashlights/CfgWeapons.hpp +++ b/addons/flashlights/CfgWeapons.hpp @@ -1,7 +1,7 @@ class CfgWeapons { class ACE_ItemCore; - class InventoryItem_Base_F; + class CBA_MiscItem_ItemInfo; class ACE_Flashlight_MX991: ACE_ItemCore { displayName = CSTRING(MX991_DisplayName); @@ -9,7 +9,7 @@ class CfgWeapons { model = QPATHTOF(data\MX_991.p3d); picture = QPATHTOF(UI\mx991_ca.paa); scope = 2; - class ItemInfo: InventoryItem_Base_F { + class ItemInfo: CBA_MiscItem_ItemInfo { mass = 1; class FlashLight { ACE_Flashlight_Colour = "red"; @@ -26,7 +26,7 @@ class CfgWeapons { model = QPATHTOF(data\KSF_1.p3d); picture = QPATHTOF(UI\ksf1_ca.paa); scope = 2; - class ItemInfo: InventoryItem_Base_F { + class ItemInfo: CBA_MiscItem_ItemInfo { mass = 1; class FlashLight { ACE_Flashlight_Colour = "red"; @@ -43,7 +43,7 @@ class CfgWeapons { model = QPATHTOF(data\Maglight.p3d); picture = QPATHTOF(UI\xl50_ca.paa); scope = 2; - class ItemInfo: InventoryItem_Base_F { + class ItemInfo: CBA_MiscItem_ItemInfo { mass = 1; class FlashLight { ACE_Flashlight_Colour = "white"; @@ -53,4 +53,4 @@ class CfgWeapons { }; }; }; -}; \ No newline at end of file +}; diff --git a/addons/flashlights/stringtable.xml b/addons/flashlights/stringtable.xml index 250c0038bd..08e291a2b6 100644 --- a/addons/flashlights/stringtable.xml +++ b/addons/flashlights/stringtable.xml @@ -11,7 +11,10 @@ Fulton MX-991 Fulton MX-991 Fulton MX-991 - Fulton MX-991 + フルトン MX-991 + Fulton MX-991 + Fulton MX-991 + Fulton MX-991 Flashlight with red filter. For use on map. @@ -24,6 +27,9 @@ Torcia con filtro rosso. Da usare in mappa. Lampe torche avec un filtre rouge. Pour utilisation sur carte. 赤色フィルタ付きのフラッシュライト。地図上でつかいます。 + 빨간색 필터가 달린 손전등입니다. 지도를 비출때 씁니다. + 拥有红色滤光片的手电筒。用来照亮地图。 + 擁有紅色濾光片的手電筒。用來照亮地圖。 Maglite XL50 @@ -35,7 +41,10 @@ Maglite XL50 Maglite XL50 Maglite XL50 - Maglite XL50 + マグライト XL50 + Maglite XL50 + Maglite XL50 + Maglite XL50 White mini flashlight. For use on map. @@ -48,6 +57,9 @@ Mini-torcia bianca. Da usare in mappa. Mini lampe torche blanche. Pour utilisation sur carte. 白色光の小さなフラッシュライト。地図上でつかいます。 + 하얀색 조그마한 손전등. 지도를 비출때 씁니다. + 白色的迷你手电筒。用来照亮地图。 + 白色的迷你手電筒。用來照亮地圖。 KSF-1 @@ -60,10 +72,13 @@ KSF-1 KSF-1 KSF-1 + KSF-1 + KSF-1 + KSF-1 Flashlight with red filter. For use on map. - Tachenlampe mit rotem Filter zum Kartenlesen. + Taschenlampe mit rotem Filter zum Kartenlesen. Latarka z czerwonym filtrem. Używana do podświetlania mapy. Lanterna com filtro vermelho. Para uso no mapa. Фонарь с красным светофильтром. Для использования на карте. @@ -72,6 +87,9 @@ Torcia con filtro rosso. Da usare in mappa. Lampe torche avec un filtre rouge. Pour utilisation sur carte. 赤色フィルタ付きのフラッシュライト。地図上でつかいます。 + 빨간색 필터가 달린 손전등입니다. 지도를 비출때 씁니다. + 拥有红色滤光片的手电筒。用来照亮地图。 + 擁有紅色濾光片的手電筒。用來照亮地圖。 - \ No newline at end of file + diff --git a/addons/flashsuppressors/stringtable.xml b/addons/flashsuppressors/stringtable.xml index e5bed3a248..52563ea1c4 100644 --- a/addons/flashsuppressors/stringtable.xml +++ b/addons/flashsuppressors/stringtable.xml @@ -1,4 +1,4 @@ - + @@ -13,6 +13,9 @@ Пламегаситель (6,5 мм) Bocacha (6,5 mm) 消炎器 (6.5 mm) + 소염기 (6.5 mm) + 消光器 (6.5 mm) + 消光器 (6.5 mm) Flash Suppressor (7.62 mm) @@ -26,6 +29,9 @@ Пламегаситель (7,62 мм) Bocacha (7,62 mm) 消炎器 (7.62 mm) + 소염기 (7.62 mm) + 消光器 (7.62 mm) + 消光器 (7.62 mm) Flash Suppressor (5.56 mm) @@ -39,6 +45,9 @@ Пламегаситель (5,56 мм) Bocacha (5,56 mm) 消炎器 (5.56 mm) + 소염기 (5.56 mm) + 消光器 (5.56 mm) + 消光器 (5.56 mm) Flash Suppressor (.45 ACP) @@ -52,6 +61,9 @@ Пламегаситель (.45 ACP) Bocacha (.45 ACP) 消炎器 (.45 ACP) + 소염기 (.45 ACP) + 消光器 (.45 ACP) + 消光器 (.45 ACP) Flash Suppressor (9 mm) @@ -65,6 +77,9 @@ Пламегаситель (9 мм) Bocacha (9 mm) 消炎器 (9 mm) + 소염기 (9 mm) + 消光器 (9 mm) + 消光器 (9 mm) Flash Suppressor (.338) @@ -78,6 +93,9 @@ Пламегаситель (.338) Bocacha (.338) 消炎器 (.338) + 소염기 (.338) + 消光器 (.338) + 消光器 (.338) Flash Suppressor (9.3 mm) @@ -91,6 +109,9 @@ Пламегаситель (9,3 мм) Bocacha (9,3 mm) 消炎器 (9.3 mm) + 소염기 (9.3 mm) + 消光器 (9.3 mm) + 消光器 (9.3 mm) - \ No newline at end of file + diff --git a/addons/fonts/CfgFontFamilies.hpp b/addons/fonts/CfgFontFamilies.hpp index 80c8114624..9ec341c83d 100644 --- a/addons/fonts/CfgFontFamilies.hpp +++ b/addons/fonts/CfgFontFamilies.hpp @@ -1,7 +1,5 @@ -class CfgFontFamilies -{ - class PixelSplitterBold - { +class CfgFontFamilies { + class PixelSplitterBold { fonts[] = { QPATHTOF(PixelSplitterBold\PixelSplitterBold6), QPATHTOF(PixelSplitterBold\PixelSplitterBold7), QPATHTOF(PixelSplitterBold\PixelSplitterBold8), diff --git a/addons/frag/$PBOPREFIX$ b/addons/frag/$PBOPREFIX$ index ddf45c738b..bc4c9e8dc9 100644 --- a/addons/frag/$PBOPREFIX$ +++ b/addons/frag/$PBOPREFIX$ @@ -1 +1 @@ -z\ace\addons\frag \ No newline at end of file +z\ace\addons\frag diff --git a/addons/frag/ACE_Settings.hpp b/addons/frag/ACE_Settings.hpp index 4dfa172bb3..63a3d564d2 100644 --- a/addons/frag/ACE_Settings.hpp +++ b/addons/frag/ACE_Settings.hpp @@ -25,21 +25,13 @@ class ACE_Settings { displayName = CSTRING(MaxTrack); description = CSTRING(MaxTrack_Desc); typeName = "SCALAR"; - value = 500; + value = 10; }; class GVAR(maxTrackPerFrame) { category = CSTRING(Module_DisplayName); displayName = CSTRING(MaxTrackPerFrame); description = CSTRING(MaxTrackPerFrame_Desc); typeName = "SCALAR"; - value = 50; - }; - - class GVAR(enableDebugTrace) { - category = CSTRING(Module_DisplayName); - displayName = CSTRING(EnableDebugTrace); - description = CSTRING(EnableDebugTrace_Desc); - typeName = "BOOL"; - value = 0; + value = 10; }; }; diff --git a/addons/frag/CfgAmmo.hpp b/addons/frag/CfgAmmo.hpp index 3da01ac29b..bff5a49ffa 100644 --- a/addons/frag/CfgAmmo.hpp +++ b/addons/frag/CfgAmmo.hpp @@ -1,16 +1,31 @@ -#define BASE_DRAG -0.01 -#define HD_MULT 5 -#define BASE_DRAG_HD (BASE_DRAG*HD_MULT) +#define BASE_DRAG -0.01 +#define HD_MULT 5 +#define BASE_DRAG_HD (BASE_DRAG * HD_MULT) class CfgAmmo { - //class ace_arty_105mm_m1_m782_time; - //class ace_arty_105mm_m1_m782_prox: ace_arty_105mm_m1_m782_time {}; - //class ace_arty_105mm_m1_m782_delay: ace_arty_105mm_m1_m782_prox { - // GVAR(skip) = 1; - //}; - class Bo_GBU12_LGB; - class ACE_GBU12 : Bo_GBU12_LGB { + // ~~~~ Bombs: + class LaserBombCore; + class Bo_GBU12_LGB: LaserBombCore { + GVAR(enabled) = 1; + + GVAR(classes)[] = {QGVAR(large), QGVAR(large), QGVAR(large_HD), QGVAR(large), QGVAR(huge), QGVAR(huge_HD), QGVAR(huge)}; + GVAR(metal) = 140000; + GVAR(charge) = 87000; + GVAR(gurney_c) = 2320; + GVAR(gurney_k) = 1/2; + }; + class Bomb_04_F: LaserBombCore { + GVAR(enabled) = 1; + + GVAR(classes)[] = {QGVAR(large), QGVAR(large), QGVAR(large_HD), QGVAR(large), QGVAR(huge), QGVAR(huge_HD), QGVAR(huge)}; + GVAR(metal) = 140000; + GVAR(charge) = 87000; + GVAR(gurney_c) = 2320; + GVAR(gurney_k) = 1/2; + }; + class BombCore; + class Bo_Mk82: BombCore { GVAR(enabled) = 1; GVAR(classes)[] = {QGVAR(large), QGVAR(large), QGVAR(large_HD), QGVAR(large), QGVAR(huge), QGVAR(huge_HD), QGVAR(huge)}; @@ -18,11 +33,9 @@ class CfgAmmo { GVAR(charge) = 87000; GVAR(gurney_c) = 2320; GVAR(gurney_k) = 1/2; - sideAirFriction = 0.04; - airFriction = 0.04; - laserLock = 0; }; + // ~~~~ Grenades: class GrenadeBase; class Grenade; class GrenadeHand: Grenade { @@ -47,41 +60,6 @@ class CfgAmmo { class SmokeShell: GrenadeHand { GVAR(skip) = 1; }; - - class RocketBase; - class R_Hydra_HE: RocketBase { - // Source: http://fas.org/man/dod-101/sys/missile/hydra-70.htm - GVAR(enabled) = 1; - - GVAR(classes)[] = {QGVAR(medium), QGVAR(medium_HD)}; - GVAR(metal) = 3850; - GVAR(charge) = 1040; - GVAR(gurney_c) = 2700; - GVAR(gurney_k) = 1/2; - }; - //class R_57mm_HE: RocketBase { - // GVAR(skip) = 1; - //}; - - class R_80mm_HE: RocketBase { - GVAR(skip) = 1; - }; - - //class R_S8T_AT: RocketBase { - // GVAR(skip) = 1; - //}; - - class BombCore; - class Bo_Mk82: BombCore { - GVAR(enabled) = 1; - - GVAR(classes)[] = {QGVAR(large), QGVAR(large), QGVAR(large_HD), QGVAR(large), QGVAR(huge), QGVAR(huge_HD), QGVAR(huge)}; - GVAR(metal) = 140000; - GVAR(charge) = 87000; - GVAR(gurney_c) = 2320; - GVAR(gurney_k) = 1/2; - }; - class G_40mm_HE: GrenadeBase { // Source: http://www.inetres.com/gp/military/infantry/grenade/40mm_ammo.html#M441 GVAR(enabled) = 1; @@ -104,10 +82,8 @@ class CfgAmmo { GVAR(gurney_k) = 1/2; }; - class ACE_G_40mm_HEDP: G_40mm_HEDP { - }; - class ACE_G_40mm_HE: G_40mm_HE { - }; + class ACE_G_40mm_HEDP: G_40mm_HEDP {}; + class ACE_G_40mm_HE: G_40mm_HE {}; class ACE_G_40mm_Practice: ACE_G_40mm_HE { GVAR(skip) = 1; GVAR(force) = 0; @@ -117,6 +93,94 @@ class CfgAmmo { GVAR(force) = 1; }; + + // ~~~~ RPGs: + class MissileBase; + class R_PG32V_F; + class R_TBG32V_F: R_PG32V_F { // HE + GVAR(enabled) = 1; + GVAR(metal) = 400; + GVAR(charge) = 210; + GVAR(gurney_c) = 2800; + GVAR(gurney_k) = "3/5"; + GVAR(classes)[] = {"ACE_frag_medium_HD"}; + }; + class M_Titan_AA: MissileBase { + GVAR(skip) = 1; + }; + class M_Titan_AT: MissileBase { + GVAR(skip) = 1; + }; + class M_Titan_AP: M_Titan_AT { // "anti personnel" + GVAR(skip) = 0; + GVAR(enabled) = 1; + GVAR(metal) = 400; + GVAR(charge) = 210; + GVAR(gurney_c) = 2800; + GVAR(gurney_k) = "3/5"; + GVAR(classes)[] = {"ACE_frag_medium_HD"}; + }; + + + // ~~~~ Missiles: + class M_PG_AT; + class M_AT: M_PG_AT { // DAR (Hydra 70) + // Source: http://fas.org/man/dod-101/sys/missile/hydra-70.htm + GVAR(enabled) = 1; + + GVAR(classes)[] = {QGVAR(medium), QGVAR(medium_HD)}; + GVAR(metal) = 3850; + GVAR(charge) = 1040; + GVAR(gurney_c) = 2700; + GVAR(gurney_k) = 1/2; + }; + class ACE_Hellfire_AGM114K: M_PG_AT { + // Source: http://www.designation-systems.net/dusrm/m-114.html + GVAR(enabled) = 1; + + GVAR(classes)[] = {QGVAR(medium), QGVAR(medium_HD)}; + GVAR(metal) = 8000; + GVAR(charge) = 2400; + GVAR(gurney_c) = 2700; + GVAR(gurney_k) = 1/2; + }; + class RocketBase; + class R_80mm_HE: RocketBase { + GVAR(skip) = 1; + }; + class Missile_AGM_02_F: MissileBase { + // Source: http://fas.org/man/dod-101/sys/smart/agm-65.htm + GVAR(enabled) = 1; + + GVAR(classes)[] = {QGVAR(medium), QGVAR(medium_HD)}; + GVAR(metal) = 56250; + GVAR(charge) = 39000; + GVAR(gurney_c) = 2700; + GVAR(gurney_k) = 1/2; + }; + class Rocket_04_HE_F: MissileBase { // Shrieker (Hydra 70) + GVAR(enabled) = 1; + GVAR(classes)[] = {QGVAR(medium), QGVAR(medium_HD)}; + GVAR(metal) = 3850; + GVAR(charge) = 1040; + GVAR(gurney_c) = 2700; + GVAR(gurney_k) = 1/2; + }; + class M_Scalpel_AT: MissileBase { // 9K121 Vikhr + GVAR(enabled) = 1; + GVAR(classes)[] = {QGVAR(medium), QGVAR(medium_HD)}; + GVAR(metal) = 10000; + GVAR(charge) = 3000; + GVAR(gurney_c) = 2700; + GVAR(gurney_k) = 1/2; + }; + class M_Air_AA: MissileBase { + GVAR(skip) = 1; + }; + class Missile_AA_04_F: MissileBase { + GVAR(skip) = 1; + }; + // curator ammo entries class ShellBase; class Sh_125mm_HEAT; @@ -130,7 +194,7 @@ class CfgAmmo { GVAR(gurney_c) = 2440; GVAR(gurney_k) = 1/2; }; - class Sh_82mm_AMOS : Sh_155mm_AMOS { + class Sh_82mm_AMOS: Sh_155mm_AMOS { // Source: http://www.arsenal-bg.com/defense_police/mortar_bombs_82mm.htm GVAR(enabled) = 1; @@ -149,7 +213,7 @@ class CfgAmmo { GVAR(gurney_c) = 2320; GVAR(gurney_k) = 1/2; }; - class Sh_105mm_HEAT_MP : Sh_125mm_HEAT { + class Sh_105mm_HEAT_MP: Sh_125mm_HEAT { GVAR(enabled) = 1; GVAR(classes)[] = {QGVAR(medium), QGVAR(medium_HD)}; @@ -158,7 +222,7 @@ class CfgAmmo { GVAR(gurney_c) = 2800; GVAR(gurney_k) = 1/2; }; - class Sh_120mm_HE : ShellBase { + class Sh_120mm_HE: ShellBase { GVAR(enabled) = 1; GVAR(classes)[] = {QGVAR(medium), QGVAR(medium_HD)}; @@ -186,200 +250,6 @@ class CfgAmmo { GVAR(gurney_k) = 1/2; }; - //class R_230mm_HE; - //class ModuleOrdnanceRocket_F_ammo: R_230mm_HE { - //}; - - //class R_230mm_fly; - //class ModuleOrdnanceRocket_F_subammo: R_230mm_fly { - //}; - // end of curator ammo entries - - //class R_SMAW_HEDP; - //class R_MEEWS_HEDP : R_SMAW_HEDP { - // GVAR(force) = 1; - // GVAR(multiplier) = 1.2; - //}; - - class MissileBase; - class Missile_AGM_02_F : MissileBase { - // Source: http://fas.org/man/dod-101/sys/smart/agm-65.htm - GVAR(enabled) = 1; - - GVAR(classes)[] = {QGVAR(medium), QGVAR(medium_HD)}; - GVAR(metal) = 56250; - GVAR(charge) = 39000; - GVAR(gurney_c) = 2700; - GVAR(gurney_k) = 1/2; - }; - class M_Hellfire_AT: MissileBase { - // Source: http://www.designation-systems.net/dusrm/m-114.html - GVAR(enabled) = 1; - - GVAR(classes)[] = {QGVAR(medium), QGVAR(medium_HD)}; - GVAR(metal) = 8000; - GVAR(charge) = 2400; - GVAR(gurney_c) = 2700; - GVAR(gurney_k) = 1/2; - }; - - /* - class B_762x51_Ball; - class GVAR(base): B_762x51_Ball { ////TODO: B_762x45_Ball no longer exists, is this a valid replacement? - model = "\A3\Weapons_f\ammo\shell"; - timeToLive = 12; - typicalSpeed = 800; - // Fix sounds - effectFly = "AmmoClassic"; - soundDefault1[] = {"A3\sounds_f\weapons\hits\concrete_1.wav",0.158114,1,30}; - soundDefault2[] = {"A3\sounds_f\weapons\hits\concrete_2.wav",0.158114,1,30}; - soundDefault3[] = {"A3\sounds_f\weapons\hits\concrete_3.wav",0.158114,1,30}; - soundDefault4[] = {"A3\sounds_f\weapons\hits\concrete_4.wav",0.158114,1,30}; - soundDefault5[] = {"A3\sounds_f\weapons\hits\concrete_5.wav",0.158114,1,30}; - soundDefault6[] = {"A3\sounds_f\weapons\hits\concrete_6.wav",0.158114,1,30}; - soundDefault7[] = {"A3\sounds_f\weapons\hits\concrete_7.wav",0.158114,1,30}; - soundDefault8[] = {"A3\sounds_f\weapons\hits\concrete_8.wav",0.158114,1,30}; - soundGroundSoft1[] = {"A3\sounds_f\weapons\hits\soft_ground_1.wav",0.02811705,1,30}; - soundGroundSoft2[] = {"A3\sounds_f\weapons\hits\soft_ground_2.wav",0.02811705,1,30}; - soundGroundSoft3[] = {"A3\sounds_f\weapons\hits\soft_ground_3.wav",0.02811705,1,30}; - soundGroundSoft4[] = {"A3\sounds_f\weapons\hits\soft_ground_4.wav",0.02811705,1,30}; - soundGroundSoft5[] = {"A3\sounds_f\weapons\hits\soft_ground_5.wav",0.02811705,1,30}; - soundGroundSoft6[] = {"A3\sounds_f\weapons\hits\soft_ground_6.wav",0.02811705,1,30}; - soundGroundSoft7[] = {"A3\sounds_f\weapons\hits\soft_ground_7.wav",0.02811705,1,30}; - soundGroundSoft8[] = {"A3\sounds_f\weapons\hits\soft_ground_8.wav",0.02811705,1,30}; - soundGroundHard1[] = {"A3\sounds_f\weapons\hits\hard_ground_1.wav",0.62946,1,40}; - soundGroundHard2[] = {"A3\sounds_f\weapons\hits\hard_ground_2.wav",0.62946,1,40}; - soundGroundHard3[] = {"A3\sounds_f\weapons\hits\hard_ground_3.wav",0.62946,1,40}; - soundGroundHard4[] = {"A3\sounds_f\weapons\hits\hard_ground_4.wav",0.62946,1,40}; - soundGroundHard5[] = {"A3\sounds_f\weapons\hits\hard_ground_5.wav",0.62946,1,40}; - soundGroundHard6[] = {"A3\sounds_f\weapons\hits\hard_ground_6.wav",0.62946,1,40}; - soundGroundHard7[] = {"A3\sounds_f\weapons\hits\hard_ground_7.wav",0.62946,1,40}; - soundGroundHard8[] = {"A3\sounds_f\weapons\hits\hard_ground_8.wav",0.62946,1,40}; - soundMetal1[] = {"A3\sounds_f\weapons\hits\metal_1.wav",0.158114,1,45}; - soundMetal2[] = {"A3\sounds_f\weapons\hits\metal_2.wav",0.158114,1,45}; - soundMetal3[] = {"A3\sounds_f\weapons\hits\metal_3.wav",0.158114,1,45}; - soundMetal4[] = {"A3\sounds_f\weapons\hits\metal_4.wav",0.158114,1,45}; - soundMetal5[] = {"A3\sounds_f\weapons\hits\metal_5.wav",0.158114,1,45}; - soundMetal6[] = {"A3\sounds_f\weapons\hits\metal_6.wav",0.158114,1,45}; - soundMetal7[] = {"A3\sounds_f\weapons\hits\metal_7.wav",0.158114,1,45}; - soundMetal8[] = {"A3\sounds_f\weapons\hits\metal_8.wav",0.158114,1,45}; - soundGlass1[] = {"A3\sounds_f\weapons\hits\glass_1.wav",0.177828,1,25}; - soundGlass2[] = {"A3\sounds_f\weapons\hits\glass_2.wav",0.177828,1,25}; - soundGlass3[] = {"A3\sounds_f\weapons\hits\glass_3.wav",0.177828,1,25}; - soundGlass4[] = {"A3\sounds_f\weapons\hits\glass_4.wav",0.177828,1,25}; - soundGlass5[] = {"A3\sounds_f\weapons\hits\glass_5.wav",0.177828,1,25}; - soundGlass6[] = {"A3\sounds_f\weapons\hits\glass_6.wav",0.177828,1,25}; - soundGlass7[] = {"A3\sounds_f\weapons\hits\glass_7.wav",0.177828,1,25}; - soundGlass8[] = {"A3\sounds_f\weapons\hits\glass_8.wav",0.177828,1,25}; - soundGlassArmored1[] = {"A3\sounds_f\weapons\hits\glass_arm_1.wav",0.177828,1,30}; - soundGlassArmored2[] = {"A3\sounds_f\weapons\hits\glass_arm_2.wav",0.177828,1,30}; - soundGlassArmored3[] = {"A3\sounds_f\weapons\hits\glass_arm_3.wav",0.177828,1,30}; - soundGlassArmored4[] = {"A3\sounds_f\weapons\hits\glass_arm_4.wav",0.177828,1,30}; - soundGlassArmored5[] = {"A3\sounds_f\weapons\hits\glass_arm_5.wav",0.177828,1,30}; - soundGlassArmored6[] = {"A3\sounds_f\weapons\hits\glass_arm_6.wav",0.177828,1,30}; - soundGlassArmored7[] = {"A3\sounds_f\weapons\hits\glass_arm_7.wav",0.177828,1,30}; - soundGlassArmored8[] = {"A3\sounds_f\weapons\hits\glass_arm_8.wav",0.177828,1,30}; - soundVehiclePlate1[] = {"A3\sounds_f\weapons\hits\metal_plate_1.wav",0.281170,1,40}; - soundVehiclePlate2[] = {"A3\sounds_f\weapons\hits\metal_plate_2.wav",0.281170,1,40}; - soundVehiclePlate3[] = {"A3\sounds_f\weapons\hits\metal_plate_3.wav",0.281170,1,40}; - soundVehiclePlate4[] = {"A3\sounds_f\weapons\hits\metal_plate_4.wav",0.281170,1,40}; - soundVehiclePlate5[] = {"A3\sounds_f\weapons\hits\metal_plate_5.wav",0.281170,1,40}; - soundVehiclePlate6[] = {"A3\sounds_f\weapons\hits\metal_plate_6.wav",0.281170,1,40}; - soundVehiclePlate7[] = {"A3\sounds_f\weapons\hits\metal_plate_7.wav",0.281170,1,40}; - soundVehiclePlate8[] = {"A3\sounds_f\weapons\hits\metal_plate_8.wav",0.281170,1,40}; - soundWood1[] = {"A3\sounds_f\weapons\hits\wood_1.wav",0.158114,1,30}; - soundWood2[] = {"A3\sounds_f\weapons\hits\wood_2.wav",0.158114,1,30}; - soundWood3[] = {"A3\sounds_f\weapons\hits\wood_3.wav",0.158114,1,30}; - soundWood4[] = {"A3\sounds_f\weapons\hits\wood_4.wav",0.158114,1,30}; - soundWood5[] = {"A3\sounds_f\weapons\hits\wood_5.wav",0.158114,1,30}; - soundWood6[] = {"A3\sounds_f\weapons\hits\wood_6.wav",0.158114,1,30}; - soundWood7[] = {"A3\sounds_f\weapons\hits\wood_7.wav",0.158114,1,30}; - soundWood8[] = {"A3\sounds_f\weapons\hits\wood_8.wav",0.158114,1,30}; - soundHitBody1[] = {"A3\sounds_f\weapons\hits\body_1.wav",0.0177828,1,25}; - soundHitBody2[] = {"A3\sounds_f\weapons\hits\body_2.wav",0.0177828,1,25}; - soundHitBody3[] = {"A3\sounds_f\weapons\hits\body_3.wav",0.0177828,1,25}; - soundHitBody4[] = {"A3\sounds_f\weapons\hits\body_4.wav",0.0177828,1,25}; - soundHitBody5[] = {"A3\sounds_f\weapons\hits\body_5.wav",0.0177828,1,25}; - soundHitBody6[] = {"A3\sounds_f\weapons\hits\body_6.wav",0.0177828,1,25}; - soundHitBody7[] = {"A3\sounds_f\weapons\hits\body_7.wav",0.0177828,1,25}; - soundHitBody8[] = {"A3\sounds_f\weapons\hits\body_8.wav",0.0177828,1,25}; - soundHitBuilding1[] = {"A3\sounds_f\weapons\hits\building_1.wav",0.251189,1,30}; - soundHitBuilding2[] = {"A3\sounds_f\weapons\hits\building_2.wav",0.251189,1,30}; - soundHitBuilding3[] = {"A3\sounds_f\weapons\hits\building_3.wav",0.251189,1,30}; - soundHitBuilding4[] = {"A3\sounds_f\weapons\hits\building_4.wav",0.251189,1,30}; - soundHitBuilding5[] = {"A3\sounds_f\weapons\hits\building_5.wav",0.251189,1,30}; - soundHitBuilding6[] = {"A3\sounds_f\weapons\hits\building_6.wav",0.251189,1,30}; - soundHitBuilding7[] = {"A3\sounds_f\weapons\hits\building_7.wav",0.251189,1,30}; - soundHitBuilding8[] = {"A3\sounds_f\weapons\hits\building_8.wav",0.251189,1,30}; - soundHitFoliage1[] = {"A3\sounds_f\weapons\hits\foliage_1.wav",0.177828,1,25}; - soundHitFoliage2[] = {"A3\sounds_f\weapons\hits\foliage_2.wav",0.177828,1,25}; - soundHitFoliage3[] = {"A3\sounds_f\weapons\hits\foliage_3.wav",0.177828,1,25}; - soundHitFoliage4[] = {"A3\sounds_f\weapons\hits\foliage_4.wav",0.177828,1,25}; - soundHitFoliage5[] = {"A3\sounds_f\weapons\hits\foliage_5.wav",0.177828,1,25}; - soundHitFoliage6[] = {"A3\sounds_f\weapons\hits\foliage_6.wav",0.177828,1,25}; - soundHitFoliage7[] = {"A3\sounds_f\weapons\hits\foliage_7.wav",0.177828,1,25}; - soundHitFoliage8[] = {"A3\sounds_f\weapons\hits\foliage_8.wav",0.177828,1,25}; - soundPlastic1[] = {"A3\sounds_f\weapons\hits\plastic_1.wav",0.177828,1,25}; - soundPlastic2[] = {"A3\sounds_f\weapons\hits\plastic_2.wav",0.177828,1,25}; - soundPlastic3[] = {"A3\sounds_f\weapons\hits\plastic_3.wav",0.177828,1,25}; - soundPlastic4[] = {"A3\sounds_f\weapons\hits\plastic_4.wav",0.177828,1,25}; - soundPlastic5[] = {"A3\sounds_f\weapons\hits\plastic_5.wav",0.177828,1,25}; - soundPlastic6[] = {"A3\sounds_f\weapons\hits\plastic_6.wav",0.177828,1,25}; - soundPlastic7[] = {"A3\sounds_f\weapons\hits\plastic_7.wav",0.177828,1,25}; - soundPlastic8[] = {"A3\sounds_f\weapons\hits\plastic_8.wav",0.177828,1,25}; - soundConcrete1[] = {"A3\sounds_f\weapons\hits\concrete_1.wav",0.177828,1,35}; - soundConcrete2[] = {"A3\sounds_f\weapons\hits\concrete_2.wav",0.177828,1,35}; - soundConcrete3[] = {"A3\sounds_f\weapons\hits\concrete_3.wav",0.177828,1,35}; - soundConcrete4[] = {"A3\sounds_f\weapons\hits\concrete_4.wav",0.177828,1,35}; - soundConcrete5[] = {"A3\sounds_f\weapons\hits\concrete_5.wav",0.177828,1,35}; - soundConcrete6[] = {"A3\sounds_f\weapons\hits\concrete_6.wav",0.177828,1,35}; - soundConcrete7[] = {"A3\sounds_f\weapons\hits\concrete_7.wav",0.177828,1,35}; - soundConcrete8[] = {"A3\sounds_f\weapons\hits\concrete_8.wav",0.177828,1,35}; - soundRubber1[] = {"A3\sounds_f\weapons\hits\tyre_1.wav",0.158114,1,25}; - soundRubber2[] = {"A3\sounds_f\weapons\hits\tyre_2.wav",0.158114,1,25}; - soundRubber3[] = {"A3\sounds_f\weapons\hits\tyre_3.wav",0.158114,1,25}; - soundRubber4[] = {"A3\sounds_f\weapons\hits\tyre_4.wav",0.158114,1,25}; - soundRubber5[] = {"A3\sounds_f\weapons\hits\tyre_5.wav",0.158114,1,25}; - soundRubber6[] = {"A3\sounds_f\weapons\hits\tyre_6.wav",0.158114,1,25}; - soundRubber7[] = {"A3\sounds_f\weapons\hits\tyre_7.wav",0.158114,1,25}; - soundRubber8[] = {"A3\sounds_f\weapons\hits\tyre_8.wav",0.158114,1,25}; - soundWater1[] = {"A3\sounds_f\weapons\hits\water_01.wav",0.158114,1,25}; - soundWater2[] = {"A3\sounds_f\weapons\hits\water_02.wav",0.158114,1,25}; - soundWater3[] = {"A3\sounds_f\weapons\hits\water_03.wav",0.158114,1,25}; - soundWater4[] = {"A3\sounds_f\weapons\hits\water_04.wav",0.158114,1,25}; - soundWater5[] = {"A3\sounds_f\weapons\hits\water_05.wav",0.158114,1,25}; - soundWater6[] = {"A3\sounds_f\weapons\hits\water_06.wav",0.158114,1,25}; - soundWater7[] = {"A3\sounds_f\weapons\hits\water_07.wav",0.158114,1,25}; - soundWater8[] = {"A3\sounds_f\weapons\hits\water_08.wav",0.158114,1,25}; - hitGroundSoft[] = {"soundGroundSoft1",0.2,"soundGroundSoft2",0.2,"soundGroundSoft3",0.1,"soundGroundSoft4",0.1,"soundGroundSoft5",0.1,"soundGroundSoft6",0.1,"soundGroundSoft7",0.1,"soundGroundSoft8",0.1}; - hitGroundHard[] = {"soundGroundHard1",0.2,"soundGroundHard2",0.2,"soundGroundHard3",0.1,"soundGroundHard4",0.1,"soundGroundHard5",0.1,"soundGroundHard6",0.1,"soundGroundHard7",0.1,"soundGroundHard8",0.1}; - hitMan[] = {"soundHitBody1",0.125,"soundHitBody2",0.125,"soundHitBody3",0.125,"soundHitBody4",0.125,"soundHitBody5",0.125,"soundHitBody6",0.125,"soundHitBody7",0.125,"soundHitBody8",0.125}; - hitArmor[] = {"soundVehiclePlate1",0.125,"soundVehiclePlate2",0.125,"soundVehiclePlate3",0.125,"soundVehiclePlate4",0.125,"soundVehiclePlate5",0.125,"soundVehiclePlate6",0.125,"soundVehiclePlate7",0.125,"soundVehiclePlate8",0.125}; - hitBuilding[] = {"soundHitBuilding1",0.2,"soundHitBuilding2",0.2,"soundHitBuilding3",0.1,"soundHitBuilding4",0.1,"soundHitBuilding5",0.1,"soundHitBuilding6",0.1,"soundHitBuilding7",0.1,"soundHitBuilding8",0.1}; - hitFoliage[] = {"soundHitFoliage1",0.125,"soundHitFoliage2",0.125,"soundHitFoliage3",0.125,"soundHitFoliage4",0.125,"soundHitFoliage5",0.125,"soundHitFoliage6",0.125,"soundHitFoliage7",0.125,"soundHitFoliage8",0.125}; - hitWood[] = {"soundWood1",0.125,"soundWood2",0.125,"soundWood3",0.125,"soundWood4",0.125,"soundWood5",0.125,"soundWood6",0.125,"soundWood7",0.125,"soundWood8",0.125}; - hitGlass[] = {"soundGlass1",0.125,"soundGlass2",0.125,"soundGlass3",0.125,"soundGlass4",0.125,"soundGlass5",0.125,"soundGlass6",0.125,"soundGlass7",0.125,"soundGlass8",0.125}; - hitGlassArmored[] = {"soundGlassArmored1",0.125,"soundGlassArmored2",0.125,"soundGlassArmored3",0.125,"soundGlassArmored4",0.125,"soundGlassArmored5",0.125,"soundGlassArmored6",0.125,"soundGlassArmored7",0.125,"soundGlassArmored8",0.125}; - hitConcrete[] = {"soundConcrete1",0.125,"soundConcrete2",0.125,"soundConcrete3",0.125,"soundConcrete4",0.125,"soundConcrete5",0.125,"soundConcrete6",0.125,"soundConcrete7",0.125,"soundConcrete8",0.125}; - hitRubber[] = {"soundRubber1",0.125,"soundRubber2",0.125,"soundRubber3",0.125,"soundRubber4",0.125,"soundRubber5",0.125,"soundRubber6",0.125,"soundRubber7",0.125,"soundRubber8",0.125}; - hitPlastic[] = {"soundPlastic1",0.125,"soundPlastic2",0.125,"soundPlastic3",0.125,"soundPlastic4",0.125,"soundPlastic5",0.125,"soundPlastic6",0.125,"soundPlastic7",0.125,"soundPlastic8",0.125}; - hitDefault[] = {"soundDefault1",0.2,"soundDefault2",0.2,"soundDefault3",0.1,"soundDefault4",0.1,"soundDefault5",0.1,"soundDefault6",0.1,"soundDefault7",0.1,"soundDefault8",0.1}; - hitMetal[] = {"soundMetal1",0.125,"soundMetal2",0.125,"soundMetal3",0.125,"soundMetal4",0.125,"soundMetal5",0.125,"soundMetal6",0.125,"soundMetal7",0.125,"soundMetal8",0.125}; - hitMetalplate[] = {"soundVehiclePlate1",0.125,"soundVehiclePlate2",0.125,"soundVehiclePlate3",0.125,"soundVehiclePlate4",0.125,"soundVehiclePlate5",0.125,"soundVehiclePlate6",0.125,"soundVehiclePlate7",0.125,"soundVehiclePlate8",0.125}; - hitWater[] = {"soundWater1",0.125,"soundWater2",0.125,"soundWater3",0.125,"soundWater4",0.125,"soundWater5",0.125,"soundWater6",0.125,"soundWater7",0.125,"soundWater8",0.125}; - bulletFly1[] = {"A3\sounds_f\weapons\hits\bullet_by_1.wav",1,1,35}; - bulletFly2[] = {"A3\sounds_f\weapons\hits\bullet_by_2.wav",1,1,35}; - bulletFly3[] = {"A3\sounds_f\weapons\hits\bullet_by_3.wav",1,1,35}; - bulletFly4[] = {"A3\sounds_f\weapons\hits\bullet_by_4.wav",1,1,35}; - bulletFly5[] = {"A3\sounds_f\weapons\hits\bullet_by_5.wav",1,1,35}; - bulletFly6[] = {"A3\sounds_f\weapons\hits\bullet_by_6.wav",1,1,35}; - bulletFly7[] = {"A3\sounds_f\weapons\hits\bullet_by_7.wav",1,1,35}; - bulletFly8[] = {"A3\sounds_f\weapons\hits\bullet_by_8.wav",1,1,35}; - bulletFly[] = {"bulletFly1",0.166,"bulletFly2",0.166,"bulletFly3",0.166,"bulletFly4",0.166,"bulletFly5",0.166,"bulletFly6",0.167,"bulletFly7",0.166,"bulletFly8",0.167}; - supersonicCrackNear[] = {"A3\sounds_f\weapons\hits\sscrack1.wav",1,1,35}; - supersonicCrackFar[] = {"A3\sounds_f\weapons\hits\sscrack2.wav",1,1,135}; - }; - */ class B_65x39_Caseless; class GVAR(base): B_65x39_Caseless { @@ -438,8 +308,6 @@ class CfgAmmo { indirectHitRange = 0.25; airFriction = BASE_DRAG_HD*0.65; caliber = 2; - - }; class GVAR(huge): GVAR(large) { diff --git a/addons/frag/CfgAmmoReflections.hpp b/addons/frag/CfgAmmoReflections.hpp index fdaac6dd90..513b58d544 100644 --- a/addons/frag/CfgAmmoReflections.hpp +++ b/addons/frag/CfgAmmoReflections.hpp @@ -1,5 +1,3 @@ -//CfgAmmoReflections.hpp - #define ACE_EXPLOSION_REFLECTION(range, hit)\ class ace_explosion_reflection_##range##_##hit : ace_explosion_reflection_base {\ indirectHitRange = range;\ diff --git a/addons/frag/CfgEventhandlers.hpp b/addons/frag/CfgEventhandlers.hpp index becf395052..0d3301d6e0 100644 --- a/addons/frag/CfgEventhandlers.hpp +++ b/addons/frag/CfgEventhandlers.hpp @@ -1,4 +1,3 @@ - class Extended_PreStart_EventHandlers { class ADDON { init = QUOTE(call COMPILE_FILE(XEH_preStart)); diff --git a/addons/frag/XEH_PREP.hpp b/addons/frag/XEH_PREP.hpp index 2fed1630f2..a7fb8ff8c3 100644 --- a/addons/frag/XEH_PREP.hpp +++ b/addons/frag/XEH_PREP.hpp @@ -7,22 +7,19 @@ PREP(spallTrack); // * Other */ PREP(addBlackList); -PREP(addTrack); -PREP(drawTraces); -PREP(removeTrack); +PREP(dev_addTrack); +PREP(dev_drawTraces); PREP(spallHP); -PREP(startTracing); -PREP(stopTracing); -PREP(trackTrace); +PREP(dev_startTracing); +PREP(dev_stopTracing); +PREP(dev_trackTrace); // New tracking mechanisms PREP(masterPFH); PREP(pfhRound); PREP(addPfhRound); -PREP(removePfhRound); // THIS SHOULD ABE USED SPARINGLY // Explosive Reflection -GVAR(replacedBisArtyWrapper) = true; PREP(findReflections); PREP(doExplosions); PREP(doReflections); diff --git a/addons/frag/XEH_postInit.sqf b/addons/frag/XEH_postInit.sqf index feb4be05b6..4126ca328c 100644 --- a/addons/frag/XEH_postInit.sqf +++ b/addons/frag/XEH_postInit.sqf @@ -1,28 +1,32 @@ #include "script_component.hpp" -if(GVAR(EnableDebugTrace) && !isMultiplayer) then { - GVAR(traceFrags) = true; - GVAR(autoTrace) = true; -}; - -if(isServer) then { - [QGVAR(frag_eh), { _this call FUNC(frago); }] call CBA_fnc_addEventHandler; +if (isServer) then { + GVAR(lastFragTime) = -1; + [QGVAR(frag_eh), {_this call FUNC(frago);}] call CBA_fnc_addEventHandler; }; ["ace_settingsInitialized", { - //If not enabled, exit if (!GVAR(enabled)) exitWith {}; // Register fire event handler - ["ace_firedPlayer", DFUNC(fired)] call CBA_fnc_addEventHandler; - ["ace_firedNonPlayer", DFUNC(fired)] call CBA_fnc_addEventHandler; - ["ace_firedPlayerVehicle", DFUNC(fired)] call CBA_fnc_addEventHandler; - ["ace_firedNonPlayerVehicle", DFUNC(fired)] call CBA_fnc_addEventHandler; - - [FUNC(masterPFH), 0, []] call CBA_fnc_addPerFrameHandler; + ["ace_firedPlayer", LINKFUNC(fired)] call CBA_fnc_addEventHandler; + ["ace_firedNonPlayer", LINKFUNC(fired)] call CBA_fnc_addEventHandler; + ["ace_firedPlayerVehicle", LINKFUNC(fired)] call CBA_fnc_addEventHandler; + ["ace_firedNonPlayerVehicle", LINKFUNC(fired)] call CBA_fnc_addEventHandler; + addMissionEventHandler ["EachFrame", {call FUNC(masterPFH)}]; }] call CBA_fnc_addEventHandler; -//Cache for ammo type configs -GVAR(cacheRoundsTypesToTrack) = createLocation ["ACE_HashLocation", [-10000,-10000,-10000], 0, 0]; -GVAR(cacheRoundsTypesToTrack) setText QGVAR(cacheRoundsTypesToTrack); +// Cache for ammo type configs +GVAR(cacheRoundsTypesToTrack) = [false] call CBA_fnc_createNamespace; + + +// Debug stuff: + +#ifdef DRAW_FRAG_INFO +[] call FUNC(dev_startTracing); +#endif + +#ifdef DEBUG_MODE_FULL +[true, true, 30] call FUNC(dev_debugAmmo); +#endif diff --git a/addons/frag/XEH_preInit.sqf b/addons/frag/XEH_preInit.sqf index 9c03491a4e..7cbd6092a1 100644 --- a/addons/frag/XEH_preInit.sqf +++ b/addons/frag/XEH_preInit.sqf @@ -2,24 +2,22 @@ ADDON = false; +PREP_RECOMPILE_START; #include "XEH_PREP.hpp" +PREP_RECOMPILE_END; GVAR(blackList) = []; GVAR(traceFrags) = false; -GVAR(TOTALFRAGS) = 0; - GVAR(spallHPData) = []; GVAR(spallIsTrackingCount) = 0; -GVAR(autoTrace) = false; GVAR(traceID) = -1; GVAR(traces) = []; GVAR(tracesStarted) = false; GVAR(lastIterationIndex) = 0; GVAR(objects) = []; -GVAR(objectTypes) = []; GVAR(arguments) = []; ADDON = true; diff --git a/addons/frag/config.cpp b/addons/frag/config.cpp index 7ac109d29f..f3b409dbd0 100644 --- a/addons/frag/config.cpp +++ b/addons/frag/config.cpp @@ -1,4 +1,5 @@ #include "script_component.hpp" + class CfgPatches { class ADDON { name = COMPONENT_NAME; diff --git a/addons/frag/functions/fnc_addBlackList.sqf b/addons/frag/functions/fnc_addBlackList.sqf index 1a7d7cb253..cfa96c9784 100644 --- a/addons/frag/functions/fnc_addBlackList.sqf +++ b/addons/frag/functions/fnc_addBlackList.sqf @@ -1,3 +1,21 @@ +/* + * Author: Jaynus, NouberNou + * Adds a round to the blacklist (will be ignored). + * + * Arguments: + * 0: Projectile + * + * Return Value: + * None + * + * Example: + * [bullet] call ace_frag_fnc_addBlackList + * + * Public: No + */ #include "script_component.hpp" + params ["_round"]; -GVAR(blackList) set [(count GVAR(blackList)), _round]; +TRACE_1("addBlackList",_round); + +GVAR(blackList) pushBack _round; diff --git a/addons/frag/functions/fnc_addPfhRound.sqf b/addons/frag/functions/fnc_addPfhRound.sqf index f0047bb24d..f97d868b9d 100644 --- a/addons/frag/functions/fnc_addPfhRound.sqf +++ b/addons/frag/functions/fnc_addPfhRound.sqf @@ -1,74 +1,78 @@ +/* + * Author: Jaynus, NouberNou + * Starts tracking a round that will frag. + * Should only be called once per round. + * + * Arguments: + * 0: Shooter + * 1: Ammo classname + * 2: Projectile + * + * Return Value: + * None + * + * Example: + * [player, "handGrenade", bullet] call ace_frag_fnc_addPfhRound + * + * Public: No + */ //#define DEBUG_MODE_FULL #include "script_component.hpp" -private ["_enabled", "_doSpall", "_spallTrack", "_spallTrackID"]; -PARAMS_3(_gun,_type,_round); -DEFAULT_PARAM(3,_doFragTrack,false); +params ["_gun", "_type", "_round"]; +TRACE_3("addPfhRound",_gun,_type,_round); -if (!GVAR(enabled)) exitWith {}; +if (!GVAR(enabled)) exitWith {TRACE_1("setting disabled",_this);}; -//_enabled = getNumber (configFile >> "CfgAmmo" >> _type >> QGVAR(enabled)); -//if(_enabled < 1) exitWith {}; +if (!alive _round) exitWith {TRACE_1("round dead?",_this);}; -if(_round in GVAR(blackList)) exitWith { - GVAR(blackList) = GVAR(blackList) - [_round]; +if (_round in GVAR(blackList)) exitWith { + TRACE_1("round in blackList",_this); + REM(GVAR(blackList),_round); }; // Exit on max track -if( (count GVAR(objects)) > GVAR(MaxTrack)) exitWith { }; +if ((count GVAR(objects)) >= GVAR(maxTrack)) exitWith {TRACE_1("maxTrack limit",count GVAR(objects));}; -if(_gun == ACE_player) then { - _doFragTrack = true; -} else { - if((gunner _gun) == ACE_player) then { - _doFragTrack = true; - } else { - if(local _gun && {!(isPlayer (gunner _gun))} && {!(isPlayer _gun)}) then { - _doFragTrack = true; - }; - }; -}; - -_doSpall = false; -if(GVAR(SpallEnabled)) then { - if(GVAR(spallIsTrackingCount) <= 0) then { +private _doSpall = false; +if (GVAR(SpallEnabled)) then { + if (GVAR(spallIsTrackingCount) <= 0) then { GVAR(spallHPData) = []; }; - if(GVAR(spallIsTrackingCount) > 5) then { - // ACE_player sideChat "LIMT!"; + if (GVAR(spallIsTrackingCount) > 5) then { + TRACE_1("At Spall Limit",GVAR(spallIsTrackingCount)); } else { _doSpall = true; - GVAR(spallIsTrackingCount) = GVAR(spallIsTrackingCount) + 1; + INC(GVAR(spallIsTrackingCount)); }; + TRACE_2("",_doSpall,GVAR(spallIsTrackingCount)); }; -// ACE_player sideChat format["c: %1", GVAR(spallIsTrackingCount)]; -if(GVAR(autoTrace)) then { - [ACE_player, _round, [1,0,0,1]] call FUNC(addTrack); -}; +#ifdef DRAW_FRAG_INFO +[ACE_player, _round, [0, 1, 0, 1]] call FUNC(dev_addTrack); +#endif // We only do the single track object check here. // We should do an {!(_round in GVAR(objects))} // But we leave that out here for optimization. So this cannot be a framework function // Otherwise, it should only be added once and from the FiredEH -if(_doFragTrack && {alive _round}) then { - _spallTrack = []; - _spallTrackID = []; +if (alive _round) then { + private _spallTrack = []; + private _spallTrackID = []; - private ["_args"]; - _args = [_round, (getPosASL _round), (velocity _round), _type, diag_frameno, _gun, _doSpall, _spallTrack, _spallTrackID, - (getNumber (configFile >> "CfgAmmo" >> _type >> QGVAR(skip))), - (getNumber (configFile >> "CfgAmmo" >> _type >> "explosive")), - (getNumber (configFile >> "CfgAmmo" >> _type >> "indirectHitRange")), - (getNumber (configFile >> "CfgAmmo" >> _type >> QGVAR(force))), - (getNumber(configFile >> "CfgAmmo" >> _type >> "indirecthit")*(sqrt((getNumber (configFile >> "CfgAmmo" >> _type >> "indirectHitRange"))))) + private _args = [ + _round, getPosASL _round, velocity _round, _type, diag_frameno, _gun, _doSpall, _spallTrack, _spallTrackID, + getNumber (configFile >> "CfgAmmo" >> _type >> QGVAR(skip)), + getNumber (configFile >> "CfgAmmo" >> _type >> "explosive"), + getNumber (configFile >> "CfgAmmo" >> _type >> "indirectHitRange"), + getNumber (configFile >> "CfgAmmo" >> _type >> QGVAR(force)), + getNumber (configFile >> "CfgAmmo" >> _type >> "indirecthit") * (sqrt (getNumber (configFile >> "CfgAmmo" >> _type >> "indirectHitRange"))) ]; TRACE_1("Initializing track", _round); GVAR(objects) pushBack _round; GVAR(arguments) pushBack _args; - if(_doSpall) then { + if (_doSpall) then { [_round, 1, _spallTrack, _spallTrackID] call FUNC(spallTrack); }; - // ACE_player sideChat "WTF2"; }; diff --git a/addons/frag/functions/fnc_addTrack.sqf b/addons/frag/functions/fnc_addTrack.sqf deleted file mode 100644 index 4270e15996..0000000000 --- a/addons/frag/functions/fnc_addTrack.sqf +++ /dev/null @@ -1,20 +0,0 @@ -#include "script_component.hpp" - -if (GVAR(autoTrace)) then { - [] call FUNC(startTracing); -}; - -// setAccTime 0.05; -private _index = count GVAR(traces); -params ["_origin", "_obj"]; -private _color = [1,0,0,1]; -if((count _this) > 2) then { - _color = _this select 2; -}; -private _positions = []; -private _objSpd = vectorMagnitude (velocity _obj); -_positions set[(count _positions), [(getPos _obj), _objSpd]]; -private _data = [_origin, typeOf _origin, typeOf _obj, _objSpd, _positions, _color]; - -GVAR(traces) set[_index, _data]; -[DFUNC(trackTrace), 0, [_obj, _index, CBA_missionTime]] call CBA_fnc_addPerFrameHandler; diff --git a/addons/frag/functions/fnc_dev_addTrack.sqf b/addons/frag/functions/fnc_dev_addTrack.sqf new file mode 100644 index 0000000000..fd180eacfe --- /dev/null +++ b/addons/frag/functions/fnc_dev_addTrack.sqf @@ -0,0 +1,27 @@ +/* + * Author: ACE-Team + * + * + * Arguments: + * None + * + * Return Value: + * None + * + * Example: + * call ace_frag_fnc_addTack + * + * Public: No + */ + +#include "script_component.hpp" + +params ["_origin", "_obj", ["_color", [1, 0, 0, 1]]]; + +private _positions = []; +private _objSpd = vectorMagnitude (velocity _obj); +_positions pushBack [getPos _obj, _objSpd]; +private _data = [_origin, typeOf _origin, typeOf _obj, _objSpd, _positions, _color]; + +private _index = GVAR(traces) pushBack _data; +[DFUNC(dev_trackTrace), 0, [_obj, _index, CBA_missionTime]] call CBA_fnc_addPerFrameHandler; diff --git a/addons/frag/functions/fnc_dev_debugAmmo.sqf b/addons/frag/functions/fnc_dev_debugAmmo.sqf index 297113f5af..8eec5f04f5 100644 --- a/addons/frag/functions/fnc_dev_debugAmmo.sqf +++ b/addons/frag/functions/fnc_dev_debugAmmo.sqf @@ -1,7 +1,27 @@ +/* + * Author: ACE-Team + * + * + * Arguments: + * None + * + * Return Value: + * None + * + * Example: + * call ace_frag_fnc_debugAmmo + * + * Public: No + */ + #define DEBUG_MODE_FULL #include "script_component.hpp" -params [["_debugMissing", true, [false]], ["_debugForce", false, [false]], ["_debugNonFrag", false, [false]]]; +params [ + ["_debugMissing", true, [false]], + ["_debugForce", false, [false]], + ["_debugSkippedFragPower", 30, [0]] +]; diag_log text format ["~~~~~~~~~~~~~Start [%1]~~~~~~~~~~~~~", _this]; @@ -10,7 +30,7 @@ private _processedCfgAmmos = []; { private _ammo = toLower getText (_x >> "ammo"); - if ((_ammo != "") && {!(_ammo in _processedCfgAmmos)}) then { + if (_ammo != "" && {!(_ammo in _processedCfgAmmos)}) then { _processedCfgAmmos pushBack _ammo; //Ignore mines/bombs @@ -23,37 +43,37 @@ private _processedCfgAmmos = []; private _explosive = getNumber (_ammoConfig >> "explosive"); private _indirectRange = getNumber (_ammoConfig >> "indirectHitRange"); private _force = getNumber (_ammoConfig >> QGVAR(force)); - private _fragPower = getNumber(_ammoConfig >> "indirecthit")*(sqrt((getNumber (_ammoConfig >> "indirectHitRange")))); + private _fragPower = getNumber (_ammoConfig >> "indirecthit") * (sqrt ((getNumber (_ammoConfig >> "indirectHitRange")))); private _shouldAdd = (_skip == 0) && {(_force == 1) || {_explosive > 0.5 && {_indirectRange >= 4.5} && {_fragPower >= 35}}}; if (_shouldAdd) then { if (_debugForce && {((getNumber(_ammoConfig >> "hit")) < 5) || {_fragPower < 10}}) then { - diag_log text format ["Ammo [%1] from Mag [%2] - Weak but will still frag!",_ammo,configName _x]; - diag_log text format [" - _force=%1,_fragPower=%2",_force,_fragPower]; + diag_log text format ["Ammo [%1] from Mag [%2] - Weak but will still frag!", _ammo, configName _x]; + diag_log text format [" - _force=%1,_fragPower=%2", _force, _fragPower]; }; - - _warn = false; + + private _warn = false; _fragTypes = getArray (_ammoConfig >> QGVAR(CLASSES)); - if(_fragTypes isEqualTo []) then {_warn = true;}; + if (_fragTypes isEqualTo []) then {_warn = true;}; _c = getNumber(_ammoConfig >> QGVAR(CHARGE)); - if(_c == 0) then {_warn = true;}; + if (_c == 0) then {_warn = true;}; _m = getNumber(_ammoConfig >> QGVAR(METAL)); - if(_m == 0) then {_warn = true;}; + if (_m == 0) then {_warn = true;}; _k = getNumber(_ammoConfig >> QGVAR(GURNEY_K)); - if(_k == 0) then {_warn = true;}; + if (_k == 0) then {_warn = true;}; _gC = getNumber(_ammoConfig >> QGVAR(GURNEY_C)); - if(_gC == 0) then { _warn = true;}; + if (_gC == 0) then {_warn = true;}; - if(_debugMissing && _warn) then { - diag_log text format ["Ammo [%1] from Mag [%2] MISSING frag configs:",_ammo,configName _x]; - diag_log text format [" - _c=%1,_m=%2,_k=%3,_gC=%4,_fragTypes=%5",_c,_m,_k,_gC,_fragTypes]; + if (_debugMissing && {_warn}) then { + diag_log text format ["Ammo [%1] from Mag [%2] MISSING frag configs:", _ammo, configName _x]; + diag_log text format [" - _c=%1,_m=%2,_k=%3,_gC=%4,_fragTypes=%5", _c, _m, _k, _gC, _fragTypes]; }; } else { - if (_debugNonFrag && {isArray (_ammoConfig >> QGVAR(CLASSES))}) then { - diag_log text format ["Ammo [%1] from Mag [%2] has frag configs but will NOT frag:",_ammo,configName _x]; - diag_log text format ["- skip=%1,explosive=%2,indirectHitRange=%3,force=%4,fragPower=%5",_skip,_explosive,_indirectRange,_force,_fragPower]; + if ((_fragPower > _debugSkippedFragPower) && {isArray (_ammoConfig >> QGVAR(CLASSES))}) then { + diag_log text format ["Ammo [%1] from Mag [%2] has frag configs but will NOT frag:", _ammo, configName _x]; + diag_log text format ["- skip=%1,explosive=%2,indirectHitRange=%3,force=%4,fragPower=%5", _skip, _explosive, _indirectRange, _force, _fragPower]; }; }; }; diff --git a/addons/frag/functions/fnc_dev_drawTraces.sqf b/addons/frag/functions/fnc_dev_drawTraces.sqf new file mode 100644 index 0000000000..f7d36b4f02 --- /dev/null +++ b/addons/frag/functions/fnc_dev_drawTraces.sqf @@ -0,0 +1,38 @@ +/* + * Author: ACE-Team + * + * + * Arguments: + * None + * + * Return Value: + * None + * + * Example: + * call ace_frag_fnc_drawTraces + * + * Public: No + */ + +#include "script_component.hpp" + +{ + _x params ["", "", "", "", "_positions", "_color"]; + private _index = 0; + private _max = count _positions; + // private _lastSpd = []; + private _lastPos = []; + while {_index < _max} do { + _data1 = _positions select _index; + _data2 = _positions select ([_index + ACE_TRACE_DRAW_INC, _max - 1] select (_index + ACE_TRACE_DRAW_INC >= _max)); + + _pos1 = _data1 select 0; + _pos2 = _data2 select 0; + ADD(_index,ACE_TRACE_DRAW_INC); + + drawLine3D [_pos1, _pos2, _color]; + _lastPos = _pos2; + // _lastSpd = _data1 select 1; + }; + // drawIcon3D ["", [1,0,0,1], _lastPos, 0, 0, 0, format ["%1m/s", _lastSpd], 1, 0.05, "RobotoCondensed"]; +} forEach GVAR(traces); diff --git a/addons/frag/functions/fnc_dev_startTracing.sqf b/addons/frag/functions/fnc_dev_startTracing.sqf new file mode 100644 index 0000000000..e58445ec83 --- /dev/null +++ b/addons/frag/functions/fnc_dev_startTracing.sqf @@ -0,0 +1,24 @@ +/* + * Author: ACE-Team + * + * + * Arguments: + * None + * + * Return Value: + * None + * + * Example: + * call ace_frag_fnc_dev_startTracing + * + * Public: No + */ + +#include "script_component.hpp" + +if (GVAR(tracesStarted)) exitWith {}; + +INFO("Starting Trace Drawing"); + +GVAR(tracesStarted) = true; +GVAR(traceID) = [LINKFUNC(dev_drawTraces), 0, []] call CBA_fnc_addPerFrameHandler; diff --git a/addons/frag/functions/fnc_dev_stopTracing.sqf b/addons/frag/functions/fnc_dev_stopTracing.sqf new file mode 100644 index 0000000000..f3b8fa234b --- /dev/null +++ b/addons/frag/functions/fnc_dev_stopTracing.sqf @@ -0,0 +1,23 @@ +/* + * Author: ACE-Team + * Dev things + * + * Arguments: + * None + * + * Return Value: + * None + * + * Example: + * + * Public: No + */ + +#include "script_component.hpp" + +if (!GVAR(tracesStarted)) exitWith {}; + +INFO("Ending Trace Drawing"); + +GVAR(tracesStarted) = false; +[GVAR(traceID)] call CBA_fnc_removePerFrameHandler; diff --git a/addons/frag/functions/fnc_dev_trackTrace.sqf b/addons/frag/functions/fnc_dev_trackTrace.sqf new file mode 100644 index 0000000000..b71f1982ff --- /dev/null +++ b/addons/frag/functions/fnc_dev_trackTrace.sqf @@ -0,0 +1,28 @@ +/* + * Author: ACE-Team + * Dev things + * + * Arguments: + * None + * + * Return Value: + * None + * + * Example: + * call ace_frag_fnc_dev_trackTrace + * + * Public: No + */ + +#include "script_component.hpp" + +params ["_args", "_pfhID"]; +_args params ["_tracerObj", "_index"]; + +if (alive _tracerObj && {!(GVAR(traces) isEqualTo [])}) then { + private _data = GVAR(traces) select _index; + private _positions = _data select 4; + _positions pushBack [getPos _tracerObj, vectorMagnitude (velocity _tracerObj)]; +} else { + [_pfhID] call CBA_fnc_removePerFrameHandler; +}; diff --git a/addons/frag/functions/fnc_doExplosions.sqf b/addons/frag/functions/fnc_doExplosions.sqf index 03ad4d1dec..25302cca7c 100644 --- a/addons/frag/functions/fnc_doExplosions.sqf +++ b/addons/frag/functions/fnc_doExplosions.sqf @@ -1,20 +1,38 @@ +/* + * Author: ACE-Team + * + * + * Arguments: + * None + * + * Return Value: + * None + * + * Example: + * call ace_frag_fnc_doExplosions + * + * Public: No + */ + //fnc_doExplosions.sqf #include "script_component.hpp" -params ["_args"]; +params ["_args", "_pfhID"]; _args params ["_explosions", "_index"]; -for "_i" from _index to ((_index+2) min (count _explosions)) do { +for "_i" from _index to ((_index + 2) min (count _explosions)) do { private _exp = _explosions select _i; _exp params ["_refExp", "_bpos", "_hit", "_distance", "_indirectHitRange", "_depth"]; _refExp createVehicle (ASLtoATL _bpos); - // if(_hit >= 150 && _distance > _indirectHitRange) then { + // if (_hit >= 150 && _distance > _indirectHitRange) then { // [_bpos, _refExp, _depth] call FUNC(doReflections); // }; }; -_index = _index + 2; -if(_index >= (count _explosions)) then { - [(_this select 1)] call CBA_fnc_removePerFrameHandler; + +ADD(_index,2); + +if (_index >= count _explosions) then { + [_pfhID] call CBA_fnc_removePerFrameHandler; } else { - _params set[1, _index]; + _args set [1, _index]; }; diff --git a/addons/frag/functions/fnc_doReflections.sqf b/addons/frag/functions/fnc_doReflections.sqf index de5bac1b62..622c4c57f4 100644 --- a/addons/frag/functions/fnc_doReflections.sqf +++ b/addons/frag/functions/fnc_doReflections.sqf @@ -1,14 +1,26 @@ +/* + * Author: ACE-Team + * Dev things + * + * Arguments: + * None + * + * Return Value: + * None + * + * Example: + * call ace_frag_fnc_doReflections + * + * Public: No + */ + //fnc_doReflections.sqf #include "script_component.hpp" -params ["_pos", "_ammo"]; +params ["_pos", "_ammo", ["_depth", 1]]; -private _depth = 1; -if(count _this > 2) then { - _depth = _this select 2; -}; -// TEST_ICONS pushBack [_pos, format["EXP!", _hit, _range, _hitFactor]]; -if(_depth <= 2) then { +// TEST_ICONS pushBack [_pos, format ["EXP!", _hit, _range, _hitFactor]]; +if (_depth <= 2) then { private _indirectHitRange = getNumber(configFile >> "CfgAmmo" >> _ammo >> "indirectHitRange"); private _indirectHit = getNumber(configFile >> "CfgAmmo" >> _ammo >> "indirectHit"); private _testParams = [_pos, [_indirectHitRange, _indirectHit], [], [], -4, _depth, 0]; diff --git a/addons/frag/functions/fnc_doSpall.sqf b/addons/frag/functions/fnc_doSpall.sqf index 2eb118004b..dcc1759648 100644 --- a/addons/frag/functions/fnc_doSpall.sqf +++ b/addons/frag/functions/fnc_doSpall.sqf @@ -1,146 +1,144 @@ +/* + * Author: ACE-Team + * Dev things + * + * Arguments: + * None + * + * Return Value: + * None + * + * Example: + * call ace_frag_fnc_doSpall + * + * Public: No + */ + //fnc_doSpall.sqf #include "script_component.hpp" // ACE_player sideChat "WAAAAAAAAAAAAAAAAAAAAA"; -params ["_hitData"]; +params ["_hitData", "_hitPartDataIndex"]; private _initialData = GVAR(spallHPData) select (_hitData select 0); -private _hpData = (_hitData select 1) select (_this select 1); +_initialData params ["_hpId", "_object", "_roundType", "_round", "_curPos", "_velocity"]; -_hpData params ["_object"]; -_object removeEventHandler ["hitPart", _initialData select 0]; -private _foundObjects = _initialData select 7; -private _index = _foundObjects find _object; -if(_index != -1) then { - _foundObjects set[_index, nil]; -}; +private _hpData = (_hitData select 1) select _hitPartDataIndex; +(_hpData select 0) removeEventHandler ["hitPart", _hpId]; -_initialData params ["", "_object", "_roundType", "_round"]; +private _caliber = getNumber (configFile >> "CfgAmmo" >> _roundType >> "caliber"); +private _explosive = getNumber (configFile >> "CfgAmmo" >> _roundType >> "explosive"); +private _idh = getNumber (configFile >> "CfgAmmo" >> _roundType >> "indirectHitRange"); -private _caliber = getNumber(configFile >> "CfgAmmo" >> _roundType >> "caliber"); -private _explosive = getNumber(configFile >> "CfgAmmo" >> _roundType >> "explosive"); -private _idh = getNumber(configFile >> "CfgAmmo" >> _roundType >> "indirectHitRange"); +if !(_caliber >= 2.5 || {(_explosive > 0 && {_idh >= 1})}) exitWith {}; +// ACE_player sideChat format ["BBBB"]; +private _exit = false; +private _vm = 1; -private _alive = true; -if(!alive _round && (_initialData select 6) isEqualTo 1) then { - _alive = false; -}; +private _oldVelocity = vectorMagnitude _velocity; +private _curVelocity = vectorMagnitude (velocity _round); -if(_alive || {_caliber >= 2.5} || {(_explosive > 0 && {_idh >= 1})}) then { - // ACE_player sideChat format["BBBB"]; - private _exit = false; - private _vm = 1; - private _velocity = _initialData select 5; - - private _oldVelocity = vectorMagnitude _velocity; - private _curVelocity = vectorMagnitude (velocity _round); - - if(alive _round) then { - private _diff = _velocity vectorDiff (velocity _round); - private _polar = _diff call CBA_fnc_vect2polar; - // ACE_player sideChat format["polar: %1", _polar]; - if((abs(_polar select 1) > 45 || abs(_polar select 2) > 45)) then { - if(_caliber < 2.5) then { - // ACE_player sideChat format["exit!"]; - _exit = true; - } else { - _vm = 1-(_curVelocity/_oldVelocity); - }; - }; - }; - if(!_exit) then { - private _unitDir = vectorNormalized _velocity; - private _pos = _hpData select 3; - private _spallPos = nil; - for "_i" from 0 to 100 do { - private _pos1 = _pos vectorAdd (_unitDir vectorMultiply (0.01 * _i)); - private _pos2 = _pos vectorAdd (_unitDir vectorMultiply (0.01 * (_i + 1))); - // _blah = [_object, "FIRE"] intersect [_object worldToModel (ASLtoATL _pos1), _object worldToModel (ASLtoATL _pos2)]; - // diag_log text format["b: %1", _blah]; - - // _data = [nil, nil, nil, 1, [[ASLtoATL _pos1, 1], [ASLtoATL _pos2, 1]]]; - // NOU_TRACES set[(count NOU_TRACES), _data]; - - if(!lineIntersects [_pos1, _pos2]) exitWith { - // ACE_player sideChat format["FOUND!"]; - _spallPos = _pos2; - }; - }; - if(!isNil "_spallPos") then { - private _spallPolar = _velocity call CBA_fnc_vect2polar; - - if(_explosive > 0) then { - // ACE_player sideChat format["EXPLOSIVE!"]; - private _warn = false; - private _c = getNumber(configFile >> "CfgAmmo" >> _roundType >> QGVAR(CHARGE)); - if(_c == 0) then { _c = 1; _warn = true;}; - private _m = getNumber(configFile >> "CfgAmmo" >> _roundType >> QGVAR(METAL)); - if(_m == 0) then { _m = 2; _warn = true;}; - private _k = getNumber(configFile >> "CfgAmmo" >> _roundType >> QGVAR(GURNEY_K)); - if(_k == 0) then { _k = 1/2; _warn = true;}; - private _gC = getNumber(configFile >> "CfgAmmo" >> _roundType >> QGVAR(GURNEY_C)); - if(_gC == 0) then { _gC = 2440; _warn = true;}; - - if(_warn) then { - WARNING_1("Ammo class %1 lacks proper explosive properties definitions for frag!",_roundType); //TODO: turn this off when we get closer to release - }; - - private _fragPower = (((_m/_c)+_k)^-(1/2))*_gC; - _spallPolar set[0, _fragPower*0.66]; - }; - - private _fragTypes = [ - QGVAR(spall_small), QGVAR(spall_small), QGVAR(spall_small), - QGVAR(spall_small),QGVAR(spall_medium),QGVAR(spall_medium),QGVAR(spall_medium), - QGVAR(spall_medium), QGVAR(spall_large), QGVAR(spall_large), QGVAR(spall_huge), - QGVAR(spall_huge) - - ]; - - // diag_log text format["SPALL POWER: %1", _spallPolar select 0]; - private _spread = 15+(random 25); - private _spallCount = 5+(random 10); - for "_i" from 1 to _spallCount do { - private _elev = ((_spallPolar select 2)-_spread)+(random (_spread*2)); - private _dir = ((_spallPolar select 1)-_spread)+(random (_spread*2)); - if(abs _elev > 90) then { - _dir = _dir + 180; - }; - _dir = _dir % 360; - private _vel = (_spallPolar select 0)*0.33*_vm; - _vel = (_vel-(_vel*0.25))+(random (_vel*0.5)); - - private _spallFragVect = [_vel, _dir, _elev] call CBA_fnc_polar2vect; - private _fragType = round (random ((count _fragTypes)-1)); - private _fragment = (_fragTypes select _fragType) createVehicleLocal [0,0,10000]; - _fragment setPosASL _spallPos; - _fragment setVelocity _spallFragVect; - - if(GVAR(traceFrags)) then { - [ACE_player, _fragment, [1,0.5,0,1]] call FUNC(addTrack); - }; - }; - _spread = 5+(random 5); - _spallCount = 3+(random 5); - for "_i" from 1 to _spallCount do { - private _elev = ((_spallPolar select 2)-_spread)+(random (_spread*2)); - private _dir = ((_spallPolar select 1)-_spread)+(random (_spread*2)); - if(abs _elev > 90) then { - _dir = _dir + 180; - }; - _dir = _dir % 360; - private _vel = (_spallPolar select 0)*0.55*_vm; - _vel = (_vel-(_vel*0.25))+(random (_vel*0.5)); - - private _spallFragVect = [_vel, _dir, _elev] call CBA_fnc_polar2vect; - private _fragType = round (random ((count _fragTypes)-1)); - private _fragment = (_fragTypes select _fragType) createVehicleLocal [0,0,10000]; - _fragment setPosASL _spallPos; - _fragment setVelocity _spallFragVect; - - if(GVAR(traceFrags)) then { - [ACE_player, _fragment, [1,0,0,1]] call FUNC(addTrack); - }; - }; +if (alive _round) then { + private _diff = _velocity vectorDiff (velocity _round); + private _polar = _diff call CBA_fnc_vect2polar; + // ACE_player sideChat format ["polar: %1", _polar]; + if (abs (_polar select 1) > 45 || {abs (_polar select 2) > 45}) then { + if (_caliber < 2.5) then { + // ACE_player sideChat format ["exit!"]; + _exit = true; + } else { + SUB(_vm,_curVelocity / _oldVelocity); }; }; }; +if (_exit) exitWith {}; +private _unitDir = vectorNormalized _velocity; +private _pos = _hpData select 3; +private _spallPos = []; +for "_i" from 0 to 100 do { + private _pos1 = _pos vectorAdd (_unitDir vectorMultiply (0.01 * _i)); + private _pos2 = _pos vectorAdd (_unitDir vectorMultiply (0.01 * (_i + 1))); + // _data = [nil, nil, nil, 1, [[ASLtoATL _pos1, 1], [ASLtoATL _pos2, 1]]]; + // NOU_TRACES pushBack _data; + + if (!lineIntersects [_pos1, _pos2]) exitWith { + // ACE_player sideChat format ["FOUND!"]; + _spallPos = _pos2; + }; +}; +if (_spallPos isEqualTo []) exitWith {}; +private _spallPolar = _velocity call CBA_fnc_vect2polar; + +if (_explosive > 0) then { + // ACE_player sideChat format ["EXPLOSIVE!"]; + private _warn = false; + private _c = getNumber (configFile >> "CfgAmmo" >> _roundType >> QGVAR(CHARGE)); + if (_c == 0) then {_c = 1; _warn = true;}; + private _m = getNumber (configFile >> "CfgAmmo" >> _roundType >> QGVAR(METAL)); + if (_m == 0) then {_m = 2; _warn = true;}; + private _k = getNumber (configFile >> "CfgAmmo" >> _roundType >> QGVAR(GURNEY_K)); + if (_k == 0) then {_k = 1 / 2; _warn = true;}; + private _gC = getNumber (configFile >> "CfgAmmo" >> _roundType >> QGVAR(GURNEY_C)); + if (_gC == 0) then {_gC = 2440; _warn = true;}; + + if (_warn) then { + WARNING_1("Ammo class %1 lacks proper explosive properties definitions for frag!",_roundType); //TODO: turn this off when we get closer to release + }; + + private _fragPower = (((_m / _c) + _k) ^ - (1 / 2)) * _gC; + _spallPolar set [0, _fragPower * 0.66]; +}; + +private _fragTypes = [ + QGVAR(spall_small), QGVAR(spall_small), QGVAR(spall_small), + QGVAR(spall_small),QGVAR(spall_medium),QGVAR(spall_medium),QGVAR(spall_medium), + QGVAR(spall_medium), QGVAR(spall_large), QGVAR(spall_large), QGVAR(spall_huge), + QGVAR(spall_huge) + +]; + +// diag_log text format ["SPALL POWER: %1", _spallPolar select 0]; +private _spread = 15 + (random 25); +private _spallCount = 5 + (random 10); +for "_i" from 1 to _spallCount do { + private _elev = ((_spallPolar select 2) - _spread) + (random (_spread * 2)); + private _dir = ((_spallPolar select 1) - _spread) + (random (_spread * 2)); + if (abs _elev > 90) then { + ADD(_dir,180); + }; + _dir = _dir % 360; + private _vel = (_spallPolar select 0) * 0.33 * _vm; + _vel = (_vel - (_vel * 0.25)) + (random (_vel * 0.5)); + + private _spallFragVect = [_vel, _dir, _elev] call CBA_fnc_polar2vect; + private _fragType = round (random ((count _fragTypes) - 1)); + private _fragment = (_fragTypes select _fragType) createVehicleLocal [0,0,10000]; + _fragment setPosASL _spallPos; + _fragment setVelocity _spallFragVect; + + #ifdef DRAW_FRAG_INFO + [ACE_player, _fragment, [1, 0.5, 0, 1]] call FUNC(dev_addTrack); + #endif +}; + +_spread = 5 + (random 5); +_spallCount = 3 + (random 5); +for "_i" from 1 to _spallCount do { + private _elev = ((_spallPolar select 2) - _spread) + (random (_spread * 2)); + private _dir = ((_spallPolar select 1) - _spread) + (random (_spread * 2)); + if (abs _elev > 90) then { + ADD(_dir,180); + }; + _dir = _dir % 360; + private _vel = (_spallPolar select 0) * 0.55 * _vm; + _vel = (_vel - (_vel * 0.25)) + (random (_vel * 0.5)); + + private _spallFragVect = [_vel, _dir, _elev] call CBA_fnc_polar2vect; + private _fragType = round (random ((count _fragTypes) - 1)); + private _fragment = (_fragTypes select _fragType) createVehicleLocal [0, 0, 10000]; + _fragment setPosASL _spallPos; + _fragment setVelocity _spallFragVect; + + #ifdef DRAW_FRAG_INFO + [ACE_player, _fragment, [1, 0, 0, 1]] call FUNC(dev_addTrack); + #endif +}; diff --git a/addons/frag/functions/fnc_drawTraces.sqf b/addons/frag/functions/fnc_drawTraces.sqf deleted file mode 100644 index 790d53491f..0000000000 --- a/addons/frag/functions/fnc_drawTraces.sqf +++ /dev/null @@ -1,31 +0,0 @@ -#include "script_component.hpp" - -private ["_color", "_index", "_lastPos", "_lastSpd", "_max", "_positions", "_startSpeed"]; - -{ - _positions = _x select 4; - _color = _x select 5; - _index = 0; - _max = count _positions; - _startSpeed = 0.01 max ((_positions select 0) select 1); - _lastSpd = []; - _lastPos = []; - while {_index < _max} do { - _data1 = _positions select _index; - _data2 = nil; - if(_index + ACE_TRACE_DRAW_INC >= _max) then { - _data2 = _positions select (_max - 1); - } else { - _data2 = _positions select (_index + ACE_TRACE_DRAW_INC); - }; - - _pos1 = _data1 select 0; - _pos2 = _data2 select 0; - _index = _index + ACE_TRACE_DRAW_INC; - - drawLine3D [_pos1, _pos2, _color]; - _lastPos = _pos2; - _lastSpd = _data1 select 1; - }; - // drawIcon3D ["", [1,0,0,1], _lastPos, 0, 0, 0, format["%1m/s", _lastSpd], 1, 0.05, "RobotoCondensed"]; -} forEach GVAR(traces); diff --git a/addons/frag/functions/fnc_findReflections.sqf b/addons/frag/functions/fnc_findReflections.sqf index 3020cd9c12..774e1764ea 100644 --- a/addons/frag/functions/fnc_findReflections.sqf +++ b/addons/frag/functions/fnc_findReflections.sqf @@ -1,61 +1,74 @@ +/* + * Author: ACE-Team + * + * + * Arguments: + * None + * + * Return Value: + * None + * + * Example: + * call ace_frag_fnc_findReflections + * + * Public: No + */ + //fnc_findReflections.sqf #include "script_component.hpp" -private ["_lastPos", "_test", "_vec", "_testPos", "_buckets", "_excludes", "_bucketIndex", "_bucketPos", "_bucketList", "_c", "_index", "_blist", "_avgX", "_avgY", "_avgZ", "_bpos", "_distance", "_hitFactor", "_hit", "_range", "_refExp", "_i", "_x", "_res", "_forEachIndex", "_explosions", "_can", "_dirvec", "_zAng"]; - BEGIN_COUNTER(fnc_findReflections); -params ["_args"]; +params ["_args", "_pfhID"]; _args params ["_pos", "_explosiveInfo", "_los", "_nlos", "_zIndex", "_depth", "_rand"]; private _split = 15; -private _radi = (360/_split*_depth); +private _radi = 360 / _split * _depth; -// player sideChat format["p: %1", _explosiveInfo]; +// player sideChat format ["p: %1", _explosiveInfo]; _explosiveInfo params ["_indirectHitRange", "_indirectHit"]; -private _distanceCount = (floor _indirectHitRange*4) min 100; +private _distanceCount = (floor _indirectHitRange * 4) min 100; -if(_zIndex < 5) then { - _lastPos = _pos; - _zAng = _zIndex*20+2; - if(_zAng > 80) then { +if (_zIndex < 5) then { + private _lastPos = _pos; + private _zAng = _zIndex * 20 + 2; + if (_zAng > 80) then { _radi = 1; _zAng = 90; }; for "_i" from 0 to _radi do { - _test = true; - _vec = [1, ((_i*_split)+_rand) mod 360, _zAng] call CBA_fnc_polar2vect; + private _test = true; + private _vec = [1, ((_i * _split) + _rand) % 360, _zAng] call CBA_fnc_polar2vect; for "_x" from 1 to _distanceCount do { - _testPos = _pos vectorAdd (_vec vectorMultiply _x); + private _testPos = _pos vectorAdd (_vec vectorMultiply _x); // drop ["\a3\data_f\Cl_basic","","Billboard",1,15,ASLtoATL _testPos,[0,0,0],1,1.275,1.0,0.0,[1],[[1,0,0,1]],[0],0.0,2.0,"","",""]; - _res = lineIntersectsWith [_pos, _testPos]; - if(count _res > 0) exitWith { + private _res = lineIntersectsWith [_pos, _testPos]; + if (count _res > 0) exitWith { _test = false; _nlos pushBack _lastPos; // { - // _x addEventHandler ["HandleDamage", { diag_log text format["this: %1", _this]; }]; + // _x addEventHandler ["HandleDamage", { diag_log text format ["this: %1", _this]; }]; // } forEach _res; // drop ["\a3\data_f\Cl_basic","","Billboard",1,15,ASLtoATL _testPos,[0,0,0],1,1.275,1.0,0.0,[1],[[1,0,0,1]],[0],0.0,2.0,"","",""]; // TEST_PAIRS pushBack [_pos, _lastPos, [1,0,0,1]]; }; - // if(terrainIntersectASL [_pos, _testPos]) exitWith {}; + // if (terrainIntersectASL [_pos, _testPos]) exitWith {}; _lastPos = _testPos; }; }; - _args set[4, _zIndex+1]; + _args set [4, _zIndex + 1]; } else { - _depth = _depth + 1; - _buckets = []; - _excludes = []; - _bucketIndex = 0; - _bucketPos = nil; - _bucketList = nil; - _c = 0; - while { count(_nlos) != count(_excludes) && _c < (count _nlos) } do { + INC(_depth); + private _buckets = []; + private _excludes = []; + private _bucketPos = nil; + private _bucketList = nil; + private _c = 0; + while {count _nlos != count _excludes && {_c < (count _nlos)}} do { scopeName "mainSearch"; { - if(!(_forEachIndex in _excludes)) then { - _index = _buckets pushBack [_x, [_x]]; + if (!(_forEachIndex in _excludes)) then { + private _index = _buckets pushBack [_x, [_x]]; _excludes pushBack _forEachIndex; _bucketPos = _x; _bucketList = (_buckets select _index) select 1; @@ -63,59 +76,53 @@ if(_zIndex < 5) then { }; } forEach _nlos; { - if(!(_forEachIndex in _excludes)) then { + if (!(_forEachIndex in _excludes)) then { _testPos = _x; - if(_testPos vectorDistanceSqr _bucketPos <= 30) then { + if (_testPos vectorDistanceSqr _bucketPos <= 30) then { _bucketList pushBack _x; _excludes pushBack _forEachIndex; }; }; } forEach _nlos; - _c = _c + 1; + INC(_c); }; - // player sideChat format["c: %1", count _buckets]; - _explosions = []; + // player sideChat format ["c: %1", count _buckets]; + private _explosions = []; { - _blist = _x select 1; - _avgX = 0; - _avgY = 0; - _avgZ = 0; + private _blist = _x select 1; + private _avg = [0, 0, 0]; { - _avgX = _avgX + (_x select 0); - _avgY = _avgY + (_x select 1); - _avgZ = _avgZ + (_x select 2); + _avg = _avg vectorAdd _x; } forEach _blist; _c = count _blist; - _bpos = [_avgX/_c, _avgY/_c, _avgZ/_c]; + private _bpos = _avg vectorMultiply (1 / _c); - _distance = _pos vectorDistance _bpos; - _hitFactor = 1-(((_distance/(_indirectHitRange*4)) min 1) max 0); - // _hitFactor = 1/(_distance^2); - _hit = _indirectHit*_hitFactor; - _hit = (floor (_hit/4)) min 500; - _hit = _hit - (_hit%10); - _range = (floor (_indirectHitRange-(_distance/4))) min 100; - _range = _range - (_range%2); + private _distance = _pos vectorDistance _bpos; + private _hitFactor = 1 - (((_distance / (_indirectHitRange * 4)) min 1) max 0); + // _hitFactor = 1 / (_distance ^ 2); + private _hit = (floor (_indirectHit * _hitFactor / 4)) min 500; + SUB(_hit,_hit % 10); + private _range = (floor (_indirectHitRange - (_distance / 4))) min 100; + SUB(_range,_range % 2); - if(_hit >= 10 && _range > 0) then { - // TEST_ICONS pushBack [_bpos, format["h: %1, r: %2, hf: %3 d: %4 ihr: %5", _hit, _range, _hitFactor, _distance, _indirectHitRange*4]]; + if (_hit >= 10 && {_range > 0}) then { + // TEST_ICONS pushBack [_bpos, format ["h: %1, r: %2, hf: %3 d: %4 ihr: %5", _hit, _range, _hitFactor, _distance, _indirectHitRange*4]]; // TEST_PAIRS pushBack [_pos, _bpos, [1,0,0,1]]; - _refExp = format["ace_explosion_reflection_%1_%2", _range, _hit]; + private _refExp = format ["ace_explosion_reflection_%1_%2", _range, _hit]; // _refExp createVehicle (ASLtoATL _bpos); // drop ["\a3\data_f\Cl_basic","","Billboard",1,15,ASLtoATL _bpos,[0,0,0],1,1.275,1.0,0.0,[1],[[1,0,0,1]],[0],0.0,2.0,"","",""]; - _explosions pushBack [_refExp, _bpos, _hit, _distance, _indirectHitRange/4, _depth]; - + _explosions pushBack [_refExp, _bpos, _hit, _distance, _indirectHitRange / 4, _depth]; }; - if(count _explosions > (_radi*2)/_depth) exitWith {}; + if (count _explosions > (_radi * 2) / _depth) exitWith {}; } forEach _buckets; // _can = "Land_Bricks_V4_F" createVehicle (ASLtoATL _pos); // _dirvec = _pos vectorFromTo ((ATLtoASL (player modelToWorldVisual (player selectionPosition "Spine3")))); // _dirvec = _dirvec vectorMultiply 100; // _can setVelocity _dirvec; [DFUNC(doExplosions), 0, [_explosions, 0]] call CBA_fnc_addPerFrameHandler; - [(_this select 1)] call CBA_fnc_removePerFrameHandler; + [_pfhID] call CBA_fnc_removePerFrameHandler; }; END_COUNTER(fnc_findReflections); diff --git a/addons/frag/functions/fnc_fired.sqf b/addons/frag/functions/fnc_fired.sqf index dbe1ab6347..b1e29a79ca 100644 --- a/addons/frag/functions/fnc_fired.sqf +++ b/addons/frag/functions/fnc_fired.sqf @@ -7,7 +7,7 @@ * None. Parameters inherited from EFUNC(common,firedEH) * * Return Value: - * Nothing + * None * * Example: * [clientFiredBIS-XEH] call ace_frag_fnc_fired @@ -30,7 +30,7 @@ if (isNil "_shouldAdd") then { _shouldAdd = false; }; - if (GVAR(SpallEnabled)) exitWith { + if (GVAR(spallEnabled)) exitWith { //Always want to run whenever spall is enabled? _shouldAdd = true; TRACE_2("SettingCache[spallEnabled]",_ammo,_shouldAdd); @@ -42,7 +42,7 @@ if (isNil "_shouldAdd") then { private _explosive = getNumber (configFile >> "CfgAmmo" >> _ammo >> "explosive"); private _indirectRange = getNumber (configFile >> "CfgAmmo" >> _ammo >> "indirectHitRange"); private _force = getNumber (configFile >> "CfgAmmo" >> _ammo >> QGVAR(force)); - private _fragPower = getNumber(configFile >> "CfgAmmo" >> _ammo >> "indirecthit")*(sqrt((getNumber (configFile >> "CfgAmmo" >> _ammo >> "indirectHitRange")))); + private _fragPower = getNumber (configFile >> "CfgAmmo" >> _ammo >> "indirecthit") * (sqrt (getNumber (configFile >> "CfgAmmo" >> _ammo >> "indirectHitRange"))); _shouldAdd = (_skip == 0) && {(_force == 1) || {_explosive > 0.5 && {_indirectRange >= 4.5} && {_fragPower >= 35}}}; TRACE_6("SettingCache[willFrag?]",_skip,_explosive,_indirectRange,_force,_fragPower,_shouldAdd); @@ -50,6 +50,14 @@ if (isNil "_shouldAdd") then { }; if (_shouldAdd) then { - TRACE_3("Running Frag Tracking",_unit,_ammo,_projectile); + // firedMan will have nil "_gunner", so just check _unit; for firedVehicle we want to check _gunner + private _localShooter = if (isNil "_gunner") then {local _unit} else {local _gunner}; + TRACE_4("",_localShooter,_unit,_ammo,_projectile); + if (!_localShooter) exitWith {}; + + // Skip if less than 0.5 second from last shot + if ((CBA_missionTime - (_unit getVariable [QGVAR(lastTrack), -1])) < 0.5) exitWith {}; + _unit setVariable [QGVAR(lastTrack), CBA_missionTime]; + [_unit, _ammo, _projectile] call FUNC(addPfhRound); }; diff --git a/addons/frag/functions/fnc_frago.sqf b/addons/frag/functions/fnc_frago.sqf index 8e6c6ca7e9..a21e92d4b3 100644 --- a/addons/frag/functions/fnc_frago.sqf +++ b/addons/frag/functions/fnc_frago.sqf @@ -1,49 +1,53 @@ -//fnc_frago.sqf -// #define DEBUG_MODE_FULL +/* + * Author: Jaynus, NouberNou + * Server func to create the fragmentation for a round. + * + * Arguments: + * 0: Last Position (ASL) + * 1: Velocity + * 2: Ammo Classname + * + * Return Value: + * None + * + * Example: + * [[], [], "handGrenade"] call ace_frag_fnc_frago + * + * Public: No + */ +//#define DEBUG_MODE_FULL #include "script_component.hpp" #define FRAG_VEC_VAR 0.004 - #define MAX_FRAG_COUNT 50 -if(!isServer) exitWith { }; - BEGIN_COUNTER(frago); -// _startTime = diag_tickTime; -private ["_fuseDist", "_indirectHitRange", "_fragRange", "_c", "_m", "_k", "_gC", "_fragPower", "_fragPowerRandom", "_manObjects", "_objects", "_crew", "_fragCount", "_fragArcs", "_doRandom", "_boundingBox", "_targetPos", "_distance", "_add", "_bbX", "_bbY", "_bbZ", "_cubic", "_targetVel", "_baseVec", "_dir", "_currentCount", "_count", "_vecVar", "_vec", "_fp", "_vel", "_fragType", "_fragObj", "_randomCount", "_sectorSize", "_sectorOffset", "_i", "_randomDir", "_endTime", "_target"]; +params ["_lastPos", "_lastVel", "_shellType"]; +TRACE_3("frago",_lastPos,_lastVel,_shellType); -params ["_round", "_lastPos", "_lastVel", "_shellType"]; -private _gun = nil; -if((count _this) > 5) then { - _gun = _this select 5; -}; +// Limit max frag count if there was a recent frag +private _maxFrags = round (MAX_FRAG_COUNT * linearConversion [0.1, 1.5, (CBA_missionTime - GVAR(lastFragTime)), 0.1, 1, true]); +TRACE_2("",_maxFrags,CBA_missionTime - GVAR(lastFragTime)); +GVAR(lastFragTime) = CBA_missionTime; private _fragTypes = [ QGVAR(tiny), QGVAR(tiny), QGVAR(tiny), QGVAR(tiny_HD), QGVAR(tiny_HD), QGVAR(tiny_HD), - QGVAR(small),QGVAR(small),QGVAR(small),QGVAR(small), - QGVAR(small_HD),QGVAR(small_HD),QGVAR(small_HD),QGVAR(small_HD), + QGVAR(small), QGVAR(small), QGVAR(small), QGVAR(small), + QGVAR(small_HD), QGVAR(small_HD), QGVAR(small_HD), QGVAR(small_HD), QGVAR(medium_HD), QGVAR(medium_HD), QGVAR(medium_HD), QGVAR(medium_HD), QGVAR(medium_HD) ]; private _warn = false; -if(isArray (configFile >> "CfgAmmo" >> _shellType >> QGVAR(CLASSES))) then { +if (isArray (configFile >> "CfgAmmo" >> _shellType >> QGVAR(CLASSES))) then { _fragTypes = getArray (configFile >> "CfgAmmo" >> _shellType >> QGVAR(CLASSES)); } else { _warn = true; }; -private _atlPos = ASLtoATL _lastPos; - -private _isArmed = true; -if(!isNil "_gun") then { - _fuseDist = getNumber(configFile >> "CfgAmmo" >> _shellType >> "fuseDistance"); - _isArmed = ((getPosASL _gun) distance _lastPos > _fuseDist); -}; - -_indirectHitRange = getNumber(configFile >> "CfgAmmo" >> _shellType >> "indirecthitrange"); -_fragRange = 20 * _indirectHitRange * 4; +private _indirectHitRange = getNumber(configFile >> "CfgAmmo" >> _shellType >> "indirecthitrange"); +private _fragRange = 20 * _indirectHitRange * 4; // _c = 185; // grams of comp-b // _m = 210; // grams of fragmentating metal // _k = 3/5; // spherical K factor @@ -54,162 +58,138 @@ _fragRange = 20 * _indirectHitRange * 4; // _k = 1/2; // spherical K factor // _gC = 2320; // Gurney constant of tritonal in /ms +private _c = getNumber (configFile >> "CfgAmmo" >> _shellType >> QGVAR(CHARGE)); +if (_c == 0) then {_c = 1; _warn = true;}; +private _m = getNumber (configFile >> "CfgAmmo" >> _shellType >> QGVAR(METAL)); +if (_m == 0) then {_m = 2; _warn = true;}; +private _k = getNumber (configFile >> "CfgAmmo" >> _shellType >> QGVAR(GURNEY_K)); +if (_k == 0) then {_k = 0.5; _warn = true;}; +private _gC = getNumber (configFile >> "CfgAmmo" >> _shellType >> QGVAR(GURNEY_C)); +if (_gC == 0) then {_gC = 2440; _warn = true;}; -_c = getNumber(configFile >> "CfgAmmo" >> _shellType >> QGVAR(CHARGE)); -if(_c == 0) then { _c = 1; _warn = true;}; -_m = getNumber(configFile >> "CfgAmmo" >> _shellType >> QGVAR(METAL)); -if(_m == 0) then { _m = 2; _warn = true;}; -_k = getNumber(configFile >> "CfgAmmo" >> _shellType >> QGVAR(GURNEY_K)); -if(_k == 0) then { _k = 1/2; _warn = true;}; -_gC = getNumber(configFile >> "CfgAmmo" >> _shellType >> QGVAR(GURNEY_C)); -if(_gC == 0) then { _gC = 2440; _warn = true;}; - -if(_warn) then { - WARNING_1("Ammo class %1 lacks proper explosive properties definitions for frag!",_shellType); //TODO: turn this off when we get closer to release +if (_warn) then { + INFO_1("Ammo class %1 lacks proper explosive properties definitions for frag!",_shellType); }; -_fragPower = (((_m/_c)+_k)^-(1/2))*_gC; -_fragPower = _fragPower * 0.8; // Gunery equation is for a non-fragmenting metal, imperical value of 80% represents fragmentation +// Gunery equation is for a non-fragmenting metal, imperical value of 80% represents fragmentation +private _fragPower = 0.8 * (((_m / _c) + _k) ^ - (1 / 2)) * _gC; -_fragPowerRandom = _fragPower * 0.5; -if((_atlPos select 2) < 0.5) then { - _lastPos set[2, (_lastPos select 2)+0.5]; +private _atlPos = ASLtoATL _lastPos; + +private _fragPowerRandom = _fragPower * 0.5; +if ((_atlPos select 2) < 0.5) then { + _lastPos vectorAdd [0, 0, 0.5]; }; -// _manObjects = _atlPos nearEntities ["CaManBase", _fragRange]; - -// setAccTime 0.01; - -//_objects = nearestObjects [_atlPos, ["AllVehicles"], _fragRange]; // Not sure if tracking "ReammoBox" is required, if so revert this change for _objects -_objects = _atlPos nearEntities [["Car", "Motorcycle", "Tank", "StaticWeapon", "CAManBase", "Air", "Ship"], _fragRange]; - -// _objects = _manObjects; -// Target also people inside vehicles or manning weapons -_crew = []; +private _objects = _atlPos nearEntities [["Car", "Motorcycle", "Tank", "StaticWeapon", "CAManBase", "Air", "Ship"], _fragRange]; +// Add unique crews in faster way { { - _crew set [count _crew,_x] + _objects pushBackUnique _x; } forEach (crew _x); } forEach _objects; +TRACE_2("",_fragRange,count _objects); -_objects = _objects - _crew; -_objects = _objects + _crew; +private _fragCount = 0; -_fragCount = 0; +private _fragArcs = []; +_fragArcs set [360, 0]; -_fragArcs = []; -_fragArcs set[360, 0]; - -#ifdef DEBUG_MODE_FULL - ACE_player sideChat format["_fragRange: %1", _fragRange]; - ACE_player sideChat format["_objects: %1", _objects]; -#endif -_doRandom = true; -if(_isArmed && (count _objects) > 0) then { - if (GVAR(ReflectionsEnabled)) then { +private _doRandom = true; +if (!(_objects isEqualTo [])) then { + if (GVAR(reflectionsEnabled)) then { [_lastPos, _shellType] call FUNC(doReflections); }; { - //if(random(1) > 0.5) then { - _target = _x; - if(alive _target) then { - _boundingBox = boundingBox _target; - _targetPos = (getPosASL _target); - _distance = _targetPos distance _lastPos; - _add = (((_boundingBox select 1) select 2)/2)+((((_distance-(_fragpower/8)) max 0)/_fragPower)*10); - _bbX = (abs((_boundingBox select 0) select 0))+((_boundingBox select 1) select 0); - _bbY = (abs((_boundingBox select 0) select 1))+((_boundingBox select 1) select 1); - _bbZ = (abs((_boundingBox select 0) select 2))+((_boundingBox select 1) select 2); - _cubic = _bbX * _bbY * _bbZ; - if(_cubic > 1) then { - _doRandom = true; + private _target = _x; + if (alive _target) then { + (boundingBox _target) params ["_boundingBoxA", "_boundingBoxB"]; - _targetVel = (velocity _target); + private _cubic = ((abs (_boundingBoxA select 0)) + (_boundingBoxB select 0)) * ((abs (_boundingBoxA select 1)) + (_boundingBoxB select 1)) * ((abs (_boundingBoxA select 2)) + (_boundingBoxB select 2)); + if (_cubic <= 1) exitWith {}; + // _doRandom = true; - _targetPos set[0, (_targetPos select 0)+((_targetVel select 0)*(_distance/_fragPower))]; - _targetPos set[1, (_targetPos select 1)+((_targetVel select 1)*(_distance/_fragPower))]; - _targetPos set[2, (_targetPos select 2)+_add]; + private _targetVel = velocity _target; + private _targetPos = getPosASL _target; + private _distance = _targetPos vectorDistance _lastPos; + private _add = ((_boundingBoxB select 2) / 2) + ((((_distance - (_fragpower / 8)) max 0) / _fragPower) * 10); - _baseVec = _lastPos vectorFromTo _targetPos; + _targetPos = _targetPos vectorAdd [ + (_targetVel select 0) * (_distance / _fragPower), + (_targetVel select 1) * (_distance / _fragPower), + _add + ]; - _dir = floor(_baseVec call CBA_fnc_vectDir); - _currentCount = _fragArcs select _dir; - if(isNil "_currentCount") then { - _currentCount = 0; - }; - if(_currentCount < 20) then { - _count = ceil(random(sqrt(_m/1000))); - _vecVar = FRAG_VEC_VAR; - if(!(_target isKindOf "Man")) then { - _vecVar = ((sqrt _cubic)/2000)+FRAG_VEC_VAR; - if((count (crew _target)) == 0 && _count > 0) then { - _count = 0 max (_count/2); - }; - }; - for "_i" from 1 to _count do { - _vec = +_baseVec; + private _baseVec = _lastPos vectorFromTo _targetPos; - _vec set[0, (_vec select 0)-(_vecVar/2)+(random _vecVar)]; - _vec set[1, (_vec select 1)-(_vecVar/2)+(random _vecVar)]; - _vec set[2, (_vec select 2)-(_vecVar/2)+(random _vecVar)]; - - _fp = (_fragPower-(random (_fragPowerRandom))); - _vel = _vec vectorMultiply _fp; - - _fragType = round (random ((count _fragTypes)-1)); - _fragObj = (_fragTypes select _fragType) createVehicleLocal [0,0,10000]; - // diag_log text format["fp: %1 %2", _fp, typeOf _fragObj]; - _fragObj setPosASL _lastPos; - _fragObj setVectorDir _vec; - _fragObj setVelocity _vel; - if(GVAR(traceFrags)) then { - GVAR(TOTALFRAGS) = GVAR(TOTALFRAGS) + 1; - [ACE_player, _fragObj, [1,0,0,1]] call FUNC(addTrack); - }; - _fragCount = _fragCount + 1; - _currentCount = _currentCount + 1; - }; - _fragArcs set[_dir, _currentCount]; + private _dir = floor (_baseVec call CBA_fnc_vectDir); + private _currentCount = RETDEF(_fragArcs select _dir,0); + if (_currentCount < 10) then { + private _count = ceil (random (sqrt (_m / 1000))); + private _vecVar = FRAG_VEC_VAR; + if (!(_target isKindOf "Man")) then { + ADD(_vecVar,(sqrt _cubic) / 2000); + if ((crew _target) isEqualTo [] && {_count > 0}) then { + _count = 0 max (_count / 2); }; }; + for "_i" from 1 to _count do { + private _vec = _baseVec vectorDiff [ + (_vecVar / 2) + (random _vecVar), + (_vecVar / 2) + (random _vecVar), + (_vecVar / 2) + (random _vecVar) + ]; + + private _fp = _fragPower - (random (_fragPowerRandom)); + private _vel = _vec vectorMultiply _fp; + + private _fragObj = (selectRandom _fragTypes) createVehicleLocal [0,0,10000]; + // TRACE_4("targeted",_fp, typeOf _fragObj,_lastPos vectorDistance _targetPos,typeOf _x); + _fragObj setPosASL _lastPos; + _fragObj setVectorDir _vec; + _fragObj setVelocity _vel; + #ifdef DRAW_FRAG_INFO + [ACE_player, _fragObj, [1,0,0,1]] call FUNC(dev_addTrack); + #endif + INC(_fragCount); + INC(_currentCount); + }; + _fragArcs set [_dir, _currentCount]; }; - //}; - if(_fragCount > MAX_FRAG_COUNT) exitWith {}; + }; + if (_fragCount > _maxFrags) exitWith {}; } forEach _objects; - if(_fragCount > MAX_FRAG_COUNT) exitWith {}; - _randomCount = ((ceil((MAX_FRAG_COUNT - _fragCount)*0.1)) max 0)+20; - _sectorSize = 360 / (_randomCount max 1); - // _doRandom = false; - if(_doRandom) then { + TRACE_1("targeted",_fragCount); + if (_fragCount > _maxFrags) exitWith {}; + private _randomCount = ceil ((_maxFrags - _fragCount) * 0.35); + TRACE_1("",_randomCount); + private _sectorSize = 360 / (_randomCount max 1); + + if (_doRandom) then { for "_i" from 1 to _randomCount do { // Distribute evenly - _sectorOffset = 360 * (_i - 1) / (_randomCount max 1); - _randomDir = random(_sectorSize); - _vec = [cos(_sectorOffset + _randomDir), sin(_sectorOffset + _randomDir), sin(30 - (random 45))]; + private _sectorOffset = 360 * (_i - 1) / (_randomCount max 1); + private _randomDir = random (_sectorSize); + _vec = [cos (_sectorOffset + _randomDir), sin (_sectorOffset + _randomDir), sin (30 - (random 45))]; - _fp = (_fragPower-(random (_fragPowerRandom))); + _fp = (_fragPower - (random (_fragPowerRandom))); _vel = _vec vectorMultiply _fp; - _fragType = round (random ((count _fragTypes)-1)); - _fragObj = (_fragTypes select _fragType) createVehicleLocal [0,0,10000]; + _fragObj = (selectRandom _fragTypes) createVehicleLocal [0, 0, 10000]; _fragObj setPosASL _lastPos; _fragObj setVectorDir _vec; _fragObj setVelocity _vel; - if(GVAR(traceFrags)) then { - GVAR(TOTALFRAGS) = GVAR(TOTALFRAGS) + 1; - [ACE_player, _fragObj, [1,0.5,0,1]] call FUNC(addTrack); - }; - _fragCount = _fragCount + 1; + #ifdef DRAW_FRAG_INFO + [ACE_player, _fragObj, [1,0.5,0,1]] call FUNC(dev_addTrack); + #endif + INC(_fragCount); }; }; - }; -// #ifdef DEBUG_MODE_FULL - // ACE_player sideChat format["total frags: %1", GVAR(TOTALFRAGS)]; - // ACE_player sideChat format["tracks: %1", (count GVAR(trackedObjects))]; -// #endif -// _endTime = diag_tickTime; + +TRACE_1("total created",_fragCount); + END_COUNTER(frago); diff --git a/addons/frag/functions/fnc_masterPFH.sqf b/addons/frag/functions/fnc_masterPFH.sqf index 722590a391..638a91ee63 100644 --- a/addons/frag/functions/fnc_masterPFH.sqf +++ b/addons/frag/functions/fnc_masterPFH.sqf @@ -1,50 +1,58 @@ /* * Author: jaynus - * - * Master single PFH abstraction for all rounds being tracked by frag/spall + * Master single PFH abstraction for all rounds being tracked by frag/spall. * * Arguments: - * + * None * * Return Value: * None + * + * Example: + * call ace_frag_fnc_masterPFH + * + * Public: No */ + //#define DEBUG_MODE_FULL #include "script_component.hpp" -//PARAMS_2(_pfhArgs,_handle); -if (!GVAR(enabled)) exitWith {}; +BEGIN_COUNTER(PFH); -private ["_gcIndex", "_iter"]; -_gcIndex = []; +// Fast exit if nothing to do +if (GVAR(objects) isEqualTo []) exitWith {END_COUNTER(PFH);}; -_iter = 0; -while { (count GVAR(objects)) > 0 && { _iter < (GVAR(MaxTrackPerFrame) min (count GVAR(objects))) } } do { - private ["_object", "_args"]; - if(GVAR(lastIterationIndex) >= (count GVAR(objects))) then { +private _gcIndex = []; + +private _iter = 0; +private _objectCount = count GVAR(objects); +while {_objectCount > 0 && {_iter < (GVAR(maxTrackPerFrame) min _objectCount)}} do { + + if (GVAR(lastIterationIndex) >= _objectCount) then { GVAR(lastIterationIndex) = 0; }; - _object = GVAR(objects) select GVAR(lastIterationIndex); + private _object = GVAR(objects) select GVAR(lastIterationIndex); - if(!isNil "_object") then { - _args = GVAR(arguments) select GVAR(lastIterationIndex); + if (!isNil "_object") then { + private _args = GVAR(arguments) select GVAR(lastIterationIndex); - if(!(_args call FUNC(pfhRound))) then { - _gcIndex pushBack GVAR(lastIterationIndex); // Add it to the GC if it returns false + if (!(_args call FUNC(pfhRound))) then { + _gcIndex pushBack GVAR(lastIterationIndex); // Add it to the GC if it returns false }; }; - _iter = _iter + 1; - GVAR(lastIterationIndex) = GVAR(lastIterationIndex) + 1; + INC(_iter); + INC(GVAR(lastIterationIndex)); }; -// clean up dead object references -private ["_deletionCount", "_deleteIndex"]; -_deletionCount = 0; +// Clean up dead object references +private _deletionCount = 0; { TRACE_1("GC Projectile", _x); - _deleteIndex = _x - _deletionCount; + private _deleteIndex = _x - _deletionCount; GVAR(objects) deleteAt _deleteIndex; GVAR(arguments) deleteAt _deleteIndex; - _deletionCount = _deletionCount + 1; + INC(_deletionCount); } forEach _gcIndex; + +END_COUNTER(PFH); diff --git a/addons/frag/functions/fnc_pfhRound.sqf b/addons/frag/functions/fnc_pfhRound.sqf index cbbd75b633..9d63df3f2a 100644 --- a/addons/frag/functions/fnc_pfhRound.sqf +++ b/addons/frag/functions/fnc_pfhRound.sqf @@ -1,26 +1,50 @@ +/* + * Author: ACE-Team + * + * + * Arguments: + * None + * + * Return Value: + * None + * + * Example: + * call ace_frag_fnc_pfhRound + * + * Public: No + */ + #include "script_component.hpp" -params ["_round", "_lastPos", "_lastVel", "_type", "_firedFrame", "", "_doSpall", "_spallTrack", "_foundObjectHPIds", "_skip", "_explosive", "_indirectRange", "_force", "_fragPower"]; +params ["_round", "_lastPos", "_lastVel", "_shellType", "_firedFrame", "_gun", "_doSpall", "_spallTrack", "_foundObjectHPIds", "_skip", "_explosive", "_indirectRange", "_force", "_fragPower"]; -if(_round in GVAR(blackList)) exitWith { +if (_round in GVAR(blackList)) exitWith { false }; if (!alive _round) exitWith { - if((diag_frameno - _firedFrame) > 1) then { //skip if deleted within a single frame - if(_skip == 0) then { - if((_explosive > 0.5 && {_indirectRange >= 4.5} && {_fragPower >= 35}) || {_force == 1} ) then { + if ((diag_frameno - _firedFrame) > 1) then { //skip if deleted within a single frame + if (_skip == 0) then { + if ((_explosive > 0.5 && {_indirectRange >= 4.5} && {_fragPower >= 35}) || {_force == 1}) then { // shotbullet, shotShell don't seem to explode when touching water, so don't create frags - if (((_lastPos select 2) < 0) && {(toLower getText (configFile >> "CfgAmmo" >> _type >> "simulation")) in ["shotbullet", "shotshell"]}) exitWith {}; - [QGVAR(frag_eh), _this] call CBA_fnc_serverEvent; + if (((_lastPos select 2) < 0) && {(toLower getText (configFile >> "CfgAmmo" >> _shellType >> "simulation")) in ["shotbullet", "shotshell"]}) exitWith {}; + private _isArmed = true; + if (!isNil "_gun") then { + private _fuseDist = getNumber(configFile >> "CfgAmmo" >> _shellType >> "fuseDistance"); + _isArmed = ((getPosASL _gun) distance _lastPos > _fuseDist); + TRACE_2("",_fuseDist,_isArmed); + }; + if (!_isArmed) exitWith {TRACE_1("round not armed",_this);}; + TRACE_3("Sending frag event to server",_lastPos,_lastVel,_shellType); + [QGVAR(frag_eh), [_lastPos,_lastVel,_shellType]] call CBA_fnc_serverEvent; }; }; }; - if(_doSpall) then { - GVAR(spallIsTrackingCount) = GVAR(spallIsTrackingCount) - 1; - // diag_log text format["F: %1", _foundObjectHPIds]; + if (_doSpall) then { + DEC(GVAR(spallIsTrackingCount)); + TRACE_1("doSpall",_foundObjectHPIds); { - if(!isNil "_x") then { + if (!isNil "_x") then { _x removeEventHandler ["hitPart", _foundObjectHPIds select _forEachIndex]; }; } forEach _spallTrack; @@ -28,12 +52,11 @@ if (!alive _round) exitWith { false }; -_this set[1, (getPosASL _round)]; -_this set[2, (velocity _round)]; +_this set [1, getPosASL _round]; +_this set [2, velocity _round]; -if(_doSpall) then { - private ["_scale"]; - _scale = ( (count GVAR(objects)) / GVAR(MaxTrackPerFrame) ) max 0.1; +if (_doSpall) then { + private _scale = ((count GVAR(objects)) / GVAR(maxTrackPerFrame)) max 0.1; [_round, _scale, _spallTrack, _foundObjectHPIds] call FUNC(spallTrack); }; diff --git a/addons/frag/functions/fnc_removePfhRound.sqf b/addons/frag/functions/fnc_removePfhRound.sqf deleted file mode 100644 index d186da1e17..0000000000 --- a/addons/frag/functions/fnc_removePfhRound.sqf +++ /dev/null @@ -1,11 +0,0 @@ -#include "script_component.hpp" - -// THIS FUNCTION SHOULD NOT BE USED BECAUSE IT CAUSES AN SEARCH AND REBUILD - -PARAMS_1(_round); - -if(_round in GVAR(blackList)) then { - GVAR(blackList) = GVAR(blackList) - [_round]; -}; - -GVAR(objects) = GVAR(objects) - [_round]; diff --git a/addons/frag/functions/fnc_removeTrack.sqf b/addons/frag/functions/fnc_removeTrack.sqf deleted file mode 100644 index 914a90602c..0000000000 --- a/addons/frag/functions/fnc_removeTrack.sqf +++ /dev/null @@ -1,14 +0,0 @@ -#include "script_component.hpp" - -private ["_ret"]; -_ret = true; -if(IS_ARRAY((_this select 0))) then { - _ret = false; -} else { - if((_this select 0) in GVAR(trackedObjects)) then { - GVAR(trackedObjects) = GVAR(trackedObjects) - [(_this select 0)]; - } else { - _ret = false; - }; -}; -_ret diff --git a/addons/frag/functions/fnc_spallHP.sqf b/addons/frag/functions/fnc_spallHP.sqf index 5bdde6eee9..643f5aefe4 100644 --- a/addons/frag/functions/fnc_spallHP.sqf +++ b/addons/frag/functions/fnc_spallHP.sqf @@ -1,29 +1,43 @@ +/* + * Author: ACE-Team + * + * + * Arguments: + * None + * + * Return Value: + * None + * + * Example: + * call ace_frag_fnc_spallHP + * + * Public: No + */ + #include "script_component.hpp" -private ["_initialData", "_hpData", "_round", "_hpRound", "_hpDirect"]; -//player sideChat format["f: %1 c: %2", (_this select 0), (count GVAR(spallHPData))]; +//player sideChat format ["f: %1 c: %2", (_this select 0), (count GVAR(spallHPData))]; -if ((_this select 0) <= (count GVAR(spallHPData))) then { - _initialData = GVAR(spallHPData) select (_this select 0); - if (!isNil "_initialData") then { - _hpRound = ((_this select 1) select 0) select 2; - _round = _initialData select 3; - _hpDirect = ((_this select 1) select 0) select 10; - if (_hpDirect && {_round == _hpRound}) then { - { - _hpData = _x; - _round = _initialData select 3; - // diag_log text format["HPDUMP-------------------------------------"]; - // { - // _hp = _x; - // diag_log text format["%1 --", _forEachIndex]; - // { - // diag_log text format["%1: %2", _forEachIndex, _x]; - // } forEach _hp; - // } forEach (_this select 1); - [DFUNC(doSpall), [_this, _forEachIndex]] call CBA_fnc_execNextFrame; - // player sideChat "WEEE"; - } forEach (_this select 1); - }; - }; +params ["_index", "_hitPartData"]; + +private _initialData = GVAR(spallHPData) param [_index, []]; +if (_initialData isEqualTo []) exitWith {}; + +private _hpRound = (_hitPartData select 0) select 2; +private _round = _initialData select 3; +private _hpDirect = (_hitPartData select 0) select 10; + +if (_hpDirect && {_round == _hpRound}) then { + { + // diag_log text format ["HPDUMP-------------------------------------"]; + // { + // _hp = _x; + // diag_log text format ["%1 --", _forEachIndex]; + // { + // diag_log text format ["%1: %2", _forEachIndex, _x]; + // } forEach _hp; + // } forEach (_this select 1); + [DFUNC(doSpall), [_this, _forEachIndex]] call CBA_fnc_execNextFrame; + // player sideChat "WEEE"; + } forEach _hitPartData; }; diff --git a/addons/frag/functions/fnc_spallTrack.sqf b/addons/frag/functions/fnc_spallTrack.sqf index 91c7dee511..ee928b35c0 100644 --- a/addons/frag/functions/fnc_spallTrack.sqf +++ b/addons/frag/functions/fnc_spallTrack.sqf @@ -1,9 +1,25 @@ +/* + * Author: ACE-Team + * + * + * Arguments: + * None + * + * Return Value: + * None + * + * Example: + * call ace_frag_fnc_spallTrack + * + * Public: No + */ + //fnc_spallTrack.sqf #include "script_component.hpp" params ["_round", "_multiplier", "_foundObjects", "_foundObjectHPIds"]; -private _delta = (1/diag_fps) * _multiplier; +private _delta = (1 / diag_fps) * _multiplier; private _curPos = getPosASL _round; private _velocity = velocity _round; @@ -12,17 +28,15 @@ private _forwardPos = _curPos vectorAdd _velocityStep; private _intersectsWith = lineIntersectsWith [_curPos, _forwardPos]; -if (count _intersectsWith > 0) then { - // player sideChat format["inter: %1", _intersectsWith]; - { - if(!(_x in _foundObjects)) then { - // diag_log text format["Adding HP: %1", _x]; - private _index = count GVAR(spallHPData); - private _hpId = _x addEventHandler ["hitPart", compile format["[%1, _this] call " + QFUNC(spallHP), _index]]; - _foundObjects set[(count _foundObjects), _x]; - _foundObjectHPIds set[(count _foundObjectHPIds), _hpId]; - private _data = [_hpId, _x, typeOf _round, _round, _curPos, _velocity, 0, _foundObjects, _foundObjectHPIds]; - GVAR(spallHPData) set[_index, _data]; - }; - } forEach _intersectsWith; -}; +if (_intersectsWith isEqualTo []) exitWith {}; + +// player sideChat format ["inter: %1", _intersectsWith]; +{ + // diag_log text format ["Adding HP: %1", _x]; + private _index = count GVAR(spallHPData); + private _hpId = _x addEventHandler ["hitPart", compile format ["[%1, _this] call " + QFUNC(spallHP), _index]]; + _foundObjects pushBack _x; + _foundObjectHPIds pushBack _hpId; + private _data = [_hpId, _x, typeOf _round, _round, _curPos, _velocity, 0, _foundObjects, _foundObjectHPIds]; + GVAR(spallHPData) pushBack _data; +} forEach (_intersectsWith select {!(_x in _foundObjects)}); diff --git a/addons/frag/functions/fnc_startTracing.sqf b/addons/frag/functions/fnc_startTracing.sqf deleted file mode 100644 index ca9aa8c84e..0000000000 --- a/addons/frag/functions/fnc_startTracing.sqf +++ /dev/null @@ -1,5 +0,0 @@ -#include "script_component.hpp" -if(!GVAR(tracesStarted)) then { - GVAR(tracesStarted) = true; - GVAR(traceID) = [FUNC(drawTraces), 0, []] call CBA_fnc_addPerFrameHandler; -}; diff --git a/addons/frag/functions/fnc_stopTracing.sqf b/addons/frag/functions/fnc_stopTracing.sqf deleted file mode 100644 index b58352c897..0000000000 --- a/addons/frag/functions/fnc_stopTracing.sqf +++ /dev/null @@ -1,5 +0,0 @@ -#include "script_component.hpp" -if(GVAR(tracesStarted)) then { - GVAR(tracesStarted) = false; - [GVAR(traceID)] call CBA_fnc_removePerFrameHandler; -}; diff --git a/addons/frag/functions/fnc_trackTrace.sqf b/addons/frag/functions/fnc_trackTrace.sqf deleted file mode 100644 index d57eaa8c5c..0000000000 --- a/addons/frag/functions/fnc_trackTrace.sqf +++ /dev/null @@ -1,12 +0,0 @@ -#include "script_component.hpp" - -params ["_args"]; -_args params ["_tracerObj", "_index"]; - -if (alive _tracerObj && (count GVAR(traces)) > 0) then { - private _data = GVAR(traces) select _index; - private _positions = _data select 4; - _positions pushBack [(getPos _tracerObj), vectorMagnitude (velocity _tracerObj)]; -} else { - [(_this select 1)] call CBA_fnc_removePerFrameHandler; -}; diff --git a/addons/frag/functions/script_component.hpp b/addons/frag/functions/script_component.hpp index 8312313751..0903b3ba1e 100644 --- a/addons/frag/functions/script_component.hpp +++ b/addons/frag/functions/script_component.hpp @@ -1 +1 @@ -#include "\z\ace\addons\frag\script_component.hpp" \ No newline at end of file +#include "\z\ace\addons\frag\script_component.hpp" diff --git a/addons/frag/script_component.hpp b/addons/frag/script_component.hpp index ed94fac8f0..0215e9f4d7 100644 --- a/addons/frag/script_component.hpp +++ b/addons/frag/script_component.hpp @@ -2,7 +2,7 @@ #define COMPONENT_BEAUTIFIED Frag #include "\z\ace\addons\main\script_mod.hpp" -//#define DEBUG_ENABLED_FRAG +// #define DRAW_FRAG_INFO // #define DEBUG_MODE_FULL // #define DISABLE_COMPILE_CACHE // #define ENABLE_PERFORMANCE_COUNTERS @@ -17,4 +17,4 @@ #include "\z\ace\addons\main\script_macros.hpp" -#define ACE_TRACE_DRAW_INC 1 +#define ACE_TRACE_DRAW_INC 1 diff --git a/addons/frag/stringtable.xml b/addons/frag/stringtable.xml index 3a4fff2711..071924ac65 100644 --- a/addons/frag/stringtable.xml +++ b/addons/frag/stringtable.xml @@ -13,6 +13,9 @@ Симуляция осколков Simulazione Frammentazione 破片シミュレーション + 조각 시뮬레이션 + 模拟碎片 + 模擬碎片 Fragmentation Simulation @@ -26,6 +29,9 @@ Симуляция осколков Simulazione Frammentazione 破片シミュレーション + 조각 시뮬레이션 + 模拟碎片 + 模擬碎片 Enable the ACE Fragmentation Simulation @@ -39,6 +45,9 @@ Включить симуляцию осколков ACE Abilita la Simulazione Frammentazione di ACE ACE 破片シミュレーションを有効化 + ACE 조각 시뮬레이션을 적용합니다. + 启用ACE模拟碎片 + 啟用ACE模擬碎片 Spalling Simulation @@ -52,6 +61,9 @@ Симуляция обломков Simulazione Spalling 剥離シミュレーション + 파편 시뮬레이션 + 模拟剥落 + 模擬剝落 Enable the ACE Spalling Simulation @@ -65,6 +77,9 @@ Включить симуляцию обломков ACE Abilita la Simulazione Spalling di ACE ACE 剥離シミュレーションを有効化 + ACE 파편 시뮬레이션을 적용합니다. + 启用ACE模拟剥落 + 啟用ACE模擬剝落 Explosion Reflections Simulation @@ -76,6 +91,9 @@ Simulação de reflexo de explosão Cимуляция отражения взрывов ACE 爆発による飛翔シミュレーション + 폭발 반사 시뮬레이션 + 模拟爆炸反射 + 模擬爆炸反射 Enable the ACE Explosion Reflection Simulation @@ -87,6 +105,9 @@ Ativa a simulação de reflexo de explosão do ACE Включить симуляцию отражения взрывов ACE 爆発による飛翔シミュレーションを有効化 + ACE 폭발 반사 시뮬레이션을 적용합니다. + 启用ACE模拟爆炸反射 + 啟用ACE模擬爆炸反射 Maximum Projectiles Tracked @@ -100,6 +121,9 @@ Макс. количество отслеживаемых снарядов Numero massimo di Proiettili Tracciati 最大弾頭追跡数 + 최대 발사체 추적수 + 最大碎片/剥落粒子追踪数量 + 最大碎片/剝落粒子追蹤數量 This setting controls the maximum amount of projectiles the fragmentation and spalling system will track at any given time. If more projectiles are fired, they will not be tracked. Lower this setting if you do not want FPS drops at high-count projectile scenarios ( >200 rounds in the air at once) @@ -113,6 +137,9 @@ Эта настройка контролирует максимальное количество снарядов, которок отслеживает система осколков и обломков в каждый момент времени. Снаряды, выстреленные сверх этого числа, отслеживаться не будут. Уменьшите это значение, если вы не хотите падения FPS при большом количестве снарядов в одной перестрелке (> 200 одновременно летящих снарядов) Questo parametro controlla il numero massimo di proiettili che la frammentazione e il sistema di spalling tracciano in ogni momento. Se più proiettili sono sparati, non verranno tracciati. Abbassa questo parametro se non vuoi cali di FPS in scenari con molti proiettili (>200 proiettili in aria contemporaneamente) 時間が許すかぎり、破片と剥離システムの最大数を設定できます。設定数以上の弾丸が発射された場合、それは対象になりません。もし多い弾数による FPS の低下を望まない場合は、低い数へ設定にします。( &gt;一度に空中内で200発) + 이 설정은 조각 및 파편 시스템으로 인해 생긴 발사체의 수를 결정합니다. 만약 더 많은 발사체가 나올경우 정해진 수 이외에는 추적하지 않습니다. 이 설정을 낮춤으로써 파편이 많은 시나리오를 실행할때 더욱 원활히 진행할 수 있습니다 (한 번에 200개 이하) + 设定在指定时间内,系统最大可追踪的碎片/剥落粒子数量。如有更多的碎片在这之后产生,这些粒子将不会被追踪。如果你想要维持好的帧数,此设定勿调的过高。( >一次200颗粒子) + 設定在指定時間內,系統最大可追蹤的碎片/剝落粒子數量。如有更多的碎片在這之後產生,這些粒子將不會被追蹤。如果你想要維持好的幀數,此設定勿調的過高。( >一次200顆粒子) Maximum Projectiles Per Frame @@ -126,6 +153,9 @@ Макс. количество снарядов за кадр Numero massimo di proiettili per Frame フレームごとの最大弾頭数 + 프레임당 최대 발사체 수 + 每一帧数(FPS)最大碎片/剥落粒子数量 + 每一幀數(FPS)最大碎片/剝落粒子數量 The number of spall track calculations to perform in any given frame. This helps spread the FPS impact of tracking spall rounds across multiple frames, limiting its impact even further. @@ -139,6 +169,9 @@ Число обрабатываемых осколков за кадр. Это позволяет распределить нагрузку по отслеживанию осколков между несколькими кадрами, чтобы предотвратить падение FPS. Il numero di calcoli per tracciamento di spalling ad ogni frame. Questo aiuta a distribuire l'impatto del tracciamento dello spalling su più frame, limitando ancora di più l'impatto. 与えられたフレームごとに追跡する剥離の数を決定します。FPS に影響をあたえないよう、剥離を複数のフレームで追跡し、分散させています。 + 가능한 프레임마다 파편을 추적 및 계산합니다. 여러 프레임에 걸쳐 파편난 발사체를 추적하여 FPS에 도움을 줍니다. 이를 제한함으로써 더욱 큰 효과를 볼 수 있습니다. + 设定在每一帧数内,系统最大可追踪的碎片/剥落粒子数量。此设定可有效帮助系统减低计算压力。 + 設定在每一幀數內,系統最大可追蹤的碎片/剝落粒子數量。此設定可有效幫助系統減低計算壓力。 (SP Only) Frag/Spall Debug Tracing @@ -152,6 +185,9 @@ (Только для одиночной игры) Отслеживаение/отладка осколков (Solo SP) Debug Tracciamento Frag/Spall (SP のみ) 破片/剥離のデバッグ用表示 + (싱글플레이 전용) 조각/파편 디버그 추적화 + (仅在单人模式) 碎片/剥落除错追踪 + (僅在單人模式) 碎片/剝落除錯追蹤 (SP Only) Requires a mission/editor restart. Enables visual tracing of fragmentation and spalling rounds in SP game mode only. @@ -160,11 +196,14 @@ (nur SP) Splitter-/Explosions-Debugging (Pouze SP) Vyžaduje restart mise/editoru. Aktivuje vizuální stopování fragmentace a úlomů pouze v režimu jednoho hráče. (Somente SP) Requer um reinício de missão / editor. Habilita o rastreamento visual de projéteis de fragmentação e estilhaçamento apenas no modo de jogo SP. - (SP seulement) Requiert un redémarrage de mission ou de l'éditeur. Active les traceurs visuels de fragmentation et d'éclats en mode solo seulement + (SP seulement) Requiert un redémarrage de mission ou de l'éditeur. Active les traceurs visuels de fragmentation et d'éclats en mode solo seulement. (Csak SP) Küldetés/Editor újraindítás szükséges. Engedélyezi a repeszek és pattogzó lövedékek vizuális nyomkövetését, csak egyjátékos módok alatt. (Только для одиночной игры) Требует перезапуска миссии/редактора. Включает визуальные следы от осколков и обломков в режиме одиночной игры. (Solo SP) Richiede un restart editor/missione. Abilita il tracciamento visivo di schegge da frammentazione/spalling in modalità Giocatore Singolo. (SP のみ) ミッションとエディタの再起動が必要です。有効化すると、シングルプレイでのみ破片と剥離の弾頭が見えるようになります。 + (仅在单人模式) 让你在单人模式下可观察到碎片/剥落粒子的移动轨迹。 + (僅在單人模式) 讓你在單人模式下可觀察到碎片/剝落粒子的移動軌跡。 + (SP 전용) 임무 / 편집자가 다시 시작해야합니다. SP 게임 모드에서만 조각화 및 스 폴링 라운드의 시각적 추적을 가능하게합니다. - \ No newline at end of file + diff --git a/addons/gestures/CfgVehicles.hpp b/addons/gestures/CfgVehicles.hpp index 6eb3990446..1d94e5ecc4 100644 --- a/addons/gestures/CfgVehicles.hpp +++ b/addons/gestures/CfgVehicles.hpp @@ -1,5 +1,4 @@ class CfgVehicles { - class Man; class CAManBase: Man { class ACE_SelfActions { @@ -7,6 +6,7 @@ class CfgVehicles { displayName = CSTRING(Gestures); condition = QUOTE((canStand _target) && {GVAR(showOnInteractionMenu) == 2}); statement = ""; + exceptions[] = {"isNotSwimming"}; showDisabled = 1; priority = 3.5; icon = QPATHTOF(UI\gestures_ca.paa); @@ -14,42 +14,48 @@ class CfgVehicles { class GVAR(Advance) { displayName = CSTRING(Advance); condition = QUOTE(true); - statement = QUOTE([ARR_2(_target,'gestureAdvance')] call EFUNC(common,doGesture);); + statement = QUOTE([ARR_2(_target,'gestureAdvance')] call EFUNC(common,doGesture)); + //exceptions[] = {"isNotSwimming"}; // Does not work underwaterexceptions[] = {"isNotSwimming"}; showDisabled = 1; priority = 1.9; }; class GVAR(Go) { displayName = CSTRING(Go); condition = QUOTE(true); - statement = QUOTE([ARR_2(_target,selectRandom [ARR_2('gestureGo','gestureGoB')])] call EFUNC(common,doGesture);); + statement = QUOTE([ARR_2(_target,selectRandom [ARR_2('gestureGo','gestureGoB')])] call EFUNC(common,doGesture)); + //exceptions[] = {"isNotSwimming"}; // Does not work underwater showDisabled = 1; priority = 1.8; }; class GVAR(Follow) { displayName = CSTRING(Follow); condition = QUOTE(true); - statement = QUOTE([ARR_2(_target,'gestureFollow')] call EFUNC(common,doGesture);); + statement = QUOTE([ARR_2(_target,'gestureFollow')] call EFUNC(common,doGesture)); + //exceptions[] = {"isNotSwimming"}; // Does not work underwater showDisabled = 1; priority = 1.7; }; class GVAR(Up) { displayName = CSTRING(Up); condition = QUOTE(true); - statement = QUOTE([ARR_2(_target,'gestureUp')] call EFUNC(common,doGesture);); + statement = QUOTE([ARR_2(_target,'gestureUp')] call EFUNC(common,doGesture)); + //exceptions[] = {"isNotSwimming"}; // Does not work underwater showDisabled = 1; priority = 1.5; }; class GVAR(CeaseFire) { displayName = CSTRING(CeaseFire); condition = QUOTE(true); - statement = QUOTE([ARR_2(_target,'gestureCeaseFire')] call EFUNC(common,doGesture);); + statement = QUOTE([ARR_2(_target,'gestureCeaseFire')] call EFUNC(common,doGesture)); + //exceptions[] = {"isNotSwimming"}; // Does not work underwater showDisabled = 1; priority = 1.3; }; class GVAR(Stop) { displayName = CSTRING(Stop); condition = QUOTE(true); - statement = QUOTE([ARR_2(_target,'gestureFreeze')] call EFUNC(common,doGesture);); // BI animation - is actualls "stop" in all stances but prone + statement = QUOTE([ARR_2(_target,'gestureFreeze')] call EFUNC(common,doGesture)); // BI animation - is actually "stop" in all stances but prone + //exceptions[] = {"isNotSwimming"}; // Does not work underwater showDisabled = 1; priority = 1.2; }; @@ -57,6 +63,7 @@ class CfgVehicles { displayName = CSTRING(Forward); condition = QUOTE(true); statement = QUOTE(QUOTE(QGVAR(forward)) call FUNC(playSignal)); + exceptions[] = {"isNotSwimming"}; showDisabled = 1; priority = 1.9; }; @@ -64,6 +71,7 @@ class CfgVehicles { displayName = CSTRING(Regroup); condition = QUOTE(true); statement = QUOTE(QUOTE(QGVAR(regroup)) call FUNC(playSignal)); + exceptions[] = {"isNotSwimming"}; showDisabled = 1; priority = 1.8; }; @@ -71,6 +79,7 @@ class CfgVehicles { displayName = CSTRING(Freeze); condition = QUOTE(true); statement = QUOTE(QUOTE(QGVAR(freeze)) call FUNC(playSignal)); + exceptions[] = {"isNotSwimming"}; showDisabled = 1; priority = 1.7; }; @@ -78,6 +87,7 @@ class CfgVehicles { displayName = CSTRING(Cover); condition = QUOTE(true); statement = QUOTE(QUOTE(QGVAR(cover)) call FUNC(playSignal)); + exceptions[] = {"isNotSwimming"}; showDisabled = 1; priority = 1.6; }; @@ -85,6 +95,7 @@ class CfgVehicles { displayName = CSTRING(Point); condition = QUOTE(true); statement = QUOTE(QUOTE(QGVAR(point)) call FUNC(playSignal)); + exceptions[] = {"isNotSwimming"}; showDisabled = 1; priority = 1.5; }; @@ -92,6 +103,7 @@ class CfgVehicles { displayName = CSTRING(Engage); condition = QUOTE(true); statement = QUOTE(QUOTE(QGVAR(engage)) call FUNC(playSignal)); + exceptions[] = {"isNotSwimming"}; showDisabled = 1; priority = 1.4; }; @@ -99,6 +111,7 @@ class CfgVehicles { displayName = CSTRING(Hold); condition = QUOTE(true); statement = QUOTE(QUOTE(QGVAR(hold)) call FUNC(playSignal)); + exceptions[] = {"isNotSwimming"}; showDisabled = 1; priority = 1.3; }; @@ -106,6 +119,7 @@ class CfgVehicles { displayName = CSTRING(Warning); condition = QUOTE(true); statement = QUOTE(QUOTE(QGVAR(warning)) call FUNC(playSignal)); + exceptions[] = {"isNotSwimming"}; showDisabled = 1; priority = 1.2; }; diff --git a/addons/gestures/XEH_postInit.sqf b/addons/gestures/XEH_postInit.sqf index b2d5de86ef..935b81aa61 100644 --- a/addons/gestures/XEH_postInit.sqf +++ b/addons/gestures/XEH_postInit.sqf @@ -20,6 +20,8 @@ if (!hasInterface) exitWith {}; TRACE_4("Adding KeyBind",_currentName,_signalName,_code,_key); + ["ACE3 Gestures", localize LSTRING(ACEKeybindCategoryGestures)] call CBA_fnc_registerKeybindModPrettyName; + [ "ACE3 Gestures", _currentName, diff --git a/addons/gestures/XEH_preInit.sqf b/addons/gestures/XEH_preInit.sqf index a7feade1c3..b47cf6628d 100644 --- a/addons/gestures/XEH_preInit.sqf +++ b/addons/gestures/XEH_preInit.sqf @@ -2,6 +2,8 @@ ADDON = false; +PREP_RECOMPILE_START; #include "XEH_PREP.hpp" +PREP_RECOMPILE_END; ADDON = true; diff --git a/addons/gestures/anim/model.cfg b/addons/gestures/anim/model.cfg new file mode 100644 index 0000000000..be41a523a8 --- /dev/null +++ b/addons/gestures/anim/model.cfg @@ -0,0 +1,124 @@ +class cfgSkeletons +{ + class OFP2_ManSkeleton + { + isDiscrete = 0; + skeletonInherit = ""; + SkeletonBones[]= + { + "Pelvis","", + "Spine","Pelvis", + "Spine1","Spine", + "Spine2","Spine1", + "Spine3","Spine2", + "camera","Pelvis",// case has changed for arma3 + "weapon","Spine1", + "launcher","Spine1", + //Head skeleton in hierarchy + "Neck","Spine3", + "Neck1","Neck", + "Head","Neck1", + + //Left upper side + "LeftShoulder","Spine3", + "LeftArm","LeftShoulder", + "LeftArmRoll","LeftArm", + "LeftForeArm","LeftArmRoll", + "LeftForeArmRoll","LeftForeArm", + "LeftHand","LeftForeArmRoll", + "LeftHandRing","LeftHand", + "LeftHandRing1","LeftHandRing", + "LeftHandRing2","LeftHandRing1", + "LeftHandRing3","LeftHandRing2", + "LeftHandPinky1","LeftHandRing", + "LeftHandPinky2","LeftHandPinky1", + "LeftHandPinky3","LeftHandPinky2", + "LeftHandMiddle1","LeftHand", + "LeftHandMiddle2","LeftHandMiddle1", + "LeftHandMiddle3","LeftHandMiddle2", + "LeftHandIndex1","LeftHand", + "LeftHandIndex2","LeftHandIndex1", + "LeftHandIndex3","LeftHandIndex2", + "LeftHandThumb1","LeftHand", + "LeftHandThumb2","LeftHandThumb1", + "LeftHandThumb3","LeftHandThumb2", + //Right upper side + "RightShoulder","Spine3", + "RightArm","RightShoulder", + "RightArmRoll","RightArm", + "RightForeArm","RightArmRoll", + "RightForeArmRoll","RightForeArm", + "RightHand","RightForeArmRoll", + "RightHandRing","RightHand", + "RightHandRing1","RightHandRing", + "RightHandRing2","RightHandRing1", + "RightHandRing3","RightHandRing2", + "RightHandPinky1","RightHandRing", + "RightHandPinky2","RightHandPinky1", + "RightHandPinky3","RightHandPinky2", + "RightHandMiddle1","RightHand", + "RightHandMiddle2","RightHandMiddle1", + "RightHandMiddle3","RightHandMiddle2", + "RightHandIndex1","RightHand", + "RightHandIndex2","RightHandIndex1", + "RightHandIndex3","RightHandIndex2", + "RightHandThumb1","RightHand", + "RightHandThumb2","RightHandThumb1", + "RightHandThumb3","RightHandThumb2", + //Left lower side + "LeftUpLeg","Pelvis", + "LeftUpLegRoll","LeftUpLeg", + "LeftLeg","LeftUpLegRoll", + "LeftLegRoll","LeftLeg", + "LeftFoot","LeftLegRoll", + "LeftToeBase","LeftFoot", + //Right lower side + "RightUpLeg","Pelvis", + "RightUpLegRoll","RightUpLeg", + "RightLeg","RightUpLegRoll", + "RightLegRoll","RightLeg", + "RightFoot","RightLegRoll", + "RightToeBase","RightFoot", + + //New facial features arma3 only + "Face_Hub","Head", + "Face_Jawbone","Face_Hub", + "Face_Jowl","Face_Jawbone", + "Face_chopRight","Face_Jawbone", + "Face_chopLeft","Face_Jawbone", + "Face_LipLowerMiddle","Face_Jawbone", + "Face_LipLowerLeft","Face_Jawbone", + "Face_LipLowerRight","Face_Jawbone", + "Face_Chin","Face_Jawbone", + "Face_Tongue","Face_Jawbone", + "Face_CornerRight","Face_Hub", + "Face_CheekSideRight","Face_CornerRight", + "Face_CornerLeft","Face_Hub", + "Face_CheekSideLeft","Face_CornerLeft", + "Face_CheekFrontRight","Face_Hub", + "Face_CheekFrontLeft","Face_Hub", + "Face_CheekUpperRight","Face_Hub", + "Face_CheekUpperLeft","Face_Hub", + "Face_LipUpperMiddle","Face_Hub", + "Face_LipUpperRight","Face_Hub", + "Face_LipUpperLeft","Face_Hub", + "Face_NostrilRight","Face_Hub", + "Face_NostrilLeft","Face_Hub", + "Face_Forehead","Face_Hub", + "Face_BrowFrontRight","Face_Forehead", + "Face_BrowFrontLeft","Face_Forehead", + "Face_BrowMiddle","Face_Forehead", + "Face_BrowSideRight","Face_Forehead", + "Face_BrowSideLeft","Face_Forehead", + "Face_Eyelids","Face_Hub", + "Face_EyelidUpperRight","Face_Hub", + "Face_EyelidUpperLeft","Face_Hub", + "Face_EyelidLowerRight","Face_Hub", + "Face_EyelidLowerLeft","Face_Hub", + "EyeLeft","Face_Hub", + "EyeRight","Face_Hub" + };// end of skeleton array + // location of pivot points (local axes) for hierarchical animation + pivotsModel="Samples_F\TemplateRTM\ManSkeleton_Pivots.p3d"; + }; +}; diff --git a/addons/gestures/functions/fnc_playSignal.sqf b/addons/gestures/functions/fnc_playSignal.sqf index 273db82da1..68a3c1c044 100644 --- a/addons/gestures/functions/fnc_playSignal.sqf +++ b/addons/gestures/functions/fnc_playSignal.sqf @@ -6,7 +6,7 @@ * Animation * * Return Value: - * + * Boolean * * Example: * "GeniusAnimation" call ace_gestures_fnc_playSignal @@ -18,7 +18,7 @@ TRACE_1("params",_this); if (GVAR(showOnInteractionMenu) == 0) exitWith {false}; -if !([ACE_player, objNull, []] call EFUNC(common,canInteractWith)) exitWith {false}; +if !([ACE_player, objNull, ["isNotSwimming"]] call EFUNC(common,canInteractWith)) exitWith {false}; private _gesture = if ((_this select [0,2]) == "BI") then { //If it starts with BI, just strip off the leading BI and use it directly diff --git a/addons/gestures/stringtable.xml b/addons/gestures/stringtable.xml index 3c033a94ac..05c5d98e90 100644 --- a/addons/gestures/stringtable.xml +++ b/addons/gestures/stringtable.xml @@ -1,6 +1,22 @@  + + ACE3 Gestures + ACE3 Gesten + ACE3 Gesty + ACE3 Posunky + ACE3 Gestes + ACE3 Kézjelek + Gesti ACE3 + ACE3 Gestos + ACE3 Жесты + ACE3 Gestos + ACE3 ジェスチャー + ACE3 수신호 + ACE3 手势 + ACE3 手勢 + ACE Gestures ACE Gesten @@ -8,11 +24,14 @@ ACE Posunky ACE Gestes ACE Kézjelek - ACE Gesti + Gesti ACE ACE Gestos ACE Жесты ACE Gestos ACE ジェスチャー + ACE 수신호 + ACE 手势 + ACE 手勢 Gestures @@ -26,6 +45,9 @@ Gestos Gesti ジェスチャー + 수신호 + 手势 + 手勢 Advance @@ -39,6 +61,9 @@ Avançar Avanzare 警戒 + 전진 + 前进 + 前進 Go @@ -52,6 +77,9 @@ Mover-se Muoversi 進め + 이동 + 出发 + 出發 Follow @@ -65,6 +93,9 @@ Seguir Seguire ついて来い + 따라올것 + 跟进 + 跟進 Up @@ -78,6 +109,9 @@ Acima Alzarsi 立ち上がれ + + 起立 + 起立 Cease Fire @@ -91,6 +125,9 @@ Cessar Fogo Cessare il Fuoco 撃つな + 사격 중지 + 停火 + 停火 Stop @@ -103,6 +140,9 @@ Stop Detenerse 止まれ + 멈춰 + 停止 + 停止 Freeze @@ -116,6 +156,9 @@ Alto Fermi 動くな + 정지 + 不准动 + 不准動 Cover @@ -129,6 +172,9 @@ Proteger-se Copertura 隠れろ + 엄폐 + 掩护 + 掩護 Rally up @@ -141,6 +187,9 @@ Raggruppare Reunirse 集合 + 집결 + 集合 + 集合 Move forward @@ -153,6 +202,9 @@ Muovere avanti Avanzar 前に進め + 앞으로 이동 + 往前走 + 往前走 Engage @@ -165,6 +217,9 @@ Ingaggiare Atacar 交戦しろ + 교전할것 + 交战 + 交戰 Point @@ -177,6 +232,9 @@ Puntare Señalar 指示 + 가리키기 + 指出 + 指出 Hold @@ -189,6 +247,9 @@ Mantenere Esperar そこにいろ + 기다려 + 停住 + 停住 Warning @@ -201,6 +262,9 @@ Attenzione Atención 注意 + 주의 + 警告 + 警告 Show Gestures On Interaction Menu @@ -213,42 +277,54 @@ Mostrar gestos no menu de interação Показать жесты в меню взаимодействия インタラクション メニュー上でジェスチャーを表示する + 수신호를 상호작용 메뉴에서 보여줍니다 + 显示手势互动选单 + 顯示手勢互動選單 Show gestures on the self interaction menu, or just use keybinds, or disable completely Zeige Gesten im Selbst-Interkationsmenü, lege sie auf Schnelltasten, oder deaktiviere sie vollständig. Zobrazit posunky pro vlastní interakční menu, nebo prostě použít klávesové zkratky, nebo to zakázat úplně Pokaż listę gestów w menu własnej interakcji, użyj tylko skrótów na klawiaturze lub wyłącz całkowicie - Mostra Gesti nel Menù Interazione Personale, o usa solamente Hotkey, o disabilita completamente + Mostra Gesti nel Menù Interazione Personale, o usa solamente tasti di scelta rapida, o disabilita completamente Muestror los gestos en el menú de interacción propia, utilizar solo combinación de teclas o desactivarlos completamente Afficher les gestes dans le menu d'interaction personnel, ou seulement utiliser les touches, ou desactiver complètement. Mostra gestos no menu de interação, ou utilize um dos atalhos de teclado ou desative completamente Показать жесты в меню взамиодейтсвия с собой или только использовать горячие клавиши, или полностью отключить キー操作や同時使用を無効化している場合はセルフ インタラクション メニュ上でジェスチャーを表示します + 수신호를 상호작용 메뉴에서 보여주거나 혹은 단축키를 지정하거나 아니면 아예 사용하지 않습니다. + 显示手势选项在自己的互动选单上,或只利用键盘来使用手势,或完全禁用 + 顯示手勢選項在自己的互動選單上,或只利用鍵盤來使用手勢,或完全禁用 Just Keybinds Nur Schnelltasten Pouze klávesové zkratky Tylko skróty klaw. - Solo Hotkey + Solo tasti di scelta rapida Solo mediante teclas Seulement les touches Somente atalhos de teclado Только горячие клавиши キー操作のみ + 오직 단축키만 + 只利用键盘 + 只利用鍵盤 Keybinds + Interaction Menu Schnelltasten+ Interaktionsmenü Klávesové zkratky + interakční menu Skróty klaw. + menu interakcji - Hotkey + Menù Interazione + Tasti di scelta rapida + Menù Interazione Teclas y Menú de Interacción Touches + menu d'interaction Atalhos + Menu de Interação Клавиши + Меню взаимодействия キー操作とインタラクション メニュ + 단축키및 상호작용 메뉴 + 键盘 + 互动选单 + 鍵盤 + 互動選單 - \ No newline at end of file + diff --git a/addons/gforces/XEH_postInit.sqf b/addons/gforces/XEH_postInit.sqf index 9eb049c9f5..f7d532c288 100644 --- a/addons/gforces/XEH_postInit.sqf +++ b/addons/gforces/XEH_postInit.sqf @@ -3,22 +3,26 @@ if (!hasInterface) exitWith {}; GVAR(pfID) = -1; +GVAR(playerIsVirtual) = false; ["ace_settingsInitialized", { TRACE_1("SettingsInitialized eh",GVAR(enabledFor)); if (GVAR(enabledFor) == 0) exitWith {}; //Module has no effect if enabledFor is "None" + + ["unit", { // Add unit changed EH to check if player is either virtual (logic) or a UAV AI + params ["_unit"]; + GVAR(playerIsVirtual) = ((getNumber (configFile >> "CfgVehicles" >> (typeOf _unit) >> "isPlayableLogic")) == 1) || + {(getText (configFile >> "CfgVehicles" >> (typeOf _unit) >> "simulation")) == "UAVPilot"}; + TRACE_3("unit changed",_unit,typeOf _unit,GVAR(playerIsVirtual)); + }, true] call CBA_fnc_addPlayerEventHandler; + if (GVAR(enabledFor) == 2) exitWith { //PFEH is always on when enabledFor is "All" [] call FUNC(addPFEH); TRACE_1("adding perm PFEH",GVAR(pfID)); }; //PFEH only runs when player is in a type "Air" vehicle when enabledFor is "Aircraft" - - if ((!isNull (vehicle ACE_player)) && {(vehicle ACE_player) isKindOf "Air"}) then { //"playerVehicleChanged" can happen before "settingInit" - [] call FUNC(addPFEH); - TRACE_1("adding temp PFEH [start in]",GVAR(pfID)); - }; ["vehicle", { params ["", "_vehicle"]; TRACE_2("playerVehicleChanged",_vehicle,typeOf _vehicle); @@ -35,5 +39,5 @@ GVAR(pfID) = -1; GVAR(pfID) = -1; }; }; - }] call CBA_fnc_addPlayerEventHandler; + }, true] call CBA_fnc_addPlayerEventHandler; }] call CBA_fnc_addEventHandler; diff --git a/addons/gforces/XEH_preInit.sqf b/addons/gforces/XEH_preInit.sqf index 99e6461c54..7530cabc45 100644 --- a/addons/gforces/XEH_preInit.sqf +++ b/addons/gforces/XEH_preInit.sqf @@ -2,7 +2,9 @@ ADDON = false; +PREP_RECOMPILE_START; #include "XEH_PREP.hpp" +PREP_RECOMPILE_END; GVAR(GForces) = []; GVAR(GForces_Index) = 0; diff --git a/addons/gforces/functions/fnc_addPFEH.sqf b/addons/gforces/functions/fnc_addPFEH.sqf index 9bd4d7fa1a..2464575fdc 100644 --- a/addons/gforces/functions/fnc_addPFEH.sqf +++ b/addons/gforces/functions/fnc_addPFEH.sqf @@ -8,12 +8,19 @@ * Return Value: * None * + * Example: + * call ace_gforces_fnc_addPFEH + * * Public: No */ #include "script_component.hpp" //Reset forces array GVAR(GForces) = []; +// init array to full array of neutral g-forces +GVAR(GForces) resize 30; +GVAR(GForces) = GVAR(GForces) apply {1}; + GVAR(GForces_Index) = 0; // Setup ppEffect @@ -26,4 +33,4 @@ GVAR(GForces_CC) ppEffectCommit 0.4; GVAR(lastUpdateTime) = 0; GVAR(oldVel) = [0,0,0]; -GVAR(pfID) = [DFUNC(pfhUpdateGForces), 0, []] call CBA_fnc_addPerFrameHandler; +GVAR(pfID) = [LINKFUNC(pfhUpdateGForces), 0, []] call CBA_fnc_addPerFrameHandler; diff --git a/addons/gforces/functions/fnc_pfhUpdateGForces.sqf b/addons/gforces/functions/fnc_pfhUpdateGForces.sqf index 48370c2431..98e633f500 100644 --- a/addons/gforces/functions/fnc_pfhUpdateGForces.sqf +++ b/addons/gforces/functions/fnc_pfhUpdateGForces.sqf @@ -9,6 +9,9 @@ * Return Value: * None * + * Example: + * [[args], 5] call ace_gforces_fnc_pfhUpdateGForces + * * Public: No */ #include "script_component.hpp" @@ -17,7 +20,7 @@ if ((CBA_missionTime - GVAR(lastUpdateTime)) < INTERVAL) exitWith {}; GVAR(lastUpdateTime) = CBA_missionTime; -if (isNull ACE_player || !(alive ACE_player)) exitWith {}; +if (GVAR(playerIsVirtual) || {!alive ACE_player}) exitWith {}; BEGIN_COUNTER(everyInterval); @@ -27,7 +30,7 @@ private _accel = ((_newVel vectorDiff GVAR(oldVel)) vectorMultiply (1 / INTERVAL private _currentGForce = (((_accel vectorDotProduct vectorUp (vehicle ACE_player)) / 9.8) max -10) min 10; GVAR(GForces) set [GVAR(GForces_Index), _currentGForce]; -GVAR(GForces_Index) = (GVAR(GForces_Index) + 1) % round (AVERAGEDURATION / INTERVAL); +GVAR(GForces_Index) = (GVAR(GForces_Index) + 1) % 30; // 30 = round (AVERAGEDURATION / INTERVAL); GVAR(oldVel) = _newVel; /* Source: https://github.com/KoffeinFlummi/AGM/issues/1774#issuecomment-70341573 diff --git a/addons/gforces/stringtable.xml b/addons/gforces/stringtable.xml index a1597eb6d5..12d3d0ba53 100644 --- a/addons/gforces/stringtable.xml +++ b/addons/gforces/stringtable.xml @@ -1,4 +1,4 @@ - + @@ -11,6 +11,10 @@ Эффекты перегрузок G による効果 Efekty przeciążeń + 중력가속도 효과 + Effetti forza G + G力影响 + G力影響 Only Aircraft @@ -22,6 +26,10 @@ Только для летательных аппаратов 航空機のみ Tylko samoloty + 비행기에만 적용 + Solo Aerei + 只有战斗机 + 只有戰鬥機 diff --git a/addons/goggles/XEH_postInit.sqf b/addons/goggles/XEH_postInit.sqf index b7b5de9e1b..5b93a7a459 100644 --- a/addons/goggles/XEH_postInit.sqf +++ b/addons/goggles/XEH_postInit.sqf @@ -20,7 +20,7 @@ if (!hasInterface) exitWith {}; if (GVAR(effects) == 0) exitWith {}; // ---Add the TINT Effect--- - + // make sure to stack effect layers in correct order GVAR(GogglesEffectsLayer) = QGVAR(GogglesEffectsLayer) call BIS_fnc_RSCLayer; GVAR(GogglesLayer) = QGVAR(GogglesLayer) call BIS_fnc_RSCLayer; @@ -29,6 +29,26 @@ if (!hasInterface) exitWith {}; GVAR(UsePP) = true; }; + // init pp effects + GVAR(PostProcess) = ppEffectCreate ["ColorCorrections", 1995]; + GVAR(EffectsActive) = false; + + // add glasses eventhandlers + ["ace_glassesChanged", { + params ["_unit", "_glasses"]; + TRACE_2("ace_glassesChanged eh",_unit,_glasses); + + SETGLASSES(_unit,GLASSESDEFAULT); + + if (call FUNC(ExternalCamera)) exitWith {call FUNC(RemoveGlassesEffect)}; + + if ([_unit] call FUNC(isGogglesVisible)) then { + [_unit, _glasses] call FUNC(applyGlassesEffect); + } else { + call FUNC(removeGlassesEffect); + }; + }] call CBA_fnc_addEventHandler; + // init GlassesChanged eventhandler GVAR(OldGlasses) = ""; ["loadout", { @@ -40,12 +60,9 @@ if (!hasInterface) exitWith {}; ["ace_glassesChanged", [_unit, _currentGlasses]] call CBA_fnc_localEvent; GVAR(OldGlasses) = _currentGlasses; }; - }] call CBA_fnc_addPlayerEventHandler; + }, true] call CBA_fnc_addPlayerEventHandler; - // init pp effects - GVAR(PostProcess) = ppEffectCreate ["ColorCorrections", 1995]; - GVAR(EffectsActive) = false; // check goggles private _fnc_checkGoggles = { @@ -57,7 +74,7 @@ if (!hasInterface) exitWith {}; }; } else { if (!(call FUNC(externalCamera)) && {[_unit] call FUNC(isGogglesVisible)}) then { - [goggles _unit] call FUNC(applyGlassesEffect); + [_unit, goggles _unit] call FUNC(applyGlassesEffect); }; }; }; @@ -66,21 +83,6 @@ if (!hasInterface) exitWith {}; ["ace_activeCameraChanged", _fnc_checkGoggles] call CBA_fnc_addEventHandler; - // add glasses eventhandlers - ["ace_glassesChanged", { - params ["_unit", "_glasses"]; - - SETGLASSES(_unit,GLASSESDEFAULT); - - if (call FUNC(ExternalCamera)) exitWith {call FUNC(RemoveGlassesEffect)}; - - if ([_unit] call FUNC(isGogglesVisible)) then { - _glasses call FUNC(applyGlassesEffect); - } else { - call FUNC(removeGlassesEffect); - }; - }] call CBA_fnc_addEventHandler; - // // ---Add the Dust/Dirt/Rain Effects--- if (GVAR(effects) == 2) then { @@ -96,7 +98,7 @@ if (!hasInterface) exitWith {}; GVAR(PostProcessEyes) ppEffectCommit 0; GVAR(PostProcessEyes) ppEffectEnable false; GVAR(PostProcessEyes_Enabled) = false; - + GVAR(FrameEvent) = [false, [false, 20]]; GVAR(DustHandler) = -1; GVAR(RainDrops) = objNull; diff --git a/addons/goggles/XEH_preInit.sqf b/addons/goggles/XEH_preInit.sqf index a7feade1c3..b47cf6628d 100644 --- a/addons/goggles/XEH_preInit.sqf +++ b/addons/goggles/XEH_preInit.sqf @@ -2,6 +2,8 @@ ADDON = false; +PREP_RECOMPILE_START; #include "XEH_PREP.hpp" +PREP_RECOMPILE_END; ADDON = true; diff --git a/addons/goggles/define.hpp b/addons/goggles/define.hpp index 7f83930774..38271ccc67 100644 --- a/addons/goggles/define.hpp +++ b/addons/goggles/define.hpp @@ -7,7 +7,6 @@ //////////////// class RscPicture { - access = 0; idc = -1; type = CT_STATIC; style = ST_PICTURE; diff --git a/addons/goggles/functions/fnc_applyDirtEffect.sqf b/addons/goggles/functions/fnc_applyDirtEffect.sqf index 46f079dc38..2c50595e86 100644 --- a/addons/goggles/functions/fnc_applyDirtEffect.sqf +++ b/addons/goggles/functions/fnc_applyDirtEffect.sqf @@ -17,11 +17,9 @@ if (call FUNC(externalCamera)) exitWith {false}; -private ["_unit", "_effects"]; +private _unit = ACE_player; -_unit = ACE_player; - -_effects = GETGLASSES(_unit); +private _effects = GETGLASSES(_unit); _effects set [DIRT, true]; SETGLASSES(_unit,_effects); diff --git a/addons/goggles/functions/fnc_applyDustEffect.sqf b/addons/goggles/functions/fnc_applyDustEffect.sqf index 6277d34c21..3568137a1f 100644 --- a/addons/goggles/functions/fnc_applyDustEffect.sqf +++ b/addons/goggles/functions/fnc_applyDustEffect.sqf @@ -17,9 +17,7 @@ if (call FUNC(ExternalCamera)) exitWith {}; -private ["_unit", "_amount"]; - -_unit = ACE_player; +private _unit = ACE_player; if ([_unit] call FUNC(isGogglesVisible)) exitWith { GVAR(GogglesEffectsLayer) cutRsc ["RscACE_GogglesEffects", "PLAIN", 2, false]; @@ -42,7 +40,7 @@ if (GETVAR(_unit,ACE_EyesDamaged,false)) exitWith { SETDUST(DAMOUNT,CLAMP(GETDUSTT(DAMOUNT) + 1,0,2)); -_amount = 1 - (GETDUSTT(DAMOUNT) * 0.125); +private _amount = 1 - (GETDUSTT(DAMOUNT) * 0.125); GVAR(PostProcessEyes) ppEffectAdjust [1, 1, 0, [0, 0, 0, 0], [_amount, _amount, _amount, _amount], [1, 1, 1, 0]]; GVAR(PostProcessEyes) ppEffectCommit 1; diff --git a/addons/goggles/functions/fnc_applyGlassesEffect.sqf b/addons/goggles/functions/fnc_applyGlassesEffect.sqf index 71a5b3b84c..ccefe45541 100644 --- a/addons/goggles/functions/fnc_applyGlassesEffect.sqf +++ b/addons/goggles/functions/fnc_applyGlassesEffect.sqf @@ -5,29 +5,33 @@ * Sets dirt/rain overlay for glasses. * * Arguments: - * 0: Glasses classname to be applied + * 0: Player + * 1: Glasses classname to be applied * * Return Value: * None * * Example: - * [goggles ace_player] call ace_goggles_fnc_applyGlassesEffect + * [ace_player, goggles ace_player] call ace_goggles_fnc_applyGlassesEffect * * Public: No */ #include "script_component.hpp" -params ["_glasses"]; +params ["_player", "_glasses"]; +TRACE_2("applyGlassesEffect",_player,_glasses); // remove old effect call FUNC(removeGlassesEffect); -private ["_config", "_postProcessColour", "_postProcessTintAmount", "_imagePath"]; +if ((getNumber (configFile >> "CfgVehicles" >> (typeOf _player) >> "isPlayableLogic")) == 1) exitWith { + TRACE_1("skipping playable logic",typeOf _player); // VirtualMan_F (placeable logic zeus / spectator) +}; -_config = configFile >> "CfgGlasses" >> _glasses; +private _config = configFile >> "CfgGlasses" >> _glasses; -_postProcessColour = getArray (_config >> "ACE_Color"); -_postProcessTintAmount = getNumber (_config >> "ACE_TintAmount"); +private _postProcessColour = getArray (_config >> "ACE_Color"); +private _postProcessTintAmount = getNumber (_config >> "ACE_TintAmount"); if (_postProcessTintAmount != 0 && {GVAR(UsePP)}) then { _postProcessColour set [3, _postProcessTintAmount/100]; @@ -39,7 +43,7 @@ if (_postProcessTintAmount != 0 && {GVAR(UsePP)}) then { GVAR(PostProcess) ppEffectCommit 30; }; -_imagePath = getText (_config >> ["ACE_Overlay", "ACE_OverlayCracked"] select GETBROKEN); +private _imagePath = getText (_config >> ["ACE_Overlay", "ACE_OverlayCracked"] select GETBROKEN); if (_imagePath != "") then { GVAR(GogglesLayer) cutRsc ["RscACE_Goggles", "PLAIN", 1, false]; diff --git a/addons/goggles/functions/fnc_applyRainEffect.sqf b/addons/goggles/functions/fnc_applyRainEffect.sqf index 01b2894d87..183335740f 100644 --- a/addons/goggles/functions/fnc_applyRainEffect.sqf +++ b/addons/goggles/functions/fnc_applyRainEffect.sqf @@ -15,13 +15,11 @@ */ #include "script_component.hpp" -private ["_unit", "_fnc_underCover"]; - -_unit = ACE_player; +private _unit = ACE_player; if (!alive _unit) exitWith {}; -_fnc_underCover = { +private _fnc_underCover = { params ["_unit"]; if (vehicle _unit != _unit && {!isTurnedOut _unit}) exitWith {true}; diff --git a/addons/goggles/functions/fnc_applyRotorWashEffect.sqf b/addons/goggles/functions/fnc_applyRotorWashEffect.sqf index 7a883ab7e7..ffe75f808e 100644 --- a/addons/goggles/functions/fnc_applyRotorWashEffect.sqf +++ b/addons/goggles/functions/fnc_applyRotorWashEffect.sqf @@ -15,9 +15,7 @@ */ #include "script_component.hpp" -private ["_unit", "_fnc_underCover"]; - -_unit = ACE_player; +private _unit = ACE_player; if (!alive _unit) exitWith {}; @@ -33,10 +31,9 @@ if (GVAR(FrameEvent) select 0) exitWith { }; // check if the unit is affected by rotor wash -private ["_rotorWash", "_safe"]; -_rotorWash = GVAR(FrameEvent) select 1; -_safe = false; +private _rotorWash = GVAR(FrameEvent) select 1; +private _safe = false; // no rotor wash? remove effects. if !(_rotorWash select 0) exitWith { diff --git a/addons/goggles/functions/fnc_clearGlasses.sqf b/addons/goggles/functions/fnc_clearGlasses.sqf index b01960527a..c75d94ae1c 100644 --- a/addons/goggles/functions/fnc_clearGlasses.sqf +++ b/addons/goggles/functions/fnc_clearGlasses.sqf @@ -16,12 +16,10 @@ */ #include "script_component.hpp" -private ["_unit", "_broken", "_effects"]; +private _unit = ACE_player; -_unit = ACE_player; - -_broken = GETBROKEN; -_effects = GLASSESDEFAULT; +private _broken = GETBROKEN; +private _effects = GLASSESDEFAULT; _effects set [BROKEN, _broken]; SETGLASSES(_unit,_effects); diff --git a/addons/goggles/functions/fnc_handleExplosion.sqf b/addons/goggles/functions/fnc_handleExplosion.sqf index 44be6ab6c1..129cd6fc36 100644 --- a/addons/goggles/functions/fnc_handleExplosion.sqf +++ b/addons/goggles/functions/fnc_handleExplosion.sqf @@ -8,6 +8,9 @@ * Return Value: * Function is handled? * + * Example: + * [bob] call ace_goggles_fnc_handleExplosion + * * Public: No */ #include "script_component.hpp" @@ -20,9 +23,7 @@ call FUNC(applyDirtEffect); if (GETBROKEN) exitWith {true}; -private ["_config", "_effects"]; - -_config = configFile >> "CfgGlasses" >> goggles _unit; +private _config = configFile >> "CfgGlasses" >> goggles _unit; if ((_this select 1) call FUNC(GetExplosionIndex) < getNumber (_config >> "ACE_Resistance")) exitWith {true}; @@ -31,7 +32,7 @@ if !([_unit] call FUNC(isGogglesVisible)) exitWith { true }; -_effects = GETGLASSES(_unit); +private _effects = GETGLASSES(_unit); _effects set [BROKEN, true]; SETGLASSES(_unit,_effects); diff --git a/addons/goggles/functions/fnc_handleFired.sqf b/addons/goggles/functions/fnc_handleFired.sqf index 066bc040f7..95a22d0a03 100644 --- a/addons/goggles/functions/fnc_handleFired.sqf +++ b/addons/goggles/functions/fnc_handleFired.sqf @@ -8,6 +8,9 @@ * Return Value: * Function is handled? * + * Example: + * call ace_goggles_fnc_handleFired + * * Public: No */ #include "script_component.hpp" @@ -21,17 +24,15 @@ if (rain > 0.1) exitWith {true}; // effect only aplies when lying on the ground if (stance _unit != "PRONE") exitWith {true}; -private ["_position", "_particleConfig", "_cloudType", "_surface", "_bullets"]; - // check if the unit really is on the ground and not in a building -_position = getPosATL _unit; +private _position = getPosATL _unit; if (_position select 2 > 0.2) exitWith {true}; // get weapon dust effect -_particleConfig = configFile >> "CfgWeapons" >> _weapon >> "GunParticles"; +private _particleConfig = configFile >> "CfgWeapons" >> _weapon >> "GunParticles"; -_cloudType = ""; +private _cloudType = ""; if (isClass (_particleConfig >> "FirstEffect")) then { // @todo read this with custom / non-standard config classnames _cloudType = getText (_particleConfig >> "FirstEffect" >> "effectName"); @@ -47,7 +48,7 @@ if (_cloudType == "") exitWith {true}; // get if the surface is dusty if (surfaceIsWater _position) exitWith {true}; -_surface = surfaceType _position select [1]; // cuts of the leading # +private _surface = surfaceType _position select [1]; // cuts of the leading # if (_surface != GVAR(surfaceCache)) then { GVAR(surfaceCache) = _surface; @@ -58,7 +59,7 @@ if (_surface != GVAR(surfaceCache)) then { if (!GVAR(surfaceCacheIsDust)) exitWith {true}; // increment dust value with type bullet -_bullets = GETDUSTT(DBULLETS); +private _bullets = GETDUSTT(DBULLETS); if (diag_tickTime - GETDUSTT(DTIME) > 1) then { _bullets = 0; diff --git a/addons/goggles/functions/fnc_handleKilled.sqf b/addons/goggles/functions/fnc_handleKilled.sqf index b9af2e075b..001a4041b8 100644 --- a/addons/goggles/functions/fnc_handleKilled.sqf +++ b/addons/goggles/functions/fnc_handleKilled.sqf @@ -8,6 +8,9 @@ * Return Value: * Function is handled? * + * Example: + * [bob] call ace_goggles_fnc_handleKilled + * * Public: No */ #include "script_component.hpp" diff --git a/addons/goggles/functions/fnc_isGogglesVisible.sqf b/addons/goggles/functions/fnc_isGogglesVisible.sqf index dfa2b97087..f1205b5df6 100644 --- a/addons/goggles/functions/fnc_isGogglesVisible.sqf +++ b/addons/goggles/functions/fnc_isGogglesVisible.sqf @@ -17,9 +17,7 @@ params ["_unit"]; -private ["_currentGlasses", "_position"]; - -_currentGlasses = goggles _unit; +private _currentGlasses = goggles _unit; if (_currentGlasses == "") exitWith {false}; @@ -27,6 +25,6 @@ if (_currentGlasses == "") exitWith {false}; if (getNumber (configFile >> "CfgGlasses" >> _currentGlasses >> "ACE_Resistance") == 0) exitWith {false}; // check if in water and has diving goggles or on land and not diving goggles -_position = getPosASLW _unit; +private _position = getPosASLW _unit; (surfaceIsWater _position && {_position select 2 < 0.25}) isEqualTo (_currentGlasses call FUNC(isDivingGoggles)) // return diff --git a/addons/goggles/functions/fnc_isInRotorWash.sqf b/addons/goggles/functions/fnc_isInRotorWash.sqf index 319da3a875..80e1bdd8e8 100644 --- a/addons/goggles/functions/fnc_isInRotorWash.sqf +++ b/addons/goggles/functions/fnc_isInRotorWash.sqf @@ -7,7 +7,7 @@ * 1: Radius to check for helicopter (default: 15) * * Return Value: - * : + * Array : * 0: In rotorwash * 1: Amount of rotor wash. * diff --git a/addons/goggles/stringtable.xml b/addons/goggles/stringtable.xml index fa31607242..309a420a46 100644 --- a/addons/goggles/stringtable.xml +++ b/addons/goggles/stringtable.xml @@ -1,4 +1,4 @@ - + @@ -13,6 +13,9 @@ Mostrar efeitos de óculos em Terceira Pessoa Attiva l'effetto degli occhiali in terza persona 三人称視点でもゴーグルによる効果を出す + 3인칭시에도 고글 효과를 보이게 합니다 + 在第三人称视角显示护目镜效果 + 在第三人稱視角顯示護目鏡效果 Wipe Goggles @@ -26,24 +29,45 @@ Limpar Óculos Pulisci gli occhiali ゴーグルを拭く + 고글 닦기 + 擦拭护目镜 + 擦拭護目鏡 Goggle Effects Эффект очков ゴーグルによる効果 Efekty gogli + Brilleneffekt + 고글 효과 + Effets des lunettes + Effetto Occhiali + 护目镜效果 + 護目鏡效果 Tint Тонировка 色彩のみ Winieta + Tönung + 색조 + Teinte + Colore + 染色 + 染色 Tint + Effects Тонировка + эффекты 色彩 + 効果 Winieta + Efekty + Tönung + Effekte + 색조+효과 + Teinte + effets + Colore + Effetti + 染色 + 影响 + 染色 + 影響 diff --git a/addons/grenades/CfgVehicles.hpp b/addons/grenades/CfgVehicles.hpp index 1315ccf611..f9ac60d9fe 100644 --- a/addons/grenades/CfgVehicles.hpp +++ b/addons/grenades/CfgVehicles.hpp @@ -2,40 +2,40 @@ class CfgVehicles { class NATO_Box_Base; class Box_NATO_Grenades_F: NATO_Box_Base { - class TransportItems { - MACRO_ADDITEM(ACE_HandFlare_White,12); - MACRO_ADDITEM(ACE_HandFlare_Green,12); - MACRO_ADDITEM(ACE_M84,12); + class TransportMagazines { + MACRO_ADDMAGAZINE(ACE_HandFlare_White,12); + MACRO_ADDMAGAZINE(ACE_HandFlare_Green,12); + MACRO_ADDMAGAZINE(ACE_M84,12); }; }; class EAST_Box_Base; class Box_East_Grenades_F: EAST_Box_Base { - class TransportItems { - MACRO_ADDITEM(ACE_HandFlare_Yellow,12); - MACRO_ADDITEM(ACE_HandFlare_Red,12); - MACRO_ADDITEM(ACE_M84,12); + class TransportMagazines { + MACRO_ADDMAGAZINE(ACE_HandFlare_Yellow,12); + MACRO_ADDMAGAZINE(ACE_HandFlare_Red,12); + MACRO_ADDMAGAZINE(ACE_M84,12); }; }; class IND_Box_Base; class Box_IND_Grenades_F: IND_Box_Base { - class TransportItems { - MACRO_ADDITEM(ACE_HandFlare_Yellow,12); - MACRO_ADDITEM(ACE_HandFlare_Green,12); - MACRO_ADDITEM(ACE_M84,12); + class TransportMagazines { + MACRO_ADDMAGAZINE(ACE_HandFlare_Yellow,12); + MACRO_ADDMAGAZINE(ACE_HandFlare_Green,12); + MACRO_ADDMAGAZINE(ACE_M84,12); }; }; class Box_NATO_Support_F; class ACE_Box_Misc: Box_NATO_Support_F { - class TransportItems { - MACRO_ADDITEM(ACE_HandFlare_White,12); - MACRO_ADDITEM(ACE_HandFlare_Red,12); - MACRO_ADDITEM(ACE_HandFlare_Green,12); - MACRO_ADDITEM(ACE_HandFlare_Yellow,12); - MACRO_ADDITEM(ACE_M84,12); - MACRO_ADDITEM(ACE_M14,12); + class TransportMagazines { + MACRO_ADDMAGAZINE(ACE_HandFlare_White,12); + MACRO_ADDMAGAZINE(ACE_HandFlare_Red,12); + MACRO_ADDMAGAZINE(ACE_HandFlare_Green,12); + MACRO_ADDMAGAZINE(ACE_HandFlare_Yellow,12); + MACRO_ADDMAGAZINE(ACE_M84,12); + MACRO_ADDMAGAZINE(ACE_M14,12); }; }; }; diff --git a/addons/grenades/XEH_postInit.sqf b/addons/grenades/XEH_postInit.sqf index 96355fe3bf..6809321d83 100644 --- a/addons/grenades/XEH_postInit.sqf +++ b/addons/grenades/XEH_postInit.sqf @@ -4,6 +4,11 @@ ["ace_flashbangExploded", {_this call FUNC(flashbangExplosionEH)}] call CBA_fnc_addEventHandler; +// Register fired event handlers +["ace_firedPlayer", DFUNC(throwGrenade)] call CBA_fnc_addEventHandler; +["ace_firedPlayerNonLocal", DFUNC(throwGrenade)] call CBA_fnc_addEventHandler; +["ace_firedNonPlayer", DFUNC(throwGrenade)] call CBA_fnc_addEventHandler; + if (!hasInterface) exitWith {}; GVAR(flashbangPPEffectCC) = ppEffectCreate ["ColorCorrections", 4265]; @@ -21,8 +26,3 @@ GVAR(flashbangPPEffectCC) ppEffectForceInNVG true; // Statement [] call FUNC(nextMode); }, {false}, [9, [false, false, false]], false] call CBA_fnc_addKeybind; //8 Key - -// Register fire event handler -["ace_firedPlayer", DFUNC(throwGrenade)] call CBA_fnc_addEventHandler; -["ace_firedPlayerNonLocal", DFUNC(throwGrenade)] call CBA_fnc_addEventHandler; -["ace_firedNonPlayer", DFUNC(throwGrenade)] call CBA_fnc_addEventHandler; diff --git a/addons/grenades/XEH_preInit.sqf b/addons/grenades/XEH_preInit.sqf index a7feade1c3..b47cf6628d 100644 --- a/addons/grenades/XEH_preInit.sqf +++ b/addons/grenades/XEH_preInit.sqf @@ -2,6 +2,8 @@ ADDON = false; +PREP_RECOMPILE_START; #include "XEH_PREP.hpp" +PREP_RECOMPILE_END; ADDON = true; diff --git a/addons/grenades/functions/fnc_incendiary.sqf b/addons/grenades/functions/fnc_incendiary.sqf index 098e2d5e20..6081daa8af 100644 --- a/addons/grenades/functions/fnc_incendiary.sqf +++ b/addons/grenades/functions/fnc_incendiary.sqf @@ -16,6 +16,8 @@ */ #include "script_component.hpp" +#define ALERT_NEAR_ENEMY_RANGE 60 + #define PARTICLE_LIFE_TIME 2 #define PARTICLE_DENSITY 20 #define PARTICLE_SIZE 1 @@ -32,12 +34,29 @@ #define ORIENTATION 5.4 #define EXPANSION 1 -params ["_projectile", "_timeToLive"]; +params ["_projectile", "_timeToLive", "_center"]; if (isNull _projectile) exitWith {TRACE_1("null",_projectile);}; private _position = position _projectile; +// --- AI +private _nearLocalEnemies = []; + +{ + { + if (local _x && {[_center, side _x] call BIS_fnc_sideIsEnemy}) then { // WE WANT THE OBJECTS SIDE HERE! + _nearLocalEnemies pushBackUnique _x; + }; + } forEach crew _x; +} forEach (_position nearObjects ALERT_NEAR_ENEMY_RANGE); + +{ + if (behaviour _x in ["SAFE", "AWARE"]) then { + _x setBehaviour "COMBAT"; + }; +} forEach _nearLocalEnemies; + // --- fire private _fire = "#particlesource" createVehicleLocal _position; diff --git a/addons/grenades/functions/fnc_throwGrenade.sqf b/addons/grenades/functions/fnc_throwGrenade.sqf index 8db3cf3829..92c2639826 100644 --- a/addons/grenades/functions/fnc_throwGrenade.sqf +++ b/addons/grenades/functions/fnc_throwGrenade.sqf @@ -56,7 +56,7 @@ if (getNumber (_config >> QGVAR(incendiary)) == 1) then { private _fuzeTime = getNumber (_config >> "explosionTime"); private _timeToLive = getNumber (_config >> "timeToLive"); - [FUNC(incendiary), [_projectile, _timeToLive], _fuzeTime] call CBA_fnc_waitAndExecute; + [FUNC(incendiary), [_projectile, _timeToLive, side _unit], _fuzeTime] call CBA_fnc_waitAndExecute; // WE WANT THE OBJECTS SIDE HERE! }; // handle throw modes diff --git a/addons/grenades/stringtable.xml b/addons/grenades/stringtable.xml index 0ec7622796..3fc5ce6208 100644 --- a/addons/grenades/stringtable.xml +++ b/addons/grenades/stringtable.xml @@ -12,7 +12,10 @@ Gránátkezelési mód váltása Cambia tipo di granata Alternar Modo de Granada - グレネード モードを切り替え + 投てき方法を切り替え + 투척 종류 전환 + 切换投掷模式 + 切換投擲模式 Normal Throw @@ -25,7 +28,10 @@ Normál dobás Lancio normale Arremesso Normal - 通常で投げる + 普通に投げる + 일반 던지기 + 普通投掷 + 普通投擲 High Throw @@ -39,6 +45,9 @@ Lancio verso l'alto Arremesso Alto 高く投げる + 높이 던지기 + 高抛 + 高拋 Precise Throw @@ -52,6 +61,9 @@ Lancio preciso Arremesso Preciso 低く投げる + 정확한 던지기 + 精准投掷 + 精準投擲 Roll Grenade @@ -65,6 +77,9 @@ Fai rotolare la granata Rolar Granada 転がす + 굴려넣기 + 地面滚抛 + 地面滾拋 Drop Grenade @@ -78,6 +93,9 @@ Lascia la granata Largar Granada 落とす + 떨어뜨리기 + 下丢投掷 + 下丟投擲 M84 Stun Grenade @@ -91,6 +109,9 @@ Granata Stordente M84 M84 granada de atordoamento M84 閃光手榴弾 + M84 섬광 수류탄 + M84 震撼弹 + M84 震撼彈 M84 @@ -104,6 +125,9 @@ M84 M84 M84 + M84 + M84 + M84 Also known as flashbang. Causes immediate flash blindness, deafness, tinnitus, and inner ear disturbance. @@ -117,6 +141,9 @@ Anche conosciuta come flashbang. Causa accecamento immediato, sensazioni di sposatezza, mancanza d'equilibrio e disturbi al timpano. Também conhecida como flashbang. Causa uma clarão imediato, cegueira, surdez, zumbido e distúrbio no tímpano. フラッシュバンとも知られています。即時に失明と難聴、耳鳴り、内耳障害を引き起こします。 + 플래시뱅이라고도 알려져있습니다. 사용즉시 섬광으로 인한 시력장애, 청각장애, 이명, 내이기관방해를 유발합니다. + 也被称为闪光弹,会造成暂时性失明,耳聋,耳鸣等效果。 + 也被稱為閃光彈,會造成暫時性失明,耳聾,耳鳴等效果。 M127A1 Hand Held Signal (White) @@ -130,6 +157,9 @@ Bengala M127A1 (Blanca) M127A1 Feux à main (Blanc) M127A1 信号弾 (白) + M127A1 신호탄 (하얀색) + M127A1 手持式信号弹 (白色) + M127A1 手持式信號彈 (白色) M127A1 Hand Held Signal (Red) @@ -143,6 +173,9 @@ Bengala M127A1 (Roja) M127A1 Feux à main (Rouge) M127A1 信号弾 (赤) + M127A1 신호탄 (빨간색) + M127A1 手持式信号弹 (红色) + M127A1 手持式信號彈 (紅色) M127A1 Hand Held Signal (Green) @@ -156,6 +189,9 @@ Bengala M127A1 (Verde) M127A1 Feux à main (Vert) M127A1 信号弾 (緑) + M127A1 신호탄 (초록색) + M127A1 手持式信号弹 (绿色) + M127A1 手持式信號彈 (綠色) M127A1 Hand Held Signal (Yellow) @@ -169,6 +205,9 @@ Bengala M127A1 (Amarilla) M127A1 Feux à main (Jaune) M127A1 信号弾 (黄) + M127A1 신호탄 (노란색) + M127A1 手持式信号弹 (黄色) + M127A1 手持式信號彈 (黃色) White Hand Flare @@ -182,6 +221,9 @@ Bengala (Blanca) Feux à main (Blanc) 白の発炎筒 + 하얀색 불꽃신호기 + 白色手持式信号弹 + 白色手持式信號彈 Red Hand Flare @@ -195,6 +237,9 @@ Bengala (Roja) Feux à main (Rouge) 赤の発炎筒 + 빨간색 불꽃신호기 + 红色手持式信号弹 + 紅色手持式信號彈 Green Hand Flare @@ -208,6 +253,9 @@ Bengala (Verde) Feux à main (Vert) 緑の発炎筒 + 초록색 불꽃신호기 + 绿色手持式信号弹 + 綠色手持式信號彈 Yellow Hand Flare @@ -221,6 +269,9 @@ Bengala (Amarilla) Feux à main (Jaune) 黄の発炎筒 + 노란색 불꽃신호기 + 黄色手持式信号弹 + 黃色手持式信號彈 M127A1 (White) @@ -234,6 +285,9 @@ M127A1 (Белый) M127A1 (Blanca) M127A1 (白) + M127A1 (하양) + M127A1 (白色) + M127A1 (白色) M127A1 (Red) @@ -247,6 +301,9 @@ M127A1 (Красный) M127A1 (Roja) M127A1 (赤) + M127A1 (빨강) + M127A1 (红色) + M127A1 (紅色) M127A1 (Green) @@ -260,6 +317,9 @@ M127A1 (Зелёный) M127A1 (Verde) M127A1 (緑) + M127A1 (초록) + M127A1 (绿色) + M127A1 (綠色) M127A1 (Yellow) @@ -273,6 +333,9 @@ M127A1 (Жёлтые) M127A1 (Amarilla) M127A1 (黄) + M127A1 (노랑) + M127A1 (黄色) + M127A1 (黃色) AN-M14 Incendiary Grenade @@ -280,6 +343,11 @@ AN-M14 Зажигательная граната AN-M14 焼夷手榴弾 Granat zapalający AN-M14 + AN-M14 소이 수류탄 + Grenade incendiaire AN-M14 + AN-M14 Granata Incendiaria + AN-M14 燃烧手榴弹 + AN-M14 燃燒手榴彈 AN-M14 @@ -287,6 +355,11 @@ AN-M14 AN-M14 AN-M14 + AN-M14 + AN-M14 + AN-M14 + AN-M14 + AN-M14 Incendiary grenade used to destroy weapons, ammunition and other equipment. @@ -294,6 +367,11 @@ Зажигательная граната используется для уничтожения оружия, боеприпасов и прочего оборудования. 焼夷手榴弾は武器や弾薬箱などの装備を破壊するために使われます。 Granat zapalający, używany do niszczenia broni, amunicji i innego sprzętu. + 소이 수류탄은 무기나 탄약 그리고 장비를 파괴할때 쓰입니다. + Grenade incendiaire utilisé pour détruire des armes, munitions et autres équipements. + Granata incendiaria usata per distruggere armi, munizioni e altri equipaggiamenti. + 燃烧手榴弹是用来摧毁武器,弹药以及其他装备的好帮手。 + 燃燒手榴彈是用來摧毀武器,彈藥以及其他裝備的好幫手。 diff --git a/addons/gunbag/XEH_preInit.sqf b/addons/gunbag/XEH_preInit.sqf index 73b1a7ea75..cac548d134 100644 --- a/addons/gunbag/XEH_preInit.sqf +++ b/addons/gunbag/XEH_preInit.sqf @@ -2,7 +2,9 @@ ADDON = false; +PREP_RECOMPILE_START; #include "XEH_PREP.hpp" +PREP_RECOMPILE_END; // restore gunbag info after respawn ["CAManBase", "respawn", { diff --git a/addons/gunbag/data/ace_gunbag.p3d b/addons/gunbag/data/ace_gunbag.p3d index 22658bb93d..64de90bf4e 100644 Binary files a/addons/gunbag/data/ace_gunbag.p3d and b/addons/gunbag/data/ace_gunbag.p3d differ diff --git a/addons/gunbag/functions/fnc_canInteract.sqf b/addons/gunbag/functions/fnc_canInteract.sqf index 1ec9e38583..556ea1f700 100644 --- a/addons/gunbag/functions/fnc_canInteract.sqf +++ b/addons/gunbag/functions/fnc_canInteract.sqf @@ -7,7 +7,7 @@ * 1: Target * * Return Value: - * -1: can't interact 0: empty gunbag 1: full gunbag + * -1: can't interact 0: empty gunbag 1: full gunbag * * Example: * _canInteract = [player, target] call ace_gunbag_fnc_canInteract diff --git a/addons/gunbag/functions/fnc_offGunbagCallback.sqf b/addons/gunbag/functions/fnc_offGunbagCallback.sqf index 5d548d0e9c..580103b021 100644 --- a/addons/gunbag/functions/fnc_offGunbagCallback.sqf +++ b/addons/gunbag/functions/fnc_offGunbagCallback.sqf @@ -29,6 +29,16 @@ if (_state isEqualTo []) exitWith { _state params ["_weapon", "_items", "_magazines"]; _unit addWeapon _weapon; + +// Game will auto add magazines from player's inventory, put these back in player inventory as they will be overwritten +([_unit, _weapon] call EFUNC(common,getWeaponState)) params ["", "", "_addedMags", "_addedAmmo"]; +{ + if (((_x select 0) != "") && {(_addedMags select _forEachIndex) != ""}) then { + TRACE_2("Re-adding mag",_x,_addedMags select _forEachIndex); + _unit addMagazine [_addedMags select _forEachIndex, _addedAmmo select _forEachIndex]; + }; +} forEach _magazines; + removeAllPrimaryWeaponItems _unit; { diff --git a/addons/gunbag/stringtable.xml b/addons/gunbag/stringtable.xml index 84758e6f36..ab4fdf5ac7 100644 --- a/addons/gunbag/stringtable.xml +++ b/addons/gunbag/stringtable.xml @@ -1,4 +1,4 @@ - + @@ -9,6 +9,10 @@ Pouzdro na zbraň ガンバッグ Torba na broń + 총가방 + Borsa per Armi + 枪袋 + 槍袋 Gunbag (Tan) @@ -18,6 +22,10 @@ Pouzdro na zbraň (Žlutohnědá) ガンバッグ (タン) Torba na broń (jasnobrązowa) + 총가방 (황갈색) + Borsa per Armi (Tan) + 枪袋 (黄褐色) + 槍袋 (黃褐色) Put weapon into gunbag @@ -27,6 +35,10 @@ Vložit zbraň do pouzdra ガンバッグへ武器を入れる Włóż broń do torby + 무기를 총가방에 넣기 + Metti l'arma nella borsa per armi + 将武器放置枪袋 + 將武器放置槍袋 Get weapon out of gunbag @@ -36,6 +48,10 @@ Vytáhnout zbraň z pouzdra ガンバッグから武器を出す Wyciągnij broń z torby + 무기를 총가방에서 꺼내기 + Prendi l'arma dalla borsa per armi + 将武器拿出枪袋 + 將武器拿出槍袋 Status @@ -45,6 +61,10 @@ Status 中身 Status + 상태 + Stato + 状态 + 狀態 Gunbag Empty @@ -54,6 +74,10 @@ Prázdné pouzdro na zbraň ガンバッグは空 Torba jest pusta + 총가방 비어있음 + Borsa per armi vuota + 枪袋为空 + 槍袋為空 diff --git a/addons/hearing/CfgVehicles.hpp b/addons/hearing/CfgVehicles.hpp index 760ed95a03..c306e46b77 100644 --- a/addons/hearing/CfgVehicles.hpp +++ b/addons/hearing/CfgVehicles.hpp @@ -5,8 +5,8 @@ class CfgVehicles { class ACE_Equipment { class ACE_PutInEarplugs { displayName = CSTRING(EarPlugs_On); - condition = QUOTE( !([_player] call FUNC(hasEarPlugsIn)) && {'ACE_EarPlugs' in items _player} ); - exceptions[] = {"isNotInside", "isNotSitting"}; + condition = QUOTE(GVAR(EnableCombatDeafness) && {!([_player] call FUNC(hasEarPlugsIn)) && {'ACE_EarPlugs' in items _player}}); + exceptions[] = {"isNotSwimming", "isNotInside", "isNotSitting"}; statement = QUOTE( [_player] call FUNC(putInEarPlugs) ); showDisabled = 0; priority = 2.5; @@ -14,8 +14,8 @@ class CfgVehicles { }; class ACE_RemoveEarplugs { displayName = CSTRING(EarPlugs_Off); - condition = QUOTE( [_player] call FUNC(hasEarPlugsIn) ); - exceptions[] = {"isNotInside", "isNotSitting"}; + condition = QUOTE( GVAR(EnableCombatDeafness) && {[_player] call FUNC(hasEarPlugsIn)}); + exceptions[] = {"isNotSwimming", "isNotInside", "isNotSitting"}; statement = QUOTE( [_player] call FUNC(removeEarPlugs) ); showDisabled = 0; priority = 2.5; diff --git a/addons/hearing/CfgWeapons.hpp b/addons/hearing/CfgWeapons.hpp index c063c0e896..48ebba61b9 100644 --- a/addons/hearing/CfgWeapons.hpp +++ b/addons/hearing/CfgWeapons.hpp @@ -1,6 +1,6 @@ class CfgWeapons { class ACE_ItemCore; - class InventoryItem_Base_F; + class CBA_MiscItem_ItemInfo; class ACE_EarPlugs: ACE_ItemCore { displayName = CSTRING(EarPlugs_Name); @@ -8,47 +8,47 @@ class CfgWeapons { model = QPATHTOF(data\ace_earplugs.p3d); picture = QPATHTOF(UI\ACE_earplugs_x_ca.paa); scope = 2; - class ItemInfo: InventoryItem_Base_F { + class ItemInfo: CBA_MiscItem_ItemInfo { mass = 1; }; }; + #define HEARING_PROTECTION_VICCREW EGVAR(hearing,protection) = 0.85; EGVAR(hearing,lowerVolume) = 0.6; + #define HEARING_PROTECTION_EARMUFF EGVAR(hearing,protection) = 0.75; EGVAR(hearing,lowerVolume) = 0.5; + #define HEARING_PROTECTION_PELTOR EGVAR(hearing,protection) = 0.75; EGVAR(hearing,lowerVolume) = 0; + class H_HelmetB; class H_HelmetCrew_B: H_HelmetB { - GVAR(protection) = 1; - GVAR(lowerVolume) = 0.80; + HEARING_PROTECTION_VICCREW }; class H_CrewHelmetHeli_B: H_HelmetB { - GVAR(protection) = 0.85; - GVAR(lowerVolume) = 0.75; + HEARING_PROTECTION_VICCREW }; class H_PilotHelmetHeli_B: H_HelmetB { - GVAR(protection) = 0.85; - GVAR(lowerVolume) = 0.75; + HEARING_PROTECTION_VICCREW }; class H_PilotHelmetFighter_B: H_HelmetB { - GVAR(protection) = 1; - GVAR(lowerVolume) = 0.80; + HEARING_PROTECTION_VICCREW }; class HelmetBase; class H_Cap_headphones: HelmetBase { - GVAR(protection) = 0.5; - GVAR(lowerVolume) = 0.60; + HEARING_PROTECTION_EARMUFF }; class H_HelmetB_light: H_HelmetB { - GVAR(protection) = 0.8; - GVAR(lowerVolume) = 0.20; + HEARING_PROTECTION_PELTOR + }; + class H_HelmetB_camo: H_HelmetB { + HEARING_PROTECTION_PELTOR }; class H_HelmetB_plain_mcamo; class H_HelmetSpecB: H_HelmetB_plain_mcamo { - GVAR(protection) = 0.8; - GVAR(lowerVolume) = 0.20; + HEARING_PROTECTION_PELTOR }; }; diff --git a/addons/hearing/XEH_postInit.sqf b/addons/hearing/XEH_postInit.sqf index 34664525da..17548a973b 100644 --- a/addons/hearing/XEH_postInit.sqf +++ b/addons/hearing/XEH_postInit.sqf @@ -11,35 +11,71 @@ GVAR(playerVehAttenuation) = 1; GVAR(time3) = 0; GVAR(damageCoefficent) = 1; GVAR(volumeAttenuation) = 1; +GVAR(lastPlayerVehicle) = objNull; ["ace_settingsInitialized", { TRACE_1("settingInit",GVAR(EnableCombatDeafness)); // Only run PFEH and install event handlers if combat deafness is enabled if (!GVAR(EnableCombatDeafness)) exitWith {}; - //Add XEH: - ["CAManBase", "FiredNear", FUNC(firedNear)] call CBA_fnc_addClassEventHandler; - ["CAManBase", "Explosion", FUNC(explosionNear)] call CBA_fnc_addClassEventHandler; - - // Update hearing protection now: - [] call FUNC(updateHearingProtection); - // Spawn volume updating process - [FUNC(updateVolume), 1, [false]] call CBA_fnc_addPerFrameHandler; + [LINKFUNC(updateVolume), 1, [false]] call CBA_fnc_addPerFrameHandler; // Update veh attunation when player veh changes - ["vehicle", FUNC(updatePlayerVehAttenuation)] call CBA_fnc_addPlayerEventHandler; - ["turret", FUNC(updatePlayerVehAttenuation)] call CBA_fnc_addPlayerEventHandler; + ["vehicle", { + params ["_player", "_vehicle"]; + TRACE_2("vehicle change",_player,_vehicle); + _this call FUNC(updatePlayerVehAttenuation); + + if (!isNull GVAR(lastPlayerVehicle)) then { + private _firedEH = GVAR(lastPlayerVehicle) getVariable [QGVAR(firedEH), -1]; + GVAR(lastPlayerVehicle) removeEventHandler ["FiredNear", _firedEH]; + GVAR(lastPlayerVehicle) setVariable [QGVAR(firedEH), nil]; + GVAR(lastPlayerVehicle) = objNull; + TRACE_2("removed veh eh",_firedEH,GVAR(lastPlayerVehicle)); + }; + if ((!isNull _vehicle) && {_player != _vehicle}) then { + private _firedEH = _vehicle addEventHandler ["FiredNear", {call FUNC(firedNear)}]; + _vehicle setVariable [QGVAR(firedEH), _firedEH]; + GVAR(lastPlayerVehicle) = _vehicle; + TRACE_2("added veh eh",_firedEH,GVAR(lastPlayerVehicle)); + }; + }, true] call CBA_fnc_addPlayerEventHandler; + ["turret", LINKFUNC(updatePlayerVehAttenuation), false] call CBA_fnc_addPlayerEventHandler; + // Reset deafness on respawn (or remote control player switch) ["unit", { + params ["_player", "_oldPlayer"]; + TRACE_2("unit change",_player,_oldPlayer); + + if (!isNull _oldPlayer) then { + private _firedEH = _oldPlayer getVariable [QGVAR(firedEH), -1]; + _oldPlayer removeEventHandler ["FiredNear", _firedEH]; + _oldPlayer setVariable [QGVAR(firedEH), nil]; + private _explosionEH = _oldPlayer getVariable [QGVAR(explosionEH), -1]; + _oldPlayer removeEventHandler ["Explosion", _explosionEH]; + _oldPlayer setVariable [QGVAR(explosionEH), nil]; + TRACE_3("removed unit eh",_oldPlayer,_firedEH,_explosionEH); + }; + // Don't add a new EH if the unit respawned + if ((_player getVariable [QGVAR(firedEH), -1]) == -1) then { + if ((getNumber (configFile >> "CfgVehicles" >> (typeOf _player) >> "isPlayableLogic")) == 1) exitWith { + TRACE_1("skipping playable logic",typeOf _player); // VirtualMan_F (placeable logic zeus / spectator) + }; + private _firedEH = _player addEventHandler ["FiredNear", {call FUNC(firedNear)}]; + _player setVariable [QGVAR(firedEH), _firedEH]; + private _explosionEH = _player addEventHandler ["Explosion", {call FUNC(explosionNear)}]; + _player setVariable [QGVAR(explosionEH), _explosionEH]; + TRACE_3("added unit eh",_player,_firedEH,_explosionEH); + }; + GVAR(deafnessDV) = 0; GVAR(deafnessPrior) = 0; - ACE_player setVariable [QGVAR(deaf), false]; GVAR(time3) = 0; [] call FUNC(updateHearingProtection); - }] call CBA_fnc_addPlayerEventHandler; + }, true] call CBA_fnc_addPlayerEventHandler; // Update protection on possible helmet change - ["loadout", FUNC(updateHearingProtection)] call CBA_fnc_addPlayerEventHandler; + ["loadout", LINKFUNC(updateHearingProtection), false] call CBA_fnc_addPlayerEventHandler; }] call CBA_fnc_addEventHandler; diff --git a/addons/hearing/XEH_preInit.sqf b/addons/hearing/XEH_preInit.sqf index a7feade1c3..b47cf6628d 100644 --- a/addons/hearing/XEH_preInit.sqf +++ b/addons/hearing/XEH_preInit.sqf @@ -2,6 +2,8 @@ ADDON = false; +PREP_RECOMPILE_START; #include "XEH_PREP.hpp" +PREP_RECOMPILE_END; ADDON = true; diff --git a/addons/hearing/functions/fnc_explosionNear.sqf b/addons/hearing/functions/fnc_explosionNear.sqf index 76c6707de5..4917ac009b 100644 --- a/addons/hearing/functions/fnc_explosionNear.sqf +++ b/addons/hearing/functions/fnc_explosionNear.sqf @@ -18,12 +18,9 @@ params ["_unit", "_damage"]; -if (_unit != ACE_player) exitWith {}; - TRACE_2("explosion near player",_unit,_damage); -private ["_strength"]; -_strength = (0 max _damage) * 30; +private _strength = (0 max _damage) * 30; if (_strength < 0.01) exitWith {}; // Call inmediately, as it will get pick up later anyway by the update thread diff --git a/addons/hearing/functions/fnc_firedNear.sqf b/addons/hearing/functions/fnc_firedNear.sqf index 488e9f56e4..9a5e65b774 100644 --- a/addons/hearing/functions/fnc_firedNear.sqf +++ b/addons/hearing/functions/fnc_firedNear.sqf @@ -24,8 +24,6 @@ params ["_object", "_firer", "_distance", "_weapon", "", "", "_ammo"]; -//Only run if firedNear object is player or player's vehicle: -if ((ACE_player != _object) && {(vehicle ACE_player) != _object}) exitWith {}; if (_weapon in ["Throw", "Put"]) exitWith {}; if (_distance > 50) exitWith {}; @@ -55,7 +53,7 @@ if (isNil "_loudness") then { }; } count _muzzles; { - _ammoType = getText(configFile >> "CfgMagazines" >> _x >> "ammo"); + private _ammoType = getText(configFile >> "CfgMagazines" >> _x >> "ammo"); _weaponMagazines set [_forEachIndex, [_x, _ammoType]]; } forEach _weaponMagazines; diff --git a/addons/hearing/functions/fnc_handleRespawn.sqf b/addons/hearing/functions/fnc_handleRespawn.sqf index 5bad68761c..58500f1c3d 100644 --- a/addons/hearing/functions/fnc_handleRespawn.sqf +++ b/addons/hearing/functions/fnc_handleRespawn.sqf @@ -6,7 +6,7 @@ * 0: Unit * * Return Value: - * Nothing + * None * * Example: * [player] call ACE_hearing_fnc_handleRespawn; diff --git a/addons/hearing/functions/fnc_hasEarPlugsIn.sqf b/addons/hearing/functions/fnc_hasEarPlugsIn.sqf index 67a76685f4..ce697ab295 100644 --- a/addons/hearing/functions/fnc_hasEarPlugsIn.sqf +++ b/addons/hearing/functions/fnc_hasEarPlugsIn.sqf @@ -3,7 +3,7 @@ * Check if the unit has earplugs put in. * * Arguments: - * 0:Unit (player) + * 0: Unit (player) * * Return Value: * Have Earplugs in diff --git a/addons/hearing/functions/fnc_moduleHearing.sqf b/addons/hearing/functions/fnc_moduleHearing.sqf index 35276c60f8..8c04d9b8a4 100644 --- a/addons/hearing/functions/fnc_moduleHearing.sqf +++ b/addons/hearing/functions/fnc_moduleHearing.sqf @@ -3,10 +3,15 @@ * Initializes the Hearing module. * * Arguments: - * Whatever the module provides. (I dunno.) + * Whatever the module provides. (I dunno.) * * Return Value: * None + * + * Example: + * [player] call ACE_hearing_fnc_moduleHearing + * + * Public: No */ #include "script_component.hpp" diff --git a/addons/hearing/functions/fnc_putInEarplugs.sqf b/addons/hearing/functions/fnc_putInEarplugs.sqf index 90fe8d62ac..4471ec1aba 100644 --- a/addons/hearing/functions/fnc_putInEarplugs.sqf +++ b/addons/hearing/functions/fnc_putInEarplugs.sqf @@ -3,7 +3,7 @@ * Puts in earplugs. * * Arguments: - * 0:Unit (player) + * 0: Unit (player) * * Return Value: * None @@ -17,6 +17,8 @@ params ["_player"]; +if (!GVAR(EnableCombatDeafness)) exitWith {}; + // Plugs in inventory, putting them in _player removeItem "ACE_EarPlugs"; diff --git a/addons/hearing/functions/fnc_removeEarplugs.sqf b/addons/hearing/functions/fnc_removeEarplugs.sqf index 3154230ecf..a46febefb2 100644 --- a/addons/hearing/functions/fnc_removeEarplugs.sqf +++ b/addons/hearing/functions/fnc_removeEarplugs.sqf @@ -3,7 +3,7 @@ * Takes out earplugs. * * Arguments: - * 0:Unit (player) + * 0: Unit (player) * * Return Value: * None @@ -17,6 +17,8 @@ params ["_player"]; +if (!GVAR(EnableCombatDeafness)) exitWith {}; + if !(_player canAdd "ACE_EarPlugs") exitWith { // inventory full [localize LSTRING(Inventory_Full)] call EFUNC(common,displayTextStructured); }; diff --git a/addons/hearing/functions/fnc_updatePlayerVehAttenuation.sqf b/addons/hearing/functions/fnc_updatePlayerVehAttenuation.sqf index 7d48ca7b34..b077487c79 100644 --- a/addons/hearing/functions/fnc_updatePlayerVehAttenuation.sqf +++ b/addons/hearing/functions/fnc_updatePlayerVehAttenuation.sqf @@ -15,20 +15,17 @@ */ #include "script_component.hpp" -private ["_effectType", "_newAttenuation", "_turretConfig", "_turretPath", "_vehicle"]; - -_vehicle = vehicle ACE_player; +private _vehicle = vehicle ACE_player; if (isNull _vehicle) exitWith {}; -_newAttenuation = 1; +private _newAttenuation = 1; if (ACE_player != _vehicle) then { - _effectType = ""; - _turretPath = [ACE_player] call EFUNC(common,getTurretIndex); - _effectType = getText (configFile >> "CfgVehicles" >> (typeOf _vehicle) >> "attenuationEffectType"); + private _turretPath = [ACE_player] call EFUNC(common,getTurretIndex); + private _effectType = getText (configFile >> "CfgVehicles" >> (typeOf _vehicle) >> "attenuationEffectType"); if (!(_turretPath isEqualTo [])) then { - _turretConfig = [(configFile >> "CfgVehicles" >> (typeOf _vehicle)), _turretPath] call EFUNC(common,getTurretConfigPath); + private _turretConfig = [(configFile >> "CfgVehicles" >> (typeOf _vehicle)), _turretPath] call EFUNC(common,getTurretConfigPath); if ((getNumber (_turretConfig >> "disableSoundAttenuation")) == 1) then { _effectType = ""; @@ -41,8 +38,10 @@ if (ACE_player != _vehicle) then { _newAttenuation = switch (true) do { case (_effectType == ""): {1}; - case (_effectType == "CarAttenuation"): {0.5}; - case (_effectType == "RHS_CarAttenuation"): {0.5}; + case (_effectType == "CarAttenuation"); + case (_effectType == "RHS_CarAttenuation"): { // Increase protection for armored cars + private _armor = getNumber (configFile >> "CfgVehicles" >> (typeOf _vehicle) >> "HitPoints" >> "HitBody" >> "armor"); + linearConversion [2, 8, _armor, 0.5, 0.3, true];}; case (_effectType == "OpenCarAttenuation"): {1}; case (_effectType == "TankAttenuation"): {0.1}; case (_effectType == "HeliAttenuation"): {0.3}; diff --git a/addons/hearing/functions/fnc_updateVolume.sqf b/addons/hearing/functions/fnc_updateVolume.sqf index 01ab58ef76..7d0f875414 100644 --- a/addons/hearing/functions/fnc_updateVolume.sqf +++ b/addons/hearing/functions/fnc_updateVolume.sqf @@ -1,10 +1,10 @@ /* * Author: commy2 and esteldunedain and Ruthberg - * Updates and applys the current deafness. Called every 1 sec from a PFEH. + * Updates and applies the current deafness. Called every 1 sec from a PFEH. * * Arguments: * 0: Args - * -----0: Just update volume (skip ringing/recovery) + * 0: Just update volume (skip ringing/recovery) (default: false) * * Return Value: * None @@ -22,7 +22,7 @@ if (!alive ACE_player) exitWith { [QUOTE(ADDON), 1, true] call EFUNC(common,setHearingCapability); }; -(_this select 0) params ["_justUpdateVolume"]; +(_this select 0) params [["_justUpdateVolume", false]]; GVAR(deafnessDV) = (GVAR(deafnessDV) min 20) max 0; GVAR(volume) = (1 - (GVAR(deafnessDV) / 20)) max 0.05; diff --git a/addons/hearing/stringtable.xml b/addons/hearing/stringtable.xml index 400e9ca9c9..bde72c6476 100644 --- a/addons/hearing/stringtable.xml +++ b/addons/hearing/stringtable.xml @@ -13,6 +13,9 @@ Protetor auricular Tappi auricolari 耳栓 + 귀마개 + 耳塞 + 耳塞 Protective Earplugs allow the wearer to be near loud weaponry without damage to his hearing. @@ -26,6 +29,9 @@ Protetor para ouvidos permitem que o usuário esteja próximo a ruídos sem danificar sua audição. Proteggono l'apparato uditivo, permettendo a chi li indossa di resistere ai suoni particolarmente forti senza alcun danno. 着けることにより、近くの大きな銃声から聴覚を保護します。 + 보호용 귀마개는 화기로부터의 큰소리로부터 사용자의 청력을 보호합니다. + 配戴防护耳塞,遇到大声的武器发射时也不会损害听力。 + 配戴防護耳塞,遇到大聲的武器發射時也不會損害聽力。 Earplugs in @@ -39,6 +45,9 @@ Protetores colocados Indossa i tappi auricolari 耳栓を着ける + 귀마개 착용 + 塞入耳塞 + 塞入耳塞 Earplugs out @@ -52,6 +61,9 @@ Protetores retirados Levati i tappi auricolari 耳栓を外す + 귀마개 뺌 + 取出耳塞 + 取出耳塞 Earplugs in @@ -65,6 +77,9 @@ Protetores colocados Indossa i tappi auricolari 耳栓を着けた + 귀마개 착용 + 耳塞已塞入 + 耳塞已塞入 Earplugs out @@ -78,6 +93,9 @@ Protetores retirados Levati i tappi auricolari 耳栓を外した + 귀마개 뺌 + 耳塞已取出 + 耳塞已取出 You have no earplugs @@ -91,6 +109,9 @@ Você não possui protetores auriculares Non hai i tappi auricolari 耳栓を持っていません + 귀마개가 없습니다 + 你没有耳塞 + 你沒有耳塞 No inventory space @@ -104,6 +125,9 @@ Nincs több hely Нет места в инвентаре インベントリに空きがありません。 + 넣을 공간이 없습니다 + 无可用空间 + 無可用空間 Disable ear ringing @@ -117,6 +141,9 @@ Disabilita i fischi nelle orecchie Desabilitar zumbido de ouvidos 耳鳴りを無効化する + 이명현상 끄기 + 关闭耳鸣效果 + 關閉耳鳴效果 Remove tinnitus effect when the player takes hearing damage @@ -128,6 +155,9 @@ Remove o efeito de zunido quando o jogador recebe dano na audição Убирает эффект звона в ушах, когда игрок получает повреждение слуха プレイヤーの聴覚が損傷をしたら耳鳴りの効果を削除します + 플레이어가 청력손실을 입을때 생기는 이명현상을 제거합니다. + 关闭耳鸣效果时,就算玩家受到相当程度的听力伤害, 也不会造成耳鸣效果 + 關閉耳鳴效果時,就算玩家受到相當程度的聽力傷害, 也不會造成耳鳴效果 Hearing @@ -141,6 +171,9 @@ Слух Udito 聴覚 + 청력 + 听力设定 + 聽力設定 Enable Combat Deafness @@ -154,6 +187,9 @@ Оглушение Sordità da combattimento 戦闘による難聴を有効化 + 전투 난청 켜기 + 启用战斗性耳聋? + 啟用戰鬥性耳聾? Reduces the hearing ability as the player takes hearing damage @@ -166,6 +202,9 @@ Riduci l'abilità uditiva quando il giocatore riceve danno uditivo Réduire l'audition lorsque le joueur prend des dommages auditifs. 音による損傷をうけ、聴覚が減る可能性があります + 청력에 손상을 입으면 듣는 소리가 감소합니다. + 当玩家听力受损时降低听力能力? + 當玩家聽力受損時降低聽力能力? Controls combat deafness and ear ringing. When activated, players can be deafened when a gun is fired in their vicinity or an explosion takes place without hearing protection @@ -179,6 +218,9 @@ Controles de sordera de combate y zumbido en los oídos. Al activarlo, los jugadores pueden ser ensordecidos cuando un arma se dispara cerca o una explosión tiene lugar sin protección auditiva Controlla la sordità da combattimento e fischio alle orecchie. Quando attivato, i giocatori possono essere assordati quando un'arma spara vicino o avviene un'esplosione senza protezione uditiva 戦闘による難聴や、耳鳴りを設定します。有効になった場合、聴覚を保護していないと近傍の銃声や爆発音により、難聴になります。 + 전투 난청과 이명현상을 조작합니다. 작동시 플레이어가 화기나 폭발의 주변에 있을경우 청력보호장치가 없을때 청력손실을 입습니다. + 设定战斗性耳聋和耳鸣。当启用后,玩家会在有武器在旁边射击或爆炸产生时造成耳鸣效果 + 設定戰鬥性耳聾和耳鳴。當啟用後,玩家會在有武器在旁邊射擊或爆炸產生時造成耳鳴效果 Effect Zeus RC @@ -191,6 +233,9 @@ Effetto Zeus RC Effet sur le CàD du Zeus Zeus RC への効果 + Zeus RC 효과 + 启用效果在宙斯远程遥控 + 啟用效果在宙斯遠程遙控 Allow zeus remote controlled units to be able to take hearing damage. @@ -203,6 +248,9 @@ Consenti alle unità controllate in remoto da Zeus di ricevere danni all'udito. Permet aux unités controlées à distance de subir des traumatismes sonores. Zeus により遠隔操作されたユニットにも、聴覚へ損傷を受けるようにします。 + Zeus가 원격으로 청력손실을 입힐 수 있게 합니다. + 设定宙斯远程遥控的单位也会受到耳鸣的效果。 + 設定宙斯遠程遙控的單位也會受到耳鳴的效果。 Add earplugs to units @@ -215,6 +263,9 @@ Agregar tapones de oida a la unidad Ajouter des bouchons anti-bruits aux unités ユニットへ耳栓を追加 + 해당 인원에게 귀마개 추가 + 增加耳塞给单位 + 增加耳塞給單位 Add the `ACE_EarPlugs` item to all units that have loud weapons. Can disable if using custom loadouts. @@ -227,6 +278,9 @@ Agregar el item `ACE_EarPlugs` a todas las unidades equipadas con armas muy ruidosas. Desactivar si quieren utilizarse equipamientos personalizados. Ajoute l'objet "Ace_EarPlugs" à toutes les unités ayant des armes bruyantes. Peut être désactivé par des loadouts personalisés. 全ユニットへ`ACE_EarPlugs`アイテムをもたせます。これは変更された武装で無効化できます。 + 무기를 가지고 있는 모든 인원에게 'ACE_EarPlugs'를 지급합니다. 임의의 장비를 사용시 비활성화 할 수 있습니다. + 增加`ACE_EarPlugs`物品给拥有巨大噪音武器的单位。当你想自定装备时,此功能可被关闭。 + 增加`ACE_EarPlugs`物品給擁有巨大噪音武器的單位。當你想自定裝備時,此功能可被關閉。 - \ No newline at end of file + diff --git a/addons/hellfire/$PBOPREFIX$ b/addons/hellfire/$PBOPREFIX$ new file mode 100644 index 0000000000..5bd6c77aff --- /dev/null +++ b/addons/hellfire/$PBOPREFIX$ @@ -0,0 +1 @@ +z\ace\addons\hellfire diff --git a/addons/hellfire/ACE_GuidanceConfig.hpp b/addons/hellfire/ACE_GuidanceConfig.hpp new file mode 100644 index 0000000000..ad3d8c667d --- /dev/null +++ b/addons/hellfire/ACE_GuidanceConfig.hpp @@ -0,0 +1,18 @@ +class EGVAR(missileguidance,AttackProfiles) { + class hellfire { + name = "LOAL-DIR"; + nameLocked = "LOBL"; + functionName = QFUNC(attackProfile); + GVAR(launchHeightClear) = 0; + }; + class hellfire_hi: hellfire { + name = "LOAL-HI"; + nameLocked = "LOAL-HI"; + GVAR(launchHeightClear) = 304.8; // clear 1000 ft by 1500m + }; + class hellfire_lo: hellfire_hi { + name = "LOAL-LO"; + nameLocked = "LOAL-LO"; + GVAR(launchHeightClear) = 91.5; // clear 300 ft by 600m + }; +}; diff --git a/addons/hellfire/CfgAmmo.hpp b/addons/hellfire/CfgAmmo.hpp new file mode 100644 index 0000000000..c8900459ad --- /dev/null +++ b/addons/hellfire/CfgAmmo.hpp @@ -0,0 +1,70 @@ +class CfgAmmo { + class M_PG_AT; + + class ACE_Hellfire_AGM114K: M_PG_AT { + displayName = "AGM-114K"; + displayNameShort = "AGM-114K"; + description = "AGM-114K"; + descriptionShort = "AGM-114K"; + + model = "\A3\Weapons_F\Ammo\Missile_AT_03_fly_F"; + proxyShape = "\A3\Weapons_F\Ammo\Missile_AT_03_F"; + + hit = 1400; + indirectHit = 71; + indirectHitRange = 4.5; + effectsMissile = "missile2"; + + irLock = 0; + laserLock = 0; + manualControl = 0; + maxSpeed = 450; + + thrustTime = 2.5; // motor burn 2-3 sec + thrust = 250; + timeToLive = 40; + + EGVAR(rearm,caliber) = 178; + + class ace_missileguidance { + enabled = 1; + + minDeflection = 0.0005; // Minium flap deflection for guidance + maxDeflection = 0.01; // Maximum flap deflection for guidance + incDeflection = 0.0005; // The incrmeent in which deflection adjusts. + + canVanillaLock = 0; // Can this default vanilla lock? Only applicable to non-cadet mode + + // Guidance type for munitions + defaultSeekerType = "SALH"; + seekerTypes[] = { "SALH", "LIDAR", "SARH", "Optic", "Thermal", "GPS", "SACLOS", "MCLOS" }; + + defaultSeekerLockMode = "LOAL"; + seekerLockModes[] = { "LOAL", "LOBL" }; + + seekLastTargetPos = 1; // seek last target position [if seeker loses LOS of target, continue to last known pos] + seekerAngle = 70; // Angle in front of the missile which can be searched + seekerAccuracy = 1; // seeker accuracy multiplier + + seekerMinRange = 1; + seekerMaxRange = 5000; // Range from the missile which the seeker can visually search + + // Attack profile type selection + defaultAttackProfile = "hellfire"; + attackProfiles[] = {"hellfire", "hellfire_hi", "hellfire_lo"}; + }; + }; + class ACE_Hellfire_AGM114N: ACE_Hellfire_AGM114K { + displayName = "AGM-114N"; + displayNameShort = "AGM-114N"; + description = "AGM-114N"; + descriptionShort = "AGM-114N"; + hit = 1100; + indirectHit = 200; + indirectHitRange = 10; + explosionEffects = "BombExplosion"; + class ace_missileguidance: ace_missileguidance { + enabled = 1; // Missile Guidance must be explicitly enabled + }; + }; +}; diff --git a/addons/hellfire/CfgEventHandlers.hpp b/addons/hellfire/CfgEventHandlers.hpp new file mode 100644 index 0000000000..77ea0239bd --- /dev/null +++ b/addons/hellfire/CfgEventHandlers.hpp @@ -0,0 +1,15 @@ +class Extended_PreStart_EventHandlers { + class ADDON { + init = QUOTE(call COMPILE_FILE(XEH_preStart)); + }; +}; +class Extended_PreInit_EventHandlers { + class ADDON { + init = QUOTE(call COMPILE_FILE(XEH_preInit)); + }; +}; +class Extended_PostInit_EventHandlers { + class ADDON { + clientInit = QUOTE(call COMPILE_FILE(XEH_postInit)); + }; +}; diff --git a/addons/hellfire/CfgMagazines.hpp b/addons/hellfire/CfgMagazines.hpp new file mode 100644 index 0000000000..47d1516db7 --- /dev/null +++ b/addons/hellfire/CfgMagazines.hpp @@ -0,0 +1,87 @@ +class CfgMagazines { + class 12Rnd_PG_missiles; + + // Kilo - tandem shaped charge HEAT (anti-tank) + class 6Rnd_ACE_Hellfire_AGM114K: 12Rnd_PG_missiles { // Old style vehicle magazine + count = 6; + ammo = "ACE_Hellfire_AGM114K"; + displayName = "AGM-114K [ACE]"; + displayNameShort = "AGM-114K"; + descriptionShort = "AGM-114K"; + }; + + // 1.70 pylon magazines: + class PylonMissile_1Rnd_ACE_Hellfire_AGM114K: 6Rnd_ACE_Hellfire_AGM114K { // Bare missle + displayName = "1x AGM-114K [ACE]"; + count = 1; + mass = 70; + pylonWeapon = QGVAR(launcher); + hardpoints[] = {"SCALPEL_1RND"}; + model = "\A3\Weapons_F\DynamicLoadout\PylonMissile_1x_Bomb_04_F.p3d"; + }; + class PylonRack_1Rnd_ACE_Hellfire_AGM114K: 6Rnd_ACE_Hellfire_AGM114K { // 1x Launcher Support Rack + displayName = "1x AGM-114K [ACE]"; + count = 1; + mass = 85; + pylonWeapon = QGVAR(launcher); + hardpoints[] = {"B_MISSILE_PYLON", "SCALPEL_1RND_EJECTOR", "B_ASRRAM_EJECTOR", "UNI_SCALPEL", "CUP_NATO_HELO_SMALL", "CUP_NATO_HELO_LARGE", "RHS_HP_MELB"}; + model = "\A3\Weapons_F\DynamicLoadout\PylonPod_1x_Missile_AA_04_F.p3d"; + }; + class PylonRack_3Rnd_ACE_Hellfire_AGM114K: 6Rnd_ACE_Hellfire_AGM114K { // 3x Launcher Support Rack + displayName = "3x AGM-114K [ACE]"; + count = 3; + mass = 250; + pylonWeapon = QGVAR(launcher); + hardpoints[] = {"B_MISSILE_PYLON", "UNI_SCALPEL", "CUP_NATO_HELO_LARGE"}; + model = "\A3\Weapons_F\DynamicLoadout\PylonPod_3x_Missile_LG_scalpel_F.p3d"; + mirrorMissilesIndexes[] = {2, 1, 3}; + }; + class PylonRack_4Rnd_ACE_Hellfire_AGM114K: 6Rnd_ACE_Hellfire_AGM114K { // 4x Launcher Support Rack + displayName = "4x AGM-114K [ACE]"; + count = 4; + mass = 340; + pylonWeapon = QGVAR(launcher); + hardpoints[] = {"UNI_SCALPEL", "CUP_NATO_HELO_LARGE", "RHS_HP_HELLFIRE_RACK"}; + model = "\A3\Weapons_F\DynamicLoadout\PylonPod_4x_Missile_LG_scalpel_F.p3d"; + mirrorMissilesIndexes[] = {2, 1, 4, 3}; + }; + + // November - Metal augmented charge (Thermobaric) (Enclosures, ships, urban targets, air defense units) + class 6Rnd_ACE_Hellfire_AGM114N: 6Rnd_ACE_Hellfire_AGM114K { // Old style vehicle magazine + count = 6; + ammo = "ACE_Hellfire_AGM114N"; + displayName = "AGM-114N [ACE]"; + displayNameShort = "AGM-114N"; + descriptionShort = "AGM-114N"; + }; + + // 1.70 pylon magazines: + class PylonMissile_1Rnd_ACE_Hellfire_AGM114N: PylonMissile_1Rnd_ACE_Hellfire_AGM114K { // Bare missle + displayName = "1x AGM-114N [ACE]"; + displayNameShort = "AGM-114N"; + descriptionShort = "AGM-114N"; + ammo = "ACE_Hellfire_AGM114N"; + pylonWeapon = QGVAR(launcher_N); + }; + class PylonRack_1Rnd_ACE_Hellfire_AGM114N: PylonRack_1Rnd_ACE_Hellfire_AGM114K { // 1x Launcher Support Rack + displayName = "1x AGM-114N [ACE]"; + displayNameShort = "AGM-114N"; + descriptionShort = "AGM-114N"; + ammo = "ACE_Hellfire_AGM114N"; + pylonWeapon = QGVAR(launcher_N); + }; + class PylonRack_3Rnd_ACE_Hellfire_AGM114N: PylonRack_3Rnd_ACE_Hellfire_AGM114K { // 3x Launcher Support Rack + displayName = "3x AGM-114N [ACE]"; + displayNameShort = "AGM-114N"; + descriptionShort = "AGM-114N"; + ammo = "ACE_Hellfire_AGM114N"; + pylonWeapon = QGVAR(launcher_N); + }; + class PylonRack_4Rnd_ACE_Hellfire_AGM114N: PylonRack_4Rnd_ACE_Hellfire_AGM114K { // 4x Launcher Support Rack + displayName = "4x AGM-114N [ACE]"; + displayNameShort = "AGM-114N"; + descriptionShort = "AGM-114N"; + ammo = "ACE_Hellfire_AGM114N"; + pylonWeapon = QGVAR(launcher_N); + }; +}; \ No newline at end of file diff --git a/addons/hellfire/CfgVehicles.hpp b/addons/hellfire/CfgVehicles.hpp new file mode 100644 index 0000000000..89dbf131d7 --- /dev/null +++ b/addons/hellfire/CfgVehicles.hpp @@ -0,0 +1,6 @@ +class CfgVehicles { + class Heli_Attack_01_base_F; + class Heli_Attack_01_dynamicLoadout_base_F: Heli_Attack_01_base_F { + GVAR(addLaserDesignator) = 1; + }; +}; diff --git a/addons/hellfire/CfgWeapons.hpp b/addons/hellfire/CfgWeapons.hpp new file mode 100644 index 0000000000..e55492a59c --- /dev/null +++ b/addons/hellfire/CfgWeapons.hpp @@ -0,0 +1,18 @@ +class CfgWeapons { + class missiles_SCALPEL; + class GVAR(launcher): missiles_SCALPEL { + displayName = "AGM-114K Hellfire II"; + GVAR(enabled) = 1; // handle adding interactions and adding Laser Designator + EGVAR(laser,canSelect) = 1; // can ace_laser lock (allows switching laser code) + EGVAR(laser,showHud) = 1; // show attack profile / lock on hud + canLock = 0; + weaponLockSystem = 0; + magazines[] = {"6Rnd_ACE_Hellfire_AGM114K", "PylonMissile_1Rnd_ACE_Hellfire_AGM114K", "PylonRack_1Rnd_ACE_Hellfire_AGM114K", "PylonRack_3Rnd_ACE_Hellfire_AGM114K", "PylonRack_4Rnd_ACE_Hellfire_AGM114K"}; + lockingTargetSound[] = {"",0,1}; + lockedTargetSound[] = {"",0,1}; + }; + class GVAR(launcher_N): GVAR(launcher) { + displayName = "AGM-114N Hellfire II"; + magazines[] = {"6Rnd_ACE_Hellfire_AGM114N", "PylonMissile_1Rnd_ACE_Hellfire_AGM114N", "PylonRack_1Rnd_ACE_Hellfire_AGM114N", "PylonRack_3Rnd_ACE_Hellfire_AGM114N", "PylonRack_4Rnd_ACE_Hellfire_AGM114N"}; + }; +}; diff --git a/addons/hellfire/README.md b/addons/hellfire/README.md new file mode 100644 index 0000000000..bb9eef711e --- /dev/null +++ b/addons/hellfire/README.md @@ -0,0 +1,10 @@ +ace_hellfire +========== + +Adds AGM-114K Hellfire missiles. + +## Maintainers + +The people responsible for merging changes to this component or answering potential questions. + +- [PabstMirror](https://github.com/PabstMirror) diff --git a/addons/hellfire/XEH_PREP.hpp b/addons/hellfire/XEH_PREP.hpp new file mode 100644 index 0000000000..f30cf0bffd --- /dev/null +++ b/addons/hellfire/XEH_PREP.hpp @@ -0,0 +1,4 @@ +LOG("prep"); +PREP(attackProfile); +PREP(getAttackProfileSettings); +PREP(setupVehicle); diff --git a/addons/hellfire/XEH_postInit.sqf b/addons/hellfire/XEH_postInit.sqf new file mode 100644 index 0000000000..e89bf7a3e3 --- /dev/null +++ b/addons/hellfire/XEH_postInit.sqf @@ -0,0 +1,17 @@ +#include "script_component.hpp" + +if (!hasInterface) exitWith {}; + +["ace_settingsInitialized", { + ["turret", LINKFUNC(setupVehicle), false] call CBA_fnc_addPlayerEventHandler; + ["vehicle", LINKFUNC(setupVehicle), true] call CBA_fnc_addPlayerEventHandler; // only one of these needs the retro flag + + // Add UAV Control Compatibility + ["ACE_controlledUAV", { + params ["_UAV", "_seatAI", "_turret", "_position"]; + TRACE_4("ACE_controlledUAV EH",_UAV,_seatAI,_turret,_position); + if (!isNull _seatAI) then { + [_seatAI] call FUNC(setupVehicle); + }; + }] call CBA_fnc_addEventHandler; +}] call CBA_fnc_addEventHandler; diff --git a/addons/hellfire/XEH_preInit.sqf b/addons/hellfire/XEH_preInit.sqf new file mode 100644 index 0000000000..3464490b65 --- /dev/null +++ b/addons/hellfire/XEH_preInit.sqf @@ -0,0 +1,9 @@ +#include "script_component.hpp" + +ADDON = false; + +PREP_RECOMPILE_START; + #include "XEH_PREP.hpp" +PREP_RECOMPILE_END; + +ADDON = true; diff --git a/addons/hellfire/XEH_preStart.sqf b/addons/hellfire/XEH_preStart.sqf new file mode 100644 index 0000000000..022888575e --- /dev/null +++ b/addons/hellfire/XEH_preStart.sqf @@ -0,0 +1,3 @@ +#include "script_component.hpp" + +#include "XEH_PREP.hpp" diff --git a/addons/hellfire/config.cpp b/addons/hellfire/config.cpp new file mode 100644 index 0000000000..8df1594612 --- /dev/null +++ b/addons/hellfire/config.cpp @@ -0,0 +1,22 @@ +#include "script_component.hpp" + +class CfgPatches { + class ADDON { + name = COMPONENT_NAME; + units[] = {}; + weapons[] = {}; + requiredVersion = REQUIRED_VERSION; + requiredAddons[] = {"ace_interaction", "ace_missileguidance"}; + author = ECSTRING(common,ACETeam); + authors[] = {"PabstMirror"}; + url = ECSTRING(main,URL); + VERSION_CONFIG; + }; +}; + +#include "ACE_GuidanceConfig.hpp" +#include "CfgAmmo.hpp" +#include "CfgEventHandlers.hpp" +#include "CfgMagazines.hpp" +#include "CfgVehicles.hpp" +#include "CfgWeapons.hpp" diff --git a/addons/hellfire/functions/fnc_attackProfile.sqf b/addons/hellfire/functions/fnc_attackProfile.sqf new file mode 100644 index 0000000000..84f1c39f0a --- /dev/null +++ b/addons/hellfire/functions/fnc_attackProfile.sqf @@ -0,0 +1,85 @@ +/* + * Author: PabstMirror + * Hellfire attack profile. Handles all 4 modes LOBL, LOAL-DIR, LOAL-HI, LOAL-LO + * + * Arguments: + * 0: Seeker Target PosASL + * 1: Guidance Arg Array + * 2: Attack Profile State + * + * Return Value: + * Missile Aim PosASL + * + * Example: + * [[1,2,3], [], []] call ace_hellfire_fnc_attackProfile + * + * Public: No + */ +// #define DEBUG_MODE_FULL +#include "script_component.hpp" + +params ["_seekerTargetPos", "_args", "_attackProfileStateParams"]; +_args params ["_firedEH", "_launchParams"]; +_launchParams params ["","_targetLaunchParams"]; +_targetLaunchParams params ["", "", "_launchPos"]; +_firedEH params ["","","","","","","_projectile"]; + +// Get state params: +if (_attackProfileStateParams isEqualTo []) then { + _this call FUNC(getAttackProfileSettings); +}; +_attackProfileStateParams params ["_attackStage", "_configLaunchHeightClear"]; + + +private _projectilePos = getPosASL _projectile; +private _distanceFromLaunch2d = _launchPos distance2d _projectilePos; +private _heightAboveLaunch = (_projectilePos select 2) - (_launchPos select 2); + +// Add height depending on distance for compensate +private _returnTargetPos = nil; + +switch (_attackStage) do { + case STAGE_LAUNCH: { // Gain height quickly to pass terrain mask + _returnTargetPos = _projectilePos getPos [100, getDir _projectile]; + _returnTargetPos set [2, (_projectilePos select 2) + 36.4]; // 100 and 36.4 gives a 20 deg angle + + if (_heightAboveLaunch > _configLaunchHeightClear) then { + _attackProfileStateParams set [0, STAGE_SEEK_CRUISE]; + TRACE_2("New Stage: STAGE_SEEK_CRUISE",_distanceFromLaunch2d,_heightAboveLaunch); + }; + }; + case STAGE_SEEK_CRUISE: { // Slowly gain altitude while searching for target + // Before 4000 cruise at 5.7 degrees up, then level out + private _cruiseHeight = linearConversion [3000, 5000, _distanceFromLaunch2d, 10, 0, true]; + + _returnTargetPos = _projectilePos getPos [100, getDir _projectile]; + _returnTargetPos set [2, (_projectilePos select 2) + _cruiseHeight]; + + if (!(_seekerTargetPos isEqualTo [0,0,0])) then { + _attackProfileStateParams set [0, STAGE_ATTACK_CRUISE]; + TRACE_1("New Stage: STAGE_ATTACK_CRUISE",_distanceFromLaunch2d); + }; + }; + case STAGE_ATTACK_CRUISE: { + private _currentHeightOverTarget = (_projectilePos select 2) - (_seekerTargetPos select 2); + private _distanceToTarget2d = _seekerTargetPos distance2d _projectilePos; + private _distToGoRatio = _distanceToTarget2d / (_launchPos distance2d _seekerTargetPos); + + // arcing up at 7 degrees to start until 50% left, then smooth curve to a downward attack + private _gainSlope = linearConversion [0.5, 0.1, _distToGoRatio, 7, -7, true]; + _returnTargetPos = +_seekerTargetPos; + _returnTargetPos set [2, ((_projectilePos select 2) + (_distanceToTarget2d * sin _gainSlope)) max (_seekerTargetPos select 2)]; + + if ((_distanceToTarget2d < 500) || {(_currentHeightOverTarget atan2 _distanceToTarget2d) > 15}) then { // Wait until we can come down at a sharp angle + _attackProfileStateParams set [0, STAGE_ATTACK_TERMINAL]; + TRACE_2("New Stage: STAGE_ATTACK_TERMINAL",_distanceToTarget2d,_currentHeightOverTarget); + }; + }; + case STAGE_ATTACK_TERMINAL: { + private _distanceToTarget2d = _seekerTargetPos distance2d _projectilePos; + _returnTargetPos = _seekerTargetPos vectorAdd [0, 0, _distanceToTarget2d * 0.02]; + }; +}; + +// TRACE_1("Adjusted target position", _returnTargetPos); +_returnTargetPos; diff --git a/addons/hellfire/functions/fnc_getAttackProfileSettings.sqf b/addons/hellfire/functions/fnc_getAttackProfileSettings.sqf new file mode 100644 index 0000000000..a4854faa55 --- /dev/null +++ b/addons/hellfire/functions/fnc_getAttackProfileSettings.sqf @@ -0,0 +1,46 @@ +/* + * Author: PabstMirror + * Gets attack profile parameters for first run of hellfire attack profile function + * + * Arguments: + * 0: Seeker Target PosASL + * 1: Guidance Arg Array + * 2: Attack Profile State + * + * Return Value: + * Nothing + * + * Example: + * [[], [], []] call ace_hellfire_fnc_getAttackProfileSettings; + * + * Public: No + */ +// #define DEBUG_MODE_FULL +#include "script_component.hpp" + +params ["_seekerTargetPos", "_args", "_attackProfileStateParams"]; +_args params ["_firedEH", "_launchParams"]; +_launchParams params ["", "", "", "_attackProfile"]; +_firedEH params ["","","","","","","_projectile"]; + +private _attackConfig = configFile >> QEGVAR(missileguidance,AttackProfiles) >> _attackProfile; + +// Launch (clearing terrain mask for LO/HI): +private _configLaunchHeightClear = getNumber (_attackConfig >> QGVAR(launchHeightClear)); + +// Get starting stage +private _startingStage = if (_configLaunchHeightClear > 0) then { + STAGE_LAUNCH; // LOAL-HI / LO +} else { + if (_seekerTargetPos isEqualTo [0,0,0]) then { + STAGE_SEEK_CRUISE; // LOAL-DIR + } else { + STAGE_ATTACK_CRUISE // LOBL + }; +}; + +// Set data in param array +_attackProfileStateParams set [0, _startingStage]; +_attackProfileStateParams set [1, _configLaunchHeightClear]; + +TRACE_1("new shot settings",_attackProfileStateParams); diff --git a/addons/hellfire/functions/fnc_setupVehicle.sqf b/addons/hellfire/functions/fnc_setupVehicle.sqf new file mode 100644 index 0000000000..36b724d8a6 --- /dev/null +++ b/addons/hellfire/functions/fnc_setupVehicle.sqf @@ -0,0 +1,96 @@ +/* + * Author: PabstMirror + * Adds interaction menu actions to switch the firemode to a vehicle. + * Also adds a Laser Designator if vehicle is configured for one. + * + * Arguments: + * 0: Player + * + * Return Value: + * Nothing + * + * Example: + * [player] call ace_hellfire_fnc_setupVehicle + * + * Public: No + */ +// #define DEBUG_MODE_FULL +#include "script_component.hpp" + + +params ["_player"]; +// Note: player may be the currently controlled UAV's AI unit (so may be different from ace_player) +TRACE_1("showHud",_player); + +private _enabled = false; +private _vehicle = vehicle _player; +private _turretPath = [-1]; + +if ((alive _player) && {_player != _vehicle}) then { + if (_player != (driver _vehicle)) then { + _turretPath = _player call CBA_fnc_turretPath + }; + { + if ((getNumber (configFile >> "CfgWeapons" >> _x >> QGVAR(enabled))) == 1) then { + TRACE_1("enabled",_x); + _enabled = true; + }; + } forEach (_vehicle weaponsTurret _turretPath); +}; + +if (!_enabled) exitWith {TRACE_3("Not enabled",_enabled,_vehicle,_turretPath);}; + + +// Add laser if vehicle is configured for one: +if ((getNumber (configFile >> "CfgVehicles" >> (typeOf _vehicle) >> QGVAR(addLaserDesignator))) == 1) then { + [{ + params ["_vehicle", "_turretPath"]; + TRACE_3("checking for laser",_vehicle,_turretPath,_vehicle turretLocal _turretPath); + if (!alive _vehicle) exitWith {}; + if (!(_vehicle turretLocal _turretPath)) then {WARNING("Turret not local");}; + private _hasLaser = false; + { + // Most addons just use "Laserdesignator_mounted", but this should cover custom ones + if ((getNumber (configFile >> "CfgWeapons" >> _x >> "Laser")) == 1) exitWith { + _hasLaser = true; + }; + } forEach (_vehicle weaponsTurret _turretPath); + if (!_hasLaser) then { + TRACE_1("Adding Laser Designator",typeOf _vehicle); + _vehicle addWeaponTurret ["Laserdesignator_mounted", _turretPath]; + _vehicle addMagazineTurret ["Laserbatteries", _turretPath]; + }; + }, [_vehicle, _turretPath], 1] call CBA_fnc_waitAndExecute; // Need to delay slightly for turret to become local (probably only needs a single frame) +}; + + +// Add interaction menu actions: +if (_vehicle getVariable [QGVAR(actionsAdded), false]) exitWith {}; +_vehicle setVariable [QGVAR(actionsAdded), true]; + +private _action = [QUOTE(ADDON), localize LSTRING(hellfireModeAction), "", {}, {true}] call EFUNC(interact_menu,createAction); +private _basePath = [_vehicle, 1, ["ACE_SelfActions"], _action] call EFUNC(interact_menu,addActionToObject); + +private _fnc_statement = { + params ["_target", "", "_attackProfile"]; + TRACE_2("statement",_target,_attackProfile); + + _target setVariable [QEGVAR(missileguidance,attackProfile), _attackProfile]; +}; +private _fnc_condition = { + params ["_target", "_player", "_attackProfile"]; + + private _turretPath = if (ACE_player == (driver _target)) then {[-1]} else {ACE_player call CBA_fnc_turretPath}; + private _hasWeapon = ({(isNumber (configFile >> "CfgWeapons" >> _x >> QGVAR(enabled))) && {getNumber (configFile >> "CfgWeapons" >> _x >> QGVAR(enabled)) > 0}} count (_target weaponsTurret _turretPath)) > 0; + + (_hasWeapon) && + {(_target getVariable [QEGVAR(missileguidance,attackProfile), "hellfire"]) != _attackProfile}; +}; + +{ + private _displayName = getText (configFile >> QEGVAR(missileguidance,AttackProfiles) >> _x >> "name"); + private _action = [format [QGVAR(%1),_x], _displayName, "", _fnc_statement, _fnc_condition, {}, _x] call EFUNC(interact_menu,createAction); + [_vehicle, 1, _basePath, _action] call EFUNC(interact_menu,addActionToObject); +} forEach ["hellfire", "hellfire_hi", "hellfire_lo"]; + +TRACE_2("interactions added",_vehicle,typeOf _vehicle); diff --git a/addons/hellfire/functions/script_component.hpp b/addons/hellfire/functions/script_component.hpp new file mode 100644 index 0000000000..899f29a758 --- /dev/null +++ b/addons/hellfire/functions/script_component.hpp @@ -0,0 +1 @@ +#include "\z\ace\addons\hellfire\script_component.hpp" diff --git a/addons/hellfire/script_component.hpp b/addons/hellfire/script_component.hpp new file mode 100644 index 0000000000..6d16736a9c --- /dev/null +++ b/addons/hellfire/script_component.hpp @@ -0,0 +1,22 @@ +#define COMPONENT hellfire +#define COMPONENT_BEAUTIFIED Hellfire +#include "\z\ace\addons\main\script_mod.hpp" + +// #define DEBUG_MODE_FULL +// #define DISABLE_COMPILE_CACHE +// #define ENABLE_PERFORMANCE_COUNTERS + +#ifdef DEBUG_ENABLED_HELLFIRE + #define DEBUG_MODE_FULL +#endif + +#ifdef DEBUG_SETTINGS_HELLFIRE + #define DEBUG_SETTINGS DEBUG_SETTINGS_HELLFIRE +#endif + +#include "\z\ace\addons\main\script_macros.hpp" + +#define STAGE_LAUNCH 1 +#define STAGE_SEEK_CRUISE 2 +#define STAGE_ATTACK_CRUISE 3 +#define STAGE_ATTACK_TERMINAL 4 diff --git a/addons/hellfire/stringtable.xml b/addons/hellfire/stringtable.xml new file mode 100644 index 0000000000..e3d21c14a2 --- /dev/null +++ b/addons/hellfire/stringtable.xml @@ -0,0 +1,14 @@ + + + + + Set Hellfire mode + Setze Hellfire-Modus + Imposta modalità Hellfire + ヘルファイア モードを設定 + 设定地狱火模式 + 設定地獄火模式 + Ustaw tryb pocisku Hellfire + + + diff --git a/addons/hitreactions/XEH_preInit.sqf b/addons/hitreactions/XEH_preInit.sqf index a7feade1c3..b47cf6628d 100644 --- a/addons/hitreactions/XEH_preInit.sqf +++ b/addons/hitreactions/XEH_preInit.sqf @@ -2,6 +2,8 @@ ADDON = false; +PREP_RECOMPILE_START; #include "XEH_PREP.hpp" +PREP_RECOMPILE_END; ADDON = true; diff --git a/addons/hitreactions/functions/fnc_fallDown.sqf b/addons/hitreactions/functions/fnc_fallDown.sqf index 03484438eb..a7814b914e 100644 --- a/addons/hitreactions/functions/fnc_fallDown.sqf +++ b/addons/hitreactions/functions/fnc_fallDown.sqf @@ -10,6 +10,9 @@ * Return Value: * None * + * Example: + * [player, kevin, 5] call ACE_hitreactions_fnc_fallDown + * * Public: No */ #include "script_component.hpp" @@ -27,6 +30,9 @@ if (_unit == _firer) exitWith {}; // camshake for player if (_unit == ACE_player) then { + if (visibleMap) then { + openMap false; + }; addCamShake [3, 5, _damage + random 10]; }; diff --git a/addons/hitreactions/functions/fnc_getRandomAnimation.sqf b/addons/hitreactions/functions/fnc_getRandomAnimation.sqf index 996901a31e..10b64b5eae 100644 --- a/addons/hitreactions/functions/fnc_getRandomAnimation.sqf +++ b/addons/hitreactions/functions/fnc_getRandomAnimation.sqf @@ -8,6 +8,9 @@ * Return Value: * Fall animation * + * Example: + * [bob] call ACE_hitreactions_fnc_getRandomAnimation + * * Public: No */ #include "script_component.hpp" diff --git a/addons/huntir/CfgWeapons.hpp b/addons/huntir/CfgWeapons.hpp index 799cfcb976..bc00035a1d 100644 --- a/addons/huntir/CfgWeapons.hpp +++ b/addons/huntir/CfgWeapons.hpp @@ -1,7 +1,7 @@ class CfgWeapons { class ACE_ItemCore; - class InventoryItem_Base_F; + class CBA_MiscItem_ItemInfo; class ACE_HuntIR_monitor: ACE_ItemCore { scope = 2; @@ -10,7 +10,7 @@ class CfgWeapons { descriptionShort = CSTRING(monitor_displayName); model = QPATHTOF(data\ace_huntir_monitor.p3d); - class ItemInfo: InventoryItem_Base_F { + class ItemInfo: CBA_MiscItem_ItemInfo { mass = 20; }; }; @@ -19,11 +19,5 @@ class CfgWeapons { class UGL_F: GrenadeLauncher { magazines[] += {"ACE_HuntIR_M203"}; }; - class Rifle_Base_F; - class arifle_MX_Base_F: Rifle_Base_F { - class GL_3GL_F: UGL_F { - //magazines[] += {"ACE_HuntIR_M203"}; - magazines[] = {"1Rnd_HE_Grenade_shell","UGL_FlareWhite_F","UGL_FlareGreen_F","UGL_FlareRed_F","UGL_FlareYellow_F","UGL_FlareCIR_F","1Rnd_Smoke_Grenade_shell","1Rnd_SmokeRed_Grenade_shell","1Rnd_SmokeGreen_Grenade_shell","1Rnd_SmokeYellow_Grenade_shell","1Rnd_SmokePurple_Grenade_shell","1Rnd_SmokeBlue_Grenade_shell","1Rnd_SmokeOrange_Grenade_shell","3Rnd_HE_Grenade_shell","3Rnd_UGL_FlareWhite_F","3Rnd_UGL_FlareGreen_F","3Rnd_UGL_FlareRed_F","3Rnd_UGL_FlareYellow_F","3Rnd_UGL_FlareCIR_F","3Rnd_Smoke_Grenade_shell","3Rnd_SmokeRed_Grenade_shell","3Rnd_SmokeGreen_Grenade_shell","3Rnd_SmokeYellow_Grenade_shell","3Rnd_SmokePurple_Grenade_shell","3Rnd_SmokeBlue_Grenade_shell","3Rnd_SmokeOrange_Grenade_shell","ACE_HuntIR_M203"}; - }; - }; + // Added to the GL_3GL_F in subconfig }; diff --git a/addons/huntir/XEH_preInit.sqf b/addons/huntir/XEH_preInit.sqf index a7feade1c3..b47cf6628d 100644 --- a/addons/huntir/XEH_preInit.sqf +++ b/addons/huntir/XEH_preInit.sqf @@ -2,6 +2,8 @@ ADDON = false; +PREP_RECOMPILE_START; #include "XEH_PREP.hpp" +PREP_RECOMPILE_END; ADDON = true; diff --git a/addons/huntir/functions/fnc_cam.sqf b/addons/huntir/functions/fnc_cam.sqf index 41a9561e60..753293f5ad 100644 --- a/addons/huntir/functions/fnc_cam.sqf +++ b/addons/huntir/functions/fnc_cam.sqf @@ -9,6 +9,9 @@ * Return Value: * None * + * Example: + * [cam] call ACE_huntir_fnc_cam + * * Public: No */ #include "script_component.hpp" @@ -132,22 +135,20 @@ GVAR(no_cams) sort true; }; }; - private ["_cam_coord_y", "_cam_coord_x", "_cam_time", "_cam_pos"]; - GVAR(logic) setPosATL (GVAR(pos) vectorAdd [0, 0, -5]); GVAR(logic) setDir GVAR(ROTATE); GVAR(logic) setVectorUp [0.0001, 0.0001, 1]; GVAR(cam) CameraEffect ["internal", "BACK"]; - _cam_coord_y = GVAR(ELEVAT) * cos(GVAR(ROTATE)); - _cam_coord_x = GVAR(ELEVAT) * sin(GVAR(ROTATE)); + private _cam_coord_y = GVAR(ELEVAT) * cos(GVAR(ROTATE)); + private _cam_coord_x = GVAR(ELEVAT) * sin(GVAR(ROTATE)); GVAR(cam) camSetRelPos [_cam_coord_x, _cam_coord_y, 2]; GVAR(cam) camCommit 0; ctrlSetText [1, format["%1 m", round(GVAR(pos) select 2)]]; ctrlSetText [2, format["%1", GVAR(cur_cam) + 1]]; - _cam_time = CBA_missionTime - (GVAR(huntIR) getVariable [QGVAR(startTime), CBA_missionTime]); + private _cam_time = CBA_missionTime - (GVAR(huntIR) getVariable [QGVAR(startTime), CBA_missionTime]); ctrlSetText [3, format["%1 s", round(_cam_time)]]; - _cam_pos = getPosVisual GVAR(huntIR); + private _cam_pos = getPosVisual GVAR(huntIR); _cam_pos = format ["X = %1, Y = %2", round (_cam_pos select 0), round (_cam_pos select 1)]; ctrlSetText [5, _cam_pos]; ctrlSetText [6, ""]; diff --git a/addons/huntir/functions/fnc_handleFired.sqf b/addons/huntir/functions/fnc_handleFired.sqf index b7e8c2a010..85e228f958 100644 --- a/addons/huntir/functions/fnc_handleFired.sqf +++ b/addons/huntir/functions/fnc_handleFired.sqf @@ -9,6 +9,9 @@ * Return Value: * None * + * Example: + * call ACE_huntir_fnc_handleFired + * * Public: No */ #include "script_component.hpp" @@ -30,9 +33,8 @@ if (!hasInterface) exitWith {}; "ACE_HuntIR_Propell" createVehicle (getPosATL _projectile); [{ - private ["_huntir"]; params ["_position"]; - _huntir = createVehicle ["ACE_HuntIR", _position, [], 0, "FLY"]; + private _huntir = createVehicle ["ACE_HuntIR", _position, [], 0, "FLY"]; _huntir setPosATL _position; _huntir setVariable [QGVAR(startTime), CBA_missionTime, true]; [{ @@ -41,10 +43,10 @@ if (!hasInterface) exitWith {}; if (isNull _huntir) exitWith { [_idPFH] call CBA_fnc_removePerFrameHandler; }; - private ["_parachuteDamage", "_velocity"]; - _parachuteDamage = _huntir getHitPointDamage "HitParachute"; + + private _parachuteDamage = _huntir getHitPointDamage "HitParachute"; if (_parachuteDamage > 0) then { - _velocity = velocity _huntir; + private _velocity = velocity _huntir; _velocity set [2, -1 min -20 * sqrt(_parachuteDamage)]; _huntir setVelocity _velocity; _huntir setVectorUp [0, 0, 1]; diff --git a/addons/huntir/functions/fnc_huntir.sqf b/addons/huntir/functions/fnc_huntir.sqf index 844ca302e7..8f92dce745 100644 --- a/addons/huntir/functions/fnc_huntir.sqf +++ b/addons/huntir/functions/fnc_huntir.sqf @@ -9,6 +9,9 @@ * Return Value: * None * + * Example: + * call ACE_huntir_fnc_huntir + * * Public: No */ #include "script_component.hpp" @@ -43,9 +46,8 @@ createDialog QGVAR(cam_dialog_off); closeDialog 0; }; - private ["_elapsedTime", "_nearestHuntIRs"]; - _elapsedTime = CBA_missionTime - GVAR(startTime); - _nearestHuntIRs = ACE_player nearEntities ["ACE_HuntIR", HUNTIR_MAX_TRANSMISSION_RANGE]; + private _elapsedTime = CBA_missionTime - GVAR(startTime); + private _nearestHuntIRs = ACE_player nearEntities ["ACE_HuntIR", HUNTIR_MAX_TRANSMISSION_RANGE]; if ((!dialog) || GVAR(done)) exitWith { [_this select 1] call CBA_fnc_removePerFrameHandler; diff --git a/addons/huntir/functions/fnc_huntirCompass.sqf b/addons/huntir/functions/fnc_huntirCompass.sqf index f383a23a24..d6fc417353 100644 --- a/addons/huntir/functions/fnc_huntirCompass.sqf +++ b/addons/huntir/functions/fnc_huntirCompass.sqf @@ -9,6 +9,9 @@ * Return Value: * None * + * Example: + * call ACE_huntir_fnc_huntirCompass + * * Public: No */ #include "script_component.hpp" @@ -29,9 +32,7 @@ disableSerialization; #define __CENTER_X 0.70 #define __CENTER_Y 0.65 -private ["_fnc_correctIt"]; - -_fnc_correctIt = { +private _fnc_correctIt = { params ["_pos", "_dir"]; if (_dir >= 270 || {_dir <= 90}) then { _pos set [1, (_pos select 1) + __OFFSET_Y] @@ -59,12 +60,11 @@ HUNTIR_CAM_ROSE_LAYER_ID cutRsc [QGVAR(cam_rose), "PLAIN"]; [_idPFH] call CBA_fnc_removePerFrameHandler; }; - private ["_dir", "_x1", "_y1", "_pos"]; - _dir = getDir GVAR(cam); // direction player; + private _dir = getDir GVAR(cam); // direction player; - _x1 = __CENTER_X - (__RADIUS * sin(_dir)); - _y1 = __CENTER_Y - (__RADIUS * cos(_dir)); - _pos = [[_x1, _y1], _dir] call _fnc_correctIt; + private _x1 = __CENTER_X - (__RADIUS * sin(_dir)); + private _y1 = __CENTER_Y - (__RADIUS * cos(_dir)); + private _pos = [[_x1, _y1], _dir] call _fnc_correctIt; __CHAR_N ctrlSetPosition [_pos select 0, _pos select 1, __WIDTH, __HEIGHT]; __CHAR_N ctrlCommit 0; diff --git a/addons/huntir/functions/fnc_keyPressed.sqf b/addons/huntir/functions/fnc_keyPressed.sqf index 509dcb9de5..90f74415a3 100644 --- a/addons/huntir/functions/fnc_keyPressed.sqf +++ b/addons/huntir/functions/fnc_keyPressed.sqf @@ -3,7 +3,7 @@ * Handles the HuntIR monitor key interaction * * Arguments: - * 0: ? + * 0: ? * 1: keycode * * Return Value: @@ -16,8 +16,7 @@ */ #include "script_component.hpp" -private ["_ret"]; -_ret = false; +private _ret = false; switch (_this select 1) do { // A = Lower zoom level diff --git a/addons/huntir/stringtable.xml b/addons/huntir/stringtable.xml index 4bfddf0bfa..9360774031 100644 --- a/addons/huntir/stringtable.xml +++ b/addons/huntir/stringtable.xml @@ -1,4 +1,4 @@ - + @@ -13,6 +13,9 @@ HuntIR Transport Box Caixa de transporte do HuntIR HuntIR 輸送箱 + HuntIR 수송함 + 高空战术成像器运输箱 + 高空戰術成像器運輸箱 HuntIR Round @@ -26,6 +29,9 @@ HuntIR lövedék Cartucho HuntIR HuntIR 弾頭 + HuntIR 유탄 + 高空战术成像器弹药 + 高空戰術成像器彈藥 HuntIR monitor @@ -39,6 +45,9 @@ HuntIR monitor Monitor HuntIR HuntIR モニタ + HuntIR 모니터 + 高空战术成像器显示面板 + 高空戰術成像器顯示面板 Activate HuntIR monitor @@ -52,6 +61,9 @@ HuntIR monitor aktiválása Ativar monitor do HuntIR HuntIR を起動する + HuntIR 모니터 켜기 + 开启高空战术成像器显示面板 + 開啟高空戰術成像器顯示面板 Camera: @@ -65,6 +77,9 @@ Kamera: Câmera: カメラ: + 카메라: + 摄影机: + 攝影機: Altitude: @@ -78,6 +93,9 @@ Magasság: Altitude: 高度: + 고도: + 高度: + 高度: Recording Time: @@ -91,6 +109,9 @@ Felvételi idő: Tempo de gravação: 録画時間: + 녹화시간: + 记录时间: + 記錄時間: Press ESC to quit camera @@ -104,6 +125,9 @@ Nyomj ESC-ket a kamerából való kilépéshez Pressione ESC para sair da câmera ESC を押しカメラを抜ける + ESC를 눌러 카메라 나가기 + 按下ESC退出摄影机 + 按下ESC退出攝影機 Help @@ -117,6 +141,9 @@ Súgó Ajuda ヘルプ + 도움말 + 帮助 + 幫助 A/D - Cycle zoom @@ -130,6 +157,9 @@ A/D - Nagyítás A/D - Troca zoom A/D - 倍率の変更 + A/D - 줌 전환 + A/D - 切换放大倍率 + A/D - 切換放大倍率 W/S - Select camera @@ -143,6 +173,9 @@ W/S - Kamera váltás W/S - Seleciona câmera W/S - カメラを選択 + W/S - 카메라 선택 + W/S - 切换摄影机 + W/S - 切換攝影機 Left/Right - Rotate camera @@ -155,7 +188,10 @@ Gauche/Droite - Rotation de la caméra Jobb/Bal - Kamera forgatás Esquerda/Direita - Rotaciona câmera - Left/Right - カメラを開店 + Left/Right - カメラ回転 + 좌/우 - 카메라 돌리기 + 左/右 - 旋转摄影机 + 左/右 - 旋轉攝影機 Up/Down - Elevate/lower camera @@ -169,6 +205,9 @@ Fel/Le - Kamera döntése/süllyesztése Acima/Abaixo - Eleva/Abaixa a câmera Up/Down - カメラ角度を変更 + 상/하 카메라 올리기/내리기 + 上/下 - 上升/下降摄影机 + 上/下 - 上升/下降攝影機 N - Cycle IT modes @@ -182,6 +221,9 @@ N - Hőkép módok N - Troca modo IT N - IT モードを変更 + N - IT모드 순환 + N - 切换热显模式 + N - 切換熱顯模式 R - Reset camera @@ -195,6 +237,9 @@ R - Kamera visszaállítása R - Redefine a câmera R - カメラを初期化 + R - 카메라 초기화 + R - 重置摄影机 + R - 重置攝影機 Esc - Exit help @@ -207,7 +252,10 @@ Esc - Sortir de l'aide Exit - Kilépés a súgóból Esc - Sai do Ajuda - Esc - ヘルプを出る + Esc - ヘルプ終了 + Esc - 도움말 나가기 + Esc - 离开帮助 + Esc - 離開幫助 - \ No newline at end of file + diff --git a/addons/huntir/subConfig/config.cpp b/addons/huntir/subConfig/config.cpp new file mode 100644 index 0000000000..29a9f0ca25 --- /dev/null +++ b/addons/huntir/subConfig/config.cpp @@ -0,0 +1,26 @@ +#include "\z\ace\addons\huntir\script_component.hpp" +#undef COMPONENT +#define COMPONENT huntir_sub + +class CfgPatches { + class ADDON { + name = COMPONENT_NAME; + units[] = {}; + weapons[] = {}; + requiredVersion = REQUIRED_VERSION; + requiredAddons[] = {"ace_huntir"}; + author = ECSTRING(common,ACETeam); + url = ECSTRING(main,URL); + VERSION_CONFIG; + }; +}; + +class CfgWeapons { + class UGL_F; + class Rifle_Base_F; + class arifle_MX_Base_F: Rifle_Base_F { + class GL_3GL_F: UGL_F { + magazines[] += {"ACE_HuntIR_M203"}; + }; + }; +}; diff --git a/addons/interact_menu/CfgEventHandlers.hpp b/addons/interact_menu/CfgEventHandlers.hpp index fa53ccf57c..b8bb1264e1 100644 --- a/addons/interact_menu/CfgEventHandlers.hpp +++ b/addons/interact_menu/CfgEventHandlers.hpp @@ -29,4 +29,10 @@ class Extended_DisplayLoad_EventHandlers { class RscDiary { ADDON = QUOTE(call COMPILE_FILE(XEH_displayLoad)); }; + class RscDisplayInterrupt { + ADDON = QUOTE(_this call FUNC(handleEscapeMenu)); + }; + class RscDisplayMPInterrupt { + ADDON = QUOTE(_this call FUNC(handleEscapeMenu)); + }; }; diff --git a/addons/interact_menu/CursorMenus.hpp b/addons/interact_menu/CursorMenus.hpp index 7705f3fcd2..385c3a0f75 100644 --- a/addons/interact_menu/CursorMenus.hpp +++ b/addons/interact_menu/CursorMenus.hpp @@ -1,6 +1,5 @@ class GVAR(cursorMenu) { idd = 91919; - access = 0; movingEnable = 0; enableSimulation = 1; onLoad = QUOTE(uiNamespace setVariable [ARR_2(QUOTE(QGVAR(dlgCursorMenu)),_this select 0)]; uiNamespace setVariable [ARR_2(QUOTE(QGVAR(cursorMenuOpened)),true)]); @@ -25,7 +24,6 @@ class RscTitles { text = ""; sizeEx = 0; lineSpacing = 0; - access = 0; type = 0; style = 0; size = 1; diff --git a/addons/interact_menu/XEH_PREP.hpp b/addons/interact_menu/XEH_PREP.hpp index 0c1a6842fc..840acbf10d 100644 --- a/addons/interact_menu/XEH_PREP.hpp +++ b/addons/interact_menu/XEH_PREP.hpp @@ -1,14 +1,17 @@ PREP(addActionToClass); PREP(addActionToObject); +PREP(addActionToZeus); PREP(addMainAction); PREP(compileMenu); PREP(compileMenuSelfAction); PREP(compileMenuZeus); PREP(collectActiveActionTree); PREP(createAction); +PREP(createVehiclesActions); PREP(ctrlSetParsedTextCached); PREP(findActionNode); +PREP(handleEscapeMenu); PREP(isSubPath); PREP(keyDown); PREP(keyUp); diff --git a/addons/interact_menu/XEH_clientInit.sqf b/addons/interact_menu/XEH_clientInit.sqf index 0d280506b3..dbe9d548cd 100644 --- a/addons/interact_menu/XEH_clientInit.sqf +++ b/addons/interact_menu/XEH_clientInit.sqf @@ -21,7 +21,7 @@ GVAR(ParsedTextCached) = []; //Setup text/shadow/size/color settings matrix [] call FUNC(setupTextColors); // Install the render EH on the main display - addMissionEventHandler ["Draw3D", DFUNC(render)]; + addMissionEventHandler ["Draw3D", {call FUNC(render)}]; }] call CBA_fnc_addEventHandler; //Add Actions to Houses: @@ -42,6 +42,27 @@ GVAR(ParsedTextCached) = []; [219, [false, true, false]], false] call CBA_fnc_addKeybind; //Left Windows Key + Ctrl/Strg +["ACE3 Common", QGVAR(InteractKey_Toggle), +format ["%1 (%2)", (localize LSTRING(InteractKey)), localize ELSTRING(common,KeybindToggle)], +{ + if (GVAR(openedMenuType) != 0) then { + [0] call FUNC(keyDown) + } else { + [0,false] call FUNC(keyUp) + }; +}, {}, [-1, [false, false, false]], false] call CBA_fnc_addKeybind; // UNBOUND + +["ACE3 Common", QGVAR(SelfInteractKey_Toggle), +format ["%1 (%2)", (localize LSTRING(SelfInteractKey)), localize ELSTRING(common,KeybindToggle)], +{ + if (GVAR(openedMenuType) != 1) then { + [1] call FUNC(keyDown) + } else { + [1, false] call FUNC(keyUp) + }; +}, {}, [-1, [false, false, false]], false] call CBA_fnc_addKeybind; // UNBOUND + + // Listens for the falling unconscious event, just in case the menu needs to be closed ["ace_unconscious", { // If no menu is open just quit diff --git a/addons/interact_menu/XEH_preInit.sqf b/addons/interact_menu/XEH_preInit.sqf index 8711f8c180..817693c93c 100644 --- a/addons/interact_menu/XEH_preInit.sqf +++ b/addons/interact_menu/XEH_preInit.sqf @@ -2,7 +2,9 @@ ADDON = false; +PREP_RECOMPILE_START; #include "XEH_PREP.hpp" +PREP_RECOMPILE_END; GVAR(ActNamespace) = [] call CBA_fnc_createNamespace; GVAR(ActSelfNamespace) = [] call CBA_fnc_createNamespace; diff --git a/addons/interact_menu/functions/fnc_addActionToZeus.sqf b/addons/interact_menu/functions/fnc_addActionToZeus.sqf new file mode 100644 index 0000000000..66c1f29d08 --- /dev/null +++ b/addons/interact_menu/functions/fnc_addActionToZeus.sqf @@ -0,0 +1,45 @@ +/* + * Author: PabstMirror + * Insert an ACE action to zeus. + * Note: This function is NOT global. + * + * Arguments: + * 0: Parent path of the new action (e.g. ["ACE_ZeusActions"]) + * 1: Action + * + * Return Value: + * The entry full path, which can be used to add children entries . + * + * Example: + * [["ACE_ZeusActions"], zeusAction] call ace_interact_menu_fnc_addActionToZeus; + * + * Public: Yes + */ +#include "script_component.hpp" + +if (!params [["_parentPath", [], [[]]], ["_action", [], [[]], 11]]) exitWith {ERROR("Bad Params"); []}; +if ((_parentPath param [0, ""]) != "ACE_ZeusActions") exitWith {ERROR_1("Bad path %1 - should have ACE_ZeusActions as base", _parentPath); []}; +TRACE_2("addActionToZeus",_parentPath,_action); + +private _currentPath = GVAR(ZeusActions); +private _pathValid = false; +{ + private _targetParent = _x; + _pathValid = false; + { + _x params ["_xAction", "_xSubActions"]; + TRACE_2("",_targetParent,_xAction); + if ((_xAction select 0) == _targetParent) exitWith { + _pathValid = true; + _currentPath = _xSubActions; + }; + } forEach _currentPath; +} forEach _parentPath; + +if (!_pathValid) exitWith {ERROR_1("Bad path %1", _parentPath); []}; + +TRACE_1("Adding Action",_currentPath); +_currentPath pushBack [_action, []]; + +// Return the full path +(_parentPath + [_action select 0]) diff --git a/addons/interact_menu/functions/fnc_collectActiveActionTree.sqf b/addons/interact_menu/functions/fnc_collectActiveActionTree.sqf index ae066576f7..08e1608990 100644 --- a/addons/interact_menu/functions/fnc_collectActiveActionTree.sqf +++ b/addons/interact_menu/functions/fnc_collectActiveActionTree.sqf @@ -11,6 +11,9 @@ * Return Value: * Active children * + * Example: + * [bob, [array], [array], 5] call ACE_interact_menu_fnc_collectActoveActionTree + * * Public: No */ #include "script_component.hpp" diff --git a/addons/interact_menu/functions/fnc_compileMenu.sqf b/addons/interact_menu/functions/fnc_compileMenu.sqf index 78232af4e2..58e13ee481 100644 --- a/addons/interact_menu/functions/fnc_compileMenu.sqf +++ b/addons/interact_menu/functions/fnc_compileMenu.sqf @@ -8,9 +8,12 @@ * Return Value: * None * + * Example: + * [bob] call ACE_interact_menu_fnc_compileMenu + * * Public: No */ -#include "script_component.hpp"; +#include "script_component.hpp" params ["_target"]; @@ -99,11 +102,32 @@ private _recurseFnc = { _actions }; +if ((getNumber (configFile >> "CfgVehicles" >> _objectType >> "isPlayableLogic")) == 1) exitWith { + TRACE_1("skipping playable logic",_objectType); + _namespace setVariable [_objectType, []]; +}; + private _actionsCfg = configFile >> "CfgVehicles" >> _objectType >> "ACE_Actions"; TRACE_1("Building ACE_Actions",_objectType); private _actions = [_actionsCfg, 0] call _recurseFnc; +// ace_interaction_fnc_addPassengerAction expects ACE_MainActions to be first +// Other mods can change the order that configs are added, so we should verify this now and resort if needed +if (_objectType isKindOf "CaManBase") then { + if ((((_actions select 0) select 0) select 0) != "ACE_MainActions") then { + INFO_1("ACE_MainActions not first for man [%1]",_objectType); + private _mainActions = []; + { + if (((_x select 0) select 0) == "ACE_MainActions") then { + _mainActions = _actions deleteAt _forEachIndex; + }; + } forEach _actions; + if (_mainActions isEqualTo []) exitWith {ERROR_1("ACE_MainActions not found on man [%1]",_objectType);}; + _actions = [_mainActions] + _actions; // resort array with ACE_MainActions first + }; +}; + _namespace setVariable [_objectType, _actions]; /* diff --git a/addons/interact_menu/functions/fnc_compileMenuSelfAction.sqf b/addons/interact_menu/functions/fnc_compileMenuSelfAction.sqf index 0c5e236f0b..b4d969667b 100644 --- a/addons/interact_menu/functions/fnc_compileMenuSelfAction.sqf +++ b/addons/interact_menu/functions/fnc_compileMenuSelfAction.sqf @@ -8,9 +8,12 @@ * Return Value: * None * + * Example: + * [bob] call ACE_interact_menu_fnc_compileMenuSelfAction + * * Public: No */ -#include "script_component.hpp"; +#include "script_component.hpp" params ["_target"]; @@ -114,7 +117,7 @@ private _actions = [ // Dummy statement so it's not collapsed when there's no available actions true }, - {[ACE_player, _target, ["isNotInside","isNotDragging", "isNotCarrying", "isNotSwimming", "notOnMap", "isNotEscorting", "isNotSurrendering", "isNotSitting", "isNotOnLadder"]] call EFUNC(common,canInteractWith)}, + {[ACE_player, _target, ["isNotInside","isNotDragging", "isNotCarrying", "isNotSwimming", "notOnMap", "isNotEscorting", "isNotSurrendering", "isNotSitting", "isNotOnLadder", "isNotRefueling"]] call EFUNC(common,canInteractWith)}, {}, {}, "Spine3", diff --git a/addons/interact_menu/functions/fnc_compileMenuZeus.sqf b/addons/interact_menu/functions/fnc_compileMenuZeus.sqf index c0797269e6..a5987d411f 100644 --- a/addons/interact_menu/functions/fnc_compileMenuZeus.sqf +++ b/addons/interact_menu/functions/fnc_compileMenuZeus.sqf @@ -3,14 +3,17 @@ * Compile the zeus action menu (only to be done once) * * Arguments: - * nil + * None * * Return Value: * None * + * Example: + * call ACE_interact_menu_fnc_compileMenuZeus + * * Public: No */ -#include "script_component.hpp"; +#include "script_component.hpp" // Exit if the action menu is already compiled for zeus if !(isNil {missionNamespace getVariable [QGVAR(ZeusActions), nil]}) exitWith {}; diff --git a/addons/interact_menu/functions/fnc_createVehiclesActions.sqf b/addons/interact_menu/functions/fnc_createVehiclesActions.sqf new file mode 100644 index 0000000000..6bdc941118 --- /dev/null +++ b/addons/interact_menu/functions/fnc_createVehiclesActions.sqf @@ -0,0 +1,33 @@ +/* + * Author: Dystopian + * Creates child actions for vehicle list. + * Statement gets vehicle as action parameter. + * + * Arguments: + * 0: Vehicle list + * 1: Statement + * 2: Target + * + * Return Value: + * Array of actions + * + * Example: + * [nearestObjects [player, ["AllVehicles"], 10], {}, cursorObject] call ace_interact_menu_fnc_createVehiclesActions + * + * Public: No + */ +#include "script_component.hpp" + +params ["_vehicles", "_statement", "_target"]; + +_vehicles apply { + private _config = configFile >> "CfgVehicles" >> typeOf _x; + private _name = getText (_config >> "displayName"); + private _ownerName = [_x, true] call EFUNC(common,getName); + if ("" != _ownerName) then { + _name = format ["%1 (%2)", _name, _ownerName]; + }; + private _icon = (getText (_config >> "icon")) call BIS_fnc_textureVehicleIcon; + private _action = [format ["%1", _x], _name, _icon, _statement, {true}, {}, _x] call EFUNC(interact_menu,createAction); + [_action, [], _target] +} diff --git a/addons/interact_menu/functions/fnc_ctrlSetParsedTextCached.sqf b/addons/interact_menu/functions/fnc_ctrlSetParsedTextCached.sqf index 38e5a42460..98408f58f9 100644 --- a/addons/interact_menu/functions/fnc_ctrlSetParsedTextCached.sqf +++ b/addons/interact_menu/functions/fnc_ctrlSetParsedTextCached.sqf @@ -10,6 +10,9 @@ * Return Value: * None * + * Example: + * [CONTROL, 5, "text"] call ACE_interact_menu_fnc_ctrlSetParsedTextCached + * * Public: No */ #include "script_component.hpp" diff --git a/addons/interact_menu/functions/fnc_handleEscapeMenu.sqf b/addons/interact_menu/functions/fnc_handleEscapeMenu.sqf new file mode 100644 index 0000000000..d390d23d94 --- /dev/null +++ b/addons/interact_menu/functions/fnc_handleEscapeMenu.sqf @@ -0,0 +1,28 @@ +/* + * Author: PabstMirror + * Handle the escape key being pressed. + * + * Arguments: + * 0: Escape menu display that should be closed (default: displayNull) + * + * Return Value: + * None + * + * Example: + * [display] call ace_interact_menu_fnc_handleEscapeMenu + * + * Public: No + */ +#include "script_component.hpp" + +if (GVAR(openedMenuType) < 0) exitWith {}; + +params [["_display", displayNull, [displayNull]]]; +TRACE_2("handleEscapeMenu",_display,isNull _display); + +if (!isNull _display) then { + _display closeDisplay 0; +}; + +GVAR(actionSelected) = false; +[GVAR(openedMenuType), false] call FUNC(keyUp); diff --git a/addons/interact_menu/functions/fnc_isSubPath.sqf b/addons/interact_menu/functions/fnc_isSubPath.sqf index 5933e2c462..2c8244b081 100644 --- a/addons/interact_menu/functions/fnc_isSubPath.sqf +++ b/addons/interact_menu/functions/fnc_isSubPath.sqf @@ -7,7 +7,7 @@ * 1: ShortPath * * Return Value: - * Bool + * Bool * * Example: * [[["ACE_SelfActions", player],["ace_Gestures", player]], [["ACE_SelfActions", player]]] call ace_interact_menu_fnc_isSubPath @@ -22,6 +22,7 @@ private _isSubPath = true; if (count _shortPath > count _longPath) exitWith {false}; +//IGNORE_PRIVATE_WARNING ["_i"]; for [{private _i = 0},{_i < count _shortPath},{_i = _i + 1}] do { if !((_longPath select _i) isEqualTo (_shortPath select _i)) exitWith { _isSubPath = false; diff --git a/addons/interact_menu/functions/fnc_keyDown.sqf b/addons/interact_menu/functions/fnc_keyDown.sqf index 58286a65bb..5d19434c79 100644 --- a/addons/interact_menu/functions/fnc_keyDown.sqf +++ b/addons/interact_menu/functions/fnc_keyDown.sqf @@ -8,6 +8,9 @@ * Return Value: * true * + * Example: + * [0] call ACE_interact_menu_fnc_keyDown + * * Public: No */ #include "script_component.hpp" @@ -18,7 +21,7 @@ if (GVAR(openedMenuType) == _menuType) exitWith {true}; // Conditions: canInteract (these don't apply to zeus) if ((isNull curatorCamera) && { - !([ACE_player, objNull, ["isNotInside","isNotDragging", "isNotCarrying", "isNotSwimming", "notOnMap", "isNotEscorting", "isNotSurrendering", "isNotSitting", "isNotOnLadder"]] call EFUNC(common,canInteractWith)) + !([ACE_player, objNull, ["isNotInside","isNotDragging", "isNotCarrying", "isNotSwimming", "notOnMap", "isNotEscorting", "isNotSurrendering", "isNotSitting", "isNotOnLadder", "isNotRefueling"]] call EFUNC(common,canInteractWith)) }) exitWith {false}; while {dialog} do { @@ -38,6 +41,7 @@ GVAR(lastTimeSearchedActions) = -1000; GVAR(ParsedTextCached) = []; GVAR(useCursorMenu) = (vehicle ACE_player != ACE_player) || + (!(isNull (ACE_controlledUAV select 0))) || visibleMap || (!isNull curatorCamera) || {(_menuType == 1) && {(isWeaponDeployed ACE_player) || GVAR(AlwaysUseCursorSelfInteraction) || {cameraView == "GUNNER"}}} || @@ -59,7 +63,13 @@ if (GVAR(useCursorMenu)) then { createDialog QGVAR(cursorMenu); }; (finddisplay 91919) displayAddEventHandler ["KeyUp", {[_this,'keyup'] call CBA_events_fnc_keyHandler}]; - (finddisplay 91919) displayAddEventHandler ["KeyDown", {[_this,'keydown'] call CBA_events_fnc_keyHandler}]; + (finddisplay 91919) displayAddEventHandler ["KeyDown", { + // Handle the escape key being pressed with menu open: + if ((_this select [1,4]) isEqualTo [1,false,false,false]) exitWith { // escape key with no modifiers + [displayNull] call FUNC(handleEscapeMenu); + }; + [_this,'keydown'] call CBA_events_fnc_keyHandler; + }]; // The dialog sets: // uiNamespace getVariable QGVAR(dlgCursorMenu); // uiNamespace getVariable QGVAR(cursorMenuOpened); @@ -73,6 +83,10 @@ if (GVAR(useCursorMenu)) then { ((finddisplay 91919) displayctrl 9922) ctrlAddEventHandler ["MouseMoving", DFUNC(handleMouseMovement)]; ((finddisplay 91919) displayctrl 9922) ctrlAddEventHandler ["MouseButtonDown", DFUNC(handleMouseButtonDown)]; setMousePosition [0.5, 0.5]; +} else { + if (uiNamespace getVariable [QGVAR(cursorMenuOpened),false]) then { + (findDisplay 91919) closeDisplay 2; + }; }; GVAR(selfMenuOffset) = (AGLtoASL (positionCameraToWorld [0, 0, 2])) vectorDiff (AGLtoASL (positionCameraToWorld [0, 0, 0])); @@ -80,12 +94,20 @@ GVAR(selfMenuOffset) = (AGLtoASL (positionCameraToWorld [0, 0, 2])) vectorDiff ( //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)]]; + if (!(isNull (ACE_controlledUAV select 0))) then { + GVAR(menuDepthPath) = [["ACE_SelfActions", (ACE_controlledUAV select 0)]]; GVAR(expanded) = true; GVAR(expandedTime) = diag_tickTime; GVAR(lastPath) = +GVAR(menuDepthPath); GVAR(startHoverTime) = -1000; + } else { + if (vehicle ACE_player != ACE_player) then { + GVAR(menuDepthPath) = [["ACE_SelfActions", (vehicle ACE_player)]]; + GVAR(expanded) = true; + GVAR(expandedTime) = diag_tickTime; + GVAR(lastPath) = +GVAR(menuDepthPath); + GVAR(startHoverTime) = -1000; + }; }; } else { GVAR(menuDepthPath) = [["ACE_ZeusActions", (getAssignedCuratorLogic player)]]; diff --git a/addons/interact_menu/functions/fnc_keyUp.sqf b/addons/interact_menu/functions/fnc_keyUp.sqf index aae9a370c1..dc1fcf3fe6 100644 --- a/addons/interact_menu/functions/fnc_keyUp.sqf +++ b/addons/interact_menu/functions/fnc_keyUp.sqf @@ -8,6 +8,9 @@ * Return Value: * true * + * Example: + * [1] call ACE_interact_menu_fnc_keyUp + * * Public: No */ #include "script_component.hpp" diff --git a/addons/interact_menu/functions/fnc_removeActionFromObject.sqf b/addons/interact_menu/functions/fnc_removeActionFromObject.sqf index 3b720d3c71..fd59e0eb4a 100644 --- a/addons/interact_menu/functions/fnc_removeActionFromObject.sqf +++ b/addons/interact_menu/functions/fnc_removeActionFromObject.sqf @@ -19,12 +19,11 @@ params ["_object", "_typeNum", "_fullPath"]; -private ["_res","_varName","_actionList"]; -_res = _fullPath call FUNC(splitPath); +private _res = _fullPath call FUNC(splitPath); _res params ["_parentPath", "_actionName"]; -_varName = [QGVAR(actions),QGVAR(selfActions)] select _typeNum; -_actionList = _object getVariable [_varName, []]; +private _varName = [QGVAR(actions),QGVAR(selfActions)] select _typeNum; +private _actionList = _object getVariable [_varName, []]; { if (((_x select 0) select 0) isEqualTo _actionName && {(_x select 1) isEqualTo _parentPath}) exitWith { diff --git a/addons/interact_menu/functions/fnc_renderActionPoints.sqf b/addons/interact_menu/functions/fnc_renderActionPoints.sqf index 017d3e539b..8d0e2de397 100644 --- a/addons/interact_menu/functions/fnc_renderActionPoints.sqf +++ b/addons/interact_menu/functions/fnc_renderActionPoints.sqf @@ -8,6 +8,9 @@ * Return Value: * None * + * Example: + * call ACE_interact_menu_fnc_renderActionPoints + * * Public: No */ #include "script_component.hpp" @@ -127,17 +130,22 @@ GVAR(collectedActionPoints) resize 0; // Render nearby actions, unit self actions or vehicle self actions as appropiate if (GVAR(openedMenuType) == 0) then { if (isNull curatorCamera) then { - if (vehicle ACE_player == ACE_player) then { - if (diag_tickTime > GVAR(lastTimeSearchedActions) + 0.20) then { - // Once every 0.2 secs, collect nearby objects active and visible action points and render them - call _fnc_renderNearbyActions; - } else { - // The rest of the frames just draw the same action points rendered the last frame - call _fnc_renderLastFrameActions; - }; + if (!(isNull (ACE_controlledUAV select 0))) then { + // Render UAV self actions when in control of UAV AI + (ACE_controlledUAV select 0) call _fnc_renderSelfActions; } else { - // Render vehicle self actions when in vehicle - (vehicle ACE_player) call _fnc_renderSelfActions; + if (vehicle ACE_player == ACE_player) then { + if (diag_tickTime > GVAR(lastTimeSearchedActions) + 0.20) then { + // Once every 0.2 secs, collect nearby objects active and visible action points and render them + call _fnc_renderNearbyActions; + } else { + // The rest of the frames just draw the same action points rendered the last frame + call _fnc_renderLastFrameActions; + }; + } else { + // Render vehicle self actions when in vehicle + (vehicle ACE_player) call _fnc_renderSelfActions; + }; }; } else { // Render zeus actions when zeus open diff --git a/addons/interact_menu/functions/fnc_renderBaseMenu.sqf b/addons/interact_menu/functions/fnc_renderBaseMenu.sqf index 363f7100f9..fefab99721 100644 --- a/addons/interact_menu/functions/fnc_renderBaseMenu.sqf +++ b/addons/interact_menu/functions/fnc_renderBaseMenu.sqf @@ -10,6 +10,9 @@ * Return Value: * Was the menu rendered * + * Example: + * [bob, [node], [0, 0, 0]] call ACE_interact_menu_fnc_renderBaseMenu + * * Public: No */ #include "script_component.hpp" @@ -34,7 +37,7 @@ private _pos = if((count _this) > 2) then { // For non-self actions, exit if the action is too far away or ocluded private _distanceToBasePoint = 0; //This will be 0 for self/zeus/in-vehicle (used later to check sub action distance) -if ((GVAR(openedMenuType) == 0) && {vehicle ACE_player == ACE_player} && {isNull curatorCamera} && +if ((GVAR(openedMenuType) == 0) && {isNull (ACE_controlledUAV select 0)} && {vehicle ACE_player == ACE_player} && {isNull curatorCamera} && { private _headPos = ACE_player modelToWorldVisual (ACE_player selectionPosition "pilot"); _distanceToBasePoint = _headPos distance _pos; @@ -61,7 +64,7 @@ if ((_sPos select 0) < safeZoneXAbs || {(_sPos select 0) > safeZoneXAbs + safeZo if ((_sPos select 1) < safeZoneY || {(_sPos select 1) > safeZoneY + safeZoneH}) exitWith {false}; -BEGIN_COUNTER(fnc_collectActiveActionTree) +BEGIN_COUNTER(fnc_collectActiveActionTree); // Collect active tree private _uid = format [QGVAR(ATCache_%1), _actionName]; @@ -71,7 +74,7 @@ private _activeActionTree = [ _object, _uid, 1.0, "ace_interactMenuClosed" ] call EFUNC(common,cachedCall); -END_COUNTER(fnc_collectActiveActionTree) +END_COUNTER(fnc_collectActiveActionTree); #ifdef DEBUG_MODE_EXTRA diag_log "Printing: _activeActionTree"; @@ -79,9 +82,6 @@ diag_log "Printing: _activeActionTree"; params ["_level", "_node"]; _node params ["_actionData", "_children", "_object"]; diag_log text format ["Level %1 -> %2 on %3", _level, _actionData select 0, _object]; - { - [_level + 1, _x] call _fnc_print; - } forEach _children; }; #endif @@ -101,6 +101,6 @@ GVAR(collectedActionPoints) pushBack [_sPos select 2, _sPos, _activeActionTree]; END_COUNTER(fnc_renderMenus); -END_COUNTER(fnc_renderBaseMenu) +END_COUNTER(fnc_renderBaseMenu); true diff --git a/addons/interact_menu/functions/fnc_renderIcon.sqf b/addons/interact_menu/functions/fnc_renderIcon.sqf index ec26635f02..4d9892ed2c 100644 --- a/addons/interact_menu/functions/fnc_renderIcon.sqf +++ b/addons/interact_menu/functions/fnc_renderIcon.sqf @@ -11,6 +11,9 @@ * Return Value: * None * + * Example: + * ["text", "icon", [5, 6], "text"] call ACE_interact_menu_fnc_renderIcon + * * Public: No */ #include "script_component.hpp" diff --git a/addons/interact_menu/functions/fnc_renderMenu.sqf b/addons/interact_menu/functions/fnc_renderMenu.sqf index 687c56d2c3..70bf02fe9a 100644 --- a/addons/interact_menu/functions/fnc_renderMenu.sqf +++ b/addons/interact_menu/functions/fnc_renderMenu.sqf @@ -11,6 +11,9 @@ * Return Value: * None * + * Example: + * [[], [], [5, 2], []] call ACE_interact_menu_fnc_renderMenu + * * Public: No */ #include "script_component.hpp" diff --git a/addons/interact_menu/functions/fnc_renderSelector.sqf b/addons/interact_menu/functions/fnc_renderSelector.sqf index ef10456b5a..c2fe5f932c 100644 --- a/addons/interact_menu/functions/fnc_renderSelector.sqf +++ b/addons/interact_menu/functions/fnc_renderSelector.sqf @@ -9,6 +9,9 @@ * Return Value: * None * + * Example: + * [[2, 5], "icon"] call ACE_interact_menu_fnc_renderSelector + * * Public: No */ #include "script_component.hpp" diff --git a/addons/interact_menu/functions/fnc_setupTextColors.sqf b/addons/interact_menu/functions/fnc_setupTextColors.sqf index 120c5b18e3..e51d39e533 100644 --- a/addons/interact_menu/functions/fnc_setupTextColors.sqf +++ b/addons/interact_menu/functions/fnc_setupTextColors.sqf @@ -8,6 +8,9 @@ * Return Value: * None * + * Example: + * call ACE_interact_menu_fnc_setupTextColor + * * Public: No */ #include "script_component.hpp" diff --git a/addons/interact_menu/functions/fnc_splitPath.sqf b/addons/interact_menu/functions/fnc_splitPath.sqf index eba203aa6f..93dea35d7c 100644 --- a/addons/interact_menu/functions/fnc_splitPath.sqf +++ b/addons/interact_menu/functions/fnc_splitPath.sqf @@ -9,6 +9,9 @@ * 0: Parent path * 1: Action name * + * Example: + * [[path]] call ACE_interact_menu_fnc_splitPath + * * Public: No */ #include "script_component.hpp" diff --git a/addons/interact_menu/functions/fnc_userActions_addHouseActions.sqf b/addons/interact_menu/functions/fnc_userActions_addHouseActions.sqf index 2940bc2936..7fa9ffdac5 100644 --- a/addons/interact_menu/functions/fnc_userActions_addHouseActions.sqf +++ b/addons/interact_menu/functions/fnc_userActions_addHouseActions.sqf @@ -7,7 +7,7 @@ * 0: Interact Menu Type (0 - world, 1 - self) * * Return Value: - * Nothing + * None * * Example: * [0] call ace_interact_menu_fnc_userActions_addHouseActions diff --git a/addons/interact_menu/functions/fnc_userActions_getHouseActions.sqf b/addons/interact_menu/functions/fnc_userActions_getHouseActions.sqf index c513805d10..99eafc0392 100644 --- a/addons/interact_menu/functions/fnc_userActions_getHouseActions.sqf +++ b/addons/interact_menu/functions/fnc_userActions_getHouseActions.sqf @@ -6,7 +6,7 @@ * 0: Building Classname * * Return Value: - * [[Array of MemPoints], [Array Of Actions]] + * [[Array of MemPoints], [Array Of Actions]] * * Example: * ["Land_i_House_Big_01_V1_F"] call ace_interact_menu_fnc_userActions_getHouseActions diff --git a/addons/interact_menu/stringtable.xml b/addons/interact_menu/stringtable.xml index a4541511dd..a05dcee3e4 100644 --- a/addons/interact_menu/stringtable.xml +++ b/addons/interact_menu/stringtable.xml @@ -13,6 +13,9 @@ Mostra sempre il cursore delle autointerazioni Sempre mostrar cursor para interação pessoal セルフ インタラクションへ常にカーソルを表示 + 자기상호작용시 항상 커서를 보이기 + 自我互动时永远显示游标 + 自我互動時永遠顯示游標 Always display cursor for interaction @@ -26,6 +29,9 @@ Mindig legyen a cselekvés kurzorja látható Sempre mostrar cursor para interação インタラクションへ常にカーソルを表示 + 상호작용시 항상 커서를 보이기 + 互动时永远显示游标 + 互動時永遠顯示游標 Display interaction menus as lists @@ -39,6 +45,9 @@ Cselekvő menük listaként való megjelenítése Mostrar menu de interação como listas 表示されるインタラクション メニューを一覧表示 + 상호작용메뉴를 리스트화 해서 보이기 + 以列表方式显示互动表单 + 以列表方式顯示互動表單 Interact Key @@ -52,6 +61,9 @@ Tasto interazione Tecla de Interação インタラクション キー + 상호작용 키 + 互动键 + 互動鍵 Self Interaction Key @@ -65,6 +77,9 @@ Tasto interazione su se stessi Tecla de Interação Pessoal セルフ インタラクション キー + 자기상호작용 키 + 自我互动键 + 自我互動鍵 Self Actions @@ -78,6 +93,9 @@ Interazioni su se stessi Ações Pessoais 自分への動作 + 자기 동작 + 自我动作 + 自我動作 Vehicle Actions @@ -91,6 +109,9 @@ Interazioni con veicoli Ações de Veículos 車両への動作 + 차량 동작 + 载具动作 + 載具動作 Zeus Actions @@ -104,6 +125,9 @@ Действия Зевса Azioni Zeus Zeus への動作 + Zeus 동작 + 宙斯操作 + 宙斯操作 Interaction - Text Max @@ -117,6 +141,9 @@ Cselekvés - Szöveg max. Interação - Max. de Texto インタラクション - 文字の色 + 상호작용 - 문자색깔 + 互动 - 文字最大化 + 互動 - 文字最大化 Interaction - Text Min @@ -130,6 +157,9 @@ Cselekvés - Szöveg min. Interação - Min. de Texto インタラクション - 文字の背景色 + 상호작용 - 문자배경색 + 互动 - 文字最小化 + 互動 - 文字最小化 Interaction - Shadow Max @@ -143,6 +173,9 @@ Cselekvés - Árnyék max. Interação - Max. de Sombra インタラクション - 文字への影の色 + 상호작용 - 문자그림자색 + 互动 - 阴影最大化 + 互動 - 陰影最大化 Interaction - Shadow Min @@ -156,6 +189,9 @@ Cselekvés - Árnyék min. Interação - Min. de Sombra インタラクション - 文字への影の最低色 + 상호작용 - 문자그림자배경색 + 互动 - 阴影最小化 + 互動 - 陰影最小化 Keep cursor centered @@ -169,6 +205,9 @@ Manter o cursor centralizado Mantieni il cursore centrato 常にカーソルを中央にする + 커서를 항상 가운데에 둡니다 + 保持游标在中心点 + 保持游標在中心點 Keeps cursor centered and pans the option menu around. Useful if screen size is limited. @@ -182,6 +221,9 @@ Manter o cursor centralizado e mover o menu de opções. Útil caso o tamanho da tela seja limitado. Mantieni il cursore centrato e sposta il menù intorno. Utile se lo schermo è piccolo. 常にカーソルを中央へ表示させ、オプション メニューが移動します。画面の大きさが制限されている時に使いやすくなります。 + 커서를 항상 가운데에 두고 메뉴를 움직입니다. 화면의 크기가 제한되있을때 유용합니다. + 保持游标在中心点并平移周遭的选项选单。这对在荧幕尺寸有限的玩家很有用! + 保持游標在中心點並平移周遭的選項選單。這對在螢幕尺寸有限的玩家很有用! Do action when releasing menu key @@ -195,6 +237,9 @@ Cselekvés végrehajtása a menügomb elengedésekor Esegui l'azione quando rilasci il tasto menu メニュー キーを離したときに動作を実行します。 + 메뉴키를 놓을때 행동하기 + 当放开选单键后就执行动作 + 當放開選單鍵後就執行動作 Interaction Text Size @@ -208,6 +253,9 @@ Cselekvő szöveg mérete Dimensione del testo d'interazione インタラクション文字の大きさ + 상호작용 - 문자크기 + 互动选单文字大小 + 互動選單文字大小 Interaction Text Shadow @@ -221,6 +269,9 @@ Cselekvő szöveg árnyéka Ombra del testo d'interazione インタラクション文字へ影 + 상호작용 - 문자그림자 + 互动选单文字阴影 + 互動選單文字陰影 Allows controlling the text's shadow. Outline ignores custom shadow colors. @@ -234,6 +285,9 @@ Hozzáférést biztosít a szöveg árnyékának kezeléséhez. A körvonal nem veszi figyelembe az egyedi árnyékszíneket. Permette di controllare l'ombra del testo. L'impostazione "Contorno" ignora il colore dell'ombra. 文字への影を設定します。縁取りは設定された影の色を無視します。 + 문자의 그림자를 조절하는것을 가능케합니다. 외각선은 임의의 그림자색을 무시합니다. + 允许控制文字阴影。轮廓部分则会忽略自定义的阴影颜色。 + 允許控制文字陰影。輪廓部分則會忽略自定義的陰影顏色。 Outline @@ -247,6 +301,9 @@ Körvonal Contorno 縁取り + 외각선 + 只显示轮廓 + 只顯示輪廓 Interaction menu background @@ -260,6 +317,9 @@ Фон меню взаимодействия Sfondo Menù Interazioni インタラクション メニューの背景 + 상호작용 메뉴 배경 + 互动选单背景 + 互動選單背景 Blur the background while the interaction menu is open. @@ -273,6 +333,9 @@ Размыть фон, пока открыто меню взаимодействия. Sfoca lo sfondo mentre il Menù Interazioni è aperto. インタラクション メニューを開いたとき、背景にボケを与えます。 + 상호작용 메뉴가 열릴시 배경을 흐릿하게 처리합니다. + 当互动选单开启时,模糊背景画面。 + 當互動選單開啟時,模糊背景畫面。 Blur screen @@ -286,6 +349,9 @@ Размытый Sfoca schermo ボケ画面 + 화면 흐리게 + 模糊画面 + 模糊畫面 Black @@ -299,6 +365,9 @@ Черный Nero ブラック + 까맣게 + 黑色 + 黑色 Show actions for buildings @@ -312,6 +381,9 @@ Показывать действия для зданий Mostra azioni per edifici 建物へ動作を表示 + 건물에 행동을 취함 + 显示建筑物可用的动作 + 顯示建築物可用的動作 Adds interaction actions for opening doors and mounting ladders on buildings. (Note: There is a performance cost when opening interaction menu, especially in towns) @@ -325,6 +397,9 @@ Добавляет действия открывания дверей и залезания на лестницы для зданий. (Примечание: возможно падение производительности при открытии меню взаимодействия, особенно в городах) Aggiunge azioni interattive per l'apertura delle porte e piazzamento scale su edifici. (Nota: C'è un costo in performance quando si apre il Menù Interazioni, soprattutto in città) 建物にあるドアの開閉やラダーの昇降といった動作をインタラクションへ追加します。(街などでインタラクション メニューを開くとパフォーマンスが低下します) + 건물의 문을 열거나 사다리에 오르는 상호작용 행동을 추가합니다. (주의: 상호작용 메뉴를 열경우 성능하락이 있을 수 있음, 특히 마을 내부에서) + 增加互动选单的功能在可开启的门与建筑物的梯子上。(注意: 此功能有可能会降低系统效能,特别是在城镇区更明显) + 增加互動選單的功能在可開啟的門與建築物的梯子上。(注意: 此功能有可能會降低系統效能,特別是在城鎮區更明顯) Interaction Menu @@ -337,6 +412,9 @@ Menù Interazioni Menu d'interaction インタラクション メニュー + 상호작용 메뉴 + 互动选单 + 互動選單 Interaction Animation Speed @@ -349,6 +427,9 @@ Velocidad de animación del menú de interacción Vitesse de l'aniamtion d'interaction インタラクションのアニメーション速度 + 상호작용 움직임 속도 + 互动选单动画速度 + 互動選單動畫速度 Makes menu animations faster and decreases the time needed to hover to show sub actions @@ -361,6 +442,9 @@ Hace la animación del menú más rápida, reduciendo el tiempo necesario para abrir sub-acciones. Rend les animations de menu plus rapide et réduit le temps nécessaire à l'affichage des sous menus d'action サブ動作が表示されるホバーをした時に、表示されるメニューのアニメーション速度を早くしたり遅くしたりできます + 使选单的动画速度更快,并减少子选项显现出来的时间 + 使選單的動畫速度更快,並減少子選項顯現出來的時間 + 상호 작용을 표시하기 위해 메뉴 애니메이션을 빠르게 만들고 마우스를 가져 오는 데 필요한 시간을 줄입니다. - \ No newline at end of file + diff --git a/addons/interaction/ACE_Settings.hpp b/addons/interaction/ACE_Settings.hpp index e95947ec75..6c6010bbe4 100644 --- a/addons/interaction/ACE_Settings.hpp +++ b/addons/interaction/ACE_Settings.hpp @@ -13,4 +13,10 @@ class ACE_Settings { displayName = CSTRING(PassMagazineSetting); category = ECSTRING(interact_menu,Category_InteractionMenu); }; + class GVAR(disableNegativeRating) { + displayName = CSTRING(DisableNegativeRating_DisplayName); + description = CSTRING(DisableNegativeRating_Description); + value = 0; + typeName = "BOOL"; + }; }; diff --git a/addons/interaction/ACE_ZeusActions.hpp b/addons/interaction/ACE_ZeusActions.hpp index af29186895..44b7078f4b 100644 --- a/addons/interaction/ACE_ZeusActions.hpp +++ b/addons/interaction/ACE_ZeusActions.hpp @@ -3,6 +3,7 @@ class ACE_ZeusActions { class ZeusUnits { displayName = "$STR_A3_RscDisplayCurator_ModeUnits_tooltip"; icon = "\A3\UI_F_Curator\Data\Displays\RscDisplayCurator\modeUnits_ca.paa"; + condition = QUOTE((count (curatorSelected select 0)) > 0); class stance { displayName = "$STR_A3_RscAttributeUnitPos_Title"; @@ -10,22 +11,22 @@ class ACE_ZeusActions { class prone { displayName = "$STR_Pos_Down"; icon = "\A3\UI_F\Data\IGUI\RscIngameUI\RscUnitInfo\SI_prone_ca.paa"; - statement = "{_x setUnitPos 'DOWN';} forEach (curatorSelected select 0);"; + statement = QUOTE([ARR_3(QQGVAR(zeusStance),[ARR_2('DOWN',curatorSelected select 0)],curatorSelected select 0)] call CBA_fnc_targetEvent;); }; class crouch { displayName = "$STR_Pos_Crouch"; icon = "\A3\UI_F\Data\IGUI\RscIngameUI\RscUnitInfo\SI_crouch_ca.paa"; - statement = "{_x setUnitPos 'MIDDLE';} forEach (curatorSelected select 0);"; + statement = QUOTE([ARR_3(QQGVAR(zeusStance),[ARR_2('MIDDLE',curatorSelected select 0)],curatorSelected select 0)] call CBA_fnc_targetEvent;); }; class stand { displayName = "$STR_Pos_Up"; icon = "\A3\UI_F\Data\IGUI\RscIngameUI\RscUnitInfo\SI_stand_ca.paa"; - statement = "{_x setUnitPos 'UP';} forEach (curatorSelected select 0);"; + statement = QUOTE([ARR_3(QQGVAR(zeusStance),[ARR_2('UP',curatorSelected select 0)],curatorSelected select 0)] call CBA_fnc_targetEvent;); }; class auto { displayName = "$STR_Pos_Automatic"; icon = "\A3\UI_F_Curator\Data\default_ca.paa"; - statement = "{_x setUnitPos 'AUTO';} forEach (curatorSelected select 0);"; + statement = QUOTE([ARR_3(QQGVAR(zeusStance),[ARR_2('AUTO',curatorSelected select 0)],curatorSelected select 0)] call CBA_fnc_targetEvent;); }; }; @@ -39,33 +40,34 @@ class ACE_ZeusActions { class ZeusGroups { displayName = "$STR_A3_RscDisplayCurator_ModeGroups_tooltip"; icon = "\A3\UI_F_Curator\Data\Displays\RscDisplayCurator\modeGroups_ca.paa"; + condition = QUOTE((count (curatorSelected select 1)) > 0); class behaviour { displayName = "$STR_Combat_Mode"; class careless { displayName = "$STR_Combat_Careless"; - statement = "{ _x setBehaviour 'CARELESS'; } forEach (curatorSelected select 1);"; + statement = QUOTE([ARR_3(QQGVAR(zeusBehaviour),[ARR_2('CARELESS',curatorSelected select 1)],curatorSelected select 1)] call CBA_fnc_targetEvent;); }; class safe { displayName = "$STR_Combat_Safe"; icon = "\A3\UI_F_Curator\Data\RscCommon\RscAttributeBehaviour\safe_ca.paa"; - statement = "{ _x setBehaviour 'SAFE'; } forEach (curatorSelected select 1);"; + statement = QUOTE([ARR_3(QQGVAR(zeusBehaviour),[ARR_2('CARELESS',curatorSelected select 1)],curatorSelected select 1)] call CBA_fnc_targetEvent;); }; class aware { displayName = "$STR_Combat_Aware"; icon = "\A3\UI_F_Curator\Data\RscCommon\RscAttributeBehaviour\aware_ca.paa"; - statement = "{ _x setBehaviour 'AWARE'; } forEach (curatorSelected select 1);"; + statement = QUOTE([ARR_3(QQGVAR(zeusBehaviour),[ARR_2('AWARE',curatorSelected select 1)],curatorSelected select 1)] call CBA_fnc_targetEvent;); }; class combat { displayName = "$STR_Combat_Combat"; icon = "\A3\UI_F_Curator\Data\RscCommon\RscAttributeBehaviour\combat_ca.paa"; - statement = "{ _x setBehaviour 'COMBAT'; } forEach (curatorSelected select 1);"; + statement = QUOTE([ARR_3(QQGVAR(zeusBehaviour),[ARR_2('COMBAT',curatorSelected select 1)],curatorSelected select 1)] call CBA_fnc_targetEvent;); }; class stealth { displayName = "$STR_Combat_Stealth"; icon = "\A3\UI_F_Curator\Data\RscCommon\RscAttributeBehaviour\stealth_ca.paa"; - statement = "{ _x setBehaviour 'STEALTH'; } forEach (curatorSelected select 1);"; + statement = QUOTE([ARR_3(QQGVAR(zeusBehaviour),[ARR_2('STEALTH',curatorSelected select 1)],curatorSelected select 1)] call CBA_fnc_targetEvent;); }; }; @@ -75,17 +77,17 @@ class ACE_ZeusActions { class limited { displayName = "$STR_Speed_Limited"; icon = "\A3\UI_F_Curator\Data\RscCommon\RscAttributeSpeedMode\limited_ca.paa"; - statement = "{_x setSpeedMode 'LIMITED';} forEach (curatorSelected select 1);"; + statement = QUOTE([ARR_3(QQGVAR(zeusSpeed),[ARR_2('LIMITED',curatorSelected select 1)],curatorSelected select 1)] call CBA_fnc_targetEvent;); }; class normal { displayName = "$STR_Speed_Normal"; icon = "\A3\UI_F_Curator\Data\RscCommon\RscAttributeSpeedMode\normal_ca.paa"; - statement = "{_x setSpeedMode 'NORMAL';} forEach (curatorSelected select 1);"; + statement = QUOTE([ARR_3(QQGVAR(zeusSpeed),[ARR_2('NORMAL',curatorSelected select 1)],curatorSelected select 1)] call CBA_fnc_targetEvent;); }; class full { displayName = "$STR_Speed_Full"; icon = "\A3\UI_F_Curator\Data\RscCommon\RscAttributeSpeedMode\full_ca.paa"; - statement = "{_x setSpeedMode 'FULL';} forEach (curatorSelected select 1);"; + statement = QUOTE([ARR_3(QQGVAR(zeusSpeed),[ARR_2('FULL',curatorSelected select 1)],curatorSelected select 1)] call CBA_fnc_targetEvent;); }; }; @@ -95,47 +97,47 @@ class ACE_ZeusActions { class wedge { displayName = "$STR_Wedge"; icon="\A3\UI_F_Curator\Data\RscCommon\RscAttributeFormation\wedge_ca.paa"; - statement = "{_x setFormation 'WEDGE';} forEach (curatorSelected select 1);"; + statement = QUOTE([ARR_3(QQGVAR(zeusFormation),[ARR_2('WEDGE',curatorSelected select 1)],curatorSelected select 1)] call CBA_fnc_targetEvent;); }; class vee { displayName = "$STR_Vee"; icon="\A3\UI_F_Curator\Data\RscCommon\RscAttributeFormation\vee_ca.paa"; - statement = "{_x setFormation 'VEE';} forEach (curatorSelected select 1);"; + statement = QUOTE([ARR_3(QQGVAR(zeusFormation),[ARR_2('VEE',curatorSelected select 1)],curatorSelected select 1)] call CBA_fnc_targetEvent;); }; class line { displayName = "$STR_Line"; icon="\A3\UI_F_Curator\Data\RscCommon\RscAttributeFormation\line_ca.paa"; - statement = "{_x setFormation 'LINE';} forEach (curatorSelected select 1);"; + statement = QUOTE([ARR_3(QQGVAR(zeusFormation),[ARR_2('LINE',curatorSelected select 1)],curatorSelected select 1)] call CBA_fnc_targetEvent;); }; class column { displayName = "$STR_Column"; icon="\A3\UI_F_Curator\Data\RscCommon\RscAttributeFormation\column_ca.paa"; - statement = "{_x setFormation 'COLUMN';} forEach (curatorSelected select 1);"; + statement = QUOTE([ARR_3(QQGVAR(zeusFormation),[ARR_2('COLUMN',curatorSelected select 1)],curatorSelected select 1)] call CBA_fnc_targetEvent;); }; class file { displayName = "$STR_File"; icon = "\A3\UI_F_Curator\Data\RscCommon\RscAttributeFormation\file_ca.paa"; - statement = "{_x setFormation 'FILE';} forEach (curatorSelected select 1);"; + statement = QUOTE([ARR_3(QQGVAR(zeusFormation),[ARR_2('FILE',curatorSelected select 1)],curatorSelected select 1)] call CBA_fnc_targetEvent;); }; class stag_column { displayName = "$STR_Staggered"; icon="\A3\UI_F_Curator\Data\RscCommon\RscAttributeFormation\stag_column_ca.paa"; - statement = "{_x setFormation 'STAG COLUMN';} forEach (curatorSelected select 1);"; + statement = QUOTE([ARR_3(QQGVAR(zeusFormation),[ARR_2('STAG COLUMN',curatorSelected select 1)],curatorSelected select 1)] call CBA_fnc_targetEvent;); }; class ech_left { displayName = "$STR_EchL"; icon="\A3\UI_F_Curator\Data\RscCommon\RscAttributeFormation\ech_left_ca.paa"; - statement = "{_x setFormation 'ECH LEFT';} forEach (curatorSelected select 1);"; + statement = QUOTE([ARR_3(QQGVAR(zeusFormation),[ARR_2('ECH LEFT',curatorSelected select 1)],curatorSelected select 1)] call CBA_fnc_targetEvent;); }; class ech_right { displayName = "$STR_EchR"; icon="\A3\UI_F_Curator\Data\RscCommon\RscAttributeFormation\ech_right_ca.paa"; - statement = "{_x setFormation 'ECH RIGHT';} forEach (curatorSelected select 1);"; + statement = QUOTE([ARR_3(QQGVAR(zeusFormation),[ARR_2('ECH RIGHT',curatorSelected select 1)],curatorSelected select 1)] call CBA_fnc_targetEvent;); }; class diamond { displayName = "$STR_Diamond"; icon="\A3\UI_F_Curator\Data\RscCommon\RscAttributeFormation\diamond_ca.paa"; - statement = "{_x setFormation 'DIAMOND';} forEach (curatorSelected select 1);"; + statement = QUOTE([ARR_3(QQGVAR(zeusFormation),[ARR_2('DIAMOND',curatorSelected select 1)],curatorSelected select 1)] call CBA_fnc_targetEvent;); }; }; }; @@ -143,33 +145,34 @@ class ACE_ZeusActions { class ZeusWaypoints { displayName = "Waypoints"; icon = "\A3\UI_F_Curator\Data\Displays\RscDisplayCurator\modeRecent_ca.paa"; + condition = QUOTE((count (curatorSelected select 2)) > 0); class behaviour { displayName = "$STR_Combat_Mode"; class careless { displayName = "$STR_Combat_Careless"; - statement = "{ _x setWaypointBehaviour 'CARELESS'; } forEach (curatorSelected select 2);"; + statement = QUOTE([ARR_2(QQGVAR(zeusBehaviour),[ARR_3('CARELESS',curatorSelected select 2,true)])] call CBA_fnc_serverEvent;); }; class safe { displayName = "$STR_Combat_Safe"; icon = "\A3\UI_F_Curator\Data\RscCommon\RscAttributeBehaviour\safe_ca.paa"; - statement = "{ _x setWaypointBehaviour 'SAFE'; } forEach (curatorSelected select 2);"; + statement = QUOTE([ARR_2(QQGVAR(zeusBehaviour),[ARR_3('SAFE',curatorSelected select 2,true)])] call CBA_fnc_serverEvent;); }; class aware { displayName = "$STR_Combat_Aware"; icon = "\A3\UI_F_Curator\Data\RscCommon\RscAttributeBehaviour\aware_ca.paa"; - statement = "{ _x setWaypointBehaviour 'AWARE'; } forEach (curatorSelected select 2);"; + statement = QUOTE([ARR_2(QQGVAR(zeusBehaviour),[ARR_3('AWARE',curatorSelected select 2,true)])] call CBA_fnc_serverEvent;); }; class combat { displayName = "$STR_Combat_Combat"; icon = "\A3\UI_F_Curator\Data\RscCommon\RscAttributeBehaviour\combat_ca.paa"; - statement = "{ _x setWaypointBehaviour 'COMBAT'; } forEach (curatorSelected select 2);"; + statement = QUOTE([ARR_2(QQGVAR(zeusBehaviour),[ARR_3('COMBAT',curatorSelected select 2,true)])] call CBA_fnc_serverEvent;); }; class stealth { displayName = "$STR_Combat_Stealth"; icon = "\A3\UI_F_Curator\Data\RscCommon\RscAttributeBehaviour\stealth_ca.paa"; - statement = "{ _x setWaypointBehaviour 'STEALTH'; } forEach (curatorSelected select 2);"; + statement = QUOTE([ARR_2(QQGVAR(zeusBehaviour),[ARR_3('STEALTH',curatorSelected select 2,true)])] call CBA_fnc_serverEvent;); }; }; @@ -179,17 +182,17 @@ class ACE_ZeusActions { class limited { displayName = "$STR_Speed_Limited"; icon = "\A3\UI_F_Curator\Data\RscCommon\RscAttributeSpeedMode\limited_ca.paa"; - statement = "{ _x setWaypointSpeed 'LIMITED'; } forEach (curatorSelected select 2);"; + statement = QUOTE([ARR_2(QQGVAR(zeusSpeed),[ARR_3('LIMITED',curatorSelected select 2,true)])] call CBA_fnc_serverEvent;); }; class normal { displayName = "$STR_Speed_Normal"; icon = "\A3\UI_F_Curator\Data\RscCommon\RscAttributeSpeedMode\normal_ca.paa"; - statement = "{ _x setWaypointSpeed 'NORMAL'; } forEach (curatorSelected select 2);"; + statement = QUOTE([ARR_2(QQGVAR(zeusSpeed),[ARR_3('NORMAL',curatorSelected select 2,true)])] call CBA_fnc_serverEvent;); }; class full { displayName = "$STR_Speed_Full"; icon = "\A3\UI_F_Curator\Data\RscCommon\RscAttributeSpeedMode\full_ca.paa"; - statement = "{ _x setWaypointSpeed 'FULL'; } forEach (curatorSelected select 2);"; + statement = QUOTE([ARR_2(QQGVAR(zeusSpeed),[ARR_3('FULL',curatorSelected select 2,true)])] call CBA_fnc_serverEvent;); }; }; @@ -199,47 +202,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 2);"; + statement = QUOTE([ARR_2(QQGVAR(zeusFormation),[ARR_3('WEDGE',curatorSelected select 2,true)])] call CBA_fnc_serverEvent;); }; class vee { displayName = "$STR_Vee"; icon="\A3\UI_F_Curator\Data\RscCommon\RscAttributeFormation\vee_ca.paa"; - statement = "{_x setWaypointFormation 'VEE';} forEach (curatorSelected select 2);"; + statement = QUOTE([ARR_2(QQGVAR(zeusFormation),[ARR_3('VEE',curatorSelected select 2,true)])] call CBA_fnc_serverEvent;); }; class line { displayName = "$STR_Line"; icon="\A3\UI_F_Curator\Data\RscCommon\RscAttributeFormation\line_ca.paa"; - statement = "{_x setWaypointFormation 'LINE';} forEach (curatorSelected select 2);"; + statement = QUOTE([ARR_2(QQGVAR(zeusFormation),[ARR_3('LINE',curatorSelected select 2,true)])] call CBA_fnc_serverEvent;); }; class column { displayName = "$STR_Column"; icon="\A3\UI_F_Curator\Data\RscCommon\RscAttributeFormation\column_ca.paa"; - statement = "{_x setWaypointFormation 'COLUMN';} forEach (curatorSelected select 2);"; + statement = QUOTE([ARR_2(QQGVAR(zeusFormation),[ARR_3('COLUMN',curatorSelected select 2,true)])] call CBA_fnc_serverEvent;); }; class file { displayName = "$STR_File"; icon = "\A3\UI_F_Curator\Data\RscCommon\RscAttributeFormation\file_ca.paa"; - statement = "{_x setWaypointFormation 'FILE';} forEach (curatorSelected select 2);"; + statement = QUOTE([ARR_2(QQGVAR(zeusFormation),[ARR_3('FILE',curatorSelected select 2,true)])] call CBA_fnc_serverEvent;); }; 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 2);"; + statement = QUOTE([ARR_2(QQGVAR(zeusFormation),[ARR_3('COLUMN',curatorSelected select 2,true)])] call CBA_fnc_serverEvent;); }; 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 2);"; + statement = QUOTE([ARR_2(QQGVAR(zeusFormation),[ARR_3('LEFT',curatorSelected select 2,true)])] call CBA_fnc_serverEvent;); }; 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 2);"; + statement = QUOTE([ARR_2(QQGVAR(zeusFormation),[ARR_3('RIGHT',curatorSelected select 2,true)])] call CBA_fnc_serverEvent;); }; class diamond { displayName = "$STR_Diamond"; icon="\A3\UI_F_Curator\Data\RscCommon\RscAttributeFormation\diamond_ca.paa"; - statement = "{_x setWaypointFormation 'DIAMOND';} forEach (curatorSelected select 2);"; + statement = QUOTE([ARR_2(QQGVAR(zeusFormation),[ARR_3('DIAMOND',curatorSelected select 2,true)])] call CBA_fnc_serverEvent;); }; }; }; @@ -247,5 +250,6 @@ class ACE_ZeusActions { class ZeusMarkers { displayName = "$STR_A3_RscDisplayCurator_ModeMarkers_tooltip"; icon = "\A3\UI_F_Curator\Data\Displays\RscDisplayCurator\modeMarkers_ca.paa"; + condition = QUOTE((count (curatorSelected select 3)) > 0); }; }; diff --git a/addons/interaction/CfgVehicles.hpp b/addons/interaction/CfgVehicles.hpp index 5ee893e101..59be0b34b0 100644 --- a/addons/interaction/CfgVehicles.hpp +++ b/addons/interaction/CfgVehicles.hpp @@ -7,7 +7,7 @@ class CfgVehicles { author = ECSTRING(common,ACETeam); category = "ACE"; displayName = CSTRING(Module_DisplayName); - function = "ACE_Interaction_fnc_moduleInteraction"; + function = QFUNC(moduleInteraction); scope = 2; isGlobal = 1; isSingular = 1; @@ -19,6 +19,12 @@ class CfgVehicles { typeName = "BOOL"; defaultValue = 1; }; + class DisableNegativeRating { + displayName = CSTRING(DisableNegativeRating_DisplayName); + description = CSTRING(DisableNegativeRating_Description); + typeName = "BOOL"; + defaultValue = 0; + }; }; class ModuleDescription { description = CSTRING(Module_Description); @@ -40,6 +46,7 @@ class CfgVehicles { displayName = CSTRING(PassMagazine); condition = ""; statement = ""; + exceptions[] = {"isNotSwimming"}; showDisabled = 0; priority = 3.3; icon = "\a3\ui_f\data\gui\Rsc\RscDisplayArsenal\cargomag_ca.paa"; @@ -48,6 +55,7 @@ class CfgVehicles { displayName = CSTRING(PassMagazinePrimary); condition = QUOTE([ARR_3(_player,_target,primaryWeapon _target)] call FUNC(canPassMagazine)); statement = QUOTE([ARR_3(_player,_target,primaryWeapon _target)] call FUNC(passMagazine)); + exceptions[] = {"isNotSwimming"}; showDisabled = 0; priority = 3; icon = "\a3\ui_f\data\gui\Rsc\RscDisplayArsenal\primaryweapon_ca.paa"; @@ -56,6 +64,7 @@ class CfgVehicles { displayName = CSTRING(PassMagazineHandgun); condition = QUOTE([ARR_3(_player,_target,handgunWeapon _target)] call FUNC(canPassMagazine)); statement = QUOTE([ARR_3(_player,_target,handgunWeapon _target)] call FUNC(passMagazine)); + exceptions[] = {"isNotSwimming"}; showDisabled = 0; priority = 1; icon = "\a3\ui_f\data\gui\Rsc\RscDisplayArsenal\handgun_ca.paa"; @@ -66,6 +75,7 @@ class CfgVehicles { displayName = CSTRING(TeamManagement); condition = QUOTE([ARR_2(_player,_target)] call DFUNC(canJoinTeam) && {GVAR(EnableTeamManagement)}); statement = ""; + exceptions[] = {"isNotSwimming"}; showDisabled = 0; priority = 3.2; icon = QPATHTOF(UI\team\team_management_ca.paa); @@ -74,6 +84,7 @@ class CfgVehicles { displayName = CSTRING(AssignTeamRed); condition = QUOTE([ARR_2(_player,_target)] call DFUNC(canJoinTeam)); statement = QUOTE([ARR_2(_target,'RED')] call DFUNC(joinTeam)); + exceptions[] = {"isNotSwimming"}; showDisabled = 1; icon = QPATHTOF(UI\team\team_red_ca.paa); priority = 2.4; @@ -82,6 +93,7 @@ class CfgVehicles { displayName = CSTRING(AssignTeamGreen); condition = QUOTE([ARR_2(_player,_target)] call DFUNC(canJoinTeam)); statement = QUOTE([ARR_2(_target,'GREEN')] call DFUNC(joinTeam)); + exceptions[] = {"isNotSwimming"}; showDisabled = 1; icon = QPATHTOF(UI\team\team_green_ca.paa); priority = 2.3; @@ -90,6 +102,7 @@ class CfgVehicles { displayName = CSTRING(AssignTeamBlue); condition = QUOTE([ARR_2(_player,_target)] call DFUNC(canJoinTeam)); statement = QUOTE([ARR_2(_target,'BLUE')] call DFUNC(joinTeam)); + exceptions[] = {"isNotSwimming"}; showDisabled = 1; icon = QPATHTOF(UI\team\team_blue_ca.paa); priority = 2.2; @@ -98,6 +111,7 @@ class CfgVehicles { displayName = CSTRING(AssignTeamYellow); condition = QUOTE([ARR_2(_player,_target)] call DFUNC(canJoinTeam)); statement = QUOTE([ARR_2(_target,'YELLOW')] call DFUNC(joinTeam)); + exceptions[] = {"isNotSwimming"}; showDisabled = 1; icon = QPATHTOF(UI\team\team_yellow_ca.paa); priority = 2.1; @@ -106,6 +120,7 @@ class CfgVehicles { displayName = CSTRING(LeaveTeam); condition = QUOTE([ARR_2(_player,_target)] call DFUNC(canJoinTeam) && {assignedTeam _target != 'MAIN'}); statement = QUOTE([ARR_2(_target,'MAIN')] call DFUNC(joinTeam)); + exceptions[] = {"isNotSwimming"}; showDisabled = 1; icon = QPATHTOF(UI\team\team_white_ca.paa); priority = 2.5; @@ -116,6 +131,8 @@ class CfgVehicles { displayName = CSTRING(JoinGroup); condition = QUOTE(GVAR(EnableTeamManagement) && {[ARR_2(_player,_target)] call DFUNC(canJoinGroup)}); statement = QUOTE([_player] joinSilent group _target); + modifierFunction = QUOTE(call FUNC(modifyJoinGroupAction)); + exceptions[] = {"isNotSwimming"}; showDisabled = 0; priority = 2.6; icon = QPATHTOF(UI\team\team_management_ca.paa); @@ -131,6 +148,7 @@ class CfgVehicles { displayName = CSTRING(SendAway); condition = QUOTE([ARR_2(_player,_target)] call DFUNC(canInteractWithCivilian)); statement = QUOTE([ARR_2(_player,_target)] call DFUNC(sendAway)); + exceptions[] = {"isNotSwimming"}; showDisabled = 0; priority = 2.0; }; @@ -138,6 +156,7 @@ class CfgVehicles { displayName = CSTRING(Pardon); condition = QUOTE([ARR_2(_player,_target)] call DFUNC(canPardon)); statement = QUOTE([ARR_2(_player,_target)] call DFUNC(pardon)); + exceptions[] = {"isNotSwimming"}; showDisabled = 0; priority = 2.5; }; @@ -145,6 +164,7 @@ class CfgVehicles { displayName = CSTRING(GetOut); condition = QUOTE(!(isNull objectParent _target) && [ARR_2(_player,_target)] call DFUNC(canInteractWithCivilian)); statement = QUOTE([_target] call EFUNC(common,unloadPerson)); + exceptions[] = {"isNotSwimming"}; showDisabled = 0; priority = 2.6; }; @@ -156,6 +176,7 @@ class CfgVehicles { distance = 1.50; condition = ""; statement = ""; + exceptions[] = {"isNotSwimming"}; }; class ACE_Head { displayName = CSTRING(Head); @@ -163,6 +184,7 @@ class CfgVehicles { distance = 1.50; condition = ""; statement = ""; + exceptions[] = {"isNotSwimming"}; }; class ACE_ArmLeft { displayName = CSTRING(ArmLeft); @@ -170,6 +192,7 @@ class CfgVehicles { distance = 1.50; condition = ""; statement = ""; + exceptions[] = {"isNotSwimming"}; }; class ACE_ArmRight { displayName = CSTRING(ArmRight); @@ -177,6 +200,7 @@ class CfgVehicles { distance = 1.50; condition = ""; statement = ""; + exceptions[] = {"isNotSwimming"}; }; class ACE_LegLeft { displayName = CSTRING(LegLeft); @@ -184,6 +208,7 @@ class CfgVehicles { distance = 1.50; condition = ""; statement = ""; + exceptions[] = {"isNotSwimming"}; }; class ACE_LegRight { displayName = CSTRING(LegRight); @@ -191,6 +216,7 @@ class CfgVehicles { distance = 1.50; condition = ""; statement = ""; + exceptions[] = {"isNotSwimming"}; }; class ACE_Weapon { displayName = CSTRING(Weapon); @@ -198,6 +224,7 @@ class CfgVehicles { distance = 1.50; condition = ""; statement = ""; + exceptions[] = {"isNotSwimming"}; }; class ACE_TapShoulderRight { displayName = CSTRING(TapShoulder); @@ -205,6 +232,7 @@ class CfgVehicles { distance = 2.0; condition = QUOTE([ARR_2(_player, _target)] call DFUNC(canTapShoulder)); statement = QUOTE([ARR_3(_player, _target, 0)] call DFUNC(tapShoulder)); + exceptions[] = {"isNotSwimming"}; }; class ACE_TapShoulderLeft { displayName = CSTRING(TapShoulder); @@ -212,6 +240,7 @@ class CfgVehicles { distance = 2.0; condition = QUOTE([ARR_2(_player, _target)] call DFUNC(canTapShoulder)); statement = QUOTE([ARR_3(_player, _target, 1)] call DFUNC(tapShoulder)); + exceptions[] = {"isNotSwimming"}; }; }; @@ -219,7 +248,7 @@ class CfgVehicles { class ACE_TeamManagement { displayName = CSTRING(TeamManagement); condition = QUOTE(GVAR(EnableTeamManagement)); - exceptions[] = {"isNotInside", "isNotSitting", "isNotOnLadder"}; + exceptions[] = {"isNotSwimming", "isNotInside", "isNotSitting", "isNotOnLadder", "isNotRefueling"}; statement = ""; showDisabled = 1; priority = 3.2; @@ -228,7 +257,7 @@ class CfgVehicles { class ACE_JoinTeamRed { displayName = CSTRING(JoinTeamRed); condition = QUOTE(true); - exceptions[] = {"isNotInside", "isNotSitting", "isNotOnLadder"}; + exceptions[] = {"isNotSwimming", "isNotInside", "isNotSitting", "isNotOnLadder", "isNotRefueling"}; statement = QUOTE([ARR_2(_player,'RED')] call DFUNC(joinTeam)); showDisabled = 1; priority = 2.4; @@ -237,7 +266,7 @@ class CfgVehicles { class ACE_JoinTeamGreen { displayName = CSTRING(JoinTeamGreen); condition = QUOTE(true); - exceptions[] = {"isNotInside", "isNotSitting", "isNotOnLadder"}; + exceptions[] = {"isNotSwimming", "isNotInside", "isNotSitting", "isNotOnLadder", "isNotRefueling"}; statement = QUOTE([ARR_2(_player,'GREEN')] call DFUNC(joinTeam)); showDisabled = 1; priority = 2.3; @@ -246,7 +275,7 @@ class CfgVehicles { class ACE_JoinTeamBlue { displayName = CSTRING(JoinTeamBlue); condition = QUOTE(true); - exceptions[] = {"isNotInside", "isNotSitting", "isNotOnLadder"}; + exceptions[] = {"isNotSwimming", "isNotInside", "isNotSitting", "isNotOnLadder", "isNotRefueling"}; statement = QUOTE([ARR_2(_player,'BLUE')] call DFUNC(joinTeam)); showDisabled = 1; priority = 2.2; @@ -255,7 +284,7 @@ class CfgVehicles { class ACE_JoinTeamYellow { displayName = CSTRING(JoinTeamYellow); condition = QUOTE(true); - exceptions[] = {"isNotInside", "isNotSitting", "isNotOnLadder"}; + exceptions[] = {"isNotSwimming", "isNotInside", "isNotSitting", "isNotOnLadder", "isNotRefueling"}; statement = QUOTE([ARR_2(_player,'YELLOW')] call DFUNC(joinTeam)); showDisabled = 1; priority = 2.1; @@ -264,7 +293,7 @@ class CfgVehicles { class ACE_LeaveTeam { displayName = CSTRING(LeaveTeam); condition = QUOTE(assignedTeam _player != 'MAIN'); - exceptions[] = {"isNotInside", "isNotSitting", "isNotOnLadder"}; + exceptions[] = {"isNotSwimming", "isNotInside", "isNotSitting", "isNotOnLadder", "isNotRefueling"}; statement = QUOTE([ARR_2(_player,'MAIN')] call DFUNC(joinTeam)); showDisabled = 1; priority = 2.5; @@ -273,7 +302,7 @@ class CfgVehicles { class ACE_BecomeLeader { displayName = CSTRING(BecomeLeader); condition = QUOTE(_this call DFUNC(canBecomeLeader)); - exceptions[] = {"isNotInside", "isNotSitting", "isNotOnLadder"}; + exceptions[] = {"isNotSwimming", "isNotInside", "isNotSitting", "isNotOnLadder", "isNotRefueling"}; statement = QUOTE(_this call DFUNC(doBecomeLeader)); showDisabled = 1; priority = 1.0; @@ -282,7 +311,7 @@ class CfgVehicles { class ACE_LeaveGroup { displayName = CSTRING(LeaveGroup); condition = QUOTE(count (units group _player) > 1); - exceptions[] = {"isNotInside", "isNotSitting", "isNotOnLadder"}; + exceptions[] = {"isNotSwimming", "isNotInside", "isNotSitting", "isNotOnLadder", "isNotRefueling"}; statement = QUOTE(_oldGroup = units group _player; _newGroup = createGroup side _player; [_player] joinSilent _newGroup; {_player reveal _x} forEach _oldGroup;); showDisabled = 1; priority = 1.2; @@ -293,7 +322,7 @@ class CfgVehicles { class ACE_Equipment { displayName = CSTRING(Equipment); condition = QUOTE(true); - exceptions[] = {"isNotInside", "notOnMap", "isNotSitting"}; + exceptions[] = {"isNotSwimming", "isNotInside", "notOnMap", "isNotSitting"}; statement = ""; showDisabled = 1; priority = 4.5; @@ -315,6 +344,7 @@ class CfgVehicles { displayName = CSTRING(Passengers); condition = "true"; statement = ""; + exceptions[] = {"isNotSwimming"}; insertChildren = QUOTE(_this call DFUNC(addPassengersActions)); }; }; @@ -342,6 +372,7 @@ class CfgVehicles { displayName = CSTRING(Passengers); condition = "true"; statement = ""; + exceptions[] = {"isNotSwimming"}; insertChildren = QUOTE(_this call DFUNC(addPassengersActions)); }; }; @@ -368,6 +399,7 @@ class CfgVehicles { displayName = CSTRING(Passengers); condition = "true"; statement = ""; + exceptions[] = {"isNotSwimming"}; insertChildren = QUOTE(_this call DFUNC(addPassengersActions)); }; }; @@ -378,6 +410,7 @@ class CfgVehicles { displayName = CSTRING(Passengers); condition = "true"; statement = ""; + exceptions[] = {"isNotSwimming"}; insertChildren = QUOTE(_this call DFUNC(addPassengersActions)); }; }; @@ -397,6 +430,7 @@ class CfgVehicles { displayName = CSTRING(Passengers); condition = "true"; statement = ""; + exceptions[] = {"isNotSwimming"}; insertChildren = QUOTE(_this call DFUNC(addPassengersActions)); }; }; @@ -424,6 +458,7 @@ class CfgVehicles { displayName = CSTRING(Passengers); condition = "true"; statement = ""; + exceptions[] = {"isNotSwimming"}; insertChildren = QUOTE(_this call DFUNC(addPassengersActions)); }; }; @@ -464,6 +499,7 @@ class CfgVehicles { distance = 6; condition = QUOTE(_target call FUNC(canPush)); statement = QUOTE(_this call FUNC(push)); + exceptions[] = {"isNotSwimming"}; showDisabled = 0; priority = -1; }; @@ -471,6 +507,7 @@ class CfgVehicles { displayName = CSTRING(Passengers); condition = "true"; statement = ""; + exceptions[] = {"isNotSwimming"}; insertChildren = QUOTE(_this call DFUNC(addPassengersActions)); }; }; @@ -497,6 +534,7 @@ class CfgVehicles { displayName = CSTRING(Passengers); condition = "true"; statement = ""; + exceptions[] = {"isNotSwimming"}; insertChildren = QUOTE(_this call DFUNC(addPassengersActions)); }; }; @@ -550,7 +588,7 @@ class CfgVehicles { class ACE_OpenBox { displayName = CSTRING(OpenBox); - condition = QUOTE(alive _target); + condition = QUOTE((alive _target) && {(getNumber (configFile >> 'CfgVehicles' >> (typeOf _target) >> 'disableInventory')) == 0}); statement = QUOTE(_player action [ARR_2(QUOTE(QUOTE(Gear)), _target)]); showDisabled = 0; priority = -1; @@ -561,6 +599,13 @@ class CfgVehicles { class ACE_SelfActions {}; }; class Slingload_base_F: ReammoBox_F {}; + class Slingload_01_Base_F: Slingload_base_F { + class ACE_Actions: ACE_Actions { + class ACE_MainActions: ACE_MainActions { + distance = 5; + }; + }; + }; class Pod_Heli_Transport_04_base_F: Slingload_base_F { class ACE_Actions: ACE_Actions { class ACE_MainActions: ACE_MainActions { diff --git a/addons/interaction/RscTitles.hpp b/addons/interaction/RscTitles.hpp index 71070b1715..ee4783da30 100644 --- a/addons/interaction/RscTitles.hpp +++ b/addons/interaction/RscTitles.hpp @@ -8,7 +8,6 @@ class ACE_Interaction_Button_Base { action = ""; idc = -1; - access = 0; type = 1; text = ""; font = "RobotoCondensed"; @@ -156,6 +155,9 @@ class RscInteractionText: RscText{ w = 24 * GUI_GRID_W; h = 1.5 * GUI_GRID_H; }; +class RscInteractionText_right: RscText{ + style = 1; // right aligned text +}; class RscTitles { class GVAR(InteractionHelper) { diff --git a/addons/interaction/UI/CenterIcon_ca.paa b/addons/interaction/UI/CenterIcon_ca.paa deleted file mode 100644 index 86deb5df7c..0000000000 Binary files a/addons/interaction/UI/CenterIcon_ca.paa and /dev/null differ diff --git a/addons/interaction/UI/backArrow_ca.paa b/addons/interaction/UI/backArrow_ca.paa deleted file mode 100644 index 627cb64f17..0000000000 Binary files a/addons/interaction/UI/backArrow_ca.paa and /dev/null differ diff --git a/addons/interaction/UI/command_rose_ca.paa b/addons/interaction/UI/command_rose_ca.paa deleted file mode 100644 index 3dd8b58768..0000000000 Binary files a/addons/interaction/UI/command_rose_ca.paa and /dev/null differ diff --git a/addons/interaction/XEH_PREP.hpp b/addons/interaction/XEH_PREP.hpp index c8ceb66e8f..4f0ef58357 100644 --- a/addons/interaction/XEH_PREP.hpp +++ b/addons/interaction/XEH_PREP.hpp @@ -2,6 +2,7 @@ // interaction menu PREP(addPassengerActions); PREP(addPassengersActions); +PREP(getInteractionDistance); PREP(getVehiclePos); PREP(getVehiclePosComplex); PREP(getWeaponPos); @@ -16,6 +17,7 @@ PREP(canInteractWithCivilian); PREP(getDown); PREP(sendAway); PREP(canJoinGroup); +PREP(modifyJoinGroupAction); PREP(canJoinTeam); PREP(joinTeam); PREP(canPassMagazine); @@ -29,6 +31,7 @@ PREP(pardon); // interaction with doors PREP(getDoor); +PREP(getGlassDoor); PREP(getDoorAnimations); PREP(handleScrollWheel); PREP(openDoor); diff --git a/addons/interaction/XEH_postInit.sqf b/addons/interaction/XEH_postInit.sqf index 9aa9cfb157..5d2b49f9b1 100644 --- a/addons/interaction/XEH_postInit.sqf +++ b/addons/interaction/XEH_postInit.sqf @@ -28,6 +28,36 @@ ACE_Modifier = 0; {_lamp setHit [_x select 0, (_x select 1) max _disabledLampDMG];nil} count _hitPointsDamage; }] call CBA_fnc_addEventHandler; +// Zeus action events +[QGVAR(zeusStance),{ + { _x setUnitPos (_this select 0); } forEach (_this select 1); +}] call CBA_fnc_addEventHandler; + +// The following 3 events handle both waypoints and groups +[QGVAR(zeusBehaviour),{ + if (param [2,false]) then { + { _x setWaypointBehaviour (_this select 0); } forEach (_this select 1); + } else { + { _x setBehaviour (_this select 0); } forEach (_this select 1); + }; +}] call CBA_fnc_addEventHandler; + +[QGVAR(zeusSpeed),{ + if (param [2,false]) then { + { _x setWaypointSpeed (_this select 0); } forEach (_this select 1); + } else { + { _x setSpeedMode (_this select 0); } forEach (_this select 1); + }; +}] call CBA_fnc_addEventHandler; + +[QGVAR(zeusFormation),{ + if (param [2,false]) then { + { _x setWaypointFormation (_this select 0); } forEach (_this select 1); + } else { + { _x setFormation (_this select 0); } forEach (_this select 1); + }; +}] call CBA_fnc_addEventHandler; + if (!hasInterface) exitWith {}; GVAR(isOpeningDoor) = false; @@ -53,14 +83,13 @@ GVAR(isOpeningDoor) = false; call EFUNC(interaction,openDoor); true }, { - //Probably don't want any condidtions here, so variable never gets locked down + //Probably don't want any conditions here, so variable never gets locked down // Statement GVAR(isOpeningDoor) = false; true }, [57, [false, true, false]], false] call CBA_fnc_addKeybind; //Key CTRL+Space - ["ACE3 Common", QGVAR(tapShoulder), localize LSTRING(TapShoulder), { // Conditions: canInteract if !([ACE_player, objNull, []] call EFUNC(common,canInteractWith)) exitWith {false}; @@ -77,5 +106,13 @@ GVAR(isOpeningDoor) = false; {false}, [20, [true, false, false]], false] call CBA_fnc_addKeybind; -["isNotSwimming", {!underwater (_this select 0)}] call EFUNC(common,addCanInteractWithCondition); +["isNotSwimming", {!(_this call EFUNC(common,isSwimming))}] call EFUNC(common,addCanInteractWithCondition); ["isNotOnLadder", {getNumber (configFile >> "CfgMovesMaleSdr" >> "States" >> animationState (_this select 0) >> "ACE_isLadder") != 1}] call EFUNC(common,addCanInteractWithCondition); + +["ace_settingsInitialized", { + if (GVAR(disableNegativeRating)) then { + player addEventHandler ["HandleRating", { + (_this select 1) max 0 + }]; + }; +}] call CBA_fnc_addEventHandler; diff --git a/addons/interaction/XEH_preInit.sqf b/addons/interaction/XEH_preInit.sqf index a7feade1c3..b47cf6628d 100644 --- a/addons/interaction/XEH_preInit.sqf +++ b/addons/interaction/XEH_preInit.sqf @@ -2,6 +2,8 @@ ADDON = false; +PREP_RECOMPILE_START; #include "XEH_PREP.hpp" +PREP_RECOMPILE_END; ADDON = true; diff --git a/addons/interaction/functions/fnc_canJoinTeam.sqf b/addons/interaction/functions/fnc_canJoinTeam.sqf index 7732e164e7..ee99723d77 100644 --- a/addons/interaction/functions/fnc_canJoinTeam.sqf +++ b/addons/interaction/functions/fnc_canJoinTeam.sqf @@ -16,7 +16,7 @@ */ #include "script_component.hpp" -PARAMS_2(_unit,_target); +params ["_unit", "_target"]; alive _target && {!(_target getVariable ["ACE_isUnconscious", false])} diff --git a/addons/interaction/functions/fnc_canPardon.sqf b/addons/interaction/functions/fnc_canPardon.sqf index a377533018..892647640e 100644 --- a/addons/interaction/functions/fnc_canPardon.sqf +++ b/addons/interaction/functions/fnc_canPardon.sqf @@ -9,6 +9,9 @@ * Return Value: * Unit can pardon target * + * Example: + * [bob, kevin] call ACE_interaction_fnc_canPardon + * * Public: No */ #include "script_component.hpp" diff --git a/addons/interaction/functions/fnc_doBecomeLeader.sqf b/addons/interaction/functions/fnc_doBecomeLeader.sqf index 8c8663b03b..cc96de5611 100644 --- a/addons/interaction/functions/fnc_doBecomeLeader.sqf +++ b/addons/interaction/functions/fnc_doBecomeLeader.sqf @@ -1,4 +1,4 @@ - /* +/* * Author: PabstMirror * Become Leader of group. * @@ -13,6 +13,7 @@ * * Public: No */ + #include "script_component.hpp" params ["_unit"]; diff --git a/addons/interaction/functions/fnc_getDoor.sqf b/addons/interaction/functions/fnc_getDoor.sqf index 8261aa44f0..8570d2a7c8 100644 --- a/addons/interaction/functions/fnc_getDoor.sqf +++ b/addons/interaction/functions/fnc_getDoor.sqf @@ -1,5 +1,5 @@ /* - * Author: commy2 + * Author: commy2, Phyma * Find door. * * Arguments: @@ -19,23 +19,28 @@ params ["_distance"]; -private ["_position0", "_position1", "_intersections", "_house", "_door"]; +private _position0 = positionCameraToWorld [0, 0, 0]; +private _position1 = positionCameraToWorld [0, 0, _distance]; -_position0 = positionCameraToWorld [0, 0, 0]; -_position1 = positionCameraToWorld [0, 0, _distance]; - -_intersections = lineIntersectsSurfaces [AGLToASL _position0, AGLToASL _position1, cameraOn, objNull, true, 1, "GEOM"]; +private _intersections = lineIntersectsSurfaces [AGLToASL _position0, AGLToASL _position1, cameraOn, objNull, true, 1, "GEOM"]; if (_intersections isEqualTo []) exitWith {[objNull, ""]}; -_house = _intersections select 0 select 2; +private _house = _intersections select 0 select 2; // shithouse is bugged if (typeOf _house == "") exitWith {[objNull, ""]}; _intersections = [_house, "GEOM"] intersect [_position0, _position1]; -_door = _intersections select 0 select 0; +private _door = toLower (_intersections select 0 select 0); + +if (isNil "_door") exitWith {[_house, ""]}; + +//Check if door is glass because then we need to find the proper location of the door so we can use it +if ((_door find "glass") != -1) then { + _door = [_distance, _house, _door] call FUNC(getGlassDoor); +}; if (isNil "_door") exitWith {[_house, ""]}; diff --git a/addons/interaction/functions/fnc_getDoorAnimations.sqf b/addons/interaction/functions/fnc_getDoorAnimations.sqf index fac29c74a8..0d40d066be 100644 --- a/addons/interaction/functions/fnc_getDoorAnimations.sqf +++ b/addons/interaction/functions/fnc_getDoorAnimations.sqf @@ -1,6 +1,6 @@ /* - * Author: commy2 - * Get door animations. @todo rewrite for better custom building support + * Author: commy2, Phyma + * Get door animations. * * Arguments: * 0: House @@ -20,104 +20,19 @@ params ["_house", "_door"]; -private ["_index", "_animations", "_lockedVariable"]; +private _animate = animationNames _house; +private _animations = []; +private _lockedVariable = []; -_index = [ - "door_1", - "door_2", - "door_3", - "door_4", - "door_5", - "door_6", - "door_7", - "door_8", - "door_9", - "door_10", - "door_11", - "door_12", - "door_13", - "Door_14", - "door_15", - "door_16", - "door_17", - "door_18", - "door_19", - "door_20", - "door_21", - "door_22", - - "hatch_1", - "hatch_2", - "hatch_3", - "hatch_4", - "hatch_5", - "hatch_6" -] find toLower _door; - -if (_index == -1) exitWith {[[],""]}; - -_animations = [ - ["Door_1_rot", "Door_Handle_1_rot_1", "Door_Handle_1_rot_2"], - ["Door_2_rot", "Door_Handle_2_rot_1", "Door_Handle_2_rot_2"], - ["Door_3_rot", "Door_Handle_3_rot_1", "Door_Handle_3_rot_2"], - ["Door_4_rot", "Door_Handle_4_rot_1", "Door_Handle_4_rot_2"], - ["Door_5_rot", "Door_Handle_5_rot_1", "Door_Handle_5_rot_2"], - ["Door_6_rot", "Door_Handle_6_rot_1", "Door_Handle_6_rot_2"], - ["Door_7_rot", "Door_Handle_7_rot_1", "Door_Handle_7_rot_2"], - ["Door_8_rot", "Door_Handle_8_rot_1", "Door_Handle_8_rot_2"], - ["Door_9_rot", "Door_Handle_9_rot_1", "Door_Handle_9_rot_2"], - ["Door_10_rot", "Door_Handle_10_rot_1", "Door_Handle_10_rot_2"], - ["Door_11_rot", "Door_Handle_11_rot_1", "Door_Handle_11_rot_2"], - ["Door_12_rot", "Door_Handle_12_rot_1", "Door_Handle_12_rot_2"], - ["Door_13_rot", "Door_Handle_13_rot_1", "Door_Handle_13_rot_2"], - ["Door_14_rot", "Door_Handle_14_rot_1", "Door_Handle_14_rot_2"], - ["Door_15_rot", "Door_Handle_15_rot_1", "Door_Handle_15_rot_2"], - ["Door_16_rot", "Door_Handle_16_rot_1", "Door_Handle_16_rot_2"], - ["Door_17_rot", "Door_Handle_17_rot_1", "Door_Handle_17_rot_2"], - ["Door_18_rot", "Door_Handle_18_rot_1", "Door_Handle_18_rot_2"], - ["Door_19_rot", "Door_Handle_19_rot_1", "Door_Handle_19_rot_2"], - ["Door_20_rot", "Door_Handle_20_rot_1", "Door_Handle_20_rot_2"], - ["Door_21_rot", "Door_Handle_21_rot_1", "Door_Handle_21_rot_2"], - ["Door_22_rot", "Door_Handle_22_rot_1", "Door_Handle_22_rot_2"], - - ["Hatch_1_rot"], - ["Hatch_2_rot"], - ["Hatch_3_rot"], - ["Hatch_4_rot"], - ["Hatch_5_rot"], - ["Hatch_6_rot"] -] select _index; - -_lockedVariable = [ - ["BIS_Disabled_Door_1", "Door_Handle_1_rot_1", "Door_Locked_1_rot"], - ["BIS_Disabled_Door_2", "Door_Handle_2_rot_1", "Door_Locked_2_rot"], - ["BIS_Disabled_Door_3", "Door_Handle_3_rot_1", "Door_Locked_3_rot"], - ["BIS_Disabled_Door_4", "Door_Handle_4_rot_1", "Door_Locked_4_rot"], - ["BIS_Disabled_Door_5", "Door_Handle_5_rot_1", "Door_Locked_5_rot"], - ["BIS_Disabled_Door_6", "Door_Handle_6_rot_1", "Door_Locked_6_rot"], - ["BIS_Disabled_Door_7", "Door_Handle_7_rot_1", "Door_Locked_7_rot"], - ["BIS_Disabled_Door_8", "Door_Handle_8_rot_1", "Door_Locked_8_rot"], - ["BIS_Disabled_Door_9", "Door_Handle_9_rot_1", "Door_Locked_9_rot"], - ["BIS_Disabled_Door_10", "Door_Handle_10_rot_1", "Door_Locked_10_rot"], - ["BIS_Disabled_Door_11", "Door_Handle_11_rot_1", "Door_Locked_11_rot"], - ["BIS_Disabled_Door_12", "Door_Handle_12_rot_1", "Door_Locked_12_rot"], - ["BIS_Disabled_Door_13", "Door_Handle_13_rot_1", "Door_Locked_13_rot"], - ["BIS_Disabled_Door_14", "Door_Handle_14_rot_1", "Door_Locked_14_rot"], - ["BIS_Disabled_Door_15", "Door_Handle_15_rot_1", "Door_Locked_15_rot"], - ["BIS_Disabled_Door_16", "Door_Handle_16_rot_1", "Door_Locked_16_rot"], - ["BIS_Disabled_Door_17", "Door_Handle_17_rot_1", "Door_Locked_17_rot"], - ["BIS_Disabled_Door_18", "Door_Handle_18_rot_1", "Door_Locked_18_rot"], - ["BIS_Disabled_Door_19", "Door_Handle_19_rot_1", "Door_Locked_19_rot"], - ["BIS_Disabled_Door_20", "Door_Handle_20_rot_1", "Door_Locked_20_rot"], - ["BIS_Disabled_Door_21", "Door_Handle_21_rot_1", "Door_Locked_21_rot"], - ["BIS_Disabled_Door_22", "Door_Handle_22_rot_1", "Door_Locked_22_rot"], - - ["", ""], - ["", ""], - ["", ""], - ["", ""], - ["", ""], - ["", ""] -] select _index; +{ + private _animName = toLower _x; + if ((_animName find (toLower _door)) != -1) then { + if (((_animName find "disabled") != -1) || ((_animName find "locked") != -1)) then { + _lockedVariable pushBack _animName; + } else { + _animations pushBack _animName; + }; + }; +} forEach _animate; [_animations, _lockedVariable] diff --git a/addons/interaction/functions/fnc_getGlassDoor.sqf b/addons/interaction/functions/fnc_getGlassDoor.sqf new file mode 100644 index 0000000000..2731f82888 --- /dev/null +++ b/addons/interaction/functions/fnc_getGlassDoor.sqf @@ -0,0 +1,67 @@ +/* + * Author: Phyma + * Find glass door. + * + * Arguments: + * 0: Distance + * 1: House + * 2: Door name + * + * Return Value: + * 0: Door Name + * + * Example: + * [player, target] call ace_interaction_fnc_getGlassDoor + * + * Public: No + */ +#include "script_component.hpp" + +params ["_distance", "_house", "_door"]; + +private _doorParts = []; +private _doorPos = []; +private _animate = animationNames _house; +private _glassDoor = _door splitString "_"; +private _glassPos = (_house selectionPosition [(_glassDoor select 0) + "_" + (_glassDoor select 1) + "_effects", "Memory"]); +// Calculate all animation names so we know what is there +{ + private _animName = toLower _x; + if (((_animName find "door") != -1) && ((_animName find "locked") == -1) && ((_animName find "disabled") == -1) && ((_animName find "handle") == -1)) then { + private _splitStr = _animName splitString "_"; + _doorParts pushBack ((_splitStr select 0) + "_" + (_splitStr select 1) + "_trigger"); + }; +} forEach _animate; + + +// Get the pos of all the door components and save the parts +{ + _doorPos pushBack (_house selectionPosition [_x, "Memory"]); +} forEach _doorParts; + +// Calculate what door that is closest to the glass door +private _lowestDistance = 0; +{ + private _objDist = _glassPos distance _x; + //Make sure we dont take another door by mistake + if (_objDist <= _distance) then { + //Need to set the value in the beginning + if (_lowestDistance == 0) then { + _lowestDistance = _objDist; + private _splitStr = (_doorParts select _forEachIndex) splitString "_"; + _door = (_splitStr select 0) + "_" + (_splitStr select 1); + } else { + if (_objDist < _lowestDistance) then { + _lowestDistance = _objDist; + private _splitStr = (_doorParts select _forEachIndex) splitString "_"; + _door = (_splitStr select 0) + "_" + (_splitStr select 1); + }; + }; + }; +} forEach _doorPos; + +// Check if we have a door or if it is the glass part +if ((isNil "_door") || ((_door find "glass") != -1)) exitWith {}; + +_door + diff --git a/addons/interaction/functions/fnc_getInteractionDistance.sqf b/addons/interaction/functions/fnc_getInteractionDistance.sqf new file mode 100644 index 0000000000..c731c6e7d1 --- /dev/null +++ b/addons/interaction/functions/fnc_getInteractionDistance.sqf @@ -0,0 +1,33 @@ +/* + * Author: PabstMirror + * Gets effective interaction distance (handles very large vehicles) + * + * Arguments: + * 0: Player + * 0: Target Vehicle + * + * Return Value: + * Distance to interaction point + * + * Example: + * [player, cursorObject] call ace_interaction_fnc_getInteractionDistance + * + * Public: No + */ +#include "script_component.hpp" + +params ["_unit", "_target"]; +TRACE_3("getInteractionDistance",_unit,_target,typeOf _target); + +// Handle Man, Crate +if (!((_target isKindOf "Car") || {_target isKindOf "Tank"} || {_target isKindOf "Helicopter"} || {_target isKindOf "Plane"} || {_target isKindOf "Ship_F"})) exitWith { + _unit distance _target +}; + +private _unitEyeASL = eyePos _unit; +private _targetModelPos = [_target, _unitEyeASL] call FUNC(getVehiclePosComplex); +private _distance = _unitEyeASL distance (AGLtoASL (_target modelToWorld _targetModelPos)); + +TRACE_2("",_targetModelPos,_distance); + +_distance diff --git a/addons/interaction/functions/fnc_getVehiclePos.sqf b/addons/interaction/functions/fnc_getVehiclePos.sqf index 1544aea939..ebcb856267 100644 --- a/addons/interaction/functions/fnc_getVehiclePos.sqf +++ b/addons/interaction/functions/fnc_getVehiclePos.sqf @@ -5,7 +5,7 @@ * Arguments: * None (uses local variable _target) * - * Return value: + * Return Value: * Children actions * * Example: @@ -19,7 +19,8 @@ private _bb = boundingBoxReal _target; (_bb select 0) params ["_bbX", "_bbY", "_bbZ"]; -private _relPos = _target worldToModelVisual ASLToAGL EGVAR(interact_menu,cameraPosASL); +private _cameraPosASL = EGVAR(interact_menu,cameraPosASL); +private _relPos = _target worldToModelVisual ASLToAGL _cameraPosASL; #ifdef DEBUG_MODE_FULL _relPos = _target worldToModelVisual ASLToAGL eyePos ACE_player; #endif @@ -29,7 +30,7 @@ private _ndx = (abs _dx) / ((abs (_bbx)) - 1); private _ndy = (abs _dy) / ((abs (_bbY)) - 1); private _ndz = (abs _dz) / ((abs (_bbZ)) - 1); -private "_pos"; +private _pos = []; if (_ndx > _ndy) then { if (_ndx > _ndz) then { // _ndx is greater, will colide with x plane first @@ -47,9 +48,14 @@ if (_ndx > _ndy) then { _pos = _relPos vectorMultiply ((1 / _ndz) min 0.8); }; }; -//Set max height at player's eye level (prevent very high interactin point on choppers) -_pos set [2, (_pos select 2) min _dz]; -TRACE_4("",_bb,_bbX,_relPos, _pos); + +// Set max height at player's eye level (prevent very high interaction point on choppers) +// Only when above water level to prevent underwater actions from following player eye level +if (_cameraPosASL select 2 >= 0) then { + _pos set [2, (_pos select 2) min _dz]; +}; + +TRACE_4("",_bb,_bbX,_relPos,_pos,_cameraPosASL); _pos /////////////////// diff --git a/addons/interaction/functions/fnc_getVehiclePosComplex.sqf b/addons/interaction/functions/fnc_getVehiclePosComplex.sqf index 886f7052c4..bfb9fef803 100644 --- a/addons/interaction/functions/fnc_getVehiclePosComplex.sqf +++ b/addons/interaction/functions/fnc_getVehiclePosComplex.sqf @@ -6,7 +6,7 @@ * 0: Target * 1: Player's Position ASL * - * Return value: + * Return Value: * Interaction point in model cords * * Example: @@ -34,7 +34,7 @@ private _ndy = (abs _dy) / ((abs (_bbY)) - 1); private _ndz = (abs _dz) / ((abs (_bbZ)) - 1); -private "_pos"; +private _pos = []; if (_ndx > _ndy) then { if (_ndx > _ndz) then { // _ndx is greater, will colide with x plane first @@ -53,7 +53,11 @@ if (_ndx > _ndy) then { }; }; -//Set max height at player's eye level (prevent very high interactin point on choppers) -_pos set [2, (_pos select 2) min _dz]; +// Set max height at player's eye level (prevent very high interaction point on vehicles) +// Only when above water level to prevent underwater actions from following player eye level +if (_cameraPosASL select 2 >= 0) then { + _pos set [2, (_pos select 2) min _dz]; +}; +TRACE_4("",_bb,_bbX,_relPos,_pos,_cameraPosASL); _pos diff --git a/addons/interaction/functions/fnc_getWeaponPos.sqf b/addons/interaction/functions/fnc_getWeaponPos.sqf index d0db3cee77..8f2d63713a 100644 --- a/addons/interaction/functions/fnc_getWeaponPos.sqf +++ b/addons/interaction/functions/fnc_getWeaponPos.sqf @@ -16,9 +16,7 @@ #include "script_component.hpp" // IGNORE_PRIVATE_WARNING(_target); -private ["_weaponDir", "_refSystem"]; - -_weaponDir = _target weaponDirection currentWeapon _target; -_refSystem = _weaponDir call EFUNC(common,createOrthonormalReference); +private _weaponDir = _target weaponDirection currentWeapon _target; +private _refSystem = _weaponDir call EFUNC(common,createOrthonormalReference); (_target selectionPosition "righthand") vectorAdd ((_refSystem select 2) vectorMultiply 0.1); diff --git a/addons/interaction/functions/fnc_handleScrollWheel.sqf b/addons/interaction/functions/fnc_handleScrollWheel.sqf index 793e78c1b3..48716a05c3 100644 --- a/addons/interaction/functions/fnc_handleScrollWheel.sqf +++ b/addons/interaction/functions/fnc_handleScrollWheel.sqf @@ -8,6 +8,9 @@ * Return Value: * handled * + * Example: + * [5] call ACE_interaction_fnc_handleScrollWheel + * * Public: No */ #include "script_component.hpp" diff --git a/addons/interaction/functions/fnc_hideMouseHint.sqf b/addons/interaction/functions/fnc_hideMouseHint.sqf index 757fe952e5..bb9fc9440a 100644 --- a/addons/interaction/functions/fnc_hideMouseHint.sqf +++ b/addons/interaction/functions/fnc_hideMouseHint.sqf @@ -19,7 +19,7 @@ if (isNull (uiNamespace getVariable ["ACE_Helper_Display", objNull])) exitWith { (QGVAR(InteractionHelper) call BIS_fnc_rscLayer) cutText ["", "PLAIN"]; -// Disable action menu, showHud also disables all scripted UI (such as drawIcon3D) +// Re-enable action menu inGameUISetEventHandler ["PrevAction", "false"]; inGameUISetEventHandler ["NextAction", "false"]; inGameUISetEventHandler ["Action", "false"]; diff --git a/addons/interaction/functions/fnc_joinTeam.sqf b/addons/interaction/functions/fnc_joinTeam.sqf index dfbb2b9070..311c45b1a5 100644 --- a/addons/interaction/functions/fnc_joinTeam.sqf +++ b/addons/interaction/functions/fnc_joinTeam.sqf @@ -22,7 +22,7 @@ params ["_unit", "_team"]; // display message if (_unit == ACE_player) then { - private "_message"; + private _message = ""; if (_team == "MAIN") then { _message = localize LSTRING(LeftTeam); diff --git a/addons/interaction/functions/fnc_modifyJoinGroupAction.sqf b/addons/interaction/functions/fnc_modifyJoinGroupAction.sqf new file mode 100644 index 0000000000..3ac493aa54 --- /dev/null +++ b/addons/interaction/functions/fnc_modifyJoinGroupAction.sqf @@ -0,0 +1,26 @@ +/* + * Author: PabstMirror + * Modifies the ACE_JoinGroup action to show group name. + * + * Arguments: + * 0: Target + * 1: Player + * 2: Args + * 3: Action Data + * + * Return Value: + * None + * + * Example: + * [cursorObject, player, [], []] call ace_interaction_fnc_modifyJoinGroupAction + * + * Public: No + */ +#include "script_component.hpp" + +params ["_target", "_player", "", "_actionData"]; + +private _actionText = format ["%1: %2", localize LSTRING(JoinGroup), groupID group _target]; +TRACE_3("",_target,group _target,_actionText); + +_actionData set [1, _actionText]; diff --git a/addons/interaction/functions/fnc_moduleInteraction.sqf b/addons/interaction/functions/fnc_moduleInteraction.sqf index ec3ec0a086..e4f5418fda 100644 --- a/addons/interaction/functions/fnc_moduleInteraction.sqf +++ b/addons/interaction/functions/fnc_moduleInteraction.sqf @@ -22,5 +22,6 @@ params ["_logic", "", "_activated"]; if !(_activated) exitWith {}; [_logic, QGVAR(EnableTeamManagement), "EnableTeamManagement"] call EFUNC(common,readSettingFromModule); +[_logic, QGVAR(disableNegativeRating), "DisableNegativeRating"] call EFUNC(common,readSettingFromModule); INFO("Interaction Module Initialized."); diff --git a/addons/interaction/functions/fnc_openDoor.sqf b/addons/interaction/functions/fnc_openDoor.sqf index b1c7789ec3..2457bc1f39 100644 --- a/addons/interaction/functions/fnc_openDoor.sqf +++ b/addons/interaction/functions/fnc_openDoor.sqf @@ -19,18 +19,33 @@ private _info = [MACRO_DOOR_REACH_DISTANCE] call FUNC(getDoor); _info params ["_house", "_door"]; +TRACE_2("openDoor",_house,_door); if (isNull _house) exitWith {}; private _getDoorAnimations = [_house, _door] call FUNC(getDoorAnimations); -_getDoorAnimations params ["_animations", "_lockedVariable"]; +_getDoorAnimations params ["_animations"]; if (_animations isEqualTo []) exitWith {}; -if (_house animationPhase (_animations select 0) <= 0 && {_house getVariable [_lockedVariable select 0, 0] == 1}) exitWith { - _lockedVariable set [0, _house]; - _lockedVariable call BIS_fnc_LockedDoorOpen; +private _lockedVariable = format ["bis_disabled_%1", _door]; + +// Check if the door can be locked aka have locked variable, otherwhise cant lock it +if ((_house animationPhase (_animations select 0) <= 0) && {_house getVariable [_lockedVariable, 0] == 1}) exitWith { + private _lockedAnimation = format ["%1_locked_source", _door]; + TRACE_3("locked",_house,_lockedAnimation,isClass (configfile >> "CfgVehicles" >> (typeOf _house) >> "AnimationSources" >> _lockedAnimation)); + if (isClass (configfile >> "CfgVehicles" >> (typeOf _house) >> "AnimationSources" >> _lockedAnimation)) then { + // from: a3\structures_f\scripts\fn_door.sqf: - wiggles the door handle (A3 buildings) + _house animateSource [_lockedAnimation, (1 - (_house animationSourcePhase _lockedAnimation))]; + }; +}; + +// Add handle on carrier +if (typeOf _house == "Land_Carrier_01_island_01_F") then { + private _handle = format ["door_handle_%1_rot_1", (_animations select 0) select [5, 1]]; + TRACE_1("carrier handle",_handle); + _animations pushBack _handle; }; playSound "ACE_Sound_Click"; // @todo replace with smth. more fitting @@ -62,7 +77,6 @@ GVAR(usedScrollWheel) = false; if (CBA_missionTime > _time && {diag_frameno > _frame}) then { GVAR(usedScrollWheel) = true; }; - // do incremental door opening {_house animate [_x, GVAR(doorTargetPhase)]; false} count _animations; }, 0.1, [_house, _animations, getPosASL ACE_player, CBA_missionTime + 0.2, diag_frameno + 2]] call CBA_fnc_addPerFrameHandler; diff --git a/addons/interaction/functions/fnc_pardon.sqf b/addons/interaction/functions/fnc_pardon.sqf index e11a92e7db..7b6085bcf4 100644 --- a/addons/interaction/functions/fnc_pardon.sqf +++ b/addons/interaction/functions/fnc_pardon.sqf @@ -9,6 +9,9 @@ * Return Value: * None * + * Example: + * [bob, kevin] call ACE_interaction_fnc_pardon + * * Public: No */ #include "script_component.hpp" diff --git a/addons/interaction/functions/fnc_passMagazine.sqf b/addons/interaction/functions/fnc_passMagazine.sqf index 15a193cd26..231d26b217 100644 --- a/addons/interaction/functions/fnc_passMagazine.sqf +++ b/addons/interaction/functions/fnc_passMagazine.sqf @@ -18,14 +18,13 @@ #include "script_component.hpp" params ["_player", "_target", "_weapon"]; -private ["_compatibleMags", "_filteredMags", "_magToPass", "_magToPassIndex", "_playerName", "_magToPassDisplayName"]; -_compatibleMags = getArray (configfile >> "CfgWeapons" >> _weapon >> "magazines"); -_filteredMags = magazinesAmmoFull _player select {(_x select 0) in _compatibleMags && {!(_x select 2)}}; +private _compatibleMags = getArray (configfile >> "CfgWeapons" >> _weapon >> "magazines"); +private _filteredMags = magazinesAmmoFull _player select {(_x select 0) in _compatibleMags && {!(_x select 2)}}; //select magazine with most ammo -_magToPass = _filteredMags select 0; -_magToPassIndex = 0; +private _magToPass = _filteredMags select 0; +private _magToPassIndex = 0; { _x params ["_className", "_ammoCount"]; if ((_ammoCount > (_magToPass select 1)) && (_target canAdd _className)) then { @@ -49,6 +48,6 @@ _player removeMagazines _magToPassClassName; _target addMagazine [_magToPassClassName, _magToPassAmmoCount]; -_playerName = [_player] call EFUNC(common,getName); -_magToPassDisplayName = getText (configFile >> "CfgMagazines" >> _magToPassClassName >> "displayName"); +private _playerName = [_player] call EFUNC(common,getName); +private _magToPassDisplayName = getText (configFile >> "CfgMagazines" >> _magToPassClassName >> "displayName"); [QEGVAR(common,displayTextStructured), [[LSTRING(PassMagazineHint), _playerName, _magToPassDisplayName], 1.5, _target], [_target]] call CBA_fnc_targetEvent; diff --git a/addons/interaction/functions/fnc_showMouseHint.sqf b/addons/interaction/functions/fnc_showMouseHint.sqf index 9ea1f26cba..815aa09f41 100644 --- a/addons/interaction/functions/fnc_showMouseHint.sqf +++ b/addons/interaction/functions/fnc_showMouseHint.sqf @@ -1,11 +1,12 @@ /* * Author: Garth de Wet (LH) - * Shows the interaction helper text with the mouse buttons at the bottom middle of the screen + * Shows the interaction helper text with the mouse buttons at the bottom middle of the screen. * * Arguments: * 0: Left Click Text * 1: Right Click Text - * 2: Scroll Text (Optional) + * 2: Scroll Text (default: "") + * 2: Extra Icon/Text pairs (default: []) * * Return Value: * None @@ -20,7 +21,7 @@ #define GUI_GRID_W (0.025) #define GUI_GRID_H (0.04) -params ["_leftClick", "_rightClick", ["_scroll", ""]]; +params ["_leftClick", "_rightClick", ["_scroll", ""], ["_extraIconSets", []]]; (QGVAR(InteractionHelper) call BIS_fnc_rscLayer) cutRsc [QGVAR(InteractionHelper), "PLAIN", 0.5, false]; @@ -28,7 +29,7 @@ disableSerialization; private _display = uiNamespace getVariable ["ACE_Helper_Display", objNull]; -if (isNull _display) exitWith {}; +if (isNull _display) exitWith {WARNING("Display was null");}; (_display displayCtrl 1000) ctrlSetText _leftClick; (_display displayCtrl 1001) ctrlSetText _rightClick; @@ -38,18 +39,42 @@ if (isNull _display) exitWith {}; (_display displayCtrl 1001) ctrlShow (_rightClick != ""); (_display displayCtrl 1201) ctrlShow (_rightClick != ""); -if (_scroll == "") exitWith { +private _offset = 19; + +if (_scroll == "") then { (_display displayCtrl 1002) ctrlShow false; (_display displayCtrl 1202) ctrlShow false; (_display displayCtrl 1001) ctrlSetPosition [21 * GUI_GRID_W, 18 * GUI_GRID_H, 24 * GUI_GRID_W, 1.5 * GUI_GRID_H]; (_display displayCtrl 1201) ctrlSetPosition [20 * GUI_GRID_W, 18.5 * GUI_GRID_H, 1.5 * GUI_GRID_W, 1 * GUI_GRID_H]; (_display displayCtrl 1001) ctrlCommit 0; (_display displayCtrl 1201) ctrlCommit 0; +} else { + _offset = _offset + 1; + (_display displayCtrl 1002) ctrlSetText _scroll; + + // Disable action menu + inGameUISetEventHandler ["PrevAction", "true"]; + inGameUISetEventHandler ["NextAction", "true"]; + inGameUISetEventHandler ["Action", "true"]; }; -(_display displayCtrl 1002) ctrlSetText _scroll; +{ + _x params [["_xKeyName", "", [""]], ["_xText", "", [""]]]; + switch (toLower _xKeyName) do { + case ("alt"): {_xKeyName = format ["<%1>", toUpper localize "str_dik_alt"];}; + case ("control"); + case ("ctrl"): {_xKeyName = format ["<%1>", toUpper localize "str_dik_control"];}; + case ("shift"): {_xKeyName = format ["<%1>", toUpper localize "str_dik_shift"];}; + }; + + private _keyNameCtrl = _display ctrlCreate ["RscInteractionText_right", -1]; + private _textCtrl = _display ctrlCreate ["RscInteractionText", -1]; + _keyNameCtrl ctrlSetText _xKeyName; + _textCtrl ctrlSetText _xText; + _keyNameCtrl ctrlSetPosition [0 * GUI_GRID_W, _offset * GUI_GRID_H, 21.4 * GUI_GRID_W, 1.5 * GUI_GRID_H]; + _textCtrl ctrlSetPosition [21 * GUI_GRID_W, _offset * GUI_GRID_H, 24 * GUI_GRID_W, 1.5 * GUI_GRID_H]; + _keyNameCtrl ctrlCommit 0; + _textCtrl ctrlCommit 0; + _offset = _offset + 1; +} forEach _extraIconSets; -// Enable action menu -inGameUISetEventHandler ["PrevAction", "true"]; -inGameUISetEventHandler ["NextAction", "true"]; -inGameUISetEventHandler ["Action", "true"]; diff --git a/addons/interaction/functions/fnc_tapShoulder.sqf b/addons/interaction/functions/fnc_tapShoulder.sqf index 3926503746..483498329d 100644 --- a/addons/interaction/functions/fnc_tapShoulder.sqf +++ b/addons/interaction/functions/fnc_tapShoulder.sqf @@ -23,6 +23,6 @@ if (_unit == ACE_player) then { addCamShake [4, 0.5, 5]; }; -[_unit, "PutDown"] call EFUNC(common,doGesture); +[_unit, "gesturePoint"] call EFUNC(common,doGesture); [QGVAR(tapShoulder), [_target, _shoulderNum], [_target]] call CBA_fnc_targetEvent; diff --git a/addons/interaction/stringtable.xml b/addons/interaction/stringtable.xml index 3a37a566a9..1f7e62f909 100644 --- a/addons/interaction/stringtable.xml +++ b/addons/interaction/stringtable.xml @@ -13,6 +13,9 @@ Interazioni Interaçãoes インタラクション + 상호작용 + 互动 + 互動 Torso @@ -26,6 +29,9 @@ Torso Torso 胴体 + 몸통 + 身体 + 身體 Head @@ -39,6 +45,9 @@ Testa Cabeça 頭部 + 머리 + 头部 + 頭部 Left Arm @@ -52,6 +61,9 @@ Braccio sinistro Braço Esquerdo 左腕 + 왼쪽 팔 + 左手 + 左手 Right Arm @@ -65,6 +77,9 @@ Braccio destro Braço Direito 右腕 + 오른쪽 팔 + 右手 + 右手 Left Leg @@ -78,6 +93,9 @@ Gamba sinistra Perna Esquerda 左足 + 왼쪽 다리 + 左脚 + 左腳 Right Leg @@ -91,6 +109,9 @@ Gamba destra Perna Direita 右足 + 오른쪽 다리 + 右脚 + 右腳 Weapon @@ -104,6 +125,9 @@ Arma Arma 武器 + 무기 + 武器 + 武器 Interaction Menu @@ -117,6 +141,9 @@ Menu de Interação Menù interazione インタラクション メニュー + 상호작용 메뉴 + 互动选单 + 互動選單 Interaction Menu (Self) @@ -130,6 +157,9 @@ Menu de Interação (Individual) Menù interazione (individuale) インタラクション メニュー (セルフ) + 상호작용 메뉴(자신) + 互动选单 (自我) + 互動選單 (自我) Open / Close Door @@ -143,6 +173,9 @@ Abrir / Fechar Porta Apri / Chiudi la porta ドアの開け閉め + 문 열기 / 닫기 + 打开/关上 门 + 打開/關上 門 Lock Door @@ -155,7 +188,10 @@ Ajtó bezárása Zablokuj drzwi Zamknout dveře - ドアの鍵を閉める + ドアの鍵をしめる + 문 잠그기 + 锁门 + 鎖門 Unlock Door @@ -168,7 +204,10 @@ Zár kinyitása Odblokuj drzwi Odemknout dveře - ドアの鍵を開ける + ドアの鍵をあける + 잠긴문 열기 + 解锁门 + 解鎖門 Locked Door @@ -181,7 +220,10 @@ Zárt ajtó Zablokowano drzwi Zamčené dveře - ドアの鍵を締めた + ドアの鍵をしめた + 잠긴 문 + 门已上锁 + 門已上鎖 Unlocked Door @@ -194,7 +236,10 @@ Nyitott ajtó Odblokowano drzwi Odemčené dveře - ドアの鍵を開けられた + ドアの鍵をあけた + 열린 문 + 门未上锁 + 門未上鎖 Join group @@ -207,7 +252,10 @@ Csatlakozás a csoporthoz Unir-se ao grupo Unisciti alla squadra - グループにはいる + グループに入る + 그룹 참여 + 加入小队 + 加入小隊 Leave Group @@ -220,7 +268,10 @@ Csoport elhagyása Deixar grupo Lascia la squadra - グループをぬける + グループを抜ける + 그룹 나가기 + 离开小队 + 離開小隊 Become Leader @@ -234,6 +285,9 @@ Tornar-se Líder Prendi il comando リーダーになる + 리더 되기 + 成为队长 + 成為隊長 DANCE! @@ -247,6 +301,9 @@ DANCE! DANZA! おどれ! + 춤추기! + 跳舞 + 跳舞 Stop Dancing @@ -260,6 +317,9 @@ Parar de dançar Smetti di ballare 踊るのをやめる + 춤 멈추기 + 停止跳舞 + 停止跳舞 << Back @@ -272,7 +332,10 @@ << Vissza << Voltar << Indietro - &lt;&lt; もどる + <<もどる + <<뒤로 + <<返回 + <<返回 Put weapon on back @@ -286,6 +349,9 @@ Colocar arma nas costas Metti l'arma in spalla 武器を背負う + 등에 무기 메기 + 将武器放到背后 + 將武器放到背後 Tap Shoulder @@ -298,7 +364,10 @@ Vállveregetés Tocar ombro Dai un colpetto - 肩をたたく + 肩を叩く + 어깨 두드리기 + 轻拍肩膀 + 輕拍肩膀 You were tapped on the RIGHT shoulder @@ -312,6 +381,9 @@ Você foi tocado no ombro Ti è stato dato un colpetto sulla spalla destra 右肩を叩かれた + 누군가 오른쪽 어깨를 쳤다 + 你的右肩膀被轻拍了一下 + 你的右肩膀被輕拍了一下 You were tapped on the LEFT shoulder. @@ -325,6 +397,9 @@ Você foi tocado no ombro. Ti è stato dato un colpetto sulla spalla sinistra 左肩を叩かれた + 누군가 왼쪽 어깨를 쳤다 + 你的左肩膀被轻拍了一下 + 你的左肩膀被輕拍了一下 Cancel @@ -338,6 +413,9 @@ Cancelar Mégse 中止 + 취소 + 取消 + 取消 Select @@ -351,6 +429,9 @@ Selecionar Kiválaszt 選択 + 선택 + 选择 + 選擇 Go Away! @@ -364,6 +445,9 @@ Vá Embora! Via di qui! うせろ! + 저리 가! + 走开! + 走開! Get Down! @@ -377,6 +461,9 @@ Abaixe-se! A terra! ふせろ! + 엎드려! + 趴下! + 趴下! Get Out @@ -388,6 +475,9 @@ Выходи Vystupte 降りる + 나가 + 出去 + 出去 Team Management @@ -401,6 +491,9 @@ Organizzazione Squadra Csapat kezelése チーム管理 + 팀 설정 + 小队管理 + 小隊管理 Red @@ -414,6 +507,9 @@ Rosso Piros レッド + 빨강 + 红色 + 紅色 Green @@ -427,6 +523,9 @@ Verde Zöld グリーン + 초록 + 绿色 + 綠色 Blue @@ -440,6 +539,9 @@ Blu Kék ブルー + 파랑 + 蓝色 + 藍色 Yellow @@ -453,6 +555,9 @@ Giallo Sárga イエロー + 노랑 + 黄色 + 黃色 Assign Red @@ -466,6 +571,9 @@ Assigner à rouge Assegna al team rosso レッドにする + 빨강에 등록 + 指派为红组 + 指派為紅組 Assign Green @@ -479,6 +587,9 @@ Assigner à vert Assegna al team verde グリーンにする + 초록에 등록 + 指派为绿组 + 指派為綠組 Assign Blue @@ -492,6 +603,9 @@ Assigner à bleu Assegna al team blu ブルーにする + 파랑이 등록 + 指派为蓝组 + 指派為藍組 Assign Yellow @@ -505,6 +619,9 @@ Assigner à jaune Assegna al team giallo イエローにする + 노랑에 등록 + 指派为黄组 + 指派為黃組 Join Red @@ -518,6 +635,9 @@ Rejoindre rouge Unirsi al team rosso レッドに入る + 빨강에 참여 + 加入红组 + 加入紅組 Join Green @@ -531,6 +651,9 @@ Rejoindre vert Unirsi al team verde グリーンに入る + 초록에 참여 + 加入绿组 + 加入綠組 Join Blue @@ -544,6 +667,9 @@ Rejoindre bleu Unirsi al team blu ブルーに入る + 파랑에 참여 + 加入蓝组 + 加入藍組 Join Yellow @@ -557,6 +683,9 @@ Rejoindre jaune Unirsi al team giallo イエローに入る + 노랑에 참여 + 加入黄组 + 加入黃組 You joined Team %1 @@ -570,6 +699,9 @@ Sei entrato nel team %1 Csatlakoztál a %1 csapathoz チーム %1 に入った + 당신은 %1팀에 참여했습니다 + 你已加入%1组 + 你已加入%1組 Leave Team @@ -583,6 +715,9 @@ Lascia il team Csapat elhagyása チームを抜ける + 팀 나가기 + 离开小队 + 離開小隊 You left the Team @@ -596,6 +731,9 @@ Hai lasciato il team Elhagytad a csapatot チームを抜けた + 팀을 나갔습니다 + 你已离开小队 + 你已離開小隊 Pardon @@ -609,6 +747,9 @@ Perdona Megbocsátás 許す + 허용 + 原谅 + 原諒 Scroll @@ -622,6 +763,9 @@ Görgetés Posunout スクロール + 스크롤 + 滚动 + 滾動 Modifier Key @@ -635,6 +779,9 @@ Módosító billentyű Modifikátor キーを割り当て + 키 할당하기 + 编辑按键 + 編輯按鍵 Not in Range @@ -648,6 +795,9 @@ Mimo dosah Fuori limite 範囲内にありません + 범위 내에 없습니다 + 不在范围内 + 不在範圍內 Equipment @@ -661,6 +811,9 @@ Equipaggiamento Equipamento 装備 + 장비 + 装备 + 裝備 Push @@ -674,6 +827,9 @@ Empurrar Spingere 押す + 밀기 + + Interact @@ -687,6 +843,9 @@ Interagire Interagir インタラクト + 상호작용 + 互动 + 互動 Passengers @@ -700,6 +859,9 @@ Passeggeri Passageiros 後部座席 + 승객 + 乘客 + 乘客 Open @@ -713,6 +875,9 @@ Apri Öffnen 開く + 열기 + 打开 + 打開 Interaction System @@ -726,6 +891,9 @@ Sistema de interação Sistema Interazioni インタラクション システム + 상호작용 시스템 + 互动系统 + 互動系統 Enable Team Management @@ -738,7 +906,10 @@ Csapatkezelés engedélyezése Habilitar gestão de equipes Abilità Management Squadra - チーム管理をつかう + チーム管理を使う + 팀 설정 활성화 + 启用小队管理 + 啟用小隊管理 Should players be allowed to use the Team Management Menu? Default: Yes @@ -752,6 +923,25 @@ Devem os jogadores ter permissão de usar o menu de gestão de equipes? Padrão: Sim Possono i giocatori usare il Menù Managment Squadra? Default: Si プレイヤーがチーム管理メニューを使えるようにしますか?標準:はい + 플레이어들이 팀 설정하는 것을 허락합니까? 기본설정: 예 + 允许玩家使用小队管理选单? 预设: 是 + 允許玩家使用小隊管理選單? 預設: 是 + + + Disable negative rating + Negative Bewertung deaktivieren + 否定評価を無効化 + Disabilita valutazione negativa + 關閉負面評價 + 关闭负面评价 + + + Should players receive negative rating? When enabled players are only receiving positive ratings which prevents friendly AI fire when destroying friendly equipment or killing team members. + Sollen Spieler negative Bewertungen erhalten dürfen? Wenn diese Option aktiviert ist, erhalten Spieler nur positive Bewerungen, was Freundbeschuss durch KI verhindert, wenn befreundete Ausrüstung zerstört oder befreundete Einheiten von Spielern des selben Teams getötet werden. + 否定評価を受けますか?有効化した場合プレイヤーは肯定評価のみを受け、友軍の装備を壊したり殺害をしてもAIからの攻撃を防ぎます。 + I giocatori dovrebbero ricevere delle valutazioni negative ? Quando è abilitato i giocatori ricevono esclusivamente valutazioni positive che prevengono il fuoco delle AI alleate quando distruggono equipaggiamenti o uccidono membri della squadra. + 玩家是否會收到負面評價? 當本功能開啟時玩家只會接收到正面評價,所以當玩家做出擊殺友軍AI、毀壞友軍裝備或殺害小隊夥伴都不會收到負面評價。 + 玩家是否会收到负面评价? 当本功能开启时玩家只会接收到正面评价,所以当玩家做出击杀友军AI、毁坏友军装备或杀害小队伙伴都不会收到负面评价。 Team management allows color allocation for team members, taking team command and joining/leaving teams. @@ -765,6 +955,9 @@ Управление группами позволяет назначать цвета членам групп, брать командование, вступать в группы или покидать их. Management Squadra permette l'assegnazione di colori per membri della squadra, prendere il comando ed entrare/uscire dalle squadre. チーム管理はチーム メンバーへ色の割り当てや指揮権を取ったり、チームの出入りを許可します。 + 팀 설정은 팀 멤버에게 색을 부여하거나 팀에 참여 혹은 나가게 할 수 있게 합니다. + 队伍管理系统允许将指定颜色分配到队伍成员上,接管队长职位或加入/离开队伍 + 隊伍管理系統允許將指定顏色分配到隊伍成員上,接管隊長職位或加入/離開隊伍 Turn on @@ -776,7 +969,10 @@ Zapnout Ligar Включить - 中に入る + 有効化 + 켜기 + 开启 + 開啟 Turn off @@ -788,7 +984,10 @@ Vypnout Desligar Выключить - 外に出す + 無効化 + 끄기 + 关闭 + 關閉 Pass magazine @@ -801,6 +1000,9 @@ Pasar cargador Passer un chargeur 弾倉をわたす + 탄창 건네기 + 给予弹匣 + 給予彈匣 Primary magazine @@ -813,6 +1015,9 @@ Cargador primario Chargeur de l'arme principale プライマリ用弾倉 + 주무기 탄창 + 给予主武器弹匣 + 給予主武器彈匣 Pistol magazine @@ -825,6 +1030,9 @@ Cargador de pistola Chargeur de pistolet 拳銃の弾倉 + 부무기 탄창 + 给予手枪弹匣 + 給予手槍彈匣 %1 passed you a %2 magazine. @@ -837,6 +1045,9 @@ %1 te pasó un cargador %2. %1 vous a passé un chargeur de %2. %1 はあなたに %2 弾倉をわたした + %1에게서 %2탄창을 받았다 + %1给你%2弹匣 + %1給你%2彈匣 Show "pass magazine" interaction @@ -849,6 +1060,9 @@ Mostrar "Pasar cargador" en el menú de interacción Montrer l'interaction "Passer un chargeur" "弾倉をわたす"をインタラクションに表示する + '탄창 건네기'를 상호작용에서 보여줌 + 显示"给予弹匣"互动动作 + 顯示"給予彈匣"互動動作 - \ No newline at end of file + diff --git a/addons/inventory/XEH_preInit.sqf b/addons/inventory/XEH_preInit.sqf index a7feade1c3..b47cf6628d 100644 --- a/addons/inventory/XEH_preInit.sqf +++ b/addons/inventory/XEH_preInit.sqf @@ -2,6 +2,8 @@ ADDON = false; +PREP_RECOMPILE_START; #include "XEH_PREP.hpp" +PREP_RECOMPILE_END; ADDON = true; diff --git a/addons/inventory/functions/fnc_addCustomFilter.sqf b/addons/inventory/functions/fnc_addCustomFilter.sqf index 44e43bdbf0..0dd80c2e74 100644 --- a/addons/inventory/functions/fnc_addCustomFilter.sqf +++ b/addons/inventory/functions/fnc_addCustomFilter.sqf @@ -10,6 +10,9 @@ * Return Value: * None * + * Example: + * ["displayname", "filter"] call ACE_inventory_fnc_addCustomFilter + * * Public: No */ #include "script_component.hpp" diff --git a/addons/inventory/functions/fnc_currentItemListBox.sqf b/addons/inventory/functions/fnc_currentItemListBox.sqf index 1f1b528e93..670efeb044 100644 --- a/addons/inventory/functions/fnc_currentItemListBox.sqf +++ b/addons/inventory/functions/fnc_currentItemListBox.sqf @@ -10,6 +10,9 @@ * Return Value: * Currently selected item list box * + * Example: + * [DISPLAY] call ACE_inventory_fnc_currentItemListBox + * * Public: No */ #include "script_component.hpp" diff --git a/addons/inventory/functions/fnc_filterBackpacks.sqf b/addons/inventory/functions/fnc_filterBackpacks.sqf index 9b629de66f..082dbd6501 100644 --- a/addons/inventory/functions/fnc_filterBackpacks.sqf +++ b/addons/inventory/functions/fnc_filterBackpacks.sqf @@ -8,6 +8,9 @@ * Return Value: * Item should appear in this list? * + * Example: + * [CONFIG] call ACE_inventory_fnc_filterBackpacks + * * Public: No */ #include "script_component.hpp" diff --git a/addons/inventory/functions/fnc_filterGrenades.sqf b/addons/inventory/functions/fnc_filterGrenades.sqf index 0acfbcaa2c..6a869849fc 100644 --- a/addons/inventory/functions/fnc_filterGrenades.sqf +++ b/addons/inventory/functions/fnc_filterGrenades.sqf @@ -8,6 +8,9 @@ * Return Value: * Item should appear in this list? * + * Example: + * [CONFIG] call ACE_inventory_fnc_filterGrenades + * * Public: No */ #include "script_component.hpp" diff --git a/addons/inventory/functions/fnc_filterHeadgear.sqf b/addons/inventory/functions/fnc_filterHeadgear.sqf index 056406a3d1..ac787fc35a 100644 --- a/addons/inventory/functions/fnc_filterHeadgear.sqf +++ b/addons/inventory/functions/fnc_filterHeadgear.sqf @@ -8,6 +8,9 @@ * Return Value: * Item should appear in this list? * + * Example: + * [CONFIG] call ACE_inventory_fnc_filterHeadgear + * * Public: No */ #include "script_component.hpp" diff --git a/addons/inventory/functions/fnc_filterItems.sqf b/addons/inventory/functions/fnc_filterItems.sqf index b9bf9baeea..1aaba46497 100644 --- a/addons/inventory/functions/fnc_filterItems.sqf +++ b/addons/inventory/functions/fnc_filterItems.sqf @@ -8,6 +8,9 @@ * Return Value: * Item should appear in this list? * + * Example: + * [CONFIG] call ACE_inventory_fnc_filterItems + * * Public: No */ #include "script_component.hpp" diff --git a/addons/inventory/functions/fnc_filterMagazines.sqf b/addons/inventory/functions/fnc_filterMagazines.sqf index dfd357f61d..e0d67e3c7e 100644 --- a/addons/inventory/functions/fnc_filterMagazines.sqf +++ b/addons/inventory/functions/fnc_filterMagazines.sqf @@ -8,6 +8,9 @@ * Return Value: * Item should appear in this list? * + * Example: + * [CONFIG] call ACE_inventory_fnc_filterMagazines + * * Public: No */ #include "script_component.hpp" diff --git a/addons/inventory/functions/fnc_filterMedical.sqf b/addons/inventory/functions/fnc_filterMedical.sqf index 397be50f06..567aa528a3 100644 --- a/addons/inventory/functions/fnc_filterMedical.sqf +++ b/addons/inventory/functions/fnc_filterMedical.sqf @@ -8,6 +8,9 @@ * Return Value: * Item should appear in this list? * + * Example: + * [CONFIG] call ACE_inventory_fnc_filterMedical + * * Public: No */ #include "script_component.hpp" diff --git a/addons/inventory/functions/fnc_filterUniforms.sqf b/addons/inventory/functions/fnc_filterUniforms.sqf index 4c135dfa88..74773c3ad0 100644 --- a/addons/inventory/functions/fnc_filterUniforms.sqf +++ b/addons/inventory/functions/fnc_filterUniforms.sqf @@ -8,6 +8,9 @@ * Return Value: * Item should appear in this list? * + * Example: + * [CONFIG] call ACE_inventory_fnc_filterUniforms + * * Public: No */ #include "script_component.hpp" diff --git a/addons/inventory/functions/fnc_filterVests.sqf b/addons/inventory/functions/fnc_filterVests.sqf index 646e23d04d..a0ce281bda 100644 --- a/addons/inventory/functions/fnc_filterVests.sqf +++ b/addons/inventory/functions/fnc_filterVests.sqf @@ -8,6 +8,9 @@ * Return Value: * Item should appear in this list? * + * Example: + * [CONFIG] call ACE_inventory_fnc_filterVests + * * Public: No */ #include "script_component.hpp" diff --git a/addons/inventory/functions/fnc_filterWeapons.sqf b/addons/inventory/functions/fnc_filterWeapons.sqf index 94a92814ae..65b3d7cdea 100644 --- a/addons/inventory/functions/fnc_filterWeapons.sqf +++ b/addons/inventory/functions/fnc_filterWeapons.sqf @@ -8,6 +8,9 @@ * Return Value: * Item should appear in this list? * + * Example: + * [CONFIG] call ACE_inventory_fnc_filterWeapons + * * Public: No */ #include "script_component.hpp" diff --git a/addons/inventory/functions/fnc_forceItemListUpdate.sqf b/addons/inventory/functions/fnc_forceItemListUpdate.sqf index e5358212bb..03bf667504 100644 --- a/addons/inventory/functions/fnc_forceItemListUpdate.sqf +++ b/addons/inventory/functions/fnc_forceItemListUpdate.sqf @@ -8,6 +8,9 @@ * Return Value: * None * + * Example: + * [DISPLAY] call ACE_inventory_fnc_forceitemListUpdate + * * Public: No */ #include "script_component.hpp" diff --git a/addons/inventory/functions/fnc_inventoryDisplayLoad.sqf b/addons/inventory/functions/fnc_inventoryDisplayLoad.sqf index 0e1daa4a52..09d2b6fb9b 100644 --- a/addons/inventory/functions/fnc_inventoryDisplayLoad.sqf +++ b/addons/inventory/functions/fnc_inventoryDisplayLoad.sqf @@ -8,6 +8,9 @@ * Return Value: * None * + * Example: + * [DISPLAY] call ACE_inventory_fnc_inventoryDisplayLoad + * * Public: No */ #include "script_component.hpp" diff --git a/addons/inventory/functions/fnc_onLBSelChanged.sqf b/addons/inventory/functions/fnc_onLBSelChanged.sqf index 5ae49049fe..86ecfa0087 100644 --- a/addons/inventory/functions/fnc_onLBSelChanged.sqf +++ b/addons/inventory/functions/fnc_onLBSelChanged.sqf @@ -10,6 +10,9 @@ * Return Value: * None * + * Example: + * [CONTROL, 5] call ACE_inventory_fnc_onLBSelChanged + * * Public: No */ #include "script_component.hpp" diff --git a/addons/inventory/stringtable.xml b/addons/inventory/stringtable.xml index 0aa7373b9d..713c8b082b 100644 --- a/addons/inventory/stringtable.xml +++ b/addons/inventory/stringtable.xml @@ -13,6 +13,9 @@ Ingrandisci il menù inventario Aumentar o Tamanho da Tela do Inventário インベントリ表示を大きくする + 소지품 화면을 더 크게 합니다 + 使物品显示清单更大 + 使物品顯示清單更大 Normally inventory display is scaled by UI size. This allows scaling the Inventory UI size up, but doesn't increase font size allowing more rows displayed. @@ -25,7 +28,10 @@ Alaphelyzetben a kezelőfelület mérete skálázza a felszerelési menüt. Ez az opció engedélyezi a menü felskálázását, de megtartja a betűméreteket, így növelve a láthatóságot. Normalmente il menù inventario è scalato in base alle dimensioni interfaccia. Questa opzione di permette di ingrandirlo ulteriormente ma senza aumentare la dimensione del testo. Normalmente o tamanho da tela do inventário é ditada pelo tamanho da UI. Isso permite aumentar o tamanho da tela de inventário, mas não aumenta o tamanho da fonte, permitindo que mais linhas sejam visualizadas. - 通常のインベントリは UI の大きさによって表示されます。これはインベントリ UI を大きくできますが、文字は大きくできません。 + 通常、インベントリは UI の大きさにより調整して表示されます。これはインベントリ UI を大きくできますが、文字は大きくできません。 + 보통 소지품 화면은 사용자 인터페이스 크기에 비례합니다. 이 항목은 소지품의 사용자 인터페이스를 확대를 가능케하면서 글씨는 그대로 냅두게 해줍니다. + 一般来说,物品清单尺寸是由使用者介面来决定的。此选项能让你的物品显示清单更大但不会增加字体大小,此举可增加更多能被显示的描述行数! + 一般來說,物品清單尺寸是由使用者介面來決定的。此選項能讓你的物品顯示清單更大但不會增加字體大小,此舉可增加更多能被顯示的描述行數! Backpacks @@ -38,6 +44,9 @@ Mochilas Рюкзаки バックパック + 가방 + 背包 + 背包 Headgear @@ -46,10 +55,13 @@ Hełmy Copricapi Cascos - Couvre-chefs + Couvre-chefs Capacetes Головные уборы ヘッドギア + 헬멧 + 头盔 + 頭盔 Glasses @@ -62,6 +74,9 @@ Óculos Очки メガネ + 안경 + 眼镜 + 眼鏡 Uniforms @@ -74,6 +89,9 @@ Uniformes Униформа 戦闘服 + 복장 + 服装 + 服裝 Vests @@ -86,6 +104,9 @@ Coletes Жилеты ベスト + 조끼 + 背心 + 背心 Grenades @@ -98,6 +119,9 @@ Granadas Гранаты 手榴弾 + 수류탄 + 手榴弹 + 手榴彈 Medical @@ -110,6 +134,9 @@ Médico Медицина 医療 + 의료 + 医疗 + 醫療 - \ No newline at end of file + diff --git a/addons/javelin/CfgEventhandlers.hpp b/addons/javelin/CfgEventhandlers.hpp index 7b76e00d43..789cfeb05c 100644 --- a/addons/javelin/CfgEventhandlers.hpp +++ b/addons/javelin/CfgEventhandlers.hpp @@ -6,20 +6,13 @@ class Extended_PreStart_EventHandlers { }; class Extended_PreInit_EventHandlers { - class ADDON { - init = QUOTE(call COMPILE_FILE(XEH_pre_init)); + class ADDON { + init = QUOTE(call COMPILE_FILE(XEH_preInit)); }; }; class Extended_PostInit_EventHandlers { - class ADDON { - init = QUOTE(call COMPILE_FILE(XEH_post_init)); + class ADDON { clientInit = QUOTE(call COMPILE_FILE(XEH_clientInit)); }; }; - -class Extended_FiredBIS_EventHandlers { - class All { - ADDON = QUOTE(_this call FUNC(onFired)); - }; -}; diff --git a/addons/javelin/CfgVehicles.hpp b/addons/javelin/CfgVehicles.hpp index a30489ad14..790b802230 100644 --- a/addons/javelin/CfgVehicles.hpp +++ b/addons/javelin/CfgVehicles.hpp @@ -1,19 +1,19 @@ class CfgVehicles { class LandVehicle; - class StaticWeapon : LandVehicle { + class StaticWeapon: LandVehicle { class Turrets; }; - class StaticMGWeapon : StaticWeapon { - class Turrets : Turrets { + class StaticMGWeapon: StaticWeapon { + class Turrets: Turrets { class MainTurret; }; }; class AT_01_base_F: StaticMGWeapon {}; class B_static_AT_F: AT_01_base_F { - class Turrets : Turrets { - class MainTurret : MainTurret { + class Turrets: Turrets { + class MainTurret: MainTurret { weapons[] = { QGVAR(Titan_Static) }; magazines[] = {"1Rnd_GAT_missiles","1Rnd_GAT_missiles","1Rnd_GAT_missiles","1Rnd_GAT_missiles"}; @@ -30,8 +30,8 @@ class CfgVehicles { }; }; class O_static_AT_F: AT_01_base_F { - class Turrets : Turrets { - class MainTurret : MainTurret { + class Turrets: Turrets { + class MainTurret: MainTurret { weapons[] = { QGVAR(Titan_Static) }; magazines[] = {"1Rnd_GAT_missiles","1Rnd_GAT_missiles","1Rnd_GAT_missiles","1Rnd_GAT_missiles"}; @@ -48,8 +48,8 @@ class CfgVehicles { }; }; class I_static_AT_F: AT_01_base_F { - class Turrets : Turrets { - class MainTurret : MainTurret { + class Turrets: Turrets { + class MainTurret: MainTurret { weapons[] = { QGVAR(Titan_Static) }; magazines[] = {"1Rnd_GAT_missiles","1Rnd_GAT_missiles","1Rnd_GAT_missiles","1Rnd_GAT_missiles"}; diff --git a/addons/javelin/CfgWeapons.hpp b/addons/javelin/CfgWeapons.hpp index 45c8c5942c..e8e5d382b2 100644 --- a/addons/javelin/CfgWeapons.hpp +++ b/addons/javelin/CfgWeapons.hpp @@ -2,17 +2,17 @@ class CfgWeapons { class Launcher; class MissileLauncher; - class Launcher_Base_F : Launcher { + class Launcher_Base_F: Launcher { class WeaponSlotsInfo; }; // @TODO: AA by default, motherfuckers - class missiles_titan : MissileLauncher { + class missiles_titan: MissileLauncher { }; - class missiles_titan_at : missiles_titan { }; - class GVAR(Titan_Static) : missiles_titan_at { + class missiles_titan_at: missiles_titan { }; + class GVAR(Titan_Static): missiles_titan_at { GVAR(enabled) = 1; weaponInfoType = "ACE_RscOptics_javelin"; modelOptics = QPATHTOF(data\reticle_titan.p3d); @@ -24,9 +24,9 @@ class CfgWeapons { }; // @TODO: AA by default, motherfuckers - class launch_Titan_base : Launcher_Base_F {}; + class launch_Titan_base: Launcher_Base_F {}; - class launch_Titan_short_base : launch_Titan_base { }; + class launch_Titan_short_base: launch_Titan_base { }; class launch_B_Titan_short_F: launch_Titan_short_base { GVAR(enabled) = 1; @@ -58,7 +58,6 @@ class CfgWeapons { canLock = 0; - lockingTargetSound[] = {"",0,1}; lockedTargetSound[] = {"",0,1}; }; diff --git a/addons/javelin/README.md b/addons/javelin/README.md index 37685d9cce..ecbf3743b4 100644 --- a/addons/javelin/README.md +++ b/addons/javelin/README.md @@ -9,3 +9,4 @@ Adds the Javelin AT launcher. The people responsible for merging changes to this component or answering potential questions. - [jaynus](https://github.com/walterpearce) +- [PabstMirror](https://github.com/PabstMirror) diff --git a/addons/javelin/RscInGameUI.hpp b/addons/javelin/RscInGameUI.hpp index 80e1201682..e34630dde3 100644 --- a/addons/javelin/RscInGameUI.hpp +++ b/addons/javelin/RscInGameUI.hpp @@ -1,10 +1,8 @@ class RscOpticsValue; -class RscControlsGroup; +class RscControlsGroupNoScrollbars; class RscPicture; -class RscMapControl; -class VScrollbar; -class HScrollbar; class RscLine; +class RscMapControl; // Taken from AGM for optics management. @@ -12,29 +10,24 @@ class RscLine; class RscInGameUI { class ACE_RscOptics_javelin { idd = 300; - controls[] = { QGVAR(elements_group), "ACE_Targeting" }; //, "ACE_TargetingConstrains", "ACE_TargetingGate", "ACE_TargetingLines"}; - onLoad = QUOTE(_this call FUNC(onOpticLoad)); - onUnload = QUOTE(_this call FUNC(onOpticUnload)); + controls[] = { QGVAR(elements_group), "ACE_Targeting", QGVAR(mapHelper) }; + onLoad = QUOTE(with uiNamespace do {ACE_RscOptics_javelin = _this select 0;};); - class GVAR(elements_group): RscControlsGroup - { - x = "SafezoneX"; - y = "SafezoneY"; - w = "SafezoneW"; - h = "SafezoneH"; + class GVAR(mapHelper): RscMapControl { + onDraw = QUOTE(_this call FUNC(mapHelperDraw);); + x = -10; + y = -10; + w = 0; + h = 0; + }; + + class GVAR(elements_group): RscControlsGroupNoScrollbars { + x = "safeZoneX"; + y = "safeZoneY"; + w = "safeZoneW"; + h = "safeZoneH"; idc = 170; - class VScrollbar { - autoScrollSpeed = -1; - autoScrollDelay = 5; - autoScrollRewind = 0; - color[] = {1,1,1,0}; - width = 0.001; - }; - class HScrollbar { - color[] = {1,1,1,0}; - height = 0.001; - }; - class Controls { + class Controls { class CA_Distance: RscOpticsValue { idc = 151; sizeEx = "0"; @@ -44,13 +37,12 @@ class RscInGameUI { w = 0; h = 0; }; - class GVAR(Day_mode_off): RscPicture { idc = 1001; - x = "(SafezoneX+(SafezoneW -SafezoneH*3/4)/2)+ (0.03/4)*3*SafezoneH - SafezoneX"; - y = "SafezoneY+SafezoneH*0.031 - SafezoneY"; - w = "0.1045752* (((SafezoneW*3)/4)/SafezoneW)/(1/SafezoneH)"; - h = "SafezoneH*0.1045752"; + x = "(safeZoneX+(safeZoneW -safeZoneH*3/4)/2)+ (0.03/4)*3*safeZoneH - safeZoneX"; + y = "safeZoneY+safeZoneH*0.031 - safeZoneY"; + w = "0.1045752* (((safeZoneW*3)/4)/safeZoneW)/(1/safeZoneH)"; + h = "safeZoneH*0.1045752"; colorText[] = {0.2941,0.2941,0.2941,1}; text = "\A3\ui_f\data\igui\rscingameui\rscoptics_titan\day_co.paa"; }; @@ -58,146 +50,135 @@ class RscInGameUI { idc = 160; colorText[] = {0.2941,0.8745,0.2157,1}; }; - class CA_Javelin_WFOV_mode_off : GVAR(Day_mode_off) { + class GVAR(WFOV_mode_off): GVAR(Day_mode_off) { idc = 1004; - x = "(SafezoneX+(SafezoneW -SafezoneH*3/4)/2)+ (0.307/4)*3*SafezoneH - SafezoneX"; + x = "(safeZoneX+(safeZoneW -safeZoneH*3/4)/2)+ (0.307/4)*3*safeZoneH - safeZoneX"; text = "\A3\ui_f\data\igui\rscingameui\rscoptics_titan\wfov_co.paa"; }; - class GVAR(WFOV_mode_group): RscControlsGroup { - x = "SafezoneX"; - y = "SafezoneY"; - w = "SafezoneW"; - h = "SafezoneH"; + class GVAR(WFOV_mode_group): RscControlsGroupNoScrollbars { + x = "safeZoneX"; + y = "safeZoneY"; + w = "safeZoneW"; + h = "safeZoneH"; idc = 163; - class VScrollbar { - autoScrollSpeed = -1; - autoScrollDelay = 5; - autoScrollRewind = 0; - color[] = {1,1,1,0}; - width = 0.001; - }; - class HScrollbar { - color[] = {1,1,1,0}; - height = 0.001; - }; class Controls { + class GVAR(WFOV_mode_on): GVAR(WFOV_mode_off) { + idc = -1; + y = "0.031*SafeZoneH - SafezoneY"; + x = "((SafezoneW -SafezoneH*3/4)/2)+ (0.307/4)*3*SafezoneH - SafezoneX"; + colorText[] = {0.2941,0.8745,0.2157,1}; + }; class StadiaL: RscLine { - x = "0.4899*SafezoneW - SafezoneX"; - y = "0.171*SafezoneH - SafezoneY"; + x = "0.4899*safeZoneW - safeZoneX"; + y = "0.171*safeZoneH - safeZoneY"; w = 0; - h = "0.049*SafezoneH"; + h = "0.049*safeZoneH"; colorText[] = {0.2941,0.8745,0.2157,1}; }; class StadiaR: RscLine { - x = "0.5109*SafezoneW- SafezoneX"; - y = "0.171*SafezoneH - SafezoneY"; + x = "0.5109*safeZoneW- safeZoneX"; + y = "0.171*safeZoneH - safeZoneY"; w = 0; - h = "0.049*SafezoneH"; + h = "0.049*safeZoneH"; colorText[] = {0.2941,0.8745,0.2157,1}; }; class BracketL: RscLine { - x = "((SafezoneW -SafezoneH*3/4)/2)+ (0.293/4)*3*SafezoneH - SafezoneX"; - y = "0.4677*SafezoneH - SafezoneY"; + x = "((safeZoneW -safeZoneH*3/4)/2)+ (0.293/4)*3*safeZoneH - safeZoneX"; + y = "0.4677*safeZoneH - safeZoneY"; w = 0; - h = "0.0646*SafezoneH"; + h = "0.0646*safeZoneH"; colorText[] = {0.2941,0.8745,0.2157,1}; }; class BracketR: RscLine { - x = "((SafezoneW -SafezoneH*3/4)/2)+ (0.70/4)*3*SafezoneH - SafezoneX"; - y = "0.4677*SafezoneH - SafezoneY"; + x = "((safeZoneW -safeZoneH*3/4)/2)+ (0.70/4)*3*safeZoneH - safeZoneX"; + y = "0.4677*safeZoneH - safeZoneY"; w = 0; - h = "0.0646*SafezoneH"; + h = "0.0646*safeZoneH"; colorText[] = {0.2941,0.8745,0.2157,1}; }; class BracketT: RscLine { - x = "((SafezoneW -SafezoneH*3/4)/2)+ (0.467/4)*3*SafezoneH - SafezoneX"; - y = "0.3535*SafezoneH - SafezoneY"; - w = "0.065* (((SafezoneW*3)/4)/SafezoneW)/(1/SafezoneH)"; + x = "((safeZoneW -safeZoneH*3/4)/2)+ (0.467/4)*3*safeZoneH - safeZoneX"; + y = "0.3535*safeZoneH - safeZoneY"; + w = "0.065* (((safeZoneW*3)/4)/safeZoneW)/(1/safeZoneH)"; h = 0; colorText[] = {0.2941,0.8745,0.2157,1}; }; class BracketB: RscLine { - x = "((SafezoneW -SafezoneH*3/4)/2)+ (0.467/4)*3*SafezoneH - SafezoneX"; - y = "0.6465*SafezoneH - SafezoneY"; - w = "0.065* (((SafezoneW*3)/4)/SafezoneW)/(1/SafezoneH)"; + x = "((safeZoneW -safeZoneH*3/4)/2)+ (0.467/4)*3*safeZoneH - safeZoneX"; + y = "0.6465*safeZoneH - safeZoneY"; + w = "0.065* (((safeZoneW*3)/4)/safeZoneW)/(1/safeZoneH)"; h = 0; colorText[] = {0.2941,0.8745,0.2157,1}; }; }; }; - class CA_Javelin_NFOV_mode_off: GVAR(Day_mode_off) { + class GVAR(NFOV_mode_off): GVAR(Day_mode_off) { idc = 1003; - x = "(SafezoneX+(SafezoneW -SafezoneH*3/4)/2)+ (0.586/4)*3*SafezoneH - SafezoneX"; + x = "(safeZoneX+(safeZoneW -safeZoneH*3/4)/2)+ (0.586/4)*3*safeZoneH - safeZoneX"; text = "\A3\ui_f\data\igui\rscingameui\rscoptics_titan\nfov_co.paa"; }; - class GVAR(NFOV_mode_group): RscControlsGroup { - x = "SafezoneX"; - y = "SafezoneY"; - w = "SafezoneW-SafezoneX"; - h = "SafezoneH-SafezoneY"; + class GVAR(NFOV_mode_group): RscControlsGroupNoScrollbars { + x = "safeZoneX"; + y = "safeZoneY"; + w = "safeZoneW-safeZoneX"; + h = "safeZoneH-safeZoneY"; idc = 162; - class VScrollbar { - autoScrollSpeed = -1; - autoScrollDelay = 5; - autoScrollRewind = 0; - color[] = {1,1,1,0}; - width = 0.001; - }; - class HScrollbar { - color[] = {1,1,1,0}; - height = 0.001; - }; class Controls { + class GVAR(NFOV_mode_on): GVAR(NFOV_mode_off) { + idc = -1; + x = "((SafezoneW -SafezoneH*3/4)/2)+ (0.586/4)*3*SafezoneH - SafezoneX"; + y = "0.031*SafeZoneH - SafezoneY"; + colorText[] = {0.2941,0.8745,0.2157,1}; + }; class StadiaL: RscLine { - x = "0.4788*SafezoneW - SafezoneX"; - y = "0.171*SafezoneH - SafezoneY"; + x = "0.4788*safeZoneW - safeZoneX"; + y = "0.171*safeZoneH - safeZoneY"; w = 0; - h = "0.049*SafezoneH"; + h = "0.049*safeZoneH"; colorText[] = {0.2941,0.8745,0.2157,1}; }; class StadiaR: RscLine { - x = "0.5212*SafezoneW - SafezoneX"; - y = "0.171*SafezoneH - SafezoneY"; + x = "0.5212*safeZoneW - safeZoneX"; + y = "0.171*safeZoneH - safeZoneY"; w = 0; - h = "0.049*SafezoneH"; + h = "0.049*safeZoneH"; colorText[] = {0.2941,0.8745,0.2157,1}; }; class LineHL: RscLine { - x = "((SafezoneW -SafezoneH*3/4)/2)+ (0.01/4)*3*SafezoneH - SafezoneX"; - y = "SafezoneH*0.5 - SafezoneY"; - w = "0.29* (((SafezoneW*3)/4)/SafezoneW)/(1/SafezoneH)"; - h = "SafezoneH*0.0"; + x = "((safeZoneW -safeZoneH*3/4)/2)+ (0.01/4)*3*safeZoneH - safeZoneX"; + y = "safeZoneH*0.5 - safeZoneY"; + w = "0.29* (((safeZoneW*3)/4)/safeZoneW)/(1/safeZoneH)"; + h = "safeZoneH*0.0"; colorText[] = {0.2941,0.8745,0.2157,1}; }; class LineHR: RscLine { - x = "((SafezoneW -SafezoneH*3/4)/2)+ (0.695/4)*3*SafezoneH - SafezoneX"; - y = "SafezoneH*0.5 - SafezoneY"; - w = "0.29* (((SafezoneW*3)/4)/SafezoneW)/(1/SafezoneH)"; - h = "SafezoneH*0.0"; + x = "((safeZoneW -safeZoneH*3/4)/2)+ (0.695/4)*3*safeZoneH - safeZoneX"; + y = "safeZoneH*0.5 - safeZoneY"; + w = "0.29* (((safeZoneW*3)/4)/safeZoneW)/(1/safeZoneH)"; + h = "safeZoneH*0.0"; colorText[] = {0.2941,0.8745,0.2157,1}; }; class LineVT: RscLine { - x = "0.5*SafezoneW - SafezoneX"; - y = "0.171*SafezoneH - SafezoneY"; + x = "0.5*safeZoneW - safeZoneX"; + y = "0.171*safeZoneH - safeZoneY"; w = 0; - h = "0.1825*SafezoneH"; + h = "0.1825*safeZoneH"; colorText[] = {0.2941,0.8745,0.2157,1}; }; class LineVB: RscLine { - x = "0.5*SafezoneW - SafezoneX"; - y = "0.6465*SafezoneH - SafezoneY"; + x = "0.5*safeZoneW - safeZoneX"; + y = "0.6465*safeZoneH - safeZoneY"; w = 0; - h = "0.1895*SafezoneH"; + h = "0.1895*safeZoneH"; colorText[] = {0.2941,0.8745,0.2157,1}; }; - }; }; class GVAR(SEEK_off): GVAR(Day_mode_off) { idc = 699000; - x = "(SafezoneX+(SafezoneW -SafezoneH*3/4)/2)+ (0.863/4)*3*SafezoneH - SafezoneX"; + x = "(safeZoneX+(safeZoneW -safeZoneH*3/4)/2)+ (0.863/4)*3*safeZoneH - safeZoneX"; text = "\A3\ui_f\data\igui\rscingameui\rscoptics_titan\seek_co.paa"; }; class GVAR(SEEK): GVAR(SEEK_off) { @@ -206,8 +187,8 @@ class RscInGameUI { }; class GVAR(Missle_off): GVAR(Day_mode_off) { idc = 1032; - x = "(SafezoneX+(SafezoneW -SafezoneH*3/4)/2)+ (-0.134/4)*3*SafezoneH - SafezoneX"; - y = "(SafezoneY + 0.208*SafezoneH) - SafezoneY"; + x = "(safeZoneX+(safeZoneW -safeZoneH*3/4)/2)+ (-0.134/4)*3*safeZoneH - safeZoneX"; + y = "(safeZoneY + 0.208*safeZoneH) - safeZoneY"; colorText[] = {0.2941,0.2941,0.2941,1}; text = "\A3\ui_f\data\igui\rscingameui\rscoptics_titan\missle_co.paa"; }; @@ -217,32 +198,32 @@ class RscInGameUI { }; class GVAR(CLU_off): GVAR(Missle_off) { idc = 1027; - y = "(SafezoneY + 0.436*SafezoneH) - SafezoneY"; + y = "(safeZoneY + 0.436*safeZoneH) - safeZoneY"; text = "\A3\ui_f\data\igui\rscingameui\rscoptics_titan\clu_co.paa"; }; class GVAR(HangFire_off): GVAR(Missle_off) { idc = 1028; - y = "(SafezoneY + 0.669*SafezoneH) - SafezoneY"; + y = "(safeZoneY + 0.669*safeZoneH) - safeZoneY"; text = "\A3\ui_f\data\igui\rscingameui\rscoptics_titan\hangfire_co.paa"; }; class GVAR(TOP_off): GVAR(Day_mode_off) { idc = 699001; - x = "(SafezoneX+(SafezoneW -SafezoneH*3/4)/2)+ (1.023/4)*3*SafezoneH - SafezoneX"; - y = "(SafezoneY + 0.208*SafezoneH) - SafezoneY"; + x = "(safeZoneX+(safeZoneW -safeZoneH*3/4)/2)+ (1.023/4)*3*safeZoneH - safeZoneX"; + y = "(safeZoneY + 0.208*safeZoneH) - safeZoneY"; text = "\A3\ui_f\data\igui\rscingameui\rscoptics_titan\top_co.paa"; colorText[] = {0.2941,0.8745,0.2157,1}; }; class GVAR(DIR): GVAR(Day_mode) { idc = 699002; - x = "(SafezoneX+(SafezoneW -SafezoneH*3/4)/2)+ (1.023/4)*3*SafezoneH - SafezoneX"; - y = "(SafezoneY + 0.436*SafezoneH) - SafezoneY"; + x = "(safeZoneX+(safeZoneW -safeZoneH*3/4)/2)+ (1.023/4)*3*safeZoneH - safeZoneX"; + y = "(safeZoneY + 0.436*safeZoneH) - safeZoneY"; text = "\A3\ui_f\data\igui\rscingameui\rscoptics_titan\dir_co.paa"; colorText[] = {0.2941,0.2941,0.2941,1}; }; class GVAR(FLTR_mode_off): GVAR(Day_mode_off) { idc = 1002; - x = "(SafezoneX+(SafezoneW -SafezoneH*3/4)/2)+ (1.023/4)*3*SafezoneH - SafezoneX"; - y = "(SafezoneY + 0.669*SafezoneH) - SafezoneY"; + x = "(safeZoneX+(safeZoneW -safeZoneH*3/4)/2)+ (1.023/4)*3*safeZoneH - safeZoneX"; + y = "(safeZoneY + 0.669*safeZoneH) - safeZoneY"; text = "\A3\ui_f\data\igui\rscingameui\rscoptics_titan\fltr_co.paa"; }; class GVAR(FLTR_mode): GVAR(FLTR_mode_off) { @@ -251,151 +232,139 @@ class RscInGameUI { }; }; }; - class ACE_Targeting : RscControlsGroup { + class ACE_Targeting: RscControlsGroupNoScrollbars { idc = 6999; - - x = "SafezoneX"; - y = "SafezoneY"; - w = "SafezoneW"; - h = "SafezoneH"; - - enabled = 0; + x = "safeZoneX"; + y = "safeZoneY"; + w = "safeZoneW"; + h = "safeZoneH"; + enabled = 0; + show = 0; class Controls { - class ACE_TargetingConstrains: RscControlsGroup { - x = "SafezoneX"; - y = "SafezoneY"; - w = "SafezoneW-SafezoneX"; - h = "SafezoneH-SafezoneY"; + class ACE_TargetingConstrains: RscControlsGroupNoScrollbars { + x = "safeZoneX"; + y = "safeZoneY"; + w = "safeZoneW-safeZoneX"; + h = "safeZoneH-safeZoneY"; enabled = 0; - class VScrollbar { - autoScrollSpeed = -1; - autoScrollDelay = 5; - autoScrollRewind = 0; - color[] = {1,1,1,0}; - width = 0.001; - }; - class HScrollbar { - color[] = {1,1,1,0}; - height = 0.001; - }; class Controls { class Top: RscPicture { idc = 699101; text = "#(argb,8,8,3)color(1,1,1,1)"; colorText[] = {0.2941,0.2941,0.2941,1}; - x = "((SafezoneW -(3/4)*SafezoneH)/2) - SafezoneX"; - y = "0.15*SafezoneH-SafezoneY"; - w = "(3/4)*SafezoneH"; - h = "0.21*SafezoneH"; + x = "((safeZoneW -(3/4)*safeZoneH)/2) - safeZoneX"; + y = "0.15*safeZoneH-safeZoneY"; + w = "(3/4)*safeZoneH"; + h = "0.21*safeZoneH"; }; class Bottom: Top { idc = 699102; - y = "0.64*SafezoneH-SafezoneY"; + y = "0.64*safeZoneH-safeZoneY"; }; class Left: Top { idc = 699103; - x = "((SafezoneW -(3/4)*SafezoneH)/2) - SafezoneX"; - y = "0.36*SafezoneH-SafezoneY"; - w = "0.31*(3/4)*SafezoneH"; - h = "0.28*SafezoneH"; + x = "((safeZoneW -(3/4)*safeZoneH)/2) - safeZoneX"; + y = "0.36*safeZoneH-safeZoneY"; + w = "0.31*(3/4)*safeZoneH"; + h = "0.28*safeZoneH"; }; class Right: Left { idc = 699104; - x = "((SafezoneW -(3/4)*SafezoneH)/2)+ 0.69*(3/4)*SafezoneH - SafezoneX"; + x = "((safeZoneW -(3/4)*safeZoneH)/2)+ 0.69*(3/4)*safeZoneH - safeZoneX"; }; class OpticsBorders: RscPicture { idc = 699105; text = QPATHTOF(data\javelin_ui_border_ca.paa); colorText[] = {0,0,0,1}; - x = "((SafezoneW -(3.1/4)*SafezoneH)/2) - SafezoneX"; - y = "0.15*SafezoneH-SafezoneY"; - w = "(3.1/4)*SafezoneH"; - h = "0.7*SafezoneH"; + x = "((safeZoneW -(3.1/4)*safeZoneH)/2) - safeZoneX"; + y = "0.15*safeZoneH-safeZoneY"; + w = "(3.1/4)*safeZoneH"; + h = "0.7*safeZoneH"; }; }; }; - class ACE_TargetingGate : ACE_TargetingConstrains { + class ACE_TargetingGate: ACE_TargetingConstrains { idc = 699200; class Controls { class TargetingGateTL: ACE_TargetingConstrains { - x = "((SafezoneW -(3/4)*SafezoneH)/2) - SafezoneX"; - y = "0.15*SafezoneH - SafezoneY"; + x = "((safeZoneW -(3/4)*safeZoneH)/2) - safeZoneX"; + y = "0.15*safeZoneH - safeZoneY"; idc = 699201; class Controls { class LineH: RscLine { idc = 699210; x = "0"; y = "0"; - w = "0.025*(3/4)*SafezoneH"; + w = "0.025*(3/4)*safeZoneH"; h = "0"; colorText[] = {0.8745,0.8745,0.8745,1}; }; class LineV: LineH { idc = 699211; w = "0"; - h = "0.025*SafezoneH"; + h = "0.025*safeZoneH"; }; }; }; class TargetingGateTR: TargetingGateTL { - x = "((SafezoneW -(3/4)*SafezoneH)/2) - SafezoneX + 0.975*(3/4)*SafezoneH"; - y = "0.15*SafezoneH - SafezoneY"; + x = "((safeZoneW -(3/4)*safeZoneH)/2) - safeZoneX + 0.975*(3/4)*safeZoneH"; + y = "0.15*safeZoneH - safeZoneY"; idc = 699202; class Controls { class LineH: RscLine { idc = 699220; x = "0"; y = "0"; - w = "0.025*(3/4)*SafezoneH"; + w = "0.025*(3/4)*safeZoneH"; h = "0"; colorText[] = {0.8745,0.8745,0.8745,1}; }; class LineV: LineH { idc = 699221; - x = "0.025*(3/4)*SafezoneH"; + x = "0.025*(3/4)*safeZoneH"; w = "0"; - h = "0.025*SafezoneH"; + h = "0.025*safeZoneH"; }; }; }; class TargetingGateBL: TargetingGateTL { - x = "((SafezoneW -(3/4)*SafezoneH)/2) - SafezoneX"; - y = "0.825*SafezoneH - SafezoneY"; + x = "((safeZoneW -(3/4)*safeZoneH)/2) - safeZoneX"; + y = "0.825*safeZoneH - safeZoneY"; idc = 699203; class Controls { class LineH: RscLine { x = "0"; - y = "0.025*SafezoneH"; - w = "0.025*(3/4)*SafezoneH"; + y = "0.025*safeZoneH"; + w = "0.025*(3/4)*safeZoneH"; h = "0"; colorText[] = {0.8745,0.8745,0.8745,1}; }; class LineV: LineH { y = "0"; w = "0"; - h = "0.025*SafezoneH"; + h = "0.025*safeZoneH"; }; }; }; class TargetingGateBR: TargetingGateBL { - x = "((SafezoneW -(3/4)*SafezoneH)/2) - SafezoneX + 0.975*(3/4)*SafezoneH"; - y = "0.825*SafezoneH - SafezoneY"; + x = "((safeZoneW -(3/4)*safeZoneH)/2) - safeZoneX + 0.975*(3/4)*safeZoneH"; + y = "0.825*safeZoneH - safeZoneY"; idc = 699204; class Controls { class LineH: RscLine { x = "0"; - y = "0.025*SafezoneH"; - w = "0.025*(3/4)*SafezoneH"; + y = "0.025*safeZoneH"; + w = "0.025*(3/4)*safeZoneH"; h = "0"; colorText[] = {0.8745,0.8745,0.8745,1}; }; class LineV: LineH { - x = "0.025*(3/4)*SafezoneH"; + x = "0.025*(3/4)*safeZoneH"; y = "0"; w = "0"; - h = "0.025*SafezoneH"; + h = "0.025*safeZoneH"; }; }; }; @@ -408,18 +377,18 @@ class RscInGameUI { class Controls { class LineH: RscLine { idc = 699301; - x = "((SafezoneW -(3/4)*SafezoneH)/2) - SafezoneX"; - y = "0.5*SafezoneH - SafezoneY"; - w = "(3/4)*SafezoneH"; + x = "((safeZoneW -(3/4)*safeZoneH)/2) - safeZoneX"; + y = "0.5*safeZoneH - safeZoneY"; + w = "(3/4)*safeZoneH"; h = "0"; colorText[] = {0.8745,0.8745,0.8745,1}; }; class LineV: RscLine { idc = 699302; - x = "0.5*SafezoneW - SafezoneX"; - y = "0.15*SafezoneH - SafezoneY"; + x = "0.5*safeZoneW - safeZoneX"; + y = "0.15*safeZoneH - safeZoneY"; w = "0"; - h = "0.7*SafezoneH"; + h = "0.7*safeZoneH"; colorText[] = {0.8745,0.8745,0.8745,1}; }; }; @@ -451,4 +420,4 @@ ACE_Titan_TOP_off: 1006 ACE_Titan_DIR: 1007 ACE_Titan_FLTR_mode_off: 1002 ACE_Titan_FLTR_mode: 161 -*/ + */ diff --git a/addons/javelin/XEH_PREP.hpp b/addons/javelin/XEH_PREP.hpp index fe9bbc553b..76d658d90d 100644 --- a/addons/javelin/XEH_PREP.hpp +++ b/addons/javelin/XEH_PREP.hpp @@ -1,11 +1,5 @@ -PREP(lockKeyDown); -PREP(lockKeyUp); - -PREP(cycleFireMode); -PREP(showFireMode); - -PREP(onFired); -PREP(onOpticLoad); +PREP(getTarget); +PREP(mapHelperDraw); PREP(onOpticDraw); -PREP(onOpticUnload); +PREP(showFireMode); diff --git a/addons/javelin/XEH_clientInit.sqf b/addons/javelin/XEH_clientInit.sqf index 1286be3697..66d645968f 100644 --- a/addons/javelin/XEH_clientInit.sqf +++ b/addons/javelin/XEH_clientInit.sqf @@ -1,5 +1,6 @@ +// #define DEBUG_MODE_FULL #include "script_component.hpp" if (!hasInterface) exitWith {}; -#include "initKeybinds.sqf" \ No newline at end of file +#include "initKeybinds.sqf" diff --git a/addons/javelin/XEH_pre_init.sqf b/addons/javelin/XEH_preInit.sqf similarity index 55% rename from addons/javelin/XEH_pre_init.sqf rename to addons/javelin/XEH_preInit.sqf index 27cbb54cfc..b404d35889 100644 --- a/addons/javelin/XEH_pre_init.sqf +++ b/addons/javelin/XEH_preInit.sqf @@ -2,7 +2,9 @@ ADDON = false; +PREP_RECOMPILE_START; #include "XEH_PREP.hpp" +PREP_RECOMPILE_END; GVAR(isLockKeyDown) = false; GVAR(pfehID) = -1; @@ -10,13 +12,13 @@ GVAR(pfehID) = -1; DFUNC(disableFire) = { params ["_firedEH"]; - if(_firedEH < 0 && {difficulty > 0}) then { + if (_firedEH < 0 && {difficulty > 0}) then { _firedEH = [ACE_player, "DefaultAction", {true}, { - _canFire = (_this select 1) getVariable["ace_missileguidance_target", nil]; - if(!isNil "_canFire") exitWith { false }; + private _canFire = (_this select 1) getVariable ["ace_missileguidance_target", nil]; + if (!isNil "_canFire") exitWith { false }; true }] call EFUNC(common,addActionEventHandler); - TRACE_1("added",_firedEH); + TRACE_1("Locking Fire Button",_firedEH); }; _firedEH @@ -24,8 +26,8 @@ DFUNC(disableFire) = { DFUNC(enableFire) = { params ["_firedEH"]; - if(_firedEH >= 0 && {difficulty > 0}) then { - TRACE_1("removing",_firedEH); + if (_firedEH >= 0 && {difficulty > 0}) then { + TRACE_1("Unlocking Fire Button",_firedEH); [ACE_player, "DefaultAction", _firedEH] call EFUNC(common,removeActionEventHandler); }; -1 diff --git a/addons/javelin/functions/fnc_cycleFireMode.sqf b/addons/javelin/functions/fnc_cycleFireMode.sqf deleted file mode 100644 index 50609b3468..0000000000 --- a/addons/javelin/functions/fnc_cycleFireMode.sqf +++ /dev/null @@ -1,13 +0,0 @@ -//#define DEBUG_MODE_FULL -#include "script_component.hpp" -TRACE_1("enter", _this); - -private _currentShooter = if (ACE_player call CBA_fnc_canUseWeapon) then {ACE_player} else {vehicle ACE_player}; -private _currentFireMode = _currentShooter getVariable["ace_missileguidance_attackProfile", "JAV_TOP"]; - -if(_currentFireMode == "JAV_DIR") then { - _currentFireMode = "JAV_TOP"; -} else { - _currentFireMode = "JAV_DIR"; -}; -_currentShooter setVariable["ace_missileguidance_attackProfile", _currentFireMode, false]; diff --git a/addons/javelin/functions/fnc_getTarget.sqf b/addons/javelin/functions/fnc_getTarget.sqf new file mode 100644 index 0000000000..49748e2883 --- /dev/null +++ b/addons/javelin/functions/fnc_getTarget.sqf @@ -0,0 +1,81 @@ +/* + * Author: PabstMirror + * Find a target within the optic range + * + * Arguments: + * 0: Last Target (seeds the scan) + * 1: Max Range (meters) + * + * Return Value: + * Target + * + * Example: + * [bob, 5] call ace_javelin_fnc_getTarget + * + * Public: No + */ +// #define DEBUG_MODE_FULL +#include "script_component.hpp" + +params ["_lastTarget", "_maxRange"]; + +scopeName "main"; + +private _viewASL = AGLtoASL positionCameraToWorld [0,0,0]; +private _viewDir = _viewASL vectorFromTo (AGLtoASL positionCameraToWorld [0,0,1]); + +// Attempt to lock onto current target if it is still valid +if (!isNull _lastTarget) then { + private _aimASL = aimPos _lastTarget; + + if ((_viewASL vectorDistance _aimASL) > _maxRange) exitWith {}; + if ((acos ((_viewASL vectorFromTo _aimASL) vectorDotProduct _viewDir)) > 0.6) exitWith {}; + + private _relAngle = (_lastTarget getRelDir _viewASL); + + for "_xOffset" from -2.5 to 2.5 step 0.5 do { + for "_yOffset" from -2 to 1 step 0.5 do { + // Find test points in the model based on the angle that we are viewing it from (not true 3d projection, but not bad) + private _testPosASL = AGLtoASL (_lastTarget modelToWorld [_xOffset * - cos _relAngle, _xOffset * sin _relAngle, _yOffset]); + private _intersectionsToCursorTarget = lineIntersectsSurfaces [_viewASL, _testPosASL, ace_player, vehicle ace_player, true, 1]; + // drawIcon3D ["\A3\ui_f\data\map\markers\military\dot_CA.paa", [[0,1,1,1], [1,0,1,1]] select (count _intersectionsToCursorTarget), (ASLtoAGL _testPosASL), 0.25, 0.25, 0, "", 0.5, 0.025, "TahomaB"]; + if (!(_intersectionsToCursorTarget isEqualTo [])) then { + (_intersectionsToCursorTarget select 0) params ["", "", "_intersectedObject"]; + if (_intersectedObject isKindOf "AllVehicles") then { + _intersectedObject breakOut "main"; + }; + }; + }; + }; +}; + +// Try cursorObject/Target as they are very fast +if ((cursorObject isKindOf "AllVehicles") && {(cursorObject distance ace_player) < _maxRange}) then { + private _intersectionsToCursorTarget = lineIntersectsSurfaces [_viewASL, aimPos cursorObject, ace_player, cursorObject, true, 1]; + if (_intersectionsToCursorTarget isEqualTo []) then { + cursorObject breakOut "main"; + }; +}; +if ((cursorTarget isKindOf "AllVehicles") && {(cursorObject distance ace_player) < _maxRange}) then { + private _intersectionsToCursorTarget = lineIntersectsSurfaces [_viewASL, aimPos cursorTarget, ace_player, cursorTarget, true, 1]; + if (_intersectionsToCursorTarget isEqualTo []) then { + cursorTarget breakOut "main"; + }; +}; + +// Attempt to scan using multiple rayscasts - This is expensive (n^2) and care should be given to balance accuracy vs speed +for "_xOffset" from -14 to 14 step 2 do { + for "_yOffset" from -12 to 12 step 4 do { + private _testPosASL = AGLtoASL (positionCameraToWorld [_xOffset, _yOffset, _maxRange]); + private _intersectionsToCursorTarget = lineIntersectsSurfaces [_viewASL, _testPosASL, ace_player, vehicle ace_player, true, 1]; + // drawIcon3D ["\A3\ui_f\data\map\markers\military\dot_CA.paa", [[0,1,0,1], [1,0,0,1]] select (count _intersectionsToCursorTarget), (ASLtoAGL _testPosASL), 0.25, 0.25, 0, "", 0.5, 0.025, "TahomaB"]; + if (!(_intersectionsToCursorTarget isEqualTo [])) then { + (_intersectionsToCursorTarget select 0) params ["", "", "_intersectedObject"]; + if (_intersectedObject isKindOf "AllVehicles") then { + _intersectedObject breakOut "main"; + }; + }; + }; +}; + +objNull diff --git a/addons/javelin/functions/fnc_lockKeyDown.sqf b/addons/javelin/functions/fnc_lockKeyDown.sqf deleted file mode 100644 index 3eabbd9c28..0000000000 --- a/addons/javelin/functions/fnc_lockKeyDown.sqf +++ /dev/null @@ -1,3 +0,0 @@ -//#define DEBUG_MODE_FULL -#include "script_component.hpp" -TRACE_1("enter", _this); \ No newline at end of file diff --git a/addons/javelin/functions/fnc_lockKeyUp.sqf b/addons/javelin/functions/fnc_lockKeyUp.sqf deleted file mode 100644 index 3eabbd9c28..0000000000 --- a/addons/javelin/functions/fnc_lockKeyUp.sqf +++ /dev/null @@ -1,3 +0,0 @@ -//#define DEBUG_MODE_FULL -#include "script_component.hpp" -TRACE_1("enter", _this); \ No newline at end of file diff --git a/addons/javelin/functions/fnc_mapHelperDraw.sqf b/addons/javelin/functions/fnc_mapHelperDraw.sqf new file mode 100644 index 0000000000..20ec3ab349 --- /dev/null +++ b/addons/javelin/functions/fnc_mapHelperDraw.sqf @@ -0,0 +1,52 @@ +/* + * Author: PabstMirror + * Handles the map helper's draw event + * Resets arguments if not run recently + * And starts a watchdog to detect when weapon display unloaded + * + * Arguments: + * None + * + * Return Value: + * None + * + * Example: + * [] call ace_javelin_fnc_mapHelperDraw + * + * Public: No + */ +// #define DEBUG_MODE_FULL +#include "script_component.hpp" + +if (isNil QGVAR(arguments)) then { + TRACE_1("Starting optic draw", _this); + + // reset shooter var: + private _currentShooter = if (ACE_player call CBA_fnc_canUseWeapon) then {ACE_player} else {vehicle ACE_player}; + _currentShooter setVariable ["ace_missileguidance_target", nil, false]; + + GVAR(arguments) = [ + diag_frameno, // Last run frame + objNull, // currentTargetObject + 0, // Lock Start Time + 0, // Next Sound timer + -1, // _fireDisabledEH + 0 // _nextTargetScan + ]; + + // Start up a watchdog for when the display is no longer shown (but might not be unloaded or null) + [{ + if (isNull (uiNamespace getVariable ["ACE_RscOptics_javelin", displayNull])) exitWith {true}; + GVAR(arguments) params ["_lastRunFrame"]; + (diag_frameno < _lastRunFrame) || {diag_frameno > (_lastRunFrame + 1)} + }, { + TRACE_1("old/null display - ending optic draw",_this); + private _fireDisabledEH = GVAR(arguments) param [4, -1]; + [_fireDisabledEH] call FUNC(enableFire); + GVAR(arguments) = nil; + }, []] call CBA_fnc_waitUntilAndExecute; +}; + +BEGIN_COUNTER(onOpticDraw); +GVAR(arguments) call FUNC(onOpticDraw); +END_COUNTER(onOpticDraw); diff --git a/addons/javelin/functions/fnc_onFired.sqf b/addons/javelin/functions/fnc_onFired.sqf deleted file mode 100644 index 220ddc37f0..0000000000 --- a/addons/javelin/functions/fnc_onFired.sqf +++ /dev/null @@ -1,15 +0,0 @@ -//#define DEBUG_MODE_FULL -#include "script_component.hpp" - -PARAMS_2(_shooter,_weapon); - -// Bail on not missile or javelin PFEH not running -if ((_shooter != ACE_player) || {(GVAR(pfehID) == -1)}) exitWith { false }; - -private _configs = configProperties [configFile >> "CfgWeapons" >> _weapon, QUOTE(configName _x == QUOTE(QGVAR(enabled))), false]; -if (((count _configs) < 1) || {(getNumber (_configs select 0)) != 1}) exitWith {}; - -__JavelinIGUITargeting ctrlShow false; -__JavelinIGUITargetingGate ctrlShow false; -__JavelinIGUITargetingLines ctrlShow false; -__JavelinIGUITargetingConstraints ctrlShow false; diff --git a/addons/javelin/functions/fnc_onOpticDraw.sqf b/addons/javelin/functions/fnc_onOpticDraw.sqf index dede3ae69c..8a473669f9 100644 --- a/addons/javelin/functions/fnc_onOpticDraw.sqf +++ b/addons/javelin/functions/fnc_onOpticDraw.sqf @@ -1,69 +1,67 @@ -//#define DEBUG_MODE_FULL +/* + * Author: jaynus, PabstMirror + * Main loop, handles scaning for targets and drawing the javelin optic + * + * Arguments: + * 0: Last run frame + * 0: Current target (what we locked last run) + * 0: Lock start time (cba mission time) + * 0: Next sound play time (ticktime) + * 0: Next target scan (ticktime) + * + * Return Value: + * None + * + * Example: + * [] call ace_javelin_fnc_mapHelperDraw + * + * Public: No + */ +// #define DEBUG_MODE_FULL #include "script_component.hpp" -TRACE_1("enter", _this); -#define __TRACKINTERVAL 0 // how frequent the check should be. -#define __LOCKONTIME 3 // Lock on won't occur sooner +// TRACE_1("onOpticDraw",diag_frameno); -private ["_apos", "_aposX", "_aposY", "_args", "_boundsInput", "_bpos", "_canFire", "_constraintBottom"]; -private ["_constraintLeft", "_constraintRight", "_constraintTop", "_currentTarget", "_fireDisabledEH"]; -private ["_firedEH", "_fov", "_lastTick", "_lockTime", "_maxX", "_maxY", "_minX", "_minY", "_newTarget"]; -private ["_offsetX", "_offsetY", "_pos", "_randomLockInterval", "_randomPosWithinBounds", "_range"]; -private ["_runTime", "_soundTime", "_targetArray", "_zamerny", "_currentShooter"]; - -_currentShooter = if (ACE_player call CBA_fnc_canUseWeapon) then {ACE_player} else {vehicle ACE_player}; - -#define __OffsetX ((ctrlPosition __JavelinIGUITargetingLineV) select 0) - 0.5 -#define __OffsetY ((ctrlPosition __JavelinIGUITargetingLineH) select 1) - 0.5 - -// Reset arguments if we havnt rendered in over a second -_args = uiNamespace getVariable[QGVAR(arguments), [] ]; -if( (count _args) > 0) then { - _lastTick = _args select 0; - if(diag_tickTime - _lastTick > 1) then { - [] call FUNC(onOpticLoad); - }; -}; - -TRACE_1("Running", "Running"); +#define __TRACKINTERVAL 0 // how frequent the ui update should be. +#define __SCANNTERVAL 0.05 // how frequent the target scan check should be. +#define __LOCKONTIME 3 // Lock on won't occur sooner // Pull the arguments -_currentTarget = _args select 1; -_runTime = _args select 2; -_lockTime = _args select 3; -_soundTime = _args select 4; -_randomLockInterval = _args select 5; -_fireDisabledEH = _args select 6; +params ["_lastRunFrame", "_currentTarget", "_lockStartTime", "_soundNextPlayTime", "_fireDisabledEH", "_nextTargetScan"]; -private ["_ammo", "_magazineConfig", "_weaponConfig"]; -_weaponConfig = configProperties [configFile >> "CfgWeapons" >> (currentWeapon _currentShooter), QUOTE(configName _x == QUOTE(QGVAR(enabled))), false]; -_magazineConfig = if ((currentMagazine _currentShooter) != "") then { - _ammo = getText (configFile >> "CfgMagazines" >> (currentMagazine _currentShooter) >> "ammo"); - configProperties [(configFile >> "CfgAmmo" >> _ammo), "(configName _x) == 'ace_missileguidance'", false]; +// Get shooter info +private _currentShooter = if (ACE_player call CBA_fnc_canUseWeapon) then {ACE_player} else {vehicle ACE_player}; +private _currentWeapon = currentWeapon _currentShooter; +private _currentMagazine = currentMagazine _currentShooter; + +// Get weapon / ammo configs +private _ammoCount = _currentShooter ammo _currentWeapon; +private _weaponConfig = configProperties [configFile >> "CfgWeapons" >> _currentWeapon, QUOTE(configName _x == QUOTE(QGVAR(enabled))), false]; +private _ammoConfig = if (_currentMagazine != "") then { + private _ammoType = getText (configFile >> "CfgMagazines" >> _currentMagazine >> "ammo"); + configProperties [(configFile >> "CfgAmmo" >> _ammoType), "(configName _x) == 'ace_missileguidance'", false]; } else { [] }; -//If weapon does not have "javelin enabled", then exit PFEH -if (((count _weaponConfig) < 1) || {(getNumber (_weaponConfig select 0)) != 1}) exitWith { +// Check if loaded and javelin enabled for wepaon and missile guidance enabled for loaded ammo +if ((_ammoCount == 0) || // No ammo loaded + {(count _weaponConfig) < 1} || {(getNumber (_weaponConfig select 0)) != 1} || // Not enabled for weapon + {(count _ammoConfig) < 1} || {(getNumber ((_ammoConfig select 0) >> "enabled")) != 1} // Not enabled for ammo + ) exitWith { + __JavelinIGUITargeting ctrlShow false; - __JavelinIGUITargetingGate ctrlShow false; - __JavelinIGUITargetingLines ctrlShow false; - __JavelinIGUITargetingConstraints ctrlShow false; + __JavelinIGUISeek ctrlSetTextColor __ColorGray; - if(!isNil "_fireDisabledEH") then { - _fireDisabledEH = [_fireDisabledEH] call FUNC(enableFire); - }; - - [(_this select 1)] call CBA_fnc_removePerFrameHandler; - GVAR(pfehID) = -1; + _fireDisabledEH = [_fireDisabledEH] call FUNC(enableFire); + _this set [0, diag_frameno]; + _this set [4, _fireDisabledEH]; }; -// Find a target within the optic range -_newTarget = objNull; -// Bail on fast movement -if ((velocity ACE_player) distance [0,0,0] > 0.5 && {cameraView == "GUNNER"} && {cameraOn == ACE_player}) exitWith { // keep it steady. +// Bail on fast movement (keep it steady) +if ((velocity ACE_player) distance [0,0,0] > 0.75 && {cameraView == "GUNNER"} && {cameraOn == ACE_player}) exitWith { + TRACE_1("exiting gunner because movement",velocity ACE_player); ACE_player switchCamera "INTERNAL"; if (player != ACE_player) then { TRACE_2("Zeus, manually reseting RC after switchCamera",player,ACE_player); @@ -71,222 +69,122 @@ if ((velocity ACE_player) distance [0,0,0] > 0.5 && {cameraView == "GUNNER"} && }; }; -// Refresh the firemode +// Refresh the firemode (top/dir) [] call FUNC(showFireMode); -_ammo = _currentShooter ammo (currentWeapon _currentShooter); -// not loaded or not "javelin enabled" for magazine, hide targeting and enable firing -if ((_ammo == 0) || {(count _magazineConfig) < 1} || {(getNumber ((_magazineConfig select 0) >> "enabled")) != 1}) exitWith { +// Get UI constants +private _offsetX = 0.5 * safeZoneW - safeZoneX - 0.5; +private _offsetY = 0.5 * safeZoneH - safeZoneY - 0.5; + +private _newTarget = objNull; +if (GVAR(isLockKeyDown) && {cameraView == "GUNNER"} && {(currentVisionMode ACE_player) == 2}) then { + // Attempting to lock; getTarget can be expensive so it's rate is limited + if (diag_tickTime > _nextTargetScan) then { + BEGIN_COUNTER(getTarget); + _newTarget = [_currentTarget, 2500, 0.6] call FUNC(getTarget); + END_COUNTER(getTarget); + _nextTargetScan = diag_tickTime + __SCANNTERVAL; + } else { + _newTarget = _currentTarget; + }; + + // Show gate box + private _boundsInput = if (_currentTarget isKindOf "CAManBase") then { + [_currentTarget,[-0.5,-0.5,-0.25],[0,0,0]]; + } else { + [_currentTarget,[-1,-1,-1],_currentTarget selectionPosition "zamerny"]; + }; + + private _bpos = _boundsInput call EFUNC(common,worldToScreenBounds); + + private _lockTime = if (isNull _currentTarget) then {0} else {CBA_missionTime - _lockStartTime}; + private _minX = ((linearConversion [1, (__LOCKONTIME - 0.5), _lockTime, 0.5 - 0.075*safeZoneW, (_bpos select 0), true]) + _offsetX) max __ConstraintLeft; + private _minY = ((linearConversion [1, (__LOCKONTIME - 0.5), _lockTime, 0.5 - 0.075*safeZoneH, (_bpos select 1), true]) + _offsetY) max __ConstraintTop; + private _maxX = (((linearConversion [1, (__LOCKONTIME - 0.5), _lockTime, 0.5 + 0.075*safeZoneW, (_bpos select 2), true]) + _offsetX) min __ConstraintRight) - (0.025 * (3 / 4) * safeZoneH); + private _maxY = (((linearConversion [1, (__LOCKONTIME - 0.5), _lockTime, 0.5 + 0.075*safeZoneH, (_bpos select 3), true]) + _offsetY) min __ConstraintBottom) - (0.025 * safeZoneH); + + // TRACE_3("",_boundsInput,_bpos,_lockTime); + // TRACE_4("",_minX,_maxX,_minY,_maxY); + + __JavelinIGUITargetingGateTL ctrlSetPosition [_minX, _minY]; + __JavelinIGUITargetingGateTR ctrlSetPosition [_maxX, _minY]; + __JavelinIGUITargetingGateBL ctrlSetPosition [_minX, _maxY]; + __JavelinIGUITargetingGateBR ctrlSetPosition [_maxX, _maxY]; + {_x ctrlCommit __TRACKINTERVAL} forEach [__JavelinIGUITargetingGateTL, __JavelinIGUITargetingGateTR, __JavelinIGUITargetingGateBL, __JavelinIGUITargetingGateBR]; + + __JavelinIGUITargeting ctrlShow true; + __JavelinIGUITargetingGate ctrlShow true; +} else { + // Not trying to lock __JavelinIGUITargeting ctrlShow false; __JavelinIGUITargetingGate ctrlShow false; __JavelinIGUITargetingLines ctrlShow false; - __JavelinIGUITargetingConstraints ctrlShow false; - - if(!isNil "_fireDisabledEH") then { - _fireDisabledEH = [_fireDisabledEH] call FUNC(enableFire); - }; -}; - -_range = parseNumber (ctrlText __JavelinIGUIRangefinder); -TRACE_1("Viewing range", _range); -if (_range > 50 && {_range < 2500}) then { - _pos = positionCameraToWorld [0,0,_range]; - _targetArray = _pos nearEntities ["AllVehicles", _range/100]; - TRACE_1("Searching at range", _targetArray); - if (count (_targetArray) > 0) then { - _newTarget = _targetArray select 0; - }; -}; - -if ((isNull _newTarget) && {cursorObject isKindOf "AllVehicles"}) then { - private _intersectionsToCursorTarget = lineIntersectsSurfaces [(AGLtoASL positionCameraToWorld [0,0,0]), aimPos cursorObject, ace_player, cursorObject, true, 1]; - if (_intersectionsToCursorTarget isEqualTo []) then { - _newTarget = cursorObject; - }; -}; -if ((isNull _newTarget) && {cursorTarget isKindOf "AllVehicles"}) then { - private _intersectionsToCursorTarget = lineIntersectsSurfaces [(AGLtoASL positionCameraToWorld [0,0,0]), aimPos cursorTarget, ace_player, cursorTarget, true, 1]; - if (_intersectionsToCursorTarget isEqualTo []) then { - _newTarget = cursorTarget; - }; -}; - -// Create constants -_constraintTop = __ConstraintTop; -_constraintLeft = __ConstraintLeft; -_constraintBottom = __ConstraintBottom; -_constraintRight = __ConstraintRight; - -_offsetX = __OffsetX; -_offsetY = __OffsetY; - -__JavelinIGUITargeting ctrlShow true; -__JavelinIGUITargetingConstrains ctrlShow true; - -_zamerny = _currentTarget selectionPosition (["zamerny", "body"] select (_currentTarget isKindOf "CAManBase")); -_randomPosWithinBounds = [(_zamerny select 0) + 1 - (random 2.0),(_zamerny select 1) + 1 - (random 2.0),(_zamerny select 2) + 0.5 - (random 1.0)]; - -_apos = worldToScreen (_currentTarget modelToWorld _randomPosWithinBounds); - -_aposX = 0; -_aposY = 0; -if (count _apos < 2) then { - _aposX = 1; - _aposY = 0; -} else { - _aposX = (_apos select 0) + _offsetX; - _aposY = (_apos select 1) + _offsetY; -}; - -if((call CBA_fnc_getFoV) select 1 > 9) then { - __JavelinIGUINFOV ctrlSetTextColor __ColorGreen; - __JavelinIGUIWFOV ctrlSetTextColor __ColorGray; -} else { - __JavelinIGUINFOV ctrlSetTextColor __ColorGray; - __JavelinIGUIWFOV ctrlSetTextColor __ColorGreen; }; if (isNull _newTarget) then { - // No targets found + // No target found _currentTarget = objNull; - _lockTime = 0; - + _lockStartTime = 0; __JavelinIGUISeek ctrlSetTextColor __ColorGray; - __JavelinIGUITargeting ctrlShow false; - __JavelinIGUITargetingGate ctrlShow false; + _currentShooter setVariable ["ace_missileguidance_target", nil, false]; + __JavelinIGUITargetingLines ctrlShow false; - __JavelinIGUITargetingConstraints ctrlShow false; - - _currentShooter setVariable ["ace_missileguidance_target",nil, false]; - + // Disallow fire _fireDisabledEH = [_fireDisabledEH] call FUNC(disableFire); } else { - _fov = [] call CBA_fnc_getFoV; - TRACE_1("FOV", _fov); - if (_newTarget distance ACE_player < 2500 - && {(call CBA_fnc_getFoV) select 1 > 9} - && { (currentVisionMode ACE_player == 2)} - && GVAR(isLockKeyDown) - ) then { - // Lock on after 3 seconds - if(_currentTarget != _newTarget) then { - TRACE_1("New Target, reseting locking", _newTarget); - _lockTime = diag_tickTime; - _currentTarget = _newTarget; + if ((!isNull _newTarget) && {_currentTarget != _newTarget}) then { + TRACE_1("New Target, reseting locking", _newTarget); + _lockStartTime = CBA_missionTime; + _currentTarget = _newTarget; + }; - playSound "ACE_Javelin_Locking"; - } else { - if(diag_tickTime - _lockTime > __LOCKONTIME + _randomLockInterval) then { - TRACE_2("LOCKED!", _currentTarget, _lockTime); + if ((CBA_missionTime - _lockStartTime) > __LOCKONTIME) then { // Lock on after 3 seconds + TRACE_2("LOCKED!", _currentTarget, _lockStartTime); + __JavelinIGUISeek ctrlSetTextColor __ColorGreen; + __JavelinIGUITargetingLines ctrlShow true; - __JavelinIGUISeek ctrlSetTextColor __ColorGreen; + // Move target marker (the crosshair) to aimpoint on the target + private _aimPointOnTarget = _currentTarget selectionPosition (["zamerny", "body"] select (_currentTarget isKindOf "CAManBase")); + (worldToScreen (_currentTarget modelToWorld _aimPointOnTarget)) params [["_aposX", 0.5], ["_aposY", 0.5]]; + private _ctrlPos = ctrlPosition __JavelinIGUITargetingLineV; + _ctrlPos set [0, _aposX + _offsetX]; + __JavelinIGUITargetingLineV ctrlSetPosition _ctrlPos; + __JavelinIGUITargetingLineV ctrlCommit __TRACKINTERVAL; + _ctrlPos = ctrlPosition __JavelinIGUITargetingLineH; + _ctrlPos set [1, _aposY + _offsetY]; + __JavelinIGUITargetingLineH ctrlSetPosition _ctrlPos; + __JavelinIGUITargetingLineH ctrlCommit __TRACKINTERVAL; - __JavelinIGUITargeting ctrlShow true; - __JavelinIGUITargetingConstrains ctrlShow false; - __JavelinIGUITargetingGate ctrlShow true; - __JavelinIGUITargetingLines ctrlShow true; + _currentShooter setVariable ["ace_missileguidance_target", _currentTarget, false]; - // Move target marker to coords. - //__JavelinIGUITargetingLineV ctrlSetPosition [_aposX,ctrlPosition __JavelinIGUITargetingLineV select 1]; - //__JavelinIGUITargetingLineH ctrlSetPosition [ctrlPosition __JavelinIGUITargetingLineH select 0,_aposY]; - //{_x ctrlCommit __TRACKINTERVAL} forEach [__JavelinIGUITargetingLineH,__JavelinIGUITargetingLineV]; + // Allow fire + _fireDisabledEH = [_fireDisabledEH] call FUNC(enableFire); - _boundsInput = if (_currentTarget isKindOf "CAManBase") then { - [_currentTarget,[-1,-1,-2],_currentTarget selectionPosition "body"]; - } else { - [_currentTarget,[-1,-1,-2],_currentTarget selectionPosition "zamerny"]; - }; - - _bpos = _boundsInput call EFUNC(common,worldToScreenBounds); - - _minX = ((_bpos select 0) + _offsetX) max _constraintLeft; - _minY = ((_bpos select 1) + _offsetY) max _constraintTop; - _maxX = ((_bpos select 2) + _offsetX) min (_constraintRight - 0.025 * (3 / 4) * SafezoneH); - _maxY = ((_bpos select 3) + _offsetY) min (_constraintBottom - 0.025 * SafezoneH); - - TRACE_4("", _boundsInput, _bpos, _minX, _minY); - - __JavelinIGUITargetingGateTL ctrlSetPosition [_minX, _minY]; - __JavelinIGUITargetingGateTR ctrlSetPosition [_maxX, _minY]; - __JavelinIGUITargetingGateBL ctrlSetPosition [_minX, _maxY]; - __JavelinIGUITargetingGateBR ctrlSetPosition [_maxX, _maxY]; - - {_x ctrlCommit __TRACKINTERVAL} forEach [__JavelinIGUITargetingGateTL, __JavelinIGUITargetingGateTR, __JavelinIGUITargetingGateBL, __JavelinIGUITargetingGateBR]; - - _currentShooter setVariable["ace_missileguidance_target", _currentTarget, false]; - - // Allow fire - _fireDisabledEH = [_fireDisabledEH] call FUNC(enableFire); - - if(diag_tickTime > _soundTime) then { - playSound "ACE_Javelin_Locked"; - _soundTime = diag_tickTime + 0.25; - }; - } else { - __JavelinIGUITargeting ctrlShow true; - __JavelinIGUITargetingGate ctrlShow true; - __JavelinIGUITargetingConstrains ctrlShow true; - __JavelinIGUITargetingLines ctrlShow false; - - _currentShooter setVariable["ace_missileguidance_target", nil, false]; - - _boundsInput = if (_currentTarget isKindOf "CAManBase") then { - [_newTarget,[-1,-1,-2],_currentTarget selectionPosition "body"]; - } else { - [_newTarget,[-1,-1,-1],_currentTarget selectionPosition "zamerny"]; - }; - - _bpos = _boundsInput call EFUNC(common,worldToScreenBounds); - - _minX = ((_bpos select 0) + _offsetX) max _constraintLeft; - _minY = ((_bpos select 1) + _offsetY) max _constraintTop; - _maxX = ((_bpos select 2) + _offsetX) min (_constraintRight - 0.025 * (3 / 4) * SafezoneH); - _maxY = ((_bpos select 3) + _offsetY) min (_constraintBottom - 0.025 * SafezoneH); - - TRACE_4("", _boundsInput, _bpos, _minX, _minY); - - __JavelinIGUITargetingGateTL ctrlSetPosition [_minX,_minY]; - __JavelinIGUITargetingGateTR ctrlSetPosition [_maxX,_minY]; - __JavelinIGUITargetingGateBL ctrlSetPosition [_minX,_maxY]; - __JavelinIGUITargetingGateBR ctrlSetPosition [_maxX,_maxY]; - - {_x ctrlCommit __TRACKINTERVAL} forEach [__JavelinIGUITargetingGateTL,__JavelinIGUITargetingGateTR,__JavelinIGUITargetingGateBL,__JavelinIGUITargetingGateBR]; - - if(diag_tickTime > _soundTime) then { - playSound "ACE_Javelin_Locking"; - _soundTime = diag_tickTime + 0.25; - }; - // Disallow fire - _fireDisabledEH = [_fireDisabledEH] call FUNC(disableFire); - }; + if (diag_tickTime > _soundNextPlayTime) then { + playSound "ACE_Javelin_Locked"; + _soundNextPlayTime = diag_tickTime + 0.25; }; } else { - // No targets found - _currentTarget = objNull; - _lockTime = 0; - + // Lock in progress __JavelinIGUISeek ctrlSetTextColor __ColorGray; - __JavelinIGUITargeting ctrlShow false; - __JavelinIGUITargetingGate ctrlShow false; __JavelinIGUITargetingLines ctrlShow false; - __JavelinIGUITargetingConstraints ctrlShow false; _currentShooter setVariable ["ace_missileguidance_target", nil, false]; + if (diag_tickTime > _soundNextPlayTime) then { + playSound "ACE_Javelin_Locking"; + _soundNextPlayTime = diag_tickTime + 0.25; + }; // Disallow fire _fireDisabledEH = [_fireDisabledEH] call FUNC(disableFire); }; }; -//TRACE_2("", _newTarget, _currentTarget); - // Save arguments for next run -_args set[0, diag_tickTime]; -_args set[1, _currentTarget]; -_args set[2, _runTime]; -_args set[3, _lockTime]; -_args set[4, _soundTime]; -_args set[6, _fireDisabledEH]; - -uiNamespace setVariable[QGVAR(arguments), _args ]; +_this set [0, diag_frameno]; +_this set [1, _currentTarget]; +_this set [2, _lockStartTime]; +_this set [3, _soundNextPlayTime]; +_this set [4, _fireDisabledEH]; +_this set [5, _nextTargetScan]; diff --git a/addons/javelin/functions/fnc_onOpticLoad.sqf b/addons/javelin/functions/fnc_onOpticLoad.sqf deleted file mode 100644 index 5148ca983f..0000000000 --- a/addons/javelin/functions/fnc_onOpticLoad.sqf +++ /dev/null @@ -1,39 +0,0 @@ -//#define DEBUG_MODE_FULL -#include "script_component.hpp" -TRACE_1("enter", _this); - -#define __LOCKONTIMERANDOM 1 // Deviation in lock on time - -if((count _this) > 0) then { - uiNameSpace setVariable ['ACE_RscOptics_javelin',_this select 0]; -}; - -private _currentShooter = if (ACE_player call CBA_fnc_canUseWeapon) then {ACE_player} else {vehicle ACE_player}; -TRACE_2("shooter",_currentShooter,typeOf _currentShooter); -_currentShooter setVariable ["ace_missileguidance_target", nil, false]; - -__JavelinIGUISeek ctrlSetTextColor __ColorGray; -__JavelinIGUINFOV ctrlSetTextColor __ColorGray; - -__JavelinIGUITargeting ctrlShow false; -__JavelinIGUITargetingConstrains ctrlShow false; -__JavelinIGUITargetingGate ctrlShow false; -__JavelinIGUITargetingLines ctrlShow false; - -if(GVAR(pfehID) != -1) then { - [] call FUNC(onOpticUnload); // Unload optic if it was already loaded -}; - -uiNameSpace setVariable [QGVAR(arguments), - [ - diag_tickTime, // Last runtime - objNull, // currentTargetObject - 0, // Run Time - 0, // Lock Time - 0, // Sound timer - (random __LOCKONTIMERANDOM), // random lock time addition - -1 - ] -]; - -GVAR(pfehID) = [FUNC(onOpticDraw), 0, []] call CBA_fnc_addPerFrameHandler; diff --git a/addons/javelin/functions/fnc_onOpticUnload.sqf b/addons/javelin/functions/fnc_onOpticUnload.sqf deleted file mode 100644 index 221fe3b5f6..0000000000 --- a/addons/javelin/functions/fnc_onOpticUnload.sqf +++ /dev/null @@ -1,20 +0,0 @@ -//#define DEBUG_MODE_FULL -#include "script_component.hpp" -TRACE_1("enter", _this); -private ["_args", "_disableFireEH"]; - -// uiNameSpace setVariable ['ACE_RscOptics_javelin',nil]; - -if(GVAR(pfehID) != -1) then { - [GVAR(pfehID)] call CBA_fnc_removePerFrameHandler; - GVAR(pfehID) = -1; -}; - -_args = uiNamespace getVariable[QGVAR(arguments), nil ]; -if(!isNil "_args") then { - _disableFireEH = _args select 6; - if(_disableFireEH > 0 && difficulty > 0) then { - [ACE_player, "DefaultAction", _disableFireEH] call EFUNC(common,removeActionEventHandler); - }; - uiNameSpace setVariable [QGVAR(arguments),nil]; -}; diff --git a/addons/javelin/functions/fnc_showFireMode.sqf b/addons/javelin/functions/fnc_showFireMode.sqf index 95dd038b92..525289d031 100644 --- a/addons/javelin/functions/fnc_showFireMode.sqf +++ b/addons/javelin/functions/fnc_showFireMode.sqf @@ -1,11 +1,27 @@ +/* + * Author: jaynus + * Updates fire mode on javelin display (top/dir) + * + * Arguments: + * None + * + * Return Value: + * None + * + * Example: + * [] call ace_javelin_fnc_showFireMode + * + * Public: No + */ //#define DEBUG_MODE_FULL #include "script_component.hpp" -TRACE_1("enter", _this); private _currentShooter = if (ACE_player call CBA_fnc_canUseWeapon) then {ACE_player} else {vehicle ACE_player}; private _currentFireMode = _currentShooter getVariable ["ace_missileguidance_attackProfile", "JAV_TOP"]; -if(_currentFireMode == "JAV_TOP") then { +TRACE_1("showFireMode", _currentFireMode); + +if (_currentFireMode == "JAV_TOP") then { __JavelinIGUITop ctrlSetTextColor __ColorGreen; __JavelinIGUIDir ctrlSetTextColor __ColorGray; } else { diff --git a/addons/javelin/initKeybinds.sqf b/addons/javelin/initKeybinds.sqf index cbfafa326d..7652f2fd57 100644 --- a/addons/javelin/initKeybinds.sqf +++ b/addons/javelin/initKeybinds.sqf @@ -5,26 +5,16 @@ if (GETGVAR(isLockKeyDown,false)) exitWith {false}; GVAR(isLockKeyDown) = true; + TRACE_1("lock key down",GVAR(isLockKeyDown)); - // Statement - [ACE_player] call FUNC(lockKeyDown); // Return false so it doesn't block the rest weapon action false }, { // prevent holding down GVAR(isLockKeyDown) = false; + TRACE_1("lock key up",GVAR(isLockKeyDown)); - // Statement - [ACE_player] call FUNC(lockKeyUp); false }, [15, [false, false, false]], false] call CBA_fnc_addKeybind; //Tab Key - -["ACE3 Weapons", QGVAR(cycleFireMode), localize LSTRING(CycleFireMode), -{ false }, -{ - [ACE_player] call FUNC(cycleFireMode); - false -}, -[15, [false, true, false]], false] call CBA_fnc_addKeybind; //Ctrl+Tab Key \ No newline at end of file diff --git a/addons/javelin/script_component.hpp b/addons/javelin/script_component.hpp index 4b1a66efdb..b78032439d 100644 --- a/addons/javelin/script_component.hpp +++ b/addons/javelin/script_component.hpp @@ -16,9 +16,6 @@ #include "\z\ace\addons\main\script_macros.hpp" -#define ACE_JAV_FIREMODE_DIR 1 -#define ACE_JAV_FIREMODE_TOP 2 - // Javelin IGUI defines #define __JavelinIGUI (uinamespace getVariable "ACE_RscOptics_javelin") @@ -29,8 +26,6 @@ #define __JavelinIGUISeek (__JavelinIGUI displayCtrl 699000) #define __JavelinIGUITop (__JavelinIGUI displayCtrl 699001) #define __JavelinIGUIDir (__JavelinIGUI displayCtrl 699002) -#define __JavelinIGUINFOV (__JavelinIGUI displayCtrl 1003) -#define __JavelinIGUIWFOV (__JavelinIGUI displayCtrl 1004) #define __JavelinIGUIRangefinder (__JavelinIGUI displayCtrl 151) // Constrains diff --git a/addons/javelin/stringtable.xml b/addons/javelin/stringtable.xml index 2e3c5bba32..96dc8d33ee 100644 --- a/addons/javelin/stringtable.xml +++ b/addons/javelin/stringtable.xml @@ -1,4 +1,4 @@ - + @@ -9,23 +9,13 @@ Namierz cel (przytrzymaj) Verrouiller la cible (maintenir) Célpontra állás (Lenyomva tartott) - Aggangia il bersagio + Aggangia il bersaglio Fijar objetivo (Mantener) Travar Alvo(Segurar) 目標を捕捉 (押しっぱ) - - - Cycle Fire Mode - Wechsle Feuermodus - Переключение режимов огня - Přepínání režimů palby - Przełącz tryb ognia - Cycle mode de tir - Tüzelési mód váltása - Alterna le modalità di fuoco - Cambiar modo de disparo - Alterar Modo de Disparo - 発射モード切り替え + 표적 획득 (누르기) + 锁定目标 (按住) + 鎖定目標 (按住) - \ No newline at end of file + diff --git a/addons/kestrel4500/CfgWeapons.hpp b/addons/kestrel4500/CfgWeapons.hpp index 8b318994a2..ea9cd2ab2f 100644 --- a/addons/kestrel4500/CfgWeapons.hpp +++ b/addons/kestrel4500/CfgWeapons.hpp @@ -1,7 +1,7 @@ class CfgWeapons { class ACE_ItemCore; - class InventoryItem_Base_F; + class CBA_MiscItem_ItemInfo; class ACE_Kestrel4500: ACE_ItemCore { author = ECSTRING(common,ACETeam); @@ -13,7 +13,7 @@ class CfgWeapons { icon = "iconObject_circle"; mapSize = 0.034; - class ItemInfo: InventoryItem_Base_F { + class ItemInfo: CBA_MiscItem_ItemInfo { mass = 2; }; }; diff --git a/addons/kestrel4500/XEH_preInit.sqf b/addons/kestrel4500/XEH_preInit.sqf index a7feade1c3..b47cf6628d 100644 --- a/addons/kestrel4500/XEH_preInit.sqf +++ b/addons/kestrel4500/XEH_preInit.sqf @@ -2,6 +2,8 @@ ADDON = false; +PREP_RECOMPILE_START; #include "XEH_PREP.hpp" +PREP_RECOMPILE_END; ADDON = true; diff --git a/addons/kestrel4500/functions/fnc_collectData.sqf b/addons/kestrel4500/functions/fnc_collectData.sqf index 2e25fbcf60..703c07797e 100644 --- a/addons/kestrel4500/functions/fnc_collectData.sqf +++ b/addons/kestrel4500/functions/fnc_collectData.sqf @@ -15,19 +15,18 @@ */ #include "script_component.hpp" -private ["_playerDir", "_playerAltitude", "_temperature", "_humidity", "_barometricPressure", "_altitude", "_airDensity", "_densityAltitude", "_chill", "_heatIndex", "_dewPoint", "_wetBulb", "_windSpeed", "_crosswind", "_headwind"]; -_playerDir = getDir ACE_player; -_playerAltitude = (getPosASL ACE_player) select 2; -_temperature = _playerAltitude call EFUNC(weather,calculateTemperatureAtHeight); -_humidity = EGVAR(weather,currentHumidity); -_barometricPressure = _playerAltitude call EFUNC(weather,calculateBarometricPressure); -_altitude = EGVAR(common,mapAltitude) + _playerAltitude; -_airDensity = [_temperature, _barometricPressure, _humidity] call EFUNC(weather,calculateAirDensity); -_densityAltitude = _airDensity call EFUNC(weather,calculateDensityAltitude); -_chill = [_temperature, _humidity] call EFUNC(weather,calculateWindChill); -_heatIndex = [_temperature, _humidity] call EFUNC(weather,calculateHeatIndex); -_dewPoint = [_temperature, _humidity] call EFUNC(weather,calculateDewPoint); -_wetBulb = [_temperature, _barometricPressure, _humidity] call EFUNC(weather,calculateWetBulb); +private _playerDir = getDir ACE_player; +private _playerAltitude = (getPosASL ACE_player) select 2; +private _temperature = _playerAltitude call EFUNC(weather,calculateTemperatureAtHeight); +private _humidity = EGVAR(weather,currentHumidity); +private _barometricPressure = _playerAltitude call EFUNC(weather,calculateBarometricPressure); +private _altitude = EGVAR(common,mapAltitude) + _playerAltitude; +private _airDensity = [_temperature, _barometricPressure, _humidity] call EFUNC(weather,calculateAirDensity); +private _densityAltitude = _airDensity call EFUNC(weather,calculateDensityAltitude); +private _chill = [_temperature, _humidity] call EFUNC(weather,calculateWindChill); +private _heatIndex = [_temperature, _humidity] call EFUNC(weather,calculateHeatIndex); +private _dewPoint = [_temperature, _humidity] call EFUNC(weather,calculateDewPoint); +private _wetBulb = [_temperature, _barometricPressure, _humidity] call EFUNC(weather,calculateWetBulb); if (isNil QGVAR(MIN) || isNil QGVAR(MAX)) then { GVAR(MIN) = [0, _playerDir, 0, 0, 0, _temperature, _chill, _humidity, _heatIndex, _dewPoint, _wetBulb, _barometricPressure, _altitude, _densityAltitude]; @@ -47,11 +46,11 @@ if (GVAR(MinAvgMaxMode) == 1) then { } count [2, 3, 4]; // Wind SPD - _windSpeed = call FUNC(measureWindSpeed); + private _windSpeed = call FUNC(measureWindSpeed); [2, _windSpeed] call FUNC(updateMemory); // CROSSWIND - _crosswind = 0; + private _crosswind = 0; if (missionNamespace getVariable [QEGVAR(advanced_ballistics,enabled), false]) then { _crosswind = abs(sin(GVAR(RefHeading) - _playerDir) * _windSpeed); } else { @@ -60,7 +59,7 @@ if (GVAR(MinAvgMaxMode) == 1) then { [3, _crosswind] call FUNC(updateMemory); // HEADWIND - _headwind = 0; + private _headwind = 0; if (missionNamespace getVariable [QEGVAR(advanced_ballistics,enabled), false]) then { _headwind = cos(GVAR(RefHeading) - _playerDir) * _windSpeed; } else { diff --git a/addons/kestrel4500/functions/fnc_generateOutputData.sqf b/addons/kestrel4500/functions/fnc_generateOutputData.sqf index c3bce5efa2..fae8575e21 100644 --- a/addons/kestrel4500/functions/fnc_generateOutputData.sqf +++ b/addons/kestrel4500/functions/fnc_generateOutputData.sqf @@ -33,48 +33,46 @@ if (diag_tickTime - GVAR(headingSetDisplayTimer) < 0.8) exitWith {["", "", " Heading Set", "", "", "", "", "", "", "", "", "", "", "", "", "", "", ""]}; -private ["_playerDir", "_playerAltitude", "_temperature", "_humidity", "_barometricPressure", "_airDensity", "_densityAltitude", "_chill", "_heatIndex", "_dewPoint", "_wetBulb", "_dayString", "_monthString", "_windSpeed", "_windDir", "_textTop", "_textCenterBig", "_textCenter", "_textCenterLine1Left", "_textCenterLine2Left", "_textCenterLine3Left", "_textCenterLine1Right", "_textCenterLine2Right", "_textCenterLine3Right", "_textInfoLine1", "_textInfoLine2", "_textBottomBig", "_textCenterLine1", "_textCenterLine2", "_textCenterLine3", "_textCenterLine4", "_textCenterLine5", "_textCenterLine6"]; - [] call FUNC(collectData); -_textTop = GVAR(Menus) select GVAR(Menu); -_textCenterBig = ""; -_textCenter = ""; +private _textTop = GVAR(Menus) select GVAR(Menu); +private _textCenterBig = ""; +private _textCenter = ""; -_textCenterLine1Left = ""; -_textCenterLine2Left = ""; -_textCenterLine3Left = ""; -_textCenterLine1Right = ""; -_textCenterLine2Right = ""; -_textCenterLine3Right = ""; +private _textCenterLine1Left = ""; +private _textCenterLine2Left = ""; +private _textCenterLine3Left = ""; +private _textCenterLine1Right = ""; +private _textCenterLine2Right = ""; +private _textCenterLine3Right = ""; -_textInfoLine1 = ""; -_textInfoLine2 = ""; +private _textInfoLine1 = ""; +private _textInfoLine2 = ""; -_textBottomBig = ""; +private _textBottomBig = ""; -_textCenterLine1 = ""; -_textCenterLine2 = ""; -_textCenterLine3 = ""; -_textCenterLine4 = ""; -_textCenterLine5 = ""; -_textCenterLine6 = ""; +private _textCenterLine1 = ""; +private _textCenterLine2 = ""; +private _textCenterLine3 = ""; +private _textCenterLine4 = ""; +private _textCenterLine5 = ""; +private _textCenterLine6 = ""; -_windSpeed = call FUNC(measureWindSpeed); -_windDir = (ACE_wind select 0) atan2 (ACE_wind select 1); +private _windSpeed = call FUNC(measureWindSpeed); +private _windDir = (ACE_wind select 0) atan2 (ACE_wind select 1); -_playerDir = getDir ACE_player; -_playerAltitude = (getPosASL ACE_player) select 2; +private _playerDir = getDir ACE_player; +private _playerAltitude = (getPosASL ACE_player) select 2; -_temperature = _playerAltitude call EFUNC(weather,calculateTemperatureAtHeight); -_humidity = EGVAR(weather,currentHumidity); -_barometricPressure = _playerAltitude call EFUNC(weather,calculateBarometricPressure); -_airDensity = [_temperature, _barometricPressure, _humidity] call EFUNC(weather,calculateAirDensity); -_densityAltitude = _airDensity call EFUNC(weather,calculateDensityAltitude); -_chill = [_temperature, _humidity] call EFUNC(weather,calculateWindChill); -_heatIndex = [_temperature, _humidity] call EFUNC(weather,calculateHeatIndex); -_dewPoint = [_temperature, _humidity] call EFUNC(weather,calculateDewPoint); -_wetBulb = [_temperature, _barometricPressure, _humidity] call EFUNC(weather,calculateWetBulb); +private _temperature = _playerAltitude call EFUNC(weather,calculateTemperatureAtHeight); +private _humidity = EGVAR(weather,currentHumidity); +private _barometricPressure = _playerAltitude call EFUNC(weather,calculateBarometricPressure); +private _airDensity = [_temperature, _barometricPressure, _humidity] call EFUNC(weather,calculateAirDensity); +private _densityAltitude = _airDensity call EFUNC(weather,calculateDensityAltitude); +private _chill = [_temperature, _humidity] call EFUNC(weather,calculateWindChill); +private _heatIndex = [_temperature, _humidity] call EFUNC(weather,calculateHeatIndex); +private _dewPoint = [_temperature, _humidity] call EFUNC(weather,calculateDewPoint); +private _wetBulb = [_temperature, _barometricPressure, _humidity] call EFUNC(weather,calculateWetBulb); GVAR(Direction) = 4 * floor(_playerDir / 90); if (_playerDir % 90 > 10) then { GVAR(Direction) = GVAR(Direction) + 1}; @@ -87,8 +85,8 @@ if (GVAR(referenceHeadingMenu) == 0) then { switch (GVAR(Menu)) do { case 0: { // Date date params ["_year", "_month", "_day"]; - _dayString = ["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"] select (date call FUNC(dayOfWeek)); - _monthString = localize (["str_january","str_february","str_march","str_april","str_may","str_june","str_july","str_august","str_september","str_october","str_november","str_december"] select (_month - 1)); + private _dayString = ["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"] select (date call FUNC(dayOfWeek)); + private _monthString = localize (["str_january","str_february","str_march","str_april","str_may","str_june","str_july","str_august","str_september","str_october","str_november","str_december"] select (_month - 1)); _textTop = _dayString; _textCenter = format["%1 %2 %3", _day, _monthString, _year]; _textBottomBig = [daytime, "HH:MM:SS"] call bis_fnc_timeToString; @@ -107,7 +105,7 @@ if (GVAR(referenceHeadingMenu) == 0) then { }; case 2: { // Wind SPD if (!GVAR(MinAvgMax)) then { - _textCenterBig = Str(round(abs(_windSpeed) * 10) / 10); + _textCenterBig = Str(round(_windSpeed * 10) / 10); } else { _textCenterLine1Left = "Max"; _textCenterLine2Left = "Avg"; @@ -134,16 +132,16 @@ if (GVAR(referenceHeadingMenu) == 0) then { if (!GVAR(MinAvgMax)) then { if (missionNamespace getVariable [QEGVAR(advanced_ballistics,enabled), false]) then { _textCenterBig = Str(round(abs(sin(GVAR(RefHeading) - _playerDir) * _windSpeed) * 10) / 10); - _textInfoLine1 = format["%1 m/s @ %2", round((abs(cos(_playerDir - _windDir)) * _windSpeed) * 10) / 10, round(_playerDir)]; + _textInfoLine1 = format["%1 m/s @ %2", round(_windSpeed * 10) / 10, round(_playerDir)]; } else { - _textCenterBig = Str(round(abs(sin(GVAR(RefHeading)) * _windSpeed) * 10) / 10); - _textInfoLine1 = format["%1 m/s @ %2", round(_windSpeed * 10) / 10, round(_windDir)]; + _textCenterBig = Str(round(abs(sin(GVAR(RefHeading) - _windDir) * _windSpeed) * 10) / 10); + _textInfoLine1 = format["%1 m/s @ %2", round(_windSpeed * 10) / 10, round(180 + _windDir)]; }; _textInfoLine2 = "- set heading"; } else { _textCenterLine1Left = "Max"; _textCenterLine2Left = "Avg"; - switch (GVAR(MinAvgMax)Mode) do { + switch (GVAR(MinAvgMaxMode)) do { case 0: { _textCenterLine1Right = "--. -"; _textCenterLine2Right = "--. -"; @@ -166,16 +164,16 @@ if (GVAR(referenceHeadingMenu) == 0) then { if (!GVAR(MinAvgMax)) then { if (missionNamespace getVariable [QEGVAR(advanced_ballistics,enabled), false]) then { _textCenterBig = Str(round(cos(GVAR(RefHeading) - _playerDir) * _windSpeed * 10) / 10); - _textInfoLine1 = format["%1 m/s @ %2", round((abs(cos(_playerDir - _windDir)) * _windSpeed) * 10) / 10, round(_playerDir)]; + _textInfoLine1 = format["%1 m/s @ %2", round(_windSpeed * 10) / 10, round(_playerDir)]; } else { - _textCenterBig = Str(round(cos(GVAR(RefHeading)) * _windSpeed * 10) / 10); - _textInfoLine1 = format["%1 m/s @ %2", round(_windSpeed * 10) / 10, round(_windDir)]; + _textCenterBig = Str(round(-cos(GVAR(RefHeading) - _windDir) * _windSpeed * 10) / 10); + _textInfoLine1 = format["%1 m/s @ %2", round(_windSpeed * 10) / 10, round(180 + _windDir)]; }; _textInfoLine2 = "- set heading"; } else { _textCenterLine1Left = "Max"; _textCenterLine2Left = "Avg"; - switch (GVAR(MinAvgMax)Mode) do { + switch (GVAR(MinAvgMaxMode)) do { case 0: { _textCenterLine1Right = "--. -"; _textCenterLine2Right = "--. -"; diff --git a/addons/kestrel4500/functions/fnc_measureWindSpeed.sqf b/addons/kestrel4500/functions/fnc_measureWindSpeed.sqf index 2a8a4bbbb3..17e97c4579 100644 --- a/addons/kestrel4500/functions/fnc_measureWindSpeed.sqf +++ b/addons/kestrel4500/functions/fnc_measureWindSpeed.sqf @@ -15,11 +15,9 @@ */ #include "script_component.hpp" -private ["_playerDir", "_windSpeed", "_windDir"]; - -_playerDir = getDir ACE_player; -_windSpeed = vectorMagnitude ACE_wind; -_windDir = (ACE_wind select 0) atan2 (ACE_wind select 1); +private _playerDir = getDir ACE_player; +private _windSpeed = vectorMagnitude ACE_wind; +private _windDir = (ACE_wind select 0) atan2 (ACE_wind select 1); if (missionNamespace getVariable [QEGVAR(advanced_ballistics,enabled), false]) then { // With wind gradient _windSpeed = [eyePos ACE_player, true, true, true] call EFUNC(weather,calculateWindSpeed); diff --git a/addons/kestrel4500/initKeybinds.sqf b/addons/kestrel4500/initKeybinds.sqf index 8c99271970..8be7464615 100644 --- a/addons/kestrel4500/initKeybinds.sqf +++ b/addons/kestrel4500/initKeybinds.sqf @@ -27,11 +27,10 @@ //Add deviceKey entry: -private ["_conditonCode", "_toggleCode", "_closeCode"]; -_conditonCode = { +private _conditonCode = { [] call FUNC(canShow); }; -_toggleCode = { +private _toggleCode = { // Conditions: canInteract if !([ACE_player, objNull, []] call EFUNC(common,canInteractWith)) exitWith {}; @@ -44,7 +43,7 @@ _toggleCode = { [] call FUNC(createKestrelDialog); }; }; -_closeCode = { +private _closeCode = { // Statement if (GVAR(Overlay)) then { //If dispaly is open, close it: diff --git a/addons/kestrel4500/stringtable.xml b/addons/kestrel4500/stringtable.xml index fe1bc28bbf..f83c875d57 100644 --- a/addons/kestrel4500/stringtable.xml +++ b/addons/kestrel4500/stringtable.xml @@ -1,4 +1,4 @@ - + @@ -12,7 +12,10 @@ Kestrel 4500NV Kestrel 4500NV Kestrel 4500NV - Kestrel 4500NV + ケストレル 4500NV + Kestrel 4500NV + 猎隼4500测风仪 + 獵隼4500測風儀 Kestrel 4500 Pocket Weather Tracker @@ -25,7 +28,10 @@ Kestrel 4500 Medidor Balístico Ativo Kestrel 4500 kézi szél-és időjárásmérő Příruční meteostanice Kestrel 4500 - Kestrel 4500 携帯型風速計 + ケストレル 4500 携帯型風速計 + Kestrel 4500 휴대형 기상 관측기 + 猎隼4500掌上型天气追踪仪 + 獵隼4500掌上型天氣追蹤儀 Open Kestrel 4500 @@ -39,6 +45,9 @@ Abrir Kestrel 4500 Otevřít Kestrel 4500 Kestrel 4500 を開く + Kestrel 4500 열기 + 开启猎隼4500测风仪 + 開啟獵隼4500測風儀 Show Kestrel 4500 @@ -51,7 +60,10 @@ Kestrel 4500 mutatása Zobrazit Kestrel 4500 Mostrar Kestrel 4500 - Kestrel 4500 を見る + ケストレル 4500 を見る + Kestrel 4500 보이기 + 显示猎隼4500测风仪 + 顯示獵隼4500測風儀 Hide Kestrel 4500 @@ -65,6 +77,9 @@ Skrýt Kestrel 4500 Ocultar Kestrel 4500 Kestrel 4500 を隠す + Kestrel 4500 숨기기 + 隐藏猎隼4500测风仪 + 隱藏獵隼4500測風儀 Open Kestrel 4500 @@ -77,7 +92,10 @@ Kestrel 4500 elővétele Otevřít Kestrel 4500 Abrir Kestrel 4500 - Kestrel 4500 を開く + ケストレル 4500 を開く + Kestrel 4500 열기 + 开启猎隼4500测风仪 + 開啟獵隼4500測風儀 Show Kestrel 4500 @@ -90,7 +108,10 @@ Kestrel 4500 mutatása Zobrazit Kestrel 4500 Mostrar Kestrel 4500 - Kestrel 4500 を見る + ケストレル 4500 を見る + Kestrel 4500 숨기기 + 显示猎隼4500测风仪 + 顯示獵隼4500測風儀 - \ No newline at end of file + diff --git a/addons/laser/CfgVehicles.hpp b/addons/laser/CfgVehicles.hpp index 4f226a1468..4b36a8261d 100644 --- a/addons/laser/CfgVehicles.hpp +++ b/addons/laser/CfgVehicles.hpp @@ -10,23 +10,4 @@ class CfgVehicles { }; }; }; - - // laserTarget fails if the turret does not have "primaryGunner" config - // This only effects the indfor strider who's commander is not the primaryGunner - class LandVehicle; - class Car: LandVehicle { - class NewTurret; - }; - class Car_F: Car { - class Turrets { - class MainTurret: NewTurret {}; - }; - }; - class MRAP_03_base_F: Car_F { - class Turrets: Turrets { - class CommanderTurret: MainTurret { - primaryGunner = 1; - }; - }; - }; }; diff --git a/addons/laser/RscInGameUI.hpp b/addons/laser/RscInGameUI.hpp index ca57f56f6f..16d3dfcd91 100644 --- a/addons/laser/RscInGameUI.hpp +++ b/addons/laser/RscInGameUI.hpp @@ -1,9 +1,3 @@ -class RscControlsGroup; -class VScrollbar; -class HScrollbar; -class RscText; -class RscMapControl; - class RscInGameUI { class RscOptics_LaserDesignator { idd = 300; diff --git a/addons/laser/RscTitles.hpp b/addons/laser/RscTitles.hpp new file mode 100644 index 0000000000..7421246181 --- /dev/null +++ b/addons/laser/RscTitles.hpp @@ -0,0 +1,53 @@ +class RscTitles { + class GVAR(modeDisplay) { + idd = -1; + onLoad = QUOTE(with uiNameSpace do { GVAR(display) = _this select 0 };); + movingEnable = 0; + duration = 60; + fadeIn = "false"; + fadeOut = "false"; + class controls { + class ModeControlGroup: RscControlsGroupNoScrollbars { + idc = IDC_MODECONTROLGROUP; + x = "3.8 * (((safezoneW / safezoneH) min 1.2) / 40) + (profilenamespace getvariable ['IGUI_GRID_WEAPON_X',((safezoneX + safezoneW) - (10 * (((safezoneW / safezoneH) min 1.2) / 40)) - 4.3 * (((safezoneW / safezoneH) min 1.2) / 40))])"; + y = "2.5 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (profilenamespace getVariable ['IGUI_GRID_WEAPON_Y', (safezoneY + 0.5 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25))])"; + w = "10 * (((safezoneW / safezoneH) min 1.2) / 40)"; + h = "1 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)"; + + class controls { + class AttackMode: RscText { + idc = IDC_ATTACKMODE; + colorText[] = {1, 1, 1, 1}; + colorBackground[] = {0, 0, 0, 0}; + x = "0"; + y = "0"; + w = "(2.6) * (((safezoneW / safezoneH) min 1.2) / 40)"; + h = "1 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)"; + sizeEx = "0.8 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)"; + }; + class LaserCode: RscText { + idc = IDC_LASERCODE; + colorText[] = {1, 1, 1, 1}; + colorBackground[] = {0, 0, 0, 0}; + x = "(3.6) * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)"; + y = "0"; + w = "(2.5) * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)"; + h = "(1) * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)"; + sizeEx = "0.8 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)"; + }; + class LaserIcon: RscPictureKeepAspect { + idc = IDC_LASERICON; + colorText[] = {1, 0, 0, 1}; + colorBackground[] = {0, 0, 0, 0}; + text = "\a3\Ui_F_Curator\Data\CfgCurator\laser_ca.paa"; + x = "(6.1) * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)"; + y = "0"; + w = "(1) * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)"; + h = "(1) * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)"; + }; + }; + }; + + }; + }; +}; diff --git a/addons/laser/XEH_PREP.hpp b/addons/laser/XEH_PREP.hpp index a95eae7842..6af5643e23 100644 --- a/addons/laser/XEH_PREP.hpp +++ b/addons/laser/XEH_PREP.hpp @@ -13,3 +13,4 @@ PREP(rotateVectLineGetMap); PREP(seekerFindLaserSpot); PREP(shootCone); PREP(shootRay); +PREP(showVehicleHud); diff --git a/addons/laser/XEH_postInit.sqf b/addons/laser/XEH_postInit.sqf index 14ec456461..5f0385cee8 100644 --- a/addons/laser/XEH_postInit.sqf +++ b/addons/laser/XEH_postInit.sqf @@ -1,7 +1,25 @@ #include "script_component.hpp" +if (hasInterface) then { #include "initKeybinds.sqf" + GVAR(pfID) = -1; + + ["ace_settingsInitialized", { + ["turret", LINKFUNC(showVehicleHud), false] call CBA_fnc_addPlayerEventHandler; + ["vehicle", LINKFUNC(showVehicleHud), true] call CBA_fnc_addPlayerEventHandler; // only one of these needs the retro flag + + // Add UAV Control Compatibility + ["ACE_controlledUAV", { + params ["_UAV", "_seatAI", "_turret", "_position"]; + TRACE_4("ACE_controlledUAV EH",_UAV,_seatAI,_turret,_position); + if (!isNull _seatAI) then { + [_seatAI] call FUNC(showVehicleHud); + }; + }] call CBA_fnc_addEventHandler; + }] call CBA_fnc_addEventHandler; +}; + // Global Laser EHs ["ace_laserOn", { params ["_uuid", "_args"]; @@ -17,6 +35,16 @@ }; }] call CBA_fnc_addEventHandler; +[QGVAR(updateCode), { + params ["_uuid", "_newCode"]; + TRACE_2("ace_laser_updateCode eh",_uuid,_newCode); + if ([GVAR(laserEmitters), _uuid] call CBA_fnc_hashHasKey) then { + private _laserArray = [GVAR(laserEmitters), _uuid] call CBA_fnc_hashGet; + TRACE_2("updating",_newCode,_laserArray select 4); + _laserArray set [4, _newCode]; + }; +}] call CBA_fnc_addEventHandler; + // Shows detector and mine posistions in 3d when debug is on #ifdef DRAW_LASER_INFO addMissionEventHandler ["Draw3D", {_this call FUNC(dev_drawVisibleLaserTargets)}]; diff --git a/addons/laser/XEH_preInit.sqf b/addons/laser/XEH_preInit.sqf index 2a68b0b3c3..2c4e7c7f4f 100644 --- a/addons/laser/XEH_preInit.sqf +++ b/addons/laser/XEH_preInit.sqf @@ -2,7 +2,9 @@ ADDON = false; +PREP_RECOMPILE_START; #include "XEH_PREP.hpp" +PREP_RECOMPILE_END; // Laser default variables ACE_DEFAULT_LASER_CODE = 1111; diff --git a/addons/laser/config.cpp b/addons/laser/config.cpp index 75f70449ea..fb6ae5e638 100644 --- a/addons/laser/config.cpp +++ b/addons/laser/config.cpp @@ -13,8 +13,19 @@ class CfgPatches { }; }; -#include "ACE_Settings.hpp" +#include "ACE_Settings.hpp" #include "CfgEventhandlers.hpp" #include "CfgVehicles.hpp" #include "CfgWeapons.hpp" + + +class RscControlsGroup; +class VScrollbar; +class HScrollbar; +class RscText; +class RscMapControl; +class RscControlsGroupNoScrollbars; +class RscPictureKeepAspect; + #include "RscInGameUI.hpp" +#include "RscTitles.hpp" diff --git a/addons/laser/functions/fnc_addLaserTarget.sqf b/addons/laser/functions/fnc_addLaserTarget.sqf index 8f173772a5..9addb8ed93 100644 --- a/addons/laser/functions/fnc_addLaserTarget.sqf +++ b/addons/laser/functions/fnc_addLaserTarget.sqf @@ -6,7 +6,7 @@ * 0: TargetObject (vanilla laser) * 1: Vehicle * - * Return value: + * Return Value: * None * * Example: @@ -50,7 +50,7 @@ private _methodArgs = [_vehicleSourceSelection]; TRACE_6("Laser on:",_vehicle,_laserMethod,_waveLength,_laserCode,_beamSpread,_methodArgs); private _laserUuid = [_vehicle, _vehicle, _laserMethod, _waveLength, _laserCode, _beamSpread, _methodArgs] call FUNC(laserOn); -GVAR(trackedLaserTargets) pushBack [_targetObject, _vehicle, _laserUuid]; +GVAR(trackedLaserTargets) pushBack [_targetObject, _vehicle, _laserUuid, _laserCode]; TRACE_1("",GVAR(trackedLaserTargets)); if (GVAR(pfehID) == -1) then { diff --git a/addons/laser/functions/fnc_dev_drawVisibleLaserTargets.sqf b/addons/laser/functions/fnc_dev_drawVisibleLaserTargets.sqf index 00a4e8a5e6..42931db29d 100644 --- a/addons/laser/functions/fnc_dev_drawVisibleLaserTargets.sqf +++ b/addons/laser/functions/fnc_dev_drawVisibleLaserTargets.sqf @@ -1,3 +1,20 @@ +/* + * Author: ACE-Team + * + * + * Argument: + * None + * + * Return Value: + * None + * + * Example: + * call ace_laser_fnc_dev_drawVisibleLaserTargets + * + * Public: No + */ + + // Dev Debug Function // Displays lasers and attempts to lock on to codes 1111 and 1112 from a target vehicle's view // On Screen Debug: @@ -14,7 +31,7 @@ private _testSeekerPosASL = AGLtoASL (_seekerVehicle modelToWorldVisual [0,0,1]) private _testSeekerDir = vectorDirVisual _seekerVehicle; { private _code = _x; - private _results = [_testSeekerPosASL, _testSeekerDir, 45, [1550,1550], _code, _seekerVehicle] call FUNC(seekerFindLaserSpot); + private _results = [_testSeekerPosASL, _testSeekerDir, 45, 10000, [1550,1550], _code, _seekerVehicle] call FUNC(seekerFindLaserSpot); private _resultPos = _results select 0; if (!isNil "_resultPos") then { // Draw lock results @@ -26,6 +43,7 @@ private _testSeekerDir = vectorDirVisual _seekerVehicle; // Draw all lasers [GVAR(laserEmitters), { + //IGNORE_PRIVATE_WARNING ["_key", "_value"]; // TRACE_2("",_key,_value); _value params ["_obj", "_owner", "_laserMethod", "_waveLength", "_laserCode", "_beamSpread"]; diff --git a/addons/laser/functions/fnc_findLaserSource.sqf b/addons/laser/functions/fnc_findLaserSource.sqf index 3577bc1c32..585faf3023 100644 --- a/addons/laser/functions/fnc_findLaserSource.sqf +++ b/addons/laser/functions/fnc_findLaserSource.sqf @@ -2,13 +2,13 @@ * Author: esteldunedain * Handler function for finding position and direction of a vanilla laser. * - * Argument: + * Arguments: * 0: Vehicle (shooter of laser) * 6: Method Args - * 0: Laser Source selection on Vehicle + * 0: Laser Source selection on Vehicle * - * Return value: - * [position, direction] + * Return Value: + * [position, direction] * * Example: * [player, x,x,x,x,x, ["pilot"]] call ace_laser_fnc_findLaserSource; diff --git a/addons/laser/functions/fnc_handleLaserTargetCreation.sqf b/addons/laser/functions/fnc_handleLaserTargetCreation.sqf index 24a2502169..c4ac9d3967 100644 --- a/addons/laser/functions/fnc_handleLaserTargetCreation.sqf +++ b/addons/laser/functions/fnc_handleLaserTargetCreation.sqf @@ -5,10 +5,7 @@ * Argument: * 0: Vanilla Laser (base type LaserTarget) * - * Return value: - * None - * - * Return value: + * Return Value: * None * * Example: @@ -16,6 +13,7 @@ * * Public: No */ +// #define DEBUG_MODE_FULL #include "script_component.hpp" TRACE_1("params",_this); @@ -37,5 +35,31 @@ TRACE_1("params",_this); [_targetObject, _owners select 0] call FUNC(addLaserTarget); }; - TRACE_1("Laser target doesn't have owner", _targetObject); + // Vehicle based laser designators won't be linked via laserTarget if the turret has "primaryGunner = 0" + // This backup method just checks the player's vic - which should be reasonably safe as we know the laserTarget is local + private _foundSource = false; + private _vehicle = vehicle ACE_player; + TRACE_2("",_vehicle,typeOf _vehicle); + if ((alive ACE_player) && {_vehicle != ACE_player}) then { + private _turretPath = if (ACE_player == (driver _vehicle)) then {[-1]} else {ACE_player call CBA_fnc_turretPath}; + TRACE_1("",_turretPath); + if (!(_turretPath isEqualTo [])) then { + private _currentWeapon = _vehicle currentWeaponTurret _turretPath; + TRACE_1("",_currentWeapon); + if ((getNumber (configFile >> "CfgWeapons" >> _currentWeapon >> "laser")) == 1) then { + #ifdef DEBUG_MODE_FULL + private _turretConfig = [_vehicle, _turretPath] call CBA_fnc_getTurret; + private _primaryGunner = getNumber (_turretConfig >> "primaryGunner"); + TRACE_1("",_primaryGunner); + #endif + TRACE_2("Laser target owner [backup method]",_targetObject,_vehicle); + [_targetObject, _vehicle] call FUNC(addLaserTarget); + _foundSource = true; + }; + }; + }; + if (!_foundSource) then { + WARNING_1("Laser target doesn't have owner", _targetObject); + }; + }, _this] call CBA_fnc_execNextFrame; diff --git a/addons/laser/functions/fnc_keyLaserCodeChange.sqf b/addons/laser/functions/fnc_keyLaserCodeChange.sqf index f4f485bcd0..14c6ab70b6 100644 --- a/addons/laser/functions/fnc_keyLaserCodeChange.sqf +++ b/addons/laser/functions/fnc_keyLaserCodeChange.sqf @@ -5,7 +5,7 @@ * Argument: * 0: Change in code * - * Return value: + * Return Value: * Key Handled * Example: @@ -24,17 +24,24 @@ if ((!alive ACE_player) || {!([ACE_player, vehicle ACE_player, []] call EFUNC(co private _currentShooter = objNull; private _currentWeapon = ""; -if (ACE_player call CBA_fnc_canUseWeapon) then { - _currentShooter = ACE_player; - _currentWeapon = currentWeapon ACE_player; +if (isNull (ACE_controlledUAV param [0, objNull])) then { + if (ACE_player call CBA_fnc_canUseWeapon) then { + _currentShooter = ACE_player; + _currentWeapon = currentWeapon ACE_player; + } else { + _currentShooter = vehicle ACE_player; + private _turretPath = if (ACE_player == (driver _currentShooter)) then {[-1]} else {ACE_player call CBA_fnc_turretPath}; + _currentWeapon = _currentShooter currentWeaponTurret _turretPath; + }; } else { - _currentShooter = vehicle ACE_player; - private _turret = [ACE_player] call ace_common_fnc_getTurretIndex; - _currentWeapon = _currentShooter currentWeaponTurret _turret; + _currentShooter = ACE_controlledUAV select 0; + private _turretPath = ACE_controlledUAV select 2; + _currentWeapon = _currentShooter currentWeaponTurret _turretPath; }; TRACE_2("",_currentShooter,_currentWeapon); -if ((getNumber (configFile >> "CfgWeapons" >> _currentWeapon >> "laser")) == 0) exitWith {false}; +if (((getNumber (configFile >> "CfgWeapons" >> _currentWeapon >> "laser")) == 0) && + {(getNumber (configFile >> "CfgWeapons" >> _currentWeapon >> QGVAR(canSelect))) == 0}) exitWith {false}; private _oldLaserCode = _currentShooter getVariable [QGVAR(code), ACE_DEFAULT_LASER_CODE]; private _newLaserCode = _oldLaserCode; @@ -52,7 +59,7 @@ if (((_codeChange < 0) && {_oldLaserCode > ACE_DEFAULT_LASER_CODE}) || {(_codeCh TRACE_2("",_oldLaserCode,_newLaserCode); if (_oldLaserCode != _newLaserCode) then { - _currentShooter setVariable [QGVAR(code), _newLaserCode, false]; + _currentShooter setVariable [QGVAR(code), _newLaserCode, true]; }; [format ["%1: %2", localize LSTRING(laserCode), _newLaserCode]] call EFUNC(common,displayTextStructured); diff --git a/addons/laser/functions/fnc_laserOff.sqf b/addons/laser/functions/fnc_laserOff.sqf index fcfc669d45..64188a62f1 100644 --- a/addons/laser/functions/fnc_laserOff.sqf +++ b/addons/laser/functions/fnc_laserOff.sqf @@ -5,7 +5,7 @@ * Arguments: * 0: UUID (from laserOn) * - * Return value: + * Return Value: * None * * Example: diff --git a/addons/laser/functions/fnc_laserOn.sqf b/addons/laser/functions/fnc_laserOn.sqf index a80f69b945..baa7e9c1c3 100644 --- a/addons/laser/functions/fnc_laserOn.sqf +++ b/addons/laser/functions/fnc_laserOn.sqf @@ -8,15 +8,15 @@ * 2: Method, can be code, which emitter and owner are passed to, a string function name, an array with a position memory point and weapon name, or an array with a position memory point, a vector begining memory point, and vector ending memory point. * 3: Wavelength (1550nm is common eye safe) * 4: Laser code - * 5: Beam divergence (in mils off beam center). - * 6: Method Args + * 5: Beam divergence (in mils off beam center) + * 6: Method Args (default: nil) * * Return Value: - * UUID for sending to laserOff function. + * UUID for sending to laserOff function * * Example: - * [hmg, hmg, [[0,0,1], "HMG_static"], 1550, 1111, 1] call ace_laser_fnc_laserOn; - * [player, player, "ace_laser_fnc_findLaserSource", 1550, 1111, 1, ["pilot"]] call ace_laser_fnc_laserOn; + * [hmg, hmg, [[0,0,1], "HMG_static"], 1550, 1111, 1] call ace_laser_fnc_laserOn + * [player, player, "ace_laser_fnc_findLaserSource", 1550, 1111, 1, ["pilot"]] call ace_laser_fnc_laserOn * * Public: No */ diff --git a/addons/laser/functions/fnc_laserTargetPFH.sqf b/addons/laser/functions/fnc_laserTargetPFH.sqf index ac7d71917f..8ee3396d94 100644 --- a/addons/laser/functions/fnc_laserTargetPFH.sqf +++ b/addons/laser/functions/fnc_laserTargetPFH.sqf @@ -5,7 +5,7 @@ * Argument: * PFEH Args * - * Return value: + * Return Value: * None * * Example: @@ -18,7 +18,7 @@ params ["", "_pfhuid"]; GVAR(trackedLaserTargets) = GVAR(trackedLaserTargets) select { - _x params ["_targetObject", "_owner", "_laserUuid"]; + _x params ["_targetObject", "_owner", "_laserUuid", "_laserCode"]; if ((isNull _targetObject) || {!(alive _targetObject)} || {isNull _owner} || @@ -29,6 +29,12 @@ GVAR(trackedLaserTargets) = GVAR(trackedLaserTargets) select { TRACE_1("Laser off:", _laserUuid); false } else { + private _newCode = _owner getVariable [QEGVAR(laser,code), ACE_DEFAULT_LASER_CODE]; + if (_laserCode != _newCode) then { + TRACE_2("code change",_newCode,_laserCode); + [QGVAR(updateCode), [_laserUuid, _newCode]] call CBA_fnc_globalEvent; + _x set [3, _newCode]; + }; true }; }; diff --git a/addons/laser/functions/fnc_rotateVectLine.sqf b/addons/laser/functions/fnc_rotateVectLine.sqf index dde211c7c4..17b771debe 100644 --- a/addons/laser/functions/fnc_rotateVectLine.sqf +++ b/addons/laser/functions/fnc_rotateVectLine.sqf @@ -1,3 +1,19 @@ +/* + * Author: ACE-Team + * + * + * Argument: + * None + * + * Return Value: + * None + * + * Example: + * call ace_laser_fnc_rotateVectline + * + * Public: No + */ + #include "script_component.hpp" params ["_map", "_theta"]; diff --git a/addons/laser/functions/fnc_rotateVectLineGetMap.sqf b/addons/laser/functions/fnc_rotateVectLineGetMap.sqf index e6ab81c7f4..8d7f0a7f2e 100644 --- a/addons/laser/functions/fnc_rotateVectLineGetMap.sqf +++ b/addons/laser/functions/fnc_rotateVectLineGetMap.sqf @@ -1,3 +1,19 @@ +/* + * Author: ACE-Team + * + * + * Arguments: + * None + * + * Return Value: + * None + * + * Example: + * call ace_laser_fnc_rotateVectLineGetMap + * + * Public: No + */ + #include "script_component.hpp" params ["_p", "_p1", "_p2"]; diff --git a/addons/laser/functions/fnc_seekerFindLaserSpot.sqf b/addons/laser/functions/fnc_seekerFindLaserSpot.sqf index c16e4389e2..200e00acae 100644 --- a/addons/laser/functions/fnc_seekerFindLaserSpot.sqf +++ b/addons/laser/functions/fnc_seekerFindLaserSpot.sqf @@ -7,15 +7,16 @@ * 0: Position of seeker (ASL) * 1: Direction vector (will be normalized) * 2: Seeker FOV in degrees - * 3: Seeker wavelength sensitivity range, [1550,1550] is common eye safe. - * 4: Seeker laser code. - * 5: Ignore 1 (e.g. Player's vehicle) + * 3: Seeker max distance in meters + * 4: Seeker wavelength sensitivity range, [1550,1550] is common eye safe + * 5: Seeker laser code. + * 6: Ignore 1 (e.g. Player's vehicle) (default: objNull) * * Return Value: - * Array, [Strongest compatible laser spot ASL pos, owner object] Nil array values if nothing found. + * [Strongest compatible laser spot ASL pos, owner object] Nil array values if nothing found * * Example: - * [getPosASL player, [0,1,0], 90, [1500, 1500], 1111, player] call ace_laser_fnc_seekerFindLaserSpot; + * [getPosASL player, [0,1,0], 90, [1500, 1500], 1111, player] call ace_laser_fnc_seekerFindLaserSpot * * Public: No */ @@ -24,13 +25,15 @@ BEGIN_COUNTER(seekerFindLaserSpot); -params ["_posASL", "_dir", "_seekerFov", "_seekerWavelengths", "_seekerCode", ["_ignoreObj1", objNull]]; +params ["_posASL", "_dir", "_seekerFov", "_seekerMaxDistance", "_seekerWavelengths", "_seekerCode", ["_ignoreObj1", objNull]]; _dir = vectorNormalized _dir; _seekerWavelengths params ["_seekerWavelengthMin", "_seekerWavelengthMax"]; -private _seekerCos = cos _seekerFov; -TRACE_5("",_posASL,_dir,_seekerFov,_seekerWavelengths,_seekerCode); +private _seekerCos = cos _seekerFov; +private _seekerMaxDistSq = _seekerMaxDistance ^ 2; + +TRACE_6("",_posASL,_dir,_seekerFov,_seekerMaxDistance,_seekerWavelengths,_seekerCode); private _spots = []; private _finalPos = nil; @@ -73,10 +76,10 @@ private _finalOwner = objNull; // Shoot a cone with dispersion ([_laserPos, _laserDir, _divergence, GVAR(dispersionCount), _obj] call FUNC(shootCone)) params ["", "", "_resultPositions"]; { - _testPoint = _x select 0; + private _testPoint = _x select 0; private _testPointVector = _posASL vectorFromTo _testPoint; private _testDotProduct = _dir vectorDotProduct _testPointVector; - if (_testDotProduct > _seekerCos) then { + if ((_testDotProduct > _seekerCos) && {(_testPoint vectorDistanceSqr _posASL) < _seekerMaxDistSq}) then { _spots pushBack [_testPoint, _owner]; }; } forEach _resultPositions; @@ -87,7 +90,7 @@ private _finalOwner = objNull; if (_distance > 0) then { private _testPointVector = _posASL vectorFromTo _resultPos; private _testDotProduct = _dir vectorDotProduct _testPointVector; - if (_testDotProduct > _seekerCos) then { + if ((_testDotProduct > _seekerCos) && {(_resultPos vectorDistanceSqr _posASL) < _seekerMaxDistSq}) then { _spots pushBack [_resultPos, _owner]; }; }; @@ -175,6 +178,7 @@ if ((count _spots) > 0) then { private _maxOwnerCount = -1; [_ownersHash, { + //IGNORE_PRIVATE_WARNING ["_key", "_value"]; if (_value > _maxOwnerCount) then { _finalOwner = _key; }; @@ -186,9 +190,9 @@ END_COUNTER(seekerFindLaserSpot); #ifdef DRAW_LASER_INFO if (isNil "_finalPos") then { - drawIcon3D ["\A3\ui_f\data\map\vehicleicons\iconMan_ca.paa", [0.9,1,0,1], (ASLtoAGL _posASL), 1, 1, 0, format ["Seeker: %1", _code], 0.5, 0.025, "TahomaB"]; + drawIcon3D ["\A3\ui_f\data\map\vehicleicons\iconMan_ca.paa", [0.9,1,0,1], (ASLtoAGL _posASL), 1, 1, 0, format ["Seeker: %1", _seekerCode], 0.5, 0.025, "TahomaB"]; } else { - drawIcon3D ["\A3\ui_f\data\map\vehicleicons\iconManAT_ca.paa", [0.5,1,0,1], (ASLtoAGL _posASL), 1, 1, 0, format ["Seeker: %1", _code], 0.5, 0.025, "TahomaB"]; + drawIcon3D ["\A3\ui_f\data\map\vehicleicons\iconManAT_ca.paa", [0.5,1,0,1], (ASLtoAGL _posASL), 1, 1, 0, format ["Seeker: %1", _seekerCode], 0.5, 0.025, "TahomaB"]; drawLine3D [ASLtoAGL _posASL, ASLtoAGL _finalPos, [0.5,1,0,1]]; }; #endif diff --git a/addons/laser/functions/fnc_shootCone.sqf b/addons/laser/functions/fnc_shootCone.sqf index e249d4d6e9..9cde6f2139 100644 --- a/addons/laser/functions/fnc_shootCone.sqf +++ b/addons/laser/functions/fnc_shootCone.sqf @@ -1,19 +1,19 @@ /* * Author: Nou - * Shoots multiple rays in a dispersion pattern + * Shoots multiple rays in a dispersion pattern. * * Arguments: * 0: Origin position ASL * 1: Direction (normalized) - * 2: Divergence (mils) - * 3: Count at each divergence level - * 4: Ignore vehicle 1 (e.g. Player's vehicle) + * 2: Divergence (mils) (default: 0.3) + * 3: Count at each divergence level (default: 3) + * 4: Ignore vehicle 1 (e.g. Player's vehicle) (default: objNull) * - * Return value: - * [_longestReturn, _shortestReturn, _resultPositions] + * Return Value: + * [_longestReturn, _shortestReturn, _resultPositions] * * Example: - * [getPosASL player, [0,1,0]] call ace_laser_fnc_shootCone; + * [getPosASL player, [0,1,0]] call ace_laser_fnc_shootCone * * Public: No */ @@ -53,7 +53,7 @@ private _pos2 = _pos vectorAdd (_vec vectorMultiply 1000); for "_i" from 1 to ceil(_count*_x) do { // Will always do at least 1 private _offset = [_vecRotateMap, (((360/_count)*_i)+_radOffset) mod 360] call FUNC(rotateVectLine); private _offsetPos = _pos2 vectorAdd (_offset vectorMultiply (_divergence*_x)); - + private _offsetVector = _pos vectorFromTo _offsetPos; _result = [_pos, _offsetVector, _ignoreObj1] call FUNC(shootRay); _resultPos = _result select 0; diff --git a/addons/laser/functions/fnc_shootRay.sqf b/addons/laser/functions/fnc_shootRay.sqf index e379026779..12a3cf64bf 100644 --- a/addons/laser/functions/fnc_shootRay.sqf +++ b/addons/laser/functions/fnc_shootRay.sqf @@ -1,18 +1,18 @@ /* * Author: Nou, PabstMirror - * Shoots a ray from a source to a direction and finds first intersction and distance + * Shoots a ray from a source to a direction and finds first intersction and distance. * * Arguments: * 0: Origin position ASL * 1: Direction (normalized) - * 2: Ignore 1 (e.g. Player's vehicle) - * 2: Ignore 2 (e.g. Player's vehicle) + * 2: Ignore 1 (e.g. Player's vehicle) (default: objNull) + * 2: Ignore 2 (e.g. Player's vehicle) (default: objNull) * - * Return value: - * [posASL, distance] - pos will be nil if no intersection + * Return Value: + * [posASL, distance] - pos will be nil if no intersection * * Example: - * [getPosASL player, [0,1,0], player] call ace_laser_fnc_shootRay; + * [getPosASL player, [0,1,0], player] call ace_laser_fnc_shootRay * * Public: No */ @@ -28,6 +28,13 @@ private _resultPos = nil; private _farPoint = _posASL vectorAdd (_dir vectorMultiply 10000); private _intersects = lineIntersectsSurfaces [_posASL, _farPoint, _ignoreVehicle1, _ignoreVehicle2]; +// workaround for lineIntersectsSurfaces using a hardcoded max distance of 5000m. New max distance 15000m +if (_intersects isEqualTo []) then { + _intersects = lineIntersectsSurfaces [_posASL vectorAdd (_dir vectorMultiply 5000), _farPoint vectorAdd (_dir vectorMultiply 5000), _ignoreVehicle1, _ignoreVehicle2]; + if (_intersects isEqualTo []) then { + _intersects = lineIntersectsSurfaces [_posASL vectorAdd (_dir vectorMultiply 10000), _farPoint vectorAdd (_dir vectorMultiply 10000), _ignoreVehicle1, _ignoreVehicle2]; + }; +}; if (!(_intersects isEqualTo [])) then { (_intersects select 0) params ["_intersectPosASL", "", "_intersectObject"]; diff --git a/addons/laser/functions/fnc_showVehicleHud.sqf b/addons/laser/functions/fnc_showVehicleHud.sqf new file mode 100644 index 0000000000..b4a5bcb519 --- /dev/null +++ b/addons/laser/functions/fnc_showVehicleHud.sqf @@ -0,0 +1,114 @@ +/* + * Author: PabstMirror + * Shows the laser hud when vehicle is equiped with the weapon. + * Shows laser code, fire mode and seeker status. + * + * Arguments: + * 0: Player + * + * Return Value: + * Nothing + * + * Example: + * [player] call ace_laser_fnc_showVehicleHud + * + * Public: No + */ +#include "script_component.hpp" + +params ["_player"]; +TRACE_1("showHud",_player); + +private _enabled = false; +private _vehicle = vehicle _player; +private _turretPath = [-1]; + +if ((alive _player) && {_player != _vehicle}) then { + if (_player != (driver _vehicle)) then { + _turretPath = _player call CBA_fnc_turretPath + }; + { + if ((getNumber (configFile >> "CfgWeapons" >> _x >> QGVAR(showHud))) == 1) then { + TRACE_1("showHud",_x); + _enabled = true; + }; + } forEach (_vehicle weaponsTurret _turretPath); +}; + +if ((!_enabled) && (GVAR(pfID) < 0)) exitWith {TRACE_2("Disabled - No Change",_enabled,GVAR(pfID));}; + +TRACE_2("Cleaning up old pfeh and display",_enabled,GVAR(pfID)); +[GVAR(pfID)] call CBA_fnc_removePerFrameHandler; +if (!isNull (uiNamespace getVariable [QGVAR(display), displayNull])) then { + ([QGVAR(modeDisplay)] call BIS_fnc_rscLayer) cutText ["", "PLAIN"]; +}; +GVAR(pfID) = -1; + +if (!_enabled) exitWith {TRACE_2("Disabled - Now Off",_enabled,GVAR(pfID));}; + +TRACE_2("Enabled - Adding PFEH",_enabled,GVAR(pfID)); + +private _adjustDown = false; // Flares display will block ours, if present just move ours down a bit +{ + if ((getText (configFile >> "CfgWeapons" >> _x >> "simulation")) == "cmlauncher") exitWith {_adjustDown = true}; +} forEach (_vehicle weaponsTurret _turretPath); + +private _turretConfig = [_vehicle, _turretPath] call CBA_fnc_getTurret; +private _seekerSource = getText (_turretConfig >> "memoryPointGunnerOptics"); +TRACE_3("",_adjustDown,_seekerSource,_vehicle selectionPosition _seekerSource); + +GVAR(pfID) = [{ + params ["_args", "_pfID"]; + _args params ["_vehicle", "_turretPath", "_seekerSource", "_adjustDown"]; + + // Restart display if null (not just at start, this will happen periodicly) + if (isNull (uiNamespace getVariable [QGVAR(display), displayNull])) then { + TRACE_1("creating display",_this); + ([QGVAR(modeDisplay)] call BIS_fnc_rscLayer) cutRsc [QGVAR(modeDisplay), "PLAIN", 1, false]; + if (_adjustDown) then { + private _ctrl = (uiNamespace getVariable [QGVAR(display), displayNull]) displayCtrl IDC_MODECONTROLGROUP; + private _pos = ctrlPosition _ctrl; + _pos set [1, (_pos select 1) + ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)]; + _ctrl ctrlSetPosition _pos; + _ctrl ctrlCommit 0; + }; + }; + + private _currentWeapon = _vehicle currentWeaponTurret _turretPath; + private _showLockMode = (getNumber (configFile >> "CfgWeapons" >> _currentWeapon >> QGVAR(showHud))) == 1; + + private _ctrlGroup = (uiNamespace getVariable [QGVAR(display), displayNull]) displayCtrl 1000; + + if (!_showLockMode) exitWith { + _ctrlGroup ctrlShow false; + }; + _ctrlGroup ctrlShow true; + + private _ctrlText = (uiNamespace getVariable [QGVAR(display), displayNull]) displayCtrl IDC_ATTACKMODE; + private _ctrlCode = (uiNamespace getVariable [QGVAR(display), displayNull]) displayCtrl IDC_LASERCODE; + private _ctrlIcon = (uiNamespace getVariable [QGVAR(display), displayNull]) displayCtrl IDC_LASERICON; + + // Do Laser Scan: + private _ammo = getText (configFile >> "CfgMagazines" >> _vehicle currentMagazineTurret _turretPath >> "ammo"); + private _laserSource = AGLtoASL (_vehicle modelToWorld (_vehicle selectionPosition _seekerSource)); + private _laserCode = _vehicle getVariable [QEGVAR(laser,code), ACE_DEFAULT_LASER_CODE]; + private _seekerAngle = getNumber (configFile >> "CfgAmmo" >> _ammo >> "ace_missileguidance" >> "seekerAngle"); + private _seekerMaxRange = getNumber (configFile >> "CfgAmmo" >> _ammo >> "ace_missileguidance" >> "seekerMaxRange"); + private _laserResult = [_laserSource, vectorDir _vehicle, _seekerAngle, _seekerMaxRange, [ACE_DEFAULT_LASER_WAVELENGTH,ACE_DEFAULT_LASER_WAVELENGTH], _laserCode, _vehicle] call EFUNC(laser,seekerFindLaserSpot); + private _foundTargetPos = _laserResult select 0; + private _haveLock = !isNil "_foundTargetPos"; + + private _defaultAttackProfile = getText (configFile >> "CfgAmmo" >> _ammo >> "ace_missileguidance" >> "defaultAttackProfile"); + private _vehicleLockMode = _vehicle getVariable [QEGVAR(missileguidance,attackProfile), _defaultAttackProfile]; + + _modeShort = if (_haveLock) then { + getText (configFile >> QEGVAR(missileguidance,AttackProfiles) >> _vehicleLockMode >> "nameLocked"); + } else { + getText (configFile >> QEGVAR(missileguidance,AttackProfiles) >> _vehicleLockMode >> "name"); + }; + + _ctrlIcon ctrlSetTextColor ([[0,0,0,0.25],[1,0,0,0.75]] select _haveLock); + _ctrlText ctrlSetText _modeShort; + _ctrlCode ctrlSetText format ["CODE: %1", _laserCode]; + +}, 0.1, [_vehicle, _turretPath, _seekerSource, _adjustDown]] call CBA_fnc_addPerFrameHandler; diff --git a/addons/laser/script_component.hpp b/addons/laser/script_component.hpp index af562536b6..b0d9951bf3 100644 --- a/addons/laser/script_component.hpp +++ b/addons/laser/script_component.hpp @@ -23,3 +23,8 @@ #define __LaserDesignatorIGUI_ACE_Distance (__LaserDesignatorIGUI displayCtrl 123002) #define __LaserDesignatorIGUI_CA_Distance (__LaserDesignatorIGUI displayCtrl 151) #define __LaserDesignatorIGUI_LaserOn (__LaserDesignatorIGUI displayCtrl 158) + +#define IDC_MODECONTROLGROUP 1000 +#define IDC_ATTACKMODE 1001 +#define IDC_LASERCODE 1002 +#define IDC_LASERICON 1003 diff --git a/addons/laser/stringtable.xml b/addons/laser/stringtable.xml index b6ccb247d9..aa09f5de0e 100644 --- a/addons/laser/stringtable.xml +++ b/addons/laser/stringtable.xml @@ -1,8 +1,16 @@ - + Laser Dispersion Simulation Count + レーザーの分散シミュレート数 + Laserstreuung-Simulationszähler + 레이저 분산 시뮬레이션 수 + Wskaźnik poziomu rozproszenia wiązki lasera + Compte de la simulation de la dispersion du laser + Contatore Simulazione Dispersione Laser + 雷射散射模拟计算 + 雷射散射模擬計算 Laser Code @@ -16,6 +24,9 @@ Laser kód Codice laser レーザ コード + 레이저 코드 + 雷射码 + 雷射碼 Laser - Cycle Code Up @@ -29,6 +40,9 @@ Laser - Kód + Codice laser + レーザ - コードの数値を増やす + 레이저 - 코드 순환 위 + 雷射 - 循环切换雷射码 上 + 雷射 - 循環切換雷射碼 上 Laser - Cycle Code Down @@ -42,6 +56,9 @@ Laser - Kód - Codice laser - レーザ - コードの数値を減らす + 레이저 - 코드 순환 아래 + 雷射 - 循环切换雷射码 下 + 雷射 - 循環切換雷射碼 下 - \ No newline at end of file + diff --git a/addons/laserpointer/CfgEventHandlers.hpp b/addons/laserpointer/CfgEventHandlers.hpp index becf395052..0d3301d6e0 100644 --- a/addons/laserpointer/CfgEventHandlers.hpp +++ b/addons/laserpointer/CfgEventHandlers.hpp @@ -1,4 +1,3 @@ - class Extended_PreStart_EventHandlers { class ADDON { init = QUOTE(call COMPILE_FILE(XEH_preStart)); diff --git a/addons/laserpointer/CfgWeapons.hpp b/addons/laserpointer/CfgWeapons.hpp index 608d025a01..c86887e1c3 100644 --- a/addons/laserpointer/CfgWeapons.hpp +++ b/addons/laserpointer/CfgWeapons.hpp @@ -9,16 +9,18 @@ class CfgWeapons { class InventoryFlashLightItem_Base_F; class acc_pointer_IR: ItemCore { - ACE_nextModeClass = "ACE_acc_pointer_red"; - ACE_modeDescription = CSTRING(IRLaser); + MRT_SwitchItemNextClass = "ACE_acc_pointer_red"; + MRT_SwitchItemPrevClass = "ACE_acc_pointer_red"; + MRT_switchItemHintText = CSTRING(IRLaser); displayName = CSTRING(red); descriptionUse = CSTRING(useLaser); }; class ACE_acc_pointer_red: ItemCore { - ACE_nextModeClass = "acc_pointer_IR"; - ACE_modeDescription = CSTRING(Laser); + MRT_SwitchItemNextClass = "acc_pointer_IR"; + MRT_SwitchItemPrevClass = "acc_pointer_IR"; + MRT_switchItemHintText = CSTRING(Laser); ACE_laserpointer = 1; @@ -68,8 +70,9 @@ class CfgWeapons { }; class ACE_acc_pointer_green_IR: acc_pointer_IR { - ACE_nextModeClass = "ACE_acc_pointer_green"; - ACE_modeDescription = CSTRING(IRLaser); + MRT_SwitchItemNextClass = "ACE_acc_pointer_green"; + MRT_SwitchItemPrevClass = "ACE_acc_pointer_green"; + MRT_switchItemHintText = CSTRING(IRLaser); author = ECSTRING(common,ACETeam); _generalMacro = "ACE_acc_pointer_green"; @@ -78,8 +81,9 @@ class CfgWeapons { }; class ACE_acc_pointer_green: ACE_acc_pointer_red { - ACE_nextModeClass = "ACE_acc_pointer_green_IR"; - ACE_modeDescription = CSTRING(Laser); + MRT_SwitchItemNextClass = "ACE_acc_pointer_green_IR"; + MRT_SwitchItemPrevClass = "ACE_acc_pointer_green_IR"; + MRT_switchItemHintText = CSTRING(Laser); ACE_laserpointer = 2; diff --git a/addons/laserpointer/XEH_PREP.hpp b/addons/laserpointer/XEH_PREP.hpp index c5dcd74a75..59a28bb4cc 100644 --- a/addons/laserpointer/XEH_PREP.hpp +++ b/addons/laserpointer/XEH_PREP.hpp @@ -1,4 +1,3 @@ - PREP(drawLaserpoint); +PREP(getNearUnits); PREP(onDraw); -PREP(switchLaserLightMode); diff --git a/addons/laserpointer/XEH_postInit.sqf b/addons/laserpointer/XEH_postInit.sqf index bfc617965d..7e90e29259 100644 --- a/addons/laserpointer/XEH_postInit.sqf +++ b/addons/laserpointer/XEH_postInit.sqf @@ -2,37 +2,90 @@ #include "script_component.hpp" // fixes laser when being captured. Needed, because the selectionPosition of the right hand is used -[QEGVAR(captives,setHandcuffed), {if (_this select 1) then {(_this select 0) action ["ace_gunLightOff", _this select 0]};}] call CBA_fnc_addEventHandler; +[QEGVAR(captives,setHandcuffed), {if (_this select 1) then {(_this select 0) action ["GunLightOff", _this select 0]};}] call CBA_fnc_addEventHandler; if (!hasInterface) exitWith {}; GVAR(nearUnits) = []; - -#include "initKeybinds.sqf" +GVAR(index) = -1; +GVAR(laserClassesCache) = [] call CBA_fnc_createNamespace; +GVAR(redLaserUnits) = []; +GVAR(greenLaserUnits) = []; ["ace_settingsInitialized", { - //If not enabled, dont't add draw eventhandler or PFEH (for performance) - if (!GVAR(enabled)) exitWith {}; - - // @todo. Maybe move to common? - [{ - // handle RHS / bugged vehicle slots - private _camPosAGL = positionCameraToWorld [0,0,0]; - if !((_camPosAGL select 0) isEqualType 0) exitWith {}; - - private _nearUnits = []; - { - _nearUnits append crew _x; - if (count _nearUnits > 10) exitWith { - _nearUnits resize 10; + // If not enabled, dont't add draw eventhandler or PFEH (for performance) + if (!GVAR(enabled)) exitWith { + ["CBA_attachmentSwitched", { + params ["_unit", "_prevItem", "_newItem", "_currWeaponType"]; + TRACE_4("CBA_attachmentSwitched eh",_unit,_prevItem,_newItem,_currWeaponType); + if ((getNumber (configFile >> "CfgWeapons" >> _newItem >> "ACE_laserpointer")) > 0) then { + TRACE_1("removing ACE_laserpointer",getNumber (configFile >> "CfgWeapons" >> _newItem >> "ACE_laserpointer")); + [1, "prev"] call CBA_accessory_fnc_switchAttachment; }; - } forEach nearestObjects [_camPosAGL, ["AllVehicles"], 50]; // when moving this, search also for units inside vehicles. currently breaks the laser in FFV + }] call CBA_fnc_addEventHandler; + }; - GVAR(nearUnits) = _nearUnits; + [{ + private _oldNearUnits = GVAR(nearUnits); + GVAR(nearUnits) = call FUNC(getNearUnits); - } , 5, []] call CBA_fnc_addPerFrameHandler; + // remove units that moved away + { + GVAR(redLaserUnits) deleteAt (GVAR(redLaserUnits) find _x); + GVAR(greenLaserUnits) deleteAt (GVAR(greenLaserUnits) find _x); + } forEach (_oldNearUnits - GVAR(nearUnits)); + }, 5, []] call CBA_fnc_addPerFrameHandler; - addMissionEventHandler ["Draw3D", { - call FUNC(onDraw); - }]; + + private _fnc_processUnit = { + params ["_unit"]; + + private _weapon = currentWeapon _unit; + if (!(_unit isFlashlightOn _weapon)) exitWith { + GVAR(redLaserUnits) deleteAt (GVAR(redLaserUnits) find _unit); + GVAR(greenLaserUnits) deleteAt (GVAR(greenLaserUnits) find _unit); + }; + + private _laser = [(_unit weaponAccessories _weapon) select 1] param [0, ""]; + if (_laser isEqualTo "") exitWith { + GVAR(redLaserUnits) deleteAt (GVAR(redLaserUnits) find _unit); + GVAR(greenLaserUnits) deleteAt (GVAR(greenLaserUnits) find _unit); + }; + + private _laserID = GVAR(laserClassesCache) getVariable _laser; + + if (isNil "_laserID") then { + _laserID = getNumber (configFile >> "CfgWeapons" >> _laser >> "ACE_laserpointer"); + GVAR(laserClassesCache) setVariable [_laser, _laserID]; + }; + TRACE_3("",_weapon,_laser,_laserID); + + if (_laserID isEqualTo 1) exitWith { + GVAR(redLaserUnits) pushBackUnique _unit; + GVAR(greenLaserUnits) deleteAt (GVAR(greenLaserUnits) find _unit); + }; + + if (_laserID isEqualTo 2) exitWith { + GVAR(greenLaserUnits) pushBackUnique _unit; + GVAR(redLaserUnits) deleteAt (GVAR(redLaserUnits) find _unit); + }; + }; + + // custom scheduler + [{ + params ["_fnc_processUnit"]; + + ACE_player call _fnc_processUnit; + + GVAR(index) = GVAR(index) + 1; + private _unit = GVAR(nearUnits) param [GVAR(index), objNull]; + + if (isNull _unit) exitWith { + GVAR(index) = -1; + }; + + _unit call _fnc_processUnit; + }, 0.1, _fnc_processUnit] call CBA_fnc_addPerFrameHandler; + + addMissionEventHandler ["Draw3D", {call FUNC(onDraw)}]; }] call CBA_fnc_addEventHandler; diff --git a/addons/laserpointer/XEH_preInit.sqf b/addons/laserpointer/XEH_preInit.sqf index a7feade1c3..d2efe43e9c 100644 --- a/addons/laserpointer/XEH_preInit.sqf +++ b/addons/laserpointer/XEH_preInit.sqf @@ -2,6 +2,15 @@ ADDON = false; +PREP_RECOMPILE_START; #include "XEH_PREP.hpp" +PREP_RECOMPILE_END; + +["visionMode", { + params ["", "_visionMode"]; + + GVAR(isIR) = _visionMode isEqualTo 1; + GVAR(isTI) = _visionMode isEqualTo 2; +}] call CBA_fnc_addPlayerEventHandler; ADDON = true; diff --git a/addons/laserpointer/functions/fnc_drawLaserpoint.sqf b/addons/laserpointer/functions/fnc_drawLaserpoint.sqf index 3ea9ed158b..f5320d2c63 100644 --- a/addons/laserpointer/functions/fnc_drawLaserpoint.sqf +++ b/addons/laserpointer/functions/fnc_drawLaserpoint.sqf @@ -85,7 +85,7 @@ private _size = 2 * sqrt (1 / _distance) * (call EFUNC(common,getZoom)); drawIcon3D [ format ["\a3\weapons_f\acc\data\collimdot_%1_ca.paa", ["red", "green"] select _isGreen], - [[1,0.25,0.25,0.5*_brightness], [0.25,1,0.25,0.5*_brightness]] select _isGreen, + [[1,0.25,0.25,0.6*_brightness], [0.25,1,0.25,0.5*_brightness]] select _isGreen, _pL, _size, _size, diff --git a/addons/laserpointer/functions/fnc_getNearUnits.sqf b/addons/laserpointer/functions/fnc_getNearUnits.sqf new file mode 100644 index 0000000000..baeb07c86e --- /dev/null +++ b/addons/laserpointer/functions/fnc_getNearUnits.sqf @@ -0,0 +1,29 @@ +/* + * Author: commy2 + * Reports near units. + * + * Arguments: + * None + * + * Return Value: + * Near Units + * + * Example: + * call ACE_laserpointer_fnc_getNearUnits + * + * Public: No + */ +#include "script_component.hpp" + +private _camPosAGL = positionCameraToWorld [0, 0, 0]; + +// handle RHS / bugged vehicle slots +if !((_camPosAGL select 0) isEqualType 0) exitWith { [] }; + +private _nearUnits = []; + +{ + _nearUnits append crew _x; +} forEach nearestObjects [_camPosAGL, ["AllVehicles"], MAX_LASER_RANGE]; + +_nearUnits diff --git a/addons/laserpointer/functions/fnc_onDraw.sqf b/addons/laserpointer/functions/fnc_onDraw.sqf index 1945dcf2b7..06c601869c 100644 --- a/addons/laserpointer/functions/fnc_onDraw.sqf +++ b/addons/laserpointer/functions/fnc_onDraw.sqf @@ -8,34 +8,24 @@ * Return Value: * None * + * Example: + * call ACE_laserpointer_fnc_onDraw + * * Public: No */ #include "script_component.hpp" -private _isIR = currentVisionMode ACE_player; +// no lasers in thermal mode +if !(GVAR(isTI)) then { + private _brightness = 2 - call EFUNC(common,ambientBrightness); -if (_isIR == 2) exitWith {}; + { + // red laser. draw green dot anyway in IR mode + [_x, 100, GVAR(isIR), _brightness] call FUNC(drawLaserpoint); + } count GVAR(redLaserUnits); -_isIR = _isIR == 1; - -private _brightness = 2 - call EFUNC(common,ambientBrightness); - -{ - private _weapon = currentWeapon _x; - private _laser = (_x weaponAccessories _weapon) select 1; - - if (_laser != "") then { - private _cacheName = format [QGVAR(laser_%1), _laser]; - private _laserID = missionNamespace getVariable [_cacheName, -1]; - - if (missionNamespace getVariable [_cacheName, -1] == -1) then { - _laserID = getNumber (configFile >> "CfgWeapons" >> _laser >> "ACE_laserpointer"); - missionNamespace setVariable [_cacheName, _laserID]; - }; - - if (_laserID > 0 && {_x isFlashlightOn _weapon}) then { - [_x, 100, (_laserID == 2 || _isIR), _brightness] call FUNC(drawLaserpoint); - }; - }; - false -} count GVAR(nearUnits); + { + // green laser + [_x, 100, true, _brightness] call FUNC(drawLaserpoint); + } count GVAR(greenLaserUnits); +}; diff --git a/addons/laserpointer/functions/fnc_switchLaserLightMode.sqf b/addons/laserpointer/functions/fnc_switchLaserLightMode.sqf deleted file mode 100644 index 2469f64352..0000000000 --- a/addons/laserpointer/functions/fnc_switchLaserLightMode.sqf +++ /dev/null @@ -1,54 +0,0 @@ -/* - * Author: Commy2 - * Switch between laser modes. - * - * Arguments: - * 0: Unit - * 1: Weapon - * - * Return Value: - * None - * - * Public: No - */ -#include "script_component.hpp" - -params ["_unit", "_weapon"]; - -private _pointer = (_unit weaponAccessories _weapon) select 1; - -if (_pointer == "") exitWith {}; - -private _config = configFile >> "CfgWeapons" >> _pointer; - -private _nextPointer = getText (_config >> "ACE_nextModeClass"); - -if (_nextPointer == "") exitWith {}; - -//If system disabled, don't switch to a laser: -private _nextPointerIsLaser = getNumber (configFile >> "CfgWeapons" >> _nextPointer >> "ACE_laserpointer"); -if ((!GVAR(enabled)) && {_nextPointerIsLaser == 1}) exitWith {}; - -// disable inheritance for this entry, because addons claim this as a base class for convenience -if !((_config >> "ACE_nextModeClass") in configProperties [_config, "true", false]) exitWith {}; - -_unit addWeaponItem [_weapon, _nextPointer]; - -private _error = false; - -if ((_unit weaponAccessories _weapon) select 1 != _nextPointer) then { - ERROR("NextPointer not compatible"); - _unit addWeaponItem [_weapon, _pointer]; - _error = true; -}; - -if (!_error) then { - private _description = getText (configFile >> "CfgWeapons" >> _nextPointer >> "ACE_modeDescription"); - private _picture = getText (configFile >> "CfgWeapons" >> _nextPointer >> "picture"); - - [_description, _picture] call EFUNC(common,displayTextPicture); -} else { - ERROR_3("Failed to add %1 to %2 - reverting to %3",_nextPointer,_weapon,_pointer); -}; - -playSound "ACE_Sound_Click"; diff --git a/addons/laserpointer/initKeybinds.sqf b/addons/laserpointer/initKeybinds.sqf deleted file mode 100644 index 2251ddfb71..0000000000 --- a/addons/laserpointer/initKeybinds.sqf +++ /dev/null @@ -1,13 +0,0 @@ -// by commy2 - -["ACE3 Weapons", QGVAR(switchLaserLightMode), localize LSTRING(switchLaserLight), -{ - // Conditions: canInteract - if !([ACE_player, objNull, ["isNotInside", "isNotSitting"]] call EFUNC(common,canInteractWith)) exitWith {false}; - // Conditions: specific - if !([ACE_player] call CBA_fnc_canUseWeapon) exitWith {false}; - - [ACE_player, currentWeapon ACE_player] call FUNC(switchLaserLightMode); - true -}, -{false}, [38, [false, true, false]], false] call CBA_fnc_addKeybind; diff --git a/addons/laserpointer/script_component.hpp b/addons/laserpointer/script_component.hpp index b6323308fd..4b7b2e0d39 100644 --- a/addons/laserpointer/script_component.hpp +++ b/addons/laserpointer/script_component.hpp @@ -15,3 +15,5 @@ #endif #include "\z\ace\addons\main\script_macros.hpp" + +#define MAX_LASER_RANGE 50 diff --git a/addons/laserpointer/stringtable.xml b/addons/laserpointer/stringtable.xml index a28ea0aec7..88228dc289 100644 --- a/addons/laserpointer/stringtable.xml +++ b/addons/laserpointer/stringtable.xml @@ -1,4 +1,4 @@ - + @@ -13,6 +13,9 @@ Puntatore laser (rosso) Laser (vermelho) レーザ ポインタ (赤) + 레이저 지시기 (빨강) + 雷射指示器 (红色) + 雷射指示器 (紅色) Laser Pointer (green) @@ -26,6 +29,9 @@ Puntatore laser (verde) Laser (verde) レーザ ポインタ (緑) + 레이저 지시기 (초록) + 雷射指示器 (绿色) + 雷射指示器 (綠色) Emits visible light. @@ -39,6 +45,9 @@ Emette luce visibile. Emite luz visível. 可視光をだします。 + 밝은 곳에서도 보임 + 发射出可见光 + 發射出可見光 <t color='#9cf953'>Use: </t>Turn Laser ON/OFF @@ -51,7 +60,10 @@ <t color='#9cf953'>Использовать: </t>ВКЛ/ВЫКЛ лазер <t color='#9cf953'>Usar: </t>Encender/Apagar láser <t color='#9cf953'>Használat: </t>Lézer BE/KI kapcsolása - &lt;t color='#9cf953'&gt;つかう: &lt;/t&gt;レーザの起動/停止 + <t color='#9cf953'>つかう: </t>レーザの起動/停止 + <t color='#9cf953'>사용키: </t>레이저 켜기/끄기 + <t color='#9cf953'>使用: </t>雷射开启/关闭 + <t color='#9cf953'>使用: </t>雷射開啟/關閉 Laser @@ -65,6 +77,9 @@ Laser Laser レーザ + 레이저 + 雷射 + 雷射 IR Laser @@ -78,6 +93,9 @@ IR Laser Laser IV 赤外線レーザ + 적외선 레이저 + 红外线雷射 + 紅外線雷射 Switch Laser / IR Laser @@ -91,6 +109,9 @@ Přepnout Laser / Infračervený Laser Alternar entre Laser / Laser IV レーザ/赤外線レーザを切り替える + 레이저 / 적외선 레이저 전환 + 切换雷射/红外线雷射 + 切換雷射/紅外線雷射 - \ No newline at end of file + diff --git a/addons/logistics_uavbattery/CfgVehicles.hpp b/addons/logistics_uavbattery/CfgVehicles.hpp index 2daa8c8011..f36736fac9 100644 --- a/addons/logistics_uavbattery/CfgVehicles.hpp +++ b/addons/logistics_uavbattery/CfgVehicles.hpp @@ -15,11 +15,20 @@ class CfgVehicles { class ACE_MainActions: ACE_MainActions { class GVAR(RefuelUAV) { displayName = CSTRING(Recharge); - distance = 4; condition = QUOTE([ARR_2(_player, _target)] call FUNC(canRefuelUAV)); statement = QUOTE([ARR_2(_player, _target)] call FUNC(refuelUAV)); - showDisabled = 0; - priority = 1.245; + icon = QPATHTOF(ui\UAV_battery_ca.paa); + }; + }; + }; + }; + class UAV_06_base_F: Helicopter_Base_F { + class ACE_Actions: ACE_Actions{ + class ACE_MainActions: ACE_MainActions { + class GVAR(RefuelUAV) { + displayName = CSTRING(Recharge); + condition = QUOTE([ARR_2(_player, _target)] call FUNC(canRefuelUAV)); + statement = QUOTE([ARR_2(_player, _target)] call FUNC(refuelUAV)); icon = QPATHTOF(ui\UAV_battery_ca.paa); }; }; diff --git a/addons/logistics_uavbattery/CfgWeapons.hpp b/addons/logistics_uavbattery/CfgWeapons.hpp index 8beedff39b..2e55bccd37 100644 --- a/addons/logistics_uavbattery/CfgWeapons.hpp +++ b/addons/logistics_uavbattery/CfgWeapons.hpp @@ -1,5 +1,5 @@ class CfgWeapons { - class InventoryItem_Base_F; + class CBA_MiscItem_ItemInfo; class ACE_ItemCore; class ACE_UAVBattery: ACE_ItemCore { @@ -8,7 +8,7 @@ class CfgWeapons { descriptionShort = CSTRING(Battery_Description); model = QPATHTOF(data\ace_battery.p3d); picture = QPATHTOF(ui\UAV_battery_ca.paa); - class ItemInfo: InventoryItem_Base_F { + class ItemInfo: CBA_MiscItem_ItemInfo { mass = 20; }; }; diff --git a/addons/logistics_uavbattery/XEH_preInit.sqf b/addons/logistics_uavbattery/XEH_preInit.sqf index a7feade1c3..b47cf6628d 100644 --- a/addons/logistics_uavbattery/XEH_preInit.sqf +++ b/addons/logistics_uavbattery/XEH_preInit.sqf @@ -2,6 +2,8 @@ ADDON = false; +PREP_RECOMPILE_START; #include "XEH_PREP.hpp" +PREP_RECOMPILE_END; ADDON = true; diff --git a/addons/logistics_uavbattery/functions/fnc_refuelUAV.sqf b/addons/logistics_uavbattery/functions/fnc_refuelUAV.sqf index 2bf617478d..2e83043d00 100644 --- a/addons/logistics_uavbattery/functions/fnc_refuelUAV.sqf +++ b/addons/logistics_uavbattery/functions/fnc_refuelUAV.sqf @@ -7,7 +7,7 @@ * 1: UAV * * Return Value: - * Nothing + * None * * Example: * [player, theUAV] call ace_logistics_uavbattery_fnc_refuelUAV diff --git a/addons/logistics_uavbattery/stringtable.xml b/addons/logistics_uavbattery/stringtable.xml index 9118cc3e3a..409a692029 100644 --- a/addons/logistics_uavbattery/stringtable.xml +++ b/addons/logistics_uavbattery/stringtable.xml @@ -13,6 +13,9 @@ Il drone è pieno БПЛА полностью заряжен ドローンは充電完了 + 드론 충전완료 + 无人载具电池已充满 + 無人載具電池已充滿 You need a UAV Battery @@ -26,6 +29,9 @@ Hai bisogno di una Batteria UAV Требуется аккумулятор для БПЛА UAV バッテリが必要です + UAV 배터리가 필요합니다 + 你需要一个无人载具电池 + 你需要一個無人載具電池 Recharge @@ -39,6 +45,9 @@ Ricarica Зарядить 充電 + 재충전 + 充电 + 充電 UAV Battery @@ -52,6 +61,9 @@ Batteria UAV Аккумулятор БПЛА UAV バッテリ + UAV 배터리 + 无人载具电池 + 無人載具電池 Used to refuel Carried UAV's @@ -65,6 +77,9 @@ Usata per ricaricare la Batteria dell'UAV Используется для зарядки переносных БПЛА 運んでいる UAV を充電に使う + UAV를 재충전 할때 씁니다. + 对可携式无人载具进行充电 + 對可攜式無人載具進行充電 Recharging... @@ -78,6 +93,9 @@ In ricarica... Заряжается... 充電中 + 充电中... + 充電中... + 충전중... - \ No newline at end of file + diff --git a/addons/logistics_wirecutter/CfgWeapons.hpp b/addons/logistics_wirecutter/CfgWeapons.hpp index 2cb7e7b7b1..1eebf82877 100644 --- a/addons/logistics_wirecutter/CfgWeapons.hpp +++ b/addons/logistics_wirecutter/CfgWeapons.hpp @@ -1,5 +1,5 @@ class CfgWeapons { - class InventoryItem_Base_F; + class CBA_MiscItem_ItemInfo; class ACE_ItemCore; class ACE_wirecutter: ACE_ItemCore { @@ -9,7 +9,7 @@ class CfgWeapons { model = QPATHTOF(data\ace_wirecutter.p3d); picture = QPATHTOF(ui\item_wirecutter_ca.paa); scope = 2; - class ItemInfo: InventoryItem_Base_F { + class ItemInfo: CBA_MiscItem_ItemInfo { mass = 25; }; }; diff --git a/addons/logistics_wirecutter/XEH_preInit.sqf b/addons/logistics_wirecutter/XEH_preInit.sqf index a7feade1c3..b47cf6628d 100644 --- a/addons/logistics_wirecutter/XEH_preInit.sqf +++ b/addons/logistics_wirecutter/XEH_preInit.sqf @@ -2,6 +2,8 @@ ADDON = false; +PREP_RECOMPILE_START; #include "XEH_PREP.hpp" +PREP_RECOMPILE_END; ADDON = true; diff --git a/addons/logistics_wirecutter/functions/fnc_cutDownFence.sqf b/addons/logistics_wirecutter/functions/fnc_cutDownFence.sqf index 2bf807975f..e371be405f 100644 --- a/addons/logistics_wirecutter/functions/fnc_cutDownFence.sqf +++ b/addons/logistics_wirecutter/functions/fnc_cutDownFence.sqf @@ -7,7 +7,7 @@ * 1: Fence * * Return Value: - * Nothing + * None * * Example: * [player, berlinWall] call ace_logistics_wirecutter_fnc_cutDownFence @@ -19,37 +19,41 @@ params ["_unit", "_fenceObject"]; TRACE_2("params",_unit,_fenceObject); -private ["_timeToCut", "_progressCheck", "_onCompletion", "_onFail"]; - if (_unit != ACE_player) exitWith {}; -_timeToCut = if ([ACE_player] call EFUNC(common,isEngineer)) then {7.5} else {11}; +private _timeToCut = if ([_unit] call EFUNC(common,isEngineer)) then {7.5} else {11}; -[ACE_player, "AinvPknlMstpSnonWnonDr_medic5", 0] call EFUNC(common,doAnimation); +if !(_unit call EFUNC(common,isSwimming)) then { + [_unit, "AinvPknlMstpSnonWnonDr_medic5", 0] call EFUNC(common,doAnimation); +}; -_onCompletion = { +private _onCompletion = { TRACE_1("_onCompletion",_this); (_this select 0) params ["_fenceObject", "", "_unit"]; _fenceObject setdamage 1; - [_unit, "AmovPknlMstpSrasWrflDnon", 1] call EFUNC(common,doAnimation); + if !(_unit call EFUNC(common,isSwimming)) then { + [_unit, "AmovPknlMstpSrasWrflDnon", 1] call EFUNC(common,doAnimation); + }; }; -_onFail = { +private _onFail = { TRACE_1("_onFail", _this); (_this select 0) params ["", "", "_unit"]; - [_unit, "AmovPknlMstpSrasWrflDnon", 1] call EFUNC(common,doAnimation); + if !(_unit call EFUNC(common,isSwimming)) then { + [_unit, "AmovPknlMstpSrasWrflDnon", 1] call EFUNC(common,doAnimation); + }; }; -_progressCheck = { +private _progressCheck = { params ["_args", "_passedTime"]; - _args params ["_fenceObject", "_lastSoundEffectTime"]; + _args params ["_fenceObject", "_lastSoundEffectTime", "_unit"]; if (_passedTime > (_lastSoundEffectTime + SOUND_CLIP_TIME_SPACEING)) then { - playSound3D [QUOTE(PATHTO_R(sound\wirecut.ogg)), objNull, false, (getPosASL ACE_player), 3, 1, 10]; + playSound3D [QUOTE(PATHTO_R(sound\wirecut.ogg)), objNull, false, (getPosASL _unit), 3, 1, 10]; _args set [1, _passedTime]; }; - ((!isNull _fenceObject) && {(damage _fenceObject) < 1} && {("ACE_wirecutter" in (items ACE_player))}) + ((!isNull _fenceObject) && {(damage _fenceObject) < 1} && {("ACE_wirecutter" in (items _unit))}) }; -[_timeToCut, [_fenceObject,0,_unit], _onCompletion, _onFail, localize LSTRING(CuttingFence), _progressCheck] call EFUNC(common,progressBar); +[_timeToCut, [_fenceObject,0,_unit], _onCompletion, _onFail, localize LSTRING(CuttingFence), _progressCheck, ["isNotSwimming"]] call EFUNC(common,progressBar); diff --git a/addons/logistics_wirecutter/functions/fnc_interactEH.sqf b/addons/logistics_wirecutter/functions/fnc_interactEH.sqf index bf0f5d3bc9..74f59a8104 100644 --- a/addons/logistics_wirecutter/functions/fnc_interactEH.sqf +++ b/addons/logistics_wirecutter/functions/fnc_interactEH.sqf @@ -6,7 +6,7 @@ * Interact Menu Type (0 - world, 1 - self) * * Return Value: - * Nothing + * None * * Example: * [0] call ace_logistics_wirecutter_fnc_interactEH @@ -27,7 +27,6 @@ if (!("ACE_wirecutter" in (items ace_player))) exitWith {}; TRACE_1("Starting wire-cut action PFEH",_interactionType); [{ - private ["_fncStatement", "_attachedFence", "_fncCondition", "_helper", "_action"]; params ["_args", "_pfID"]; _args params ["_setPosition", "_addedHelpers", "_fencesHelped"]; @@ -41,13 +40,13 @@ TRACE_1("Starting wire-cut action PFEH",_interactionType); //If player moved >5 meters from last pos, then rescan if (((getPosASL ace_player) distance _setPosition) > 5) then { - _fncStatement = { + private _fncStatement = { params ["", "_player", "_attachedFence"]; [_player, _attachedFence] call FUNC(cutDownFence); }; - _fncCondition = { + private _fncCondition = { params ["_helper", "_player", "_attachedFence"]; - if (!([_player, _attachedFence, []] call EFUNC(common,canInteractWith))) exitWith {false}; + if (!([_player, _attachedFence, ["isNotSwimming"]] call EFUNC(common,canInteractWith))) exitWith {false}; ((!isNull _attachedFence) && {(damage _attachedFence) < 1} && {("ACE_wirecutter" in (items _player))} && { //Custom LOS check for fence private _headPos = ACE_player modelToWorldVisual (ACE_player selectionPosition "pilot"); @@ -60,8 +59,8 @@ TRACE_1("Starting wire-cut action PFEH",_interactionType); if (!(_x in _fencesHelped)) then { if ([_x] call FUNC(isFence)) then { _fencesHelped pushBack _x; - _helper = "ACE_LogicDummy" createVehicleLocal (getpos _x); - _action = [QGVAR(helperCutFence), (localize LSTRING(CutFence)), QPATHTOF(ui\wirecutter_ca.paa), _fncStatement, _fncCondition, {}, _x, {[0,0,0]}, 5.5, [false, false, false, false, true]] call EFUNC(interact_menu,createAction); + private _helper = "ACE_LogicDummy" createVehicleLocal (getpos _x); + private _action = [QGVAR(helperCutFence), (localize LSTRING(CutFence)), QPATHTOF(ui\wirecutter_ca.paa), _fncStatement, _fncCondition, {}, _x, {[0,0,0]}, 5.5, [false, false, false, false, true]] 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/stringtable.xml b/addons/logistics_wirecutter/stringtable.xml index 3f79ed6bfd..53c5e21b14 100644 --- a/addons/logistics_wirecutter/stringtable.xml +++ b/addons/logistics_wirecutter/stringtable.xml @@ -1,4 +1,4 @@ - + @@ -13,6 +13,9 @@ Trancia Cortador de Arame ワイヤーカッター + 절단기 + 剪铁丝网钳 + 剪鐵絲網鉗 Wirecutter @@ -23,9 +26,12 @@ Służą do cięcia drutu i płotów Pince coupante Drótok, huzalok, és kábelek vágására alkalmas olló. - Trancia da ferro + Tronchese Cortador de Arame ワイヤーカッター + 절단기 + 剪铁丝网钳 + 剪鐵絲網鉗 Cut Fence @@ -39,6 +45,9 @@ Drótkerítés átvágása Разрезать забор フェンスを切断する + 철조망 자르기 + 剪断护栏 + 剪斷護欄 Cutting Fences / Wires... @@ -52,6 +61,9 @@ Drótok elvágása... Разрезаем забор / провода... フェンス/ワイヤを切断中・・・ + 철망/철조망 자르는중... + 剪断护栏/刺网中... + 剪斷護欄/刺網中... Fence cut @@ -65,6 +77,9 @@ Drótkerítés átvágva Забор разрезан フェンスを切断した + 절단됨 + 护栏已被剪断 + 護欄已被剪斷 - \ No newline at end of file + diff --git a/addons/magazinerepack/CfgVehicles.hpp b/addons/magazinerepack/CfgVehicles.hpp index 0bf4833bf0..2c8ef81608 100644 --- a/addons/magazinerepack/CfgVehicles.hpp +++ b/addons/magazinerepack/CfgVehicles.hpp @@ -5,10 +5,10 @@ class CfgVehicles { class ACE_RepackMagazines { displayName = CSTRING(RepackMagazines); condition = QUOTE(true); - exceptions[] = {"isNotInside", "isNotSitting"}; + exceptions[] = {"isNotInside", "isNotSwimming", "isNotSitting"}; insertChildren = QUOTE(_this call FUNC(getMagazineChildren)); priority = -2; - icon = QPATHTOF(UI\repack_ca.paa); + icon = QPATHTOEF(common,UI\repack_ca.paa); }; }; }; diff --git a/addons/magazinerepack/XEH_preInit.sqf b/addons/magazinerepack/XEH_preInit.sqf index a7feade1c3..b47cf6628d 100644 --- a/addons/magazinerepack/XEH_preInit.sqf +++ b/addons/magazinerepack/XEH_preInit.sqf @@ -2,6 +2,8 @@ ADDON = false; +PREP_RECOMPILE_START; #include "XEH_PREP.hpp" +PREP_RECOMPILE_END; ADDON = true; diff --git a/addons/magazinerepack/functions/fnc_magazineRepackFinish.sqf b/addons/magazinerepack/functions/fnc_magazineRepackFinish.sqf index 36544b0084..286db1389b 100644 --- a/addons/magazinerepack/functions/fnc_magazineRepackFinish.sqf +++ b/addons/magazinerepack/functions/fnc_magazineRepackFinish.sqf @@ -25,11 +25,12 @@ _args params ["_magazineClassname", "_lastAmmoCount"]; private _fullMagazineCount = getNumber (configFile >> "CfgMagazines" >> _magazineClassname >> "count"); // Don't show anything if player can't interact -if (!([ACE_player, objNull, ["isNotInside", "isNotSitting"]] call EFUNC(common,canInteractWith))) exitWith {}; +if (!([ACE_player, objNull, ["isNotInside", "isNotSitting", "isNotSwimming"]] call EFUNC(common,canInteractWith))) exitWith {}; // Count mags private _fullMags = 0; private _partialMags = 0; +private _bulletsLeft = 0; { _x params ["_classname", "_count"]; @@ -38,15 +39,16 @@ private _partialMags = 0; _fullMags = _fullMags + 1; } else { _partialMags = _partialMags + 1; + _bulletsLeft = _count; }; }; } forEach (magazinesAmmoFull ACE_player); -private _repackedMagsText = format [localize LSTRING(RepackedMagazinesCount), _fullMags, _partialMags]; - private _structuredOutputText = if (_errorCode == 0) then { + private _repackedMagsText = format [localize LSTRING(RepackedMagazinesDetail), _fullMags, _bulletsLeft]; format ["%1
%2", localize LSTRING(RepackComplete), _repackedMagsText]; } else { + private _repackedMagsText = format [localize LSTRING(RepackedMagazinesCount), _fullMags, _partialMags]; format ["%1
%2", localize LSTRING(RepackInterrupted), _repackedMagsText]; }; diff --git a/addons/magazinerepack/functions/fnc_magazineRepackProgress.sqf b/addons/magazinerepack/functions/fnc_magazineRepackProgress.sqf index 3808df4cdc..ddc7ca4fa8 100644 --- a/addons/magazinerepack/functions/fnc_magazineRepackProgress.sqf +++ b/addons/magazinerepack/functions/fnc_magazineRepackProgress.sqf @@ -18,7 +18,7 @@ */ #include "script_component.hpp" -params ["_ars", "_elapsedTime", "_totalTime"]; +params ["_args", "_elapsedTime", "_totalTime"]; _args params ["_magazineClassname", "_lastAmmoCount", "_simEvents"]; if !((_simEvents select 0) params ["_nextEventTime", "_nextEventIsBullet", "_nextEventMags"]) exitWith { ERROR("No Event"); false }; diff --git a/addons/magazinerepack/functions/fnc_simulateRepackEvents.sqf b/addons/magazinerepack/functions/fnc_simulateRepackEvents.sqf index 09c04de26e..a96fa2dead 100644 --- a/addons/magazinerepack/functions/fnc_simulateRepackEvents.sqf +++ b/addons/magazinerepack/functions/fnc_simulateRepackEvents.sqf @@ -26,6 +26,7 @@ _arrayOfAmmoCounts = +_arrayOfAmmoCounts; _arrayOfAmmoCounts sort true; private _fnc_newMag = { + //IGNORE_PRIVATE_WARNING ["_time", "_events"]; _time = _time + GVAR(TimePerMagazine); _events pushBack [_time, false, +_arrayOfAmmoCounts]; }; diff --git a/addons/magazinerepack/functions/fnc_startRepackingMagazine.sqf b/addons/magazinerepack/functions/fnc_startRepackingMagazine.sqf index 32ce65d188..e87fc5f221 100644 --- a/addons/magazinerepack/functions/fnc_startRepackingMagazine.sqf +++ b/addons/magazinerepack/functions/fnc_startRepackingMagazine.sqf @@ -10,7 +10,7 @@ * 2: Magazine Classname * * Return Value: - * Nothing + * None * * Example: * [player, player, "30Rnd_65x39_caseless_mag"] call ace_magazinerepack_fnc_startRepackingMagazine @@ -29,7 +29,7 @@ private _fullMagazineCount = getNumber (_magazineCfg >> "count"); private _isBelt = isNumber (_magazineCfg >> "ACE_isBelt") && {(getNumber (_magazineCfg >> "ACE_isBelt")) == 1}; //Check canInteractWith: -if !([_player, objNull, ["isNotInside", "isNotSitting"]] call EFUNC(common,canInteractWith)) exitWith {}; +if !([_player, objNull, ["isNotInside", "isNotSwimming", "isNotSitting"]] call EFUNC(common,canInteractWith)) exitWith {}; [_player] call EFUNC(common,goKneeling); @@ -67,5 +67,5 @@ private _totalTime = _simEvents select (count _simEvents - 1) select 0; {_this call FUNC(magazineRepackFinish)}, (localize LSTRING(RepackingMagazine)), {_this call FUNC(magazineRepackProgress)}, - ["isNotInside", "isNotSitting"] + ["isNotInside", "isNotSwimming", "isNotSitting"] ] call EFUNC(common,progressBar); diff --git a/addons/magazinerepack/stringtable.xml b/addons/magazinerepack/stringtable.xml index c655774398..10e806b316 100644 --- a/addons/magazinerepack/stringtable.xml +++ b/addons/magazinerepack/stringtable.xml @@ -1,4 +1,4 @@ - + @@ -13,32 +13,9 @@ Újratárazás Перепаковать магазины 弾倉を詰め替え - - - Select Magazine Menu - Magazinauswahlmenü - Menú de selección de cargador - Sélectionner le menu des chargeurs - Menu wyboru magazynków - Zvolit menu zásobníků - Seleziona menù di ricarica - Menu de Seleção de Carregador - Fegyvertár menü kiválasztás - Меню выбора магазинов - 弾倉メニューから選ぶ - - - Select Mag - Magazin auswählen - Seleccionar cargador - Sélectionner le chargeur - Wybierz magazynek - Vyber zásobník - Seleziona caricatore - Selecionar Carregador - Tár kiválasztása - Выбрать магазин - 弾倉を選択 + 탄창 다시 채우기 + 重新整理弹匣 + 重新整理彈匣 Repacking Magazines... @@ -52,19 +29,9 @@ Újratárazás... Перепаковка магазинов... 弾倉を詰め替え中・・・ - - - Repacked Magazines - Magazine umgepackt - Cargadores reorganizados - Chargeurs réorganisés - Magazynki przepakowane - Přepáskované zásobníky - Caricatore riempito - Carregadores Reorganizados - Újratárazott tárak - Магазины перепакованы - 弾倉の詰め替えが終わった + 다시 채우는중... + 重新整理弹匣中 ... + 重新整理彈匣中 ... %1 full mag(s) and %2 extra round(s) @@ -77,7 +44,10 @@ %1 carregador(es) cheio(s) e %2 disparo(s) a mais %1 teljes tár és %2 extra lőszer %1 полных магазина(ов) и %2 патрона(ов) - %1 個の満杯な弾倉と入りきらなかった %2 個の弾倉 + %1 個の満杯な弾倉と入りきらなかった %2 発の弾薬 + %1개의 꽉찬 탄창과 %2발의 총알이 남았다 + %1个满的弹匣与%2发额外子弹 + %1個滿的彈匣與%2發額外子彈 Repacking Finished @@ -91,6 +61,9 @@ Caricatori riempiti Reorganização Terminada 詰め替えが完了 + 탄창 채우기 끝남 + 重整完成 + 重整完成 Repacking Interrupted @@ -104,11 +77,14 @@ Riempimento interrotto Reorganização Interrompida 詰め替えを中断した + 탄창 채우기 방해받음 + 重整被中断 + 重整被中斷 %1 Full and %2 Partial %1 plein(s) et %2 partiel(s) - %1 volle Magazine und 1 Magazin mit %2 Partronen + %1 volle(s) Magazin(e) und %2 angefangene(s) Magazin(e) %1 Llenos y %2 Incompletos %1 полных и %2 неполных %1 plný a %2 částečně @@ -116,7 +92,10 @@ %1 teljes és %2 részleges %1 pieno(i) e %2 parziale(i) %1 Total e %2 Parcial - %1 個の満杯で、 %2 の余分数 + %1 個の満杯と %2 個の弾薬入り弾倉 + %1 꽉찼고 %2 부분참 + %1个满的与%2个部分的 + %1個滿的與%2個部分的 - \ No newline at end of file + diff --git a/addons/main/CfgSettings.hpp b/addons/main/CfgSettings.hpp index 58cb824a6f..dcb78ffb60 100644 --- a/addons/main/CfgSettings.hpp +++ b/addons/main/CfgSettings.hpp @@ -10,6 +10,7 @@ class CfgSettings { //Warnings for missing RHS compat pbos compat_rhs_afrf3[] = {"ace_compat_rhs_afrf3", {VERSION_AR}, "isClass (configFile >> 'CfgPatches' >> 'rhs_main')"}; compat_rhs_usf3[] = {"ace_compat_rhs_usf3", {VERSION_AR}, "isClass (configFile >> 'CfgPatches' >> 'rhsusf_main')"}; + compat_rhs_gref3[] = {"ace_compat_rhs_gref3", {VERSION_AR}, "isClass (configFile >> 'CfgPatches' >> 'rhsgref_main')"}; }; }; }; diff --git a/addons/main/config.cpp b/addons/main/config.cpp index 5d485b6fd9..15a4a0edcb 100644 --- a/addons/main/config.cpp +++ b/addons/main/config.cpp @@ -7,6 +7,20 @@ class CfgPatches { weapons[] = {}; requiredVersion = REQUIRED_VERSION; requiredAddons[] = { + "A3_Data_F_Loadorder", + "A3_Data_F_Curator_Loadorder", + "A3_Data_F_Kart_Loadorder", + "A3_Data_F_Bootcamp_Loadorder", + "A3_Data_F_Heli_Loadorder", + "A3_Data_F_Mark_Loadorder", + "A3_Data_F_Exp_A_Loadorder", + "A3_Data_F_Exp_B_Loadorder", + "A3_Data_F_Exp_Loadorder", + "A3_Data_F_Jets_Loadorder", + "A3_Data_F_Argo_Loadorder", + "A3_Data_F_Patrol_Loadorder", + "A3_Data_F_Orange_Loadorder", + // Vanilla "a3_3den", "a3_3den_language", diff --git a/addons/main/script_debug.hpp b/addons/main/script_debug.hpp index 92f58e1f96..bb08e34e09 100644 --- a/addons/main/script_debug.hpp +++ b/addons/main/script_debug.hpp @@ -1,3 +1,20 @@ +/** +Fast Recompiling via function +**/ +// #define DISABLE_COMPILE_CACHE +// To Use: [] call ACE_PREP_RECOMPILE; + +#ifdef DISABLE_COMPILE_CACHE + #define LINKFUNC(x) {_this call FUNC(x)} + #define PREP_RECOMPILE_START if (isNil "ACE_PREP_RECOMPILE") then {ACE_RECOMPILES = []; ACE_PREP_RECOMPILE = {{call _x} forEach ACE_RECOMPILES;}}; private _recomp = { + #define PREP_RECOMPILE_END }; call _recomp; ACE_RECOMPILES pushBack _recomp; +#else + #define LINKFUNC(x) FUNC(x) + #define PREP_RECOMPILE_START /* */ + #define PREP_RECOMPILE_END /* */ +#endif + + /** STACK TRACING **/ @@ -6,12 +23,12 @@ 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 CALLSTACK(function) {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'; private _ret = _this call ##function; ACE_STACK_DEPTH = ACE_STACK_DEPTH - 1; ACE_IS_ERRORED = false; _ret;} + #define CALLSTACK_NAMED(function, functionName) {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; private _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) {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)'; private _ret = _this call TRIPLES(ADDON,fnc,var1); ACE_STACK_DEPTH = ACE_STACK_DEPTH - 1; ACE_IS_ERRORED = false; _ret;} + #define EFUNC(var1,var2) {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)'; private _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 @@ -23,6 +40,7 @@ STACK TRACING PERFORMANCE COUNTERS SECTION **/ //#define ENABLE_PERFORMANCE_COUNTERS +// To Use: [] call ace_common_fnc_dumpPerformanceCounters; #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 } diff --git a/addons/main/script_mod.hpp b/addons/main/script_mod.hpp index 6f9d0e5a6b..cd6d49c4e1 100644 --- a/addons/main/script_mod.hpp +++ b/addons/main/script_mod.hpp @@ -3,17 +3,14 @@ #define MAINPREFIX z #define PREFIX ace -#define MAJOR 3 -#define MINOR 7 -#define PATCHLVL 0 -#define BUILD 6 +#include "script_version.hpp" #define VERSION MAJOR.MINOR.PATCHLVL.BUILD #define VERSION_AR MAJOR,MINOR,PATCHLVL,BUILD // MINIMAL required version for the Mod. Components can specify others.. -#define REQUIRED_VERSION 1.62 -#define REQUIRED_CBA_VERSION {3,1,0} +#define REQUIRED_VERSION 1.76 +#define REQUIRED_CBA_VERSION {3,4,1} #ifdef COMPONENT_BEAUTIFIED #define COMPONENT_NAME QUOTE(ACE3 - COMPONENT_BEAUTIFIED) diff --git a/addons/main/script_version.hpp b/addons/main/script_version.hpp new file mode 100644 index 0000000000..709e29f4ab --- /dev/null +++ b/addons/main/script_version.hpp @@ -0,0 +1,4 @@ +#define MAJOR 3 +#define MINOR 11 +#define PATCHLVL 0 +#define BUILD 26 diff --git a/addons/main/stringtable.xml b/addons/main/stringtable.xml index 48ae8dd539..7e6a6fb76a 100644 --- a/addons/main/stringtable.xml +++ b/addons/main/stringtable.xml @@ -12,6 +12,9 @@ Logistica ACE ACE Logistique ACE ロジスティクス + ACE 后勤 + ACE 後勤 + ACE 논리 http://ace3mod.com/ @@ -25,6 +28,8 @@ http://ace3mod.com/ http://ace3mod.com/ http://ace3mod.com/ + http://ace3mod.com/ + http://ace3mod.com/ - \ No newline at end of file + diff --git a/addons/map/CfgLights.hpp b/addons/map/CfgLights.hpp index bd69f9acbf..c5ebc8e054 100644 --- a/addons/map/CfgLights.hpp +++ b/addons/map/CfgLights.hpp @@ -1,7 +1,7 @@ class CfgLights { - + class Chemlight_Blue; - + class ACE_FlashlightLight_White: Chemlight_Blue { brightness = 100; color[] = {1,1,1,1}; @@ -16,20 +16,24 @@ class CfgLights { start = 0.075; }; }; - + class ACE_FlashlightLight_Red: ACE_FlashlightLight_White { diffuse[] = {1,0,0}; }; - + class ACE_FlashlightLight_Blue: ACE_FlashlightLight_White { diffuse[] = {0.25,0.25,1}; }; - + class ACE_FlashlightLight_Green: ACE_FlashlightLight_White { diffuse[] = {0,1,0}; }; - + class ACE_FlashlightLight_Yellow: ACE_FlashlightLight_White { diffuse[] = {1,1,0.4}; }; -}; \ No newline at end of file + + class ACE_FlashlightLight_Orange: ACE_FlashlightLight_White { + diffuse[] = {1,0.65,0}; + }; +}; diff --git a/addons/map/CfgMarkers.hpp b/addons/map/CfgMarkers.hpp index 0a04e4a691..3dd6463891 100644 --- a/addons/map/CfgMarkers.hpp +++ b/addons/map/CfgMarkers.hpp @@ -4,36 +4,7 @@ class CfgMarkers { // Reenable NATO symbols ... class b_unknown: Flag {scope = 2;}; - - // ... and disable all the useless ones - // If you think that some of these are needed, create an issue; But until - // there's a better way to place markers, there should be only the most - // important markers here. - // Keep in mind that all of these can still be placed in the editor. - class b_hq: b_unknown {scope = 1;}; - class b_installation: b_unknown {scope = 1;}; - class b_maint: b_unknown {scope = 1;}; - class b_med: b_unknown {scope = 1;}; - class b_service: b_unknown {scope = 1;}; - class b_support: b_unknown {scope = 1;}; - - class n_unknown: b_unknown {}; - class n_hq: n_unknown {scope = 1;}; - class n_installation: n_unknown {scope = 1;}; - class u_installation: n_unknown {scope = 1;}; // i have no idea... - class n_maint: n_unknown {scope = 1;}; - class n_med: n_unknown {scope = 1;}; - class n_service: n_unknown {scope = 1;}; - class n_support: n_unknown {scope = 1;}; - - class o_unknown: b_unknown {}; - class o_hq: o_unknown {scope = 1;}; - class o_installation: o_unknown {scope = 1;}; - class o_maint: o_unknown {scope = 1;}; - class o_med: o_unknown {scope = 1;}; - class o_service: o_unknown {scope = 1;}; - class o_support: o_unknown {scope = 1;}; - + // disable all civy markers (harbor etc.) class c_unknown: b_unknown {scope = 1;}; diff --git a/addons/map/XEH_postInitClient.sqf b/addons/map/XEH_postInitClient.sqf index 110d07ee0c..6f2f60fc0c 100644 --- a/addons/map/XEH_postInitClient.sqf +++ b/addons/map/XEH_postInitClient.sqf @@ -116,12 +116,53 @@ call FUNC(determineZoom); GVAR(hasWatch) = true; ["loadout", { - if (isNull (_this select 0)) exitWith { + params ["_unit"]; + if (isNull _unit) exitWith { GVAR(hasWatch) = true; }; GVAR(hasWatch) = false; { if (_x isKindOf ["ItemWatch", configFile >> "CfgWeapons"]) exitWith {GVAR(hasWatch) = true;}; false - } count (assignedItems ACE_player); -}] call CBA_fnc_addPlayerEventHandler; + } count (assignedItems _unit); +}, true] call CBA_fnc_addPlayerEventHandler; + + +// Vehicle map lighting: +GVAR(vehicleLightCondition) = {true}; +GVAR(vehicleExteriorTurrets) = []; +GVAR(vehicleLightColor) = [1,1,1,0]; + +["vehicle", { + params ["_unit", "_vehicle"]; + if ((isNull _vehicle) || {_unit == _vehicle}) exitWith {}; + private _cfg = configfile >> "CfgVehicles" >> (typeOf _vehicle); + GVAR(vehicleExteriorTurrets) = getArray (_cfg >> QGVAR(vehicleExteriorTurrets)); + GVAR(vehicleLightColor) = [_cfg >> QGVAR(vehicleLightColor), "array", [1,1,1,0]] call CBA_fnc_getConfigEntry; + + // Handle vehicles with toggleable interior lights: + private _vehicleLightCondition = getText (_cfg >> QGVAR(vehicleLightCondition)); + if (_vehicleLightCondition == "") then { + private _userAction = toLower getText (_cfg >> "UserActions" >> "ToggleLight" >> "statement"); + switch (true) do { + case ((_userAction find "cabinlights_hide") > 0): {_vehicleLightCondition = "(_vehicle animationSourcePhase 'cabinlights_hide') == 1";}; + case ((_userAction find "cargolights_hide") > 0): {_vehicleLightCondition = "(_vehicle animationSourcePhase 'cargolights_hide') == 1";}; + }; + }; + + GVAR(vehicleLightCondition) = if (_vehicleLightCondition != "") then { + if (_vehicle isKindOf "Helicopter" || {_vehicle isKindOf "Plane"}) then { + compile format ["(driver _vehicle == _unit) || {gunner _vehicle == _unit} || {%1}", _vehicleLightCondition]; + } else { + compile _vehicleLightCondition + }; + } else { + switch (true) do { + case (_vehicle isKindOf "Tank"); + case (_vehicle isKindOf "Wheeled_APC"): { {true} }; + case (_vehicle isKindOf "Helicopter"); + case (_vehicle isKindOf "Plane"): { {(driver _vehicle == _unit) || {gunner _vehicle == _unit}} }; + default { {false} }; + }; + }; +}, true] call CBA_fnc_addPlayerEventHandler; diff --git a/addons/map/XEH_preInit.sqf b/addons/map/XEH_preInit.sqf index 7d00e938cf..7fe826a174 100644 --- a/addons/map/XEH_preInit.sqf +++ b/addons/map/XEH_preInit.sqf @@ -3,6 +3,8 @@ ADDON = false; LOG(MSG_INIT); +PREP_RECOMPILE_START; #include "XEH_PREP.hpp" +PREP_RECOMPILE_END; ADDON = true; diff --git a/addons/map/functions/fnc_blueForceTrackingModule.sqf b/addons/map/functions/fnc_blueForceTrackingModule.sqf index f31386b204..a892bf72cd 100644 --- a/addons/map/functions/fnc_blueForceTrackingModule.sqf +++ b/addons/map/functions/fnc_blueForceTrackingModule.sqf @@ -1,13 +1,18 @@ /* -* Author: KoffeinFlummi -* Initializes the blue force tracking module. -* -* Arguments: -* Whatever the module provides. (I dunno.) -* -* Return Value: -* None -*/ + * Author: KoffeinFlummi + * Initializes the blue force tracking module. + * + * Arguments: + * Whatever the module provides. (I dunno.) + * + * Return Value: + * None + * + * Example: + * call ACE_map_fnc_blueForceTrackingModule + * + * Public: No + */ #include "script_component.hpp" diff --git a/addons/map/functions/fnc_blueForceTrackingUpdate.sqf b/addons/map/functions/fnc_blueForceTrackingUpdate.sqf index 9f37252331..46e7833cc1 100644 --- a/addons/map/functions/fnc_blueForceTrackingUpdate.sqf +++ b/addons/map/functions/fnc_blueForceTrackingUpdate.sqf @@ -1,3 +1,20 @@ +/* + * Author: ACE-Team + * Update the blue force tracking. + * + * Arguments: + * None + * + * Return Value: + * None + * + * Example: + * call ACE_map_fnc_blueForceTrackingUpdate + * + * Public: No + */ + + // #define ENABLE_PERFORMANCE_COUNTERS #include "script_component.hpp" // BEGIN_COUNTER(blueForceTrackingUpdate); diff --git a/addons/map/functions/fnc_compileFlashlightMenu.sqf b/addons/map/functions/fnc_compileFlashlightMenu.sqf index fb33b59682..f271cd723f 100644 --- a/addons/map/functions/fnc_compileFlashlightMenu.sqf +++ b/addons/map/functions/fnc_compileFlashlightMenu.sqf @@ -39,7 +39,7 @@ _unitLight params ["_flashlight", ""]; {[_player, _this select 2] call FUNC(switchFlashlight)} }; - _action = [_x, _displayName, _icon, _statement, {true}, {}, _x] call EFUNC(interact_menu,createAction); + private _action = [_x, _displayName, _icon, _statement, {true}, {}, _x] call EFUNC(interact_menu,createAction); _actions pushBack [_action, [], _player]; } forEach _flashlightItems; diff --git a/addons/map/functions/fnc_determineMapLight.sqf b/addons/map/functions/fnc_determineMapLight.sqf index 3269c5a056..3eaa39c6d8 100644 --- a/addons/map/functions/fnc_determineMapLight.sqf +++ b/addons/map/functions/fnc_determineMapLight.sqf @@ -9,6 +9,9 @@ * 0: Does the map needs shading? * 1: Color of the overlay * + * Example: + * call ACE_map_fnc_determineMapLight + * * Public: No */ @@ -44,9 +47,9 @@ if (_lightLevel > 0.95) exitWith { private _vehicle = vehicle _unit; // Do not obscure the map if the player is on a enclosed vehicle (assume internal illumination) -if ((_vehicle != _unit) && {!isTurnedOut _unit && {_vehicle isKindOf "Tank" || {(_vehicle isKindOf "Helicopter" || _vehicle isKindOf "Plane") && {driver _vehicle == _unit || {gunner _vehicle == _unit}}} || {_vehicle isKindOf "Wheeled_APC"}}}) exitWith { - TRACE_1("Player in a enclosed vehicle",""); - [false, [1,1,1,0]] +if ((_vehicle != _unit) && {(!isTurnedOut _unit)} && GVAR(vehicleLightCondition) && {!((_unit call CBA_fnc_turretPath) in GVAR(vehicleExteriorTurrets))}) exitWith { + TRACE_1("Player in a enclosed vehicle",GVAR(vehicleLightColor)); + [!(GVAR(vehicleLightColor) isEqualTo [1,1,1,0]), GVAR(vehicleLightColor)] }; // Player is not in a vehicle diff --git a/addons/map/functions/fnc_determineZoom.sqf b/addons/map/functions/fnc_determineZoom.sqf index efe20a0e52..fd9cc24264 100644 --- a/addons/map/functions/fnc_determineZoom.sqf +++ b/addons/map/functions/fnc_determineZoom.sqf @@ -1,15 +1,19 @@ /* -* Author: Rocko -* Calculate the maximum zoom level allowed for the current map -* -* Arguments: -* None -* -* Return Value: -* None -* -* Public: No -*/ + * Author: Rocko + * Calculate the maximum zoom level allowed for the current map + * + * Arguments: + * None + * + * Return Value: + * None + * + * Example: + * call ACE_map_fnc_determineZoom + * + * Public: No + */ + #include "script_component.hpp" private _grids = (configFile >> "CfgWorlds" >> worldName >> "Grid"); diff --git a/addons/map/functions/fnc_moduleMap.sqf b/addons/map/functions/fnc_moduleMap.sqf index fa64cacb82..3dead784ca 100644 --- a/addons/map/functions/fnc_moduleMap.sqf +++ b/addons/map/functions/fnc_moduleMap.sqf @@ -3,10 +3,15 @@ * Initializes the Map module. * * Arguments: - * Whatever the module provides. (I dunno.) + * Whatever the module provides. (I dunno.) * * Return Value: * None + * + * Example: + * call ACE_map_fnc_moduleMap + * + * Public: No */ #include "script_component.hpp" diff --git a/addons/map/functions/fnc_onDrawMap.sqf b/addons/map/functions/fnc_onDrawMap.sqf index 37ec5a7000..dff79d694a 100644 --- a/addons/map/functions/fnc_onDrawMap.sqf +++ b/addons/map/functions/fnc_onDrawMap.sqf @@ -1,4 +1,19 @@ -// by commy2 +/* + * Author: commy2 + * + * + * Arguments: + * Something + * + * Return Value: + * None + * + * Example: + * call ACE_map_fnc_onDrawMap + * + * Public: No + */ + #include "script_component.hpp" ((_this select 0) displayCtrl 1016) ctrlShow GVAR(mapShowCursorCoordinates); diff --git a/addons/map/functions/fnc_simulateMapLight.sqf b/addons/map/functions/fnc_simulateMapLight.sqf index ba03c421a7..94c0853b23 100644 --- a/addons/map/functions/fnc_simulateMapLight.sqf +++ b/addons/map/functions/fnc_simulateMapLight.sqf @@ -11,6 +11,9 @@ * Return Value: * None * + * Example: + * [CONTROL, 5, [5, 4, 6], []] call ACE_map_fnc_simulateMapLights + * * Public: No */ diff --git a/addons/map/functions/fnc_updateMapEffects.sqf b/addons/map/functions/fnc_updateMapEffects.sqf index 23e97114a8..e8ebcbd884 100644 --- a/addons/map/functions/fnc_updateMapEffects.sqf +++ b/addons/map/functions/fnc_updateMapEffects.sqf @@ -8,6 +8,9 @@ * Return Value: * None * + * Example: + * call ACE_map_fnc_updateMapEffects + * * Public: No */ diff --git a/addons/map/stringtable.xml b/addons/map/stringtable.xml index 440d376f0e..a28266ed60 100644 --- a/addons/map/stringtable.xml +++ b/addons/map/stringtable.xml @@ -13,6 +13,9 @@ Карта Mappa 地図 + 지도 + 地图 + 地圖 Map illumination? @@ -26,6 +29,9 @@ Освещение карты? Illuminazione Mappa? 地図に照明? + 지도에 조명? + 地图照明? + 地圖照明? Simulate map lighting based on ambient lighting and player's items? @@ -37,7 +43,10 @@ Simular iluminación de mapa basada en la iluminación ambiente y los elementos de los jugadores? Simulovat nasvícení mapy v závisloti na okolí a předmětů hráče? Simula illuminazione della mappa in base alla luce ambientale e agli oggetti del giocatore? - 環境光やプレイヤーのアイテムにより、地図へ光のシミュレーションをおこないますか? + 地図へ環境光やプレイヤーのアイテムにもとづいた光のシミュレーションをおこないますか? + 주변 환경및 플레이어 조명에 의한 빛 변화를 지도에 반영할까요? + 透过环境光与玩家的物品来决定地图亮度? + 透過環境光與玩家的物品來決定地圖亮度? Map flashlight glow? @@ -50,6 +59,9 @@ Luce della torcia in mappa? Lumière de la lampe de carte ? 地図をフラッシュライトで照らしますか? + 지도 조명이 빛이 납니까? + 增加地图亮度? + 增加地圖亮度? Add external glow to players who use flashlight on map? @@ -62,6 +74,9 @@ Přidat externí záři hráči který používá baterku v mapě? Aggiungi luce esterna a giocatori che usano la torcia in mappa? プレイヤが地図上でフラッシュライトを使うと、照らすようにしますか? + 지도에 불빛을 비치는 플레이어를 조금 더 밝게 합니까? + 当玩家拥有手电筒时,增加地图亮度? + 當玩家擁有手電筒時,增加地圖亮度? Map shake? @@ -75,6 +90,9 @@ Тряска карты? Scuoti la mappa? 地図を揺らしますか? + 지도 흔들림? + 地图震动? + 地圖震動? Make map shake when walking? @@ -88,6 +106,9 @@ Заставлять карту трястись при ходьбе? Far scuotere la mappa mentre cammini? 歩いているときは地図を揺らしますか? + 걸을때 지도보면 흔들리게 합니까? + 走路时让地图有震动的感觉? + 走路時讓地圖有震動的感覺? Limit map zoom? @@ -101,6 +122,9 @@ Ограничить приближение карты? Limita lo zoom in mappa? 地図の拡大を制限しますか? + 지도 확대 제한? + 限制地图缩放倍率? + 限制地圖縮放倍率? Limit the amount of zoom available for the map? @@ -114,6 +138,9 @@ Ограничить максимальное приближение, доступное на карте? Limita l'ammontare di zoom disponibile per la mappa? 地図上で利用できる拡大倍率を制限しますか? + 지도 확대에 제한을 둡니까? + 限制地图上可允许缩放的倍率? + 限制地圖上可允許縮放的倍率? Show cursor coordinates? @@ -127,6 +154,9 @@ Показывать координаты курсора? Mostra coordinate sul cursore? カーソル先で座標を表示しますか? + 커서에 좌표를 보이게 합니까? + 显示游标的座标? + 顯示游標的座標? Show the grid coordinates on the mouse pointer? @@ -139,7 +169,10 @@ Mutatva legyen-e a kurzornál található rész rácskoordinátája? Показывать координаты около курсора мыши? Mostra la griglia coordinate sul cursore mouse? - カーソルに合わせた先の地図座標を表示しますか? + カーソルに合わせた先を地図座標で表示しますか? + 지도에서 커서 옆에 좌표가 뜨게 합니까? + 显示滑鼠游标所在的网格座标? + 顯示滑鼠游標所在的網格座標? This module allows you to customize the map screen. @@ -153,6 +186,9 @@ Este módulo permite personalizar la pantalla del mapa. Questo modulo ti permette di customizzare lo schermo della mappa. モジュールは地図画面をカスタマイズできます。 + 이 모듈은 지도 화면을 임의로 설정할 수 있게 해줍니다. + 此模块允许自定地图的相关效果. + 此模塊允許自定地圖的相關效果. Blue Force Tracking @@ -166,6 +202,9 @@ Система слежения Blue Force Tracking Blue Force Tracking ブルー フォース トラッキング + GPS피아식별기 + 显示蓝方踪迹 + 顯示藍方蹤跡 BFT Enable @@ -179,6 +218,9 @@ Включить BFT Abilita BFT BFT を有効化 + GPS피아식별기 켜기 + 蓝方踪迹启用 + 藍方蹤跡啟用 Enable Blue Force Tracking. Default: No @@ -191,7 +233,10 @@ Blue Force követés engedélyezése. Alapértelmezett: Nem Включает систему служения BFT. По-умолчанию: Нет Abilita Blue Force Tracking. Default: No - ブルー フォース トラッキングを有効化します。標準:無効 + ブルー フォース トラッキングを有効化します。標準: 無効 + GPS피아식별기 켭니다. 기본설정: 아니요 + 启用显示蓝方踪迹. 预设: 否 + 啟用顯示藍方蹤跡. 預設: 否 Interval @@ -205,6 +250,9 @@ Интервал Intervallo 間隔 + 간격 + 间隔 + 間隔 How often the markers should be refreshed (in seconds) @@ -217,7 +265,10 @@ Milyen gyakran frissüljenek a jelölők (másodpercben) Как часто должны обновляться маркеры (в секундах) Quanto spesso vengono aggiornati i marker (in secondi) - マーカが再描画される間隔を設定できます(秒) + マーカが再描画される間隔を設定できます (秒) + 몇 초마다 마커를 새로 갱신합니까? + 设定每多少时间重新标示出单位位置 (秒) + 設定每多少時間重新標示出單位位置 (秒) Hide AI groups? @@ -231,6 +282,9 @@ Скрыть группы ботов? Nascondere gruppi IA? AI グループを非表示にしますか? + 인공지능 그룹을 숨깁니까? + 隐藏AI小队? + 隱藏AI小隊? Hide markers for 'AI only' groups? @@ -244,6 +298,9 @@ Скрыть маркеры групп, которые состоят полностью из ботов? Nascondi markers per gruppi di sole IA? 'AI のみ'グループのマーカを隠しますか? + 인공지능만 있는 그룹의 마커를 숨깁니까? + 隐藏'AI小队'的踪迹? + 隱藏'AI小隊'的蹤跡? Show player names? @@ -257,6 +314,9 @@ Показать имена игроков? Mostra i nomi dei giocatori? プレイヤ名を表示しますか? + 플레이어 이름을 표시합니까? + 显示玩家名称? + 顯示玩家名稱? Show individual player names? @@ -270,6 +330,9 @@ Показать отдельные имена игроков? Mostra i nomi dei giocatori singoli? プレイヤの名前を表示しますか? + 각 플레이어의 이름을 표시합니까? + 显示玩家的个别名称? + 顯示玩家的個別名稱? This module allows the tracking of allied units with BFT map markers. @@ -283,6 +346,9 @@ Este módulo permite el seguimiento de las unidades aliadas con marcadores de mapa BFT. Questo modulo permette il tracciamento di unità alleate con i marker BFT in mappa モジュールは BFT マップ マーカとともに、同勢力ユニットの追跡を許可します。 + 이 모듈은 아군을 지도상에서 추적할 수 있게 해줍니다. + 此模块将使你能在地图上看见友方单位的踪迹 + 此模塊將使你能在地圖上看見友方單位的蹤跡 Flashlights @@ -295,6 +361,9 @@ Linternas Torcia フラッシュライト + 손전등 + 手电筒 + 手電筒 NVG @@ -307,6 +376,9 @@ NVG NVG 夜間暗視装置 + 야투경 + 夜视镜 + 夜視鏡 On @@ -319,6 +391,9 @@ Encendido Acceso 起動 + 켜기 + 开启 + 開啟 Off @@ -331,6 +406,9 @@ Apagado Spento 停止 + 끄기 + 关闭 + 關閉 Increase Brightness @@ -342,7 +420,10 @@ Zvýšit jas Aumentar brillo Aumenta Luminosità - 感度を上げる + 明度を上げる + 밝기 올리기 + 增加亮度 + 增加亮度 Decrease Brightness @@ -354,7 +435,10 @@ Snížit jas Reducir brillo Diminuisci Luminosità - 感度を下げる + 明度を下げる + 밝기 내리기 + 降低亮度 + 降低亮度 Turn On %1 @@ -368,6 +452,9 @@ Ativar %1 Активировать %1 %1 を点ける + %1 켜기 + 开启%1 + 開啟%1 Turn Off %1 @@ -381,6 +468,9 @@ Desativar %1 Деактивировать %1 %1 を消す + %1 끄기 + 关闭%1 + 關閉%1 Set Channel At Start @@ -393,6 +483,9 @@ Setear canal al comenzar Mettre un canal par défaut 開始時のチャンネルを決定 + 시작시 채널 + 设定游戏开始时的聊天频道 + 設定遊戲開始時的聊天頻道 Change the starting marker channel at mission start @@ -405,14 +498,31 @@ Cambiar el canal de marcadores inicial al comenzar la misión Change le canal de communication par défaut au début de la mission. ミッション開始時にあらかじめ設定されているマーカ チャンネルを変更します + 미션시작시 마커채널을 변경합니다 + 更改任务启动时的聊天频道 + 更改任務啟動時的聊天頻道 Disable BFT BFT deaktivieren + BFTを無効化 + GPS피아식별기 끄기 + Wyłącz BFT + Désactive le BFT + Disablita BFT + 关闭友军踪迹 + 關閉友軍蹤跡 Always disable Blue Force Tracking for this group. Blue Force Tracking für diese Gruppe immer deaktivieren. + このグループへのブルー フォース トラッキングを常に無効化します。 + 이 그룹에 한해 GPS피아식별기를 항상 끕니다. + Zawsze wyłączaj Blue Force Tracking dla tej grupy. + Désactive en permanence le Blue Force Tracking pour ce groupe. + Disabilita sempre il Blue Force Tracking per questo gruppo. + 对此小队永远关闭友军踪迹显示 + 對此小隊永遠關閉友軍蹤跡顯示 diff --git a/addons/map_gestures/ACE_Settings.hpp b/addons/map_gestures/ACE_Settings.hpp index 3730c08c58..bb01592230 100644 --- a/addons/map_gestures/ACE_Settings.hpp +++ b/addons/map_gestures/ACE_Settings.hpp @@ -44,18 +44,4 @@ class ACE_Settings { typeName = "COLOR"; value[] = {1, 0.88, 0, 0.7}; }; - class GVAR(groupColorConfigurations) { - displayName = CSTRING(groupColorConfigurations_displayName); - description = CSTRING(groupColorConfigurations_description); - category = CSTRING(mapGestures_category); - typeName = "ARRAY"; - value[] = {}; - }; - class GVAR(groupColorConfigurationMapping) { - displayName = CSTRING(groupColorConfigurationMapping_displayName); - description = CSTRING(groupColorConfigurationMapping_description); - category = CSTRING(mapGestures_category); - typeName = "ARRAY"; - value[] = {{}, {}}; - }; }; diff --git a/addons/map_gestures/CfgEventHandlers.hpp b/addons/map_gestures/CfgEventHandlers.hpp index b0848d0248..becf395052 100644 --- a/addons/map_gestures/CfgEventHandlers.hpp +++ b/addons/map_gestures/CfgEventHandlers.hpp @@ -14,6 +14,5 @@ class Extended_PreInit_EventHandlers { class Extended_PostInit_EventHandlers { class ADDON { init = QUOTE(call COMPILE_FILE(XEH_postInit)); - serverInit = QUOTE(call COMPILE_FILE(XEH_serverPostInit)); }; }; diff --git a/addons/map_gestures/CfgVehicles.hpp b/addons/map_gestures/CfgVehicles.hpp index 5593d66181..0745c70a16 100644 --- a/addons/map_gestures/CfgVehicles.hpp +++ b/addons/map_gestures/CfgVehicles.hpp @@ -47,7 +47,7 @@ class CfgVehicles { category = "ACE"; displayName = CSTRING(moduleGroupSettings_displayName); function = QFUNC(moduleGroupSettings); - isGlobal = 0; + isGlobal = 2; author = ECSTRING(common,ACETeam); icon = QPATHTOF(ui\icon_module_map_gestures_ca.paa); class Arguments { diff --git a/addons/map_gestures/XEH_PREP.hpp b/addons/map_gestures/XEH_PREP.hpp index eba9f5bfe8..8d457bd7e0 100644 --- a/addons/map_gestures/XEH_PREP.hpp +++ b/addons/map_gestures/XEH_PREP.hpp @@ -1,5 +1,5 @@ -PREP(assignClientIDOnServer); +PREP(addGroupColorMapping); PREP(drawMapGestures); PREP(endTransmit); PREP(getProximityPlayers); diff --git a/addons/map_gestures/XEH_postInit.sqf b/addons/map_gestures/XEH_postInit.sqf index 3d93337aa6..cc3daf6a06 100644 --- a/addons/map_gestures/XEH_postInit.sqf +++ b/addons/map_gestures/XEH_postInit.sqf @@ -8,6 +8,17 @@ if (!hasInterface) exitWith {}; ["ace_settingsInitialized", { if (!GVAR(enabled)) exitWith {}; + + // This will set QEGVAR(common,playerOwner) var on player objects + [] call EFUNC(common,setPlayerOwner); + + GVAR(pointPosition) = [0,0,0]; + + [QGVAR(syncPos), { + params ["_unit", "_pointPos"]; + _unit setVariable [QGVAR(pointPosition), _pointPos]; + }] call CBA_fnc_addEventHandler; + [{ if (isNull (findDisplay 12)) exitWith {}; diff --git a/addons/map_gestures/XEH_preInit.sqf b/addons/map_gestures/XEH_preInit.sqf index a7feade1c3..92387036e4 100644 --- a/addons/map_gestures/XEH_preInit.sqf +++ b/addons/map_gestures/XEH_preInit.sqf @@ -2,6 +2,10 @@ ADDON = false; +PREP_RECOMPILE_START; #include "XEH_PREP.hpp" +PREP_RECOMPILE_END; + +GVAR(GroupColorCfgMappingNew) = call CBA_fnc_createNamespace; ADDON = true; diff --git a/addons/map_gestures/XEH_serverPostInit.sqf b/addons/map_gestures/XEH_serverPostInit.sqf deleted file mode 100644 index 1b70e24149..0000000000 --- a/addons/map_gestures/XEH_serverPostInit.sqf +++ /dev/null @@ -1,3 +0,0 @@ -#include "script_component.hpp" - -[QGVAR(noOwnerID), FUNC(assignClientIDOnServer)] call CBA_fnc_addEventHandler; diff --git a/addons/map_gestures/functions/fnc_addGroupColorMapping.sqf b/addons/map_gestures/functions/fnc_addGroupColorMapping.sqf new file mode 100644 index 0000000000..e02403b323 --- /dev/null +++ b/addons/map_gestures/functions/fnc_addGroupColorMapping.sqf @@ -0,0 +1,31 @@ +/* + * Author: Dslyecxi, MikeMatrix, PabstMirror + * Adds a group id color mapping. + * + * Arguments: + * 0: Group ID or group + * 1: Leader color array (4 numbers including alpha) + * 2: Unit (non-leader) color array (4 numbers including alpha) + * + * Return Value: + * None + * + * Example: + * ["Alpha 1-1", [1,0,0,1], [0,1,0,1]] call ace_map_gestures_fnc_addGroupColorMapping + * + * Public: Yes + */ +#include "script_component.hpp" + +if (!params [["_group", "", [grpNull, ""]], ["_leadColor", [1,1,1,1], [[]], 4], ["_unitColor", [1,1,1,1], [[]], 4]]) exitWith { + ERROR_1("Bad Params: %1",_this); +}; +TRACE_3("params",_group,_leadColor,_unitColor); + +if (_group isEqualType grpNull) then {_group = groupID _group}; + +if (_group == "") exitWith {ERROR("Group ID is blank, which is not valid.")}; +if (!([_leadColor] call FUNC(isValidColorArray))) exitWith {ERROR("leadColor is not a valid color array.")}; +if (!([_unitColor] call FUNC(isValidColorArray))) exitWith {ERROR("color is not a valid color array.")}; + +GVAR(GroupColorCfgMappingNew) setVariable [_group, [_leadColor, _unitColor]]; diff --git a/addons/map_gestures/functions/fnc_assignClientIDOnServer.sqf b/addons/map_gestures/functions/fnc_assignClientIDOnServer.sqf deleted file mode 100644 index 92b1e95ab5..0000000000 --- a/addons/map_gestures/functions/fnc_assignClientIDOnServer.sqf +++ /dev/null @@ -1,24 +0,0 @@ -/* - * Author: Dslyecxi, MikeMatrix - * Assign readable client ID to unit on the server. - * - * Arguments: - * 0: Unit name - * - * Return Value: - * None - * - * Example: - * ["MikeMatrix"] call ace_map_gestures_fnc_assignClientIDOnServer - * - * Public: No - */ -#include "script_component.hpp" - -params ["_unitName"]; - -{ - if (name _x == _unitName) exitWith { - _x setVariable [QGVAR(owner_id), owner _x, true]; - }; -} count playableUnits; diff --git a/addons/map_gestures/functions/fnc_drawMapGestures.sqf b/addons/map_gestures/functions/fnc_drawMapGestures.sqf index 728126531e..237d0537f5 100644 --- a/addons/map_gestures/functions/fnc_drawMapGestures.sqf +++ b/addons/map_gestures/functions/fnc_drawMapGestures.sqf @@ -15,6 +15,8 @@ */ #include "script_component.hpp" +BEGIN_COUNTER(draw); + #define ICON_RENDER_SIZE 55 #define ICON_TEXT_ALIGN "left" #define ICON_ANGLE 0 @@ -26,36 +28,34 @@ if (!GVAR(enabled) || !visibleMap) exitWith {}; -private ["_color", "_drawPosVariableName", "_group", "_grpName", "_pos", "_unitUID"]; - params ["_mapHandle"]; // Iterate over all nearby players and render their pointer if player is transmitting. { - // Data variable name for unit - _unitUID = getPlayerUID _x; - _drawPosVariableName = if (!isNil "_unitUID" && _unitUID != "") then {format [QGVAR(%1_DrawPos), _unitUID]} else {nil}; - if (!isNil "_drawPosVariableName") then { - if (isNil {missionNamespace getVariable _drawPosVariableName}) then {missionNamespace setVariable [_drawPosVariableName, [1, 1, 1]];}; - _pos = missionNamespace getVariable _drawPosVariableName; + // Only render if the unit is alive and transmitting + if (alive _x && {_x getVariable [QGVAR(Transmit), false]}) then { - // Only render if the unit is alive and transmitting - if (alive _x && {_x getVariable QGVAR(Transmit)}) then { - _group = group _x; - _grpName = groupID _group; + private _pos = _x getVariable [QGVAR(pointPosition), [0,0,0]]; - // If color settings for the group exist, then use those, otherwise fall back to the default colors - _color = if ([GVAR(GroupColorConfigurationMapping), _grpName] call CBA_fnc_hashHasKey) then { - (GVAR(GroupColorConfigurations) select ([GVAR(GroupColorConfigurationMapping), _grpName] call CBA_fnc_hashGet)) select (_x != leader _group) - } else { - if (_x == leader _group) then {GVAR(defaultLeadColor)} else {GVAR(defaultColor)}; - }; + private _group = group _x; + private _grpName = groupID _group; - // Render icon and player name - _mapHandle drawIcon ["\a3\ui_f\data\gui\cfg\Hints\icon_text\group_1_ca.paa", _color, _pos, ICON_RENDER_SIZE, ICON_RENDER_SIZE, ICON_ANGLE, "", ICON_SHADOW, TEXT_SIZE, TEXT_FONT, ICON_TEXT_ALIGN]; - _mapHandle drawIcon ["#(argb,8,8,3)color(0,0,0,0)", GVAR(nameTextColor), _pos, TEXT_ICON_RENDER_SIZE, TEXT_ICON_RENDER_SIZE, ICON_ANGLE, name _x, TEXT_SHADOW, TEXT_SIZE, TEXT_FONT, ICON_TEXT_ALIGN]; + // If color settings for the group exist, then use those, otherwise fall back to the default colors + private _colorMap = GVAR(GroupColorCfgMappingNew) getVariable _grpName; + private _color = if (isNil "_colorMap") then { + [GVAR(defaultLeadColor), GVAR(defaultColor)] select (_x != leader _group); + } else { + _colorMap select (_x != leader _group); }; + + TRACE_2("",_colorMap,_color); + + // Render icon and player name + _mapHandle drawIcon ["\a3\ui_f\data\gui\cfg\Hints\icon_text\group_1_ca.paa", _color, _pos, ICON_RENDER_SIZE, ICON_RENDER_SIZE, ICON_ANGLE, "", ICON_SHADOW, TEXT_SIZE, TEXT_FONT, ICON_TEXT_ALIGN]; + _mapHandle drawIcon ["#(argb,8,8,3)color(0,0,0,0)", GVAR(nameTextColor), _pos, TEXT_ICON_RENDER_SIZE, TEXT_ICON_RENDER_SIZE, ICON_ANGLE, name _x, TEXT_SHADOW, TEXT_SIZE, TEXT_FONT, ICON_TEXT_ALIGN]; }; nil } count ([ACE_player, GVAR(maxRange)] call FUNC(getProximityPlayers)); + +END_COUNTER(draw); diff --git a/addons/map_gestures/functions/fnc_getProximityPlayers.sqf b/addons/map_gestures/functions/fnc_getProximityPlayers.sqf index e4ec44837b..ea058f0f7e 100644 --- a/addons/map_gestures/functions/fnc_getProximityPlayers.sqf +++ b/addons/map_gestures/functions/fnc_getProximityPlayers.sqf @@ -10,7 +10,7 @@ * All units in proximity * * Example: - * ["example value"] call ace_module_fnc_functionName + * [player, 7] call ace_map_gestures_fnc_getProximityPlayers * * Public: No */ @@ -21,4 +21,5 @@ params ["_unit", "_range"]; private _proximityPlayers = (getPos _unit) nearEntities [["CAMAnBase"], _range]; _proximityPlayers deleteAt (_proximityPlayers find _unit); _proximityPlayers append (crew vehicle _unit); -_proximityPlayers + +_proximityPlayers select {[_x, false] call EFUNC(common,isPlayer);} diff --git a/addons/map_gestures/functions/fnc_moduleGroupSettings.sqf b/addons/map_gestures/functions/fnc_moduleGroupSettings.sqf index 52ae6d0a49..8f44cf5732 100644 --- a/addons/map_gestures/functions/fnc_moduleGroupSettings.sqf +++ b/addons/map_gestures/functions/fnc_moduleGroupSettings.sqf @@ -17,29 +17,18 @@ */ #include "script_component.hpp" -private ["_color", "_configurationGroupMappings", "_configurationIndex", "_configurations", "_leadColor"]; - params ["_logic", "_units", "_activated"]; +TRACE_3("params",_logic,_units,_activated); -if (!_activated || !isServer) exitWith {}; +if (!_activated) exitWith {}; // Transcode string setting into usable array. Example: "1,1,1,1" -> [1, 1, 1, 1] -_leadColor = call compile ("[" + (_logic getVariable ["leadColor", ""]) + "]"); +private _leadColor = call compile ("[" + (_logic getVariable ["leadColor", ""]) + "]"); if (!([_leadColor] call FUNC(isValidColorArray))) exitWith {ERROR("leadColor is not a valid color array.")}; -_color = call compile ("[" + (_logic getVariable ["color", ""]) + "]"); +private _color = call compile ("[" + (_logic getVariable ["color", ""]) + "]"); if (!([_color] call FUNC(isValidColorArray))) exitWith {ERROR("color is not a valid color array.")}; -// If we already have color configurations from another source, use those, otherwise use default. -_configurations = if (isNil QGVAR(GroupColorConfigurations)) then { [] } else { +GVAR(GroupColorConfigurations) }; -_configurationGroupMappings = if(isNil QGVAR(GroupColorConfigurationMapping)) then { [] call CBA_fnc_hashCreate } else { +GVAR(GroupColorConfigurationMapping) }; - -// Save custom color configuration and keep the index of the entry. -_configurationIndex = _configurations pushBack [_leadColor, _color]; - // Add all synchronized groups and reference custom configuration for them { - [_configurationGroupMappings, groupID group _x, _configurationIndex] call CBA_fnc_hashSet; + [group _x, _leadColor, _color] call FUNC(addGroupColorMapping); } forEach _units; - -[QGVAR(GroupColorConfigurations), _configurations, false, true] call EFUNC(common,setSetting); -[QGVAR(GroupColorConfigurationMapping), _configurationGroupMappings, false, true] call EFUNC(common,setSetting); diff --git a/addons/map_gestures/functions/fnc_receiverInit.sqf b/addons/map_gestures/functions/fnc_receiverInit.sqf index b132dad1d7..9386523340 100644 --- a/addons/map_gestures/functions/fnc_receiverInit.sqf +++ b/addons/map_gestures/functions/fnc_receiverInit.sqf @@ -22,4 +22,4 @@ if (!isNil QGVAR(DrawMapHandlerID)) then { (findDisplay 12 displayCtrl 51) ctrlRemoveEventHandler ["Draw", GVAR(DrawMapHandlerID)]; GVAR(DrawMapHandlerID) = nil; }; -GVAR(DrawMapHandlerID) = findDisplay 12 displayCtrl 51 ctrlAddEventHandler ["Draw", FUNC(drawMapGestures)]; +GVAR(DrawMapHandlerID) = findDisplay 12 displayCtrl 51 ctrlAddEventHandler ["Draw", {call FUNC(drawMapGestures)}]; diff --git a/addons/map_gestures/functions/fnc_transmit.sqf b/addons/map_gestures/functions/fnc_transmit.sqf index aacff9e679..166b1cb375 100644 --- a/addons/map_gestures/functions/fnc_transmit.sqf +++ b/addons/map_gestures/functions/fnc_transmit.sqf @@ -16,7 +16,7 @@ */ #include "script_component.hpp" -private ["_ownerID", "_unitUID", "_drawPosVariableName", "_playerOwnerID"]; +BEGIN_COUNTER(transmit); params ["", "_pfhId"]; @@ -29,17 +29,14 @@ if (!GVAR(EnableTransmit) || !visibleMap) exitWith { }; { - _ownerID = _x getVariable QGVAR(owner_id); - if (isNil "_ownerID") then { - [QGVAR(noOwnerID), [name _x]] call CBA_fnc_serverEvent; - } else { - _playerOwnerID = ACE_player getVariable QGVAR(owner_id); - if (!isNil "_playerOwnerID" && _ownerID != _playerOwnerID) then { - _unitUID = getPlayerUID ACE_Player; - _drawPosVariableName = if (!isNil "_unitUID" && _unitUID != "") then {format [QGVAR(%1_DrawPos), _unitUID]} else {nil}; - if (!isNil "_drawPosVariableName") then { - _ownerID publicVariableClient _drawPosVariableName; - }; + private _owner = _x getVariable [QEGVAR(common,playerOwner), -1]; + if (_owner > -1) then { + private _remotePos = _x getVariable [QGVAR(remotePos), [0,0,0]]; + if ((_remotePos distance2d GVAR(pointPosition)) > 1) then { // Only transmit when actually moving + [QGVAR(syncPos), [ACE_Player, GVAR(pointPosition)], _owner] call CBA_fnc_ownerEvent; + _x setVariable [QGVAR(remotePos), GVAR(pointPosition)]; }; }; } count ([ACE_player, GVAR(maxRange)] call FUNC(getProximityPlayers)); + +END_COUNTER(transmit); diff --git a/addons/map_gestures/functions/fnc_transmitterInit.sqf b/addons/map_gestures/functions/fnc_transmitterInit.sqf index d115fb22c5..3c363d6f04 100644 --- a/addons/map_gestures/functions/fnc_transmitterInit.sqf +++ b/addons/map_gestures/functions/fnc_transmitterInit.sqf @@ -15,11 +15,9 @@ */ #include "script_component.hpp" -private ["_mapCtrl", "_unitUID", "_drawPosVariableName"]; - disableSerialization; -_mapCtrl = findDisplay 12 displayCtrl 51; +private _mapCtrl = findDisplay 12 displayCtrl 51; // MouseMoving EH. if (!isNil QGVAR(MouseMoveHandlerID)) then { @@ -28,7 +26,7 @@ if (!isNil QGVAR(MouseMoveHandlerID)) then { }; GVAR(MouseMoveHandlerID) = _mapCtrl ctrlAddEventHandler ["MouseMoving", { // Don't transmit any data if we're using the map tools - if (!GVAR(EnableTransmit) || EGVAR(maptools,mapTool_isDragging) || EGVAR(maptools,mapTool_isRotating)) exitWith {}; + if (!GVAR(EnableTransmit) || {(["ace_maptools"] call EFUNC(common,isModLoaded)) && {EGVAR(maptools,mapTool_isDragging) || EGVAR(maptools,mapTool_isRotating)}}) exitWith {}; params ["_control", "_posX", "_posY"]; @@ -36,11 +34,7 @@ GVAR(MouseMoveHandlerID) = _mapCtrl ctrlAddEventHandler ["MouseMoving", { ACE_player setVariable [QGVAR(Transmit), true, true]; }; - _unitUID = getPlayerUID ACE_player; - _drawPosVariableName = if (!isNil "_unitUID" && _unitUID != "") then {format [QGVAR(%1_DrawPos), _unitUID]} else {nil}; - if (!isNil "_drawPosVariableName") then { - missionNamespace setVariable [_drawPosVariableName, _control ctrlMapScreenToWorld [_posX, _posY]]; - }; + GVAR(pointPosition) = _control ctrlMapScreenToWorld [_posX, _posY]; }]; // MouseDown EH diff --git a/addons/map_gestures/stringtable.xml b/addons/map_gestures/stringtable.xml index 3cc1f6b33a..2bcc1ca4bd 100644 --- a/addons/map_gestures/stringtable.xml +++ b/addons/map_gestures/stringtable.xml @@ -12,6 +12,9 @@ Gestos en mapa Gestes de carte マップ ジェスチャ + 지도 신호 + 地图指示器 + 地圖指示器 Enabled @@ -24,6 +27,9 @@ Activado Activer 有効化 + 켜기 + 启用 + 啟用 Map Gesture Max Range @@ -36,6 +42,9 @@ Máx. dist. para gestos en mapa Distance max. des gestes de carte マップ ジェスチャの最大範囲 + 지도 신호 최대 거리 + 地图指示器最大范围 + 地圖指示器最大範圍 Max range between players to show the map gesture indicator [default: 7 meters] @@ -48,6 +57,9 @@ Máxima distancia a la cual pueden verse el indicador de gestos [defecto: 7 m] Distance max. entre les joueurs pour montrer le pointage sur carte. (Défaut : 7m) プレイヤのマップ ジェスチャによる表示範囲を設定します [標準:7 メートル] + 플레이어간에 지도 신호 표시거리를 설정합니다. [기본: 7 미터] + 设定地图指示器显示的最大范围距离 [预设: 7公尺] + 設定地圖指示器顯示的最大範圍距離 [預設: 7公尺] Lead Default Color @@ -60,6 +72,9 @@ Color por defecto para el lider Couleur principale de commandement. リーダー用標準の色 + 리더 기본 색상 + 队长预设颜色 + 隊長預設顏色 Fallback Color value for group leaders when there is no group setting. [Module: leave blank to not force on clients] @@ -71,6 +86,9 @@ Color por defecto para líderes cuando no está configurado [Módulo: dejar en blanco para no forzar] Couleur par défaut pour les chefs de groupe quand il n'y a pas de réglage pour le groupe. (Module : laisser vide pour ne pas forcer chez les clients) グループ設定が存在しない場合に、グループ リーダーへ設定される色の値を設定します。[モジュール:空の場合はクライアントへ強制しません] + 그룹 설정이 없는 경우 리더의 예비 색상 값입니다. [모듈: 클라이언트에서 강체치 않기 위해 공백으로 비워둘것] + 当没有设定小队颜色时,此功能会定义队长的指示器颜色。[模块: 此栏留空来保持预设颜色] + 當沒有設定小隊顏色時,此功能會定義隊長的指示器顏色。[模塊: 此欄留空來保持預設顏色] Default Color @@ -83,6 +101,9 @@ Color por defecto Couleur par défaut 標準色 + 기본 색상 + 预设颜色 + 預設顏色 Fallback Color value when there is no group setting. [Module: leave blank to not force on clients] @@ -94,6 +115,9 @@ Color por defecto cuando no está configurado [Módulo: dejar en blanco para no forzar] Couleur par défaut quand il n'y a pas de réglage pour le groupe. (Module : laisser vide pour ne pas forcer chez les clients) グループ設定が存在しない場合に、グループ リーダーへ設定される色の値を設定します。[モジュール:空の場合はクライアントへ強制しません] + 그룹 설정이 없을 경우의 예비 색상입니다. [모듈: 클라이언트에서 강체치 않기 위해 공백으로 비워둘것] + 当没有设定小队颜色时,此功能会定义玩家的指示器颜色。[模块: 此栏留空来保持预设颜色] + 當沒有設定小隊顏色時,此功能會定義玩家的指示器顏色。[模塊: 此欄留空來保持預設顏色] Lead Color @@ -106,6 +130,9 @@ Color para el líder Couleur de commandement リーダー用の色 + 리더 색상 + 队长颜色 + 隊長顏色 Color value for group leaders of groups synced with this module. @@ -117,6 +144,9 @@ Color para los líderes de los grupos sincronizados al módulo. Couleur pour les chefs de groupe des groupes synchronisés avec le module. モジュールで同期されたグループのリーダー用に色の値を決定します。 + 그룹이 이 모듈에 동기화 됐을때의 리더 색상입니다. + 改变与此同步小队队长的指示器颜色。 + 改變與此同步小隊隊長的指示器顏色。 Color @@ -129,6 +159,9 @@ Color Couleur + 색상 + 颜色 + 顏色 Color value for group members of groups synced with this module. @@ -140,6 +173,9 @@ Color para los miembros de los grupos sincronizados al módulo. Couleur pour les membres du groupe synchronisé avec ce module. モジュールで同期されたグループのメンバ用に色の値を決定します。 + 그룹이 이 모듈에 동기화 됐을때의 멤버 색상입니다. + 改变与此同步小队队员的指示器颜色 + 改變與此同步小隊隊員的指示器顏色 Map Gestures - Group Settings @@ -152,6 +188,9 @@ Gestos en mapas - Configuración de grupos Gestes de carte - réglages de groupe マップ ジェスチャ - グループ設定 + 지도 신호 - 그룹 설정 + 地图指示器 - 队伍设定 + 地圖指示器 - 隊伍設定 Update Interval @@ -164,6 +203,9 @@ Período de actualización Intervalle de mise à jour 更新間隔 + 갱신 간격 + 更新间隔 + 更新間隔 Time between data updates. @@ -176,51 +218,9 @@ Tiempo entre actualizaciones sucesivas. Temps entre les actualisations de données データの更新間隔 - - - Group color configurations - Configurações de cores de grupo - Konf. koloru grup - Конфигурация цвета групп - Konfigurace barvy pro skupinu - Configurazioni colori dei gruppi - Konfiguration der Gruppenfarbe - Configuración de color de grupo - Configuration des couleurs de groupe - グループで使う色の設定 - - - Group color configuration containing arrays of color pairs ([leadColor, color]). - Configuração de cores de grupo contendo arrays com pares de cores ([leadColor, color]). - Konfiguracja kolorów grup zawierająca tablice par kolorów ([kolorLidera, kolor]). - Конфигурация цвета групп содержит массив цветовых пар ([лид. цвет, цвет]). - Configurazioni colori gruppi contenenti array di coppie di colori ([leadColor, color]). - Konfiguration der Gruppenfarbe mit zugeordneten Farbpaaren der Aufstellung ([leadColor, color]). - Configuración de color de grupo conteniendo una lista de pares de colores ([colorLider, colo]). - Configuration des couleurs de groupe contenant des tableaux de paires de couleurs ([couleurDeCommandement, couleur]). - アライに格納された組によりグループの色を設定します。([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. - Hasz ID grup zmapowanych w indeksie konfiguracji koloru grup. - Хеш ID групп, соответствующих индексам конфигурации цвета групп. - Hash degli ID Gruppi mappati nell'indice configurazioni colori gruppi. - Hashwert der Gruppen-ID, die dem Konfigurations-Index der Gruppenfarbe zugeordnet werden. - ID de Grupo mapeado al índice de la configuración de color de grupo. - Hash de l'identifiant du groupe mappé à l'index de la configuration de la couleur du groupe. - グループ ID のハッシュはグループの色を設定するインデックスへマッピングされます。 - - - GroupID Color configuration mapping - Mapeamento de configuração para cores de GroupID - Mapowanie kolorów poprzez GroupID - Соответствие ID групп конфигурации цвета групп - Mappatura configurazioni colori GroupID - Gruppen-ID-Farbe Konfigurationszuordnung - Mapeado de ID de Grupo - Configuration du mappage de l'identifiant de la couleur du groupe. - GroupID の色への設定をマッピング + 데이터 갱신 간격 + 定义每次更新数据的时间. + 定義每次更新數據的時間. Enables the Map Gestures. @@ -233,6 +233,9 @@ Activar Gestos en Mapa Activer les gestes de carte マップ ジェスチャを有効化 + 지도 신호 활성화 + 启用地图指示器 + 啟用地圖指示器 Name Text Color @@ -245,6 +248,9 @@ Color de los nombres Couleur du texte du nom 名前への色 + 글 색상 명칭 + 名称文字颜色 + 名稱文字顏色 Color of the name tag text besides the map gestures mark. @@ -256,6 +262,9 @@ Color de los nombres dibujados al lado del marcados de gestos. Couleur des tags de nom à côté de marqueur de pointage sur carte. マップ ジェスチャに表示される、名前の色を決定します。 + 지도 색상에 표시되는 이름의 색상을 결정합니다. + 定义名称文字颜色。使其与地图指示器颜色有所区别。 + 定義名稱文字顏色。使其與地圖指示器顏色有所區別。 Map Gestures @@ -268,6 +277,9 @@ Gestos en mapa Gestes de carte マップ ジェスチャ + 지도 신호 + 地图指示器 + 地圖指示器 - \ No newline at end of file + diff --git a/addons/maptools/CfgWeapons.hpp b/addons/maptools/CfgWeapons.hpp index dc7a7046dd..df884c6b67 100644 --- a/addons/maptools/CfgWeapons.hpp +++ b/addons/maptools/CfgWeapons.hpp @@ -1,6 +1,6 @@ class CfgWeapons { class ACE_ItemCore; - class InventoryItem_Base_F; + class CBA_MiscItem_ItemInfo; class ACE_MapTools: ACE_ItemCore { displayName = CSTRING(Name); @@ -8,7 +8,7 @@ class CfgWeapons { model = QPATHTOF(data\ace_MapTools.p3d); picture = QPATHTOF(UI\maptool_item.paa); scope = 2; - class ItemInfo: InventoryItem_Base_F { + class ItemInfo: CBA_MiscItem_ItemInfo { mass = 1; }; }; diff --git a/addons/maptools/MapGpsUI.hpp b/addons/maptools/MapGpsUI.hpp index c5b230f163..cd0a418465 100644 --- a/addons/maptools/MapGpsUI.hpp +++ b/addons/maptools/MapGpsUI.hpp @@ -40,7 +40,8 @@ class RscTitles { colorBackground[] = {0,0,0,0}; colorText[] = {0.247,0.251,0.157,1}; shadowColo[] = {0,0,0,0}; - font = "EtelkaNarrowMediumPro"; + // EtelkaNarrowMediumPro broke with 1.72 hotfix, can revert back to that font if fixed (following 3 uses of PuristaSemibold) + font = "PuristaSemibold"; shadow = 0; sizeEx = 0.042; }; @@ -55,7 +56,7 @@ class RscTitles { colorBackground[] = {0,0,0,0}; colorText[] = {0.247,0.251,0.157,1}; shadowColo[] = {0,0,0,0}; - font = "EtelkaNarrowMediumPro"; + font = "PuristaSemibold"; shadow = 0; sizeEx = 0.042; }; @@ -70,7 +71,7 @@ class RscTitles { colorBackground[] = {0,0,0,0}; colorText[] = {0.247,0.251,0.157,1}; shadowColo[] = {0,0,0,0}; - font = "EtelkaNarrowMediumPro"; + font = "PuristaSemibold"; shadow = 0; sizeEx = 0.1; }; diff --git a/addons/maptools/XEH_preInit.sqf b/addons/maptools/XEH_preInit.sqf index a7feade1c3..b47cf6628d 100644 --- a/addons/maptools/XEH_preInit.sqf +++ b/addons/maptools/XEH_preInit.sqf @@ -2,6 +2,8 @@ ADDON = false; +PREP_RECOMPILE_START; #include "XEH_PREP.hpp" +PREP_RECOMPILE_END; ADDON = true; diff --git a/addons/maptools/functions/fnc_calculateMapScale.sqf b/addons/maptools/functions/fnc_calculateMapScale.sqf index 926ed558fe..d5148893d5 100644 --- a/addons/maptools/functions/fnc_calculateMapScale.sqf +++ b/addons/maptools/functions/fnc_calculateMapScale.sqf @@ -6,7 +6,10 @@ * None * * Return Value: - * No + * None + * + * Example: + * call ACE_maptools_fnc_calculateMapScale * * Public: No */ diff --git a/addons/maptools/functions/fnc_canUseMapGPS.sqf b/addons/maptools/functions/fnc_canUseMapGPS.sqf index a327c2bc8d..7333c1f9e0 100644 --- a/addons/maptools/functions/fnc_canUseMapGPS.sqf +++ b/addons/maptools/functions/fnc_canUseMapGPS.sqf @@ -6,7 +6,10 @@ * None * * Return Value: - * + * Boolean + * + * Example: + * call ACE_map_fnc_canUseMapGPS * * Public: No */ diff --git a/addons/maptools/functions/fnc_canUseMapTools.sqf b/addons/maptools/functions/fnc_canUseMapTools.sqf index 8c16425082..bc3c7fbb8a 100644 --- a/addons/maptools/functions/fnc_canUseMapTools.sqf +++ b/addons/maptools/functions/fnc_canUseMapTools.sqf @@ -6,7 +6,10 @@ * None * * Return Value: - * + * Boolean + * + * Example: + * call ACE_maptools_fnc_canUseMapTools * * Public: No */ diff --git a/addons/maptools/functions/fnc_drawLinesOnRoamer.sqf b/addons/maptools/functions/fnc_drawLinesOnRoamer.sqf index 6a900c335b..ba9363c68f 100644 --- a/addons/maptools/functions/fnc_drawLinesOnRoamer.sqf +++ b/addons/maptools/functions/fnc_drawLinesOnRoamer.sqf @@ -7,7 +7,7 @@ * 1: Roamer Width * * Return Value: - * Nothing + * None * * Example: * [map, 300] call ace_maptools_fnc_drawLinesOnRoamer diff --git a/addons/maptools/functions/fnc_handleMouseButton.sqf b/addons/maptools/functions/fnc_handleMouseButton.sqf index 7750ef0965..143289447e 100644 --- a/addons/maptools/functions/fnc_handleMouseButton.sqf +++ b/addons/maptools/functions/fnc_handleMouseButton.sqf @@ -3,12 +3,18 @@ * Handle mouse buttons. * * Arguments: - * 0: 1 if mouse down down, 0 if mouse button up (Number) - * 1: Parameters of the mouse button event + * 0: 1 if mouse down down, 0 if mouse button up + * 1: Parameters of the mouse button event * * Return Value: - * Boolean, true if event was handled + * true if event was handled + * + * Example: + * [0, [array]] call ACE_maptools_fnc_handleMouseButton + * + * Public: No */ + #include "script_component.hpp" params ["_dir", "_params"]; @@ -26,16 +32,16 @@ if ((_button == 0) && {GVAR(freedrawing) || _ctrlKey}) exitWith { private _markerName = allMapMarkers select (count allMapMarkers - 1); private _markerPos = getMarkerPos _markerName; private _distanceCheck = _markerPos distance2d GVAR(drawPosStart); - + TRACE_3("Line Drawn",_markerName,_markerPos,_distanceCheck); - + if (_distanceCheck > 1) exitWith {WARNING("Wrong Marker!");}; if ((count GVAR(freeDrawingData)) != 3) exitWith {TRACE_1("never touched roamer",GVAR(freeDrawingData));}; - + GVAR(freeDrawingData) params ["", "_startStraightPos", "_endStraightPos"]; _startStraightPos set [2, 0]; - _endStraightPos set [2, 0]; - + _endStraightPos set [2, 0]; + // Convert marker to rectangle and change it's pos/size/dir _markerName setMarkerShape "RECTANGLE"; diff --git a/addons/maptools/functions/fnc_handleMouseMove.sqf b/addons/maptools/functions/fnc_handleMouseMove.sqf index a52163ba32..a7c48cfed4 100644 --- a/addons/maptools/functions/fnc_handleMouseMove.sqf +++ b/addons/maptools/functions/fnc_handleMouseMove.sqf @@ -3,11 +3,16 @@ * Handle mouse movement over the map tool. * * Arguments: - * 0: Map Control - * 1: Mouse position on screen coordinates + * 0: Map Control + * 1: Mouse position on screen coordinates * * Return Value: - * Boolean, true if event was handled + * true if event was handled + * + * Example: + * [CONTROL, [0, 5, 1]] call ACE_maptools_fnc_handleMouseMove + * + * Public: No */ #include "script_component.hpp" diff --git a/addons/maptools/functions/fnc_isInsideMapTool.sqf b/addons/maptools/functions/fnc_isInsideMapTool.sqf index 216a2a675a..c54f831e8f 100644 --- a/addons/maptools/functions/fnc_isInsideMapTool.sqf +++ b/addons/maptools/functions/fnc_isInsideMapTool.sqf @@ -7,8 +7,14 @@ * 1: y Position (in meters) * * Return Value: - * Boolean + * Boolean + * + * Example: + * [0, 5] call ACE_maptools_fnc_isInsideMapTool + * + * Public: No */ + #include "script_component.hpp" if (GVAR(mapTool_Shown) == 0) exitWith {false}; diff --git a/addons/maptools/functions/fnc_openMapGps.sqf b/addons/maptools/functions/fnc_openMapGps.sqf index c3e2a8bfee..7e8d923661 100644 --- a/addons/maptools/functions/fnc_openMapGps.sqf +++ b/addons/maptools/functions/fnc_openMapGps.sqf @@ -6,7 +6,10 @@ * 0: Open GPS? * * Return Value: - * Nothing + * None + * + * Example: + * [true] call ACE_maptools_fnc_openMapGps * * Public: No */ diff --git a/addons/maptools/functions/fnc_openMapGpsUpdate.sqf b/addons/maptools/functions/fnc_openMapGpsUpdate.sqf index 719bf37763..63ecae81ec 100644 --- a/addons/maptools/functions/fnc_openMapGpsUpdate.sqf +++ b/addons/maptools/functions/fnc_openMapGpsUpdate.sqf @@ -1,5 +1,18 @@ -//esteldunedain -//update gps display +/* + * Author: esteldunedain + * update gps display + * + * Arguments: + * Something + * + * Return Value: + * None + * + * Example: + * call ACE_maptools_fnc_openMapGpsUpdate + * + * Public: No + */ #include "script_component.hpp" diff --git a/addons/maptools/functions/fnc_updateMapToolMarkers.sqf b/addons/maptools/functions/fnc_updateMapToolMarkers.sqf index 864ef33844..026a4037d1 100644 --- a/addons/maptools/functions/fnc_updateMapToolMarkers.sqf +++ b/addons/maptools/functions/fnc_updateMapToolMarkers.sqf @@ -6,7 +6,10 @@ * 0: The Map * * Return Value: - * Nothing + * None + * + * Example: + * [CONTROL] call ACE_maptools_fnc_updateMapToolMarkers * * Public: No */ diff --git a/addons/maptools/stringtable.xml b/addons/maptools/stringtable.xml index 59ab5db0d0..639ece59e5 100644 --- a/addons/maptools/stringtable.xml +++ b/addons/maptools/stringtable.xml @@ -13,6 +13,9 @@ Térképészeti eszközök Инструменты карты マップ ツール + 독도용 도구 + 地图工具 + 地圖工具 The Map Tools allow you to measure distances and angles on the map. @@ -26,6 +29,9 @@ A térképészeti eszközökkel távolságokat és szögeket tudsz mérni a térképen. Картографические инструменты позволяют измерять расстояния и углы на карте. マップ ツールは地図上で距離や角度を測れます。 + 독도용 도구는 지도상에서 거리나 각도를 잴 수 있게 해줍니다. + 地图工具能够让你在地图上测量距离与角度 + 地圖工具能夠讓你在地圖上測量距離與角度 Map Tools @@ -39,6 +45,9 @@ Térképészeti eszközök Инструменты карты マップ ツール + 독도용 도구 + 地图工具 + 地圖工具 Hide Map Tool @@ -52,6 +61,9 @@ Schovat pomůcky k mapě Скрыть инструменты マップ ツールを隠す + 독도용 도구 숨기기 + 隐藏地图工具 + 隱藏地圖工具 Show Normal Map Tool @@ -65,6 +77,9 @@ Zobrazit pomůcku k mapě (Velkou) Показать инструменты (средн. размер) マップ ツールを表示する + 보통 독도용 도구로 보기 + 显示地图工具 + 顯示地圖工具 Show Small Map Tool @@ -78,6 +93,9 @@ Zobrazit pomůcku k mapě (Malou) Показать инструменты (малый размер) 小さいマップ ツールを表示する + 작은 독도용 도구로 보기 + 显示小的地图工具 + 顯示小的地圖工具 Align Map Tool to North @@ -91,6 +109,9 @@ Srovnat pomůcku k mapě na sever Выровнять инструменты на север マップ ツールを北に合わせる + 독도용 도구를 북쪽으로 정렬 + 地图工具对准北方 + 地圖工具對準北方 Align Map Tool to Compass @@ -104,6 +125,9 @@ Srovnat pomůcku k mapě ke kompasu Выровнять инструменты по компасу マップ ツールを方位磁石に合わせる + 독도용 도구를 나침반에 정렬 + 地图工具对准指北针 + 地圖工具對準指北針 Show GPS on Map @@ -117,6 +141,9 @@ Zobrazit GPS na mapě Показать GPS на карте 地図上に GPS を表示する + GPS를 지도상에 꺼내기 + 在地图上显示GPS + 在地圖上顯示GPS Hide GPS on Map @@ -130,6 +157,9 @@ Schovat GPS na mapě Скрыть GPS на карте 地図上から GPS を隠す + GPS를 지도상에서 숨기기 + 在地图上隐藏GPS + 在地圖上隱藏GPS Direction: %1° @@ -143,6 +173,9 @@ Direzione: %1° Direção: %1 方位:%1° + 방위: %1° + 方位: %1° + 方位: %1° Rotate Map Tools Key @@ -150,6 +183,11 @@ Клавиша поворота инструментов карты マップ ツールの回転キー Klawisz obrotu narzędzi nawigacyjnych + Taste zum Drehen des Kartenwerkzeugs + 독도용 도구 돌리기 키 + Ruota Strumenti di Mappatura + 选转地图工具的按键 + 選轉地圖工具的按鍵 Modifier key to allow rotating map tools @@ -157,12 +195,33 @@ Клавиша-модификатор, позволяющая поворачивать инструменты карты マップ ツールを回転させるキーを編集できます。 Modyfikator pozwalający na obracanie narzędzi nawigacyjnych + Steuerungstaste, um Drehung des Kartenwerkzeugs zu ermöglichen. + 독도용 도구를 돌리기 위한 키를 변경할 수 있습니다. + Tasto modifica per consentire strumenti di mappatura rotanti + 修改旋转地图工具的按键 + 修改旋轉地圖工具的按鍵 Draw straight lines with maptools + マップ ツールを使って直線を書く + Zeichne gerade Linien mit dem Kartenwerkzeug + 독도용 도구로 직선 그리기 + Rysuj proste linie przy użyciu narzędzi nawigacyjnych + Tracer des lignes droites + Disegna linee dritte con gli strumenti di mappatura + 使用地图工具来绘制直线 + 使用地圖工具來繪製直線 Draw on the edge of maptools to draw straight lines. Note: Must hover at midpoint to delete. + マップ ツールの端から直線を書きます。メモ:線の中央ホバーすると削除します。 + Zeichne gerade Linien am Rand des Kartenwerkzeugs. Hinweis: zum Löschen über den Mittelpunkt der Linie fahren + 독도용 도구 가장자리에 직선을 그립니다. 주의: 삭제하기 위해선 선의 중앙에 가져다 대십시요 + Przeciągnij po krawędzi narzędzi nawigacyjnych by narysować prostą linię. Uwaga: aby usunąć linię - nalezy ustawić kursor nad jej środkiem. + Utiliser le bord des outils de navigation pour tracer des lignes droites. Note: l'on doit survoler le milieu du trait pour pouvoir le supprimer. + Disegna sul bordo degli strumenti di mappatura per disegnare linee dritte. Nota: Deve spostarsi al centro per essere cancellato. + 使用地图工具的边缘来绘制直线。备注: 要删除直线时,请把滑鼠移动到该线条的中央即可删除该线。 + 使用地圖工具的邊緣來繪製直線。備註: 要刪除直線時,請把滑鼠移動到該線條的中央即可刪除該線。 diff --git a/addons/markers/ACE_Settings.hpp b/addons/markers/ACE_Settings.hpp new file mode 100644 index 0000000000..b1866a7d21 --- /dev/null +++ b/addons/markers/ACE_Settings.hpp @@ -0,0 +1,17 @@ +class ACE_Settings { + class GVAR(movableMarkersEnabled) { + category = CSTRING(Module_DisplayName); + value = 0; + typeName = "BOOL"; + displayName = CSTRING(MovableMarkers_DisplayName); + description = CSTRING(MovableMarkers_Description); + }; + class GVAR(moveRestriction) { + category = CSTRING(Module_DisplayName); + value = 0; + typeName = "SCALAR"; + displayName = CSTRING(MoveRestriction_DisplayName); + description = CSTRING(MoveRestriction_Description); + values[] = {CSTRING(MoveRestriction_All), CSTRING(MoveRestriction_Admins), CSTRING(MoveRestriction_GroupLeaders), CSTRING(MoveRestriction_GroupLeadersAndAdmins)}; + }; +}; diff --git a/addons/markers/CfgVehicles.hpp b/addons/markers/CfgVehicles.hpp new file mode 100644 index 0000000000..2fd3778738 --- /dev/null +++ b/addons/markers/CfgVehicles.hpp @@ -0,0 +1,48 @@ +class CfgVehicles { + class ACE_Module; + class ACE_ModuleMarkers: ACE_Module { + author = ECSTRING(common,ACETeam); + category = "ACE"; + displayName = CSTRING(Module_DisplayName); + function = QFUNC(initModule); + scope = 2; + isGlobal = 1; + isSingular = 1; + icon = QPATHTOF(UI\Icon_Module_Markers_ca.paa); + class Arguments { + class MovableMarkersEnabled { + displayName = CSTRING(MovableMarkers_DisplayName); + description = CSTRING(MovableMarkers_Description); + typeName = "BOOL"; + defaultValue = 0; + }; + class MoveRestriction { + displayName = CSTRING(MoveRestriction_DisplayName); + description = CSTRING(MoveRestriction_Description); + typeName = "NUMBER"; + class values { + class all { + name = CSTRING(MoveRestriction_All); + value = MOVE_RESTRICTION_ALL; + default = MOVE_RESTRICTION_ALL; + }; + class admins { + name = CSTRING(MoveRestriction_Admins); + value = MOVE_RESTRICTION_ADMINS; + }; + class groupLeaders { + name = CSTRING(MoveRestriction_GroupLeaders); + value = MOVE_RESTRICTION_GROUP_LEADERS; + }; + class groupLeadersAndAdmins { + name = CSTRING(MoveRestriction_GroupLeadersAndAdmins); + value = MOVE_RESTRICTION_GROUP_LEADERS_ADMINS; + }; + }; + }; + }; + class ModuleDescription { + description = CSTRING(Module_Description); + }; + }; +}; diff --git a/addons/markers/UI/Icon_Module_Markers_ca.paa b/addons/markers/UI/Icon_Module_Markers_ca.paa new file mode 100644 index 0000000000..8c9e41e0ca Binary files /dev/null and b/addons/markers/UI/Icon_Module_Markers_ca.paa differ diff --git a/addons/markers/XEH_PREP.hpp b/addons/markers/XEH_PREP.hpp index c6ad5c6ba2..521f692389 100644 --- a/addons/markers/XEH_PREP.hpp +++ b/addons/markers/XEH_PREP.hpp @@ -11,3 +11,8 @@ PREP(placeMarker); PREP(sendMarkersJIP); PREP(setMarkerJIP); PREP(setMarkerNetwork); +PREP(movePFH); +PREP(onMouseButtonDownMap); +PREP(onMouseButtonUpMap); +PREP(initModule); +PREP(canMoveMarker); diff --git a/addons/markers/XEH_postInit.sqf b/addons/markers/XEH_postInit.sqf index 6e1af95a50..eadf5be907 100644 --- a/addons/markers/XEH_postInit.sqf +++ b/addons/markers/XEH_postInit.sqf @@ -18,3 +18,28 @@ GVAR(currentMarkerPosition) = []; GVAR(currentMarkerAngle) = 0; GVAR(currentMarkerColorConfigName) = ""; GVAR(currentMarkerConfigName) = ""; + +// set marker pos local on every computer (prevent markers visible for everyone) +[QGVAR(applyMarkerPosLocal), { + params["_marker", "_pos"]; + _marker setMarkerPosLocal _pos; + + if (isServer) then { + private _index = (GETGVAR(allMapMarkers,[])) find _marker; // case-sensitive, but should be fine + if (_index < 0) exitWith {ERROR_1("Could not find data for %1", _marker);}; + private _data = GVAR(allMapMarkersProperties) select _index; + _data set [2, _pos]; + }; +}] call CBA_fnc_addEventHandler; + +["ace_settingsInitialized", { + if (GVAR(movableMarkersEnabled)) then { + if (!hasInterface) exitWith {}; + [{ + !isNull (findDisplay 12) + }, { + (findDisplay 12 displayCtrl 51) ctrlAddEventHandler ["MouseButtonDown", FUNC(onMouseButtonDownMap)]; + (findDisplay 12 displayCtrl 51) ctrlAddEventHandler ["MouseButtonUp", FUNC(onMouseButtonUpMap)]; + }] call CBA_fnc_waitUntilAndExecute; + }; +}] call CBA_fnc_addEventHandler; diff --git a/addons/markers/XEH_preInit.sqf b/addons/markers/XEH_preInit.sqf index da62205b51..7ee91d67e5 100644 --- a/addons/markers/XEH_preInit.sqf +++ b/addons/markers/XEH_preInit.sqf @@ -2,7 +2,9 @@ ADDON = false; +PREP_RECOMPILE_START; #include "XEH_PREP.hpp" +PREP_RECOMPILE_END; // init marker types if (isNil QGVAR(MarkersCache)) then { diff --git a/addons/markers/config.cpp b/addons/markers/config.cpp index 1a8c310735..1881183ac1 100644 --- a/addons/markers/config.cpp +++ b/addons/markers/config.cpp @@ -15,4 +15,7 @@ class CfgPatches { }; #include "CfgEventHandlers.hpp" +#include "ACE_Settings.hpp" +#include "CfgVehicles.hpp" + #include "InsertMarker.hpp" diff --git a/addons/markers/functions/fnc_canMoveMarker.sqf b/addons/markers/functions/fnc_canMoveMarker.sqf new file mode 100644 index 0000000000..4e7a5d9e5b --- /dev/null +++ b/addons/markers/functions/fnc_canMoveMarker.sqf @@ -0,0 +1,28 @@ +/* + * Author: chris579 + * Checks whether the player can move markers. + * + * Arguments: + * None + * + * Return Value: + * Whether the player can move markers + * + * Example: + * [] call ace_markers_fnc_canMoveMarker + * + * Public: No + */ +#include "script_component.hpp" + +switch (GVAR(moveRestriction)) do { + case MOVE_RESTRICTION_ALL: { true }; + case MOVE_RESTRICTION_ADMINS: { IS_ADMIN }; + case MOVE_RESTRICTION_GROUP_LEADERS: { + leader group ACE_player == ACE_player + }; + case MOVE_RESTRICTION_GROUP_LEADERS_ADMINS: { + (leader group ACE_player == ACE_player) || IS_ADMIN + }; + default { true }; +}; diff --git a/addons/markers/functions/fnc_getEnabledChannels.sqf b/addons/markers/functions/fnc_getEnabledChannels.sqf index 9a64ff06d4..eb4bcfd5ce 100644 --- a/addons/markers/functions/fnc_getEnabledChannels.sqf +++ b/addons/markers/functions/fnc_getEnabledChannels.sqf @@ -8,6 +8,9 @@ * Return Value: * Enabled Channels * + * Example: + * [false] call ACE_markers_fnc_getEnabledChannels + * * Public: No */ #include "script_component.hpp" diff --git a/addons/markers/functions/fnc_initModule.sqf b/addons/markers/functions/fnc_initModule.sqf new file mode 100644 index 0000000000..c30c80d874 --- /dev/null +++ b/addons/markers/functions/fnc_initModule.sqf @@ -0,0 +1,21 @@ +/* + * Author: chris579 + * Initializes the Markers Module. + * + * Arguments: + * 0: Logic + * + * Return Value: + * None + * + * Example: + * [LOGIC] call ACE_markers_fnc_initModule + * + * Public: No + */ +#include "script_component.hpp" + +params ["_logic"]; + +[_logic, QGVAR(movableMarkersEnabled), "MovableMarkersEnabled"] call EFUNC(common,readSettingFromModule); +[_logic, QGVAR(moveRestriction), "MoveRestriction"] call EFUNC(common,readSettingFromModule); diff --git a/addons/markers/functions/fnc_movePFH.sqf b/addons/markers/functions/fnc_movePFH.sqf new file mode 100644 index 0000000000..021561b560 --- /dev/null +++ b/addons/markers/functions/fnc_movePFH.sqf @@ -0,0 +1,38 @@ +/* + * Author: chris579 + * When the marker is being moved. + * + * Arguments: + * 0: Marker data + * 1: PFH ID + * + * Return Value: + * None + * + * Example: + * [[MARKER], 5] call ace_markers_fnc_movePFH + * + * Public: No + */ +#include "script_component.hpp" + +params ["_args", "_idPFH"]; +_args params ["_marker"]; + +if (isNull (findDisplay 12 displayCtrl 51) || {!(player getVariable [QGVAR(moveInProgress), false])}) exitWith { + [_idPFH] call CBA_fnc_removePerFrameHandler; + + private _origin = ACE_player getVariable [QGVAR(movedMarkerOrigin), getMarkerPos _marker]; + + if !([QGVAR(markerMoveEnded), [ACE_player, _marker, _origin, getMarkerPos _marker]] call CBA_fnc_localEvent) exitWith { + _marker setMarkerPosLocal _origin; + }; + + [QGVAR(applyMarkerPosLocal), [_marker, getMarkerPos _marker]] call CBA_fnc_globalEvent; + _marker setMarkerAlphaLocal (ACE_player getVariable [QGVAR(movedMarkerAlpha), 1]); + + EGVAR(map_gestures,enabled) = ACE_player getVariable [QGVAR(mapGesturesSetting), false]; + (findDisplay 12 displayCtrl 51) ctrlMapCursor ["Track", "Track"]; +}; + +_marker setMarkerPosLocal ((findDisplay 12 displayCtrl 51) posScreenToWorld getMousePosition); diff --git a/addons/markers/functions/fnc_onLBSelChangedChannel.sqf b/addons/markers/functions/fnc_onLBSelChangedChannel.sqf index f63c4e5cf4..8c7ac11046 100644 --- a/addons/markers/functions/fnc_onLBSelChangedChannel.sqf +++ b/addons/markers/functions/fnc_onLBSelChangedChannel.sqf @@ -9,6 +9,9 @@ * Return Value: * None * + * Example: + * [CONTROL, 5] call ACE_markers_fnc_onLBSelChangedChannel + * * Public: No */ #include "script_component.hpp" diff --git a/addons/markers/functions/fnc_onMouseButtonDownMap.sqf b/addons/markers/functions/fnc_onMouseButtonDownMap.sqf new file mode 100644 index 0000000000..6e001a5f87 --- /dev/null +++ b/addons/markers/functions/fnc_onMouseButtonDownMap.sqf @@ -0,0 +1,53 @@ +/* + * Author: chris579 + * Triggered when a mouse button is pressed on the map. + * + * Arguments: + * 0: Map Control the EVH was assigned to + * 1: Button code + * 2: Position of x + * 3: Position of y + * 4: State of Shift + * 5: State of Ctrl + * 6: State of Alt + * + * Return Value: + * None + * + * Example: + * [CONTROL, 2, 0, 0, true, false, false] call ace_markers_fnc_onMouseButtonDownMap + * + * Public: No + */ +#include "script_component.hpp" + +params ["_mapCtrl", "_button", "_x", "_y", "_shift", "_ctrl", "_alt"]; + +if (_button != 0) exitWith {}; + +private _mouseOver = ctrlMapMouseOver _mapCtrl; + +if (count _mouseOver == 2) then { + if ((_mouseOver select 0) == "marker") then { + private _markerName = _mouseOver select 1; + + if (_markerName find "_USER_DEFINED" != -1) then { + if (!_ctrl && !_shift && _alt && ([] call FUNC(canMoveMarker))) then { + // move marker + _mapCtrl ctrlMapCursor ["Track", "Move"]; + + if !([QGVAR(markerMoveStarted), [ACE_player, _markerName, getMarkerPos _markerName]] call CBA_fnc_localEvent) exitWith {}; + + ACE_player setVariable [QGVAR(movedMarkerOrigin), getMarkerPos _markerName]; + ACE_player setVariable [QGVAR(movedMarkerAlpha), markerAlpha _markerName]; + ACE_player setVariable [QGVAR(moveInProgress), true]; + ACE_player setVariable [QGVAR(mapGesturesSetting), EGVAR(map_gestures,enabled)]; + EGVAR(map_gestures,enabled) = false; + + _markerName setMarkerAlphaLocal 0.5; + [FUNC(movePFH), 0, [_markerName]] call CBA_fnc_addPerFrameHandler; + + }; + }; + }; +}; diff --git a/addons/markers/functions/fnc_onMouseButtonUpMap.sqf b/addons/markers/functions/fnc_onMouseButtonUpMap.sqf new file mode 100644 index 0000000000..c1abfdf73f --- /dev/null +++ b/addons/markers/functions/fnc_onMouseButtonUpMap.sqf @@ -0,0 +1,21 @@ +/* + * Author: chris579 + * Triggered when a mouse button is released on the map. + * + * Arguments: + * 0: Map Control the evh was assigned to + * 1: Button code + * + * Return Value: + * None + * + * Example: + * [CONTROL, 2] call ace_markers_fnc_onMouseButtonUpMap + * + * Public: No + */ +#include "script_component.hpp" + +params ["_mapCtrl", "_button"]; + +player setVariable [QGVAR(moveInProgress), false]; diff --git a/addons/markers/script_component.hpp b/addons/markers/script_component.hpp index 80256466e9..cd77c827a6 100644 --- a/addons/markers/script_component.hpp +++ b/addons/markers/script_component.hpp @@ -24,3 +24,8 @@ localize "str_channel_vehicle", \ localize "str_channel_direct" \ ] + +#define MOVE_RESTRICTION_ALL 0 +#define MOVE_RESTRICTION_ADMINS 1 +#define MOVE_RESTRICTION_GROUP_LEADERS 2 +#define MOVE_RESTRICTION_GROUP_LEADERS_ADMINS 3 diff --git a/addons/markers/stringtable.xml b/addons/markers/stringtable.xml index b20bdb0210..b815f80d6b 100644 --- a/addons/markers/stringtable.xml +++ b/addons/markers/stringtable.xml @@ -4,7 +4,7 @@ Direction: %1° Drehung: %1° - Direction: %1° + Direction : %1° Směr: %1° Kierunek: %1° Dirección: %1° @@ -12,7 +12,90 @@ Irány: %1° Direzione: %1° Direção %1 - 方位:%1° + 方位: %1° + 방위: %1° + 方位: %1° + 方位: %1° + + + Markers + Markierungen + マーカー + Marcatori + 標誌 + 标志 + + + This module allows you to customize markers placement. + Dieses Modul ermöglicht die Steuerung der Platzierung von Markierungen. + モジュールではマーカー配置のカスタマイズを可能にします。 + Questo modulo permette di personalizzare i marcatori a piacimento. + 此模塊可讓你自定標誌的擺放方式。 + 此模块可让你自定标志的摆放方式。 + + + Movable markers + Bewegbare Markierungen + 可動式マーカー + Marcatori mobili + 可移動的標誌 + 可移动的标志 + + + Should map markers placed by players be movable? + Sollen Markierungen, die von Spielern platziert wurden, verschiebbar sein? + プレイヤーによって配置されたマーカーを可動式にしますか? + I marcatori in mappa piazzati dai giocatori dovrebbero poter essere mossi ? + 玩家放置的地圖標誌可以被移動嗎? + 玩家放置的地图标志可以被移动吗? + + + Move restriction + Verschiebungsrestriktion + 可動制限 + Restrizione di movimento + 移動限制 + 移动限制 + + + Apply move restrictions so that not every player is able to move markers. + Restriktionen, damit nicht jeder Spieler Marker verschieben kann + マーカーを可動出来るプレイヤーを決定します。 + Applica le restrizioni di movimento cosicchè ogni giocatore possa spostare i marcatori. + 設定那些玩家可以移動標誌的位置。 + 设定那些玩家可以移动标志的位置。 + + + All players + Alle Spieler + 全プレイヤー + Tutti i giocatori + 所有玩家 + 所有玩家 + + + Admins + Admins + 管理者 + Amministratori + 管理員 + 管理员 + + + Group leaders + Gruppenführer + グループ リーダー + Capigruppo + 小隊長 + 小队长 + + + Group leaders and Admins + Gruppenführer und Admins + グループ リーダーと管理者 + Capigruppo e Amministratori + 小隊長與管理員 + 小队长与管理员 - \ No newline at end of file + diff --git a/addons/maverick/$PBOPREFIX$ b/addons/maverick/$PBOPREFIX$ new file mode 100644 index 0000000000..78ffc29019 --- /dev/null +++ b/addons/maverick/$PBOPREFIX$ @@ -0,0 +1 @@ +z\ace\addons\maverick \ No newline at end of file diff --git a/addons/maverick/ACE_GuidanceConfig.hpp b/addons/maverick/ACE_GuidanceConfig.hpp new file mode 100644 index 0000000000..f6b9020157 --- /dev/null +++ b/addons/maverick/ACE_GuidanceConfig.hpp @@ -0,0 +1,7 @@ +class EGVAR(missileguidance,AttackProfiles) { + class maverick { + name = "LOAL-DIR"; + nameLocked = "LOBL-DIR"; + functionName = QEFUNC(missileguidance,attackProfile_DIR); + }; +}; diff --git a/addons/maverick/CfgAmmo.hpp b/addons/maverick/CfgAmmo.hpp new file mode 100644 index 0000000000..cd53935a2e --- /dev/null +++ b/addons/maverick/CfgAmmo.hpp @@ -0,0 +1,42 @@ +class CfgAmmo { + class MissileCore; + class MissileBase : MissileCore { + class Components; + }; + class Missile_AGM_02_F : MissileBase {}; + + class GVAR(L) : Missile_AGM_02_F { + author = "rufix"; + autoSeekTarget = 0; + irLock = 0; + laserLock = 0; + manualControl = 0; + missileLockMaxDistance = 16000; + weaponLockSystem = 4; + class ace_missileguidance { + enabled = 1; + + minDeflection = 0.0005; + maxDeflection = 0.01; + incDeflection = 0.005; + + canVanillaLock = 0; + + defaultSeekerType = "SALH"; + seekerTypes[] = {"SALH"}; + + defaultSeekerLockMode = "LOAL"; + seekerLockModes[] = {"LOAL","LOBL"}; + + seekLastTargetPos = 1; + seekerAngle = 60; + seekerAccuracy = 1; + + seekerMinRange = 1; + seekerMaxRange = 16000; + + defaultAttackProfile = "maverick"; + attackProfiles[] = {"maverick"}; + }; + }; +}; diff --git a/addons/maverick/CfgMagazines.hpp b/addons/maverick/CfgMagazines.hpp new file mode 100644 index 0000000000..e3fd9d2194 --- /dev/null +++ b/addons/maverick/CfgMagazines.hpp @@ -0,0 +1,74 @@ +class CfgMagazines { + class CA_Magazine; + class VehicleMagazine : CA_Magazine {}; + + class magazine_Missile_AGM_02_x1 : VehicleMagazine {}; + class PylonMissile_Missile_AGM_02_x1 : magazine_Missile_AGM_02_x1 {}; + class PylonMissile_Missile_AGM_02_x2 : magazine_Missile_AGM_02_x1 {}; + + class 6Rnd_Missile_AGM_02_F : VehicleMagazine {}; + class PylonRack_1Rnd_Missile_AGM_02_F : 6Rnd_Missile_AGM_02_F {}; + class PylonRack_3Rnd_Missile_AGM_02_F : PylonRack_1Rnd_Missile_AGM_02_F{}; + + class PylonRack_Missile_AGM_02_x1 : magazine_Missile_AGM_02_x1 {}; + class PylonRack_Missile_AGM_02_x2 : magazine_Missile_AGM_02_x1 {}; + + class GVAR(L_magazine_x1) : magazine_Missile_AGM_02_x1 { + ammo = QGVAR(L); + author = "xrufix"; + descriptionShort = CSTRING(L_MAG_DESCR); + displayName = CSTRING(L_MAG_x1); + displayNameShort = CSTRING(L_MAG_short); + }; + + class GVAR(L_pylonmissile_x1) : PylonMissile_Missile_AGM_02_x1 { + ammo = QGVAR(L); + author = "xrufix"; + descriptionShort = CSTRING(L_MAG_DESCR); + displayName = CSTRING(L_MAG_x1); + displayNameShort = CSTRING(L_MAG_short); + pylonWeapon = QGVAR(L_Launcher); + }; + class GVAR(L_pylonmissile_x2) : PylonMissile_Missile_AGM_02_x2 { + ammo = QGVAR(L); + author = "xrufix"; + descriptionShort = CSTRING(L_MAG_DESCR); + displayName = CSTRING(L_MAG_x1); + displayNameShort = CSTRING(L_MAG_short); + pylonWeapon = QGVAR(L_Launcher); + }; + + class GVAR(L_pylonRack_1Rnd) : PylonRack_1Rnd_Missile_AGM_02_F { + ammo = QGVAR(L); + author = "xrufix"; + descriptionShort = CSTRING(L_MAG_DESCR); + displayName = CSTRING(L_MAG_x1); + displayNameShort = CSTRING(L_MAG_short); + pylonWeapon = QGVAR(L_Launcher_Plane); + }; + class GVAR(L_PylonRack_3Rnd) : PylonRack_3Rnd_Missile_AGM_02_F { + ammo = QGVAR(L); + author = "xrufix"; + descriptionShort = CSTRING(L_MAG_DESCR); + displayName = CSTRING(L_MAG_x3); + displayNameShort = CSTRING(L_MAG_short); + pylonWeapon = QGVAR(L_Launcher_Plane); + }; + + class GVAR(L_PylonRack_x1) : PylonRack_Missile_AGM_02_x1 { + ammo = QGVAR(L); + author = "xrufix"; + descriptionShort = CSTRING(L_MAG_DESCR); + displayName = CSTRING(L_MAG_x1); + displayNameShort = CSTRING(L_MAG_short); + pylonWeapon = QGVAR(L_Launcher); + }; + class GVAR(L_PylonRack_x2) : PylonRack_Missile_AGM_02_x2 { + ammo = QGVAR(L); + author = "xrufix"; + descriptionShort = CSTRING(L_MAG_DESCR); + displayName = CSTRING(L_MAG_x2); + displayNameShort = CSTRING(L_MAG_short); + pylonWeapon = QGVAR(L_Launcher); + }; +}; diff --git a/addons/maverick/CfgWeapons.hpp b/addons/maverick/CfgWeapons.hpp new file mode 100644 index 0000000000..7a526c8692 --- /dev/null +++ b/addons/maverick/CfgWeapons.hpp @@ -0,0 +1,48 @@ +class CfgWeapons { + class LauncherCore; + class RocketPods : LauncherCore {}; + class weapon_AGM_65Launcher : RocketPods{}; + + class MissileLauncher : LauncherCore {}; + class Missile_AGM_02_Plane_CAS_01_F : MissileLauncher {}; + + class GVAR(L_Launcher) : weapon_AGM_65Launcher { + author = "xrufix"; + displayname = CSTRING(L); + magazines[] = { + QGVAR(L_magazine_x1), + QGVAR(L_pylonmissile_x1), + QGVAR(L_pylonmissile_x2), + QGVAR(L_pylonRack_1Rnd), + QGVAR(L_PylonRack_3Rnd), + QGVAR(L_PylonRack_x1), + QGVAR(L_PylonRack_x2) + }; + weaponLockDelay = 0.1; + weaponLockSystem = 0; + + EGVAR(laser,canSelect) = 1; // can ace_laser lock (allows switching laser code) + EGVAR(laser,showHud) = 1; // show attack profile / lock on hud + GVAR(enabled) = 1; + }; + + class GVAR(L_Launcher_Plane) : Missile_AGM_02_Plane_CAS_01_F { + author = "xrufix"; + displayname = CSTRING(L); + magazines[] = { + QGVAR(L_magazine_x1), + QGVAR(L_pylonmissile_x1), + QGVAR(L_pylonmissile_x2), + QGVAR(L_pylonRack_1Rnd), + QGVAR(L_PylonRack_3Rnd), + QGVAR(L_PylonRack_x1), + QGVAR(L_PylonRack_x2) + }; + weaponLockDelay = 0.1; + weaponLockSystem = 0; + + EGVAR(laser,canSelect) = 1; // can ace_laser lock (allows switching laser code) + EGVAR(laser,showHud) = 1; // show attack profile / lock on hud + GVAR(enabled) = 1; + }; +}; diff --git a/addons/maverick/README.md b/addons/maverick/README.md new file mode 100644 index 0000000000..da103dbd7f --- /dev/null +++ b/addons/maverick/README.md @@ -0,0 +1,16 @@ +ace_maverick +========== + +Adds pylon magazines with laser guided AGM-65 Maverick L. + +* The magazines can be added to every plane the vanilla Macer II can be added to. +* The missile uses laser guidance based on ACE's Advanced Missile Guidance framework. +* The PylonWeapon from CfgWeapons is added to planes with pylons automatically. + +![Laser guided Maverick](https://upload.wikimedia.org/wikipedia/commons/thumb/c/c3/US_Navy_041128-N-5345W-016_Aviation_Ordnanceman_3rd_Class_William_Miller_arms_a_AGM-65_Maverick_laser-guided_missile.jpg/1280px-US_Navy_041128-N-5345W-016_Aviation_Ordnanceman_3rd_Class_William_Miller_arms_a_AGM-65_Maverick_laser-guided_missile.jpg) + +## Maintainers + +The people responsible for merging changes to this component or answering potential questions. + +- [xrufix](https://github.com/xrufix) diff --git a/addons/maverick/config.cpp b/addons/maverick/config.cpp new file mode 100644 index 0000000000..2d8f43f64f --- /dev/null +++ b/addons/maverick/config.cpp @@ -0,0 +1,38 @@ +#include "script_component.hpp" + +class CfgPatches { + class ADDON { + name = COMPONENT_NAME; + requiredVersion = REQUIRED_VERSION; + requiredAddons[] = {"ace_hellfire"}; + author = ECSTRING(common,ACETeam); + authors[] = {"xrufix"}; + url = ECSTRING(main,URL); + VERSION_CONFIG; + ammo[] = { + GVAR(L) + }; + magazines[] = { + QGVAR(L_magazine_x1), + QGVAR(L_pylonmissile_x1), + QGVAR(L_pylonmissile_x2), + QGVAR(L_pylonRack_1Rnd), + QGVAR(L_PylonRack_3Rnd), + QGVAR(L_PylonRack_x1), + QGVAR(L_PylonRack_x2) + }; + weapons[] = { + GVAR(L_Launcher_Plane), + GVAR(L_Launcher) + }; + units[] = {}; + }; +}; + + +class SensorTemplateLaser; + +#include "CfgAmmo.hpp" +#include "CfgMagazines.hpp" +#include "CfgWeapons.hpp" +#include "ACE_GuidanceConfig.hpp" diff --git a/addons/maverick/script_component.hpp b/addons/maverick/script_component.hpp new file mode 100644 index 0000000000..ff396b7cbf --- /dev/null +++ b/addons/maverick/script_component.hpp @@ -0,0 +1,17 @@ +#define COMPONENT maverick +#define COMPONENT_BEAUTIFIED Maverick +#include "\z\ace\addons\main\script_mod.hpp" + +// #define DEBUG_MODE_FULL +// #define DISABLE_COMPILE_CACHE +// #define ENABLE_PERFORMANCE_COUNTERS + +#ifdef DEBUG_ENABLED_MAIN + #define DEBUG_MODE_FULL +#endif + +#ifdef DEBUG_SETTINGS_MAIN + #define DEBUG_SETTINGS DEBUG_SETTINGS_MAIN +#endif + +#include "\z\ace\addons\main\script_macros.hpp" diff --git a/addons/maverick/stringtable.xml b/addons/maverick/stringtable.xml new file mode 100644 index 0000000000..3c349f4d9e --- /dev/null +++ b/addons/maverick/stringtable.xml @@ -0,0 +1,57 @@ + + + + + + AGM-65 Maverick L, Laser Guided Anti-Ground-Missile + AGM-65 Maverick L, lasergelenkte Luft-Boden-Rakete + AGM-65 Maverick L, Guida Laser Missile-Anti-Terra + AGM-65 マーベリック L、レーザー誘導対地ミサイル + AGM-65"小牛"飛彈L型,雷射導引對地導彈 + AGM-65"小牛"飞弹L型,雷射导引对地导弹 + + + AGM-65 Maverick L x1 + AGM-65 Maverick L x1 + AGM-65 Maverick L x1 + AGM-65 マーベリック L x1 + AGM-65"小牛"飛彈L型 x1 + AGM-65"小牛"飞弹L型 x1 + + + AGM-65 Maverick L x2 + AGM-65 Maverick L x2 + AGM-65 Maverick L x2 + AGM-65 マーベリック L x2 + AGM-65"小牛"飛彈L型 x2 + AGM-65"小牛"飞弹L型 x2 + + + AGM-65 Maverick L x3 + AGM-65 Maverick L x3 + AGM-65 Maverick L x3 + AGM-65 マーベリック L x3 + AGM-65"小牛"飛彈L型 x3 + AGM-65"小牛"飞弹L型 x3 + + + Laser Guided + Lasergelenkt + Guida Laser + レーザー誘導 + 雷射導引 + 雷射导引 + + + + + AGM-65 Maverick L + AGM-65 Maverick L + AGM-65 Maverick L + AGM-65 マーベリック L + AGM-65"小牛"飛彈L型 + AGM-65"小牛"飞弹L型 + + + + diff --git a/addons/medical/ACE_Medical_SelfActions.hpp b/addons/medical/ACE_Medical_SelfActions.hpp index fca025adcb..bf3fbe775f 100644 --- a/addons/medical/ACE_Medical_SelfActions.hpp +++ b/addons/medical/ACE_Medical_SelfActions.hpp @@ -1,7 +1,7 @@ class Medical { displayName = CSTRING(Actions_Medical); runOnHover = 1; - exceptions[] = {"isNotInside", "isNotSitting"}; + exceptions[] = {"isNotInside", "isNotSwimming", "isNotSitting"}; statement = QUOTE([ARR_3(_target, true, 0)] call DFUNC(displayPatientInformation)); condition = "true"; icon = QPATHTOF(UI\icons\medical_cross.paa); @@ -9,7 +9,7 @@ class Medical { class ACE_Head { displayName = CSTRING(Head); icon = QPATHTOF(UI\icons\medical_cross.paa); - exceptions[] = {"isNotInside", "isNotSitting"}; + exceptions[] = {"isNotInside", "isNotSwimming", "isNotSitting"}; statement = QUOTE([ARR_3(_target, true, 0)] call DFUNC(displayPatientInformation)); modifierFunction = QUOTE([ARR_4(_target,_player,0,_this select 3)] call FUNC(modifyMedicalAction)); condition = "true"; @@ -19,7 +19,7 @@ class Medical { displayName = CSTRING(Bandage); distance = 2.0; condition = QUOTE([ARR_4(_player, _target, 'head', 'Bandage')] call DFUNC(canTreatCached)); - exceptions[] = {"isNotInside"}; + exceptions[] = {"isNotInside", "isNotSwimming"}; statement = QUOTE([ARR_4(_player, _target, 'head', 'Bandage')] call DFUNC(treatment)); showDisabled = 1; priority = 2; @@ -30,7 +30,7 @@ class Medical { displayName = CSTRING(Actions_FieldDressing); distance = 5.0; condition = QUOTE([ARR_4(_player, _target, 'head', 'FieldDressing')] call DFUNC(canTreatCached)); - exceptions[] = {"isNotInside"}; + exceptions[] = {"isNotInside", "isNotSwimming"}; statement = QUOTE([ARR_4(_player, _target, 'head', 'FieldDressing')] call DFUNC(treatment)); showDisabled = 0; priority = 2; @@ -39,35 +39,35 @@ class Medical { class PackingBandage: fieldDressing { displayName = CSTRING(Actions_PackingBandage); condition = QUOTE([ARR_4(_player, _target, 'head', 'PackingBandage')] call DFUNC(canTreatCached)); - exceptions[] = {"isNotInside"}; + exceptions[] = {"isNotInside", "isNotSwimming"}; statement = QUOTE([ARR_4(_player, _target, 'head', 'PackingBandage')] call DFUNC(treatment)); icon = QPATHTOF(UI\icons\packingBandage.paa); }; class ElasticBandage: fieldDressing { displayName = CSTRING(Actions_ElasticBandage); condition = QUOTE([ARR_4(_player, _target, 'head', 'ElasticBandage')] call DFUNC(canTreatCached)); - exceptions[] = {"isNotInside"}; + exceptions[] = {"isNotInside", "isNotSwimming"}; statement = QUOTE([ARR_4(_player, _target, 'head', 'ElasticBandage')] call DFUNC(treatment)); icon = QPATHTOF(UI\icons\bandage.paa); }; class QuikClot: fieldDressing { displayName = CSTRING(Actions_QuikClot); condition = QUOTE([ARR_4(_player, _target, 'head', 'QuikClot')] call DFUNC(canTreatCached)); - exceptions[] = {"isNotInside"}; + exceptions[] = {"isNotInside", "isNotSwimming"}; statement = QUOTE([ARR_4(_player, _target, 'head', 'QuikClot')] call DFUNC(treatment)); icon = QPATHTOF(UI\icons\bandage.paa); }; class CheckPulse: fieldDressing { displayName = CSTRING(Actions_CheckPulse); condition = QUOTE([ARR_4(_player, _target, 'head', 'CheckPulse')] call DFUNC(canTreatCached)); - exceptions[] = {"isNotInside"}; + exceptions[] = {"isNotInside", "isNotSwimming"}; statement = QUOTE([ARR_4(_player, _target, 'head', 'CheckPulse')] call DFUNC(treatment)); icon = ""; }; class CheckBloodPressure: CheckPulse { displayName = CSTRING(Actions_CheckBloodPressure); condition = QUOTE([ARR_4(_player, _target, 'head', 'CheckBloodPressure')] call DFUNC(canTreatCached)); - exceptions[] = {"isNotInside"}; + exceptions[] = {"isNotInside", "isNotSwimming"}; statement = QUOTE([ARR_4(_player, _target, 'head', 'CheckBloodPressure')] call DFUNC(treatment)); }; }; @@ -76,7 +76,7 @@ class Medical { distance = 5.0; condition = "true"; runOnHover = 1; - exceptions[] = {"isNotInside", "isNotSitting"}; + exceptions[] = {"isNotInside", "isNotSwimming", "isNotSitting"}; statement = QUOTE([ARR_3(_target, true, 1)] call DFUNC(displayPatientInformation)); modifierFunction = QUOTE([ARR_4(_target,_player,1,_this select 3)] call FUNC(modifyMedicalAction)); showDisabled = 1; @@ -87,7 +87,7 @@ class Medical { displayName = CSTRING(Bandage); distance = 2.0; condition = QUOTE([ARR_4(_player, _target, 'body', 'Bandage')] call DFUNC(canTreatCached)); - exceptions[] = {"isNotInside"}; + exceptions[] = {"isNotInside", "isNotSwimming"}; statement = QUOTE([ARR_4(_player, _target, 'body', 'Bandage')] call DFUNC(treatment)); showDisabled = 1; priority = 2; @@ -98,7 +98,7 @@ class Medical { displayName = CSTRING(Actions_TriageCard); distance = 2.0; condition = "true"; - exceptions[] = {"isNotInside"}; + exceptions[] = {"isNotInside", "isNotSwimming"}; statement = QUOTE([ARR_2(_target, true)] call DFUNC(displayTriageCard)); showDisabled = 1; priority = 2; @@ -110,7 +110,7 @@ class Medical { displayName = CSTRING(Actions_FieldDressing); distance = 5.0; condition = QUOTE([ARR_4(_player, _target, 'body', 'FieldDressing')] call DFUNC(canTreatCached)); - exceptions[] = {"isNotInside"}; + exceptions[] = {"isNotInside", "isNotSwimming"}; statement = QUOTE([ARR_4(_player, _target, 'body', 'FieldDressing')] call DFUNC(treatment)); showDisabled = 0; priority = 2; @@ -119,21 +119,21 @@ class Medical { class PackingBandage: fieldDressing { displayName = CSTRING(Actions_PackingBandage); condition = QUOTE([ARR_4(_player, _target, 'body', 'PackingBandage')] call DFUNC(canTreatCached)); - exceptions[] = {"isNotInside"}; + exceptions[] = {"isNotInside", "isNotSwimming"}; statement = QUOTE([ARR_4(_player, _target, 'body', 'PackingBandage')] call DFUNC(treatment)); icon = QPATHTOF(UI\icons\packingBandage.paa); }; class ElasticBandage: fieldDressing { displayName = CSTRING(Actions_ElasticBandage); condition = QUOTE([ARR_4(_player, _target, 'body', 'ElasticBandage')] call DFUNC(canTreatCached)); - exceptions[] = {"isNotInside"}; + exceptions[] = {"isNotInside", "isNotSwimming"}; statement = QUOTE([ARR_4(_player, _target, 'body', 'ElasticBandage')] call DFUNC(treatment)); icon = QPATHTOF(UI\icons\bandage.paa); }; class QuikClot: fieldDressing { displayName = CSTRING(Actions_QuikClot); condition = QUOTE([ARR_4(_player, _target, 'body', 'QuikClot')] call DFUNC(canTreatCached)); - exceptions[] = {"isNotInside"}; + exceptions[] = {"isNotInside", "isNotSwimming"}; statement = QUOTE([ARR_4(_player, _target, 'body', 'QuikClot')] call DFUNC(treatment)); icon = QPATHTOF(UI\icons\bandage.paa); }; @@ -141,7 +141,7 @@ class Medical { class ACE_ArmLeft { displayName = ECSTRING(interaction,ArmLeft); runOnHover = 1; - exceptions[] = {"isNotInside", "isNotSitting"}; + exceptions[] = {"isNotInside", "isNotSwimming", "isNotSitting"}; statement = QUOTE([ARR_3(_target, true, 2)] call DFUNC(displayPatientInformation)); modifierFunction = QUOTE([ARR_4(_target,_player,2,_this select 3)] call FUNC(modifyMedicalAction)); condition = "true"; @@ -151,7 +151,7 @@ class Medical { displayName = CSTRING(Bandage); distance = 2.0; condition = QUOTE([ARR_4(_player, _target, 'hand_l', 'Bandage')] call DFUNC(canTreatCached)); - exceptions[] = {"isNotInside"}; + exceptions[] = {"isNotInside", "isNotSwimming"}; statement = QUOTE([ARR_4(_player, _target, 'hand_l', 'Bandage')] call DFUNC(treatment)); showDisabled = 1; priority = 2; @@ -163,7 +163,7 @@ class Medical { displayName = CSTRING(Actions_FieldDressing); distance = 5.0; condition = QUOTE([ARR_4(_player, _target, 'hand_l', 'FieldDressing')] call DFUNC(canTreatCached)); - exceptions[] = {"isNotInside"}; + exceptions[] = {"isNotInside", "isNotSwimming"}; statement = QUOTE([ARR_4(_player, _target, 'hand_l', 'FieldDressing')] call DFUNC(treatment)); showDisabled = 0; priority = 2; @@ -172,83 +172,83 @@ class Medical { class PackingBandage: fieldDressing { displayName = CSTRING(Actions_PackingBandage); condition = QUOTE([ARR_4(_player, _target, 'hand_l', 'PackingBandage')] call DFUNC(canTreatCached)); - exceptions[] = {"isNotInside"}; + exceptions[] = {"isNotInside", "isNotSwimming"}; statement = QUOTE([ARR_4(_player, _target, 'hand_l', 'PackingBandage')] call DFUNC(treatment)); icon = QPATHTOF(UI\icons\packingBandage.paa); }; class ElasticBandage: fieldDressing { displayName = CSTRING(Actions_ElasticBandage); condition = QUOTE([ARR_4(_player, _target, 'hand_l', 'ElasticBandage')] call DFUNC(canTreatCached)); - exceptions[] = {"isNotInside"}; + exceptions[] = {"isNotInside", "isNotSwimming"}; statement = QUOTE([ARR_4(_player, _target, 'hand_l', 'ElasticBandage')] call DFUNC(treatment)); icon = QPATHTOF(UI\icons\bandage.paa); }; class QuikClot: fieldDressing { displayName = CSTRING(Actions_QuikClot); condition = QUOTE([ARR_4(_player, _target, 'hand_l', 'QuikClot')] call DFUNC(canTreatCached)); - exceptions[] = {"isNotInside"}; + exceptions[] = {"isNotInside", "isNotSwimming"}; statement = QUOTE([ARR_4(_player, _target, 'hand_l', 'QuikClot')] call DFUNC(treatment)); icon = QPATHTOF(UI\icons\bandage.paa); }; class Tourniquet: fieldDressing { displayName = CSTRING(Actions_Tourniquet); condition = QUOTE([ARR_4(_player, _target, 'hand_l', 'Tourniquet')] call DFUNC(canTreatCached)); - exceptions[] = {"isNotInside"}; + exceptions[] = {"isNotInside", "isNotSwimming"}; statement = QUOTE([ARR_4(_player, _target, 'hand_l', 'Tourniquet')] call DFUNC(treatment)); icon = QPATHTOF(UI\icons\tourniquet.paa); }; class Morphine: fieldDressing { displayName = CSTRING(Inject_Morphine); condition = QUOTE([ARR_4(_player, _target, 'hand_l', 'Morphine')] call DFUNC(canTreatCached)); - exceptions[] = {"isNotInside"}; + exceptions[] = {"isNotInside", "isNotSwimming"}; statement = QUOTE([ARR_4(_player, _target, 'hand_l', 'Morphine')] call DFUNC(treatment)); icon = QPATHTOF(UI\icons\autoInjector.paa); }; class Adenosine: Morphine { displayName = CSTRING(Inject_Atropine); condition = QUOTE([ARR_4(_player, _target, 'hand_l', 'Adenosine')] call DFUNC(canTreatCached)); - exceptions[] = {"isNotInside"}; + exceptions[] = {"isNotInside", "isNotSwimming"}; statement = QUOTE([ARR_4(_player, _target, 'hand_l', 'Adenosine')] call DFUNC(treatment)); icon = QPATHTOF(UI\icons\autoInjector.paa); }; class Atropine: Morphine { displayName = CSTRING(Inject_Atropine); condition = QUOTE([ARR_4(_player, _target, 'hand_l', 'Atropine')] call DFUNC(canTreatCached)); - exceptions[] = {"isNotInside"}; + exceptions[] = {"isNotInside", "isNotSwimming"}; statement = QUOTE([ARR_4(_player, _target, 'hand_l', 'Atropine')] call DFUNC(treatment)); icon = QPATHTOF(UI\icons\autoInjector.paa); }; class Epinephrine: Morphine { displayName = CSTRING(Inject_Epinephrine); condition = QUOTE([ARR_4(_player, _target, 'hand_l', 'Epinephrine')] call DFUNC(canTreatCached)); - exceptions[] = {"isNotInside"}; + exceptions[] = {"isNotInside", "isNotSwimming"}; statement = QUOTE([ARR_4(_player, _target, 'hand_l', 'Epinephrine')] call DFUNC(treatment)); icon = QPATHTOF(UI\icons\autoInjector.paa); }; class CheckPulse: fieldDressing { displayName = CSTRING(Actions_CheckPulse); condition = QUOTE([ARR_4(_player, _target, 'hand_l', 'CheckPulse')] call DFUNC(canTreatCached)); - exceptions[] = {"isNotInside"}; + exceptions[] = {"isNotInside", "isNotSwimming"}; statement = QUOTE([ARR_4(_player, _target, 'hand_l', 'CheckPulse')] call DFUNC(treatment)); icon = ""; }; class CheckBloodPressure: CheckPulse { displayName = CSTRING(Actions_CheckBloodPressure); condition = QUOTE([ARR_4(_player, _target, 'hand_l', 'CheckBloodPressure')] call DFUNC(canTreatCached)); - exceptions[] = {"isNotInside"}; + exceptions[] = {"isNotInside", "isNotSwimming"}; statement = QUOTE([ARR_4(_player, _target, 'hand_l', 'CheckBloodPressure')] call DFUNC(treatment)); }; class RemoveTourniquet: Tourniquet { displayName = CSTRING(Actions_RemoveTourniquet); condition = QUOTE([ARR_4(_player, _target, 'hand_l', 'RemoveTourniquet')] call DFUNC(canTreatCached)); - exceptions[] = {"isNotInside"}; + exceptions[] = {"isNotInside", "isNotSwimming"}; statement = QUOTE([ARR_4(_player, _target, 'hand_l', 'RemoveTourniquet')] call DFUNC(treatment)); }; }; class ACE_ArmRight { displayName = ECSTRING(interaction,ArmRight); runOnHover = 1; - exceptions[] = {"isNotInside", "isNotSitting"}; + exceptions[] = {"isNotInside", "isNotSwimming", "isNotSitting"}; statement = QUOTE([ARR_3(_target, true, 3)] call DFUNC(displayPatientInformation)); modifierFunction = QUOTE([ARR_4(_target,_player,3,_this select 3)] call FUNC(modifyMedicalAction)); condition = "true"; @@ -258,7 +258,7 @@ class Medical { displayName = CSTRING(Bandage); distance = 2.0; condition = QUOTE([ARR_4(_player, _target, 'hand_r', 'Bandage')] call DFUNC(canTreatCached)); - exceptions[] = {"isNotInside"}; + exceptions[] = {"isNotInside", "isNotSwimming"}; statement = QUOTE([ARR_4(_player, _target, 'hand_r', 'Bandage')] call DFUNC(treatment)); showDisabled = 1; priority = 2; @@ -270,7 +270,7 @@ class Medical { displayName = CSTRING(Actions_FieldDressing); distance = 5.0; condition = QUOTE([ARR_4(_player, _target, 'hand_r', 'FieldDressing')] call DFUNC(canTreatCached)); - exceptions[] = {"isNotInside"}; + exceptions[] = {"isNotInside", "isNotSwimming"}; statement = QUOTE([ARR_4(_player, _target, 'hand_r', 'FieldDressing')] call DFUNC(treatment)); showDisabled = 0; priority = 2; @@ -279,79 +279,79 @@ class Medical { class PackingBandage: fieldDressing { displayName = CSTRING(Actions_PackingBandage); condition = QUOTE([ARR_4(_player, _target, 'hand_r', 'PackingBandage')] call DFUNC(canTreatCached)); - exceptions[] = {"isNotInside"}; + exceptions[] = {"isNotInside", "isNotSwimming"}; statement = QUOTE([ARR_4(_player, _target, 'hand_r', 'PackingBandage')] call DFUNC(treatment)); icon = QPATHTOF(UI\icons\packingBandage.paa); }; class ElasticBandage: fieldDressing { displayName = CSTRING(Actions_ElasticBandage); condition = QUOTE([ARR_4(_player, _target, 'hand_r', 'ElasticBandage')] call DFUNC(canTreatCached)); - exceptions[] = {"isNotInside"}; + exceptions[] = {"isNotInside", "isNotSwimming"}; statement = QUOTE([ARR_4(_player, _target, 'hand_r', 'ElasticBandage')] call DFUNC(treatment)); }; class QuikClot: fieldDressing { displayName = CSTRING(Actions_QuikClot); condition = QUOTE([ARR_4(_player, _target, 'hand_r', 'QuikClot')] call DFUNC(canTreatCached)); - exceptions[] = {"isNotInside"}; + exceptions[] = {"isNotInside", "isNotSwimming"}; statement = QUOTE([ARR_4(_player, _target, 'hand_r', 'QuikClot')] call DFUNC(treatment)); }; class Tourniquet: fieldDressing { displayName = CSTRING(Actions_Tourniquet); condition = QUOTE([ARR_4(_player, _target, 'hand_r', 'Tourniquet')] call DFUNC(canTreatCached)); - exceptions[] = {"isNotInside"}; + exceptions[] = {"isNotInside", "isNotSwimming"}; statement = QUOTE([ARR_4(_player, _target, 'hand_r', 'Tourniquet')] call DFUNC(treatment)); icon = QPATHTOF(UI\icons\tourniquet.paa); }; class Morphine: fieldDressing { displayName = CSTRING(Inject_Morphine); condition = QUOTE([ARR_4(_player, _target, 'hand_r', 'Morphine')] call DFUNC(canTreatCached)); - exceptions[] = {"isNotInside"}; + exceptions[] = {"isNotInside", "isNotSwimming"}; statement = QUOTE([ARR_4(_player, _target, 'hand_r', 'Morphine')] call DFUNC(treatment)); icon = QPATHTOF(UI\icons\autoInjector.paa); }; class Adenosine: Morphine { - displayName = CSTRING(Inject_Atropine); + displayName = CSTRING(Inject_Adenosine); condition = QUOTE([ARR_4(_player, _target, 'hand_r', 'Adenosine')] call DFUNC(canTreatCached)); - exceptions[] = {"isNotInside"}; + exceptions[] = {"isNotInside", "isNotSwimming"}; statement = QUOTE([ARR_4(_player, _target, 'hand_r', 'Adenosine')] call DFUNC(treatment)); icon = QPATHTOF(UI\icons\autoInjector.paa); }; class Atropine: Morphine { displayName = CSTRING(Inject_Atropine); condition = QUOTE([ARR_4(_player, _target, 'hand_r', 'Atropine')] call DFUNC(canTreatCached)); - exceptions[] = {"isNotInside"}; + exceptions[] = {"isNotInside", "isNotSwimming"}; statement = QUOTE([ARR_4(_player, _target, 'hand_r', 'Atropine')] call DFUNC(treatment)); }; class Epinephrine: Morphine { displayName = CSTRING(Inject_Epinephrine); condition = QUOTE([ARR_4(_player, _target, 'hand_r', 'Epinephrine')] call DFUNC(canTreatCached)); - exceptions[] = {"isNotInside"}; + exceptions[] = {"isNotInside", "isNotSwimming"}; statement = QUOTE([ARR_4(_player, _target, 'hand_r', 'Epinephrine')] call DFUNC(treatment)); }; class CheckPulse: fieldDressing { displayName = CSTRING(Actions_CheckPulse); condition = QUOTE([ARR_4(_player, _target, 'hand_r', 'CheckPulse')] call DFUNC(canTreatCached)); - exceptions[] = {"isNotInside"}; + exceptions[] = {"isNotInside", "isNotSwimming"}; statement = QUOTE([ARR_4(_player, _target, 'hand_r', 'CheckPulse')] call DFUNC(treatment)); icon = ""; }; class CheckBloodPressure: CheckPulse { displayName = CSTRING(Actions_CheckBloodPressure); condition = QUOTE([ARR_4(_player, _target, 'hand_r', 'CheckBloodPressure')] call DFUNC(canTreatCached)); - exceptions[] = {"isNotInside"}; + exceptions[] = {"isNotInside", "isNotSwimming"}; statement = QUOTE([ARR_4(_player, _target, 'hand_r', 'CheckBloodPressure')] call DFUNC(treatment)); }; class RemoveTourniquet: Tourniquet { displayName = CSTRING(Actions_RemoveTourniquet); condition = QUOTE([ARR_4(_player, _target, 'hand_r', 'RemoveTourniquet')] call DFUNC(canTreatCached)); - exceptions[] = {"isNotInside"}; + exceptions[] = {"isNotInside", "isNotSwimming"}; statement = QUOTE([ARR_4(_player, _target, 'hand_r', 'RemoveTourniquet')] call DFUNC(treatment)); }; }; class ACE_LegLeft { displayName = ECSTRING(interaction,LegLeft); runOnHover = 1; - exceptions[] = {"isNotInside", "isNotSitting"}; + exceptions[] = {"isNotInside", "isNotSwimming", "isNotSitting"}; statement = QUOTE([ARR_3(_target, true, 4)] call DFUNC(displayPatientInformation)); modifierFunction = QUOTE([ARR_4(_target,_player,4,_this select 3)] call FUNC(modifyMedicalAction)); condition = "true"; @@ -361,7 +361,7 @@ class Medical { displayName = CSTRING(Bandage); distance = 2.0; condition = QUOTE([ARR_4(_player, _target, 'leg_l', 'Bandage')] call DFUNC(canTreatCached)); - exceptions[] = {"isNotInside"}; + exceptions[] = {"isNotInside", "isNotSwimming"}; statement = QUOTE([ARR_4(_player, _target, 'leg_l', 'Bandage')] call DFUNC(treatment)); showDisabled = 1; priority = 2; @@ -374,7 +374,7 @@ class Medical { displayName = CSTRING(Actions_FieldDressing); distance = 5.0; condition = QUOTE([ARR_4(_player, _target, 'leg_l', 'FieldDressing')] call DFUNC(canTreatCached)); - exceptions[] = {"isNotInside"}; + exceptions[] = {"isNotInside", "isNotSwimming"}; statement = QUOTE([ARR_4(_player, _target, 'leg_l', 'FieldDressing')] call DFUNC(treatment)); showDisabled = 0; priority = 2; @@ -383,67 +383,67 @@ class Medical { class PackingBandage: fieldDressing { displayName = CSTRING(Actions_PackingBandage); condition = QUOTE([ARR_4(_player, _target, 'leg_l', 'PackingBandage')] call DFUNC(canTreatCached)); - exceptions[] = {"isNotInside"}; + exceptions[] = {"isNotInside", "isNotSwimming"}; statement = QUOTE([ARR_4(_player, _target, 'leg_l', 'PackingBandage')] call DFUNC(treatment)); icon = QPATHTOF(UI\icons\packingBandage.paa); }; class ElasticBandage: fieldDressing { displayName = CSTRING(Actions_ElasticBandage); condition = QUOTE([ARR_4(_player, _target, 'leg_l', 'ElasticBandage')] call DFUNC(canTreatCached)); - exceptions[] = {"isNotInside"}; + exceptions[] = {"isNotInside", "isNotSwimming"}; statement = QUOTE([ARR_4(_player, _target, 'leg_l', 'ElasticBandage')] call DFUNC(treatment)); }; class QuikClot: fieldDressing { displayName = CSTRING(Actions_QuikClot); condition = QUOTE([ARR_4(_player, _target, 'leg_l', 'QuikClot')] call DFUNC(canTreatCached)); - exceptions[] = {"isNotInside"}; + exceptions[] = {"isNotInside", "isNotSwimming"}; statement = QUOTE([ARR_4(_player, _target, 'leg_l', 'QuikClot')] call DFUNC(treatment)); }; class Tourniquet: fieldDressing { displayName = CSTRING(Actions_Tourniquet); condition = QUOTE([ARR_4(_player, _target, 'leg_l', 'Tourniquet')] call DFUNC(canTreatCached)); - exceptions[] = {"isNotInside"}; + exceptions[] = {"isNotInside", "isNotSwimming"}; statement = QUOTE([ARR_4(_player, _target, 'leg_l', 'Tourniquet')] call DFUNC(treatment)); icon = QPATHTOF(UI\icons\tourniquet.paa); }; class Morphine: fieldDressing { displayName = CSTRING(Inject_Morphine); condition = QUOTE([ARR_4(_player, _target, 'leg_l', 'Morphine')] call DFUNC(canTreatCached)); - exceptions[] = {"isNotInside"}; + exceptions[] = {"isNotInside", "isNotSwimming"}; statement = QUOTE([ARR_4(_player, _target, 'leg_l', 'Morphine')] call DFUNC(treatment)); icon = QPATHTOF(UI\icons\autoInjector.paa); }; class Adenosine: Morphine { displayName = CSTRING(Inject_Atropine); condition = QUOTE([ARR_4(_player, _target, 'leg_l', 'Adenosine')] call DFUNC(canTreatCached)); - exceptions[] = {"isNotInside"}; + exceptions[] = {"isNotInside", "isNotSwimming"}; statement = QUOTE([ARR_4(_player, _target, 'leg_l', 'Adenosine')] call DFUNC(treatment)); icon = QPATHTOF(UI\icons\autoInjector.paa); }; class Atropine: Morphine { displayName = CSTRING(Inject_Atropine); condition = QUOTE([ARR_4(_player, _target, 'leg_l', 'Atropine')] call DFUNC(canTreatCached)); - exceptions[] = {"isNotInside"}; + exceptions[] = {"isNotInside", "isNotSwimming"}; statement = QUOTE([ARR_4(_player, _target, 'leg_l', 'Atropine')] call DFUNC(treatment)); icon = QPATHTOF(UI\icons\autoInjector.paa); }; class Epinephrine: Morphine { displayName = CSTRING(Inject_Epinephrine); condition = QUOTE([ARR_4(_player, _target, 'leg_l', 'Epinephrine')] call DFUNC(canTreatCached)); - exceptions[] = {"isNotInside"}; + exceptions[] = {"isNotInside", "isNotSwimming"}; statement = QUOTE([ARR_4(_player, _target, 'leg_l', 'Epinephrine')] call DFUNC(treatment)); }; class RemoveTourniquet: Tourniquet { displayName = CSTRING(Actions_RemoveTourniquet); condition = QUOTE([ARR_4(_player, _target, 'leg_l', 'RemoveTourniquet')] call DFUNC(canTreatCached)); - exceptions[] = {"isNotInside"}; + exceptions[] = {"isNotInside", "isNotSwimming"}; statement = QUOTE([ARR_4(_player, _target, 'leg_l', 'RemoveTourniquet')] call DFUNC(treatment)); }; }; class ACE_LegRight { displayName = ECSTRING(interaction,LegRight); runOnHover = 1; - exceptions[] = {"isNotInside", "isNotSitting"}; + exceptions[] = {"isNotInside", "isNotSwimming", "isNotSitting"}; statement = QUOTE([ARR_3(_target, true, 5)] call DFUNC(displayPatientInformation)); modifierFunction = QUOTE([ARR_4(_target,_player,5,_this select 3)] call FUNC(modifyMedicalAction)); condition = "true"; @@ -453,7 +453,7 @@ class Medical { displayName = CSTRING(Bandage); distance = 2.0; condition = QUOTE([ARR_4(_player, _target, 'leg_r', 'Bandage')] call DFUNC(canTreatCached)); - exceptions[] = {"isNotInside"}; + exceptions[] = {"isNotInside", "isNotSwimming"}; statement = QUOTE([ARR_4(_player, _target, 'leg_r', 'Bandage')] call DFUNC(treatment)); showDisabled = 1; priority = 2; @@ -466,7 +466,7 @@ class Medical { displayName = CSTRING(Actions_FieldDressing); distance = 5.0; condition = QUOTE([ARR_4(_player, _target, 'leg_r', 'FieldDressing')] call DFUNC(canTreatCached)); - exceptions[] = {"isNotInside"}; + exceptions[] = {"isNotInside", "isNotSwimming"}; statement = QUOTE([ARR_4(_player, _target, 'leg_r', 'FieldDressing')] call DFUNC(treatment)); showDisabled = 0; priority = 2; @@ -475,59 +475,59 @@ class Medical { class PackingBandage: fieldDressing { displayName = CSTRING(Actions_PackingBandage); condition = QUOTE([ARR_4(_player, _target, 'leg_r', 'PackingBandage')] call DFUNC(canTreatCached)); - exceptions[] = {"isNotInside"}; + exceptions[] = {"isNotInside", "isNotSwimming"}; statement = QUOTE([ARR_4(_player, _target, 'leg_r', 'PackingBandage')] call DFUNC(treatment)); icon = QPATHTOF(UI\icons\packingBandage.paa); }; class ElasticBandage: fieldDressing { displayName = CSTRING(Actions_ElasticBandage); condition = QUOTE([ARR_4(_player, _target, 'leg_r', 'ElasticBandage')] call DFUNC(canTreatCached)); - exceptions[] = {"isNotInside"}; + exceptions[] = {"isNotInside", "isNotSwimming"}; statement = QUOTE([ARR_4(_player, _target, 'leg_r', 'ElasticBandage')] call DFUNC(treatment)); }; class QuikClot: fieldDressing { displayName = CSTRING(Actions_QuikClot); condition = QUOTE([ARR_4(_player, _target, 'leg_r', 'QuikClot')] call DFUNC(canTreatCached)); - exceptions[] = {"isNotInside"}; + exceptions[] = {"isNotInside", "isNotSwimming"}; statement = QUOTE([ARR_4(_player, _target, 'leg_r', 'QuikClot')] call DFUNC(treatment)); }; class Tourniquet: fieldDressing { displayName = CSTRING(Actions_Tourniquet); condition = QUOTE([ARR_4(_player, _target, 'leg_r', 'Tourniquet')] call DFUNC(canTreatCached)); - exceptions[] = {"isNotInside"}; + exceptions[] = {"isNotInside", "isNotSwimming"}; statement = QUOTE([ARR_4(_player, _target, 'leg_r', 'Tourniquet')] call DFUNC(treatment)); icon = QPATHTOF(UI\icons\tourniquet.paa); }; class Morphine: fieldDressing { displayName = CSTRING(Inject_Morphine); condition = QUOTE([ARR_4(_player, _target, 'leg_r', 'Morphine')] call DFUNC(canTreatCached)); - exceptions[] = {"isNotInside"}; + exceptions[] = {"isNotInside", "isNotSwimming"}; statement = QUOTE([ARR_4(_player, _target, 'leg_r', 'Morphine')] call DFUNC(treatment)); icon = QPATHTOF(UI\icons\autoInjector.paa); }; class Adenosine: Morphine { displayName = CSTRING(Inject_Atropine); condition = QUOTE([ARR_4(_player, _target, 'leg_r', 'Adenosine')] call DFUNC(canTreatCached)); - exceptions[] = {"isNotInside"}; + exceptions[] = {"isNotInside", "isNotSwimming"}; statement = QUOTE([ARR_4(_player, _target, 'leg_r', 'Adenosine')] call DFUNC(treatment)); icon = QPATHTOF(UI\icons\autoInjector.paa); }; class Atropine: Morphine { displayName = CSTRING(Inject_Atropine); condition = QUOTE([ARR_4(_player, _target, 'leg_r', 'Atropine')] call DFUNC(canTreatCached)); - exceptions[] = {"isNotInside"}; + exceptions[] = {"isNotInside", "isNotSwimming"}; statement = QUOTE([ARR_4(_player, _target, 'leg_r', 'Atropine')] call DFUNC(treatment)); }; class Epinephrine: Morphine { displayName = CSTRING(Inject_Epinephrine); condition = QUOTE([ARR_4(_player, _target, 'leg_r', 'Epinephrine')] call DFUNC(canTreatCached)); - exceptions[] = {"isNotInside"}; + exceptions[] = {"isNotInside", "isNotSwimming"}; statement = QUOTE([ARR_4(_player, _target, 'leg_r', 'Epinephrine')] call DFUNC(treatment)); }; class RemoveTourniquet: Tourniquet { displayName = CSTRING(Actions_RemoveTourniquet); condition = QUOTE([ARR_4(_player, _target, 'leg_r', 'RemoveTourniquet')] call DFUNC(canTreatCached)); - exceptions[] = {"isNotInside"}; + exceptions[] = {"isNotInside", "isNotSwimming"}; statement = QUOTE([ARR_4(_player, _target, 'leg_r', 'RemoveTourniquet')] call DFUNC(treatment)); }; }; diff --git a/addons/medical/ACE_Settings.hpp b/addons/medical/ACE_Settings.hpp index 9434686f4b..4c3cdc3607 100644 --- a/addons/medical/ACE_Settings.hpp +++ b/addons/medical/ACE_Settings.hpp @@ -49,16 +49,6 @@ class ACE_Settings { typeName = "SCALAR"; value = 1; }; - class GVAR(enableAirway) { - category = CSTRING(Category_Medical); - typeName = "BOOL"; - value = false; - }; - class GVAR(enableFractures) { - category = CSTRING(Category_Medical); - typeName = "BOOL"; - value = false; - }; class GVAR(enableAdvancedWounds) { category = CSTRING(Category_Medical); displayName = CSTRING(AdvancedMedicalSettings_enableAdvancedWounds_DisplayName); diff --git a/addons/medical/CfgEden.hpp b/addons/medical/CfgEden.hpp index e4d034a413..bebfdb9549 100644 --- a/addons/medical/CfgEden.hpp +++ b/addons/medical/CfgEden.hpp @@ -9,8 +9,8 @@ class Cfg3DEN { }; }; class GVAR(isMedicControl): Title { - attributeLoad = "(_this controlsGroupCtrl 100) lbsetcursel (((_value + 1) min 3) max 0);"; - attributeSave = "(missionnamespace getvariable ['ace_isMeidc_temp',0]) - 1;"; + attributeLoad = "(_this controlsGroupCtrl 100) lbSetCurSel (((_value + 1) min 3) max 0);"; + attributeSave = "(lbCurSel (_this controlsGroupCtrl 100)) - 1"; class Controls: Controls { class Title: Title{}; class Value: ctrlToolbox { @@ -22,7 +22,6 @@ class Cfg3DEN { rows = 1; columns = 4; strings[] = {"$STR_3DEN_Attributes_Lock_Default_text", CSTRING(AssignMedicRoles_role_none), CSTRING(AssignMedicRoles_role_medic), CSTRING(AssignMedicRoles_role_doctorShort)}; - onToolboxSelChanged = "missionnamespace setvariable ['ace_isMeidc_temp',_this select 1];"; }; }; }; @@ -36,7 +35,7 @@ class Cfg3DEN { control = QGVAR(isMedicControl); displayName = CSTRING(AssignMedicRoles_role_DisplayName); tooltip = CSTRING(Attributes_isMedic_Description); - expression = QUOTE(if (_value != -1) then {_this setVariable [ARR_3(QUOTE(QGVAR(medicClass)),_value, true)];};); + expression = QUOTE(if (_value > -1) then {_this setVariable [ARR_3(QUOTE(QGVAR(medicClass)),_value, true)];};); typeName = "NUMBER"; condition = "objectBrain"; defaultValue = "-1"; diff --git a/addons/medical/CfgVehicles.hpp b/addons/medical/CfgVehicles.hpp index 84bda805fd..4217fb3745 100644 --- a/addons/medical/CfgVehicles.hpp +++ b/addons/medical/CfgVehicles.hpp @@ -522,7 +522,7 @@ class CfgVehicles { class ACE_Actions { // Include actions in body parts for treatment while in the open - #define EXCEPTIONS exceptions[] = {}; + #define EXCEPTIONS exceptions[] = {"isNotSwimming"}; #define ACTION_CONDITION condition = QUOTE(GVAR(menuTypeStyle) == 0); #include "ACE_Medical_Actions.hpp" @@ -538,29 +538,30 @@ class CfgVehicles { #undef EXCEPTIONS #undef ACTION_CONDITION - #define EXCEPTIONS exceptions[] = {"isNotInside"}; + #define EXCEPTIONS exceptions[] = {"isNotInside", "isNotSwimming"}; #define ACTION_CONDITION condition = "true"; #include "ACE_Medical_Actions.hpp" }; class GVAR(loadPatient) { displayName = CSTRING(LoadPatient); distance = 5; - condition = QUOTE(_target getVariable[ARR_2(QUOTE(QUOTE(ACE_isUnconscious)),false)] && vehicle _target == _target); + condition = QUOTE(_target getVariable [ARR_2(QUOTE(QUOTE(ACE_isUnconscious)), false)] && {alive _target} && {vehicle _target == _target}); statement = QUOTE([ARR_2(_player, _target)] call DFUNC(actionLoadUnit)); showDisabled = 0; priority = 2; icon = QPATHTOF(UI\icons\medical_cross.paa); - exceptions[] = {"isNotDragging", "isNotCarrying"}; + exceptions[] = {"isNotDragging", "isNotCarrying", "isNotSwimming"}; + insertChildren = QUOTE(call DFUNC(addLoadPatientActions)); }; class GVAR(UnLoadPatient) { displayName = CSTRING(UnloadPatient); distance = 5; - condition = QUOTE(_target getVariable[ARR_2(QUOTE(QUOTE(ACE_isUnconscious)),false)] && vehicle _target != _target); + condition = QUOTE(_target getVariable [ARR_2(QUOTE(QUOTE(ACE_isUnconscious)), false)] && {vehicle _target != _target} && {vehicle _player == _player}); statement = QUOTE([ARR_2(_player, _target)] call DFUNC(actionUnloadUnit)); showDisabled = 0; priority = 2; icon = QPATHTOF(UI\icons\medical_cross.paa); - exceptions[] = {"isNotDragging", "isNotCarrying", "isNotInside"}; + exceptions[] = {"isNotDragging", "isNotCarrying", "isNotInside", "isNotSwimming"}; }; }; }; @@ -876,14 +877,22 @@ class CfgVehicles { }; }; - class NATO_Box_Base; + class ThingX; + class ReammoBox_F: ThingX { + class ACE_Actions; + }; + class NATO_Box_Base: ReammoBox_F { + class ACE_Actions: ACE_Actions { + class ACE_MainActions; + }; + }; class ACE_medicalSupplyCrate: NATO_Box_Base { scope = 2; scopeCurator = 2; accuracy = 1000; displayName = CSTRING(medicalSupplyCrate); model = QPATHTOF(data\ace_medcrate.p3d); - author = ECSTRING(common,ACETeam); + author = "ElTyranos"; class TransportItems { MACRO_ADDITEM(ACE_fieldDressing,50); MACRO_ADDITEM(ACE_morphine,25); @@ -893,6 +902,35 @@ class CfgVehicles { MACRO_ADDITEM(ACE_bloodIV_250,15); MACRO_ADDITEM(ACE_bodyBag,10); }; + class AnimationSources { + class Cover { + source = "user"; + animPeriod = 1.5; + initPhase = 0; + minValue = 0; + maxValue = 1; + }; + }; + class ACE_Actions: ACE_Actions { + class ACE_MainActions: ACE_MainActions { + selection = "cover_action"; + + class ACE_OpenLid { + displayName = CSTRING(openLid); + condition = QUOTE(alive _target && {_target animationPhase 'Cover' < 0.5}); + statement = QUOTE(_target animate ARR_2(['Cover',1])); + showDisabled = 0; + priority = -1; + }; + class ACE_CloseLid { + displayName = CSTRING(closeLid); + condition = QUOTE(alive _target && {_target animationPhase 'Cover' >= 0.5}); + statement = QUOTE(_target animate ARR_2(['Cover',0])); + showDisabled = 0; + priority = -1; + }; + }; + }; }; class ACE_medicalSupplyCrate_advanced: ACE_medicalSupplyCrate { displayName = CSTRING(medicalSupplyCrate_advanced); diff --git a/addons/medical/CfgWeapons.hpp b/addons/medical/CfgWeapons.hpp index df9a756a34..25872b584a 100644 --- a/addons/medical/CfgWeapons.hpp +++ b/addons/medical/CfgWeapons.hpp @@ -1,7 +1,7 @@ class CfgWeapons { class ItemCore; - class InventoryItem_Base_F; + class CBA_MiscItem_ItemInfo; class InventoryFirstAidKitItem_Base_F; class MedikitItem; @@ -27,7 +27,7 @@ class CfgWeapons { displayName = CSTRING(Bandage_Basic_Display); descriptionShort = CSTRING(Bandage_Basic_Desc_Short); descriptionUse = CSTRING(Bandage_Basic_Desc_Use); - class ItemInfo: InventoryItem_Base_F { + class ItemInfo: CBA_MiscItem_ItemInfo { mass = 1; }; }; @@ -38,7 +38,7 @@ class CfgWeapons { model = QPATHTOF(data\packingbandage.p3d); descriptionShort = CSTRING(Packing_Bandage_Desc_Short); descriptionUse = CSTRING(Packing_Bandage_Desc_Use); - class ItemInfo: InventoryItem_Base_F { + class ItemInfo: CBA_MiscItem_ItemInfo { mass = 1; }; }; @@ -49,7 +49,7 @@ class CfgWeapons { model = "\A3\Structures_F_EPA\Items\Medical\Bandage_F.p3d"; descriptionShort = CSTRING(Bandage_Elastic_Desc_Short); descriptionUse = CSTRING(Bandage_Elastic_Desc_Use); - class ItemInfo: InventoryItem_Base_F { + class ItemInfo: CBA_MiscItem_ItemInfo { mass = 1; }; }; @@ -60,7 +60,7 @@ class CfgWeapons { model = QPATHTOF(data\tourniquet.p3d); descriptionShort = CSTRING(Tourniquet_Desc_Short); descriptionUse = CSTRING(Tourniquet_Desc_Use); - class ItemInfo: InventoryItem_Base_F { + class ItemInfo: CBA_MiscItem_ItemInfo { mass = 1; }; }; @@ -71,7 +71,7 @@ class CfgWeapons { model = QPATHTOF(data\morphine.p3d); descriptionShort = CSTRING(Morphine_Desc_Short); descriptionUse = CSTRING(Morphine_Desc_Use); - class ItemInfo: InventoryItem_Base_F { + class ItemInfo: CBA_MiscItem_ItemInfo { mass = 1; }; }; @@ -82,7 +82,7 @@ class CfgWeapons { model = QPATHTOF(data\adenosine.p3d); descriptionShort = CSTRING(adenosine_Desc_Short); descriptionUse = CSTRING(adenosine_Desc_Use); - class ItemInfo: InventoryItem_Base_F { + class ItemInfo: CBA_MiscItem_ItemInfo { mass = 1; }; }; @@ -93,7 +93,7 @@ class CfgWeapons { model = QPATHTOF(data\atropine.p3d); descriptionShort = CSTRING(Atropine_Desc_Short); descriptionUse = CSTRING(Atropine_Desc_Use); - class ItemInfo: InventoryItem_Base_F { + class ItemInfo: CBA_MiscItem_ItemInfo { mass = 1; }; }; @@ -104,7 +104,7 @@ class CfgWeapons { model = QPATHTOF(data\epinephrine.p3d); descriptionShort = CSTRING(Epinephrine_Desc_Short); descriptionUse = CSTRING(Epinephrine_Desc_Use); - class ItemInfo: InventoryItem_Base_F { + class ItemInfo: CBA_MiscItem_ItemInfo { mass = 1; }; }; @@ -118,7 +118,7 @@ class CfgWeapons { picture = QPATHTOF(ui\items\plasmaIV_x_ca.paa); descriptionShort = CSTRING(Plasma_IV_Desc_Short); descriptionUse = CSTRING(Plasma_IV_Desc_Use); - class ItemInfo: InventoryItem_Base_F { + class ItemInfo: CBA_MiscItem_ItemInfo { mass = 10; }; }; @@ -126,7 +126,7 @@ class CfgWeapons { displayName = CSTRING(Plasma_IV_500); model = QPATHTOF(data\IVBag_500ml.p3d); hiddenSelectionsTextures[] = { QPATHTOF(data\IVBag_plasma_500ml_ca.paa) }; - class ItemInfo: InventoryItem_Base_F { + class ItemInfo: CBA_MiscItem_ItemInfo { mass = 5; }; }; @@ -134,7 +134,7 @@ class CfgWeapons { displayName = CSTRING(Plasma_IV_250); model = QPATHTOF(data\IVBag_250ml.p3d); hiddenSelectionsTextures[] = { QPATHTOF(data\IVBag_plasma_250ml_ca.paa) }; - class ItemInfo: InventoryItem_Base_F { + class ItemInfo: CBA_MiscItem_ItemInfo { mass = 2.5; }; }; @@ -147,7 +147,7 @@ class CfgWeapons { hiddenSelectionsTextures[] = { QPATHTOF(data\IVBag_blood_1000ml_ca.paa) }; descriptionShort = CSTRING(Blood_IV_Desc_Short); descriptionUse = CSTRING(Blood_IV_Desc_Use); - class ItemInfo: InventoryItem_Base_F { + class ItemInfo: CBA_MiscItem_ItemInfo { mass = 10; }; }; @@ -155,7 +155,7 @@ class CfgWeapons { displayName = CSTRING(Blood_IV_500); model = QPATHTOF(data\IVBag_500ml.p3d); hiddenSelectionsTextures[] = { QPATHTOF(data\IVBag_blood_500ml_ca.paa) }; - class ItemInfo: InventoryItem_Base_F { + class ItemInfo: CBA_MiscItem_ItemInfo { mass = 5; }; }; @@ -163,7 +163,7 @@ class CfgWeapons { displayName = CSTRING(Blood_IV_250); model = QPATHTOF(data\IVBag_250ml.p3d); hiddenSelectionsTextures[] = { QPATHTOF(data\IVBag_blood_250ml_ca.paa) }; - class ItemInfo: InventoryItem_Base_F { + class ItemInfo: CBA_MiscItem_ItemInfo { mass = 2.5; }; }; @@ -176,7 +176,7 @@ class CfgWeapons { picture = QPATHTOF(ui\items\salineIV_x_ca.paa); descriptionShort = CSTRING(Saline_IV_Desc_Short); descriptionUse = CSTRING(Saline_IV_Desc_Use); - class ItemInfo: InventoryItem_Base_F { + class ItemInfo: CBA_MiscItem_ItemInfo { mass = 10; }; }; @@ -184,7 +184,7 @@ class CfgWeapons { displayName = CSTRING(Saline_IV_500); model = QPATHTOF(data\IVBag_500ml.p3d); hiddenSelectionsTextures[] = { QPATHTOF(data\IVBag_saline_500ml_ca.paa) }; - class ItemInfo: InventoryItem_Base_F { + class ItemInfo: CBA_MiscItem_ItemInfo { mass = 5; }; }; @@ -192,7 +192,7 @@ class CfgWeapons { displayName = CSTRING(Saline_IV_250); model = QPATHTOF(data\IVBag_250ml.p3d); hiddenSelectionsTextures[] = { QPATHTOF(data\IVBag_saline_250ml_ca.paa) }; - class ItemInfo: InventoryItem_Base_F { + class ItemInfo: CBA_MiscItem_ItemInfo { mass = 2.5; }; }; @@ -203,7 +203,7 @@ class CfgWeapons { picture = QPATHTOF(ui\items\quickclot_x_ca.paa); descriptionShort = CSTRING(QuikClot_Desc_Short); descriptionUse = CSTRING(QuikClot_Desc_Use); - class ItemInfo: InventoryItem_Base_F { + class ItemInfo: CBA_MiscItem_ItemInfo { mass = 1; }; }; @@ -213,7 +213,7 @@ class CfgWeapons { picture = QPATHTOF(ui\items\personal_aid_kit_x_ca.paa); descriptionShort = CSTRING(Aid_Kit_Desc_Short); descriptionUse = CSTRING(Aid_Kit_Desc_Use); - class ItemInfo: InventoryItem_Base_F { + class ItemInfo: CBA_MiscItem_ItemInfo { mass = 10; }; }; @@ -224,7 +224,7 @@ class CfgWeapons { picture = QPATHTOF(ui\items\surgicalKit_x_ca.paa); descriptionShort = CSTRING(SurgicalKit_Desc_Short); descriptionUse = CSTRING(SurgicalKit_Desc_Use); - class ItemInfo: InventoryItem_Base_F { + class ItemInfo: CBA_MiscItem_ItemInfo { mass = 15; }; }; @@ -235,7 +235,7 @@ class CfgWeapons { picture = QPATHTOF(ui\items\bodybag_x_ca.paa); descriptionShort = CSTRING(Bodybag_Desc_Short); descriptionUse = CSTRING(Bodybag_Desc_Use); - class ItemInfo: InventoryItem_Base_F { + class ItemInfo: CBA_MiscItem_ItemInfo { mass = 7; }; }; diff --git a/addons/medical/XEH_PREP.hpp b/addons/medical/XEH_PREP.hpp index b754f00f5d..9749bd7efc 100644 --- a/addons/medical/XEH_PREP.hpp +++ b/addons/medical/XEH_PREP.hpp @@ -11,7 +11,7 @@ PREP(actionLoadUnit); PREP(actionUnloadUnit); PREP(addDamageToUnit); PREP(addHeartRateAdjustment); -PREP(addToInjuredCollection); +PREP(addLoadPatientActions); PREP(addToLog); PREP(addToTriageCard); PREP(addUnconsciousCondition); diff --git a/addons/medical/XEH_postInit.sqf b/addons/medical/XEH_postInit.sqf index 979f3c47bc..4fb13428c9 100644 --- a/addons/medical/XEH_postInit.sqf +++ b/addons/medical/XEH_postInit.sqf @@ -107,7 +107,6 @@ GVAR(effectTimeBlood) = CBA_missionTime; // MAIN EFFECTS LOOP [{ - private ["_bleeding", "_blood"]; // Zeus interface is open or player is dead; disable everything if (!(isNull curatorCamera) or !(alive ACE_player)) exitWith { GVAR(effectUnconsciousCC) ppEffectEnable false; @@ -148,7 +147,7 @@ GVAR(effectTimeBlood) = CBA_missionTime; }; }; - _bleeding = [ACE_player] call FUNC(getBloodLoss); + private _bleeding = [ACE_player] call FUNC(getBloodLoss); // Bleeding Indicator if (_bleeding > 0 and GVAR(effectTimeBlood) + 3.5 < CBA_missionTime) then { GVAR(effectTimeBlood) = CBA_missionTime; @@ -156,7 +155,7 @@ GVAR(effectTimeBlood) = CBA_missionTime; }; // Blood Volume Effect - _blood = if (GVAR(level) < 2) then { + private _blood = if (GVAR(level) < 2) then { (ACE_player getVariable [QGVAR(bloodVolume), 100]) / 100; } else { (((ACE_player getVariable [QGVAR(bloodVolume), 100]) - 60) max 0) / 40; @@ -177,14 +176,13 @@ GVAR(lastHeartBeatSound) = CBA_missionTime; // HEARTRATE BASED EFFECTS [{ - private ["_heartRate", "_interval", "_minTime", "_sound", "_strength", "_pain"]; - _heartRate = ACE_player getVariable [QGVAR(heartRate), 70]; - _pain = ACE_player getVariable [QGVAR(pain), 0]; + private _heartRate = ACE_player getVariable [QGVAR(heartRate), 70]; + private _pain = ACE_player getVariable [QGVAR(pain), 0]; if (GVAR(level) == 1) then { _heartRate = 60 + 40 * _pain; }; if (_heartRate <= 0) exitWith {}; - _interval = 60 / (_heartRate min 40); + private _interval = 60 / (_heartRate min 40); if ((ACE_player getVariable ["ACE_isUnconscious", false])) then { if (GVAR(painEffectType) == 1) then { @@ -198,7 +196,7 @@ GVAR(lastHeartBeatSound) = CBA_missionTime; // Pain effect, no pain effect in zeus camera if (isNull curatorCamera) then { - _strength = ((_pain - (ACE_player getVariable [QGVAR(painSuppress), 0])) max 0) min 1; + private _strength = ((_pain - (ACE_player getVariable [QGVAR(painSuppress), 0])) max 0) min 1; _strength = _strength * (ACE_player getVariable [QGVAR(painCoefficient), GVAR(painCoefficient)]); if (GVAR(painEffectType) == 1) then { GVAR(effectPainCC) ppEffectEnable false; @@ -250,12 +248,12 @@ GVAR(lastHeartBeatSound) = CBA_missionTime; }; if (GVAR(level) >= 2 && {_heartRate > 0}) then { - _minTime = 60 / _heartRate; + private _minTime = 60 / _heartRate; if (CBA_missionTime - GVAR(lastHeartBeatSound) > _minTime) then { GVAR(lastHeartBeatSound) = CBA_missionTime; // Heart rate sound effect if (_heartRate < 60) then { - _sound = GVAR(heartBeatSounds_Normal) select (random((count GVAR(heartBeatSounds_Normal)) -1)); + private _sound = GVAR(heartBeatSounds_Normal) select (random((count GVAR(heartBeatSounds_Normal)) -1)); playSound _sound; } else { if (_heartRate > 150) then { diff --git a/addons/medical/XEH_preInit.sqf b/addons/medical/XEH_preInit.sqf index ff161ef2ab..6d09e9427c 100644 --- a/addons/medical/XEH_preInit.sqf +++ b/addons/medical/XEH_preInit.sqf @@ -2,7 +2,9 @@ ADDON = false; +PREP_RECOMPILE_START; #include "XEH_PREP.hpp" +PREP_RECOMPILE_END; GVAR(injuredUnitCollection) = []; @@ -48,6 +50,9 @@ addMissionEventHandler ["Loaded",{ TRACE_1("preload done",_this); }, [_x]] call CBA_fnc_waitUntilAndExecute; } forEach GVAR(fixedStatics); + + // Reload configs into extension (handle full game restart) + call FUNC(parseConfigForInjuries); }]; diff --git a/addons/medical/data/ace_medcrate.p3d b/addons/medical/data/ace_medcrate.p3d index 4398599b99..6158b3c972 100644 Binary files a/addons/medical/data/ace_medcrate.p3d and b/addons/medical/data/ace_medcrate.p3d differ diff --git a/addons/medical/data/ace_medcrate.rvmat b/addons/medical/data/ace_medcrate.rvmat new file mode 100644 index 0000000000..17488ebfdf --- /dev/null +++ b/addons/medical/data/ace_medcrate.rvmat @@ -0,0 +1,79 @@ +surfaceInfo = "a3\data_f\penetration\metal.bisurf"; +ambient[]={1,1,1,1}; +diffuse[]={1,1,1,1}; +forcedDiffuse[]={0,0,0,0}; +emmisive[]={0,0,0,1}; +specular[]={1,1,1,0}; +specularPower=50; +PixelShaderID="Super"; +VertexShaderID="Super"; +class Stage1 { + texture="z\ace\addons\medical\data\ace_medcrate_nohq.paa"; + uvSource="tex"; + class uvTransform { + aside[]={1,0,0}; + up[]={0,1,0}; + dir[]={0,0,0}; + pos[]={0,0,0}; + }; +}; +class Stage2 { + texture="#(argb,8,8,3)color(0.5,0.5,0.5,1,DT)"; + uvSource="tex"; + class uvTransform { + aside[]={1,0,0}; + up[]={0,1,0}; + dir[]={0,0,0}; + pos[]={0,0,0}; + }; +}; +class Stage3 { + texture="#(argb,8,8,3)color(0,0,0,0,MC)"; + uvSource="tex"; + class uvTransform { + aside[]={1,0,0}; + up[]={0,1,0}; + dir[]={0,0,0}; + pos[]={0,0,0}; + }; +}; +class Stage4 { + texture="z\ace\addons\medical\data\ace_medcrate_as.paa"; + uvSource="tex"; + class uvTransform { + aside[]={1,0,0}; + up[]={0,1,0}; + dir[]={0,0,0}; + pos[]={0,0,0}; + }; +}; +class Stage5 { + texture="z\ace\addons\medical\data\ace_medcrate_smdi.paa"; + uvSource="tex"; + class uvTransform { + aside[]={1,0,0}; + up[]={0,1,0}; + dir[]={0,0,0}; + pos[]={0,0,0}; + }; +}; +class Stage6 { + texture="#(ai,64,64,1)fresnel(2,0.1)"; + uvSource="tex"; + class uvTransform { + aside[]={1,0,0}; + up[]={0,1,0}; + dir[]={0,0,0}; + pos[]={0,0,0}; + }; +}; +class Stage7 { + texture="a3\data_f\env_land_co.paa"; + uvSource="tex"; + class uvTransform { + aside[]={1,0,0}; + up[]={0,1,0}; + dir[]={0,0,0}; + pos[]={0,0,0}; + }; +}; diff --git a/addons/medical/data/ace_medcrate_as.paa b/addons/medical/data/ace_medcrate_as.paa new file mode 100644 index 0000000000..de1952e756 Binary files /dev/null and b/addons/medical/data/ace_medcrate_as.paa differ diff --git a/addons/medical/data/ace_medcrate_co.paa b/addons/medical/data/ace_medcrate_co.paa index a817bf0ae4..725902d0ef 100644 Binary files a/addons/medical/data/ace_medcrate_co.paa and b/addons/medical/data/ace_medcrate_co.paa differ diff --git a/addons/medical/data/ace_medcrate_nohq.paa b/addons/medical/data/ace_medcrate_nohq.paa new file mode 100644 index 0000000000..ea67585d62 Binary files /dev/null and b/addons/medical/data/ace_medcrate_nohq.paa differ diff --git a/addons/medical/data/ace_medcrate_r.p3d b/addons/medical/data/ace_medcrate_r.p3d deleted file mode 100644 index f711996bec..0000000000 Binary files a/addons/medical/data/ace_medcrate_r.p3d and /dev/null differ diff --git a/addons/medical/data/ace_medcrate_smdi.paa b/addons/medical/data/ace_medcrate_smdi.paa new file mode 100644 index 0000000000..7335753fbd Binary files /dev/null and b/addons/medical/data/ace_medcrate_smdi.paa differ diff --git a/addons/medical/data/model.cfg b/addons/medical/data/model.cfg index 114fae7ada..e6b373cb38 100644 --- a/addons/medical/data/model.cfg +++ b/addons/medical/data/model.cfg @@ -4,6 +4,14 @@ class CfgSkeletons { skeletonInherit = ""; skeletonBones[] = {}; }; + + class ACE_Medcrate_Skeleton { + isDiscrete = 1; + skeletonInherit = "Default"; + skeletonBones[] = { + "cover","" + }; + }; }; class CfgModels { @@ -12,13 +20,33 @@ class CfgModels { sections[] = {""}; skeletonName = ""; }; + class IVBagBase: Default { sectionsInherit = ""; sections[] = {"camo"}; skeletonName = ""; }; - class IVBag_250ml: IVBagBase {}; class IVBag_500ml: IVBagBase {}; class IVBag_1000ml: IVBagBase {}; -}; \ No newline at end of file + + class ace_medcrate: Default { + skeletonName = "ACE_Medcrate_Skeleton"; + sectionsInherit = "Default"; + + class Animations { + class Cover { + type = "rotationX"; + source = "user"; + selection = "cover"; + axis = "cover_axis"; + memory = 1; + sourceAddress = "clamp"; + minValue = 0; + maxValue = 1; + angle0 = "0"; + angle1 = "rad + 240"; + }; + }; + }; +}; diff --git a/addons/medical/functions/fnc_actionCheckBloodPressure.sqf b/addons/medical/functions/fnc_actionCheckBloodPressure.sqf index 9e66eda263..207e2bb90d 100644 --- a/addons/medical/functions/fnc_actionCheckBloodPressure.sqf +++ b/addons/medical/functions/fnc_actionCheckBloodPressure.sqf @@ -1,16 +1,19 @@ /* -* Author: Glowbal -* Action for checking the blood pressure of the patient -* -* Arguments: -* 0: The medic -* 1: The patient -* -* Return Value: -* None -* -* Public: No -*/ + * Author: Glowbal + * Action for checking the blood pressure of the patient + * + * Arguments: + * 0: The medic + * 1: The patient + * + * Return Value: + * None + * + * Example: + * [bob, kevin] call ACE_medical_fnc_actionCheckBloodPressure + * + * Public: No + */ #include "script_component.hpp" diff --git a/addons/medical/functions/fnc_actionCheckBloodPressureLocal.sqf b/addons/medical/functions/fnc_actionCheckBloodPressureLocal.sqf index 184110265a..0497b559b8 100644 --- a/addons/medical/functions/fnc_actionCheckBloodPressureLocal.sqf +++ b/addons/medical/functions/fnc_actionCheckBloodPressureLocal.sqf @@ -9,6 +9,9 @@ * Return Value: * None * + * Example: + * [bob, kevin] call ACE_medical_fnc_actionCheckBloodPressureLocal + * * Public: No */ diff --git a/addons/medical/functions/fnc_actionCheckPulse.sqf b/addons/medical/functions/fnc_actionCheckPulse.sqf index 39f196a0a5..7654f24d78 100644 --- a/addons/medical/functions/fnc_actionCheckPulse.sqf +++ b/addons/medical/functions/fnc_actionCheckPulse.sqf @@ -1,16 +1,19 @@ /* -* Author: Glowbal -* Action for checking the pulse or heart rate of the patient -* -* Arguments: -* 0: The medic -* 1: The patient -* -* Return Value: -* None -* -* Public: No -*/ + * Author: Glowbal + * Action for checking the pulse or heart rate of the patient + * + * Arguments: + * 0: The medic + * 1: The patient + * + * Return Value: + * None + * + * Example: + * [bob, kevin] call ACE_medical_fnc_actionCheckPulse + * + * Public: No + */ #include "script_component.hpp" diff --git a/addons/medical/functions/fnc_actionCheckPulseLocal.sqf b/addons/medical/functions/fnc_actionCheckPulseLocal.sqf index cf84df075e..7f4fe176da 100644 --- a/addons/medical/functions/fnc_actionCheckPulseLocal.sqf +++ b/addons/medical/functions/fnc_actionCheckPulseLocal.sqf @@ -9,6 +9,9 @@ * Return Value: * None * + * Example: + * [bob, kevin] call ACE_medical_fnc_actionCheckPulseLocal + * * Public: No */ diff --git a/addons/medical/functions/fnc_actionCheckResponse.sqf b/addons/medical/functions/fnc_actionCheckResponse.sqf index c47dc5dd64..a56c8191c6 100644 --- a/addons/medical/functions/fnc_actionCheckResponse.sqf +++ b/addons/medical/functions/fnc_actionCheckResponse.sqf @@ -9,6 +9,9 @@ * Return Value: * None * + * Example: + * [bob, kevin] call ACE_medical_fnc_actionCheckResponse + * * Public: No */ diff --git a/addons/medical/functions/fnc_actionDiagnose.sqf b/addons/medical/functions/fnc_actionDiagnose.sqf index d86d90db7d..81e73699a8 100644 --- a/addons/medical/functions/fnc_actionDiagnose.sqf +++ b/addons/medical/functions/fnc_actionDiagnose.sqf @@ -1,16 +1,19 @@ /* -* Author: Glowbal -* Action for diagnosing in basic medical -* -* Arguments: -* 0: The medic -* 1: The patient -* -* Return Value: -* None -* -* Public: No -*/ + * Author: Glowbal + * Action for diagnosing in basic medical + * + * Arguments: + * 0: The medic + * 1: The patient + * + * Return Value: + * None + * + * Example: + * [bob, kevin] call ACE_medical_fnc_actionDiagnose + * + * Public: No + */ #include "script_component.hpp" diff --git a/addons/medical/functions/fnc_actionLoadUnit.sqf b/addons/medical/functions/fnc_actionLoadUnit.sqf index 55a7a9ba51..264fb72a4b 100644 --- a/addons/medical/functions/fnc_actionLoadUnit.sqf +++ b/addons/medical/functions/fnc_actionLoadUnit.sqf @@ -1,20 +1,24 @@ /* * Author: Glowbal - * Action for loading an unconscious or dead unit in the nearest vechile + * Action for loading an unconscious or dead unit in the nearest vehicle, or _vehicle if given. * * Arguments: * 0: The medic * 1: The patient + * 2: The vehicle (default: objNull) * * Return Value: * None * + * Example: + * [bob, kevin] call ACE_medical_fnc_actionLoadUnit + * * Public: No */ #include "script_component.hpp" -params ["_caller", "_target"]; +params ["_caller", "_target", ["_vehicle", objNull]]; if ([_target] call EFUNC(common,isAwake)) exitWith { [QEGVAR(common,displayTextStructured), [[LSTRING(CanNotLoaded), [_target] call EFUNC(common,getName)], 1.5, _caller], [_caller]] call CBA_fnc_targetEvent; @@ -26,4 +30,4 @@ if ([_target] call FUNC(isBeingDragged)) then { [_caller, _target] call EFUNC(dragging,dropObject); }; -private _vehicle = [_caller, _target] call EFUNC(common,loadPerson); +[_caller, _target, _vehicle] call EFUNC(common,loadPerson); diff --git a/addons/medical/functions/fnc_actionRemoveTourniquet.sqf b/addons/medical/functions/fnc_actionRemoveTourniquet.sqf index bf0a3e5ae4..e32fd09f69 100644 --- a/addons/medical/functions/fnc_actionRemoveTourniquet.sqf +++ b/addons/medical/functions/fnc_actionRemoveTourniquet.sqf @@ -10,6 +10,9 @@ * Return Value: * None * + * Example: + * [bob, kevin, "selection"] call ace_medical_fnc_actionRemoveTourniquet + * * Public: Yes */ diff --git a/addons/medical/functions/fnc_actionUnloadUnit.sqf b/addons/medical/functions/fnc_actionUnloadUnit.sqf index 75fe76bce9..061355fdc8 100644 --- a/addons/medical/functions/fnc_actionUnloadUnit.sqf +++ b/addons/medical/functions/fnc_actionUnloadUnit.sqf @@ -10,6 +10,9 @@ * Return Value: * None * + * Example: + * [bob, kevin, false] call ACE_medical_fnc_actionUnloadUnit + * * Public: No */ diff --git a/addons/medical/functions/fnc_addHeartRateAdjustment.sqf b/addons/medical/functions/fnc_addHeartRateAdjustment.sqf index a23ea45023..de3d2c4204 100644 --- a/addons/medical/functions/fnc_addHeartRateAdjustment.sqf +++ b/addons/medical/functions/fnc_addHeartRateAdjustment.sqf @@ -11,6 +11,9 @@ * Return Value: * None * + * Example: + * [bob, 1, 5, {callback}] call ace_medical_fnc_addHeartRateAdjustment + * * Public: Yes */ diff --git a/addons/medical/functions/fnc_addLoadPatientActions.sqf b/addons/medical/functions/fnc_addLoadPatientActions.sqf new file mode 100644 index 0000000000..b00ff72472 --- /dev/null +++ b/addons/medical/functions/fnc_addLoadPatientActions.sqf @@ -0,0 +1,25 @@ +/* + * Author: 654wak654 + * Adds child actions to the "load patient" action for near vehicles. + * + * Arguments: + * 0: Patient + * + * Return Value: + * Child actions + * + * Example: + * [kevin] call ace_medical_fnc_addLoadPatientActions + * + * Public: No + */ +#include "script_component.hpp" + +params ["_target"]; + +private _statement = { + params ["_target", "_player", "_vehicle"]; + [_player, _target, _vehicle] call FUNC(actionLoadUnit); +}; + +[_target call EFUNC(common,nearestVehiclesFreeSeat), _statement, _target] call EFUNC(interact_menu,createVehiclesActions) diff --git a/addons/medical/functions/fnc_addToInjuredCollection.sqf b/addons/medical/functions/fnc_addToInjuredCollection.sqf deleted file mode 100644 index 77d2378d0d..0000000000 --- a/addons/medical/functions/fnc_addToInjuredCollection.sqf +++ /dev/null @@ -1,17 +0,0 @@ -/* - * Author: Glowbal - * Enabled the vitals loop for a unit. - * - * Arguments: - * 0: The Unit - * - * ReturnValue: - * None - * - * Deprecated - */ -#include "script_component.hpp" - -ACE_DEPRECATED("ace_medical_fnc_addToInjuredCollection","3.7.0","ace_medical_fnc_addVitalLoop"); - -_this call FUNC(addVitalLoop); diff --git a/addons/medical/functions/fnc_addToLog.sqf b/addons/medical/functions/fnc_addToLog.sqf index f0c6b9c622..2a5e77fd1b 100644 --- a/addons/medical/functions/fnc_addToLog.sqf +++ b/addons/medical/functions/fnc_addToLog.sqf @@ -11,6 +11,9 @@ * Return Value: * None * + * Example: + * [bob, "type", "message", [_args]] call ace_medical_fnc_addToLog + * * Public: Yes */ diff --git a/addons/medical/functions/fnc_addToTriageCard.sqf b/addons/medical/functions/fnc_addToTriageCard.sqf index 0e11f38f77..720a435d68 100644 --- a/addons/medical/functions/fnc_addToTriageCard.sqf +++ b/addons/medical/functions/fnc_addToTriageCard.sqf @@ -9,6 +9,9 @@ * Return Value: * None * + * Example: + * [bob, "bandage"] call ace_medical_fnc_addToTriageCard + * * Public: Yes */ diff --git a/addons/medical/functions/fnc_addUnconsciousCondition.sqf b/addons/medical/functions/fnc_addUnconsciousCondition.sqf index 195cd557d7..b3b7f7747b 100644 --- a/addons/medical/functions/fnc_addUnconsciousCondition.sqf +++ b/addons/medical/functions/fnc_addUnconsciousCondition.sqf @@ -5,9 +5,12 @@ * Arguments: * 0-N: Code, should return a boolean * - * ReturnValue: + * Return Value: * None * + * Example: + * [[{bob}]] call ace_medical_fnc_addUnconsciousCondition + * * Public: Yes */ #include "script_component.hpp" diff --git a/addons/medical/functions/fnc_addUnloadPatientActions.sqf b/addons/medical/functions/fnc_addUnloadPatientActions.sqf index 596a536de6..20399c67c1 100644 --- a/addons/medical/functions/fnc_addUnloadPatientActions.sqf +++ b/addons/medical/functions/fnc_addUnloadPatientActions.sqf @@ -10,6 +10,9 @@ * Return Value: * Children actions * + * Example: + * [car, kevin, [params]] call ACE_medical_fnc_addUnloadPatientActions + * * Public: No */ #include "script_component.hpp" diff --git a/addons/medical/functions/fnc_addVitalLoop.sqf b/addons/medical/functions/fnc_addVitalLoop.sqf index aa3d6608d0..4045c188f5 100644 --- a/addons/medical/functions/fnc_addVitalLoop.sqf +++ b/addons/medical/functions/fnc_addVitalLoop.sqf @@ -5,9 +5,12 @@ * Arguments: * 0: The Unit * - * ReturnValue: + * Return Value: * None * + * Example: + * [bob] call ace_medical_fnc_addVitalLoop + * * Public: Yes */ diff --git a/addons/medical/functions/fnc_adjustPainLevel.sqf b/addons/medical/functions/fnc_adjustPainLevel.sqf index e37972d0ef..b935041faf 100644 --- a/addons/medical/functions/fnc_adjustPainLevel.sqf +++ b/addons/medical/functions/fnc_adjustPainLevel.sqf @@ -16,8 +16,6 @@ */ #include "script_component.hpp" -private ["_pain"]; - params ["_unit", "_addedPain"]; //Only run on local units: if (!local _unit) exitWith {ERROR("unit is not local");}; diff --git a/addons/medical/functions/fnc_bodyCleanupLoop.sqf b/addons/medical/functions/fnc_bodyCleanupLoop.sqf index af17ffcd34..9f59f32a25 100644 --- a/addons/medical/functions/fnc_bodyCleanupLoop.sqf +++ b/addons/medical/functions/fnc_bodyCleanupLoop.sqf @@ -5,9 +5,12 @@ * Arguments: * None * - * ReturnValue: + * Return Value: * None * + * Example: + * call ACE_medical_fnc_bodyCleanupLoop + * * Public: No */ diff --git a/addons/medical/functions/fnc_canAccessMedicalEquipment.sqf b/addons/medical/functions/fnc_canAccessMedicalEquipment.sqf index 53707ae65c..d31c03db1d 100644 --- a/addons/medical/functions/fnc_canAccessMedicalEquipment.sqf +++ b/addons/medical/functions/fnc_canAccessMedicalEquipment.sqf @@ -6,9 +6,12 @@ * 0: The caller * 1: The target * - * ReturnValue: + * Return Value: * Can Treat * + * Example: + * [bob, target] call ace_medical_fnc_canAccessMedicalEquipment + * * Public: Yes */ diff --git a/addons/medical/functions/fnc_canTreat.sqf b/addons/medical/functions/fnc_canTreat.sqf index 1c78eb1e43..765df301c7 100644 --- a/addons/medical/functions/fnc_canTreat.sqf +++ b/addons/medical/functions/fnc_canTreat.sqf @@ -8,7 +8,7 @@ * 2: Selection name * 3: ACE_Medical_Treatments Classname * - * ReturnValue: + * Return Value: * Can Treat * * Example: diff --git a/addons/medical/functions/fnc_canTreatCached.sqf b/addons/medical/functions/fnc_canTreatCached.sqf index 76d4897b74..dd7711936f 100644 --- a/addons/medical/functions/fnc_canTreatCached.sqf +++ b/addons/medical/functions/fnc_canTreatCached.sqf @@ -8,9 +8,12 @@ * 2: Selection name * 3: ACE_Medical_Treatments Classname * - * ReturnValue: + * Return Value: * Can Treat * + * Example: + * [bob, kevin, "selection", "classname"] call ACE_medical_fnc_canTreatCached + * * Public: No */ diff --git a/addons/medical/functions/fnc_copyDeadBody.sqf b/addons/medical/functions/fnc_copyDeadBody.sqf index af601d9f33..7bed7f39ec 100644 --- a/addons/medical/functions/fnc_copyDeadBody.sqf +++ b/addons/medical/functions/fnc_copyDeadBody.sqf @@ -9,23 +9,25 @@ * Return Value: * Returns the copy of the unit. If no copy could be made, returns the oldBody * + * Example: + * [bob, kevin] call ACE_medical_fnc_copyDeadBody + * * Public: No */ #include "script_component.hpp" -private ["_newUnit", "_class", "_group", "_position", "_side", "_name"]; params ["_oldBody", "_caller"]; if (alive _oldBody) exitWith {_oldBody}; // we only want to do this for dead bodies -_name = _oldBody getVariable ["ACE_name", "unknown"]; -_class = typeOf _oldBody; -_side = side _caller; -_group = createGroup _side; -_position = getPos _oldBody; +private _name = _oldBody getVariable ["ACE_name", "unknown"]; +private _class = typeOf _oldBody; +private _side = side _caller; +private _group = createGroup _side; +private _position = getPos _oldBody; -_newUnit = _group createUnit [typeOf _oldBody, _position, [], 0, "NONE"]; +private _newUnit = _group createUnit [typeOf _oldBody, _position, [], 0, "NONE"]; _newUnit setVariable ["ACE_name", _name, true]; _newUnit disableAI "TARGET"; diff --git a/addons/medical/functions/fnc_createLitter.sqf b/addons/medical/functions/fnc_createLitter.sqf index 2780642056..85e852d927 100644 --- a/addons/medical/functions/fnc_createLitter.sqf +++ b/addons/medical/functions/fnc_createLitter.sqf @@ -7,13 +7,16 @@ * 1: The target * 2: The treatment Selection Name * 3: The treatment classname - * 4: ? - * 5: Users of Items + * 4: ? + * 5: Users of Items * 6: Blood Loss on selection (previously called _previousDamage) * * Return Value: * None * + * Example: + * [bob, kevin, "selection", "classname", , , 5] call ACE_medical_fnc_createLitter + * * Public: No */ diff --git a/addons/medical/functions/fnc_determineIfFatal.sqf b/addons/medical/functions/fnc_determineIfFatal.sqf index 9dbbcce9a6..9d1940a80a 100644 --- a/addons/medical/functions/fnc_determineIfFatal.sqf +++ b/addons/medical/functions/fnc_determineIfFatal.sqf @@ -10,6 +10,9 @@ * Return Value: * None * + * Example: + * [bob, 2, 5] call ACE_medical_fnc_determineIfFatal + * * Public: No */ #include "script_component.hpp" @@ -30,7 +33,7 @@ if (_part < 0 || _part > 5) exitWith {false}; // Find the correct Damage threshold for unit. private _damageThreshold = [1,1,1]; -if ([_unit] call EFUNC(common,IsPlayer)) then { +if ([_unit, GVAR(remoteControlledAI)] call EFUNC(common,isPlayer)) then { _damageThreshold =_unit getVariable[QGVAR(unitDamageThreshold), [GVAR(playerDamageThreshold), GVAR(playerDamageThreshold), GVAR(playerDamageThreshold) * 1.7]]; } else { _damageThreshold =_unit getVariable[QGVAR(unitDamageThreshold), [GVAR(AIDamageThreshold), GVAR(AIDamageThreshold), GVAR(AIDamageThreshold) * 1.7]]; diff --git a/addons/medical/functions/fnc_displayPatientInformation.sqf b/addons/medical/functions/fnc_displayPatientInformation.sqf index 1489e27288..fdc87da8b5 100644 --- a/addons/medical/functions/fnc_displayPatientInformation.sqf +++ b/addons/medical/functions/fnc_displayPatientInformation.sqf @@ -7,9 +7,12 @@ * 1: Show (default: true) * 2: Selection (default: 0) * - * ReturnValue: + * Return Value: * None * + * Example: + * [bob, true, 2] call ACE_medical_fnc_displayPatientInformation + * * Public: No */ @@ -28,7 +31,6 @@ if (_show) then { ("ACE_MedicalRscDisplayInformation" call BIS_fnc_rscLayer) cutRsc [QGVAR(DisplayInformation),"PLAIN"]; [{ - private ["_target", "_display", "_alphaLevel", "_damaged", "_availableSelections", "_openWounds", "_selectionBloodLoss", "_red", "_green", "_blue", "_alphaLevel", "_allInjuryTexts", "_lbCtrl", "_genericMessages"]; params ["_args", "_idPFH"]; _args params ["_target", "_selectionN"]; @@ -68,7 +70,7 @@ if (_show) then { }; private _totalIvVolume = 0; - private _bloodBags = _unit getVariable [QGVAR(ivBags), []]; + private _bloodBags = _target getVariable [QGVAR(ivBags), []]; { _x params ["_bagVolumeRemaining"]; _totalIvVolume = _totalIvVolume + _bagVolumeRemaining; diff --git a/addons/medical/functions/fnc_displayTriageCard.sqf b/addons/medical/functions/fnc_displayTriageCard.sqf index 1633853214..c273b1d0f0 100644 --- a/addons/medical/functions/fnc_displayTriageCard.sqf +++ b/addons/medical/functions/fnc_displayTriageCard.sqf @@ -9,6 +9,9 @@ * Return Value: * None * + * Example: + * [bob, true] call ace_medical_fnc_displayTriageCard + * * Public: Yes */ diff --git a/addons/medical/functions/fnc_dropDownTriageCard.sqf b/addons/medical/functions/fnc_dropDownTriageCard.sqf index c499283446..3e52d3efc5 100644 --- a/addons/medical/functions/fnc_dropDownTriageCard.sqf +++ b/addons/medical/functions/fnc_dropDownTriageCard.sqf @@ -8,6 +8,9 @@ * Return Value: * None * + * Example: + * [true] call ace_medical_fnc_dropDownTriageCard + * * Public: Yes */ diff --git a/addons/medical/functions/fnc_getBloodLoss.sqf b/addons/medical/functions/fnc_getBloodLoss.sqf index 8f2f968e99..e584b4cd0d 100644 --- a/addons/medical/functions/fnc_getBloodLoss.sqf +++ b/addons/medical/functions/fnc_getBloodLoss.sqf @@ -5,9 +5,12 @@ * Arguments: * 0: The Unit * - * ReturnValue: + * Return Value: * Total blood loss of unit * + * Example: + * [bob] call ACE_medical_fnc_getBloodLoss + * * Public: No */ diff --git a/addons/medical/functions/fnc_getBloodPressure.sqf b/addons/medical/functions/fnc_getBloodPressure.sqf index 63908eecc7..076d42c286 100644 --- a/addons/medical/functions/fnc_getBloodPressure.sqf +++ b/addons/medical/functions/fnc_getBloodPressure.sqf @@ -5,10 +5,13 @@ * Arguments: * 0: The Unit * - * ReturnValue: + * Return Value: * 0: BloodPressure Low * 1: BloodPressure High * + * Example: + * [bob, kevin] call ACE_medical_fnc_getBloodPressure + * * Public: No */ diff --git a/addons/medical/functions/fnc_getBloodVolumeChange.sqf b/addons/medical/functions/fnc_getBloodVolumeChange.sqf index 396d058140..fcabcd53cf 100644 --- a/addons/medical/functions/fnc_getBloodVolumeChange.sqf +++ b/addons/medical/functions/fnc_getBloodVolumeChange.sqf @@ -6,9 +6,12 @@ * 0: The Unit * 1: Global Sync Values (bloodbags) * - * ReturnValue: + * Return Value: * Blood volume change (in % total) * + * Example: + * [bob, true] call ACE_medical_fnc_getBloodVolumeChange + * * Public: No */ diff --git a/addons/medical/functions/fnc_getCardiacOutput.sqf b/addons/medical/functions/fnc_getCardiacOutput.sqf index 74da98012b..ef6e75cde4 100644 --- a/addons/medical/functions/fnc_getCardiacOutput.sqf +++ b/addons/medical/functions/fnc_getCardiacOutput.sqf @@ -5,9 +5,12 @@ * Arguments: * 0: The Unit * - * ReturnValue: + * Return Value: * Current cardiac output * + * Example: + * [bob] call ACE_medical_fnc_getCardiacOutput + * * Public: No */ diff --git a/addons/medical/functions/fnc_getHeartRateChange.sqf b/addons/medical/functions/fnc_getHeartRateChange.sqf index 4f0b19f80c..ac659622b8 100644 --- a/addons/medical/functions/fnc_getHeartRateChange.sqf +++ b/addons/medical/functions/fnc_getHeartRateChange.sqf @@ -5,9 +5,12 @@ * Arguments: * 0: The Unit * - * ReturnValue: + * Return Value: * Change in heart Rate * + * Example: + * [bob] call ACE_medical_fnc_getHeartRateChange + * * Public: No */ diff --git a/addons/medical/functions/fnc_getTriageStatus.sqf b/addons/medical/functions/fnc_getTriageStatus.sqf index 79af660407..ac1ad4aa9a 100644 --- a/addons/medical/functions/fnc_getTriageStatus.sqf +++ b/addons/medical/functions/fnc_getTriageStatus.sqf @@ -10,15 +10,18 @@ * 1: Status ID * 2: Color > * + * Example: + * [bob] call ace_medical_fnc_getTriageStatus + * * Public: Yes */ #include "script_component.hpp" -private ["_unit","_return","_status"]; params ["_unit"]; -_status = _unit getVariable [QGVAR(triageLevel), -1]; -_return = switch (_status) do { + +private _status = _unit getVariable [QGVAR(triageLevel), -1]; +private _return = switch (_status) do { case 1: {[localize LSTRING(Triage_Status_Minor), 1, [0, 0.5, 0, 0.9]]}; case 2: {[localize LSTRING(Triage_Status_Delayed), 2, [0.7, 0.5, 0, 0.9]]}; case 3: {[localize LSTRING(Triage_Status_Immediate), 3, [0.4, 0.07, 0.07, 0.9]]}; diff --git a/addons/medical/functions/fnc_getTypeOfDamage.sqf b/addons/medical/functions/fnc_getTypeOfDamage.sqf index 56cb8f75ef..b026f41ded 100644 --- a/addons/medical/functions/fnc_getTypeOfDamage.sqf +++ b/addons/medical/functions/fnc_getTypeOfDamage.sqf @@ -5,9 +5,12 @@ * Arguments: * 0: The projectile classname or object * - * ReturnValue: + * Return Value: * Type of damage * + * Example: + * ["bullet"] call ACE_medical_fnc_getTypeOfDamage + * * Public: No */ diff --git a/addons/medical/functions/fnc_getUnconsciousCondition.sqf b/addons/medical/functions/fnc_getUnconsciousCondition.sqf index ad366b5ab2..f5cb4444bc 100644 --- a/addons/medical/functions/fnc_getUnconsciousCondition.sqf +++ b/addons/medical/functions/fnc_getUnconsciousCondition.sqf @@ -5,9 +5,12 @@ * Arguments: * 0: The Unit * - * ReturnValue: + * Return Value: * Should the unit stay unconscious? * + * Example: + * [bob] call ace_medical_fnc_getUnconsciousCondition + * * Public: Yes */ diff --git a/addons/medical/functions/fnc_handleBandageOpening.sqf b/addons/medical/functions/fnc_handleBandageOpening.sqf index ed589e3fd6..4884b43757 100644 --- a/addons/medical/functions/fnc_handleBandageOpening.sqf +++ b/addons/medical/functions/fnc_handleBandageOpening.sqf @@ -13,12 +13,14 @@ * Return Value: * None * + * Example: + * [bob, 5, 5, 1, [injury], "bandage"] call ACE_medical_fnc_handleBandageOpening + * * Public: No */ #include "script_component.hpp" -private ["_className", "_reopeningChance", "_reopeningMinDelay", "_reopeningMaxDelay", "_config", "_woundTreatmentConfig", "_bandagedWounds", "_exist", "_injuryId", "_existingInjury", "_delay", "_openWounds", "_selectedInjury", "_bandagedInjury"]; params ["_target", "_impact", "_part", "_injuryIndex", "_injury", "_bandage"]; private _classID = _injury select 1; @@ -63,7 +65,7 @@ private _bandagedInjury = []; { if ((_x select 1) == _injuryType && (_x select 2) == (_injury select 2)) exitwith { _exist = true; - _existingInjury = _x; + private _existingInjury = _x; _existingInjury set [3, (_existingInjury select 3) + _impact]; _bandagedWounds set [_foreachIndex, _existingInjury]; @@ -82,7 +84,7 @@ _target setVariable [QGVAR(bandagedWounds), _bandagedWounds, true]; TRACE_1("",_reopeningChance); // Check if we are ever going to reopen this if (random(1) <= _reopeningChance) then { - _delay = _reopeningMinDelay + random(_reopeningMaxDelay - _reopeningMinDelay); + private _delay = _reopeningMinDelay + random(_reopeningMaxDelay - _reopeningMinDelay); TRACE_1("Will open",_delay); [{ params ["_target", "_impact", "_part", "_injuryIndex", "_injury"]; @@ -100,7 +102,7 @@ if (random(1) <= _reopeningChance) then { { if ((_x select 1) == _injuryId && (_x select 2) == (_injury select 2)) exitwith { _exist = true; - _existingInjury = _x; + private _existingInjury = _x; _existingInjury set [3, ((_existingInjury select 3) - _impact) max 0]; _bandagedWounds set [_foreachIndex, _existingInjury]; }; diff --git a/addons/medical/functions/fnc_handleCollisionDamage.sqf b/addons/medical/functions/fnc_handleCollisionDamage.sqf index 191a91cb6a..e5b553bc15 100644 --- a/addons/medical/functions/fnc_handleCollisionDamage.sqf +++ b/addons/medical/functions/fnc_handleCollisionDamage.sqf @@ -1,13 +1,27 @@ -// by commy2 +/* + * Author: commy2 + * + * + * Arguments: + * 0: Unit + * 1: New Damage + * + * Return Value: + * None + * + * Example: + * [bob, 2] call ACE_medical_fnc_handleCollisionDamage + * + * Public: No + */ + #include "script_component.hpp" params ["_unit", "_newDamage"]; -private ["_selection", "_totalDamage"]; +private _selection = "body"; -_selection = "body"; - -_totalDamage = (_unit getHit _selection) + _newDamage; +private _totalDamage = (_unit getHit _selection) + _newDamage; _unit setHit [_selection, _totalDamage]; diff --git a/addons/medical/functions/fnc_handleCreateLitter.sqf b/addons/medical/functions/fnc_handleCreateLitter.sqf index 2c701a2917..45ea452782 100644 --- a/addons/medical/functions/fnc_handleCreateLitter.sqf +++ b/addons/medical/functions/fnc_handleCreateLitter.sqf @@ -10,6 +10,9 @@ * Return Value: * None * + * Example: + * ["litter", [2, 5, 6], bob] call ACE_medical_fnc_handleCreateLitter + * * Public: No */ #include "script_component.hpp" diff --git a/addons/medical/functions/fnc_handleDamage.sqf b/addons/medical/functions/fnc_handleDamage.sqf index de86665f99..242b9a7997 100644 --- a/addons/medical/functions/fnc_handleDamage.sqf +++ b/addons/medical/functions/fnc_handleDamage.sqf @@ -1,4 +1,4 @@ - /* +/* * Author: KoffeinFlummi, Glowbal, commy2 * Main HandleDamage EH function. * @@ -7,17 +7,21 @@ * 1: Name Of Hit Selection * 2: Amount Of Damage * 3: Shooter - * 4: Projectile + * 4: Projectile * 5: HitPointIndex (-1 for structural) * 6: Shooter * * Return Value: * Damage To Be Inflicted * + * Example: + * [bob, "leg", 2, kevin, "bullet", -1, kevin] call ACE_medical_fnc_handleDamage + * * Public: No */ #include "script_component.hpp" +_this = _this select [0, 7]; params ["_unit", "_selection", "_damage", "_shooter", "_projectile", "_hitPointIndex"]; TRACE_5("ACE_DEBUG: HandleDamage Called",_unit, _selection, _damage, _shooter, _projectile); diff --git a/addons/medical/functions/fnc_handleDamage_advanced.sqf b/addons/medical/functions/fnc_handleDamage_advanced.sqf index 724958dfbc..77d78b94dd 100644 --- a/addons/medical/functions/fnc_handleDamage_advanced.sqf +++ b/addons/medical/functions/fnc_handleDamage_advanced.sqf @@ -15,6 +15,9 @@ * Return Value: * None * + * Example: + * [bob, "leg", 2, kevin, "bullet", 2, kevin, 2] call ACE_medical_fnc_handleDamage_advanced + * * Public: No */ @@ -27,10 +30,10 @@ params ["_unit", "_selectionName", "_amountOfDamage", "_sourceOfDamage", "_typeO if ((_typeOfProjectile == "") && {_newDamage < 0.15} && { _newDamage = _newDamage + (_unit getVariable [QGVAR(trivialDamage), 0]); - if (_newDamage > 0.15) then { + if (_newDamage > 0.15) then { // if the new sum is large enough, reset variable and continue with it added in _unit setVariable [QGVAR(trivialDamage), 0]; - false + false } else { // otherwise just save the new sum into the variable and exit _unit setVariable [QGVAR(trivialDamage), _newDamage]; diff --git a/addons/medical/functions/fnc_handleDamage_advancedSetDamage.sqf b/addons/medical/functions/fnc_handleDamage_advancedSetDamage.sqf index b18604f133..561a929133 100644 --- a/addons/medical/functions/fnc_handleDamage_advancedSetDamage.sqf +++ b/addons/medical/functions/fnc_handleDamage_advancedSetDamage.sqf @@ -8,6 +8,9 @@ * Return Value: * None * + * Example: + * [bob] call ACE_medical_fnc_handleDamage_advancedSetDamage + * * Public: No */ diff --git a/addons/medical/functions/fnc_handleDamage_airway.sqf b/addons/medical/functions/fnc_handleDamage_airway.sqf index fb4c9fe83c..7ff2610de3 100644 --- a/addons/medical/functions/fnc_handleDamage_airway.sqf +++ b/addons/medical/functions/fnc_handleDamage_airway.sqf @@ -12,6 +12,9 @@ * Return Value: * None * + * Example: + * [bob, "leg", 2, kevin, "shot"] call ACE_medical_fnc_airway + * * Public: No */ diff --git a/addons/medical/functions/fnc_handleDamage_caching.sqf b/addons/medical/functions/fnc_handleDamage_caching.sqf index 792f09e75d..c9499361a4 100644 --- a/addons/medical/functions/fnc_handleDamage_caching.sqf +++ b/addons/medical/functions/fnc_handleDamage_caching.sqf @@ -11,7 +11,10 @@ * 5: HitPointIndex (-1 for structural) * * Return Value: - * + * None + * + * Example: + * [bob, "leg", 2, kevin, "bullet", -1] call ACE_medical_fnc_handleDamage_caching * * Public: No */ diff --git a/addons/medical/functions/fnc_handleDamage_fractures.sqf b/addons/medical/functions/fnc_handleDamage_fractures.sqf index 5292781420..546d6623ac 100644 --- a/addons/medical/functions/fnc_handleDamage_fractures.sqf +++ b/addons/medical/functions/fnc_handleDamage_fractures.sqf @@ -12,16 +12,18 @@ * Return Value: * None * + * Example: + * [bob, "leg", 2, kevin, "shot"] call ACE_medical_fnc_handleDamage_fractures + * * Public: No */ #include "script_component.hpp" -private ["_bodyPartn", "_fractures", "_fractureType"]; params ["_unit", "_selectionName", "_amountOfDamage", "_sourceOfDamage", "_typeOfDamage"]; -_bodyPartn = [_selectionName] call FUNC(selectionNameToNumber); +private _bodyPartn = [_selectionName] call FUNC(selectionNameToNumber); -_fractureType = 1; +private _fractureType = 1; if (_amountOfDamage > 0.05) then { // TODO specify fractures based off typeOfInjury details better. @@ -58,10 +60,9 @@ if (_amountOfDamage > 0.05) then { }; }; - private ["_fractures", "_fractureID", "_amountOf"]; - _fractures = _unit getVariable[QGVAR(fractures), []]; - _fractureID = 1; - _amountOf = count _fractures; + private _fractures = _unit getVariable[QGVAR(fractures), []]; + private _fractureID = 1; + private _amountOf = count _fractures; if (_amountOf > 0) then { _fractureID = (_fractures select (_amountOf - 1) select 0) + 1; }; diff --git a/addons/medical/functions/fnc_handleDamage_internalInjuries.sqf b/addons/medical/functions/fnc_handleDamage_internalInjuries.sqf index 8e249eee8f..97499c53c6 100644 --- a/addons/medical/functions/fnc_handleDamage_internalInjuries.sqf +++ b/addons/medical/functions/fnc_handleDamage_internalInjuries.sqf @@ -12,6 +12,9 @@ * Return Value: * None * + * Example: + * [bob, "leg", 2, kevin, "shot"] call ACE_medical_fnc_handleDamage_internalInjuries + * * Public: No */ diff --git a/addons/medical/functions/fnc_handleDamage_wounds.sqf b/addons/medical/functions/fnc_handleDamage_wounds.sqf index 804c933b0e..1ab223d14a 100644 --- a/addons/medical/functions/fnc_handleDamage_wounds.sqf +++ b/addons/medical/functions/fnc_handleDamage_wounds.sqf @@ -12,6 +12,9 @@ * Return Value: * None * + * Example: + * [bob, "leg", 2, kevin, "shot"] call ACE_medical_fnc_handleDamage_wounds + * * Public: No */ diff --git a/addons/medical/functions/fnc_handleDamage_woundsOld.sqf b/addons/medical/functions/fnc_handleDamage_woundsOld.sqf index c6ccd1c2b5..376d50ff8c 100644 --- a/addons/medical/functions/fnc_handleDamage_woundsOld.sqf +++ b/addons/medical/functions/fnc_handleDamage_woundsOld.sqf @@ -12,24 +12,26 @@ * Return Value: * None * + * Example: + * [bob, "leg", 1, kevin, "shot"] call ACE_medical_fnc_handleDamage_woundsOld + * * Public: No */ #include "script_component.hpp" -private ["_bodyPartn", "_injuryTypeInfo", "_allInjuriesForDamageType", "_allPossibleInjuries", "_highestPossibleDamage", "_highestPossibleSpot", "_minDamage", "_openWounds", "_woundID", "_toAddInjury", "_painToAdd", "_bloodLoss", "_bodyPartNToAdd", "_classType", "_damageLevels", "_foundIndex", "_i", "_injury", "_maxDamage", "_pain", "_painLevel", "_selections", "_toAddClassID", "_woundsCreated"]; params ["_unit", "_selectionName", "_damage", "_typeOfProjectile", "_typeOfDamage"]; TRACE_6("ACE_DEBUG: HandleDamage_WoundsOLD Called",_unit, _selectionName, _damage, _shooter, _typeOfProjectile,_typeOfDamage); // Convert the selectionName to a number and ensure it is a valid selection. -_bodyPartn = [_selectionName] call FUNC(selectionNameToNumber); +private _bodyPartn = [_selectionName] call FUNC(selectionNameToNumber); if (_bodyPartn < 0) exitWith {}; // Get the injury type information. Format: [typeDamage thresholds, selectionSpecific, woundTypes] -_injuryTypeInfo = missionNamespace getVariable [format[QGVAR(woundInjuryType_%1), _typeOfDamage],[[], false, []]]; +private _injuryTypeInfo = missionNamespace getVariable [format[QGVAR(woundInjuryType_%1), _typeOfDamage],[[], false, []]]; // This are the available injuries for this damage type. Format [[classtype, selections, bloodloss, minimalDamage, pain], ..] -_allInjuriesForDamageType = _injuryTypeInfo select 2; +private _allInjuriesForDamageType = _injuryTypeInfo select 2; // It appears we are dealing with an unknown type of damage. if (count _allInjuriesForDamageType == 0) then { @@ -39,20 +41,19 @@ if (count _allInjuriesForDamageType == 0) then { }; // find the available injuries for this damage type and damage amount -_highestPossibleSpot = -1; -_highestPossibleDamage = -1; -_allPossibleInjuries = []; +private _highestPossibleSpot = -1; +private _highestPossibleDamage = -1; +private _allPossibleInjuries = []; { - _damageLevels = _x select 4; - _minDamage = _damageLevels select 0; - _maxDamage = _damageLevels select 1; + private _damageLevels = _x select 4; + _damageLevels params ["_minDamage","_maxDamage"]; // Check if the damage is higher as the min damage for the specific injury if (_damage >= _minDamage && {_damage <= _maxDamage || _maxDamage < 0}) then { - //_classType = _x select 0; - _selections = _x select 1; - //_bloodLoss = _x select 2; - //_pain = _x select 3; + //private _classType = _x select 0; + private _selections = _x select 1; + //private _bloodLoss = _x select 2; + //private _pain = _x select 3; // Check if the injury can be applied to the given selection name if ("All" in _selections || _selectionName in _selections) then { @@ -73,21 +74,21 @@ _allPossibleInjuries = []; if (_highestPossibleSpot < 0) exitWith {}; // Administration for open wounds and ids -_openWounds = _unit getVariable[QGVAR(openWounds), []]; -_woundID = _unit getVariable[QGVAR(lastUniqueWoundID), 1]; +private _openWounds = _unit getVariable[QGVAR(openWounds), []]; +private _woundID = _unit getVariable[QGVAR(lastUniqueWoundID), 1]; -_painToAdd = 0; -_woundsCreated = []; +private _painToAdd = 0; +private _woundsCreated = []; { if (_x select 0 <= _damage) exitWith { for "_i" from 0 to ((_x select 1)-1) do { // Find the injury we are going to add. Format [ classID, allowdSelections, bloodloss, painOfInjury, minimalDamage] - _toAddInjury = if (random(1) >= 0.85) then {_allInjuriesForDamageType select _highestPossibleSpot} else {selectRandom _allPossibleInjuries}; - _toAddClassID = _toAddInjury select 0; - _foundIndex = -1; + private _toAddInjury = if (random(1) >= 0.85) then {_allInjuriesForDamageType select _highestPossibleSpot} else {selectRandom _allPossibleInjuries}; + private _toAddClassID = _toAddInjury select 0; + private _foundIndex = -1; - _bodyPartNToAdd = if (_injuryTypeInfo select 1) then {_bodyPartn} else {floor(random(6))}; + private _bodyPartNToAdd = if (_injuryTypeInfo select 1) then {_bodyPartn} else {floor(random(6))}; // If the injury type is selection part specific, we will check if one of those injury types already exists and find the spot for it.. if ((_injuryTypeInfo select 1)) then { { @@ -98,7 +99,7 @@ _woundsCreated = []; } forEach _openWounds; }; - _injury = []; + private _injury = []; if (_foundIndex < 0) then { // Create a new injury. Format [ID, classID, bodypart, percentage treated, bloodloss rate] _injury = [_woundID, _toAddInjury select 0, _bodyPartNToAdd, 1, _toAddInjury select 2]; @@ -129,6 +130,6 @@ if (count _woundsCreated > 0) then { _unit setVariable [QGVAR(lastUniqueWoundID), _woundID, true]; }; -_painLevel = _unit getVariable [QGVAR(pain), 0]; +private _painLevel = _unit getVariable [QGVAR(pain), 0]; _unit setVariable [QGVAR(pain), _painLevel + _painToAdd]; TRACE_6("ACE_DEBUG: HandleDamage_WoundsOLD",_unit, _painLevel, _painToAdd, _unit getVariable QGVAR(pain), _unit getVariable QGVAR(openWounds),_woundsCreated); diff --git a/addons/medical/functions/fnc_handleKilled.sqf b/addons/medical/functions/fnc_handleKilled.sqf index 6ca05a4228..52b79f8760 100644 --- a/addons/medical/functions/fnc_handleKilled.sqf +++ b/addons/medical/functions/fnc_handleKilled.sqf @@ -5,9 +5,12 @@ * Arguments: * 0: The Unit * - * ReturnValue: + * Return Value: * None * + * Example: + * [bob] call ACE_medical_fnc_handleKilled + * * Public: No */ diff --git a/addons/medical/functions/fnc_handleLocal.sqf b/addons/medical/functions/fnc_handleLocal.sqf index 8bf3cd5e69..b9282ef9ee 100644 --- a/addons/medical/functions/fnc_handleLocal.sqf +++ b/addons/medical/functions/fnc_handleLocal.sqf @@ -6,9 +6,12 @@ * 0: The Unit * 1: Is local * - * ReturnValue: + * Return Value: * None * + * Example: + * [bob, true] call ACE_medical_fnc_handleLocal + * * Public: No */ diff --git a/addons/medical/functions/fnc_handleUnitVitals.sqf b/addons/medical/functions/fnc_handleUnitVitals.sqf index 78c1cc9dfe..3bb40dd134 100644 --- a/addons/medical/functions/fnc_handleUnitVitals.sqf +++ b/addons/medical/functions/fnc_handleUnitVitals.sqf @@ -5,8 +5,11 @@ * Arguments: * 0: The Unit * - * ReturnValue: - * + * Return Value: + * None + * + * Example: + * [bob] call ACE_medical_fnc_handleUnitVitals * * Public: No */ diff --git a/addons/medical/functions/fnc_hasItem.sqf b/addons/medical/functions/fnc_hasItem.sqf index cebe02e6c6..c1b84a940a 100644 --- a/addons/medical/functions/fnc_hasItem.sqf +++ b/addons/medical/functions/fnc_hasItem.sqf @@ -7,8 +7,11 @@ * 1: Patient * 2: Item * - * ReturnValue: - * + * Return Value: + * None + * + * Example: + * [bob, patient, "bandage"] call ace_medical_fnc_hasItem * * Public: Yes */ diff --git a/addons/medical/functions/fnc_hasItems.sqf b/addons/medical/functions/fnc_hasItems.sqf index d3e79c0a54..e251f22174 100644 --- a/addons/medical/functions/fnc_hasItems.sqf +++ b/addons/medical/functions/fnc_hasItems.sqf @@ -7,9 +7,12 @@ * 1: Patient * 2: Items > * - * ReturnValue: + * Return Value: * Has the items * + * Example: + * [bob, patient, ["bandage", "morphine"]] call ace_medical_fnc_hasItems + * * Public: Yes */ diff --git a/addons/medical/functions/fnc_hasMedicalEnabled.sqf b/addons/medical/functions/fnc_hasMedicalEnabled.sqf index 5cc5b60aa3..d6150e13a1 100644 --- a/addons/medical/functions/fnc_hasMedicalEnabled.sqf +++ b/addons/medical/functions/fnc_hasMedicalEnabled.sqf @@ -1,4 +1,3 @@ - /* * Author: Glowbal * Check if unit has CMS enabled @@ -14,6 +13,7 @@ * * Public: No */ + #include "script_component.hpp" params ["_unit"]; diff --git a/addons/medical/functions/fnc_hasTourniquetAppliedTo.sqf b/addons/medical/functions/fnc_hasTourniquetAppliedTo.sqf index abbe512d74..ba4aecefa3 100644 --- a/addons/medical/functions/fnc_hasTourniquetAppliedTo.sqf +++ b/addons/medical/functions/fnc_hasTourniquetAppliedTo.sqf @@ -6,9 +6,12 @@ * 0: The Unit * 1: SelectionName * - * ReturnValue: + * Return Value: * Has tourniquet applied * + * Example: + * [bob, "leg"] call ace_medical_fnc_hasTourniquetAppliedTo + * * Public: Yes */ diff --git a/addons/medical/functions/fnc_init.sqf b/addons/medical/functions/fnc_init.sqf index d6db3db392..f5f484106e 100644 --- a/addons/medical/functions/fnc_init.sqf +++ b/addons/medical/functions/fnc_init.sqf @@ -5,8 +5,11 @@ * Arguments: * 0: The Unit * - * ReturnValue: - * nil + * Return Value: + * None + * + * Example: + * [bob] call ACE_medical_fnc_init * * Public: No */ @@ -66,16 +69,14 @@ _unit setVariable [QGVAR(hasPain), false, true]; _unit setVariable [QGVAR(amountOfReviveLives), GVAR(amountOfReviveLives), true]; _unit setVariable [QGVAR(painSuppress), 0, true]; -private ["_allUsedMedication", "_logs"]; - // medication -_allUsedMedication = _unit getVariable [QGVAR(allUsedMedication), []]; +private _allUsedMedication = _unit getVariable [QGVAR(allUsedMedication), []]; { _unit setVariable [_x select 0, nil]; } forEach _allUsedMedication; _unit setVariable [QGVAR(allUsedMedication), [], true]; -_logs = _unit getVariable [QGVAR(allLogs), []]; +private _logs = _unit getVariable [QGVAR(allLogs), []]; { _unit setVariable [_x, nil]; } forEach _logs; diff --git a/addons/medical/functions/fnc_isInMedicalFacility.sqf b/addons/medical/functions/fnc_isInMedicalFacility.sqf index 313ee8eca4..12e52ada19 100644 --- a/addons/medical/functions/fnc_isInMedicalFacility.sqf +++ b/addons/medical/functions/fnc_isInMedicalFacility.sqf @@ -5,7 +5,7 @@ * Arguments: * 0: The Unit * - * ReturnValue: + * Return Value: * Is in medical facility * * Example: diff --git a/addons/medical/functions/fnc_isInStableCondition.sqf b/addons/medical/functions/fnc_isInStableCondition.sqf index a11e40dd31..078079e46e 100644 --- a/addons/medical/functions/fnc_isInStableCondition.sqf +++ b/addons/medical/functions/fnc_isInStableCondition.sqf @@ -1,15 +1,18 @@ /* -* Author: Glowbal -* Check if a unit is in a stable condition -* -* Arguments: -* 0: The patient -* -* Return Value: -* Is in stable condition -* -* Public: No -*/ + * Author: Glowbal + * Check if a unit is in a stable condition + * + * Arguments: + * 0: The patient + * + * Return Value: + * Is in stable condition + * + * Example: + * [bob] call ACE_medical_fnc_isInStableCondition + * + * Public: No + */ #include "script_component.hpp" diff --git a/addons/medical/functions/fnc_isMedic.sqf b/addons/medical/functions/fnc_isMedic.sqf index ff5a1b24a9..f09fe88dbb 100644 --- a/addons/medical/functions/fnc_isMedic.sqf +++ b/addons/medical/functions/fnc_isMedic.sqf @@ -6,7 +6,7 @@ * 0: The Unit * 1: Class (default: 1) * - * ReturnValue: + * Return Value: * Is in of medic class * * Example: @@ -19,7 +19,7 @@ params ["_unit", ["_medicN", 1]]; -private _class = _unit getVariable [QGVAR(medicClass), getNumber (configFile >> "CfgVehicles" >> typeOf _unit >> "attendant")]; +private _class = _unit getVariable [QGVAR(medicClass), [0, 1] select (_unit getUnitTrait "medic")]; if (_class >= _medicN min GVAR(medicSetting)) exitWith {true}; if (!GVAR(increaseTrainingInLocations)) exitWith {false}; diff --git a/addons/medical/functions/fnc_isMedicalVehicle.sqf b/addons/medical/functions/fnc_isMedicalVehicle.sqf index 14499cb241..66ecf84a07 100644 --- a/addons/medical/functions/fnc_isMedicalVehicle.sqf +++ b/addons/medical/functions/fnc_isMedicalVehicle.sqf @@ -5,11 +5,15 @@ * Arguments: * 0: The Vehicle * - * ReturnValue: + * Return Value: * Is in of medic class * + * Example: + * [car] call ace_medical_fnc_isMedicalVehicle + * * Public: Yes */ + #include "script_component.hpp" params ["_vehicle"]; diff --git a/addons/medical/functions/fnc_itemCheck.sqf b/addons/medical/functions/fnc_itemCheck.sqf index d49e04e774..6ab1e490c3 100644 --- a/addons/medical/functions/fnc_itemCheck.sqf +++ b/addons/medical/functions/fnc_itemCheck.sqf @@ -5,9 +5,12 @@ * Arguments: * 0: The unit * - * ReturnValue: + * Return Value: * None * + * Example: + * [bob] call ace_medical_fnc_itemCheck + * * Public: Yes */ diff --git a/addons/medical/functions/fnc_litterCleanupLoop.sqf b/addons/medical/functions/fnc_litterCleanupLoop.sqf index 417144dd64..6f546b47ed 100644 --- a/addons/medical/functions/fnc_litterCleanupLoop.sqf +++ b/addons/medical/functions/fnc_litterCleanupLoop.sqf @@ -5,9 +5,12 @@ * Arguments: * None * - * ReturnValue: + * Return Value: * None * + * Example: + * call ACE_medical_fnc_litterCleanupLoop + * * Public: No */ diff --git a/addons/medical/functions/fnc_medicationEffectLoop.sqf b/addons/medical/functions/fnc_medicationEffectLoop.sqf index 00ef00a82c..c1690806fe 100644 --- a/addons/medical/functions/fnc_medicationEffectLoop.sqf +++ b/addons/medical/functions/fnc_medicationEffectLoop.sqf @@ -10,9 +10,12 @@ * 4: Viscosity adjustment rate * 5: Pain reduction rate * - * ReturnValue: + * Return Value: * None * + * Example: + * [bob, "leg", 1, 2, 3, 4] call ACE_medical_fnc_medicationEffectLoop + * * Public: No */ diff --git a/addons/medical/functions/fnc_modifyMedicalAction.sqf b/addons/medical/functions/fnc_modifyMedicalAction.sqf index 4d0db7af34..1da4ed20c0 100644 --- a/addons/medical/functions/fnc_modifyMedicalAction.sqf +++ b/addons/medical/functions/fnc_modifyMedicalAction.sqf @@ -9,9 +9,12 @@ * 2: Selection Number * 3: The action to modify * - * ReturnValue: + * Return Value: * None * + * Example: + * [bob, kevin, 2, "action"] call ACE_medical_fnc_modifyMedicalAction + * * Public: No */ diff --git a/addons/medical/functions/fnc_moduleAdvancedMedicalSettings.sqf b/addons/medical/functions/fnc_moduleAdvancedMedicalSettings.sqf index b54196d75f..b884e8b82d 100644 --- a/addons/medical/functions/fnc_moduleAdvancedMedicalSettings.sqf +++ b/addons/medical/functions/fnc_moduleAdvancedMedicalSettings.sqf @@ -10,6 +10,9 @@ * Return Value: * None * + * Example: + * [LOGIC, [bob, kevin], true] call ACE_medical_fnc_moduleAdvancedMedicalSettings + * * Public: No */ diff --git a/addons/medical/functions/fnc_moduleAssignMedicRoles.sqf b/addons/medical/functions/fnc_moduleAssignMedicRoles.sqf index 5bdaccff93..51a4be7461 100644 --- a/addons/medical/functions/fnc_moduleAssignMedicRoles.sqf +++ b/addons/medical/functions/fnc_moduleAssignMedicRoles.sqf @@ -10,6 +10,9 @@ * Return Value: * None * + * Example: + * [LOGIC, [bob, kevin], true] call ACE_medical_fnc_moduleAssignMedicRoles + * * Public: No */ #include "script_component.hpp" diff --git a/addons/medical/functions/fnc_moduleAssignMedicalFacility.sqf b/addons/medical/functions/fnc_moduleAssignMedicalFacility.sqf index 368b065908..61e140d0fd 100644 --- a/addons/medical/functions/fnc_moduleAssignMedicalFacility.sqf +++ b/addons/medical/functions/fnc_moduleAssignMedicalFacility.sqf @@ -10,16 +10,18 @@ * Return Value: * None * + * Example: + * [LOGIC, [kevin, bob], true] call ACE_medical_fnc_moduleAssignMedicalFacility + * * Public: No */ #include "script_component.hpp" -private ["_setting", "_objects"]; params [["_logic", objNull, [objNull]]]; if (!isNull _logic) then { - _setting = _logic getVariable ["class",0]; - _objects = synchronizedObjects _logic; + private _setting = _logic getVariable ["class",0]; + private _objects = synchronizedObjects _logic; { if (local _x) then { _x setVariable[QGVAR(isMedicalFacility), true, true]; diff --git a/addons/medical/functions/fnc_moduleAssignMedicalVehicle.sqf b/addons/medical/functions/fnc_moduleAssignMedicalVehicle.sqf index 60a46f8420..4d7576f2c2 100644 --- a/addons/medical/functions/fnc_moduleAssignMedicalVehicle.sqf +++ b/addons/medical/functions/fnc_moduleAssignMedicalVehicle.sqf @@ -10,6 +10,9 @@ * Return Value: * None * + * Example: + * [LOGIC, [bob, kevin], true] call ACE_medical_fnc_moduleAssignMedicalVehicle + * * Public: No */ #include "script_component.hpp" diff --git a/addons/medical/functions/fnc_moduleBasicMedicalSettings.sqf b/addons/medical/functions/fnc_moduleBasicMedicalSettings.sqf index 08076878f2..c73d49458b 100644 --- a/addons/medical/functions/fnc_moduleBasicMedicalSettings.sqf +++ b/addons/medical/functions/fnc_moduleBasicMedicalSettings.sqf @@ -10,6 +10,9 @@ * Return Value: * None * + * Example: + * [Logic, [bob, kevin], true] call ACE_medical_fnc_moduleBasicMedicalSettings + * * Public: No */ diff --git a/addons/medical/functions/fnc_moduleMedicalSettings.sqf b/addons/medical/functions/fnc_moduleMedicalSettings.sqf index 29398bbc35..148183ea22 100644 --- a/addons/medical/functions/fnc_moduleMedicalSettings.sqf +++ b/addons/medical/functions/fnc_moduleMedicalSettings.sqf @@ -10,6 +10,9 @@ * Return Value: * None * + * Example: + * [LOGIC, [bob, kevin], true] call ACE_medical_fnc_moduleMedicalSettings + * * Public: No */ diff --git a/addons/medical/functions/fnc_moduleReviveSettings.sqf b/addons/medical/functions/fnc_moduleReviveSettings.sqf index 19aa9579dd..de9e53820c 100644 --- a/addons/medical/functions/fnc_moduleReviveSettings.sqf +++ b/addons/medical/functions/fnc_moduleReviveSettings.sqf @@ -10,6 +10,9 @@ * Return Value: * None * + * Example: + * [LOGIC, [bob, kevin], true] call ACE_medical_fnc_moduleReviveSettings + * * Public: No */ diff --git a/addons/medical/functions/fnc_onMedicationUsage.sqf b/addons/medical/functions/fnc_onMedicationUsage.sqf index 019abd094c..95e7d0bf5e 100644 --- a/addons/medical/functions/fnc_onMedicationUsage.sqf +++ b/addons/medical/functions/fnc_onMedicationUsage.sqf @@ -13,6 +13,9 @@ * Return Value: * None * + * Example: + * [bob, "classname", "varname", 5, 6, ["stuff"]] call ACE_medical_fnc_onMedicationUsage + * * Public: No */ diff --git a/addons/medical/functions/fnc_parseConfigForInjuries.sqf b/addons/medical/functions/fnc_parseConfigForInjuries.sqf index 42dd98dc1f..07bd69fa52 100644 --- a/addons/medical/functions/fnc_parseConfigForInjuries.sqf +++ b/addons/medical/functions/fnc_parseConfigForInjuries.sqf @@ -4,21 +4,23 @@ * * Arguments: * None - * ReturnValue: + * + * Return Value: * None * + * Example: + * call ACE_medical_fnc_parseConfigForInjuries + * * Public: No */ #include "script_component.hpp" -private ["_injuriesRootConfig", "_woundsConfig", "_allWoundClasses", "_amountOf", "_entry","_classType", "_selections", "_bloodLoss", "_pain","_minDamage","_causes", "_damageTypesConfig", "_thresholds", "_typeThresholds", "_selectionSpecific", "_selectionSpecificType", "_classDisplayName", "_subClassDisplayName", "_maxDamage", "_subClassmaxDamage", "_defaultMinLethalDamage", "_minLethalDamage", "_allFoundDamageTypes", "_classID", "_configDamageTypes", "_i", "_parseForSubClassWounds", "_subClass", "_subClassConfig", "_subClassbloodLoss", "_subClasscauses", "_subClassminDamage", "_subClasspain", "_subClassselections", "_subClasstype", "_type", "_varName", "_woundTypes"]; - -_injuriesRootConfig = (configFile >> "ACE_Medical_Advanced" >> "Injuries"); -_allFoundDamageTypes = []; -_configDamageTypes = (_injuriesRootConfig >> "damageTypes"); +private _injuriesRootConfig = (configFile >> "ACE_Medical_Advanced" >> "Injuries"); +private _allFoundDamageTypes = []; +private _configDamageTypes = (_injuriesRootConfig >> "damageTypes"); // minimum lethal damage collection, mapped to damageTypes -_defaultMinLethalDamage = getNumber (_configDamageTypes >> "lethalDamage"); +private _defaultMinLethalDamage = getNumber (_configDamageTypes >> "lethalDamage"); GVAR(minLethalDamages) = []; // Collect all available damage types from the config @@ -26,7 +28,7 @@ for "_i" from 0 to (count _configDamageTypes -1) /* step +1 */ do { // Only get the subclasses in damageType class if (isClass(_configDamageTypes select _i)) then { _allFoundDamageTypes pushBack (configName (_configDamageTypes select _i)); - _minLethalDamage = if (isNumber((_configDamageTypes select _i) >> "lethalDamage")) then { + private _minLethalDamage = if (isNumber((_configDamageTypes select _i) >> "lethalDamage")) then { getNumber((_configDamageTypes select _i) >> "lethalDamage"); } else { _defaultMinLethalDamage @@ -41,18 +43,18 @@ GVAR(fractureClassNames) = []; // Parsing the wounds // function for parsing a sublcass of an injury -_parseForSubClassWounds = { - _subClass = _this select 0; +private _parseForSubClassWounds = { + private _subClass = _this select 0; if (isClass (_entry >> _subClass)) exitWith { - _subClassConfig = (_entry >> _subClass); - _subClasstype = _classType + (configName _subClassConfig); - _subClassselections = if (isArray(_subClassConfig >> "selections")) then { getArray(_subClassConfig >> "selections");} else { _selections }; - _subClassbloodLoss = if (isNumber(_subClassConfig >> "bleedingRate")) then { getNumber(_subClassConfig >> "bleedingRate");} else { _bloodLoss }; - _subClasspain = if (isNumber(_subClassConfig >> "pain")) then { getNumber(_subClassConfig >> "pain");} else { _pain }; - _subClassminDamage = if (isNumber(_subClassConfig >> "minDamage")) then { getNumber(_subClassConfig >> "minDamage");} else { _minDamage }; - _subClassmaxDamage = if (isNumber(_subClassConfig >> "maxDamage")) then { getNumber(_subClassConfig >> "maxDamage");} else { _maxDamage }; - _subClasscauses = if (isArray(_subClassConfig >> "causes")) then { getArray(_subClassConfig >> "causes");} else { _causes }; - _subClassDisplayName = if (isText(_subClassConfig >> "name")) then { getText(_subClassConfig >> "name");} else {_classDisplayName + " " + _subClass}; + private _subClassConfig = (_entry >> _subClass); + private _subClasstype = _classType + (configName _subClassConfig); + private _subClassselections = if (isArray(_subClassConfig >> "selections")) then { getArray(_subClassConfig >> "selections");} else { _selections }; + private _subClassbloodLoss = if (isNumber(_subClassConfig >> "bleedingRate")) then { getNumber(_subClassConfig >> "bleedingRate");} else { _bloodLoss }; + private _subClasspain = if (isNumber(_subClassConfig >> "pain")) then { getNumber(_subClassConfig >> "pain");} else { _pain }; + private _subClassminDamage = if (isNumber(_subClassConfig >> "minDamage")) then { getNumber(_subClassConfig >> "minDamage");} else { _minDamage }; + private _subClassmaxDamage = if (isNumber(_subClassConfig >> "maxDamage")) then { getNumber(_subClassConfig >> "maxDamage");} else { _maxDamage }; + private _subClasscauses = if (isArray(_subClassConfig >> "causes")) then { getArray(_subClassConfig >> "causes");} else { _causes }; + private _subClassDisplayName = if (isText(_subClassConfig >> "name")) then { getText(_subClassConfig >> "name");} else {_classDisplayName + " " + _subClass}; if (count _selections > 0 && {count _causes > 0}) then { GVAR(woundClassNames) pushBack _subClasstype; _allWoundClasses pushBack [_classID, _subClassselections, _subClassbloodLoss, _subClasspain, [_subClassminDamage, _subClassmaxDamage], _subClasscauses, _subClassDisplayName]; @@ -64,22 +66,22 @@ _parseForSubClassWounds = { }; // TODO classTypes are strings currently. Convert them to unqiue IDs instead. -_woundsConfig = (_injuriesRootConfig >> "wounds"); -_allWoundClasses = []; -_classID = 0; +private _woundsConfig = (_injuriesRootConfig >> "wounds"); +private _allWoundClasses = []; +private _classID = 0; if (isClass _woundsConfig) then { - _amountOf = count _woundsConfig; + private _amountOf = count _woundsConfig; for "_i" from 0 to (_amountOf -1) /* step +1 */ do { - _entry = _woundsConfig select _i; + private _entry = _woundsConfig select _i; if (isClass _entry) then { - _classType = (ConfigName _entry); - _selections = if (isArray(_entry >> "selections")) then { getArray(_entry >> "selections");} else {[]}; - _bloodLoss = if (isNumber(_entry >> "bleedingRate")) then { getNumber(_entry >> "bleedingRate");} else {0}; - _pain = if (isNumber(_entry >> "pain")) then { getNumber(_entry >> "pain");} else {0}; - _minDamage = if (isNumber(_entry >> "minDamage")) then { getNumber(_entry >> "minDamage");} else {0}; - _maxDamage = if (isNumber(_entry >> "maxDamage")) then { getNumber(_entry >> "maxDamage");} else {-1}; - _causes = if (isArray(_entry >> "causes")) then { getArray(_entry >> "causes");} else {[]}; - _classDisplayName = if (isText(_entry >> "name")) then { getText(_entry >> "name");} else {_classType}; + private _classType = (ConfigName _entry); + private _selections = if (isArray(_entry >> "selections")) then { getArray(_entry >> "selections");} else {[]}; + private _bloodLoss = if (isNumber(_entry >> "bleedingRate")) then { getNumber(_entry >> "bleedingRate");} else {0}; + private _pain = if (isNumber(_entry >> "pain")) then { getNumber(_entry >> "pain");} else {0}; + private _minDamage = if (isNumber(_entry >> "minDamage")) then { getNumber(_entry >> "minDamage");} else {0}; + private _maxDamage = if (isNumber(_entry >> "maxDamage")) then { getNumber(_entry >> "maxDamage");} else {-1}; + private _causes = if (isArray(_entry >> "causes")) then { getArray(_entry >> "causes");} else {[]}; + private _classDisplayName = if (isText(_entry >> "name")) then { getText(_entry >> "name");} else {_classType}; // TODO instead of hardcoding minor, medium and large just go through all sub classes recursively until none are found if (["Minor"] call _parseForSubClassWounds || ["Medium"] call _parseForSubClassWounds || ["Large"] call _parseForSubClassWounds) exitWith {}; // continue to the next one @@ -97,31 +99,30 @@ if (isClass _woundsConfig) then { GVAR(AllWoundInjuryTypes) = _allWoundClasses; // Linking injuries to the woundInjuryType variables. -_damageTypesConfig = (configFile >> "ACE_Medical_Advanced" >> "Injuries" >> "damageTypes"); -_thresholds = getArray(_damageTypesConfig >> "thresholds"); -_selectionSpecific = getNumber(_damageTypesConfig >> "selectionSpecific"); +private _damageTypesConfig = (configFile >> "ACE_Medical_Advanced" >> "Injuries" >> "damageTypes"); +private _thresholds = getArray(_damageTypesConfig >> "thresholds"); +private _selectionSpecific = getNumber(_damageTypesConfig >> "selectionSpecific"); { - _varName = format[QGVAR(woundInjuryType_%1),_x]; - _woundTypes = []; - _type = _x; + private _varName = format[QGVAR(woundInjuryType_%1),_x]; + private _woundTypes = []; + private _type = _x; { // Check if this type is in the causes of a wound class, if so, we will store the wound types for this damage type if (_type in (_x select 5)) then { _woundTypes pushBack _x; }; } forEach _allWoundClasses; - _typeThresholds = _thresholds; - _selectionSpecificType = _selectionSpecific; + private _typeThresholds = _thresholds; + private _selectionSpecificType = _selectionSpecific; if (isClass(_damageTypesConfig >> _x)) then { if (isArray(_damageTypesConfig >> _x >> "thresholds")) then { _typeThresholds = getArray(_damageTypesConfig >> _x >> "thresholds");}; if (isNumber(_damageTypesConfig >> _x >> "selectionSpecific")) then { _selectionSpecificType = getNumber(_damageTypesConfig >> _x >> "selectionSpecific");}; }; missionNamespace setVariable [_varName, [_typeThresholds, _selectionSpecificType > 0, _woundTypes]]; - private ["_minDamageThresholds", "_amountThresholds"]; // extension loading - _minDamageThresholds = ""; - _amountThresholds = ""; + private _minDamageThresholds = ""; + private _amountThresholds = ""; { _minDamageThresholds = _minDamageThresholds + str(_x select 0); _amountThresholds = _amountThresholds + str(_x select 1); @@ -139,12 +140,11 @@ _selectionSpecific = getNumber(_damageTypesConfig >> "selectionSpecific"); // Extension loading { - private ["_classID", "_className", "_allowedSelections", "_bloodLoss", "_pain", "_minDamage", "_maxDamage", "_causes", "_classDisplayName", "_extensionInput", "_selections", "_causesArray"]; // add shit to addInjuryType _x params ["_classID", "_selections", "_bloodLoss", "_pain", "_damage", "_causesArray", "_classDisplayName"]; _damage params ["_minDamage", "_maxDamage"]; - _className = GVAR(woundClassNames) select _forEachIndex; - _allowedSelections = ""; + private _className = GVAR(woundClassNames) select _forEachIndex; + private _allowedSelections = ""; { _allowedSelections = _allowedSelections + _x; @@ -153,7 +153,7 @@ _selectionSpecific = getNumber(_damageTypesConfig >> "selectionSpecific"); }; } forEach _selections; - _causes = ""; + private _causes = ""; { _causes = _causes + _x; diff --git a/addons/medical/functions/fnc_playInjuredSound.sqf b/addons/medical/functions/fnc_playInjuredSound.sqf index 2e5ec2ab5f..629b600d49 100644 --- a/addons/medical/functions/fnc_playInjuredSound.sqf +++ b/addons/medical/functions/fnc_playInjuredSound.sqf @@ -8,9 +8,12 @@ * 0: The Unit * 1: Amount of Pain * - * ReturnValue: + * Return Value: * None * + * Example: + * [bob, 5] call ACE_medical_fnc_playInjuredSound + * * Public: No */ diff --git a/addons/medical/functions/fnc_reviveStateLoop.sqf b/addons/medical/functions/fnc_reviveStateLoop.sqf index 5dcaad09c4..0ec5f78c85 100644 --- a/addons/medical/functions/fnc_reviveStateLoop.sqf +++ b/addons/medical/functions/fnc_reviveStateLoop.sqf @@ -5,9 +5,12 @@ * Arguments: * 0: Unit * - * ReturnValue: + * Return Value: * None * + * Example: + * [bob] call ACE_medical_fnc_reviveStateLoop + * * Public: No */ diff --git a/addons/medical/functions/fnc_selectionNameToNumber.sqf b/addons/medical/functions/fnc_selectionNameToNumber.sqf index 1e8d79183f..441f4bb31e 100644 --- a/addons/medical/functions/fnc_selectionNameToNumber.sqf +++ b/addons/medical/functions/fnc_selectionNameToNumber.sqf @@ -5,9 +5,12 @@ * Arguments: * 0: The selection name of a unit * - * ReturnValue: + * Return Value: * Number representation. -1 if invalid. * + * Example: + * ["head"] call ace_medical_fnc_selectionNameToNumber + * * Public: yes */ diff --git a/addons/medical/functions/fnc_serverRemoveBody.sqf b/addons/medical/functions/fnc_serverRemoveBody.sqf index f68ffd95cd..3c1bfe90a1 100644 --- a/addons/medical/functions/fnc_serverRemoveBody.sqf +++ b/addons/medical/functions/fnc_serverRemoveBody.sqf @@ -7,7 +7,7 @@ * 0: Mr Body * * Return Value: - * Nothing + * None * * Example: * [cursorTarget] call ace_medical_fnc_serverRemoveBody diff --git a/addons/medical/functions/fnc_setCardiacArrest.sqf b/addons/medical/functions/fnc_setCardiacArrest.sqf index 69bda192dd..5b97b3d50b 100644 --- a/addons/medical/functions/fnc_setCardiacArrest.sqf +++ b/addons/medical/functions/fnc_setCardiacArrest.sqf @@ -6,9 +6,12 @@ * Arguments: * 0: The unit that will be put in cardiac arrest state * - * ReturnValue: + * Return Value: * None * + * Example: + * [bob] call ace_medical_fnc_setCardiacArrest + * * Public: yes */ diff --git a/addons/medical/functions/fnc_setDead.sqf b/addons/medical/functions/fnc_setDead.sqf index 0e5fd884f4..3949f2cfd9 100644 --- a/addons/medical/functions/fnc_setDead.sqf +++ b/addons/medical/functions/fnc_setDead.sqf @@ -4,18 +4,20 @@ * * Arguments: * 0: The unit that will be killed - * 1: Force Dead (ignore revive setting) - * 1: Delay setDamage for a frame + * 1: Force Dead (ignore revive setting) (default: false) + * 1: Delay setDamage for a frame (default: false) * - * ReturnValue: + * Return Value: * Did he died? * + * Example: + * [bob, false, false] call ace_medical_fnc_setDead + * * Public: yes */ #include "script_component.hpp" -private ["_reviveVal", "_lifesLeft"]; params ["_unit", ["_force", false], ["_delaySetDamage", false]]; if ((!alive _unit) || {_unit getVariable ["ACE_isDead", false]}) exitWith {true}; @@ -24,12 +26,12 @@ if (!local _unit) exitwith { false; }; -_reviveVal = _unit getVariable [QGVAR(enableRevive), GVAR(enableRevive)]; +private _reviveVal = _unit getVariable [QGVAR(enableRevive), GVAR(enableRevive)]; if (((_reviveVal == 1 && {[_unit] call EFUNC(common,isPlayer)} || _reviveVal == 2)) && !_force) exitwith { if (_unit getVariable [QGVAR(inReviveState), false]) exitwith { if (GVAR(amountOfReviveLives) > 0) then { - _lifesLeft = _unit getVariable[QGVAR(amountOfReviveLives), GVAR(amountOfReviveLives)]; - if (_lifesLeft == 0) then { + private _lifesLeft = _unit getVariable[QGVAR(amountOfReviveLives), GVAR(amountOfReviveLives)]; + if (_lifesLeft <= 0) then { [_unit, true] call FUNC(setDead); }; }; diff --git a/addons/medical/functions/fnc_setHitPointDamage.sqf b/addons/medical/functions/fnc_setHitPointDamage.sqf index b1dfe59d29..eb93b6740e 100644 --- a/addons/medical/functions/fnc_setHitPointDamage.sqf +++ b/addons/medical/functions/fnc_setHitPointDamage.sqf @@ -12,6 +12,9 @@ * Return Value: * None * + * Example: + * [medic, "Leg", 2, false] call ace_medical_fnc_setHitPointDamage + * * Public: Yes */ @@ -21,7 +24,6 @@ #define ARMDAMAGETRESHOLD1 1 #define ARMDAMAGETRESHOLD2 1.7 -private ["_unit", "_selection", "_damage", "_selections", "_damages", "_damageOld", "_damageSumOld", "_damageNew", "_damageSumNew", "_damageFinal", "_armdamage", "_legdamage"]; params ["_unit", "_selection", "_damage", ["_disabled", false]]; // Unit isn't local, give function to machine where it is. @@ -34,7 +36,7 @@ if (_disabled) exitWith { _unit setHitPointDamage [_selection, _damage]; }; -_selections = [ +private _selections = [ "HitHead", "HitBody", "HitLeftArm", @@ -47,10 +49,10 @@ if !(_selection in _selections) exitWith { _unit setHitPointDamage [_selection, _damage]; }; -_damages = _selections apply {_unit getHitPointDamage _x}; +private _damages = _selections apply {_unit getHitPointDamage _x}; -_damageOld = damage _unit; -_damageSumOld = 0; +private _damageOld = damage _unit; +private _damageSumOld = 0; { _damageSumOld = _damageSumOld + _x; } forEach _damages; @@ -58,12 +60,12 @@ _damageSumOld = _damageSumOld max 0.001; _damages set [_selections find _selection, _damage]; -_damageSumNew = 0; +private _damageSumNew = 0; { _damageSumNew = _damageSumNew + _x; } forEach _damages; -_damageNew = _damageSumNew / 6; +private _damageNew = _damageSumNew / 6; if (_damageOld > 0) then { _damageNew = _damageOld * (_damageSumNew / _damageSumOld); }; @@ -77,12 +79,12 @@ if (_damageNew >= 0.9) then { }; { - _damageFinal = (_damages select _forEachIndex); + private _damageFinal = (_damages select _forEachIndex); _unit setHitPointDamage [_x, _damageFinal]; } forEach _selections; // Leg Damage -_legdamage = (_unit getHitPointDamage "HitLeftLeg") + (_unit getHitPointDamage "HitRightLeg"); +private _legdamage = (_unit getHitPointDamage "HitLeftLeg") + (_unit getHitPointDamage "HitRightLeg"); if (_legdamage >= LEGDAMAGETRESHOLD1) then { if (_unit getHitPointDamage "HitLegs" != 1) then {_unit setHitPointDamage ["HitLegs", 1]}; } else { @@ -92,7 +94,7 @@ if (_legdamage >= LEGDAMAGETRESHOLD1) then { // Arm Damage -_armdamage = (_unit getHitPointDamage "HitLeftArm") + (_unit getHitPointDamage "HitRightArm"); +private _armdamage = (_unit getHitPointDamage "HitLeftArm") + (_unit getHitPointDamage "HitRightArm"); if (_armdamage >= ARMDAMAGETRESHOLD1) then { if (_unit getHitPointDamage "HitHands" != 1) then {_unit setHitPointDamage ["HitHands", 1]}; } else { diff --git a/addons/medical/functions/fnc_setStructuralDamage.sqf b/addons/medical/functions/fnc_setStructuralDamage.sqf index ba30b08153..4f8c6e2613 100644 --- a/addons/medical/functions/fnc_setStructuralDamage.sqf +++ b/addons/medical/functions/fnc_setStructuralDamage.sqf @@ -5,8 +5,11 @@ * Arguments: * 0: The unit * - * ReturnValue: - * + * Return Value: + * None + * + * Example: + * [bob] call ACE_medical_fnc_setStructuralDamage * * Public: no? */ diff --git a/addons/medical/functions/fnc_setUnconscious.sqf b/addons/medical/functions/fnc_setUnconscious.sqf index 5bee0967ba..7b7235d7ec 100644 --- a/addons/medical/functions/fnc_setUnconscious.sqf +++ b/addons/medical/functions/fnc_setUnconscious.sqf @@ -8,8 +8,8 @@ * 2: Minimum unconscious time (default: (round(random(10)+5))) * 3: Force AI Unconscious (skip random death chance) (default: false) * - * ReturnValue: - * nil + * Return Value: + * None * * Example: * [bob, true] call ace_medical_fnc_setUnconscious; @@ -26,7 +26,6 @@ if !(EGVAR(common,settingsInitFinished)) exitWith { EGVAR(common,runAtSettingsInitialized) pushBack [FUNC(setUnconscious), _this]; }; -private ["_animState", "_originalPos", "_startingTime", "_isDead"]; params ["_unit", ["_set", true], ["_minWaitingTime", DEFAULT_DELAY], ["_force", false]]; // No change, fuck off. (why is there no xor?) @@ -55,9 +54,9 @@ if (_unit == ACE_player) then { }; // if we have unconsciousness for AI disabled, we will kill the unit instead -_isDead = false; +private _isDead = false; if (!([_unit, GVAR(remoteControlledAI)] call EFUNC(common,isPlayer)) && !_force) then { - _enableUncon = _unit getVariable [QGVAR(enableUnconsciousnessAI), GVAR(enableUnconsciousnessAI)]; + private _enableUncon = _unit getVariable [QGVAR(enableUnconsciousnessAI), GVAR(enableUnconsciousnessAI)]; if (_enableUncon == 0 or {_enableUncon == 1 and (random 1) < 0.5}) then { [_unit, true] call FUNC(setDead); _isDead = true; @@ -86,7 +85,7 @@ if (vehicle _unit != _unit) then { }; //Save current stance: -_originalPos = unitPos _unit; +private _originalPos = unitPos _unit; _unit setUnitPos "DOWN"; [_unit, true] call EFUNC(common,disableAI); @@ -100,15 +99,19 @@ if (GVAR(moveUnitsFromGroupOnUnconscious)) then { if (GVAR(delayUnconCaptive) == 0) then { [_unit, "setCaptive", "ace_unconscious", true] call EFUNC(common,statusEffect_set); } else { + // when the Delay is so high that the unit can wake up and get uncon again we need to check if it is the correct wait that got executed + private _counter = _unit getVariable [QGVAR(unconsciousCounter), 0]; + _counter = _counter + 1; + _unit setVariable [QGVAR(unconsciousCounter), _counter]; [{ - params ["_unit"]; - if (_unit getVariable ["ACE_isUnconscious", false]) then { + params ["_unit", "_counter"]; + if (_unit getVariable ["ACE_isUnconscious", false] && (_unit getVariable [QGVAR(unconsciousCounter), 0]) == _counter) then { [_unit, "setCaptive", "ace_unconscious", true] call EFUNC(common,statusEffect_set); }; - },[_unit], GVAR(delayUnconCaptive)] call CBA_fnc_waitAndExecute; + },[_unit, _counter], GVAR(delayUnconCaptive)] call CBA_fnc_waitAndExecute; }; -_anim = [_unit] call EFUNC(common,getDeathAnim); +private _anim = [_unit] call EFUNC(common,getDeathAnim); [_unit, _anim, 1, true] call EFUNC(common,doAnimation); [{ params ["_unit", "_anim"]; @@ -117,7 +120,7 @@ _anim = [_unit] call EFUNC(common,getDeathAnim); }; }, [_unit, _anim], 0.5, 0] call CBA_fnc_waitAndExecute; -_startingTime = CBA_missionTime; +private _startingTime = CBA_missionTime; [DFUNC(unconsciousPFH), 0.1, [_unit, _originalPos, _startingTime, _minWaitingTime, false, vehicle _unit isKindOf "ParachuteBase"] ] call CBA_fnc_addPerFrameHandler; diff --git a/addons/medical/functions/fnc_showBloodEffect.sqf b/addons/medical/functions/fnc_showBloodEffect.sqf index 8ed77714cb..61cd6fe464 100644 --- a/addons/medical/functions/fnc_showBloodEffect.sqf +++ b/addons/medical/functions/fnc_showBloodEffect.sqf @@ -8,6 +8,9 @@ * Return Value: * None * + * Example: + * [2] call ace_medical_fnc_showBloodEffect + * * Public: Yes */ #include "script_component.hpp" @@ -17,10 +20,12 @@ params ["_bloodRemaining"]; disableSerialization; // get already existing controls, or create them -private ["_fxBloodControls", "_bloodCtrl1", "_bloodCtrl2", "_bloodCtrl3"]; -_fxBloodControls = GETUVAR(GVAR(FXBloodControls),[]); +private _fxBloodControls = GETUVAR(GVAR(FXBloodControls),[]); +private _bloodCtrl1 = controlNull; +private _bloodCtrl2 = controlNull; +private _bloodCtrl3 = controlNull; if (count _fxBloodControls != 3) then { _bloodCtrl1 = findDisplay 46 ctrlCreate ["RscPicture", -1]; _bloodCtrl2 = findDisplay 46 ctrlCreate ["RscPicture", -1]; diff --git a/addons/medical/functions/fnc_treatment.sqf b/addons/medical/functions/fnc_treatment.sqf index 453d074f98..80f097fee4 100644 --- a/addons/medical/functions/fnc_treatment.sqf +++ b/addons/medical/functions/fnc_treatment.sqf @@ -11,6 +11,9 @@ * Return Value: * Succesful treatment started * + * Example: + * [medic, patient, "SelectionName","bandage"] call ace_medical_fnc_treatment + * * Public: Yes */ @@ -173,21 +176,24 @@ if (vehicle _caller == _caller && {_callerAnim != ""}) then { _caller selectWeapon (primaryWeapon _caller); // unit always has a primary weapon here }; - if (isWeaponDeployed _caller) then { - TRACE_1("Weapon Deployed, breaking out first",(stance _caller)); - [_caller, "", 0] call EFUNC(common,doAnimation); - }; - - if ((stance _caller) == "STAND") then { - switch (_wpn) do {//If standing, end in a crouched animation based on their current weapon - case ("rfl"): {_caller setVariable [QGVAR(treatmentPrevAnimCaller), "AmovPknlMstpSrasWrflDnon"];}; - case ("pst"): {_caller setVariable [QGVAR(treatmentPrevAnimCaller), "AmovPknlMstpSrasWpstDnon"];}; - case ("non"): {_caller setVariable [QGVAR(treatmentPrevAnimCaller), "AmovPknlMstpSnonWnonDnon"];}; + if !(_caller call EFUNC(common,isSwimming)) then { + // Weapon on back also does not work underwater + if (isWeaponDeployed _caller) then { + TRACE_1("Weapon Deployed, breaking out first",(stance _caller)); + [_caller, "", 0] call EFUNC(common,doAnimation); }; - } else { - _caller setVariable [QGVAR(treatmentPrevAnimCaller), animationState _caller]; + + if ((stance _caller) == "STAND") then { + switch (_wpn) do {//If standing, end in a crouched animation based on their current weapon + case ("rfl"): {_caller setVariable [QGVAR(treatmentPrevAnimCaller), "AmovPknlMstpSrasWrflDnon"];}; + case ("pst"): {_caller setVariable [QGVAR(treatmentPrevAnimCaller), "AmovPknlMstpSrasWpstDnon"];}; + case ("non"): {_caller setVariable [QGVAR(treatmentPrevAnimCaller), "AmovPknlMstpSnonWnonDnon"];}; + }; + } else { + _caller setVariable [QGVAR(treatmentPrevAnimCaller), animationState _caller]; + }; + [_caller, _callerAnim] call EFUNC(common,doAnimation); }; - [_caller, _callerAnim] call EFUNC(common,doAnimation); }; //Get treatment time @@ -217,7 +223,7 @@ private _treatmentTime = if (isNumber (_config >> "treatmentTime")) then { DFUNC(treatment_failure), getText (_config >> "displayNameProgress"), _callbackProgress, - ["isnotinside"] + ["isNotInside", "isNotSwimming"] ] call EFUNC(common,progressBar); // Display Icon diff --git a/addons/medical/functions/fnc_treatmentAdvanced_CPR.sqf b/addons/medical/functions/fnc_treatmentAdvanced_CPR.sqf index 0ce1f7d4d9..aedcffdb49 100644 --- a/addons/medical/functions/fnc_treatmentAdvanced_CPR.sqf +++ b/addons/medical/functions/fnc_treatmentAdvanced_CPR.sqf @@ -11,6 +11,9 @@ * Return Value: * Succesful treatment started * + * Example: + * [medic, patient, "selectionName", "bandage"] call ace_medical_fnc_treatmentAdvanced_CPR + * * Public: Yes */ diff --git a/addons/medical/functions/fnc_treatmentAdvanced_CPRLocal.sqf b/addons/medical/functions/fnc_treatmentAdvanced_CPRLocal.sqf index fbc7aac601..a893feedef 100644 --- a/addons/medical/functions/fnc_treatmentAdvanced_CPRLocal.sqf +++ b/addons/medical/functions/fnc_treatmentAdvanced_CPRLocal.sqf @@ -9,6 +9,9 @@ * Return Value: * Succesful treatment started * + * Example: + * [medic, patient] call ace_medical_fnc_treatmentAdvanced_CPRLocal + * * Public: Yes */ diff --git a/addons/medical/functions/fnc_treatmentAdvanced_bandage.sqf b/addons/medical/functions/fnc_treatmentAdvanced_bandage.sqf index 0db3e641b3..0dd9742c08 100644 --- a/addons/medical/functions/fnc_treatmentAdvanced_bandage.sqf +++ b/addons/medical/functions/fnc_treatmentAdvanced_bandage.sqf @@ -13,6 +13,9 @@ * Return Value: * Succesful treatment started * + * Example: + * [medic, patient, "Selectionname", "bandage", "bandage", -1] call ace_medical_fnc_treatmentAdvanced_bandage + * * Public: Yes */ diff --git a/addons/medical/functions/fnc_treatmentAdvanced_bandageLocal.sqf b/addons/medical/functions/fnc_treatmentAdvanced_bandageLocal.sqf index a9f26ca2fd..c581d4ddbe 100644 --- a/addons/medical/functions/fnc_treatmentAdvanced_bandageLocal.sqf +++ b/addons/medical/functions/fnc_treatmentAdvanced_bandageLocal.sqf @@ -10,6 +10,9 @@ * Return Value: * Succesful treatment started * + * Example: + * [bob, "classname"] call ACE_medical_fnc_treatmentAdvanced_bandageLocal + * * Public: No */ diff --git a/addons/medical/functions/fnc_treatmentAdvanced_fullHeal.sqf b/addons/medical/functions/fnc_treatmentAdvanced_fullHeal.sqf index 18bd0468d2..5b20863338 100644 --- a/addons/medical/functions/fnc_treatmentAdvanced_fullHeal.sqf +++ b/addons/medical/functions/fnc_treatmentAdvanced_fullHeal.sqf @@ -1,11 +1,21 @@ -/** - * fn_heal.sqf - * @Descr: N/A - * @Author: Glowbal +/* + * Author: Glowbal * - * @Arguments: [] - * @Return: - * @PublicAPI: false + * + * Arguments: + * 0: Caller + * 1: Target + * 2: SelectionName + * 3: ClassName + * 4: Item + * + * Return Value: + * Boolean + * + * Example: + * [bob, kevin, "selection", "classname", ] call ACE_medical_fnc_treatmentAdvanced_fullHeal + * + * Public: No */ #include "script_component.hpp" diff --git a/addons/medical/functions/fnc_treatmentAdvanced_fullHealLocal.sqf b/addons/medical/functions/fnc_treatmentAdvanced_fullHealLocal.sqf index 7517f235e7..bd31e58ba9 100644 --- a/addons/medical/functions/fnc_treatmentAdvanced_fullHealLocal.sqf +++ b/addons/medical/functions/fnc_treatmentAdvanced_fullHealLocal.sqf @@ -1,11 +1,18 @@ -/** - * fn_healLocal.sqf - * @Descr: N/A - * @Author: Glowbal +/* + * Author: Glowbal * - * @Arguments: [] - * @Return: - * @PublicAPI: false + * + * Arguments: + * 0: Caller + * 1: Target + * + * Return Value: + * Boolean + * + * Example: + * [bob, kevin] call ACE_medical_fnc_treatmentAdvanced_fullHealLocal + * + * Public: No */ #include "script_component.hpp" @@ -47,7 +54,6 @@ if (alive _target) exitWith { _target setVariable [QGVAR(airwayCollapsed), false, true]; // generic medical admin - _target setVariable [QGVAR(addedToUnitLoop), false, true]; _target setVariable [QGVAR(inCardiacArrest), false, true]; _target setVariable [QGVAR(inReviveState), false, true]; _target setVariable ["ACE_isUnconscious", false, true]; diff --git a/addons/medical/functions/fnc_treatmentAdvanced_medication.sqf b/addons/medical/functions/fnc_treatmentAdvanced_medication.sqf index ceb788f571..a58ded3de3 100644 --- a/addons/medical/functions/fnc_treatmentAdvanced_medication.sqf +++ b/addons/medical/functions/fnc_treatmentAdvanced_medication.sqf @@ -12,6 +12,9 @@ * Return Value: * Succesful treatment started * + * Example: + * [medic, patient, "selectionName", "bandage", 2] call ace_medical_fnc_treatmentAdvanced_medication + * * Public: Yes */ diff --git a/addons/medical/functions/fnc_treatmentAdvanced_medicationLocal.sqf b/addons/medical/functions/fnc_treatmentAdvanced_medicationLocal.sqf index 46a8b9c2a8..32b7e9d2c1 100644 --- a/addons/medical/functions/fnc_treatmentAdvanced_medicationLocal.sqf +++ b/addons/medical/functions/fnc_treatmentAdvanced_medicationLocal.sqf @@ -10,6 +10,9 @@ * Return Value: * Succesful treatment started * + * Example: + * [medic, "bandage", 2] call ace_medical_fnc_treatmentAdvanced_medicationLocal + * * Public: Yes */ diff --git a/addons/medical/functions/fnc_treatmentAdvanced_surgicalKit_onProgress.sqf b/addons/medical/functions/fnc_treatmentAdvanced_surgicalKit_onProgress.sqf index 0a1e48288f..a73661ac77 100644 --- a/addons/medical/functions/fnc_treatmentAdvanced_surgicalKit_onProgress.sqf +++ b/addons/medical/functions/fnc_treatmentAdvanced_surgicalKit_onProgress.sqf @@ -12,6 +12,9 @@ * Return Value: * Succesful treatment started * + * Example: + * [[bob, kevin], 5, 5] call ACE_medical_fnc_treatmentAdvanced_surgicalKit_onProgress + * * Public: No */ #include "script_component.hpp" diff --git a/addons/medical/functions/fnc_treatmentBasic_bloodbag.sqf b/addons/medical/functions/fnc_treatmentBasic_bloodbag.sqf index 6989ac14b8..5ef368922d 100644 --- a/addons/medical/functions/fnc_treatmentBasic_bloodbag.sqf +++ b/addons/medical/functions/fnc_treatmentBasic_bloodbag.sqf @@ -11,6 +11,9 @@ * Return Value: * None * + * Example: + * [bob, kevin, "selection", "classname"] call ACE_medical_fnc_treatmentBasic_bloodbag + * * Public: No */ diff --git a/addons/medical/functions/fnc_treatmentBasic_bloodbagLocal.sqf b/addons/medical/functions/fnc_treatmentBasic_bloodbagLocal.sqf index cb4dcf032c..1e56eb3d88 100644 --- a/addons/medical/functions/fnc_treatmentBasic_bloodbagLocal.sqf +++ b/addons/medical/functions/fnc_treatmentBasic_bloodbagLocal.sqf @@ -7,7 +7,10 @@ * 1: Treatment Classname * * Return Value: - * nil + * None + * + * Example: + * [bob, "classname"] call ACE_medical_fnc_treatmentBasic_bloodbagLocal * * Public: No */ diff --git a/addons/medical/functions/fnc_treatmentBasic_epipen.sqf b/addons/medical/functions/fnc_treatmentBasic_epipen.sqf index 1abee1cd58..161626bb41 100644 --- a/addons/medical/functions/fnc_treatmentBasic_epipen.sqf +++ b/addons/medical/functions/fnc_treatmentBasic_epipen.sqf @@ -11,6 +11,9 @@ * Return Value: * None * + * Example: + * [bob, kevin, "selection", "classname"] call ACE_medical_fnc_treatmentBasic_epipen + * * Public: No */ #include "script_component.hpp" diff --git a/addons/medical/functions/fnc_treatmentBasic_morphine.sqf b/addons/medical/functions/fnc_treatmentBasic_morphine.sqf index f704a67042..f011ab41a2 100644 --- a/addons/medical/functions/fnc_treatmentBasic_morphine.sqf +++ b/addons/medical/functions/fnc_treatmentBasic_morphine.sqf @@ -11,6 +11,9 @@ * Return Value: * None * + * Example: + * [bob, kevin, "selection", "classname"] call ACE_medical_fnc_treatmentBasic_morphine + * * Public: No */ diff --git a/addons/medical/functions/fnc_treatmentBasic_morphineLocal.sqf b/addons/medical/functions/fnc_treatmentBasic_morphineLocal.sqf index bb670c75bd..f24719d352 100644 --- a/addons/medical/functions/fnc_treatmentBasic_morphineLocal.sqf +++ b/addons/medical/functions/fnc_treatmentBasic_morphineLocal.sqf @@ -9,6 +9,9 @@ * Return Value: * None * + * Example: + * [bob, kevin] call ACE_medical_fnc_treatmentBasic_morphineLocal + * * Public: No */ diff --git a/addons/medical/functions/fnc_treatmentIV.sqf b/addons/medical/functions/fnc_treatmentIV.sqf index 7b16fad650..a393acbb13 100644 --- a/addons/medical/functions/fnc_treatmentIV.sqf +++ b/addons/medical/functions/fnc_treatmentIV.sqf @@ -11,6 +11,9 @@ * Return Value: * Succesful treatment started * + * Example: + * [medic, patient, "SelectionName", "bandage"] call ace_medical_fnc_treatmentIV + * * Public: Yes */ diff --git a/addons/medical/functions/fnc_treatmentIVLocal.sqf b/addons/medical/functions/fnc_treatmentIVLocal.sqf index 1324d5aac2..63d8292b0f 100644 --- a/addons/medical/functions/fnc_treatmentIVLocal.sqf +++ b/addons/medical/functions/fnc_treatmentIVLocal.sqf @@ -10,6 +10,9 @@ * Return Value: * None * + * Example: + * [medic, "Classname"] call ace_medical_fnc_treatmentIVLocal + * * Public: Yes */ diff --git a/addons/medical/functions/fnc_treatmentTourniquet.sqf b/addons/medical/functions/fnc_treatmentTourniquet.sqf index 3fa34a58aa..cb7e6d21d0 100644 --- a/addons/medical/functions/fnc_treatmentTourniquet.sqf +++ b/addons/medical/functions/fnc_treatmentTourniquet.sqf @@ -12,6 +12,9 @@ * Return Value: * Succesful treatment started * + * Example: + * [bob, kevin, "selection", "classname"] call ACE_medical_fnc_treatmentTourniquet + * * Public: No */ diff --git a/addons/medical/functions/fnc_treatmentTourniquetLocal.sqf b/addons/medical/functions/fnc_treatmentTourniquetLocal.sqf index ab24a94a23..e7e9ff7ca1 100644 --- a/addons/medical/functions/fnc_treatmentTourniquetLocal.sqf +++ b/addons/medical/functions/fnc_treatmentTourniquetLocal.sqf @@ -9,6 +9,9 @@ * Return Value: * None * + * Example: + * [bob, "classname"] call ACE_medical_fnc_treatmentTourniquetLocal + * * Public: No */ #include "script_component.hpp" diff --git a/addons/medical/functions/fnc_treatment_failure.sqf b/addons/medical/functions/fnc_treatment_failure.sqf index d81c576feb..fbd69dde5b 100644 --- a/addons/medical/functions/fnc_treatment_failure.sqf +++ b/addons/medical/functions/fnc_treatment_failure.sqf @@ -12,6 +12,9 @@ * Return Value: * None * + * Example: + * [bob, kevin, "selectionname", "classname", ["bandage"]] call ACE_medical_fnc_treatment_failure + * * Public: No */ @@ -23,7 +26,7 @@ _args params ["_caller", "_target", "_selectionName", "_className", "_items", "_ if (primaryWeapon _caller == "ACE_FakePrimaryWeapon") then { _caller removeWeapon "ACE_FakePrimaryWeapon"; }; -if (vehicle _caller == _caller) then { +if (vehicle _caller == _caller && {!(_caller call EFUNC(common,isSwimming))}) then { private _lastAnim = _caller getVariable [QGVAR(treatmentPrevAnimCaller), ""]; //Don't play another medic animation (when player is rapidily treating) TRACE_2("Reseting to old animation", animationState player, _lastAnim); @@ -34,21 +37,20 @@ if (vehicle _caller == _caller) then { case "ainvppnemstpslaywpstdnon_medic": {_lastAnim = "AinvPpneMstpSlayWpstDnon"}; case "ainvpknlmstpslaywpstdnon_medic": {_lastAnim = "AmovPknlMstpSrasWpstDnon"}; }; - [_caller, _lastAnim, 2] call EFUNC(common,doAnimation); }; _caller setVariable [QGVAR(treatmentPrevAnimCaller), nil]; private _weaponSelect = (_caller getVariable [QGVAR(selectedWeaponOnTreatment), []]); if ((_weaponSelect params [["_previousWeapon", ""]]) && {(_previousWeapon != "") && {_previousWeapon in (weapons _caller)}}) then { - for "_index" from 0 to 99 do { + for "_index" from 0 to 299 do { _caller action ["SwitchWeapon", _caller, _caller, _index]; //Just check weapon, muzzle and mode (ignore ammo in case they were reloading) if (((weaponState _caller) select [0,3]) isEqualTo (_weaponSelect select [0,3])) exitWith {TRACE_1("Restoring", (weaponState _caller));}; if ((weaponState _caller) isEqualTo ["","","","",0]) exitWith {ERROR("weaponState not found");}; }; } else { - _caller action ["SwitchWeapon", _caller, _caller, 99]; + _caller action ["SwitchWeapon", _caller, _caller, 299]; }; { diff --git a/addons/medical/functions/fnc_treatment_success.sqf b/addons/medical/functions/fnc_treatment_success.sqf index eb52d20e3c..37b5f8a51d 100644 --- a/addons/medical/functions/fnc_treatment_success.sqf +++ b/addons/medical/functions/fnc_treatment_success.sqf @@ -12,6 +12,9 @@ * Return Value: * None * + * Example: + * [bob, kevin, "selectionname", "classname", ["bandage"]] call ACE_medical_fnc_treatment_success + * * Public: No */ @@ -23,7 +26,7 @@ _args params ["_caller", "_target", "_selectionName", "_className", "_items", "_ if (primaryWeapon _caller == "ACE_FakePrimaryWeapon") then { _caller removeWeapon "ACE_FakePrimaryWeapon"; }; -if (vehicle _caller == _caller) then { +if (vehicle _caller == _caller && {!(_caller call EFUNC(common,isSwimming))}) then { private _lastAnim = _caller getVariable [QGVAR(treatmentPrevAnimCaller), ""]; //Don't play another medic animation (when player is rapidily treating) TRACE_2("Reseting to old animation", animationState player, _lastAnim); @@ -34,21 +37,20 @@ if (vehicle _caller == _caller) then { case "ainvppnemstpslaywpstdnon_medic": {_lastAnim = "AinvPpneMstpSlayWpstDnon"}; case "ainvpknlmstpslaywpstdnon_medic": {_lastAnim = "AmovPknlMstpSrasWpstDnon"}; }; - [_caller, _lastAnim, 2] call EFUNC(common,doAnimation); }; _caller setVariable [QGVAR(treatmentPrevAnimCaller), nil]; private _weaponSelect = (_caller getVariable [QGVAR(selectedWeaponOnTreatment), []]); if ((_weaponSelect params [["_previousWeapon", ""]]) && {(_previousWeapon != "") && {_previousWeapon in (weapons _caller)}}) then { - for "_index" from 0 to 99 do { + for "_index" from 0 to 299 do { _caller action ["SwitchWeapon", _caller, _caller, _index]; //Just check weapon, muzzle and mode (ignore ammo in case they were reloading) if (((weaponState _caller) select [0,3]) isEqualTo (_weaponSelect select [0,3])) exitWith {TRACE_1("Restoring", (weaponState _caller));}; if ((weaponState _caller) isEqualTo ["","","","",0]) exitWith {ERROR("weaponState not found");}; }; } else { - _caller action ["SwitchWeapon", _caller, _caller, 99]; + _caller action ["SwitchWeapon", _caller, _caller, 299]; }; // Record specific callback diff --git a/addons/medical/functions/fnc_unconsciousPFH.sqf b/addons/medical/functions/fnc_unconsciousPFH.sqf index 37d54a2ad6..b9236883a3 100644 --- a/addons/medical/functions/fnc_unconsciousPFH.sqf +++ b/addons/medical/functions/fnc_unconsciousPFH.sqf @@ -3,7 +3,7 @@ * PFH logic for unconscious state * * Arguments: - * 0: PFEH - Args + * 0: PFEH - * 0: The unit that will be put in an unconscious state * 1: unitPos (stance) * 2: Starting Time @@ -12,14 +12,17 @@ * 5: Parachute Check * 1: PFEH ID * - * ReturnValue: + * Return Value: * None * + * Example: + * [[unit,"pos", 5, 5, true, false], 5], "classname"] call ace_medical_fnc_unconsciousPFH + * * Public: yes */ + #include "script_component.hpp" -private ["_unit", "_minWaitingTime", "_slotInfo", "_hasMovedOut", "_parachuteCheck", "_args", "_originalPos", "_startingTime", "_awakeInVehicleAnimation", "_oldVehicleAnimation", "_vehicle"]; params ["_args", "_idPFH"]; _args params ["_unit", "_originalPos", "_startingTime", "_minWaitingTime", "_hasMovedOut", "_parachuteCheck"]; @@ -64,9 +67,9 @@ if !(_unit getVariable ["ACE_isUnconscious",false]) exitWith { [_unit,"amovppnemstpsnonwnondnon", 2] call EFUNC(common,doAnimation); }; } else { - _vehicle = vehicle _unit; - _oldVehicleAnimation = _unit getVariable [QGVAR(vehicleAwakeAnim), []]; - _awakeInVehicleAnimation = ""; + private _vehicle = vehicle _unit; + private _oldVehicleAnimation = _unit getVariable [QGVAR(vehicleAwakeAnim), []]; + private _awakeInVehicleAnimation = ""; if (((count _oldVehicleAnimation) > 0) && {(_oldVehicleAnimation select 0) == _vehicle}) then { _awakeInVehicleAnimation = _oldVehicleAnimation select 1; }; @@ -76,7 +79,7 @@ if !(_unit getVariable ["ACE_isUnconscious",false]) exitWith { } else { //Don't have a valid animation saved, reset the unit animation with a moveInXXX TRACE_1("No Valid Animation, doing seat reset", _awakeInVehicleAnimation); - _slotInfo = []; + private _slotInfo = []; {if ((_x select 0) == _unit) exitWith {_slotInfo = _x;};} forEach (fullCrew _vehicle); if (_slotInfo isEqualTo []) exitWith {ERROR("No _slotInfo?");}; //Move the unit out: diff --git a/addons/medical/functions/fnc_useItem.sqf b/addons/medical/functions/fnc_useItem.sqf index 63b3f2a696..ec032a279f 100644 --- a/addons/medical/functions/fnc_useItem.sqf +++ b/addons/medical/functions/fnc_useItem.sqf @@ -7,10 +7,13 @@ * 1: Patient * 2: Item * - * ReturnValue: + * Return Value: * 0: success * 1: Unit * + * Example: + * [unit, patient, "bandage"] call ace_repair_fnc_useItem + * * Public: Yes */ diff --git a/addons/medical/functions/fnc_useItems.sqf b/addons/medical/functions/fnc_useItems.sqf index aac7b0623a..f898ea72f5 100644 --- a/addons/medical/functions/fnc_useItems.sqf +++ b/addons/medical/functions/fnc_useItems.sqf @@ -7,9 +7,12 @@ * 1: Patient * 2: Items > * - * ReturnValue: + * Return Value: * None * + * Example: + * [unit, patient, ["bandage"]] call ace_medical_fnc_useItems + * * Public: Yes */ diff --git a/addons/medical/functions/fnc_vitalLoop.sqf b/addons/medical/functions/fnc_vitalLoop.sqf index 6e5bb7fb2b..a9efa81719 100644 --- a/addons/medical/functions/fnc_vitalLoop.sqf +++ b/addons/medical/functions/fnc_vitalLoop.sqf @@ -6,9 +6,12 @@ * 0: The Unit * 1: Time of last computation * - * ReturnValue: + * Return Value: * None * + * Example: + * [bob, 5] call ACE_medical_fnc_vitalLoop + * * Public: No */ diff --git a/addons/medical/stringtable.xml b/addons/medical/stringtable.xml index 7a54167f12..64115cfbec 100644 --- a/addons/medical/stringtable.xml +++ b/addons/medical/stringtable.xml @@ -13,19 +13,25 @@ ZRANĚNÍ FERIMENTOS 負傷 + 부상 + 受伤 + 受傷 No injuries on this bodypart... Körperteil nicht verletzt... Non ci sono lesioni in questa parte del corpo... Данная часть тела не повреждена... - Aucune blessures sur cette partie du corps... + Aucune blessure ici... Brak obrażeń na tej części ciała... Sin heridas en esta parte del cuerpo... Ezen a testrészen nincs sérülés... Žádné zranění na této části těla... Nenhum ferimento nesta parte do corpo... 怪我をしていない + 이 부위에는 부상이 없습니다... + 此身体部位没有受伤 + 此身體部位沒有受傷 Litter Simulation Detail @@ -39,6 +45,9 @@ Detalhe da simulação de sujeira Počet zobrazených předmětů po použití zdravotnického materiálu 医療廃棄物を再現する詳細度 + 의료폐기물 재현 상세도 + 医疗废弃物模拟细节 + 醫療廢棄物模擬細節 Litter simulation detail level sets the number of litter items which will be locally spawned in the client. Excessive amounts in local areas could cause FPS lag, so this is a client only setting. @@ -52,18 +61,24 @@ O nível de detalhe de sujeira determina o número de itens que irão aparecer no cliente. Quantidades excessivas em áreas locais podem aumentar o lag do FPS, então esta é uma opção somente para o cliente. Počet zobrazených předmětů po použití zdravotnického materiálu ovlivňuje počet objektů, které budou zobrazeny klientovi v místě použití zdravotnického materiálu. Vyšší množství objektů může způsobovat poklesy FPS a proto je toto nastavení čistě na klientovi. 医療廃棄物再現度は各クライアントでローカルに作成される、医療廃棄物への詳細度を決定できます。ローカルで多くのアイテムがあると FPS の低下を引き起こすため、クライアント側のみの設定です。 + 의료폐기물 재현 상세도의 경우 얼마나 많은 수의 폐기물이 클라이언트 주변에 생성되는지를 정합니다. 매우 많은 수의 지역은 프레임드랍을 유발할 수 있습니다, 고로 이는 클라이언트 전용 설정입니다. + 设定医疗废弃物的最大产生数量,过多的数量会导致画面更新率延迟,因此这由用户端来设定。 + 設定醫療廢棄物的最大產生數量,過多的數量會導致畫面更新率延遲,因此這由用戶端來設定。 Inject Adenosine Adenosin injizieren Inyectar Adenosina Wstrzyknij adenozynę - Injecter de l'adénosine + Adénosine Inietta andenosina Aplikovat adenosine Injetar Adenosina Ввести аденозин アデノシンを投与 + 아데노신 주사 + 注射腺苷 + 注射腺苷 Inject Atropine @@ -71,12 +86,15 @@ Inyectar Atropina Aplikovat atropin Wstrzyknij atropinę - Injecter de l'atropine + Atropine Ввести атропин Atropin beadása Inietta atropina Injetar Atropina アトロピンを投与 + 아트로핀 주사 + 注射阿托品 + 注射阿托品 Inject Epinephrine @@ -84,12 +102,15 @@ Inyectar Epinefrina Wstrzyknij adrenalinę Aplikovat adrenalin - Injecter épinéphrine + Épinéphrine Ввести адреналин Epinefrin beadása Injetar Epinefrina Inietta adrenalina アドレナリンを投与 + 에피네프린 주사 + 注射肾上腺素 + 注射腎上腺素 Inject Morphine @@ -98,11 +119,14 @@ Wstrzyknij morfinę Aplikovat morfin Ввести морфин - Injecter morphine + Morphine Morfium beadása Injetar Morfina Inietta morfina モルヒネを投与 + 모르핀 주사 + 注射吗啡 + 注射嗎啡 Transfuse Blood @@ -111,11 +135,14 @@ Przetocz krew Transfúze krve Перелить кровь - Transfuser du sang + Transfuser (sang) Infúzió (vér) Transfundir Sangue Trasfusione di sangue 輸血する + 혈액 수혈 + 输血液 + 輸血液 Transfuse Plasma @@ -123,12 +150,15 @@ Transfundir plasma Transfúze plazmy Przetocz osocze - Transfuser du Plasma + Transfuser (plasma) Перелить плазму Infúzió (vérplazma) Trasfusione di plasma Transfundir Plasma 血しょうを投与 + 혈장 수혈 + 输血浆 + 輸血漿 Transfuse Saline @@ -136,12 +166,15 @@ Transfundir salino Transfúze fyziologického roztoku Przetocz sól fizjologiczną - Transfuser de la solution saline + Transfuser (saline) Перелить физраствор Infúzió (sós víz) Trasfusione di soluzione salina Transfundir Soro 生理食塩水を投与 + 생리식염수 수혈 + 注射生理食盐水 + 注射生理食鹽水 Apply Tourniquet @@ -149,12 +182,15 @@ Aplicar torniquete Aplikovat škrtidlo Załóż stazę - Appliquer un garrot + Poser garrot Наложить жгут Applica laccio emostatico Aplicar Torniquete Érszorító alkalmazása 止血帯を巻く + 지혈대 적용 + 使用军用止血带 + 使用軍用止血帶 Bandage @@ -168,6 +204,9 @@ Atadura Перевязать 包帯 + 붕대 + 绷带 + 繃帶 Bandage Head @@ -181,6 +220,9 @@ Atar Cabeça Benda la testa 包帯を頭へ + 머리에 붕대감기 + 绷带包扎 头部 + 繃帶包紮 頭部 Bandage Torso @@ -194,6 +236,9 @@ Atar Tronco Benda il torso 包帯を胴体へ + 몸통에 붕대감기 + 绷带包扎 身体 + 繃帶包紮 身體 Bandage Left Arm @@ -207,6 +252,9 @@ Atar Braço Esquerdo Benda il braccio sinistro 包帯を左腕に + 왼팔에 붕대감기 + 绷带包扎 左手 + 繃帶包紮 左手 Bandage Right Arm @@ -220,6 +268,9 @@ Atar Braço Direito Benda il braccio destro 包帯を右腕に + 오른팔에 붕대감기 + 绷带包扎 右手 + 繃帶包紮 右手 Bandage Left Leg @@ -233,6 +284,9 @@ Atar Perna Esquerda Benda la gamba sinistra 包帯を左足へ + 왼쪽 다리에 붕대감기 + 绷带包扎 左脚 + 繃帶包紮 左腳 Bandage Right Leg @@ -246,6 +300,9 @@ Atar Perna Direita Benda la gamba destra 包帯を右足へ + 오른쪽 다리에 붕대감기 + 绷带包扎 右脚 + 繃帶包紮 右腳 Injecting Morphine... @@ -254,11 +311,14 @@ Wstrzykiwanie morfiny... Aplikuji morfin... Введение морфина... - Injection de Morphine... + Injection (morphine)... Morfium beadása... Injetando Morfina... Inietto la morfina... モルヒネを投与中・・・ + 모르핀 주사중... + 吗啡注射中... + 嗎啡注射中... Injecting Epinephrine... @@ -267,23 +327,29 @@ Wstrzykiwanie adrenaliny... Aplikuji adrenalin... Введение адреналина... - Injection d'Adrénaline... + Injection (épinéphrine)... Epinefrin beadása... Injetando Epinefrina... Inietto l'adrenalina... アドレナリンを投与中・・・ + 에피네프린 주사중... + 肾上腺素注射中... + 腎上腺素注射中... Injecting Adenosine... Adenosin injizieren... Inyectando Adenosina... Wstrzykiwanie adenozyny... - Injection d'adénosine... + Injection (adénosine)... Inietto l'andenosina Aplikuji adenosine... Injetando Adenosina... Введение аденозина... アドネシンを投与中・・・ + 아데노신 주사중... + 腺苷注射中... + 腺苷注射中... Injecting Atropine... @@ -291,12 +357,15 @@ Inyectando Atropina... Aplikuji atropin... Wstrzykiwanie atropiny... - Injection d'Atropine... + Injection (atropine)... Введение атропина... Atropin beadása... Inietto l'atropina... Injetando Atropina アトロピンを投与中・・・ + 아트리핀 주사중... + 阿托品注射中 ... + 阿托品注射中 ... Transfusing Blood... @@ -305,11 +374,14 @@ Przetaczanie krwi... Probíhá transfúze krve... Переливание крови... - Transfusion Sanguine... + Transfusion (sang)... Infúzió vérrel... Transfundindo Sangue... Effettuo la trasfusione di sangue... 輸血中・・・ + 혈액 수혈중... + 输血液中 ... + 輸血液中 ... Transfusing Saline... @@ -317,12 +389,15 @@ Transfusión de salino... Probíha transfúze fyziologického roztoku... Przetaczanie soli fizjologicznej... - Transfusion de saline... + Transfusion (solution saline)... Переливание физраствора... Infúzió sós vizzel... Effettuo la rasfusione di soluzione salina Transfundindo Soro... - 血しょうを投与中・・・ + 生理食塩水を投与中・・・ + 생리식염수 수혈중... + 施打生理食盐水中 ... + 施打生理食鹽水中 ... Transfusing Plasma... @@ -330,12 +405,15 @@ Transfusión de plasma... Probíha transfúze plazmy... Przetaczanie osocza... - Transfusion de Plasma... + Transfusion (plasma)... Переливание плазмы... Infúzió vérplazmával... Effettu la trasfusione di plasma... Transfundindo Plasma... - 生理食塩水を投与中・・・ + 血しょうを投与中・・・ + 혈장 수혈중... + 输血浆中 ... + 輸血漿中 ... Bandaging... @@ -349,6 +427,9 @@ Atando... Перевязывание... 包帯を巻いています・・・ + 붕대감는중... + 绷带包扎中 ... + 繃帶包紮中 ... Applying Tourniquet... @@ -356,12 +437,15 @@ Aplicando torniquete... Aplikuji škrtidlo... Zakładanie stazy... - Mise en place du Garrot... + Pose du garrot... Наложение жгута... Érszorító felhelyezése... Sto applicando il laccio emostatico... Applicando Torniquete 止血帯を巻いています・・・ + 지혈대 적용중... + 使用军用止血带中 ... + 使用軍用止血帶中 ... Medical @@ -375,6 +459,9 @@ Médico Orvosi 治療 + 치료 + 医疗 + 醫療 Field Dressing @@ -383,11 +470,14 @@ Бинтовая повязка Obinadlo Bandaż jałowy - Bandage rapide + Pansement individuel Zárókötszer Bendaggio rapido Curativo de Campo - フィールド ドレッシング + 緊急圧迫包帯 + 필드 드레싱 + 基础绷带 + 基礎繃帶 Packing Bandage @@ -397,10 +487,13 @@ Bandaż uciskowy Nyomókötszer Bendaggio compressivo - Bandage gauze + Bande extensible Bandagem de Compressão Obvaz Tlakový - パッキング バンテージ + 弾性包帯 + 거즈 붕대 + 包扎绷带 + 包紮繃帶 Elastic Bandage @@ -409,11 +502,14 @@ Давящая повязка Obavaz Elastický Bandaż elastyczny - Pansement élastique + Bande compressive Rögzitő kötszer Bendaggio elastico Bandagem Elástica - エラスティック バンテージ + 伸縮包帯 + 압박 붕대 + 弹性绷带 + 彈性繃帶 QuikClot @@ -422,11 +518,14 @@ QuikClot Opatrunek QuikClot QuikClot - Hémostatique + Bandage hémostatique QuikClot QuikClot (polvere emostatica) QuikClot - クイック クロット + クイッククロット + 퀵 클롯 + 止血粉 + 止血粉 Check Pulse @@ -435,11 +534,14 @@ Проверить пульс Zkontrolovat puls Sprawdź tętno - Vérifier le pouls + Prendre le pouls Pulzus ellenőrzése Controlla il polso Checar Pulso 心拍数をはかる + 맥박 확인 + 检查脉搏 + 檢查脈搏 Check Blood Pressure @@ -448,11 +550,14 @@ Проверить давление Zkontrolovat krevní tlak Sprawdź ciśnienie krwi - Vérification de la tension + Prendre la tension Vérnyomás megmérése Controlla pressionsa sanguigna Chegar Pressão Sanguínea 血圧をはかる + 혈압 확인 + 检查血压 + 檢查血壓 Triage Card @@ -461,24 +566,30 @@ Медкарта Karta segregacyjna Štítek - Carte de triage + Fiche de triage Orvosi lap Triage Card Cartão de Triagem トリアージ カード + 부상자 분류 카드 + 检伤分类卡 + 檢傷分類卡 No entries on this triage card. Keine Einträge auf der Triagekarte Nessuna voce sulla Triage Card Нет записей. - Aucune entrée sur cette carte de triage + Fiche vide Brak wpisów w tej karcie segregacyjnej. Sin entradas en esta tarjeta de clasificación. Ez az orvosi lap nem tartalmaz bejegyzést. Žádné záznamy na tomto štítku Nenhuma entrada neste cartão de triagem トリアージ カードには何も無い + 부상자 분류 카드에 쓰여있는것이 없습니다. + 此检伤分类卡上没有任何资料 + 此檢傷分類卡上沒有任何資料 Tourniquet @@ -492,6 +603,9 @@ Laccio emostatico Torniquete 止血帯 + 지혈대 + 军用止血带 + 軍用止血帶 Remove Tourniquet @@ -500,11 +614,14 @@ Снять жгут Sundat škrtidlo Zdejmij stazę - Enlever le garrot + Enlever garrot Érszorító leszedése Rimuovi laccio emostatico Remover Torniquete 止血帯をはずす + 지혈대 제거 + 移除军用止血带 + 移除軍用止血帶 Diagnose @@ -518,6 +635,9 @@ Diagnóza Diagnosticar 診断する + 진단 + 诊断 + 診斷 Diagnosing... @@ -531,32 +651,41 @@ Diagnostika... Diagnosticando... 診断中・・・ + 진단중... + 诊断中... + 診斷中... CPR HLW RCP Сердечно-лёгочная реанимация - RPC + RCP RKO RCP Újraélesztés CPR SBV 心肺蘇生 + 심폐소생술 + 心肺复苏术 + 心肺復甦術 Performing CPR... HLW durchführen... Eseguendo RCP... Сердечно-лёгочная реанимация... - RPC en cours + RCP en cours Przeprowadzanie RKO... Realizando RCP... Újraélesztés folyamatban... Provádím CPR... Realizando o SBV... 心肺蘇生を実行中・・・ + 심폐소생중... + 进行心肺复苏术中... + 進行心肺復甦術中... Give Blood IV (1000ml) @@ -564,12 +693,15 @@ Dar Sangre IV (1000ml) Перелить пакет крови (1000 мл) Podaj krew IV (1000ml) - Administrer du sang en IV (1000ml) + Sang en IV (1000ml) Podat krev. transfúzi (1000ml) Vér adása intravénásan (1000ml) Effettua trasfusione sangue EV (1˙000ml) Administrar Sangue IV (1000ml) 血液 IV (1000ml) をあたえる + IV 혈액 수혈 (1000ml) + 输血液 (1000ml) + 輸血液 (1000ml) Give Blood IV (500ml) @@ -577,12 +709,15 @@ Dar Sangre IV (500ml) Перелить пакет крови (500 мл) Podaj krew IV (500ml) - Administrer du sang en IV (500ml) - Podat krev. transfúzi (500ml) + Sang en IV (500ml) + Podat krev. transfúzi (500ml) Vér adása intravénásan (500ml) Effettua trasfusione sangue EV (500ml) Administrar Sangue IV (500ml) 血液 IV (500ml) をあたえる + IV 혈액 수혈 (500ml) + 输血液 (500ml) + 輸血液 (500ml) Give Blood IV (250ml) @@ -590,12 +725,15 @@ Dar Sangre IV (250ml) Перелить пакет крови (250 мл) Podaj krew IV (250ml) - Administrer du sang en IV (250ml) + Sang en IV (250ml) Podat krev. transfúzi (250ml) Vér adása intravénásan (250ml) Effettua trasfusione sangue EV (250ml) Administrar Sangue IV (250ml) 血液 IV (250ml) をあたえる + IV 혈액 수혈 (250ml) + 输血液 (250ml) + 輸血液 (250ml) Give Plasma IV (1000ml) @@ -603,12 +741,15 @@ Dar Plasma IV (1000ml) Перелить пакет плазмы (1000 мл) Podaj osocze IV (1000ml) - Administrer du plasma en IV (1000ml) + Plasma en IV (1000ml) Podat plazmu (1000ml) Vérplazma adása intravénásan (1000ml) Effettua trasfusione plasma EV (1˙000ml) Administrar Plasma IV (1000ml) 血しょう IV (1000ml) をあたえる + IV 혈장 수혈 (1000ml) + 输血浆 (1000ml) + 輸血漿 (1000ml) Give Plasma IV (500ml) @@ -616,12 +757,15 @@ Dar Plasma IV (500ml) Перелить пакет плазмы (500 мл) Podaj osocze IV (500ml) - Administrer du plasma en IV (500ml) + Plasma en IV (500ml) Podat plazmu (500ml) Vérplazma adása intravénásan (500ml) Effettua trasfusione plasma EV (500ml) Administrar Plasma IV (500ml) 血しょう IV (500ml) をあたえる + IV 혈장 수혈 (500ml) + 输血浆 (500ml) + 輸血漿 (500ml) Give Plasma IV (250ml) @@ -629,12 +773,15 @@ Dar Plasma IV (250ml) Перелить пакет плазмы (250 мл) Podaj osocze IV (250ml) - Administrer du plasma en IV (250ml) + Plasma en IV (250ml) Podat plazmu (250ml) Vérplazma adása intravénásan (250ml) Effettua trasfusione plasma EV (250ml) Administrar Plasma IV (250ml) 血しょう IV (250ml) をあたえる + IV 혈장 수혈 (250ml) + 输血浆 (250ml) + 輸血漿 (250ml) Give Saline IV (1000ml) @@ -642,12 +789,15 @@ Dar Salino IV (1000ml) Перелить пакет физраствора (1000 мл) Podaj sól fizjologiczną IV (1000ml) - Administrer de la solution saline en IV (1000ml) + Solution saline en IV (1000ml) Podaz fyz. roztok (1000ml) Sós víz adása intravénásan (1000ml) Effettua trasfusione salina EV (1˙000ml) Administrar Soro IV (1000ml) - 血しょう IV (1000ml) をあたえる + 生理食塩水 IV (1000ml) をあたえる + IV 생리식염수 수혈 (1000ml) + 注射生理食盐水 (1000ml) + 注射生理食鹽水 (1000ml) Give Saline IV (500ml) @@ -655,12 +805,15 @@ Dar Salino IV (500ml) Перелить пакет физраствора (500 мл) Podaj sól fizjologiczną IV (500ml) - Administrer de la solution saline en IV (500ml) + Solution saline en IV (500ml) Podaz fyz. roztok (500ml) Sós víz adása intravénásan (500ml) Effettua trasfusione salina EV (500ml) Administrar Soro IV (500ml) - 血しょう IV (500ml) をあたえる + 生理食塩水 IV (500ml) をあたえる + IV 생리식염수 수혈 (500ml) + 注射生理食盐水 (500ml) + 注射生理食鹽水 (500ml) Give Saline IV (250ml) @@ -668,12 +821,15 @@ Dar Salino IV (250ml) Перелить пакет физраствора (250 мл) Podaj sól fizjologiczną IV (250ml) - Administrer de la solution saline en IV (250ml) + Solution saline en IV (250ml) Podaz fyz. roztok (250ml) Sós víz adása intravénásan (250ml) Effettua trasfusione salina EV (250ml) Administrar Soro IV (250ml) - 血しょう IV (250ml) をあたえる + 生理食塩水 IV (250ml) をあたえる + IV 생리식염수 수혈 (250ml) + 注射生理食盐水 (250ml) + 注射生理食鹽水 (250ml) Minor @@ -681,38 +837,47 @@ Menor Несрочная помощь Normalny - Mineur + Traitement en attente Minimální Enyhe Minore Leve 保留群 + 경미 + 轻微 + 輕微 Delayed Retrasado Срочная помощь Opóźniony - Différé + Traitement urgent Verzögert Odložitelný Késleltetett Differito Atrasado 待機的治療群 + 늦어짐 + 延后 + 延後 Immediate Inmediato Неотложная помощь Natychmiastowy - Urgence Immédiate + Traitement immédiat Sofort Okamžitý Azonnali Immediata Imediato 再優先治療群 + 긴급 + 紧急 + 緊急 Deceased @@ -726,19 +891,25 @@ Deceduto Falecido 死亡群 + 사망 + 死亡 + 死亡 None Ninguno Отсутствует Brak - Aucun + Pas de fiche Keine Nic Semmi Nessuna Nenhum なし + 없음 + 未分类 + 未分類 Normal breathing @@ -752,25 +923,31 @@ Respiro normale Respiração normal 通常の呼吸 + 정상 호흡 + 呼吸正常 + 呼吸正常 No breathing Keine Atmung Дыхание отсутствует No respira - Aucune respiration + Pas de respiration Brak oddechu Nedýchá Nincs légzés Mancanza di respiro Não respira 息をしていない + 호흡 불가 + 没有呼吸 + 沒有呼吸 Difficult breathing Дыхание затруднено Dificultad para respirar - Difficultée respiratoire + Difficulté respiratoire Trudności z oddychaniem Schwere Atmung Dýchá s obtížemi @@ -778,6 +955,9 @@ Difficoltà a respirare Dificuldade para respirar 呼吸が苦しそうだ + 호흡 곤란 + 呼吸困难 + 呼吸困難 Almost no breathing @@ -791,6 +971,9 @@ Respira a fatica Quase não respira ほとんど呼吸をしていない + 호흡이 없음 + 快要没呼吸 + 快要沒呼吸 Bleeding @@ -804,19 +987,25 @@ Sanguinando Sangrando 出血している + 출혈 + 流血中 + 流血中 - In Pain + In pain Hat Schmerzen Испытывает боль Con dolor - Ressent de la douleur + Douleur moyenne W bólu V bolestech Fájdalom alatt Con dolore Com dor 痛みがある + 고통 + 疼痛中 + 疼痛中 Lost a lot of Blood @@ -829,7 +1018,10 @@ Sok vért vesztett Ha perso parecchio sangue Perdeu muito sangue - 大量出血している + 大量失血している + 大量失血中 + 大量失血中 + 혈액 부족 Tourniquet [CAT] @@ -843,6 +1035,9 @@ Laccio emostatico [CAT] Torniquete [CAT] 止血帯 [CAT] + 지혈대 [CAT] + 军用止血带 + 軍用止血帶 Receiving IV [%1ml] @@ -850,25 +1045,31 @@ Recibiendo IV [%1ml] Принимается переливание [%1 мл] Otrzymywanie IV [pozostało %1ml] - Transfusion en IV [%1ml] + Transfusion : [%1ml] Přijímání transfúze [%1ml] Infúzióra kötve [%1ml] Ricevendo EV [%1ml] Recebendo IV [%1ml] - IV [%1ml] を投与されている + IV で [%1ml] 投与されている + 接收静脉注射液中 [%1ml] + 接收靜脈注射液中 [%1ml] + IV처리 [%1ml] 수혈중 Bandage (Basic) Bandage (Einfach) Повязка (обычная) Vendaje (Básico) - Bandage (Standard) + Pansement adhésif Bandaż (jałowy) Obvaz (Standartní) Kötszer (Általános) Bendaggio (base) Bandagem(Básico) - 包帯 (ベーシック) + 包帯 (緊急圧迫) + 붕대 (기본) + 基础绷带 + 基礎繃帶 Used to cover a wound @@ -882,45 +1083,57 @@ Usado para cobrir um ferimento Slouží k překrytí poranění 傷口をおおう + 상처를 덮을때 씁니다 + 用于覆盖伤口 + 用於覆蓋傷口 A dressing, that is a particular material used to cover a wound, which is applied over the wound once bleeding has been stemmed. Ein Verband, der aus einem besonderen Material besteht um die Wunde zu schützen, nachdem die Blutung gestoppt wurde. Повязка, накладываемая поверх раны после остановки кровотечения. Un apósito, material específico utilizado para cubrir una herida, se aplica sobre la herida una vez ha dejado de sangrar. - Bandage fait d'un matériel spécial utilisé pour couvrir une blessure, qui peut etre appliqué dès que le saignement a été stoppé. + Pansement utilisé pour couvrir une blessure lorsque le saignement a été stoppé. Opatrunek materiałowy, używany do przykrywania ran, zakładany na ranę po zatamowaniu krwawienia. Egy különleges anyagú kötszer sebek betakarására, amelyet a vérzés elállítása után helyeznek fel. Una benda apposita, utilizzata per coprire una ferita, la quale viene applicata su di essa una volta fermata l'emorragia. Uma curativo, material específico para cobrir um ferimento que é aplicado assim que o sangramento é estancando. Obvaz je vhodným způsobem upravený sterilní materiál, určený k překrytí rány, případně k fixaci poranění. - ドレッシングは、傷口を血液凝固剤でおおうようにできていて、つかうと出血の原因を取りさります。 + 緊急圧迫包帯は傷口を血液凝固剤でおおうようにできていて、つかうと出血の原因を取りさります。 + 드레싱, 출혈을 막고서 상처를 덮기위해 쓰는 물건입니다. + 用于覆盖伤口以防止出血,透过敷料的止血剂来让出血慢慢停止。 + 用於覆蓋傷口以防止出血,透過敷料的止血劑來讓出血慢慢停止。 Packing Bandage Mullbinde Тампонирующая повязка Vendaje compresivo - Bandage gauze + Bande extensible Bandaż (uciskowy) Nyomókötszer Bendaggio compressivo Bandagem de Compressão Obvaz (Tlakový) - パッキング バンテージ + 弾性包帯 + 거즈 붕대 + 包扎绷带 + 包紮繃帶 Used to pack medium to large wounds and stem the bleeding Wird verwendet, um mittlere bis große Wunden abzudecken und Blutungen zu stoppen Для тампонирования ран среднего и большого размера и остановки кровотечения. Se utiliza para vendar heridas medianas o grandes y detener el sangrado - Utilisé pour couvrir des blessures de taille moyenne à grande. Arrête l'hémorragie. + Utilisé pour couvrir des blessures moyennes et grandes, ralentit le saignement. Używany w celu opatrywania średnich i dużych ran oraz tamowania krwawienia. Dobrze radzi sobie z tamowaniem ran płatowych oraz postrzałowych. Közepestől nagyig terjedő sebek betakarására és vérzés elállítására használt kötszer Usato su ferite medie o larghe per fermare emorragie. Usado para o preenchimento de cavidades geradas por ferimentos médios e grandes e estancar o sangramento. Používá se k zastavení středních až silnějších krvácení - パッキングは粘着フィルム状で、普通から大きめなケガにつかい止血します。 + 弾性包帯は粘着フィルム状で、普通から大きめなケガにつかい止血します。 + 중형 또는 대형 상처를 채우고 출혈을 막기위해 쓰입니다 + 用于包扎中到大型伤口,并防止出血 + 用於包紮中到大型傷口,並防止出血 A bandage used to pack the wound to stem bleeding and facilitate wound healing. Packing a wound is an option in large polytrauma injuries. @@ -933,33 +1146,42 @@ Ein Verband, um die Wunde abzudecken und die Wundheilung zu fördern. Wunden abdecken ist eine Option bei größeren Polytraumen Uma bandagem usada para preencher o ferimento para estancar o sangramento e facilitar a cicatrização. Preenchimento de feridas é uma opção em ferimentos de politrauma grandes. Tlakový obvaz se skládá se ze sterilní krycí vrstvy, na kterou je přiložena silná vrstva savého materiálu stlačující cévu v ráně a která je přitlačována k ráně a připevněna obinadlem. Slouží k zastavení silnějších krvácení. - 包帯をつかうと出血の原因を取りのぞき、それを促進させます。また大きめな多発性外傷にたいしても使えます。 + 包帯をつかうと出血を防ぎ治療を促進させます。また大きめな多発性外傷にたいしても使えます。 + 출혈을 막고 상처를 치유하기 위한 붕대. 다발성외상의 경우 상처를 채우는것도 한 가지 방법입니다. + 用于包扎中到大型伤口,并防止出血,为在大型多处性伤口的选项之一! + 用於包紮中到大型傷口,並防止出血,為在大型多處性傷口的選項之一! Bandage (Elastic) Bandage (Elastisch) Повязка (давящая) Vendaje (Elástico) - Bandage (Élastique) + Bande compressive Bandaż (elastyczny) Obvaz (Elastický) Rögzító kötszer Benda (elastica) Bandagem (Elástica) - 包帯 (エラスティック) + 包帯 (伸縮) + 붕대 (압박) + 弹性绷带 + 彈性繃帶 Bandage kit, Elastic Elastische Binde (Kompressionsbinde) Давящая повязка Kit de vendaje (Elástico) - Bandage compressif élastique + Bande compressive Bandaż elastyczny służy do opatrywania ran ciętych oraz kłutych. Dobrze radzi sobie również ze zgniecieniami tkanek miękkich oraz rozerwaniami powierzchni skóry. Rugalmas kötszercsomag, "rögzítő" Kit di bendaggio, elastico Kit de Bandagem, Elástica Sada obvazů, Elastická - 包帯キット (エラスティック) + 包帯キット (伸縮) + 붕대, 압박 + 弹性绷带 + 彈性繃帶 Allows an even compression and extra support to the injured area. @@ -973,6 +1195,9 @@ Esta bandagem pode ser utilizada para comprimir o ferimento e diminuir o sangramento e garantir que o ferimento não abra em movimento. Hodí se k fixačním účelům a to i v oblastech kloubů. 負傷部分へ最大の対応と止血を続けられます。 + 부상 부위를 골고루 압박해주면서 동시에 고정시켜 줍니다. + 可对伤口持续压迫并固定以防止伤口情况变严重 + 可對傷口持續壓迫並固定以防止傷口情況變嚴重 Tourniquet (CAT) @@ -986,25 +1211,31 @@ Laccio emostatico (CAT) Torniquete (CAT) 止血帯 (CAT) + 지혈대 [CAT] + 军用止血带 + 軍用止血帶 Slows down blood loss when bleeding Замедляет кровопотерю при кровотечении Reduce la velocidad de pérdida de sangre - Ralentit le saignement + Ralentit l'hémorragie Zmniejsza ubytek krwi z kończyn w przypadku krwawienia. Nie może być noszony zbyt długo ze względu na narastający ból z kończyny. Verringert den Blutverlust Lelassítja a vérvesztést vérzés esetén Rallenta la perdita di sangue in caso di sanguinamento Reduz a velocidade da perda de sangue Zpomaluje ztráty krve při krvácení - 出血しているときに、流れ出る量をへらします。 + 出血しているときに、失血量をおさえます。 + 출혈 시 혈액손실을 늦춰줍니다 + 减缓失血的速度 + 減緩失血的速度 A constricting device used to compress venous and arterial circulation in effect inhibiting or slowing blood flow and therefore decreasing loss of blood. Жгут используется для прижатия сосудов к костным выступам, которое приводит к остановке или значительному уменьшению кровотечения Dispositivo utilizado para eliminar el pulso distal y de ese modo controlar la pérdida de sangre - Un dispositif permettant de compresser les artères et veines afin de réduire la perte de sang. + Un dispositif permettant de compresser les artères et veines afin de ralentir l'hémorragie. Opaska uciskowa CAT służy do tamowanie krwotoków w sytuacji zranienia kończyn z masywnym krwawieniem tętniczym lub żylnym. Ein Hilfsmittel, das Druck auf Venen und Arterien ausübt und so den Blutfluss verringert. Egy szűkítőeszköz, mely a vénás és artériás nyomás keringés helyi összenyomására szolgál, ezzel lelassítva vagy megállítva az adott területen a vérkeringést. Ez csökkenti a vérvesztés mértékét. @@ -1012,19 +1243,25 @@ A aparelho que comprime as artérias e veias para diminuir a perda de sangue. Zařízení používané ke stlačení venózního a arteriálního oběhu. V důsledku dochází ke zpomalení toku krve a tedy i snížení ztrát krve. 止血帯は静脈や動脈へ圧力をかけ、循環を遅らせることで血液の流れをおそくし、失血を防ぎます。 + 정맥과 동맥을 압축시키켜 혈액순환을 억제 혹은 늦추게하여 혈액손실을 줄이는 도구입니다. + 用于压迫静脉与动脉的血液流动,达到减缓失血速度的目的。 + 用於壓迫靜脈與動脈的血液流動,達到減緩失血速度的目的。 Morphine autoinjector Morphium-Autoinjektor Морфин в пневмошприце Morfina auto-inyectable - Auto-injecteur de Morphine + Auto-injecteur de morphine Autostrzykawka z morfiną Auto-morfin Morfium autoinjektor Autoiniettore di morfina Auto-injetor de morfina - モルヒネ + モルヒネ注射器 + 모르핀 자동주사기 + 吗啡自动注射器 + 嗎啡自動注射器 Used to combat moderate to severe pain experiences @@ -1038,6 +1275,9 @@ Usado para combater dores moderadas e severas Slouží k tlumení středně těžkých a těžkých bolestí 戦闘が収まったとき、痛みにたいしてつかいます。 + 심한 통증을 완화하는데 쓰입니다 + 减低中度至重度的疼痛感 + 減低中度至重度的疼痛感 An analgesic used to combat moderate to severe pain experiences. @@ -1051,55 +1291,70 @@ Um analgésico usado para combater dores moderadas e fortes. Analgetikum slouží k tlumení středně těžkých a těžkých bolestí 戦闘が収まったとき、モルヒネを痛みにたいしてつかいます。 + 심한 통증을 완화하기 위해 쓰이는 진통제입니다. + 止痛药的一种,用于减低中度至重度的疼痛感。 + 止痛藥的一種,用於減低中度至重度的疼痛感。 Adenosine autoinjector Adenosin-Autoinjektor Asenosina auto-inyectable Autostrzykawka z adenozyną - Auto-injécteur d'adénosine + Auto-injecteur d'adénosine Autoiniettore di adenosina Auto-adenosine Auto-injetor de Adenosina Аденозин в пневмошприце - アデノシン + アデノシン注射器 + 아데노신 자동주사기 + 腺苷自动注射器 + 腺苷自動注射器 Used to counter effects of Epinephrine Wird verwendet um die Symptome von Epiniphrin zu lindern Utilizada para contrarrestar los effectos de la Epinefrina Adenozyna. Stosowana do zwalczania efektów działania adrenaliny. - Utilisé pour contrer les effets de l'adrénaline + Utilisé pour contrer les effets de l'épinéphrine Usato per contrastare l'effetto dell'epinefrina Slouží jako protiváha Adrenalinu Usado para combater os efeitos da Epinefrina Используется для купирования эффектов адреналина アドレナリンの反対の効果としてつかいます。 + 에피네프린 대응책으로 쓰입니다 + 用来对付肾上腺素的影响 + 用來對付腎上腺素的影響 A drug used to counter the effects of Epinephrine Ein Medikament, das die Symptome von Epiniphrin bekämpft. Medicamento usado para contrarrestar los efectos de la Epinefrina. Organiczny związek chemiczny z grupy nukleozydów. Skuteczna w leczeniu częstoskurczu komorowego. Działa rozszerzająco na naczynia krwionośne. - Un composé utilisé pour contrer les effets de l'adrénaline + Un composé utilisé pour contrer les effets de l'épinéphrine Medicamento usato per contrastare l'effetto dell'epinefrina Droga používaná k tlumení efektu Adrenalinu Uma droga usada para combater os efeitos da Epinefrina Препарат используется для купирования эффектов адреналина つかうと、アドレナリンと反対の効果がでます。 + 에피네프린에 대응용으로 쓰이는 약품 + 一种药物用于减低肾上腺素的效果 + 一種藥物用於減低腎上腺素的效果 Atropine autoinjector Атропин в пневмошприце Atropina auto-inyectable - Auto-injecteur d'Atropine + Auto-injecteur d'atropine Autostrzykawka AtroPen Atropin-Autoinjektor Auto-atropine Atropin autoinjektor Autoiniettore di atropina Auto-injetor de Atropina - アトロピン + アトロピン注射器 + 아트로핀 자동주사기 + 阿托品自动注射器 + 阿托品自動注射器 Used in NBC scenarios @@ -1112,7 +1367,10 @@ Usato in situazioni con gas nervino. Usado em casos de ataque QBRN Používá se v přítomnosti nervových plynů - 核・生物・化学兵器がつかわれている条件下にてつかいます。 + 核・生物・化学兵器によ汚染環境下にてつかいます。 + 핵,생물,화학 상황에 쓰입니다 + 使用于核生化污染的情况 + 使用於核生化汙染的情況 A drug used by the Military in NBC scenarios. @@ -1126,6 +1384,9 @@ Uma droga usada por militares em casos de ataque QBRN. Atropin slouží jako protijed na otravu organofosfátovými insekticidy (diazinon) a nervovými plyny. 核・生物・化学兵器がつかわれている条件下にてつかいます。 + 핵,생물,화학 상황에 쓰이는 군용 약품 + 军用神经解毒针,用来应付核生化污染的情况。 + 軍用神經解毒針,用來應付核生化汙染的情況。 Epinephrine autoinjector @@ -1138,7 +1399,10 @@ Epinefrin autoinjektor Autoiniettore di adrenalina Auto-injetor de epinefrina - アドレナリン + アドレナリン注射器 + 에피네프린 자동주사기 + 肾上腺素自动注射器 + 腎上腺素自動注射器 Increase heart rate and counter effects given by allergic reactions @@ -1152,6 +1416,9 @@ Aumenta a frequência cardíaca e combate efeitos causados por reações alérgicas Zvyšuje srdeční frekvenci a chrání před alergickými reakcemi 心拍数を増加させたり、アレルギー反応を収める効果もあります。 + 심박수를 높이며 알러지반응의 대응책입니다 + 增加心跳速率的一种药物 + 增加心跳速率的一種藥物 A drug that works on a sympathetic response to dilate the bronchi, increase heart rate and counter such effects given by allergic reactions (anaphylaxis). Used in sudden cardiac arrest scenarios with decreasing positive outcomes. @@ -1165,77 +1432,95 @@ Egy hormon, mely a szimpatikus idegrendszer által kitágítja a hörgőket, valamint megnöveli a szívverést, ezzel ellensúlyozva ilyen jellegű allergiás reakciókat (anafilaxiás sokk). Hirtelen szívmegállás esetén is használt, idő alatt csökkenő hatásfokkal. Zúžení periferních cév díky působení na alfa receptory a následné kontrakci hladkých svalů, tím dochází k tzv. centralizaci oběhu, krev se soustřeďuje v životně důležitých centrálních orgánech (srdce, mozek, plíce), působí také pozitivně na srdeční činnost a dochází ke zvýšení krevního tlaku a tepu. Dále se používá při náhlé srdeční zástavě. 薬は気管支を拡張するよう交感神経を拡張させ、心拍数を増加させます。それにアレルギー反応を収める効果もあります(アナフィラキシー ショック)。得られる効果は少ないですが、心停止している場合などにつかわれます。 + 기관지를 확장시키는 교감 신경 반응을 이끌어내는 약물로써, 심박을 높이고 알러지 효과에 대응합니다(아나필락시스). 심폐가 정지하는 경우 호전이 되지않을때 사용합니다. + 俗称强心针,为一种支气管扩张药物,会增加心跳速率并减缓过敏反应(过敏性休克),在心跳骤停时有恢复心跳的效果! + 俗稱強心針,為一種支氣管擴張藥物,會增加心跳速率並減緩過敏反應(過敏性休克),在心跳驟停時有恢復心跳的效果! Plasma IV (1000ml) Плазма для в/в вливания (1000 мл) Plasma IV (1000ml) - Plasma Sanguin IV (1000ml) + Plasma IV (1000ml) Osocze IV (1000ml) Plasma IV (1000ml) Vérplazma-infúzió (1000ml) Plasma EV (1000ml) Plasma IV (1000ml) Krevní plazma (1000ml) - 生理食塩水 IV (1000ml) + 血しょう IV (1000ml) + 혈장 IV (250ml) + 血浆 (1000ml) + 血漿 (1000ml) A volume-expanding blood supplement. Дополнительный препарат, применяемый при возмещении объема крови. Suplemento para expandir el volumen sanguíneo. - Supplément visant à remplacer les volumes sanguin + Supplément sanguin visant à remplacer les volumes perdus. Składnik krwi, używany do zwiększenia jej objętości. Egy térfogatnövelő vérkiegészítmény. Aiuta ad aumentare il volume sanguigno. Volumenerweiterungsmittel (künstliches Blutvolumen) Suplemento para expandir o volume sanguíneo. - Intravenózně podávaný doplněk k zvětšení objemu krve + Intravenózně podávaný doplněk k zvětšení objemu krve 血液量を増加させる補助です。 + 혈액량을 늘리기위한 보조수단 입니다. + 可快速得到血液补充 + 可快速得到血液補充 A volume-expanding blood supplement. Дополнительный препарат, применяемый при возмещении объема крови. Suplemento para expandir el volumen sanguíneo. - Supplément visant à remplacer le volume sanguin et remplace les plaquettes. + Supplément visant à remplacer le volume sanguin perdu et remplace les plaquettes. Składnik krwi, używany do zwiększenia jej objętości. Egy térfogatnövelő vérkiegészítmény. Aiuta ad aumentare il volume sanguigno. Volumenerweiterungsmittel (künstliches Blutvolumen) Suplemento para expandir o volume sanguíneo. - Intravenózně podávaný doplněk k zvětšení objemu krve + Intravenózně podávaný doplněk k zvětšení objemu krve 血液量を増加させる補助です。 + 혈액량을 늘리기위한 보조수단 입니다. + 可快速得到血液补充 + 可快速得到血液補充 Plasma IV (500ml) Плазма для в/в вливания (500 мл) Plasma IV (500ml) - Plasma sanguin IV (500ml) + Plasma IV (500ml) Osocze IV (500ml) Plasma IV (500ml) Vérplazma-infúzió (500ml) Plasma EV (500ml) Plasma IV (500ml) Krevní plazma (500ml) - 生理食塩水 IV (500ml) + 血しょう IV (500ml) + 혈장 IV (500ml) + 血浆 (500ml) + 血漿 (500ml) Plasma IV (250ml) Плазма для в/в вливания (250 мл) Plasma IV (250ml) - Plasma sanguin (250ml) + Plasma (250ml) Osocze IV (250ml) Plasma IV (250ml) Vérplazma-infúzió (250ml) Plasma EV (250ml) Plasma IV (250ml) Krevní plazma (250ml) - 生理食塩水 IV (250ml) + 血しょう IV (250ml) + 혈장 IV (250ml) + 血浆 (250ml) + 血漿 (250ml) Blood IV (1000ml) Кровь для переливания (1000 мл) Sangre IV (1000ml) - Cullot sanguin IV (1000ml) + Culot sanguin IV (1000ml) Krew IV (1000ml) Blut IV (1000ml) Vér-infúzió (1000ml) @@ -1243,19 +1528,25 @@ Sangue IV (1000ml) Krevní transfúze (1000ml) 血液 IV (1000ml) + 혈액 IV (1000ml) + 血液 (1000ml) + 血液 (1000ml) Blood IV, for restoring a patients blood (keep cold) Пакет крови для возмещения объёма потерянной крови (хранить в холодильнике) Sangre intravenosa, para restarurar el volumen sanguíneo (mantener frío) - Cullot sanguin O-, utilisé seulement lors de perte sanguine majeure afin de remplacer le volume sanguin perdu. Habituelment utilisé lors du transport ou dans un etablisement de soins. + Culot sanguin O-, utilisé seulement lors de perte sanguine majeure afin de remplacer le volume sanguin perdu. Habituellement utilisé lors du transport ou dans un établissement de soins. Krew IV, używana do uzupełnienia krwi u pacjenta, trzymać w warunkach chłodniczych. Vér-infúzió, intravénás bejuttatásra egy páciensnek (hidegen tárolandó) Sangue usato per ripristinare pazienti in cui si è verificata una perdita di sangue (conservare al fresco) Blut IV, Bluthaushalt des Patienten wiederherstellen. (Kühl halten) Sangue intravenoso, para restaurar o volume sanguinio do paciente.(Manter frio) Krevní transfuze pro doplnění pacientovi krve (skladujte v chladu) - 血液 IV は、患者へ血液を補給します。(要低温保存) + 血液 IV は、患者へ血液を補給します。(要低温保存) + 혈액 IV, 환자에게 혈액을 공급합니다. (차갑게 할것) + 血液,用于补充伤者流失的血液 (需冷藏) + 血液,用於補充傷者流失的血液 (需冷藏) O Negative infusion blood used in strict and rare events to replenish blood supply usually conducted in the transport phase of medical care. @@ -1263,18 +1554,21 @@ Krew 0 Rh-, używana w rzadkich i szczególnych przypadkach do uzupełnienia krwi u pacjenta, zazwyczaj w trakcie fazie transportu rannej osoby do szpitala. Utilice sólo durante gran pérdida de sangre para reemplazar el volumen de sangre perdida. Uso habitual durante el transporte de heridos. Sangue 0 negativo usato per ripristinare sangue in pazienti in cui si è verificata una perdita di sangue. - Cullot sanguin O- utilisé dans de rares et stricts cas pour compléter une perte de sang importante. Administré normalement lors d'un MEDEVAC. + Culot sanguin O- utilisé dans de rares et stricts cas pour compléter une perte de sang importante. Administré normalement lors d'un MEDEVAC. O Negative Blutinfusion wird nur in seltenen Fällen verwendet, um den Bluthaushalt des Patienten zu ergänzen. Wird in der Regel wärend der Transportphase durchgeführt. - Sangue O- , utilizado em casos raros para rapidamente repor o sangue. Uso habitual ocorre durante o transporte ou em estações de tratamento. + Sangue O- , utilizado em casos raros para rapidamente repor o sangue. Uso habitual ocorre durante o transporte ou em estações de tratamento. Nullás vércsoportú, Rh-negatív vér-infúzió, melyet kritikus és ritka helyzetekben vérutánpótlásra használnak, jellemzően az orvosi ellátás szállítási fázisa közben. 0 Rh negativní krev se používá v vzácných případech k doplnění pacientovy hladiny krve, obvykle při převozu zraněné osoby do nemocnice. O 型への輸血はまれで厳格であり、通常は治療のための輸送段階で輸血をおこないます。 + O- 형 혈액 투여는 매우 엄격하고 드문 혈액보급의 경우에 쓰이는데 주로 치료의 운송단계에서 사용됩니다. + O型负值注射用血液,在紧急情况时使用,用于补充伤者流失的血液。 + O型負值注射用血液,在緊急情況時使用,用於補充傷者流失的血液。 Blood IV (500ml) Кровь для переливания (500 мл) Sangre IV (500ml) - Cullot sanguin IV (500ml) + Culot sanguin IV (500ml) Krew IV (500ml) Blut IV (500ml) Vér-infúzió (500ml) @@ -1282,12 +1576,15 @@ Sangue IV (500ml) Krevní transfúze (500ml) 血液 IV (500ml) + 혈액 IV (500ml) + 血液 (500ml) + 血液 (500ml) Blood IV (250ml) Кровь для переливания (250 мл) Sangre IV (250ml) - Cullot sanguin IV (250ml) + Culot sanguin IV (250ml) Krew IV (250ml) Blut IV (250ml) Vér-infúzió (250ml) @@ -1295,12 +1592,15 @@ Sangue IV (250ml) Krevní transfúze (250ml) 血液 IV (250ml) + 혈액 IV (250ml) + 血液 (250ml) + 血液 (250ml) Saline IV (1000ml) Физраствор для в/в вливания (1000 мл) Salino IV (1000ml) - Solution saline 0.9% IV (1000ml) + Solution saline IV (1000ml) Sól fizjologiczna IV (1000ml) Kochsalzlösung (1000ml) 0,9%-os sósvíz-infúzió (1000ml) @@ -1308,12 +1608,15 @@ Soro IV (1000ml) Fyziologický roztok (1000ml) 生理食塩水 IV (1000ml) + 생리식염수 IV (1000ml) + 生理食盐水 (1000ml) + 生理食鹽水 (1000ml) Saline IV, for restoring a patients blood Пакет физраствора для возмещения объёма потерянной крови Solución salina intravenosa, para restaurar el volumen sanguíneo - Solution saline 0.9% IV, pour rétablir temporairement la tension artérielle + Solution saline, pour rétablir temporairement la tension artérielle Używany w medycynie w formie płynu infuzyjnego jako środek nawadniający i uzupełniający niedobór elektrolitów, podawany dożylnie (IV). 0,9%-os sósvíz-infúzió, a páciens vérmennyiségének helyreállítására Soluzione salina, usata per ripristinare sangue nei pazienti. @@ -1321,6 +1624,9 @@ Solução Salina Intravenosa 0.9%, para restaurar o volume de sangue temporariamente. Fyziologický roztok se aplikuje intravenózně a slouží k obnově pacientovi krve 生理食塩水 IV は、患者の血液量を補助します + 생리식염수, 환자의 혈액량을 보충할때 쓰입니다 + 生理食盐水,用于恢复伤者血液 + 生理食鹽水,用於恢復傷者血液 A medical volume-replenishing agent introduced into the blood system through an IV infusion. @@ -1330,16 +1636,19 @@ Używany w medycynie w formie płynu infuzyjnego jako środek nawadniający i uzupełniający niedobór elektrolitów, podawany dożylnie (IV). Egy orvosi térfogat-helyreállító készítmény, melyet intravénás módon lehet a szervezetbe juttatni. Una soluzione medica per ripristinare il volume del sangue introdotta tramite trasfusione EV. - Ein medizinisches Volumenersatzmittel, dass durch einen intravenösen Zugang in den Blutkreislauf verabreicht wird. - Uma reposição temporaria para restaurar a pressão arterial perdida por perda de sangue. + Ein medizinisches Volumenersatzmittel, dass durch einen intravenösen Zugang in den Blutkreislauf verabreicht wird. + Uma reposição temporaria para restaurar a pressão arterial perdida por perda de sangue. Fyziologický roztok se využívá nejčastěji jako infuze při dehydrataci organismu. 生理食塩水 IV を静脈へ投与し、血液量を増加させることができます。 + 혈류에 IV로 투여되는 의료 용적 대체 요법 + 利用静脉注射进入人体血液系统,帮助伤者血液恢复。 + 利用靜脈注射進入人體血液系統,幫助傷者血液恢復。 Saline IV (500ml) Физраствор для в/в вливания (500 мл) Salino IV (500ml) - Solution saline 0.9% IV (500ml) + Solution saline IV (500ml) Sól fizjologiczna IV (500ml) Kochsalzlösung (500ml) 0,9%-os sósvíz-infúzió (500ml) @@ -1347,12 +1656,15 @@ Soro IV (1000ml) Fyziologický roztok (500ml) 生理食塩水 IV (500ml) + 생리식염수 IV (500ml) + 生理食盐水 (500ml) + 生理食鹽水 (500ml) Saline IV (250ml) Физраствор для в/в вливания (250 мл) Salino IV (250ml) - Solution saline 0.9% IV (250ml) + Solution saline IV (250ml) Sól fizjologiczna IV (250ml) Kochsalzlösung (250ml) 0,9%-os sósvíz-infúzió (250ml) @@ -1360,6 +1672,9 @@ Soro IV (1000ml) Fyziologický roztok (250ml) 生理食塩水 IV (250ml) + 생리식염수 IV (250ml) + 生理食盐水 (250ml) + 生理食鹽水 (250ml) Basic Field Dressing (QuikClot) @@ -1372,7 +1687,10 @@ Bendaggio emostatico (QuikClot) Bandagem básica (Coagulante) Hemostatický obvaz (QuikClot) - ベーシック フィールド ドレッシング(クイック クロット) + 緊急圧迫止血包帯 (クイッククロット) + 필드 드레싱 (퀵 클롯) + 基本战地包扎 (止血粉) + 基本戰地包紮 (止血粉) QuikClot bandage @@ -1385,7 +1703,10 @@ Bendaggio emostatico (QuikClot) Bandagem com agente coagulante Hemostatický obvaz (QuikClot) - クイック クロット + クイッククロット包帯 + 퀵 클롯 붕대 + 止血粉绷带 + 止血粉繃帶 Hemostatic bandage with coagulant that stops bleeding. @@ -1396,14 +1717,17 @@ Verband mit Gerinnungsmittel, um starke Blutung zu behandeln. Hemostatikus kötszer egy vérzésgátló anyaggal. Bendaggio emostatico con coagulante che permette di arrestare perdite di sangue - Bandagem Hemostática com coagulante que controla hemorragia médias e grandes com risco de vida. + Bandagem Hemostática com coagulante que controla hemorragia médias e grandes com risco de vida. Hemostatický obvaz určený k zástavě krvácení 血液凝固剤をふくむ包帯により、止血できます。 + 지혈시 사용하는 붕대로 혈액 응고제를 포함하고있습니다. + 包含止血粉成分的止血绷带,可用于止血。 + 包含止血粉成分的止血繃帶,可用於止血。 Personal Aid Kit Аптечка - Trousse de premiers soins + Trousse sanitaire Equipo de primeros auxilios Apteczka osobista Persönliches Erste-Hilfe-Set @@ -1412,38 +1736,47 @@ Kit De Primeiros Socorros Pessoal Osobní lékárnička (PAK) 応急処置キット + 개인응급키트 + 个人急救包 + 個人急救包 Includes various treatment kit needed for stitching or advanced treatment Содержит различные материалы и инструменты для зашивания ран и оказания специальной медпомощи. Incluye material médico para tratamientos avanzados - Inclue du matériel medical pour les traitements avancés, tel les points de suture. + Inclut du matériel medical pour les traitements délicats, tel les points de suture. Zestaw środków medycznych do opatrywania ran i dodatkowego leczenia po-urazowego. Beinhaltet medizinisches Material für fortgeschrittene Behandlung und zum Nähen. Változatos segédfelszereléseket tartalmaz sebvarráshoz és haladó elsősegélynyújtáshoz Include vario materiale medico per trattamenti avanzati. Inclui vários tratamentos materiais para custura e tratamento avançado - Osobní lékárnička obsahuje zdravotnický materiál umožňující šití a pokročilejší ošetřování raněných + Osobní lékárnička obsahuje zdravotnický materiál umožňující šití a pokročilejší ošetřování raněných 縫合や高度な処置に必要とされる、さまざまな治療器具が含まれています。 + 봉합및 고급 조치에 필요한 다양한 치료 도구가 있습니다. + 包含各种医疗套件,以及进阶伤口系统需要的缝合用品 + 包含各種醫療套件,以及進階傷口系統需要的縫合用品 Personal Aid Kit for in field stitching or advanced treatment W znacznym stopniu poprawia stan pacjenta Полевая аптчека для продвинутого лечения и зашивания ран Persönliches Erste-Hilfe-Set zum ambulanten Nähen und fortgeschrittener Behandlung. - Trousse de premiers soins pour coudre sur le terrain et traitements avancés. + Inclut du matériel medical pour les traitements délicats, tel les points de suture. Equipo de primeros auxilios para sutura de campaña o tratamientos avanzados Elsősegélycsomag, terepen való sebvarráshoz és haladó ellátáshoz Kit de primeiros socorros para sutura ou tratamentos avançados - Osobní lékárnička obsahuje zdravotnický materiál umožňující šití a pokročilejší ošetřování raněných v poli + Osobní lékárnička obsahuje zdravotnický materiál umožňující šití a pokročilejší ošetřování raněných v poli Pronto soccorso personale da campo per mettersi i punti o per trattamenti avanzati. 戦場で縫合や高度な処置に必要とされる、さまざまな治療器具が含まれています。 + 야전에서 봉합및 고급 조치를 위한 개인응급키트 + 个人急救包可用于战地缝合手术或进阶伤口系统使用 + 個人急救包可用於戰地縫合手術或進階傷口系統使用 Use Personal Aid Kit Erste-Hilfe-Set benutzen Использовать аптечку - Utiliser la Trousse de premier soins + Utiliser la trousse sanitaire Użyj apteczki osobistej Usar equipo de primeros auxilios Elsősegélycsomag használata @@ -1451,6 +1784,9 @@ Použít osobní lékárničku (PAK) Usa il pronto soccorso personale 応急処置キットをつかう + 개인 응급 키트사용하기 + 使用个人急救包 + 使用個人急救包 Surgical Kit @@ -1464,6 +1800,9 @@ Kit Cirurgico Chirurgická sada 縫合キット + 봉합 키트 + 手术包 + 手術包 Surgical Kit for in field advanced medical treatment @@ -1477,6 +1816,9 @@ Kit Cirurgico para uso de tratamento médico avançado em campo Chirurgická sada určená k pokročilejším zdravotnickým zákrokům v poli 縫合キットは戦場で高度な処置をするためにつかわれます。 + 야전 상황에서 고급 의료 처치를 위해 사용되는 봉합 키트 + 用于在战场上为伤口进行缝合(需要开启进阶伤口系统) + 用於在戰場上為傷口進行縫合(需要開啟進階傷口系統) Surgical Kit for in field advanced medical treatment @@ -1490,6 +1832,9 @@ Kit Cirurgico para uso de tratamento médico avançado em campo. Chirurgická sada určená k pokročilejším zdravotnickým zákrokům v poli 縫合キットは戦場で高度な処置をするためにつかわれます。 + 야전 상황에서 고급 의료 처치를 위해 사용되는 봉합 키트 + 用于在战场上为伤口进行缝合(需要开启进阶伤口系统) + 用於在戰場上為傷口進行縫合(需要開啟進階傷口系統) Use Surgical Kit @@ -1503,6 +1848,9 @@ Použít chirurgickou sadu Usar kit cirúrgico 縫合キットをつかう + 봉합키트 사용하기 + 使用手术包 + 使用手術包 Bodybag @@ -1516,6 +1864,9 @@ Saco para cadáver Pytel na mrtvoly 死体袋 + 尸袋 + 屍袋 + 시체 운반 가방 A bodybag for dead bodies @@ -1529,6 +1880,9 @@ Um saco para corpos mortos Pytel na mrtvoly 死体袋は死体を入れるためにつかいます + 시체를 운반할때 쓰는 가방입니다 + 用来装尸体用 + 用來裝屍體用 A bodybag for dead bodies @@ -1542,6 +1896,9 @@ Um saco para corpos mortos. Pytel na mrtvoly 死体袋は死体を入れるためにつかいます + 시체를 운반할때 쓰는 가방입니다 + 用来装尸体用 + 用來裝屍體用 Blood Pressure @@ -1555,10 +1912,13 @@ Pressão Arterial Krevní tlak 血圧を測る + 혈압 + 血压 + 血壓 Checking Blood Pressure.. - Mesure de la tension... + Prise de la tension... Проверка артериального давления... Comprobando presión arterial... Sprawdzanie ciśnienia krwi... @@ -1568,23 +1928,29 @@ Aferindo Pressão Arterial... Měřím krevní tlak... 血圧を測定中・・・ + 혈압 측정증... + 检查血压中... + 檢查血壓中... %1 checked Blood Pressure: %2 %1 kontrollierte Blutdruck: %2 %1 controllata pressione sanguigna: %2 %1 проверил артериальное давление: %2 - %1 à vérifié la tension: %2 + %1 a mesuré la tension: %2 %1 sprawdził ciśnienie krwi: %2 %1 verificada la presión arterial: %2 %1 ellenőrizte a vérnyomást: %2 %1 zkontroloval krevní tlak: %2 %1 verificou pressão arterial: %2 %1 が測った血圧は: %2 + %1 (이)가 혈압을 측정했습니다: %2 + 已由%1确认血压: %2 + 已由%1確認血壓: %2 You checked %1 - Vous diagnostiquez %1 + Vous examinez %1 Вы осмотрели раненого %1 Examinando a %1 Zbadałeś %1 @@ -1594,10 +1960,13 @@ Você verificou o paciente %1 Zkontroloval jsi %1 自分の血圧は %1 + 나의 혈압은 %1 이다 + 你已经检查 %1 + 你已經檢查 %1 You find a blood pressure of %2/%3 - Vous avez trouvé une tension de %2/%3 + Vous avez mesuré une tension de %2/%3 Артериальное давление %2/%3 La Presión Arterial es %2/%3 A vérnyomás %2/%3 @@ -1607,6 +1976,9 @@ A Pressão Arterial é de %2/%3 Naměřil si krevní tlak u %2/%3 血圧は %2/%3 + 혈압이 %2/%3 이다 + 血压为%2/%3 + 血壓為%2/%3 You find a low blood pressure @@ -1620,6 +1992,9 @@ Pressão Arterial baixa Naměřil si nízký krevní tlak 血圧はかなり低い + 发现到低血压 + 發現到低血壓 + 혈압이 낮음 You find a normal blood pressure @@ -1633,10 +2008,13 @@ Pressão Arterial normal Naměřil si normální krevní tlak 血圧は通常 + 发现到正常血压 + 發現到正常血壓 + 혈압이 정상 You find a high blood pressure - Tension haute + Tension élevée Давление высокое La presión arterial es alta Wyczuwasz wysokie ciśnienie krwi @@ -1646,6 +2024,9 @@ Pressão Arterial Alta Naměřil si vysoký krevní tlak 血圧はかなり高い + 发现到高血压 + 發現到高血壓 + 혈압이 높음 You find no blood pressure @@ -1659,6 +2040,9 @@ Sem Pressão Arterial Nenaměřil si žádný krevní tlak 血圧は測れなかった + 혈압이 잡히지 않는다 + 量不到血压 + 量不到血壓 You fail to find a blood pressure @@ -1672,58 +2056,73 @@ Você falhou em aferir a Pressão Arterial Nedokázal si změřit krevní tlak 血圧を測るのに失敗 + 혈압을 잡을 수 없었다 + 检查血压的动作失败 + 檢查血壓的動作失敗 Low Niedrig Bassa Низкое - Faible + basse Niskie Baja Alacsony Nízký Baixa 低い + 낮음 + + Normal Normal Normale Нормальное - Normale + normale Normalne Normal Normális Normální Normal 通常 + 보통 + 正常 + 正常 High Hoch Alta Высокое - Haute + élevée Wysokie Alta Magas Vysoký Alta 高い + 높음 + + No Blood Pressure Kein Blutdruck Nessuna Pressione Sanguigna Артериальное давление отсутствует - Aucune tension + pas de tension Brak ciśnienia krwi Sin presión arterial Nincs vérnyomás Žádný krevní tlak Sem pressão arterial 血圧なし + 혈압 없음 + 无血压 + 無血壓 Pulse @@ -1737,10 +2136,13 @@ Pulso Puls 心拍数 + 맥박 + 脉搏 + 脈搏 Checking Heart Rate... - Vérification du rythme cardiaque... + Vérification du pouls... Проверка пульса... Comprobando ritmo cardíaco... Sprawdzanie tętna... @@ -1750,6 +2152,9 @@ Aferindo Pulso... Kontroluji srdeční tep... 心拍数を測定中・・・ + 맥박 확인중... + 检查心跳中... + 檢查心跳中... You checked %1 @@ -1763,19 +2168,25 @@ Você aferiu o paciente %1 Zkontroloval si %1 心拍数は %1 + 나의 맥박은 %1 이다 + 你已经检查 %1 + 你已經檢查 %1 %1 checked Heart Rate: %2 %1 kontrollierte Herzfrequenz: %2 %1 Controllata Frequenza Cardiaca: %2 %1 проверил пульс: %2 - %1 à vérifié le rythme cardiaque: %2 + %1 a vérifié le pouls de : %2 %1 sprawdził tętno: %2 %1 verificado el ritmo cardíaco: %2 %1 ellenőrizte a szívverés-számot: %2 %1 zkontroloval srdeční tep: %2 %1 verificou a frequência cardíaca: %2 %1 が測った心拍数は: %2 + %1 (이)가 맥박을 측정했습니다: %2 + 已由%1确认心跳: %2 + 已由%1確認心跳: %2 None @@ -1785,53 +2196,65 @@ Keine Žádný Nada - Aucun + aucun Nincs Niente なし + 없음 + + Weak Schwach Lento Слабый - Faible + lent Słabe Débil Gyenge Slabý Fraca 弱い + 약함 + 微弱 + 微弱 Normal Normal Normale Нормальный - Normal + normal Normalne Normal Normális Normální Normal 通常 + 보통 + 正常 + 正常 Strong Stark Veloce Сильный - Fort + rapide Silne Fuerte Erős Silný Forte 強い + 강함 + 过快 + 過快 You find a Heart Rate of %2 - Rythme cardiaque de %2 + %2 battements par minute Пульс %2 уд./мин. El ritmo cardíaco es de %2 Wyczuwasz tętno o wartości %2 @@ -1841,10 +2264,13 @@ A Freqüência Cardíaca é de %2 Nahmatal jsi srdeční tep u %2 心拍数は %2 + 心跳为%2 + 心跳為%2 + 맥박 %2 You find a weak Heart Rate - Rythme cardiaque faible + Poulslent Пульс слабый El ritmo cardíaco es débil Wyczuwasz słabe tętno @@ -1854,10 +2280,13 @@ Freqüência Cardíaca baixa Nahmatal si slabý srdeční puls 自分の心拍数は低い + 心跳微弱 + 心跳微弱 + 약한 맥박 You find a strong Heart Rate - Rythme cardiaque élevé + pouls rapide Пульс учащенный El ritmo cardíaco está acelerado Wyczuwasz silne tętno @@ -1867,10 +2296,13 @@ Freqüência Cardíaca normal Nahmatal si silný srdeční puls 自分の心拍数は強い + 心跳过快 + 心跳過快 + 강한 맥박 You find a normal Heart Rate - Rythme cardiaque normal + pouls normal Пульс в норме El ritmo cardíaco es bueno Wyczuwasz normalne tętno @@ -1880,10 +2312,13 @@ Freqüência Cardíaca alta Nahmatal si normální srdeční puls 自分の心拍数は通常 + 心跳正常 + 心跳正常 + 보통 맥박 You find no Heart Rate - Pas de rythme cardiaque + pas de pouls Пульс не прощупывается No tiene ritmo cardíaco Wyczuwasz brak tętna @@ -1893,10 +2328,13 @@ Sem Freqüência Cardíaca Žádný puls 心拍数を測れなかった + 量不到心跳 + 量不到心跳 + 맥박 없음 Response - Etat de Conscience + Conscience Реакция Respuesta Przytomność @@ -1906,10 +2344,13 @@ Reação Odezva 反応を見る + 반응 + 反应 + 反應 You check response of patient - Vous vérifiez la réponse du patient + Vous évaluez l'état de conscience Вы проверяете реакцию раненого Compruebas si el paciente reacciona Sprawdzasz przytomność pacjenta @@ -1919,6 +2360,9 @@ Aferindo se o paciente tem reação Zkontroloval jsi reakci pacienta 患者からの反応をみる + 대상의 반응 확인중 + 检查伤者的反应 + 檢查傷者的反應 %1 is responsive @@ -1932,6 +2376,9 @@ %1 está respondendo %1 odpovídá %1 は反応あり + %1 有反应 + %1 有反應 + %1 은 반응이 있다 %1 is not responsive @@ -1945,6 +2392,9 @@ %1 não está respondendo %1 neodpovídá %1 の反応なし + %1 没有反应 + %1 沒有反應 + %1 은 반응이 없다 You checked %1 @@ -1958,6 +2408,9 @@ Você aferiu o paciente %1 Zkontroloval jsi %1 %1 を見た + %1 을 확인함 + 你已经检查 %1 + 你已經檢查 %1 Patient %1<br/>is %2.<br/>%3.<br/>%4 @@ -1970,7 +2423,10 @@ A páciens, %1,<br/>%2.<br/>%3.<br/>%4 Pacient %1<br/>je %2.<br/>%3.<br/>%4 Paciente %1<br/>é %2.<br/>%3.<br/>%4 - 痛みは %1&lt;br/&gt; %2.&lt;br/&gt;%3.&lt;br/&gt;%4 + 患者 %1<br/>は %2.<br/>%3.<br/>%4 + 환자 %1<br/>는 %2.<br/>%3.<br/>%4 + 伤者 %1<br/>is %2.<br/>%3.<br/>%4 + 傷者 %1<br/>is %2.<br/>%3.<br/>%4 alive @@ -1984,6 +2440,9 @@ naživu vivo 生存 + 생존 + 活着 + 活著 dead @@ -1991,12 +2450,15 @@ мёртв muerto tot - mort + décédé martwy halott mrtev morto 死亡 + 사망 + 死亡 + 死亡 He's lost some blood @@ -2010,6 +2472,9 @@ Ztratil trochu krve Ele perdeu um pouco de sangue 彼は出血している + 적은 양의 피를 잃었다 + 他流失一些血液 + 他流失一些血液 He's lost a lot of blood @@ -2022,7 +2487,10 @@ Ztratil hodně krve Ele perdeu muito sangue Ha perso molto sangue - 彼は大量出血している + 彼は大量失血している + 많은 양의 피를 잃었다 + 他流失大量血液 + 他流失大量血液 He hasn't lost blood @@ -2035,7 +2503,10 @@ Nem vesztett vért Neztratil žádnou krev Ele não perdeu sangue - 彼は出血していない + 彼は失血していない + 피를 잃지 않았다 + 他并没有失血 + 他並沒有失血 He is in pain @@ -2049,6 +2520,9 @@ Je v bolestech Ele está com dor 彼には痛みがあるようだ + 통증이 있다 + 他感到疼痛 + 他感到疼痛 He is not in pain @@ -2062,10 +2536,13 @@ Nemá žádné bolesti Ele não está com dor 彼には痛みがないようだ + 통증이 없다 + 他不会疼痛 + 他不會疼痛 Bandaged - Bandé + Pansé Повязка наложена Vendado Zabandażowano @@ -2075,10 +2552,13 @@ Enfaixado Obvázaný 包帯 + 붕대 감음 + 绷带 + 繃帶 You bandage %1 (%2) - Vous bandez %1 (%2) + Vous pansez %1 (%2) Вы перевязали раненого %1 (%2) Aplicas vendaje a %1 en %2 Bandażujesz %1 (%2) @@ -2088,10 +2568,13 @@ Você aplica bandagem no paciente %1 (%2) Obvazuješ %1 (%2) %1 (%2) 包帯をつかった + %1 (%2) 붕대를 감았다 + 你正在对 %1 (%2) 包扎绷带中 + 你正在對 %1 (%2) 包紮繃帶中 %1 is bandaging you - %1 vous bande + %1 vous panse %1 перевязывает вас %1 te está vendando %1 bandażuje Ciebie @@ -2101,6 +2584,9 @@ %1 está aplicando uma bandagem em você %1 tě obvazuje %1 は自分に包帯を巻いている + %1 (이)가 나에게 붕대를 감고있다 + %1 正在对你包扎绷带中 + %1 正在對你包紮繃帶中 You start stitching injuries from %1 (%2) @@ -2114,6 +2600,9 @@ Você começa a suturar os ferimentos do %1 (%2) Zašíváš rány %1 (%2) あなたは %1 (%2) の外傷へ縫合をはじめた + 나는 %1(%2) 상처로부터 봉합을 시작했다 + 你正开始对 %1 (%2) 缝合伤口中 + 你正開始對 %1 (%2) 縫合傷口中 Stitching @@ -2126,7 +2615,10 @@ Suturando Suturando Šití - 縫合 + 縫合中 + 붕합중 + 缝合中 + 縫合中 You treat the airway of %1 @@ -2140,6 +2632,9 @@ Você entuba o %1 Ošetřuješ dýchací cesty %1 %1 の気道を診断する + %1의 기도를 확보했다 + 你治疗 %1 的呼吸道 + 你治療 %1 的呼吸道 Airway @@ -2153,6 +2648,9 @@ Vias Aéreas Dýchací cesty 気道 + 기도 + 呼吸道 + 呼吸道 %1 is treating your airway @@ -2166,6 +2664,9 @@ %1 está te entubando %1 ošetřuje tvoje dýchací cesty %1 はあなたの気道を見ている + %1 (이)가 나의 기도를 확보중이다 + %1 正在治疗你的呼吸道 + %1 正在治療你的呼吸道 Drag @@ -2174,11 +2675,14 @@ Ciągnij Táhnout Тащить - Trainer + Traîner Húzás Arrastar Trascina 引きずる + 끌다 + 拖拉 + 拖拉 Carry @@ -2192,6 +2696,9 @@ Carregar Trasporta 運ぶ + 업다 + 背起 + 背起 Release @@ -2205,6 +2712,9 @@ Soltar Rrilascia 離す + 내려놓기 + 放下 + 放下 Load Patient Into @@ -2218,6 +2728,9 @@ Carregar Paciente Em Carica paziente nel 患者を載せる + 환자 싣기 + 将伤者放入 + 將傷者放入 Unload Patient @@ -2231,6 +2744,9 @@ Descarregar Paciente Scarica il paziente 患者を降ろす + 환자 내리기 + 将伤者背出 + 將傷者背出 Unload patient @@ -2238,12 +2754,15 @@ Выгрузить пациента Patient ausladen Wyładuj pacjenta - Débarquer le patient + Le patient débarque Sebesült kihúzása Scarica il paziente Descarregar Paciente Vyložit pacienta 患者を降ろす + 환자 내리기 + 将伤者背出 + 將傷者背出 Load patient @@ -2257,6 +2776,9 @@ Carregar Paciente Em Naložit pacienta 患者を載せる + 환자 싣기 + 将伤者放入 + 將傷者放入 Place body in bodybag @@ -2270,6 +2792,9 @@ Colocar corpo dentro do saco para cadáver Umístni tělo do pytle na mrtvoly 死体袋に入れる + 시체 가방에 담기 + 将尸体放入尸袋 + 將屍體放入屍袋 Placing body in bodybag... @@ -2283,6 +2808,9 @@ Colocando corpo dentro do saco para cadáver... Umístňuji tělo do pytle na mrtvoly... 死体袋へ梱包中・・・ + 시체 가방에 담는중... + 将尸体放入尸袋中... + 將屍體放入屍袋中... %1 has bandaged patient @@ -2296,6 +2824,9 @@ %1 aplicou bandagem no paciente %1 již obvázal pacienta %1 は包帯を巻いた + %1 已包扎伤者 + %1 已包紮傷者 + %1 (이)가 붕대를 감음 %1 performed CPR @@ -2306,8 +2837,11 @@ %1 realizou RCP %1 провел сердечно-легочную реанимацию %1 realicó RCP - %1 à fait une RPC + %1 à fait une RCP %1 は心肺蘇生をした + %1 已执行心肺复苏术 + %1 已執行心肺復甦術 + %1 (이)가 심폐소생술을 실시함 %1 used %2 @@ -2321,6 +2855,9 @@ %1 usou %2 %1 použil %2 %1 は %2 をつかった + %1 已使用 %2 + %1 已使用 %2 + %1 (이)가 %2 을 사용함 %1 has given an IV @@ -2328,12 +2865,15 @@ %1 ha puesto una IV %1 hat eine Infusion verabreicht %1 podał IV - %1 a administré une IV + %1 a plaçé une IV %1 infúziót adott %1 ha somministrato una EV %1 aplicou um intravenoso %1 již aplikoval IV - %1 は IV を与えた + %1 は IV をした + %1 已经给予静脉注射液 + %1 已經給予靜脈注射液 + %1 (이)가 IV를 실시함 %1 applied a tourniquet @@ -2341,12 +2881,15 @@ %1 наложил жгут %1 hat ein Tourniquet angelegt %1 założył stazę - %1 a appliqué un garrot + %1 a plaçé un garrot %1 felhelyezett egy érszorítót %1 ha applicato un laccio emostatico %1 aplicou um torniquete %1 použil škrtidlo %1 は止血帯を巻いた + %1 已经绑上止血带 + %1 已經綁上止血帶 + %1 (이)가 지혈대를 적용함 %1 used Personal Aid Kit @@ -2357,8 +2900,11 @@ %1 использовал аптечку %1 ha usato Kit Pronto Soccorso Personale %1 usó Kit de Primeros Auxilios - %1 à utilisé un PAK + %1 a utilisé une trousse %1 は応急処置キットをつかった + %1 已使用了个人急救包 + %1 已使用了個人急救包 + %1 (이)가 개인응급키트를 사용함 Heavily wounded @@ -2367,11 +2913,14 @@ Тяжелые ранения Gravemente ferito Gravemente herido - Lourdement blessé + Gravement blessé Erősen sérült Těžce raněn Gravemente ferido 重傷 + 중상 + 重伤 + 重傷 Lightly wounded @@ -2385,6 +2934,9 @@ Lehce raněn Levemente ferido 軽傷 + 경상 + 轻伤 + 輕傷 Very lightly wounded @@ -2398,6 +2950,9 @@ Velmi lehce raněn Muito levemente ferido かなり浅い傷 + 매우 가벼운 부상 + 小伤 + 小傷 Head @@ -2411,6 +2966,9 @@ Hlava Cabeça 頭部 + 머리 + 头部 + 頭部 Torso @@ -2424,6 +2982,9 @@ Trup Torso 胴体 + 몸통 + 身体 + 身體 Left Arm @@ -2432,11 +2993,14 @@ Левой руки Braccio sinistro Brazo izquierdo - Bras gouche + Bras gauche Bal kar Levá ruka Braço Esquerdo 左腕 + 왼쪽 팔 + 左手 + 左手 Right Arm @@ -2450,6 +3014,9 @@ Pravá ruka Braço Direito 右腕 + 오른쪽 팔 + 右手 + 右手 Left Leg @@ -2463,6 +3030,9 @@ Levá noha Perna Esquerda 左足 + 왼쪽 다리 + 左脚 + 左腳 Right Leg @@ -2476,6 +3046,9 @@ Pravá noha Perna Direita 右足 + 오른쪽 다리 + 右脚 + 右腳 Heal fully bandaged hitpoints @@ -2485,9 +3058,12 @@ Curar hitpoints totalmente enfaixados Heal fully bandaged hitpoints Cura hitpoints completamente bendati - Soigner les plaies entièrement bandées. + Soigner les plaies entièrement bandées Heilt vollständig bandagierte Trefferpunkte 包帯は体力を完全に回復する + 붕대를 감은후 체력을 회복함 + 完全医疗包扎的部位至痊愈 + 完全醫療包紮的部位至痊癒 Pain is only temporarily suppressed @@ -2496,11 +3072,14 @@ Bolest je potlačena pouze dočasně El dolor se suprime solo temporalmente Dor é suprimida somente temporáriamente - La douleur est seulement supprimée temporairement + La douleur est temporairement calmée A fájdalom csak ideiglenesen csökken Боль приглушается только временно Dolore è soppresso solo temporaneamente 痛みは一時的な影響 + 疼痛只会暂时性压制 + 疼痛只會暫時性壓制 + 고통은 일시적으로만 회복 Pain Effect Type @@ -2514,6 +3093,9 @@ Tipo do efeito de dor Typ bolesti - efekt 痛みの種類 + 고통 효과 종류 + 疼痛效果类型 + 疼痛效果類型 Colour Flashing @@ -2527,6 +3109,9 @@ Flash de cor Blikající barva 色の点滅 + 색 반짝임 + 闪烁颜色 + 閃爍顏色 Chromatic Aberration @@ -2540,11 +3125,14 @@ Chromatická aberace Aberração Cromática 色の収差 + 색수차 + 色差 + 色差 Style of menu (Medical) Styl menu medycznego - Style de menu (Médical) + Style de menu (médical) Menüstil (Medizin) Вид меню (медицина) Tipo de menú (Medico) @@ -2553,11 +3141,14 @@ Menü stílusa (Orvosi) Stile del menù (medico) メニューの表示形式 (治療) + 메뉴의 스타일 (의료) + 选单样式 (医疗) + 選單樣式 (醫療) Select the type of menu you prefer; default 3d selections or radial. Wybierz rodzaj menu, który preferujesz: domyślne pozycje 3D lub radialne - Selctionne le type de menu préféré; par défaut la sélection 3D ou radiale + Sélectionne le type de menu préféré; par défaut la sélection 3D ou radiale Wähle den Menüstil: Standard 3D-Auswahl oder kreisförmig. Выберите тип меню: стандартный вариант (3D) или радиальный Selecciona el tipo de menú que prefieres: selecciones 3d por defecto o radial. @@ -2566,11 +3157,14 @@ Zvolte typ menu: základní 3D výběr nebo kruhový Seleziona il tipo di menù che preferisci: selezione (3D), radiale o disabilitata. 好みに応じてメニューの表示形式を選んでください。標準では 3D 選択か円状です。 + 선호하는 종류의 메뉴를 고르세요; 기본 3d 선택형 혹은 다이얼형 + 选择你喜欢的选单样式; 预设为3D选项或放射状 + 選擇你喜歡的選單樣式; 預設為3D選項或放射狀 Selections (3d) Pozycje (3D) - sélections (3D) + Sélection (3D) 3D-Auswahl Стандартный (3D) Selecciones (3d) @@ -2578,12 +3172,15 @@ Választékok (3D) 3D výběr Selezione (3D) - 選択 (3d) + 選択 (3D) + 선택 (3d) + 选择 (3D) + 選擇 (3D) Radial Radialne - Radiale + Radial Kreisförmig Радиальный Radial @@ -2592,58 +3189,73 @@ Kruhový Radiale 円状 + 다이얼형 + 放射状 + 放射狀 Scrape Kratzer Scorticatura Ссадина - Eraflure + Abrasion Draśnięcie Arañazo Horzsolás Raspão Odřenina 擦り傷 + 찰과상 + 擦伤 + 擦傷 Minor Scrape Kleiner Kratzer Minima Scorticatura Малая ссадина - Petite éraflure + Petite abrasion Pomniejsze draśnięcie Arañazo menor Kis horzsolás Raspão leve Malá odřenina 小さな擦り傷 + 소형 찰과상 + 小擦伤 + 小擦傷 Medium Scrape Mittlerer Kratzer Media Scorticatura Средняя ссадина - Moyenne éraflure + Moyenne abrasion Średnie draśnięcie Arañazo medio Közepes horzsolás Raspão médio Středně velká odřenina 中くらいの擦り傷 + 중형 찰과상 + 中擦伤 + 中擦傷 Large Scrape Großer Kratzer Alta Scorticatura Большая ссадина - Grande éraflure + Grande abrasion Duże draśnięcie Arañazo severo Nagy horzsolás Raspão grave Velká odřenina 大きな擦り傷 + 대형 찰과상 + 大擦伤 + 大擦傷 Avulsion @@ -2657,6 +3269,9 @@ Avulsão Avulze 剥離傷 + 열상 + 撕脱伤 + 撕脫傷 Minor Avulsion @@ -2670,6 +3285,9 @@ Avulsão leve Malá avulze 小さな剥離傷 + 소형 열상 + 小撕脱伤 + 小撕脫傷 Medium Avulsion @@ -2683,6 +3301,9 @@ Avulsão média Střední avulze 中くらいの剥離傷 + 중형 열상 + 中撕脱伤 + 中撕脫傷 Large Avulsion @@ -2696,110 +3317,137 @@ Avulsão grave Velká avulze 大きな剥離傷 + 대형 열상 + 大撕脱伤 + 大撕脫傷 Bruise Prellung Contusione Ушиб - Hématome + Contusion Stłuczenie Contusión Zúzódás Contusão Modřina 打ち傷 + 타박상 + 挫伤 + 挫傷 Minor Bruise Kleine Prellung Minima Contusione Малый ушиб - Petit hématome + Petite contusion Pomniejsze stłuczenie Contusión menor Kis zúzódás Contusão leve Malá modřina 小さな打ち傷 + 소형 타박상 + 小挫伤 + 小挫傷 Medium Bruise Mittlere Prellung Media Contusione Средний ушиб - Hématome moyen + Moyenne contusion Średnie stłuczenie Contusión media Közepes zúzódás Contusão média Středně velká modřina 中くらいの打ち傷 + 중형 타박상 + 中挫伤 + 中挫傷 Large Bruise Große Prellung Alta Contusione Большой ушиб - Hématome important + Grande contusion Duże stłuczenie Contusión severa Nagy zúzódás Contusão grave Velká modřina 大きな打撲傷 + 대형 타박상 + 大挫伤 + 大挫傷 Crushed tissue Quetschverletzung Tessuto Schiacciato Компресионная травма - Tissu écrasé + Écrasement Zgniecienie tkanek miękkich Tejido triturado Zúzott szövet Tecido esmagado Zhmoždění měkkých tkání 圧挫傷 + 좌상 + 撞伤 + 撞傷 Minor crushed tissue Kleine Quetschverletzung Minimo Tessuto Schiacciato Малая компрессионная травма - Tissu écrasé léger + Petit écrasement Pomniejsze zgniecienie tkanek miękkich Tejido triturado menor Kis zúzott szövet Tecido esmagado leve Malé zhmoždění měkkých tkání 小さな圧挫傷 + 소형 좌상 + 小撞伤 + 小撞傷 Medium crushed tissue Mittlere Quetschverletzung Medio Tessuto Schiacciato Средняя компрессионная травма - Tissu écrasé moyen + Moyen écrasement Średnie zgniecienie tkanek miękkich Tejido triturado medio Közepes zúzott szövet Tecido esmagado médio Střední zhmoždění měkkých tkání 中くらいの圧挫傷 + 중형 좌상 + 中撞伤 + 中撞傷 Large crushed tissue Große Quetschverletzung Alto Tessuto Schiacciato Большая компрессионная травма - Tissu écrasé large + Grand écrasement Duże zgniecienie tkanek miękkich Tejido triturado severo Nagy zúzött szövet Tecido esmagado grave Velké zhmoždění měkkých tkání 大きな圧挫傷 + 대형 좌상 + 大撞伤 + 大撞傷 Cut @@ -2813,6 +3461,9 @@ Corte Řezná rána 切り傷 + 절상 + 割伤 + 割傷 Small Cut @@ -2826,6 +3477,9 @@ Corte leve Malá řezná rána 小さな切り傷 + 소형 절상 + 小割伤 + 小割傷 Medium Cut @@ -2839,6 +3493,9 @@ Corte médio Střední řezná rána 中くらいの切り傷 + 중형 절상 + 中割伤 + 中割傷 Large Cut @@ -2848,10 +3505,13 @@ Duża rana cięta Corte severo Nagy vágás - Large coupure + Grande coupure Corte grave Velká řezná rána 大きな切り傷 + 대형 절상 + 大割伤 + 大割傷 Tear @@ -2859,12 +3519,15 @@ Strappo Рваная рана Rozerwanie skóry - Déchirure + Lacération Desgarro Szakadás Ruptura Tržná rána 裂傷 + 창상 + 撕裂伤 + 撕裂傷 Small Tear @@ -2872,12 +3535,15 @@ Piccolo Strappo Малая рваная рана Pomniejsze rozerwanie skóry - Petite Déchirure + Petite lacération Desgarro menor Kis szakadás Ruptura leve Malá tržná rána 小さな裂傷 + 소형 창상 + 小撕裂伤 + 小撕裂傷 Medium Tear @@ -2887,10 +3553,13 @@ Średnie rozerwanie skóry Desgarro medio Közepes szakadás - Moyenne déchirure + Moyenne lacération Ruptura média Střední tržná rána 中くらいの裂傷 + 중형 창상 + 中撕裂伤 + 中撕裂傷 Large Tear @@ -2900,10 +3569,13 @@ Duże rozerwanie skóry Desgarro severo Nagy szakadás - Large déchirure + Grande lacération Ruptura grave Velká tržná rána 大きな裂傷 + 대형 창상 + 大撕裂伤 + 大撕裂傷 Velocity Wound @@ -2911,12 +3583,15 @@ Velocità Ferita Огнестрельная рана Rana postrzałowa - Blessure de vélocité + Plaie pénétrante Herida de bala Lőtt seb Ferimento por projétil de arma de fogo Střelné poranění 銃創 + 총상 + 穿透伤 + 穿透傷 Small Velocity Wound @@ -2926,10 +3601,13 @@ Pomniejsza rana postrzałowa Herida de bala menor Kis lőtt seb - Petite blessure de vélocité + Petite plaie pénétrante Ferimento leve por projétil de arma de fogo Malé střelné poranění 小さな銃創 + 소형 총상 + 小穿透伤 + 小穿透傷 Medium Velocity Wound @@ -2939,10 +3617,13 @@ Średnia rana postrzałowa Herida de bala media Közepes lőtt seb - Moyenne blessure de vélocité + Moyenne plaie pénétrante Ferimento médio por projétil de arma de fogo Střední střelné poranění 中くらいの銃創 + 중형 총상 + 中穿透伤 + 中穿透傷 Large Velocity Wound @@ -2952,10 +3633,13 @@ Duża rana postrzałowa Herida de bala severa Nagy lőtt seb - Large blessure de vélocité + Grande plaie pénétrante Ferimento grave por projétil de arma de fogo Velké střelné poranění 大きな銃創 + 대형 총상 + 大穿透伤 + 大穿透傷 Puncture Wound @@ -2963,12 +3647,15 @@ Puntura Ferita Колотая рана Rana kłuta - Blessure de perforation + Perforation Herida punzante Szúrt seb Ferimento por perfuração Bodná rána 刺し傷 + 관통상 + 穿刺伤 + 穿刺傷 Minor Puncture Wound @@ -2978,10 +3665,13 @@ Pomniejsza rana kłuta Herida punzante menor Kis szúrt seb - Légère blessure de perforation + Petite perforation Ferimento leve por perfuração Malá bodná rána 小さな刺し傷 + 소형 관통상 + 小穿刺伤 + 小穿刺傷 Medium Puncture Wound @@ -2991,10 +3681,13 @@ Średnia rana kłuta Herida punzante media Közepes szúrt seb - Moyenne blessure de perforation + Moyenne perforation Ferimento médio por perfuração Střední bodná rána 中くらいの刺し傷 + 중형 관통상 + 中穿刺伤 + 中穿刺傷 Large Puncture Wound @@ -3004,10 +3697,13 @@ Duża rana kłuta Herida punzante severa Nagy szúrt seb - Large blessure de perforation + Grande perforation Ferimento grave por perfuração Velká bodná rána 大きな刺し傷 + 대형 관통상 + 大穿刺伤 + 大穿刺傷 Broken Femur @@ -3021,6 +3717,9 @@ Fêmur quebrado Zlomená stehenní kost 大腿骨の骨折 + 대퇴골 골절 + 大腿骨骨折 + 大腿骨骨折 Treating... @@ -3034,6 +3733,9 @@ Ošetřuji... Curando... 治療中・・・ + 치료중... + 治疗中... + 治療中... Removing Tourniquet... @@ -3047,6 +3749,9 @@ Снятие жгута... Togliendo il laccio emostatico... 止血帯を外している・・・ + 지혈대 제거중... + 移除军用止血带中... + 移除軍用止血帶中... ACE Medical @@ -3060,6 +3765,9 @@ ACE Orvosi Rendszer ACE Medical ACE 医療 + ACE 의료 + ACE 医疗系统 + ACE 醫療系統 Medical Settings [ACE] @@ -3069,10 +3777,13 @@ Sanitätseinstellungen [ACE] Lékařské nastavení [ACE] Ajustes médicos [ACE] - Option médicale [ACE] + Options médicales [ACE] Orvosi beállítások [ACE] Impostazioni Mediche [ACE] 医療設定 [ACE] + 의료 설정 [ACE] + 医疗设定 [ACE] + 醫療設定 [ACE] Medical Level @@ -3086,6 +3797,9 @@ Orvosi szint Livello Medico 医療レベル + 의료 수준 + 医疗等级 + 醫療等級 What is the medical simulation level? @@ -3095,10 +3809,13 @@ Wie hoch soll das medizinische Simulationslevel sein? Jaká je úroveň lékařské simulace? Qual o nível de simulação médica? - Quel niveau de simulation médicale choisissez vous? + Quel niveau de simulation médicale choisissez-vous? Milyen komplex legyen az orvosi szimuláció? Qual'è il livello di simulazione medica? 治療の再現度は? + 의료 시뮬레이션의 수준 + 选择需要的医疗模拟等级 + 選擇需要的醫療模擬等級 Basic @@ -3112,6 +3829,9 @@ Alap Basico ベーシック + 기본 + 基本 + 基本 Advanced @@ -3121,10 +3841,13 @@ Erweitert Pokročilé Avançada - Avancée + Avancé Fejlett Avanzato アドバンスド + 고급 + 进阶 + 進階 Medics setting @@ -3134,10 +3857,13 @@ Sanitätseinstellungen Úroveň zdravotníků Configuração médica - Paramètre des infirmiers + Règlage des infirmiers Orvosok beállítása Parametri Medici 治療の設定 + 의료 설정 + 医护兵等级 + 醫護兵等級 What is the level of detail prefered for medics? @@ -3147,10 +3873,13 @@ ¿Cuál es el nivel de detalle preferido para los médicos? Jaká úroveň detailů je preferována pro zdravotníky? Qual o nível de detalhe preferido para os médicos? - Quel niveau de détail voullez vous pour les infirmier? + Quel niveau de détail voulez-vous pour les infirmiers? Mi a javasolt részletesség orvosok számára? Qual'è il livello di dettagli preferito per i medici? >衛生兵への再現度をどのくらいに設定しますか? + 의무병의 시뮬레이션 정도? + 设定医护兵的预设医疗水平(医疗兵,军医) + 設定醫護兵的預設醫療水平(醫療兵,軍醫) Locations boost training @@ -3160,21 +3889,27 @@ Ubicación mejora entrenamiento. Miejsca zwiększają wyszkolenie Localização melhora treinamento - Locations boost l'entraînement de médecin + Le lieu améliore l'efficacité Места ускоренного обучения 衛生兵としての能力を与える場所 + 受所在位置影响提升医疗能力 + 受所在位置影響提升醫療能力 + 의료 효과 증가 지역 Boost medic rating in medical vehicles or near medical facilities [untrained becomes medic, medic becomes doctor] - Zlepšit zkušenosti zdravotníka v medickém vozidle nebo poblíž zdravotního zařízení [nezkušení se stane zdravotníkem, zdravotník se stane doktorem] + Zlepšit zkušenosti zdravotníka v medickém vozidle nebo poblíž zdravotního zařízení [nezkušení se stane zdravotníkem, zdravotník se stane doktorem] Aumenta il rating medico in veicoli medici o vicino strutture mediche [non addestrato diventa medico, medico diventa dottore] Steigert die medizinische Einstufung eines Soldaten in Sanitätsfarhzeugen oder in der Nähe von Sanitätseinrichtungen [untrainiert wird zu Sanitäter, Sanitäter zu Doktor] Mejora el entrenamiento médico dentro de vehículos médicos o cerca de instalaciones médicas (no entrenados se convierten en médicos, médicos se convierten en doctores) Zwiększa poziom wyszkolenia medyków wewnątrz pojazdów medycznych lub w pobliżu budynków medycznych [niedoświadczony zostaje medykiem, medyk zostaje doktorem] Aumenta a classificação do médico dentro de veículos médicos ou perto de instalações médicas [sem treinamento vira médico, médico vira doutor] - Boost le rang médical dans les véhicules ou bâtiments médicaux [non entraînés deviennent médecins, médecins deviennent docteurs] + Améliore l'efficacité des soins dans les véhicules ou structures de soins [non formés deviennent médecins, médecins deviennent docteurs] Улучшает медицинскую подготовку в мед. транспорте и около мед. строений [нетренированные становятся медиками, медики становятся врачами] 医療車両や医療施設の近くは衛生兵としての能力を与える場所となり、衛生兵の訓練を受けていないのに衛生兵としてなる(未訓練は衛生兵に、衛生兵は医師に) + 의무병의 수준이 주변의 차량이나 의료시설에 따라 증가합니다. [비교육자가 의무병이되고, 의무병이 의사가 됩니다] + 当人员在医疗载具或是医护设施旁进行医疗时,该员医疗能力将会有所提升 (未受训人员提升为医疗兵,医疗兵提升为军医) + 當人員在醫療載具或是醫護設施旁進行醫療時,該員醫療能力將會有所提升 (未受訓人員提升為醫療兵,醫療兵提升為軍醫) Disable medics @@ -3188,6 +3923,9 @@ Orvosok letiltása Disabilita medici 衛生兵を無効化 + 의무병 비활성화 + 关闭医护兵 + 關閉醫護兵 Enable Litter @@ -3201,6 +3939,9 @@ Szemét engedélyezése Abilita Barella 医療廃棄物の表示を有効化 + 의료폐기물 활성화 + 启用医疗废弃物 + 啟用醫療廢棄物 Enable litter being created upon treatment @@ -3214,6 +3955,9 @@ Engedélyezi a szemét keletkezését ellátáskor Abilita la creazione della barella dopo trattamento 治療を始めると、医療廃棄物の作成を有効化する + 의료폐기물이 치료중 주변에 생성되는것을 활성화 합니다 + 本功能启用后,当每次医疗动作结束时,地上会产生相应的医疗废弃物 + 本功能啟用後,當每次醫療動作結束時,地上會產生相應的醫療廢棄物 Life time of litter objects @@ -3227,6 +3971,9 @@ Szemétobjektumok élettartama Tempo di vita delle barelle 医療廃棄物の作成限界数を設定 + 의료폐기물 시간제한 + 医疗废弃物存在时间 + 醫療廢棄物存在時間 How long should litter objects stay? In seconds. -1 is forever. @@ -3240,6 +3987,9 @@ Milyen sokáig legyenek jelen a szemétobjektumok (másodpercben)? A -1 végtelen időt jelent. Per quanto devono restare le barelle? In secondi. -1 è permanente 医療廃棄物オブジェクトが表示されつづける時間を設定しますか?-1 は永遠です。 + 얼마동안 폐기물이 존재합니까? 초 단위. -1 은 영구적. + 定义医疗废弃物存在时间,以秒为单位,-1为永远存在。 + 定義醫療廢棄物存在時間,以秒為單位,-1為永遠存在。 Enable Screams @@ -3253,9 +4003,12 @@ Kiáltások engedélyezése Abilita Grida 叫びを有効化 + 비명 활성화 + 启用尖叫 + 啟用尖叫 - Enable screaming by injuried units + Enable screaming by injured units Включить крики раненных бойцов Aktywuj wrzeszczenie z bólu przez ranne jednostki Activar gritos para unidades heridas @@ -3266,6 +4019,9 @@ Engedélyezi a sérült egységek kiáltásait Abilita Grida da parte delle unità ferite 負傷したユニットが叫ぶように + 부상당한 인원이 소리지르는것을 활성화합니다 + 启用伤者的尖叫声 + 啟用傷者的尖叫聲 Player Damage @@ -3275,10 +4031,13 @@ Spielerschaden Poškození hráče Dano do jogador - Dégats des joueurs + Dégats du joueur Játékos sérülés Danno Giocatore プレイヤーへの損傷 + 플레이어 부상 + 玩家伤害 + 玩家傷害 What is the damage a player can take before being killed? @@ -3288,10 +4047,13 @@ Wie viel Schaden kann ein Spieler erleiden, bevor er getötet wird? Jaké poškození může hráč dostat než bude zabit? Qal é o dano que um jogador pode sofrer antes de morrer? - Quels dégats peut subir un joueur avant d'être tué + Quels dégâts peut subir un joueur avant d'être tué Mennyi sérülést szenvedhet el egy játékos, mielőtt meghal? Quanto è il danno che un giocatore può sostenere prima di essere ucciso? プレイヤーが死に始める前に損傷を受けるようにしますか? + 얼마정도의 부상을 플레이어가 죽기 전까지 버틸 수 있습니까? + 玩家死亡前所能承受的伤害程度 + 玩家死亡前所能承受的傷害程度 AI Damage @@ -3301,10 +4063,13 @@ KI-Schaden Poškození AI Dano da IA - Dégats des IA + Dégâts des IA AI sérülés Danno AI AI への損傷 + 인공지능 부상 + AI伤害 + AI傷害 What is the damage an AI can take before being killed? @@ -3314,10 +4079,13 @@ Wie viel Schaden kann eine KI erleiden, bis sie getötet wird? Jaké poškození může AI dostat než bude zabito? Qual é o dano que uma IA pode sofrer antes de morrer? - Quels dégats peut subir une IA avant d'être tuée + Quels dégâts peut subir une IA avant d'être tuée Mennyi sérülést szenvedhet el egy AI, mielőtt meghal? Quanto è il danno che un'IA può sostenere prima di essere uccisa? AI が死に始める前に損傷を受けるようにしますか? + 얼마정도의 부상을 인공지능이 죽기 전까지 버틸 수 있습니까? + AI 死亡前所能承受的伤害程度 + AI 死亡前所能承受的傷害程度 AI Unconsciousness @@ -3331,6 +4099,9 @@ AI eszméletlenség Incoscienza IA AI の気絶 + 인공지능 기절 + AI无意识 + AI無意識 Allow AI to go unconscious @@ -3344,6 +4115,9 @@ Engedélyezi az AI eszméletének elvesztését Permetti alle IA di diventare incoscienti AI が気絶をするように + 인공지능도 기절에 빠지게 합니다 + 允许AI进入无意识状态 + 允許AI進入無意識狀態 Remote Controlled AI @@ -3357,6 +4131,9 @@ Зевса считать ботом IA Controllate in Remoto 遠隔操作された AI + 인공지능 원격조종 + 遥控AI + 遙控AI Treat remote controlled units as AI not players? @@ -3370,6 +4147,9 @@ Обрабатывать дистанционно управляемых юнитов как ботов, а не как игроков? Considera le unità controllate in remoto come IA e non come giocatori? 遠隔操作された AI は、非プレイヤーとして扱いますか? + 원격 조작하는 AI는 비 플레이어로 취급합니까? + 以医疗AI的方式医疗被遥控的单位 + 以醫療AI的方式醫療被遙控的單位 Prevent instant death @@ -3383,6 +4163,9 @@ Azonnali halál kiiktatása Previeni morte istantanea 即死の防止 + 즉사 방지 + 防止当场死亡 + 防止當場死亡 Have a unit move to unconscious instead of death @@ -3396,6 +4179,9 @@ Egy egység kerüljön eszméletlen állapotba a halott helyett Imposta un'unità come incosciente invece di morta ユニットの即死を防止するために、気絶へ移行させます + 인원의 즉사를 방지코자 즉사 대신 기절시킵니다 + 伤者最严重只会立即进入昏迷,而非立即死亡 + 傷者最嚴重只會立即進入昏迷,而非立即死亡 Bleeding coefficient @@ -3405,10 +4191,13 @@ Verblutungsmultiplikator Koeficient krvácení Coeficiente de sangramento - Coefficient de saignement + Coéfficient de saignement Vérzési koefficiens Coefficiente sanguinamento 出血の係数 + 출혈 계수 + 流血系数 + 流血係數 Coefficient to modify the bleeding speed @@ -3418,10 +4207,13 @@ Multiplikator um die Verblutungsgeschwindigkeit zu verändern Koeficient rychlosti krvácení Coeficiente para modificar a velocidade do sangramento - Coefficient modifiant la vitesse de saignement + Modifie le débit des saignements Egy szorzó a vérzés sebességének szabályozására Coefficiente che modifica la velocità di sanguinamento この係数では出血速度を変更できます + 출혈의 속도를 계수만큼 변경합니다 + 修改流血速度 + 修改流血速度 Pain coefficient @@ -3431,10 +4223,13 @@ Schmerzmultiplikator Koeficient bolesti Coeficiente de dor - Coefficient de douleur + Coéfficient de douleur Fájdalmi koefficiens Coefficiente dolore 痛みの係数 + 고통 계수 + 疼痛系数 + 疼痛係數 Coefficient to modify the pain intensity @@ -3444,10 +4239,13 @@ Multiplikator um die Schmerzintensität zu verändern Koeficient intenzity bolesti Coeficiente para modificar a instensidade de dor - Coefficient modifiant l'intensité de la douleur + Modifie l'intensité de la douleur Egy szorzó a fájdalom erősségének szabályozására Coefficiente che modifica l'intensità del dolore この係数では痛みの強さを変更できます + 고통의 정도를 계수만큼 변경합니다 + 修改疼痛强度的系数 + 修改疼痛強度的係數 Sync status @@ -3457,10 +4255,13 @@ Status synchronisieren Synchronizovat status Sincronizar estado - Status de la synchronisation + Synchronisation du status Szinkronizációs állapot Sincronizza stato 同期状態 + 상태 동기화 + 同步状态 + 同步狀態 Keep unit status synced. Recommended on. @@ -3470,10 +4271,13 @@ Status der Einheit synchron halten. Sollte aktiviert bleiben. Udržuje status jednotky synchronizovaný. Doporučeno zapnout. Mater o estado da unidade sincronizado. Recomendado ativado. - Garder l'unité synchronisée, Recommandé sur oui. + Garder l'unité synchronisée. Activation recommandée. Egységállapotok szinkronizálása. Javasolt a bekapcsolása. Mantieni lo stato delle unità sincronizzato. Consigliato attivo. ユニット状態の同期を続けます。有効化を推奨。 + 인원의 상태를 동기화합니다. 켜기를 권장합니다. + 保持单位状态同步,建议启用! + 保持單位狀態同步,建議啟用! Provides a medical system for both players and AI. @@ -3483,22 +4287,28 @@ Aktiviert ein Sanitätssystem für Spieler und KI. Poskytuje zdravotní systém pro hráče a AI. Proporciona o sistema médico para os jogadores e a IA. - Fourni un système médical pour les joueurs tout comme pour les IA. + Fourni un système médical pour les joueurs et les IA. Egy orvosi rendszert ad játékosok és AI-k számára. Fornisce un sistema medico sia per giocatori che IA. プレイヤーと AI の両方へ医療システムを提供します。 + 의료 시스템을 플레이어 및 인공지능에게 제공합니다. + 医疗系统将同时对玩家与AI发生作用。 + 醫療系統將同時對玩家與AI發生作用。 Basic Medical Settings [ACE] Standard Sanitätseinstellungen [ACE] Podstawowe ustawienia medyczne Ajustes médicos básicos [ACE] - Réglages du système médical basic [ACE] + Paramètres des soins basiques [ACE] Impostazioni Mediche Di Base [ACE] Základní zdravotnické nastavení [ACE] Ajustes médicos básicos [ACE] Настройки базовой медицины [ACE] ベーシック医療設定 [ACE] + 기본 의료 설정 [ACE] + 基本医疗设定 [ACE] + 基本醫療設定 [ACE] Advanced Medical Settings [ACE] @@ -3512,6 +4322,9 @@ Fejlett orvosi beállítások [ACE] Impostazioni Mediche Avanzate [ACE] アドバンスド医療設定 [ACE] + 고급 의료 설정 [ACE] + 进阶医疗设定 [ACE] + 進階醫療設定 [ACE] Enabled for @@ -3525,6 +4338,9 @@ Engedélyezve Abilitato per 次を有効化 + 활성 + 被启用给 + 被啟用給 Select what units the advanced medical system will be enabled for @@ -3534,10 +4350,13 @@ Wähle aus, welche Einheiten unter das erweiterte Sanitätssystem fallen Vyberte, pro jaké jednotky bude pokročilý zdravotní systém povolen Selecione quais unidades o sistema médico avançado será habilitado - Sélectionne pour quelle unité le système de soin avancé est activé + Sélectionne pour quelles unités les soins avancés seront activés Kiválasztható, mely egységek számára legyen engedélyezve a fejlett orvosi rendszer Seleziona per quali unità verrà abilitato i sistema medico avanzato 選択されたユニットが、アドバンスド医療が使えるようになります + 어느 인원에게 고급 의료 시스템을 적용시킬지 선택하십시요. + 选择进阶医疗系统影响的对象 + 選擇進階醫療系統影響的對象 Players only @@ -3547,10 +4366,13 @@ Nur Spieler Pouze hráči Somente jogadores - Joueur uniquement + Joueurs uniquement Csak játékosok Solo giocatori プレイヤーのみ + 플레이어만 + 只限玩家 + 只限玩家 Players and AI @@ -3560,10 +4382,13 @@ Spieler und KI Hráči a AI Jogadores e IA - Joueur et IA + Joueurs et IA Játékosok és AI Giocatori ed IA プレイヤーと AI + 플레이어 및 인공지능 + 玩家与AI + 玩家與AI Enable Advanced wounds @@ -3573,10 +4398,13 @@ Aktiviere erweiterte Wunden Povolit pokročilé zranění Ativar ferimentos avançados - Activer les blessures avancées + Activer les plaies compliquées Komplex sebek engedélyezése Abilita ferite Avanzate アドバンスドな傷を有効化 + 고급 부상 활성화 + 启用进阶伤口系统 + 啟用進階傷口系統 Allow reopening of bandaged wounds? @@ -3586,10 +4414,13 @@ Erlaube das Öffnen von bandagierten Wunden? Umožnit znovuotevření zavázané rány? Permitr reabertura de ferimentos enfaixados? - Permettre la réouverture des bandages + Les plaies peuvent se rouvrir Visszanyílhatnak a bekötözött sebek? Permetti la riapertura di ferite bendate? 包帯で巻かれた傷を再び開くようにしますか? + 붕대가 풀리는것을 활성화합니까? + 启用进阶伤口系统会使已被包扎的伤口有机率裂开 + 啟用進階傷口系統會使已被包紮的傷口有機率裂開 Vehicle Crashes @@ -3603,6 +4434,9 @@ Járműbalesetek Schianto Veicoli 車両の衝突 + 차량 사고 + 载具碰撞 + 載具碰撞 Do units take damage from a vehicle crash? @@ -3616,18 +4450,24 @@ Sérülnek-e az egységek autós ütközés során? Le unità sostengono danni da incidenti con veicoli? ユニットは車両の衝突による損傷を受けるようにしますか? + 차량 사고시 인원들이 부상을 입습니까? + 设定人员是否会因为载具冲撞别的物件而产生伤害? + 設定人員是否會因為載具衝撞別的物件而產生傷害? Allow Epinephrine Erlaube Epiniphrin Permitir Epinefrina Ograniczenia adrenaliny - Autoriser l'adrénaline + Activer l'épinéphrine Permette epinefrina Povolit adrenalin Permitir Epinefrina Разрешить Адреналин アドレナリンの許可 + 에피네프린 활성화 + 允许使用肾上腺素 + 允許使用腎上腺素 Who can use Epinephrine for full heal? (Basic medical only) @@ -3640,6 +4480,9 @@ Quem pode usar Epinefrina para cura completa? (Somente sistema médico básico) Кому разрешено использовать адреналин для полного излечения? (Только для базовой медицины) 完全に回復できるよう誰しもがアドレナリンを使えるようにしますか?(ベーシック医療のみ) + 완전한 체력회복을 위해 어느 인원이 에피네프린을 쓸 수 있습니까? (기본 의료 전용) + 谁可以使用肾上腺素完整医治? (仅适用于基本医疗) + 誰可以使用腎上腺素完整醫治? (僅適用於基本醫療) Allow PAK @@ -3649,10 +4492,13 @@ Erlaube Erste-Hilfe-Set Povolit osobní lékárničky (PAK) Permitir Kit de Primeiros Socorros - Permettre le kit de premier secours + Activer la trousse sanitaire Elsősegélycsomag engedélyezése Consenti Kit di Pronto Soccorso 応急処置キットの許可 + 개인응급키트 활성화 + 允许使用个人急救包 + 允許使用個人急救包 Who can use the PAK for full heal? @@ -3662,10 +4508,13 @@ Wer kann das Erste-Hilfe-Set für eine Endheilung verwenden? Kdo může použít osobní lékárničku pro plné vyléčení? Quem pode usar o KPS para cura completa? - Qui peut utilier les kit de premier secours pour soigner + Qui peut utilier la trousse sanitaire pour des soins complets? Ki használhatja az elsősegélycsomagot teljes gyógyításra? Chi può usare il KPS per cura completa? 完全に回復できるよう誰しもが応急処置キットを使えるようにしますか? + 완전한 체력회복을 위해 어느 인원이 개인응급키트을 쓸 수 있습니까? (기본 의료 전용) + 谁能够使用个人急救包来达到完整医疗? + 誰能夠使用個人急救包來達到完整醫療? Anyone @@ -3675,10 +4524,13 @@ Jeder Kdokoliv Qualquer um - Tout le monde + Tous Akárki Chiunque だれでも + 모두 + 任何人 + 任何人 Medics only @@ -3688,10 +4540,13 @@ Nur Sanitäter Pouze zdravotník Somente médicos - Infirmier uniquement + Infirmiers uniquement Csak orvosok Solo medici 衛生兵のみ + 의무병만 + 只限医疗兵 + 只限醫療兵 Doctors only @@ -3701,10 +4556,13 @@ Nur Ärzte Pouze doktor Somente doutores - Médecin uniquement + Médecins uniquement Csak doktorok Solo dottori 医師のみ + 의사만 + 只限军医 + 只限軍醫 Remove PAK on use @@ -3714,10 +4572,13 @@ Entf. Erste-Hilfe-Set bei Verwendung Odebrat osobní lékárničku po použití Remover o KPS depois do uso - Enlever le KPS à l'utilisation + Utilisation unique de la trousse sanitaire Elsősegélycsomag eltávolítása használatkor Rimuovi Kit Pronto Soccorso dopo l'uso 応急処置キットの削除 + 개인응급키트 사용후 사라짐 + 在使用后删除个人急救包 + 在使用後刪除個人急救包 Should PAK be removed on usage? @@ -3727,34 +4588,43 @@ Sollen Erste-Hilfe-Sets bei Verwendung entfernt werden? Má se osobní lékárnička odstranit po použití? Deve o KPS ser removido depois do uso? - Le Kit de Premier Secours doit il être enlevé à l'utilisation? + La trousse sanitaire doit être consommée à l'utilisation? Eltávolítódjon az elsősegélycsomag használatkor? Il Kit Pronto Soccorso dev'essere rimosso dopo l'utilizzo? 応急処置キットを使うと削除しますか? + 개인응급키트를 사용하고 나서 제거합니까? + 要在使用后删除个人急救包吗? + 要在使用後刪除個人急救包嗎? Locations Epinephrine Orte für Epiniphrin Ubicaciones epinefrina Ograniczenia adrenaliny - Position des adrénalines + Utilisation de l'épinéphrine Ubicazione epinefrina Oblast k použití adrenalinu Localizações de Epinefrina Место использования адреналина アドレナリンをつかう場所 + 에피네프린 사용 장소 + 肾上腺素使用地点 + 腎上腺素使用地點 Where can the Epinephrine be used? (Basic Medical) Wo kann Epiniphrin verwendet werden? (Standard Sanitätseinstellungen) Configura donde puede usarse Epinefrina (Solo sistema médico básico) Gdzie można korzystać z adrenaliny? (Podstawowy system medyczny) - Où peuvent être utilisées les adrénalines ? (Médical basique) + Où peut être utilisé l'épinéphrine ? (Médical basique) Dove si può usare l'epinefrina? (Sistema medico di base) Kde může být použit adrenalin? (Pouze základní zdravotní systém) Onde pode-se usar a Epinefrina? (Somente sistema médico básico) Где может использоваться адреналин? (Базовая медицина) どこでもアドレナリンをつかえるようにしますか?(ベーシック医療のみ) + 어디에서 에피네프린을 사용할 수 있습니까? (기본 의료) + 在哪里可以使用肾上腺素? (基本医疗) + 在哪裡可以使用腎上腺素? (基本醫療) Locations PAK @@ -3764,10 +4634,13 @@ Orte für Erste-Hilfe-Set Oblast k použití PAK Localizações do KPS - Lieu d'utilisation du KPS + Lieu d'utilisation da trousse sanitaire Elsősegélycsomag helyek Locazioni Kit Pronto Soccorso 応急処置キットをつかう場所 + 개인응급키트 사용 장소 + 个人急救包使用地点 + 個人急救包使用地點 Where can the PAK be used? @@ -3777,36 +4650,45 @@ Wo kann das Erste-Hilfe-Set verwendet werden? Kde může být použita osobní lékárnička (PAK)? Onde o kit de primeiros socorros pode ser utilizado? - Où le Kit de Premier Secour peut être utilisé + Où la trousse sanitaire peut être utilisée ? Hol lehet az elsősegélycsomagot használni? Dove può essere usato il Kit Pronto Soccorso? どこでも応急処置キットをつかえるようにしますか? + 어디에서 개인응급키트를 사용할 수 있습니까? + 在哪里可以使用个人急救包? + 在哪裡可以使用個人急救包? Condition PAK Bedingungen für d. Erste-Hilfe-Set Podmínky pro použití osobní lékárničky Condición EPA - Condition d'utilisation du KPS + Condition d'utilisation de la trousse sanitaire Warunek apteczek Elsősegélycsomag állapot Condição do KPS Условие использования аптечки Condizioni Kit Pronto Soccorso 応急処置キットの状態 + 개인응급키트 상태 + 个人急救包使用条件 + 個人急救包使用條件 When can the PAK be used? Wann kann das Erste-Hilfe-Set verwendet werden? Kdy může být použita osobní lékárnička? ¿Cuando se puede utilizar el Equipo de primeros auxilios? - Quand peut être utilisé le Kit de Premier Secours + Quand peut être utilisé la trousse sanitaire? Po spełnieniu jakich warunków apteczka osobista może zostać zastosowana na pacjencie? Mikor lehet az elsősegélycsomagot használni? Onde o kit de primeiros socorros pode ser utilizado? Когда может использоваться аптечка? Quando può essere usato il Kit Pronto Soccorso? どこでも応急処置キットをつかえるようにしますか? + 언제 개인응급키트를 사용할 수 있습니까? + 何时可以使用个人急救包? + 何時可以使用個人急救包? Anywhere @@ -3816,10 +4698,13 @@ Überall Kdekoliv Qualquer lugar - PArtout + Partout Akárhol Ovunque どこでも + 어디서나 + 任何地方 + 任何地方 Medical vehicles @@ -3829,10 +4714,13 @@ Sanitätsfahrzeuge Zdravotnická vozidla Veículos médcos - Dans les véhicules médicals + Dans les véhicules sanitaires Orvosi járművek Veicoli medici 医療車両のみ + 의료차량 + 医疗载具 + 醫療載具 Medical facility @@ -3842,10 +4730,13 @@ Medizinische Einrichtungen Zdravotnické zařízení Instalação médica - Dans les installations médicales + Dans les structures sanitaires Orvosi létesítmény Strutture mediche 医療施設でのみ + 의료시설 + 医疗设施 + 醫療設施 Vehicles & facility @@ -3855,10 +4746,13 @@ Fahrzeuge & Einrichtungen Vozidla a zařízení Veículos e instalações - Dans les véhicules et les installations médicals + Dans les véhicules et les structures sanitaires Járművek & létesítmény Veicoli e Strutture - 車両 &amp; 施設 + 車両 & 施設 + 차량 및 시설 + 医疗载具 & 医疗设施 + 醫療載具 & 醫療設施 Allow Surgical Kit (Adv) @@ -3868,10 +4762,13 @@ Erlaube Operationskasten Povolit chirurgickou soupravu (Pokr.) Permite kit cirúrgico (avançado) - Permettre les kit de chirurgie (Avancé) + Permettre les trousses chirurgicales (Avancé) Sebészkészlet (Fejlett) engedélyezése Permetti Kit Chirurgico (Avanzato) - 縫合キットの許可 (Adv) + 縫合キットの許可 (アド) + 봉합키트 활성화 (고급) + 允许使用手术包 (进阶伤口) + 允許使用手術包 (進階傷口) Who can use the Surgical Kit? @@ -3881,10 +4778,13 @@ Wer kann den Operationskasten verwenden? Kdo může použít chirurgickou soupravu? Quem pode usar o kit cirúrgico? - Qui peut utiliser les kit de chirurgie + Qui peut utiliser les trousses chirurgicales? Ki használhatja a sebészkészletet? Chi può usare il Kit Chirurgico? だれでも縫合キットをつかえるようにしますか? + 어느 인원이 봉합키트를 사용할 수 있습니까? + 谁能够使用手术包? + 誰能夠使用手術包? Remove Surgical Kit (Adv) @@ -3894,10 +4794,13 @@ Entferne Operationskasten (erweitert) Odebrat chirurgickou soupravu (Pokr.) Remover kit cirúrgico (avançado) - Supprimer les kit de chirurgie (Avancé) + Consommer les trousses chirurgicales (Av.) Sebészkészlet (Fejlett) eltávolítása Rimuovi Kit Chirurgico (Avanzato) - 縫合キットを削除 (Adv) + 縫合キットを削除 (アド) + 봉합키트 제거 (고급) + 在使用后删除手术包 (进阶伤口) + 在使用後刪除手術包 (進階傷口) Should Surgical kit be removed on usage? @@ -3907,10 +4810,13 @@ Entferne Operationskästen bei Verwendung? Odebrat chirurgickou soupravu po použití? Deve o kit cirúrgico ser removido após o uso? - Le kit de chirurgie doit il être supprimé à l'utilisation + La trousse chirurgicale doit être consommée à l'utilisation? Eltávolítódjon a sebészkészlet használatkor? Il Kit Chirurgico dev'essere rimosso dopo l'uso? 縫合キットをつかった後に削除しますか? + 봉합키트를 사용하고 나서 제거합니까? + 手术包会在使用后被删除吗? + 手術包會在使用後被刪除嗎? Locations Surgical Kit (Adv) @@ -3920,10 +4826,13 @@ Orte für Operationskästen (erweitert) Lokace chirurgické soupravy (Pokr.) Localizações do kit cirúrgico (avançado) - Lieu d'utilisation du kit de chirurgie + Lieu d'utilisation des trousses chirurgicales Sebészkészlet (Fejlett) helyei Località Kit Chirurgico (Avanzato) - 縫合キットをつかう場所 (Adv) + 縫合キットをつかう場所 (アド) + 봉합키트 사용 장소 (고급) + 手术包使用地点 (进阶伤口) + 手術包使用地點 (進階傷口) Where can the Surgical Kit be used? @@ -3933,36 +4842,45 @@ Wo kann der Operationskasten verwendet werden? Kde může být použita chirurgická souprava? Onde o kit cirúrgico pode ser utilizado? - Où peut être utilisé les kit de chirurgie + Où peut être utilisé les trousses chirurgicales? Hol lehet a sebészkészletet használni? Dove può essere usato il Kit Chirurgico? どこでも縫合キットをつかえるようにしますか? + 어디에서 봉합키트를 사용할 수 있게 합니까? + 定义手术包可被使用的地方? + 定義手術包可被使用的地方? Condition Surgical Kit (Adv) Beding. für d. Operationskasten (erw.) Podmínka chirurgické soupravy (Pokr.) Condición de equipo quirúrgico (Av) - Conditions d'utilisation du kit de chirurgie + Conditions d'utilisation de la trousse chirurgicale (Av.) Warunek zestawu chirurgicznego Sebészkészlet állapot Condição do Kit Cirúrgico (Avançado) Условие использования хирургического набора (усл.) Condizioni Kit Chirurgico (Avanzato) - 縫合キットの状態 (Adv) + 縫合キットの状態 (アド) + 봉합키트 상태 (고급) + 使用手术包的条件 (进阶伤口) + 使用手術包的條件 (進階傷口) When can the Surgical Kit be used? Wann kann der Operationskasten verwendet werden? Kde může být použita chirurgická souprava? ¿Cuando se puede utilizar el equipo quirúrgico? - Quand peut être utilisé les kit de chirurgie + Quand peut être utilisé la trousse chirurgicale Po spełnieniu jakich warunków zestaw chirurgiczny może zostać zastosowany na pacjencie? Mikor lehet a sebészkészletet használni? Onde o kit cirúrgico pode ser utilizado? Когда может использоваться хирургический набор? Quando può essere usato il Kit Chirurgico? いつでも縫合キットをつかえるようにしますか? + 언제 봉합키트를 사용할 수 있습니까? + 何时可以使用手术工具包? + 何時可以使用手術工具包? Heal hitpoints @@ -3973,8 +4891,11 @@ Curar hitpoints Léčit hitponty Cura Hitpoints - Soigner les dommages + Soigner les blessures ヒットポイントの回復 + 체력 회복 + 完整治疗 + 完整治療 Heal fully bandaged hitpoints @@ -3987,6 +4908,9 @@ Cura Hitpoints completamente bendati Soigner les plaies entièrement bandées. 包帯によりヒットポイントを完全に回復する + 붕대를 감아서 체력을 회복 + 完全医疗包扎的部位至痊愈 + 完全醫療包紮的部位至痊癒 Pain suppression @@ -3995,11 +4919,14 @@ Potlačení bolesti Supresión del dolor Supressão de dor - Suppression de la douleur + Traitement de la douleur Fájdalomcsillapítás Приглушение боли Soppressione dolore 痛みの継続 + 고통 억제 + 疼痛抑制 + 疼痛抑制 Pain is only temporarily suppressed, not removed @@ -4008,11 +4935,14 @@ Bolest je potlačena, ale jen dočastně El dolor se suprime solo temporalmente, no se elimina. Dor é somente temporáriamente suprimida, não removida - La douleur est temporairement supprimée, pas enlevée + La douleur est seulement temporairement calmée A fájdalom csak ideiglenesen csökken, nem távolítódik el Боль приглушается только временно Dolore è solo temporaneamente soppresso, non rimosso 痛みを一時的に継続させ、取り除かない + 고통은 제거가 아닌 일시적으로 억제만 가능합니다. + 疼痛只会被暂时抑制,而不能完全消除 + 疼痛只會被暫時抑制,而不能完全消除 Configure the treatment settings from ACE Basic Medical @@ -4024,6 +4954,9 @@ Configura as opções de tratamento do sistema médico básico do ACE Настройка лечения в базовой медицинской системе ACE ACE ベーシック医療による設定で、治療を設定する + ACE 기본 의료에 대한 치료 설정 수정 + 设定ACE基本医疗的规则 + 設定ACE基本醫療的規則 Configure the treatment settings from ACE Advanced Medical @@ -4033,10 +4966,13 @@ Behandlungseinstellungen vom ACE-Medizin konfigurieren Konfigurace nastavení léčby ze zdravotnické systému ACE Configure as opções de tratamento do ACE Médico - Configure les paramètres de traitement du système de soin ACE + Configure les réglages de traitement dans dans ACE médical avancé Kezelési lehetőségek konfigurálása az ACE Orvosi rendszerből Configura le impostazioni trattamenti per ACE Medical ACE アドバンスド医療による設定で、治療を設定する + ACE 고급 의료에 대한 치료 설정 수정 + 设定ACE进阶医疗的规则 + 設定ACE進階醫療的規則 Revive Settings [ACE] @@ -4050,6 +4986,9 @@ Újraélesztés beállításai [ACE] Impostazioni Revive [ACE] リバイブ設定 [ACE] + 소생 설정 [ACE] + 复苏设定 [ACE] + 復甦設定 [ACE] Enable Revive @@ -4063,6 +5002,9 @@ Újraélesztés engedélyezése Abilita Revive リバイブを有効化 + 소생 활성화 + 启用复苏 + 啟用復甦 Enable a basic revive system @@ -4072,10 +5014,13 @@ Aktiviere Standard-Wiederbelebungssystem Povolit základní systém oživení Habilitar um sistema básico de reavivamento - Active un sytème de revive basique + Active un système de revive basique Egy alap újraélesztési rendszer engedélyezése Abilita un sistema revive basico ベーシックなリバイブを有効化 + 기본 소생 시스템 활성화 + 启用基本复苏系统 + 啟用基本復甦系統 Max Revive time @@ -4085,10 +5030,13 @@ Maximale Wiederbelebungszeit Maximální čas pro oživení Tempo máximo de reavivamento - Temps maximum pour le revive + Délai maximum pour le revive Maximum újraélesztési idő Tempo massimo Revive 最大リバイブ時間 + 최대 소생 시간 + 最大复苏时间 + 最大復甦時間 Max amount of seconds a unit can spend in revive state @@ -4098,10 +5046,13 @@ Maximale Zeitspanne in Sekunden die eine Einheit im Wiederbelebungszustand verbringen kann Maximální doba v agónii v sekundách Quantidade máxima de segundos que uma unidade pode gastar em um estado de reavivamento - Nombre de seconde maximum qu'une unité peut être en attente d'un revive + Délai d'attente maximum pour un revive Maximum másodperc, amit egy egység újraélesztési állapotban tölthet Numero massimo di secondi che un'unità può spendere in stato revive ユニットがリバイブ状態になっている最大時間を設定できます + 소생상태에서 인원이 버틸 수 있는 최대 시간을 초 단위로 정합니다 + 人员在等待复苏状态下能够等待的最大时间(秒) + 人員在等待復甦狀態下能夠等待的最大時間(秒) Max Revive lives @@ -4115,6 +5066,9 @@ Maximum újraélesztési lehetőségek Numero massimo Revives 最大リバイブ数 + 최대 소생 횟수 + 最大被救活次数 + 最大被救活次數 Max amount of lives a unit. 0 or -1 is disabled. @@ -4124,10 +5078,13 @@ Anzahl der Leben einer Einheit. 0 oder -1 bedeutet deaktiviert. Maximální počet životu pro jednotku. 0 nebo -1 je zakázáno. Quantidade máxima de vidas por unidade. 0 ou -1 é desativado. - Nombre de vie maximale d'une unité. 0 ou -1 désactive + Nombre de vie maximum d'une unité. 0 ou -1 désactive Egy egység maximum "életei". 0 vagy -1 letiltja. Numero massimo di vite di un'unità. 0 o -1 per disabilitare. ユニットの最大リバイブ数を設定できます。0 または -1 は無効化になります + 소생 가능한 횟수입니다. 0 혹은 -1 로 비활성화 합니다 + 一个人员最大可被救活次数,0或-1为关闭 (无限救活) + 一個人員最大可被救活次數,0或-1為關閉 (無限救活) Provides a medical system for both players and AI. @@ -4137,10 +5094,13 @@ Aktiviert das Sanitätssystem für Spieler und KI. Poskytuje zdravotní systém pro hráče a AI. Proporciona um sistema médico para jogadores e IA. - Fourni un sytème médical pour les joueurs et les IAs + Fourni un sytème médical pour les joueurs et les IA. Egy orvosi rendszert ad játékosok és AI-k számára. Fornisce un sistema medico sia per giocatori che IA プレイヤーと AI の両方へ医療システムを提供します。 + 플레이어와 인공지능 모두에게 의료 시스템을 지원합니다. + 医疗系统将同时作用在玩家与AI + 醫療系統將同時作用在玩家與AI Set Medic Class [ACE] @@ -4150,10 +5110,13 @@ Setze Sanitäterklassen [ACE] Určit třídu medika [ACE] Definir classe médica [ACE] - Définir comme unité médicale [ACE] + Définir classe médicale [ACE] Orvos beállítása [ACE] Imposta Classe Medico [ACE] 衛生兵クラスとして設定 [ACE] + 의무병 보직 설정 [ACE] + 设定医疗兵单位 [ACE] + 設定醫療兵單位 [ACE] List @@ -4167,6 +5130,9 @@ Lista Lista 一覧 + 목록 + 列表 + 列表 List of unit names that will be classified as medic, separated by commas. @@ -4176,10 +5142,13 @@ Aufzählung von Einheiten, die als Sanitäter gelten. Werden durch Kommata getrennt. Seznam osob které budou klasifikovány jako zdravotník, oddělené čárkami. Lista dos nomes das unidades que se classificam como médicos, separados por vírgulas. - Liste d'unité qui seront listées comme infirmier, séparation par virgule + Liste d'unité qui seront qualifiés comme infirmier, séparation par virgule. Azon egységek nevei, melyek orvosként vannak meghatározva, vesszővel elválasztva. Lista di nomi unità che verranno classificati come medici, separati da virgole. 衛生兵として設定されるユニット名を一覧で指定でき、コンマで区切りを付けられます。 + 보직 이름 목록으로 의무병이 구분됩니다, 쉼표로 구분. + 列出的单位名字将被指派为医疗兵,记得用逗号隔开! + 列出的單位名字將被指派為醫療兵,記得用逗號隔開! Is Medic @@ -4193,6 +5162,9 @@ Orvos-e E' Medico 衛生兵として + 의무병 + 是医疗兵 + 是醫療兵 This module allows you to assign the medic class to selected units. @@ -4206,6 +5178,9 @@ Este módulo permite asignar la clase médico a las unidades seleccionadas. Questo modulo ti permette di assegnare la classe Medico alle unità selezionate. 選択されたユニットを衛生兵として指定します。 + 이 모듈은 선택한 보직이 의무병을 할 수 있게 해줍니다. + 本模块可让被同步的单位成为医疗兵 + 本模塊可讓被同步的單位成為醫療兵 None @@ -4219,6 +5194,9 @@ Nincs Nessuno なし + 없음 + + Regular medic @@ -4228,10 +5206,13 @@ Normaler Sanitäter Řadový zdravotník Médico regular - Infirmier standard + Infirmier Hagyományos orvos Medico Regolare 通常の衛生兵 + 일반 의무병 + 普通医疗兵 + 普通醫療兵 Doctor (Only Advanced Medics) @@ -4244,7 +5225,10 @@ Médecin (traitements avancés uniquement) Doktor (csak fejlett orvosok) Dottore (Solo Medici Avanzati) - 医師 (アドバンスド医療でのみ) + 医師 (アドバンスド医療のみ) + 의사 (오직 고급 의료에서만) + 军医 (只限进阶医疗系统) + 軍醫 (只限進階醫療系統) Doctor @@ -4258,6 +5242,9 @@ Doktor Dottore 医師 + 의사 + 军医 + 軍醫 Assigns the ACE medic class to a unit @@ -4271,6 +5258,9 @@ Az ACE orvosi jelző hozzárendelése egy egységhez Assegna la classe medico ACE ad un'unità ユニットを ACE の衛生兵として割り当てる + 인원에게 ACE 의무병 보직 선정 + 指派ACE医疗职位给该单位 + 指派ACE醫療職位給該單位 Set Medical Vehicle [ACE] @@ -4284,6 +5274,9 @@ Orvosi jármű beállítása [ACE] Imposta Veicolo Medico [ACE] 医療車両を設定 [ACE] + 의료 차랑 선정 [ACE] + 设定医疗载具 [ACE] + 設定醫療載具 [ACE] List @@ -4297,6 +5290,9 @@ Lista Lista 一覧 + 목록 + 列表 + 列表 List of vehicles that will be classified as medical vehicle, separated by commas. @@ -4310,6 +5306,9 @@ Orvosi járműveknek tekintett járművek listája, vesszővel elválasztva. Lista di veicoli che verranno classificati come veicoli medici, separati da virgole. 医療車両として設定されるクラス名を一覧で指定でき、コンマで区切りを付けられます + 차량 명칭 목록으로 의료차량이 구분됩니다, 쉼표로 구분. + 列出的载具将被指定为医疗载具,记得用逗号隔开! + 列出的載具將被指定為醫療載具,記得用逗號隔開! Is Medical Vehicle @@ -4323,6 +5322,9 @@ Orvosi jármű-e E' Veicolo Medico 医療車両として + 의료 차량 + 是医疗载具 + 是醫療載具 Whatever or not the objects in the list will be a medical vehicle. @@ -4336,6 +5338,9 @@ A listában lévő objektumok orvosi járművek-e, vagy sem. Gli oggetti nella lista verranno considerati veicoli medici o meno. どれでも、またはこの一覧にないオブジェクトを医療車両として割り当てる。 + 무엇이 되었던간에 이 목록에 있는 물체는 의료 차량이 됩니다. + 列表中的载具将会变成医疗载具 + 列表中的載具將會變成醫療載具 Assigns the ACE medic class to a unit @@ -4349,6 +5354,9 @@ Hozzárendeli az ACE orvosi jelzőt egy egységhez Assegna la classe medico ACE ad un'unità ユニットを ACE の衛生兵として割り当てる + 指派ACE医疗职位给该单位 + 指派ACE醫療職位給該單位 + 병력에 ACE 의무병 보직 선정 Set Medical Facility [ACE] @@ -4358,10 +5366,13 @@ Setze medizinische Einrichtung [ACE] Určit zdravotnické zařízení [ACE] Definir instalação médica [ACE] - Définir comme équipement médical [ACE] + Définir comme installation médical [ACE] Orvosi létesítmény beállítása [ACE] Imposta Struttura Medica [ACE] - 医療施設として設定 [ACE] + 医療施設を設定 [ACE] + 의료시설 선정 [ACE] + 设定医疗设施 [ACE] + 設定醫療設施 [ACE] Is Medical Facility @@ -4371,10 +5382,13 @@ Ist eine medizinische Einrichtung Zdravotnické zařízení É uma instalação médica - Est un équipement médical + Est une installation médical Orvosi létesítmény-e E' Struttura Medica 医療施設として + 의료시설 + 是医疗设施 + 是醫療設施 Registers an object as a medical facility @@ -4384,10 +5398,13 @@ Definiert ein Objekt als medizinische Einrichtung Registruje objekt jako zdravotnické zařízení Registra um objeto como instalacão médica - Enregistrer un objet comme un équipement médical + Enregistrer un objet comme une installation médical Egy objektum orvosi létesítményként való regisztrálása Registra un oggetto come struttura medica オブジェクトを医療施設として割り当てる + 물체를 의료시설로 등록합니다 + 指定一个物件作为医疗设施 + 指定一個物件作為醫療設施 Defines an object as a medical facility. This allows for more advanced treatments. Can be used on buildings and vehicles. @@ -4397,10 +5414,13 @@ Definiert ein Objekt als medizinische Einrichtung. Hier werden weitere, tiefgreifende Behandlungen ermöglicht. Kann Fahrzeugen oder Gebäuden zugewiesen werden. Definuje objekt jako zdravotnické zařízení. To umožňuje více pokročilé léčení. Může být použito na budovy nebo na vozidla. Define um objeto como instalação médica. Isso permite tratamentos mais avançados. Pode ser utilizado em edifícios e veículos. - Définir un objet comme équipement médical. Cela permet les traitements avancés. Peut être utilisé sur les batiments et les véhicules + Définir un objet comme installation médical. Cela permet les traitements avancés. Peut être utilisé sur les batiments et les véhicules Egy objektumot orvosi létesítményként határoz meg. Ez fejlett ellátási lehetőségeket engedélyez. Használható járműveken és épületeken. Definisce un oggetto come struttura medica. Questo permette cure più avanzate. Può essere usato su edifici e veicoli. - オブジェクトを医療施設として割り当てます。割り当てられた場合、より高度な治療が可能になり、建物と車両へつかえます。 + オブジェクトを医療施設として割り当てます。建物と車両へ割り当てられた場合、より高度な治療が可能になります。 + 물체를 의료시설로 정의합니다. 건물 혹은 차량이 될 수 있습니다. 이는 고급 의료 조치를 할 수 있게해줍니다. + 定义一个物件作为医疗设施,此医疗设施将被允许使用更进阶的医疗方法。此功能可用于建筑物或是载具上! + 定義一個物件作為醫療設施,此醫療設施將被允許使用更進階的醫療方法。此功能可用於建築物或是載具上! [ACE] Medical Supply Crate (Basic) @@ -4413,7 +5433,10 @@ [ACE] Caisse médicale (basique) [ACE] Orvosi láda (Alap) [ACE] Cassa Rifornimenti Medici (Basico) - [ACE] 医療箱 (ベーシック) + [ACE] 医療物資箱 (ベーシック) + [ACE] 의료 물자 (기본) + [ACE] 医疗补给箱(基本) + [ACE] 醫療補給箱(基本) [ACE] Medical Supply Crate (Advanced) @@ -4426,7 +5449,10 @@ [ACE] Caisse médicale (avancée) [ACE] Orvosi láda (Fejlett) [ACE] Cassa Rifornimenti Medici (Avanzato) - [ACE] 医療箱 (アドバンスド) + [ACE] 医療物資箱 (アドバンスド) + [ACE] 의료 물자 (고급) + [ACE] 医疗补给箱(进阶) + [ACE] 醫療補給箱(進階) Anytime @@ -4440,6 +5466,9 @@ В любое время Sempre いつでも + 언제나 + 任何时间 + 任何時間 Stable @@ -4453,6 +5482,9 @@ После стабилизации Stabile 安定 + 안정된 + 稳定状态下 + 穩定狀態下 Medical @@ -4466,6 +5498,9 @@ Médico Orvosi 治療 + 의료 + 医疗设定 + 醫療設定 Distance to %1 has become to far for treatment @@ -4478,6 +5513,9 @@ Distanza da %1 è diventata troppo alta per permettere trattamento %1 est trop loin pour être soigné %1 は治療をできない所まで離れた + %1 부터의 거리가 너무 멀어 치료할 수 없습니다 + 设定当距离超过%1将不能使用治疗动作 + 設定當距離超過%1將不能使用治療動作 This person (%1) is awake and cannot be loaded @@ -4488,8 +5526,11 @@ Esta pessoa (%1) está acordada e não pode ser carregada Tato osoba (%1) je vzhůru a nemůže být naložena Questa persona (%1) è sveglia e non può essere caricata. - Cette personne (%1) est consciente et ne peut être chargées. + %1 est conscient et ne peut être embarqué. 患者 (%1) は意識があり、積み込めない + 이 사람 (%1) 은(는) 의식이 있어 태우지 못합니다 + 此人(%1)是清醒且不能被装载 + 此人(%1)是清醒且不能被裝載 There is no tourniquet on this body part! @@ -4502,6 +5543,9 @@ Non c'è nessun laccio emostatico su questa parte del corpo! Il n'y a pas de garrot sur ce membre ! 身体には止血帯が無い! + 이 부위에는 지혈대가 없습니다! + 这部位没有止血带! + 這部位沒有止血帶! Medical training @@ -4514,6 +5558,9 @@ Treino médico Медицинская подготовка 治療の訓練 + 의료 훈련 + 医疗训练 + 醫療訓練 Whether or not the object will be a medical vehicle. @@ -4521,10 +5568,13 @@ L'oggetto in questione sarà un veicolo medico o meno. Legt fest, ob das Objekt ein Sanitätsfahrzeug ist. Es un vehículo médico? - Définit si le véhicule est un véhicule médical ou non. + Détermine si c'est un véhicule sanitaire. Se o objeto será ou não um veículo médico Будет ли объект считаться медицинским транспортом. どれでも、またはオブジェクトを医療車両として割り当てます。 + 무엇이 되었던간에 이 목록에 있는 물체는 의료 차량이 됩니다. + 是否使该载具为医疗载具? + 是否使該載具為醫療載具? Delay cease fire of AI while player is unconscious for medical reasons. @@ -4532,10 +5582,13 @@ Ritarda il cessate il fuoco dell'IA quando il giocatore è svenuto per motivi medici. Prodleva zastavení palby pro AI, pokud je hráč v bezvědomí ze zdravotních důvodů. Atraso durante cessar fogo da AI durante inconsciência médica - Délai de cessez le feu pour l'IA pendant que le joueur est inconscient pour des raisons médicales + Délai de cessez le feu pour l'IA pendant que le joueur est inconscient pour des raisons médicales. Задержка прекращения огня ботами, когда игрок теряет сознание по медицинским причинам. AI はプレイヤーが医療的な理由で気絶している場合にかぎり、撃つのをためらいます。 Opóźnij stan wstrzymania ognia u AI kiedy gracz jest nieprzytomny z powodów medycznych. + 의료상의 이유로 플레이어가 기절할 경우 인공지능이 발사를 지연합니다. + 当玩家为无意识的状态时, 延长AI的停火时间 + 當玩家為無意識的狀態時, 延長AI的停火時間 Delay cease fire of AI for unconsciousness @@ -4548,6 +5601,25 @@ Délai de cessez le feu de l'IA pour la perte de conscience Задержка прекращения огня ботами при потере сознания AI は気絶している人へ、ためらってから射撃します + 기절할 경우 인공지능이 발사를 지연합니다 + 延长AI对已无意识玩家的停火时间 + 延長AI對已無意識玩家的停火時間 + + + Open lid + Deckel aufklappen + フタをあける + Apri lid + 打開蓋子 + 打开盖子 + + + Close lid + Deckel zuklappen + フタをしめる + Chiudi lid + 關閉蓋子 + 关闭盖子 diff --git a/addons/medical_ai/XEH_preInit.sqf b/addons/medical_ai/XEH_preInit.sqf index a7feade1c3..b47cf6628d 100644 --- a/addons/medical_ai/XEH_preInit.sqf +++ b/addons/medical_ai/XEH_preInit.sqf @@ -2,6 +2,8 @@ ADDON = false; +PREP_RECOMPILE_START; #include "XEH_PREP.hpp" +PREP_RECOMPILE_END; ADDON = true; diff --git a/addons/medical_ai/functions/fnc_canRequestMedic.sqf b/addons/medical_ai/functions/fnc_canRequestMedic.sqf index 75a4a0fb32..39a5063f24 100644 --- a/addons/medical_ai/functions/fnc_canRequestMedic.sqf +++ b/addons/medical_ai/functions/fnc_canRequestMedic.sqf @@ -8,6 +8,9 @@ * Return Value: * Can request medic * + * Example: + * call ACE_medical_ai_fnc_canRequestMedic + * * Public: No */ #include "script_component.hpp" diff --git a/addons/medical_ai/functions/fnc_healSelf.sqf b/addons/medical_ai/functions/fnc_healSelf.sqf index 3cf8ad75e9..253dcd2a45 100644 --- a/addons/medical_ai/functions/fnc_healSelf.sqf +++ b/addons/medical_ai/functions/fnc_healSelf.sqf @@ -6,7 +6,10 @@ * None * * Return Value: - * Nothing + * None + * + * Example: + * call ACE_medical_ai_fnc_healSelf * * Public: No */ diff --git a/addons/medical_ai/functions/fnc_healUnit.sqf b/addons/medical_ai/functions/fnc_healUnit.sqf index 52b0c51e6e..78471469da 100644 --- a/addons/medical_ai/functions/fnc_healUnit.sqf +++ b/addons/medical_ai/functions/fnc_healUnit.sqf @@ -6,7 +6,10 @@ * None * * Return Value: - * Nothing + * None + * + * Example: + * call ACE_medical_ai_fnc_healUnit * * Public: No */ @@ -29,6 +32,7 @@ if (isNull _target || {!alive _target} || {!(_target call FUNC(isInjured))}) exi _this forceSpeed -1; // return to formation instead of going where the injured unit was if it healed itself in the mean time _this doFollow leader _this; + _this setVariable [QGVAR(movingToInjured), false]; #ifdef DEBUG_MODE_FULL systemChat format ["%1 finished healing %2", _this, _target]; @@ -50,6 +54,7 @@ _target forceSpeed 0; private _needsBandaging = ([_target] call EFUNC(medical,getBloodLoss)) > 0; private _needsMorphine = (_target getVariable [QEGVAR(medical,pain), 0]) > 0.2; +private _needsEpinephrine = _target getVariable ["ACE_isUnconscious", false]; switch (true) do { case _needsBandaging: { @@ -62,7 +67,7 @@ switch (true) do { }; } forEach _openWounds; private _selection = ["head","body","hand_l","hand_r","leg_l","leg_r"] select _partIndex; - [_target, "Bandage", _selection] call EFUNC(medical,treatmentAdvanced_bandageLocal); + [_this, _target, _selection, "Bandage"] call EFUNC(medical,treatmentAdvanced_bandage); #ifdef DEBUG_MODE_FULL systemChat format ["%1 is bandaging selection %2 on %3", _this, _selection, _target]; @@ -73,7 +78,7 @@ switch (true) do { _this setVariable [QGVAR(treatmentOverAt), CBA_missionTime + 5]; }; case _needsMorphine: { - [_target] call EFUNC(medical,treatmentBasic_morphineLocal); + [_this, _target] call EFUNC(medical,treatmentBasic_morphine); [_this, false, false] call FUNC(playTreatmentAnim); _this setVariable [QGVAR(treatmentOverAt), CBA_missionTime + 2]; @@ -81,4 +86,13 @@ switch (true) do { systemChat format ["%1 is giving %2 morphine", _this, _target]; #endif }; + case _needsEpinephrine: { + [_this, _target] call EFUNC(medical,treatmentBasic_epipen); + [_this, false, false] call FUNC(playTreatmentAnim); + _this setVariable [QGVAR(treatmentOverAt), CBA_missionTime + 2]; + + #ifdef DEBUG_MODE_FULL + systemChat format ["%1 is using an epipen on %2", _this, _target]; + #endif + }; }; diff --git a/addons/medical_ai/functions/fnc_isInjured.sqf b/addons/medical_ai/functions/fnc_isInjured.sqf index 6852fc1c58..b4bece59d4 100644 --- a/addons/medical_ai/functions/fnc_isInjured.sqf +++ b/addons/medical_ai/functions/fnc_isInjured.sqf @@ -8,15 +8,18 @@ * Return Value: * Does unit need treatment * + * Example: + * call ACE_medical_ai_fnc_isInjured + * * Public: No */ #include "script_component.hpp" if !(alive _this) exitWith {false}; -private _bloodLoss = [_this] call EFUNC(medical,getBloodLoss); -private _pain = _this getVariable [QEGVAR(medical,pain), 0]; -// Advanced only? +private _bloodLoss = [_this] call EFUNC(medical,getBloodLoss); +private _pain = _this getVariable [QEGVAR(medical,pain), 0]; +private _unconscious = _this getVariable ["ACE_isUnconscious", false]; // private _heartRate = _this getVariable [QEGVAR(medical,heartRate), 70]; -(_bloodLoss > 0) || {_pain > 0.2} // || {_heartRate > 100} || {_heartRate < 40} +(_bloodLoss > 0) || {_pain > 0.2} || _unconscious // || {_heartRate > 100} || {_heartRate < 40} diff --git a/addons/medical_ai/functions/fnc_isSafe.sqf b/addons/medical_ai/functions/fnc_isSafe.sqf index 92bbc60587..de7d9667cc 100644 --- a/addons/medical_ai/functions/fnc_isSafe.sqf +++ b/addons/medical_ai/functions/fnc_isSafe.sqf @@ -8,6 +8,9 @@ * Return Value: * Is unit safe enough * + * Example: + * call ACE_medical_ai_fnc_isSafe + * * Public: No */ #include "script_component.hpp" diff --git a/addons/medical_ai/functions/fnc_playTreatmentAnim.sqf b/addons/medical_ai/functions/fnc_playTreatmentAnim.sqf index 93a784922d..de2c0ee30e 100644 --- a/addons/medical_ai/functions/fnc_playTreatmentAnim.sqf +++ b/addons/medical_ai/functions/fnc_playTreatmentAnim.sqf @@ -8,7 +8,10 @@ * 2: Is self treatment * * Return Value: - * Nothing + * None + * + * Example: + * [bob, true, true] call ACE_medical_ai_fnc_playTreatmentAnim * * Public: No */ @@ -32,7 +35,12 @@ if (stance _unit == "PRONE") then { }; private _anim = getText (_animConfig >> _configProperty); -private _wpn = ["non", "rfl", "pst"] select (1 + ([primaryWeapon _unit, handgunWeapon _unit] find (currentWeapon _unit))); +private _wpn = switch (true) do { + case ((currentWeapon _unit) == ""): {"non"}; + case ((currentWeapon _unit) == (primaryWeapon _unit)): {"rfl"}; + case ((currentWeapon _unit) == (handgunWeapon _unit)): {"pst"}; + default {"non"}; +}; _anim = [_anim, "[wpn]", _wpn] call CBA_fnc_replace; [_unit, _anim] call EFUNC(common,doAnimation); diff --git a/addons/medical_ai/functions/fnc_requestMedic.sqf b/addons/medical_ai/functions/fnc_requestMedic.sqf index f669b06975..6bb3229e9a 100644 --- a/addons/medical_ai/functions/fnc_requestMedic.sqf +++ b/addons/medical_ai/functions/fnc_requestMedic.sqf @@ -6,7 +6,10 @@ * None * * Return Value: - * Nothing + * None + * + * Example: + * call ACE_medical_ai_fnc_requestMedic * * Public: No */ diff --git a/addons/medical_ai/functions/fnc_wasRequested.sqf b/addons/medical_ai/functions/fnc_wasRequested.sqf index 2b86423be8..c340ff7b9e 100644 --- a/addons/medical_ai/functions/fnc_wasRequested.sqf +++ b/addons/medical_ai/functions/fnc_wasRequested.sqf @@ -8,6 +8,9 @@ * Return Value: * Was requested * + * Example: + * call ACE_medical_ai_fnc_wasRequested + * * Public: No */ #include "script_component.hpp" diff --git a/addons/medical_ai/stringtable.xml b/addons/medical_ai/stringtable.xml index 44a8f770c9..b2bda42146 100644 --- a/addons/medical_ai/stringtable.xml +++ b/addons/medical_ai/stringtable.xml @@ -8,6 +8,11 @@ Нур сервера унд HC サーバーと HC のみ Tylko serwer i HC + Seulement sur le server ou le HC + Solo Server e HC + 只在伺服器或无头客户端 + 只在伺服器或無頭客戶端 + 서버와 헤드리스만 diff --git a/addons/medical_blood/XEH_postInit.sqf b/addons/medical_blood/XEH_postInit.sqf index 8d563da1dc..ceff7f074c 100644 --- a/addons/medical_blood/XEH_postInit.sqf +++ b/addons/medical_blood/XEH_postInit.sqf @@ -39,7 +39,7 @@ if (isServer) then { ["CAManBase", "hit", { params ["_unit"]; - if (GVAR(enabledFor) == 1 && {!isPlayer _unit || {_unit == ACE_player}}) exitWith {}; + if (GVAR(enabledFor) == 1 && {!isPlayer _unit && {_unit != ACE_player}}) exitWith {}; _this call FUNC(hit); }] call CBA_fnc_addClassEventHandler; diff --git a/addons/medical_blood/XEH_preInit.sqf b/addons/medical_blood/XEH_preInit.sqf index fd97dfda93..9cf50a1b60 100644 --- a/addons/medical_blood/XEH_preInit.sqf +++ b/addons/medical_blood/XEH_preInit.sqf @@ -2,7 +2,9 @@ ADDON = false; +PREP_RECOMPILE_START; #include "XEH_PREP.hpp" +PREP_RECOMPILE_END; // blood object model namespace GVAR(models) = [] call CBA_fnc_createNamespace; diff --git a/addons/medical_blood/functions/fnc_hit.sqf b/addons/medical_blood/functions/fnc_hit.sqf index 1572b2e5a1..3c0251a437 100644 --- a/addons/medical_blood/functions/fnc_hit.sqf +++ b/addons/medical_blood/functions/fnc_hit.sqf @@ -10,6 +10,9 @@ * Return Value: * None * + * Example: + * [bob, kevin, 5] call ACE_medical_blood_fnc_hit + * * Public: No */ #include "script_component.hpp" diff --git a/addons/medical_blood/functions/fnc_onBleeding.sqf b/addons/medical_blood/functions/fnc_onBleeding.sqf index 204483ce43..4357bc382a 100644 --- a/addons/medical_blood/functions/fnc_onBleeding.sqf +++ b/addons/medical_blood/functions/fnc_onBleeding.sqf @@ -33,6 +33,6 @@ if ((CBA_missionTime - _lastTime) + _bloodLoss >= 8 + random 2) then { ]; _position set [2, 0]; - private _bloodDrop = ["blooddrop_1", "blooddrop_2", "blooddrop_3", "blooddrop_4"] select floor (_bloodLoss max 3); + private _bloodDrop = ["blooddrop_1", "blooddrop_2", "blooddrop_3", "blooddrop_4"] select floor (_bloodLoss min 3); [_bloodDrop, _position, getDir _unit] call FUNC(createBlood); }; diff --git a/addons/medical_blood/functions/fnc_spurt.sqf b/addons/medical_blood/functions/fnc_spurt.sqf index d17139988d..aaaa75894e 100644 --- a/addons/medical_blood/functions/fnc_spurt.sqf +++ b/addons/medical_blood/functions/fnc_spurt.sqf @@ -23,6 +23,7 @@ #define OFFSET 0.25 params ["_unit", "_dir", "_damage"]; +_damage = _damage min 1; private _distanceBetweenDrops = DISTANCE_BETWEEN_DROPS * _damage; private _offset = OFFSET + _distanceBetweenDrops; diff --git a/addons/medical_blood/stringtable.xml b/addons/medical_blood/stringtable.xml index 35902a1a06..0464d661b7 100644 --- a/addons/medical_blood/stringtable.xml +++ b/addons/medical_blood/stringtable.xml @@ -3,12 +3,36 @@ Only Players + プレイヤーのみ + Nur Spieler + 오직 플레이어만 + Tylko gracze + Joueurs seulement + Solo Giocatori + 只有玩家 + 只有玩家 Enable Blood Drops + 血痕を有効化 + Aktiviere Blutspritzer + 피흘리기 활성화 + Włącz ślady krwi na ziemi + Active les gouttes de sang + Abilita Perdite di Sangue + 开启血液滴落效果 + 開啟血液滴落效果 Enable or disable Blood Drops created on bleeding and taking damage + ダメージを受けたり、出血していると出る血痕の有効か無効化 + Aktiviere oder deaktiviere Blutspritzer, die durch Blutungen oder bei Schadensnahme entstehen. + Włącz lub wyłącz pozostawianie śladów krwi na ziemi kiedy postać odnosi obrażenia bądź krwawi + (Dés)active les gouttes de sang lors d'un saignement ou de blessure + Abilita o disabilita la Perdite di Sangue create sanguinando e prendendo danno + 开启后, 会让受伤时伤口有血液滴落的效果 + 開啟後, 會讓受傷時傷口有血液滴落的效果 + 출혈이나 부상을 입었을 때, 떨어지는 혈액을 활성화 하거나 비활성화 합니다. diff --git a/addons/medical_menu/CfgVehicles.hpp b/addons/medical_menu/CfgVehicles.hpp index 1918511566..cd2258aa5e 100644 --- a/addons/medical_menu/CfgVehicles.hpp +++ b/addons/medical_menu/CfgVehicles.hpp @@ -47,7 +47,7 @@ class CfgVehicles { class Medical_Menu { displayName = CSTRING(OpenMenu); runOnHover = 0; - exceptions[] = {"isNotInside"}; + exceptions[] = {"isNotInside", "isNotSwimming"}; condition = QUOTE([ARR_2(ACE_player,_target)] call FUNC(canOpenMenu)); statement = QUOTE([_target] call DFUNC(openMenu)); icon = QPATHTOEF(medical,UI\icons\medical_cross.paa); @@ -60,7 +60,7 @@ class CfgVehicles { class Medical_Menu { displayName = CSTRING(OpenMenu); runOnHover = 0; - exceptions[] = {"isNotInside"}; + exceptions[] = {"isNotInside", "isNotSwimming"}; condition = QUOTE([ARR_2(ACE_player,_target)] call FUNC(canOpenMenu)); statement = QUOTE([_target] call DFUNC(openMenu)); icon = QPATHTOEF(medical,UI\icons\medical_cross.paa); diff --git a/addons/medical_menu/XEH_postInit.sqf b/addons/medical_menu/XEH_postInit.sqf index b028a16e75..89488c0d69 100644 --- a/addons/medical_menu/XEH_postInit.sqf +++ b/addons/medical_menu/XEH_postInit.sqf @@ -21,7 +21,7 @@ GVAR(pendingReopen) = false; 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, ["isNotInside", "isNotSwimming"]] call EFUNC(common,canInteractWith)) exitWith {false}; if !([ACE_player, _target] call FUNC(canOpenMenu)) exitWith {false}; // Statement diff --git a/addons/medical_menu/XEH_preInit.sqf b/addons/medical_menu/XEH_preInit.sqf index 009a9ed1a6..16e448fc38 100644 --- a/addons/medical_menu/XEH_preInit.sqf +++ b/addons/medical_menu/XEH_preInit.sqf @@ -2,7 +2,9 @@ ADDON = false; +PREP_RECOMPILE_START; #include "XEH_PREP.hpp" +PREP_RECOMPILE_END; GVAR(INTERACTION_TARGET) = objNull; GVAR(actionsOther) = []; diff --git a/addons/medical_menu/functions/fnc_getTreatmentOptions.sqf b/addons/medical_menu/functions/fnc_getTreatmentOptions.sqf index 6fed994671..293eb07836 100644 --- a/addons/medical_menu/functions/fnc_getTreatmentOptions.sqf +++ b/addons/medical_menu/functions/fnc_getTreatmentOptions.sqf @@ -10,7 +10,7 @@ * Return Value: * Available actions * - * Exmaple: + * Example: * [ACE_player, poor_dude, "some category"] call ace_medical_menu_fnc_getTreatmentOptions * * Public: No @@ -19,7 +19,7 @@ params ["_player", "_target", "_name"]; -if (!([ACE_player, _target, ["isNotInside"]] call EFUNC(common,canInteractWith))) exitWith {[]}; +if (!([ACE_player, _target, ["isNotInside", "isNotSwimming"]] call EFUNC(common,canInteractWith))) exitWith {[]}; private _actions = if (EGVAR(medical,level) == 2) then { GVAR(actionsAdvanced); diff --git a/addons/medical_menu/functions/fnc_handleUI_DisplayOptions.sqf b/addons/medical_menu/functions/fnc_handleUI_DisplayOptions.sqf index 97e5c19519..4cb8f4ceab 100644 --- a/addons/medical_menu/functions/fnc_handleUI_DisplayOptions.sqf +++ b/addons/medical_menu/functions/fnc_handleUI_DisplayOptions.sqf @@ -21,20 +21,18 @@ if (!hasInterface) exitWith{}; -private ["_entries", "_display", "_newTarget", "_ctrl", "_code"]; - params ["_name"]; disableSerialization; -_display = uiNamespace getVariable QGVAR(medicalMenu); +private _display = uiNamespace getVariable QGVAR(medicalMenu); if (isNil "_display") exitWith {}; // no valid dialog present if (_name isEqualTo "toggle") exitWith { - _newTarget = ACE_player; + private _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), ["isNotInside", "isNotSwimming"]] call EFUNC(common,canInteractWith)} && {[ACE_player, GVAR(INTERACTION_TARGET_PREVIOUS)] call FUNC(canOpenMenu)}) then { _newTarget = GVAR(INTERACTION_TARGET_PREVIOUS); }; @@ -49,7 +47,7 @@ if (_name isEqualTo "toggle") exitWith { // Clean the dropdown options list from all actions for [{_x = START_IDC}, {_x <= END_IDC}, {_x = _x + 1}] do { - _ctrl = (_display displayCtrl (_x)); + private _ctrl = (_display displayCtrl (_x)); _ctrl ctrlSetText ""; _ctrl ctrlShow false; _ctrl ctrlSetEventHandler ["ButtonClick",""]; @@ -64,12 +62,11 @@ lbClear 212; if (_name isEqualTo "triage") exitWith { ctrlEnable [212, true]; - private ["_log", "_triageCardTexts", "_message"]; - _log = GVAR(INTERACTION_TARGET) getVariable [QEGVAR(medical,triageCard), []]; - _triageCardTexts = []; + private _log = GVAR(INTERACTION_TARGET) getVariable [QEGVAR(medical,triageCard), []]; + private _triageCardTexts = []; { _x params ["_item", "_amount", "_time"]; - _message = _item; + private _message = _item; if (isClass(configFile >> "CfgWeapons" >> _item)) then { _message = getText(configFile >> "CfgWeapons" >> _item >> "DisplayName"); } else { @@ -100,7 +97,7 @@ _entries = [ACE_player, GVAR(INTERACTION_TARGET), _name] call FUNC(getTreatmentO _ctrl = (_display displayCtrl (START_IDC + _forEachIndex)); if (!(_forEachIndex > AMOUNT_OF_ENTRIES)) then { _ctrl ctrlSetText (_x select 0); - _code = format ["ace_medical_menu_pendingReopen = true; call %1;", (_x select 3)]; + private _code = format ["ace_medical_menu_pendingReopen = true; call %1;", (_x select 3)]; _ctrl ctrlSetEventHandler ["ButtonClick", _code]; _ctrl ctrlSetTooltip (_x select 0); // TODO implement _ctrl ctrlShow true; diff --git a/addons/medical_menu/functions/fnc_module.sqf b/addons/medical_menu/functions/fnc_module.sqf index 666440e208..f056082743 100644 --- a/addons/medical_menu/functions/fnc_module.sqf +++ b/addons/medical_menu/functions/fnc_module.sqf @@ -10,6 +10,9 @@ * Return Value: * None * + * Example: + * [LOGIC, [bob, kevin], true] call ACE_medical_menu_fnc_module + * * Public: No */ diff --git a/addons/medical_menu/functions/fnc_onMenuOpen.sqf b/addons/medical_menu/functions/fnc_onMenuOpen.sqf index 58cb9ff74e..3b933d1862 100644 --- a/addons/medical_menu/functions/fnc_onMenuOpen.sqf +++ b/addons/medical_menu/functions/fnc_onMenuOpen.sqf @@ -75,7 +75,7 @@ GVAR(MenuPFHID) = [{ [GVAR(LatestDisplayOptionMenu)] call FUNC(handleUI_DisplayOptions); //Check that it's valid to stay open: - if !(([ACE_player, GVAR(INTERACTION_TARGET), ["isNotInside"]] call EFUNC(common,canInteractWith)) && {[ACE_player, GVAR(INTERACTION_TARGET)] call FUNC(canOpenMenu)}) then { + if !(([ACE_player, GVAR(INTERACTION_TARGET), ["isNotInside", "isNotSwimming"]] call EFUNC(common,canInteractWith)) && {[ACE_player, GVAR(INTERACTION_TARGET)] call FUNC(canOpenMenu)}) then { closeDialog 314412; //If we failed because of distance check, show UI message: if ((ACE_player distance GVAR(INTERACTION_TARGET)) > GVAR(maxRange)) then { diff --git a/addons/medical_menu/functions/fnc_setTriageStatus.sqf b/addons/medical_menu/functions/fnc_setTriageStatus.sqf index 8a85eeb950..66efd6ac0c 100644 --- a/addons/medical_menu/functions/fnc_setTriageStatus.sqf +++ b/addons/medical_menu/functions/fnc_setTriageStatus.sqf @@ -9,6 +9,9 @@ * Return Value: * None * + * Example: + * [bob, 2] call ACE_medical_menu_fnc_setTriageStatus + * * Public: No */ #include "script_component.hpp" diff --git a/addons/medical_menu/functions/fnc_updateInformationLists.sqf b/addons/medical_menu/functions/fnc_updateInformationLists.sqf index 28818465bc..d6ff631df8 100644 --- a/addons/medical_menu/functions/fnc_updateInformationLists.sqf +++ b/addons/medical_menu/functions/fnc_updateInformationLists.sqf @@ -10,6 +10,9 @@ * Return Value: * None * + * Example: + * [DISPLAY, [messagecollection], [injurycollection]] call ACE_medical_menu_fnc_updateInformationLists + * * Public: No */ #include "script_component.hpp" diff --git a/addons/medical_menu/functions/fnc_updateUIInfo.sqf b/addons/medical_menu/functions/fnc_updateUIInfo.sqf index 4994ad2acf..5fef1ff2a4 100644 --- a/addons/medical_menu/functions/fnc_updateUIInfo.sqf +++ b/addons/medical_menu/functions/fnc_updateUIInfo.sqf @@ -18,15 +18,13 @@ 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); +private _selectionN = GVAR(selectedBodyPart); 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; +private _genericMessages = []; +private _partText = [ELSTRING(medical,Head), ELSTRING(medical,Torso), ELSTRING(medical,LeftArm) ,ELSTRING(medical,RightArm) ,ELSTRING(medical,LeftLeg), ELSTRING(medical,RightLeg)] select _selectionN; _genericMessages pushBack [localize _partText, [1, 1, 1, 1]]; if (_target getVariable [QEGVAR(medical,isBleeding), false]) then { @@ -45,7 +43,7 @@ if (_target getVariable [QEGVAR(medical,hasPain), false]) then { _genericMessages pushBack [localize ELSTRING(medical,Status_Pain), [1, 1, 1, 1]]; }; -_totalIvVolume = 0; +private _totalIvVolume = 0; private _bloodBags = _target getVariable [QEGVAR(medical,ivBags), []]; { _x params ["_bagVolumeRemaining"]; @@ -56,15 +54,14 @@ if (_totalIvVolume >= 1) then { _genericMessages pushBack [format [localize ELSTRING(medical,receivingIvVolume), floor _totalIvVolume], [1, 1, 1, 1]]; }; -_damaged = [false, false, false, false, false, false]; -_selectionBloodLoss = [0, 0, 0, 0, 0, 0]; +private _damaged = [false, false, false, false, false, false]; +private _selectionBloodLoss = [0, 0, 0, 0, 0, 0]; -_allInjuryTexts = []; +private _allInjuryTexts = []; if ((EGVAR(medical,level) >= 2) && {([_target] call EFUNC(medical,hasMedicalEnabled))}) then { - _openWounds = _target getVariable [QEGVAR(medical,openWounds), []]; - private "_amountOf"; + private _openWounds = _target getVariable [QEGVAR(medical,openWounds), []]; { - _amountOf = _x select 3; + private _amountOf = _x select 3; // Find how much this bodypart is bleeding if (_amountOf > 0) then { _damaged set [_x select 2, true]; @@ -83,9 +80,9 @@ if ((EGVAR(medical,level) >= 2) && {([_target] call EFUNC(medical,hasMedicalEnab }; } forEach _openWounds; - _bandagedwounds = _target getVariable [QEGVAR(medical,bandagedWounds), []]; + private _bandagedwounds = _target getVariable [QEGVAR(medical,bandagedWounds), []]; { - _amountOf = _x select 3; + private _amountOf = _x select 3; // Find how much this bodypart is bleeding if !(_damaged select (_x select 2)) then { _selectionBloodLoss set [_x select 2, (_selectionBloodLoss select (_x select 2)) + (20 * ((_x select 4) * _amountOf))]; @@ -106,10 +103,9 @@ if ((EGVAR(medical,level) >= 2) && {([_target] call EFUNC(medical,hasMedicalEnab } else { // Add all bleeding from wounds on selection - _openWounds = _target getVariable [QEGVAR(medical,openWounds), []]; - private "_amountOf"; + private _openWounds = _target getVariable [QEGVAR(medical,openWounds), []]; { - _amountOf = _x select 3; + private _amountOf = _x select 3; // Find how much this bodypart is bleeding if (_amountOf > 0) then { _damaged set [_x select 2, true]; @@ -117,9 +113,9 @@ if ((EGVAR(medical,level) >= 2) && {([_target] call EFUNC(medical,hasMedicalEnab }; } forEach _openWounds; - _bandagedwounds = _target getVariable [QEGVAR(medical,bandagedWounds), []]; + private _bandagedwounds = _target getVariable [QEGVAR(medical,bandagedWounds), []]; { - _amountOf = _x select 3; + private _amountOf = _x select 3; // Find how much this bodypart is bleeding if !(_damaged select (_x select 2)) then { _selectionBloodLoss set [_x select 2, (_selectionBloodLoss select (_x select 2)) + (20 * ((_x select 4) * _amountOf))]; diff --git a/addons/medical_menu/stringtable.xml b/addons/medical_menu/stringtable.xml index 3f3fe6e993..96b765d174 100644 --- a/addons/medical_menu/stringtable.xml +++ b/addons/medical_menu/stringtable.xml @@ -12,6 +12,9 @@ Menù Medico Menu médical 治療メニュー + 의료 메뉴 + 医疗选单 + 醫療選單 Allow Medical Menu @@ -24,6 +27,9 @@ Consenti Menù Medico Autoriser le menu médical 治療メニューを有効化 + 의료 메뉴 활성화 + 允许医疗选单 + 允許醫療選單 Allow clients to use the medical menu @@ -36,6 +42,9 @@ Consenti ai clients di usare il Menù Medico Autoriser les clients à utiliser le menu médical すべてのクライアントが治療メニューをつかえるようにする + 클라이언트가 의료 메뉴를 쓰는것을 허락합니다 + 允许客户端使用医疗选单 + 允許客戶端使用醫療選單 Use Medical menu @@ -48,6 +57,9 @@ Usa Menù Medico Utiliser le menu médical 治療メニューをつかう + 의료 메뉴 사용 + 使用医疗选单 + 使用醫療選單 If allowed by server, enable the option to use the Medical Menu through keybinding and interaction menu @@ -60,6 +72,9 @@ Se consentito dal server, abilita l'opzione di usare il Menù Medico attraverso hotkeys e menù interazione Si autorisé par le serveur, active l'option d'utiliser le menu médical à travers les raccourcis clavier et le menu d'interaction. サーバーが有効化を許可している場合は、オプションから有効化でき治療メニューはキー割り当てとインタラクション メニューを無視できます + 서버 허가하에 단축키와 상호작용 메뉴로 의료 메뉴사용을 허가합니다 + 如果伺服器允许,只需透过按键即可叫出医疗选单 + 如果伺服器允許,只需透過按鍵即可叫出醫療選單 Re-open Medical menu @@ -72,6 +87,9 @@ Ri-apri Menù Medico Ré-ouvrir le menu médical 治療メニューを再びひらく + 의료 메뉴 다시 열기 + 重新开启医疗选单 + 重新開啟醫療選單 Re-open the medical menu after succesful treatment @@ -84,6 +102,9 @@ Ri-Apri il Menù Medico dopo un trattamento riuscito Ré-ouvrir le menu médical après un traitement réussi 治療が終わったあと、再び治療メニューをひらく + 성공적으로 치료한후에 의료 메뉴를 다시 엽니다 + 当治疗成功后重新打开医疗选单 + 當治療成功後重新打開醫療選單 Open Medical Menu @@ -96,6 +117,9 @@ Apri Menù Medico Ouvir le menu médical 治療メニューをひらく + 의료 메뉴 열기 + 开起医疗选单 + 開起醫療選單 Medical Menu Settings @@ -108,6 +132,9 @@ Impostazioni Menù Medico Réglages du menu médical 治療メニューの設定 + 의료 메뉴 설정 + 医疗选单设定 + 醫療選單設定 Configure the usage of the Medical Menu @@ -120,6 +147,9 @@ Configura l'uso del Menù Medico Configurer l'utilisation du menu médical 治療メニューを使うための設定 + 의료 메뉴 사용의 설정 + 设置医疗选单的使用 + 設置醫療選單的使用 EXAMINE & TREATMENT @@ -131,7 +161,10 @@ EXAMINAR & TRATAMENTO VYŠETŘENÍ & LÉČBA ESAMINA & TRATTA - 診断 &amp; 治療 + 診断 & 治療 + 검사 / 치료 + 检查 & 治疗 + 檢查 & 治療 STATUS @@ -144,6 +177,9 @@ STAV STATO 状態 + 상태 + 状态 + 狀態 OVERVIEW @@ -156,6 +192,9 @@ PŘEHLED PANORAMICA オーバービュー + 개요 + 概述 + 概述 ACTIVITY LOG @@ -168,6 +207,9 @@ PROTOKOL LOG ATTIVITA' 治療履歴 + 활동 로그 + 医疗纪录 + 醫療紀錄 QUICK VIEW @@ -180,6 +222,9 @@ RYCHLÝ NÁHLED VISTA RAPIDA クイック ビュー + 퀵 뷰 + 快速检查 + 快速檢查 View triage Card @@ -192,6 +237,9 @@ Zkontrolovat štítek Guarda Triage Card トリアージ カードを見る + 부상자 카드 보기 + 查看诊断卡 + 查看診斷卡 Examine Patient @@ -204,6 +252,9 @@ Zkontrolovat pacienta Esamina Paziente 患者を調べる + 환자 검사하기 + 检查伤者 + 檢查傷者 Bandage / Fractures @@ -216,6 +267,9 @@ Bandáž / Zlomeniny Bendaggi/Fratture 包帯 / 骨折 + 붕대 / 골절 + 绷带 / 骨折 + 繃帶 / 骨折 Medication @@ -228,6 +282,9 @@ Léky Medicazione 薬物による治療 + 약물 치료 + 药物 + 藥物 Airway Management @@ -240,6 +297,9 @@ Gestione Vie Respiratorie Atemwegssicherung 気道を確保 + 기도 관리 + 呼吸道管理 + 呼吸道管理 Advanced Treatments @@ -252,6 +312,9 @@ Pokročilé ošetření Trattamenti Avanzati 高度な治療 + 고급 치료 + 进阶治疗 + 進階治療 Drag/Carry @@ -264,6 +327,9 @@ Táhnout/Nést Trascina/Trasporta 引きずる / 運ぶ + 끌기 / 들기 + 拖 / 背 + 拖 / 背 Toggle (Self) @@ -275,91 +341,115 @@ Alternar (Si mesmo) Přepnout (na sebe) Attiva (Te Stesso) - トグル (自分) + 切り替え (自分) + 토글 (자신) + 切换 (自己) + 切換 (自己) Select triage status Setze Status auf der Triagekarte Сортировка Seleccionar estado de Triage - Selectioner l'état de triage + Sélectionner l'état de triage Wybierz priorytet Selecionar estado de triagem Vybrat prioritu Seleziona stato Triage トリアージによる状態を選択 + 부상 상태 고르기 + 选择分诊状态 + 選擇分診狀態 Select Head Wähle Kopf Выбрать голову Seleccionar Cabeza - Selectioner Tête + Sélectionner la tête Wybierz głowę Selecionar Cabeça Vybrat Hlavu Seleziona Testa 頭部を選ぶ + 머리 선택 + 选择头部 + 選擇頭部 Select Torso Wähle Torso Выбрать торс Seleccionar Torso - Selectioner Torse + Sélectionner le torse Wybierz tors Selecionar Torso Vybrat Trup Seleziona Torso 胴体を選ぶ + 몸통 선택 + 选择身体 + 選擇身體 Select Left Arm Wähle linken Arm Выбрать левую руку Seleccionar Brazo Izquierdo - Selectioner Bras Gauche + Sélectionner le bras gauche Wybierz lewą rękę Selecionar Braço Esquerdo Vybrat Levou ruku Seleziona Braccio Sinistro 左腕を選ぶ + 왼쪽 팔 선택 + 选择左手 + 選擇左手 Select Right Arm Wähle rechten Arm Выбрать правую руку Seleccionar Brazo Derecho - Selectioner Bras Droit + Sélectionner le bras droit Wybierz prawą rękę Selecionar Braço Direito Vybrat Pravou ruku Seleziona Braccio Destro 右腕を選ぶ + 오른쪽 팔 선택 + 选择右手 + 選擇右手 Select Left Leg Wähle linkes Bein Выбрать левую ногу Seleccionar Pierna Izquierda - Selectioner Jambe Gauche + Sélectionner la jambe gauche Wybierz lewą nogę Selecionar Perna Esquerda Vybrat Levou nohu Seleziona Gamba Sinistra 左足を選ぶ + 왼쪽 다리 선택 + 选择左脚 + 選擇左腳 Select Right Leg Wähle rechtes Bein Выбрать правую ногу Seleccionar Pierna Derecha - Selectioner Jambe Droite + Sélectionner la jambe droite Wybierz prawą nogę Selecionar Perna Direita Vybrat Pravou nohu Seleziona Gamba Destra 右足を選ぶ + 오른쪽 다리 선택 + 选择右脚 + 選擇右腳 Head @@ -372,6 +462,9 @@ Hlava Testa 頭部 + 머리 + 头部 + 頭部 Torso @@ -384,66 +477,84 @@ Torso Torso 胴体 + 몸통 + 身体 + 身體 Left Arm Linker Arm Левая рука Brazo Izquierdo - Bras Gauche + Bras gauche Lewa ręka Braço Esquerdo Levá Ruka Braccio Sinistro 左腕 + 왼쪽 팔 + 左手 + 左手 Right Arm Rechter Arm Правая рука Brazo Derecho - Bras Droit + Bras droit Prawa ręka Braço Direito Pravá Ruka Braccio Destro 右腕 + 오른쪽 팔 + 右手 + 右手 Left Leg Linkes Bein Левая нога Pierna Izquierda - Jambe Gauche + Jambe gauche Lewa noga Perna Esquerda Levá Noha Gamba Sinistra 左足 + 왼쪽 다리 + 左脚 + 左腳 Right Leg Rechtes Bein Правая нога Pierna Derecha - Jambe Droite + Jambe droite Prawa noga Perna Direita Pravá Noha Gamba Destra 右足 + 오른쪽 다리 + 右脚 + 右腳 Body Part: %1 Körperteil: %1 Часть тела: %1 Parte del cuerpo: %1 - Partie du corps: %1 + Partie du corps : %1 Część ciała: %1 Parte do corpo: %1 Část těla: %1 Parte del Corpo: %1 身体の一部: %1 + 신체 부위: %1 + 身体部位: %1 + 身體部位: %1 Small @@ -456,6 +567,9 @@ Malý Piccolo 小さい + + + Medium @@ -468,6 +582,9 @@ Střední Medio 中くらい + + + Large @@ -480,18 +597,24 @@ Velký Grande 大きい + + + There are %2 %1 Open Wounds Er hat %2 offene Wunden (%1) %2 открытые раны %1 Hay %2 Heridas Abiertas %1 - Il y a %2 %1 Blessure(s) Ouverte(s) + Il y a %2 %1 blessure(s) ouverte(s) Widzisz otwarte rany w ilości %2 o %1 rozmiarze Existem %2 ferimentos abertos %1 Jsou zde %2 %1 otevřené rány Ci sono %2 %1 Ferite Aperte 開いている傷口が %2 %1 ほどあるようだ + 여기 %2 %1 크기의 열린 상처가 있다 + 有 %2 %1 开放性伤口 + 有 %2 %1 開放性傷口 There is 1 %1 Open Wound @@ -504,54 +627,69 @@ Je zde 1 %1 otevřená rána C'è 1 %1 Ferita Aperta 1 つの空いている %1 傷口 + 여기 %1 크기의 열린 상처가 있다 + 有 1 %1 开放性伤口 + 有 1 %1 開放性傷口 There is a partial %1 Open wound Er hat eine zum Teil offene Wunde (%1) Частично открытая рана %1 Hay una herida parcial abierta %1 - Il y a une Blessure Patiellement Ouverte %1 + Il y a une blessure partiellement ouverte %1 Widzisz częściowo otwartą ranę o %1 rozmiarze Existe um ferimento parcial aberto %1 Je zde částečně %1 otevřená rána C'è 1 parziale %1 Ferita Aperta 部分的に開いている %1 の傷口がある + 여기 부분적으로 %1 크기의 상처가 있다 + 有部分 %1 开放性伤口 + 有部分 %1 開放性傷口 There are %2 %1 Bandaged Wounds Er hat %2 verbundene Wunden (%1) %2 перевязанные раны %1 Hay %2 Heridas %1 Vendadas - Il y a %2 %1 Blessure(s) Bandée(s) + Il y a %2 %1 blessure(s) bandée(s) Widzisz %2 zabandażowanych ran o %1 rozmiarze Existem %2 ferimentos %1 tratados Jsou zde %2 %1 ovázané rány Ci sono %2 %1 Ferite Bendate ここには %2 %1 の処置された傷がある + 여기에 붕대를 감은 %2 %1 크기의 상처가 있다 + 有 %2 %1 包扎过伤口 + 有 %2 %1 包紮過傷口 There is 1 %1 Bandaged Wound Er hat 1 verbundene Wunde (%1) 1 перевязанная рана %1 Hay 1 Herida Vendada %1 - Il y a 1 %1 Blessure Bandée + Il y a 1 %1 blessure bandée Widzisz 1 zabandażowaną ranę o %1 rozmiarze Existe 1 ferimento %1 tratado Je zde 1 %1 ovázaná rána C'è 1 %1 Ferita Bendata 1 つの包帯で巻かれている %1 傷 + 여기에 붕대를 감은 %1 크기의 상처가 있다 + 有 1 %1 包扎过伤口 + 有 1 %1 包紮過傷口 There is a partial %1 Bandaged wound Er hat eine zum Teil verbundene Wunde (%1) Частично перевязанная рана %1 Hay una Herida parcial %1 Vendada - Il y a %1 Blessure Partielment Bandée + Il y a %1 blessure partiellement bandée Widzisz 1 częściowo zabandażowaną ranę o %1 rozmiarze Existe um ferimento parcial tratado %1 Je zde částěčně %1 ovázaná rána C'è 1 parziale %1 Ferita Bendata 患者には %1 の包帯で処置された傷がある + 여기 부분적으로 붕대질한 %1 크기의 상처가 있다 + 有部分 %1 包扎过伤口 + 有部分 %1 包紮過傷口 Normal breathing @@ -564,6 +702,9 @@ Normální dýchání Respirazione Normale 通常の呼吸 + 정상 호흡 + 正常呼吸 + 正常呼吸 No breathing @@ -576,6 +717,9 @@ Nedýchá Nessuna Respirazione 息をしていない + 호흡이 없음 + 没有呼吸 + 沒有呼吸 Difficult breathing @@ -588,6 +732,9 @@ Potíže s dýcháním Difficoltà Respiratorie 呼吸が難しそうだ + 호흡 곤란 + 呼吸困难 + 呼吸困難 Almost no breathing @@ -600,6 +747,9 @@ Téměř nedýchá Quasi nessuna Respirazione ほとんど呼吸していない + 호흡이 거의 없음 + 几乎没有呼吸 + 幾乎沒有呼吸 Bleeding @@ -611,7 +761,10 @@ Sangrando Krvácí Sanguinamento - 出血 + 出血中 + 출혈 + 出血中 + 出血中 in Pain @@ -624,18 +777,24 @@ v bolestech in Dolore 痛みがある + 고통 + 疼痛中 + 疼痛中 Lost a lot of Blood hat sehr viel Blut verloren Большая кровопотеря Mucha Sangre perdida - A Perdu Bcp de Sang + A perdu beaucoup de sang Stracił dużo krwi Perdeu muito sangue Ztratil hodně krve Perso molto Sangue - 大量出血している + 大量失血している + 많은 피를 흘림 + 大量失血 + 大量失血 Tourniquet [CAT] @@ -648,6 +807,9 @@ Škrtidlo [CAT] Laccio Emostatico [CAT] 止血帯 [CAT] + 지혈대 [CAT] + 军用止血带 + 軍用止血帶 Nasopharyngeal Tube [NPA] @@ -660,6 +822,9 @@ Nasofaryngeální trubice [NPA] Tubo Nasofaringeo [NPA] 鼻咽頭チューブ [NPA] + 비-인두 기도기 [NPA] + 鼻咽管 + 鼻咽管 - \ No newline at end of file + diff --git a/addons/microdagr/CfgUIGrids.hpp b/addons/microdagr/CfgUIGrids.hpp new file mode 100644 index 0000000000..5d7b921800 --- /dev/null +++ b/addons/microdagr/CfgUIGrids.hpp @@ -0,0 +1,21 @@ +class CfgUIGrids { + class IGUI { + class Presets { + class Arma3 { + class Variables { + grid_ACE_microDagr[] = {{"(safezoneX + safezoneW - 11 * (((safezoneW / safezoneH) min 1.2) / 40))","(safezoneY + safezoneH - 15 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25))","(10 * (((safezoneW / safezoneH) min 1.2) / 40))","(10 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25))"},"(((safezoneW / safezoneH) min 1.2) / 40)","((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)"}; + }; + }; + }; + + class Variables { + class grid_ACE_microDagr { + displayName = COMPONENT_NAME; + description = "ACE MicroDagr"; + preview = QPATHTOF(ui\IGUI_preview_ca.paa); + saveToProfile[] = {0,1,2,3}; + canResize = 1; + }; + }; + }; +}; diff --git a/addons/microdagr/CfgWeapons.hpp b/addons/microdagr/CfgWeapons.hpp index 92ace96c53..6c7c920427 100644 --- a/addons/microdagr/CfgWeapons.hpp +++ b/addons/microdagr/CfgWeapons.hpp @@ -1,6 +1,6 @@ class CfgWeapons { class ACE_ItemCore; - class InventoryItem_Base_F; + class CBA_MiscItem_ItemInfo; class ACE_microDAGR: ACE_ItemCore { author = ECSTRING(common,ACETeam); @@ -9,7 +9,7 @@ class CfgWeapons { descriptionShort = CSTRING(itemDescription); model = QPATHTOF(data\MicroDAGR.p3d); picture = QPATHTOF(images\microDAGR_item.paa); - class ItemInfo: InventoryItem_Base_F { + class ItemInfo: CBA_MiscItem_ItemInfo { mass = 2; }; }; diff --git a/addons/microdagr/UI/IGUI_preview_ca.paa b/addons/microdagr/UI/IGUI_preview_ca.paa new file mode 100644 index 0000000000..12cbdb5f9b Binary files /dev/null and b/addons/microdagr/UI/IGUI_preview_ca.paa differ diff --git a/addons/microdagr/XEH_clientInit.sqf b/addons/microdagr/XEH_clientInit.sqf index 46003b9cb1..d82721e697 100644 --- a/addons/microdagr/XEH_clientInit.sqf +++ b/addons/microdagr/XEH_clientInit.sqf @@ -4,15 +4,14 @@ if (!hasInterface) exitWith {}; //Add deviceKey entry: -private ["_conditonCode", "_toggleCode", "_closeCode"]; -_conditonCode = { +private _conditonCode = { ("ACE_microDAGR" in (items ACE_player)) }; -_toggleCode = { +private _toggleCode = { if !([ACE_player, objNull, ["notOnMap", "isNotInside", "isNotSitting"]] call EFUNC(common,canInteractWith)) exitWith {}; [] call FUNC(openDisplay); //toggle display mode }; -_closeCode = { +private _closeCode = { if (GVAR(currentShowMode) == DISPLAY_MODE_CLOSED) exitWith {}; [DISPLAY_MODE_CLOSED] call FUNC(openDisplay); }; diff --git a/addons/microdagr/XEH_preInit.sqf b/addons/microdagr/XEH_preInit.sqf index ba262ec8c5..c6cdd0bbef 100644 --- a/addons/microdagr/XEH_preInit.sqf +++ b/addons/microdagr/XEH_preInit.sqf @@ -2,7 +2,9 @@ ADDON = false; +PREP_RECOMPILE_START; #include "XEH_PREP.hpp" +PREP_RECOMPILE_END; //Functions that are called for each draw of the map: GVAR(miniMapDrawHandlers) = []; diff --git a/addons/microdagr/config.cpp b/addons/microdagr/config.cpp index c3ca72b454..a138a194d5 100644 --- a/addons/microdagr/config.cpp +++ b/addons/microdagr/config.cpp @@ -18,4 +18,5 @@ class CfgPatches { #include "CfgWeapons.hpp" #include "CfgVehicles.hpp" #include "gui.hpp" +#include "CfgUIGrids.hpp" #include "ACE_Settings.hpp" diff --git a/addons/microdagr/functions/fnc_appMarkKeypadEntry.sqf b/addons/microdagr/functions/fnc_appMarkKeypadEntry.sqf index 86ace87b3e..7e0049d007 100644 --- a/addons/microdagr/functions/fnc_appMarkKeypadEntry.sqf +++ b/addons/microdagr/functions/fnc_appMarkKeypadEntry.sqf @@ -15,23 +15,21 @@ */ #include "script_component.hpp" -private ["_display", "_editText", "_actualPos"]; - params ["_keypadButton"]; disableSerialization; -_display = uiNamespace getVariable [[QGVAR(RscTitleDisplay), QGVAR(DialogDisplay)] select (GVAR(currentShowMode) == DISPLAY_MODE_DIALOG), displayNull]; +private _display = uiNamespace getVariable [[QGVAR(RscTitleDisplay), QGVAR(DialogDisplay)] select (GVAR(currentShowMode) == DISPLAY_MODE_DIALOG), displayNull]; if (isNull _display) exitWith {ERROR("No Display");}; if (GVAR(currentApplicationPage) != APP_MODE_MARK) exitWith {}; -_editText = ctrlText (_display displayCtrl IDC_MODEMARK_CORDSEDIT); +private _editText = ctrlText (_display displayCtrl IDC_MODEMARK_CORDSEDIT); switch (_keypadButton) do { case ("ok"): { if ((count GVAR(newWaypointPosition)) == 0) then { - _actualPos = [_editText, true] call EFUNC(common,getMapPosFromGrid); + private _actualPos = [_editText, true] call EFUNC(common,getMapPosFromGrid); _actualPos set [2, (getTerrainHeightASL _actualPos)]; GVAR(newWaypointPosition) = _actualPos; [APP_MODE_MARK] call FUNC(saveCurrentAndSetNewMode); diff --git a/addons/microdagr/functions/fnc_appWaypointsButtonDeleteWP.sqf b/addons/microdagr/functions/fnc_appWaypointsButtonDeleteWP.sqf index d1fe1e8bdd..c03ff06265 100644 --- a/addons/microdagr/functions/fnc_appWaypointsButtonDeleteWP.sqf +++ b/addons/microdagr/functions/fnc_appWaypointsButtonDeleteWP.sqf @@ -15,14 +15,12 @@ */ #include "script_component.hpp" -private ["_display", "_wpIndex"]; - disableSerialization; -_display = uiNamespace getVariable [[QGVAR(RscTitleDisplay), QGVAR(DialogDisplay)] select (GVAR(currentShowMode) == DISPLAY_MODE_DIALOG), displayNull]; +private _display = uiNamespace getVariable [[QGVAR(RscTitleDisplay), QGVAR(DialogDisplay)] select (GVAR(currentShowMode) == DISPLAY_MODE_DIALOG), displayNull]; if (isNull _display) exitWith {ERROR("No Display");}; -_wpIndex = lbCurSel (_display displayCtrl IDC_MODEWAYPOINTS_LISTOFWAYPOINTS); +private _wpIndex = lbCurSel (_display displayCtrl IDC_MODEWAYPOINTS_LISTOFWAYPOINTS); //If it's our currentWP then deactivate if (GVAR(currentWaypoint) == _wpIndex) then {GVAR(currentWaypoint) = -1}; diff --git a/addons/microdagr/functions/fnc_appWaypointsButtonSetWP.sqf b/addons/microdagr/functions/fnc_appWaypointsButtonSetWP.sqf index d2b3b0e20c..b0d10667a0 100644 --- a/addons/microdagr/functions/fnc_appWaypointsButtonSetWP.sqf +++ b/addons/microdagr/functions/fnc_appWaypointsButtonSetWP.sqf @@ -15,14 +15,12 @@ */ #include "script_component.hpp" -private ["_wpListBox", "_newWpIndex", "_waypoints"]; - disableSerialization; params ["_wpButton"]; -_wpListBox = (ctrlParent _wpButton) displayCtrl 144501; -_newWpIndex = lbCurSel _wpListBox; -_waypoints = [] call FUNC(deviceGetWaypoints); +private _wpListBox = (ctrlParent _wpButton) displayCtrl 144501; +private _newWpIndex = lbCurSel _wpListBox; +private _waypoints = [] call FUNC(deviceGetWaypoints); if ((_newWpIndex < 0) || (_newWpIndex > ((count _waypoints) - 1))) exitWith { GVAR(currentWaypoint) = -1; diff --git a/addons/microdagr/functions/fnc_mapOnDrawEH.sqf b/addons/microdagr/functions/fnc_mapOnDrawEH.sqf index 92d647f348..0c1925f1f8 100644 --- a/addons/microdagr/functions/fnc_mapOnDrawEH.sqf +++ b/addons/microdagr/functions/fnc_mapOnDrawEH.sqf @@ -15,23 +15,21 @@ */ #include "script_component.hpp" -private ["_mapSize", "_waypoints", "_size", "_targetPos", "_relBearing", "_wpName", "_wpPos", "_alpha"]; - params ["_theMap"]; -_mapSize = (ctrlPosition _theMap) select 3; +private _mapSize = (ctrlPosition _theMap) select 3; -_waypoints = [] call FUNC(deviceGetWaypoints); +private _waypoints = [] call FUNC(deviceGetWaypoints); if (GVAR(currentApplicationPage) == 1) then { _theMap ctrlMapAnimAdd [0, DUMMY_ZOOM, DUMMY_POS]; ctrlMapAnimCommit _theMap; - _size = 412 * _mapSize; + private _size = 412 * _mapSize; _theMap drawIcon [QUOTE(PATHTO_R(images\compass_starInverted.paa)), [1,1,1,1], DUMMY_POS, _size, _size, (-1 * (([ACE_player] call CBA_fnc_headDir) select 0)), '', 0 ]; _theMap drawIcon [QUOTE(PATHTO_R(images\compass_needle.paa)), [0.533,0.769,0.76,1], DUMMY_POS, _size, _size, 0, '', 0 ]; if (GVAR(currentWaypoint) != -1) then { - _targetPos = []; + private _targetPos = []; if (GVAR(currentWaypoint) == -2) then { if ((count GVAR(rangeFinderPositionASL)) == 3) then { _targetPos = GVAR(rangeFinderPositionASL); @@ -42,7 +40,7 @@ if (GVAR(currentApplicationPage) == 1) then { }; }; if ((count _targetPos) == 3) then { - _relBearing = [ACE_player, _targetPos] call BIS_fnc_relativeDirTo; + private _relBearing = (ACE_player getDir _targetPos) - (([ACE_player] call CBA_fnc_headDir) select 0); _theMap drawIcon [QUOTE(PATHTO_R(images\compass_needle.paa)), [1,0.564,0.564,1], DUMMY_POS, _size, _size, _relBearing, '', 0 ]; }; }; @@ -55,14 +53,14 @@ if (GVAR(currentApplicationPage) == 1) then { _theMap ctrlMapAnimAdd [0, (GVAR(mapZoom)/_mapSize), (getPosASL ACE_player)]; ctrlMapAnimCommit _theMap; }; - _size = 48 * _mapSize; + private _size = 48 * _mapSize; _theMap drawIcon [QUOTE(PATHTO_R(images\icon_self.paa)), [0.533,0.769,0.76,0.75], (getPosASL ACE_player), _size, _size, (([ACE_player] call CBA_fnc_headDir) select 0), '', 0 ]; if (GVAR(settingShowAllWaypointsOnMap)) then { _size = 32 * _mapSize; { _x params ["_wpName", "_wpPos"]; - _alpha = if (_forEachIndex == GVAR(currentWaypoint)) then {1} else {0.5}; + private _alpha = if (_forEachIndex == GVAR(currentWaypoint)) then {1} else {0.5}; _theMap drawIcon [QUOTE(PATHTO_R(images\icon_mapWaypoints.paa)), [1,1,1,_alpha], _wpPos, _size, _size, 0, '', 0 ]; } forEach _waypoints; }; diff --git a/addons/microdagr/functions/fnc_openDisplay.sqf b/addons/microdagr/functions/fnc_openDisplay.sqf index aa2db94827..0f407138f5 100644 --- a/addons/microdagr/functions/fnc_openDisplay.sqf +++ b/addons/microdagr/functions/fnc_openDisplay.sqf @@ -1,9 +1,9 @@ /* * Author: PabstMirror - * Changes the display mode of the microDAGR + * Changes the display mode of the MicroDAGR. * * Arguments: - * 0: Display Mode to show the microDAGR in + * 0: Display Mode to show the microDAGR in (default: -1) * * Return Value: * None @@ -15,10 +15,8 @@ */ #include "script_component.hpp" -private ["_oldShowMode", "_args", "_player"]; - params [["_newDisplayShowMode", -1, [-1]]]; -_oldShowMode = GVAR(currentShowMode); +private _oldShowMode = GVAR(currentShowMode); if (_newDisplayShowMode == -1) then { //Toggle mode button: diff --git a/addons/microdagr/functions/fnc_recieveRangefinderData.sqf b/addons/microdagr/functions/fnc_recieveRangefinderData.sqf index 8b2c6672a8..9d9bec33ef 100644 --- a/addons/microdagr/functions/fnc_recieveRangefinderData.sqf +++ b/addons/microdagr/functions/fnc_recieveRangefinderData.sqf @@ -16,19 +16,16 @@ * Public: No */ #include "script_component.hpp" - -private ["_horizontalDistance", "_verticleDistance", "_targetOffset", "_targetPosASL"]; - params ["_slopeDistance", "_azimuth", "_inclination"]; if (GVAR(currentWaypoint) != -2) exitWith {}; //Only take waypoint when "connected" if (_slopeDistance < 0) exitWith {}; //Bad Data -_horizontalDistance = (cos _inclination) * _slopeDistance; -_verticleDistance = (sin _inclination) * _slopeDistance; +private _horizontalDistance = (cos _inclination) * _slopeDistance; +private _verticleDistance = (sin _inclination) * _slopeDistance; -_targetOffset = [((sin _azimuth) * _horizontalDistance), ((cos _azimuth) * _horizontalDistance), _verticleDistance]; +private _targetOffset = [((sin _azimuth) * _horizontalDistance), ((cos _azimuth) * _horizontalDistance), _verticleDistance]; //This assumes the "rangefinder view" pos is very close to player, at worst the turret should only be a few meters different -_targetPosASL = (getPosASL ACE_player) vectorAdd _targetOffset; +private _targetPosASL = (getPosASL ACE_player) vectorAdd _targetOffset; GVAR(rangeFinderPositionASL) = _targetPosASL; diff --git a/addons/microdagr/functions/fnc_saveCurrentAndSetNewMode.sqf b/addons/microdagr/functions/fnc_saveCurrentAndSetNewMode.sqf index 7cbec9f242..9c98f2f7dc 100644 --- a/addons/microdagr/functions/fnc_saveCurrentAndSetNewMode.sqf +++ b/addons/microdagr/functions/fnc_saveCurrentAndSetNewMode.sqf @@ -15,22 +15,19 @@ * Public: No */ #include "script_component.hpp" - -private ["_display", "_theMap", "_centerPos", "_mapCtrlPos"]; - params ["_newMode"]; disableSerialization; -_display = uiNamespace getVariable [[QGVAR(RscTitleDisplay), QGVAR(DialogDisplay)] select (GVAR(currentShowMode) == DISPLAY_MODE_DIALOG), displayNull]; +private _display = uiNamespace getVariable [[QGVAR(RscTitleDisplay), QGVAR(DialogDisplay)] select (GVAR(currentShowMode) == DISPLAY_MODE_DIALOG), displayNull]; if (isNull _display) exitWith {ERROR("No Display");}; if (GVAR(currentApplicationPage) == 2) then { - _theMap = [_display displayCtrl IDC_MAPDETAILS, _display displayCtrl IDC_MAPPLAIN] select (!GVAR(mapShowTexture)); - _mapCtrlPos = ctrlPosition _theMap; + private _theMap = [_display displayCtrl IDC_MAPDETAILS, _display displayCtrl IDC_MAPPLAIN] select (!GVAR(mapShowTexture)); + private _mapCtrlPos = ctrlPosition _theMap; _mapCtrlPos params ["_mapCtrlPosX", "_mapCtrlPosY", "_mapCtrlPosZ", "_mapSize"]; - _centerPos = [(_mapCtrlPosX + _mapCtrlPosZ / 2), (_mapCtrlPosY + _mapSize / 2)]; + private _centerPos = [(_mapCtrlPosX + _mapCtrlPosZ / 2), (_mapCtrlPosY + _mapSize / 2)]; GVAR(mapPosition) = _theMap ctrlMapScreenToWorld _centerPos; GVAR(mapZoom) = (ctrlMapScale _theMap) * _mapSize; diff --git a/addons/microdagr/functions/fnc_showApplicationPage.sqf b/addons/microdagr/functions/fnc_showApplicationPage.sqf index 903680e896..c944aa6546 100644 --- a/addons/microdagr/functions/fnc_showApplicationPage.sqf +++ b/addons/microdagr/functions/fnc_showApplicationPage.sqf @@ -15,11 +15,9 @@ */ #include "script_component.hpp" -private ["_display", "_theMap", "_mapSize"]; - disableSerialization; -_display = uiNamespace getVariable [[QGVAR(RscTitleDisplay), QGVAR(DialogDisplay)] select (GVAR(currentShowMode) == DISPLAY_MODE_DIALOG), displayNull]; +private _display = uiNamespace getVariable [[QGVAR(RscTitleDisplay), QGVAR(DialogDisplay)] select (GVAR(currentShowMode) == DISPLAY_MODE_DIALOG), displayNull]; if (isNull _display) exitWith {ERROR("No Display");}; diff --git a/addons/microdagr/functions/fnc_updateDisplay.sqf b/addons/microdagr/functions/fnc_updateDisplay.sqf index b13abbec06..87c5ee9751 100644 --- a/addons/microdagr/functions/fnc_updateDisplay.sqf +++ b/addons/microdagr/functions/fnc_updateDisplay.sqf @@ -15,33 +15,31 @@ */ #include "script_component.hpp" -private ["_display", "_waypoints", "_posString", "_eastingText", "_northingText", "_numASL", "_aboveSeaLevelText", "_compassAngleText", "_targetPos", "_targetPosName", "_targetPosLocationASL", "_bearingText", "_rangeText", "_targetName", "_bearing", "_2dDistanceKm", "_SpeedText", "_wpListBox", "_currentIndex", "_wpName", "_wpPos", "_settingListBox", "_yearString", "_monthSring", "_dayString", "_daylight"]; - disableSerialization; -_display = uiNamespace getVariable [[QGVAR(RscTitleDisplay), QGVAR(DialogDisplay)] select (GVAR(currentShowMode) == DISPLAY_MODE_DIALOG), displayNull]; +private _display = uiNamespace getVariable [[QGVAR(RscTitleDisplay), QGVAR(DialogDisplay)] select (GVAR(currentShowMode) == DISPLAY_MODE_DIALOG), displayNull]; if (isNull _display) exitWith {ERROR("No Display");}; //Fade "shell" at night -_daylight = [] call EFUNC(common,ambientBrightness); +private _daylight = [] call EFUNC(common,ambientBrightness); (_display displayCtrl IDC_MICRODAGRSHELL) ctrlSetTextColor [_daylight, _daylight, _daylight, 1]; (_display displayCtrl IDC_CLOCKTEXT) ctrlSetText ([daytime, "HH:MM"] call bis_fnc_timeToString); -_waypoints = [] call FUNC(deviceGetWaypoints); +private _waypoints = [] call FUNC(deviceGetWaypoints); switch (GVAR(currentApplicationPage)) do { case (APP_MODE_INFODISPLAY): { //Easting/Northing: - _posString = [getPos ACE_player] call EFUNC(common,getMapGridFromPos); - _eastingText = (_posString select 0) + "e"; - _northingText = (_posString select 1) + "n"; + private _posString = [getPos ACE_player] call EFUNC(common,getMapGridFromPos); + private _eastingText = (_posString select 0) + "e"; + private _northingText = (_posString select 1) + "n"; (_display displayCtrl IDC_MODEDISPLAY_EASTING) ctrlSetText _eastingText; (_display displayCtrl IDC_MODEDISPLAY_NORTHING) ctrlSetText _northingText; //Elevation: - _numASL = ((getPosASL ACE_player) select 2) + EGVAR(common,mapAltitude); - _aboveSeaLevelText = [_numASL, 5, 0] call CBA_fnc_formatNumber; + private _numASL = ((getPosASL ACE_player) select 2) + EGVAR(common,mapAltitude); + private _aboveSeaLevelText = [_numASL, 5, 0] call CBA_fnc_formatNumber; _aboveSeaLevelText = if (_numASL > 0) then {"+" + _aboveSeaLevelText + " MSL"} else {_aboveSeaLevelText + " MSL"}; (_display displayCtrl IDC_MODEDISPLAY_ELEVATIONNUM) ctrlSetText _aboveSeaLevelText; @@ -58,23 +56,22 @@ case (APP_MODE_INFODISPLAY): { if (GVAR(currentWaypoint) == -1) then { - _yearString = (date select 0); - _monthSring = localize (["error","str_january","str_february","str_march","str_april","str_may","str_june","str_july","str_august","str_september","str_october","str_november","str_december"] select (date select 1)); - _dayString = if ((date select 2) < 10) then {"0" + str (date select 2)} else {str (date select 2)}; + private _yearString = (date select 0); + private _monthSring = localize (["error","str_january","str_february","str_march","str_april","str_may","str_june","str_july","str_august","str_september","str_october","str_november","str_december"] select (date select 1)); + private _dayString = if ((date select 2) < 10) then {"0" + str (date select 2)} else {str (date select 2)}; (_display displayCtrl IDC_MODEDISPLAY_TIMEDISPLAYGREEN1) ctrlSetText format ["%1-%2-%3", _yearString, _monthSring, _dayString]; //"18-Feb-2010"; (_display displayCtrl IDC_MODEDISPLAY_TIMEDISPLAYGREEN2) ctrlSetText ([daytime, "HH:MM:SS"] call bis_fnc_timeToString); } else { - _targetPosName = ""; - _targetPosLocationASL = []; + private _targetPosName = ""; + private _targetPosLocationASL = []; _bearingText = "----"; _rangeText = "----"; _aboveSeaLevelText = "----"; - _targetName = "----"; if (GVAR(currentWaypoint) == -2) then { if (!(GVAR(rangeFinderPositionASL) isEqualTo [])) then { - _targetPos = [GVAR(rangeFinderPositionASL)] call EFUNC(common,getMapGridFromPos); + private _targetPos = [GVAR(rangeFinderPositionASL)] call EFUNC(common,getMapGridFromPos); _targetPosName = format ["[%1 %2 %3]", EGVAR(common,MGRS_data) select 1, _targetPos select 0, _targetPos select 1]; _targetPosLocationASL = GVAR(rangeFinderPositionASL); }; @@ -85,15 +82,15 @@ case (APP_MODE_INFODISPLAY): { }; if (!(_targetPosLocationASL isEqualTo [])) then { - _bearing = [(getPosASL ACE_player), _targetPosLocationASL] call BIS_fnc_dirTo; + private _bearing = [(getPosASL ACE_player), _targetPosLocationASL] call BIS_fnc_dirTo; _bearingText = if (GVAR(settingUseMils)) then { [(floor ((6400 / 360) * (_bearing))), 4, 0] call CBA_fnc_formatNumber; } else { ([_bearing, 3, 1] call CBA_fnc_formatNumber) + "°" //degree symbol is in UTF-8 }; - _2dDistanceKm = ((getPosASL ACE_player) distance2D _targetPosLocationASL) / 1000; + private _2dDistanceKm = ((getPosASL ACE_player) distance2D _targetPosLocationASL) / 1000; _rangeText = format ["%1km", ([_2dDistanceKm, 1, 1] call CBA_fnc_formatNumber)]; - _numASL = (_targetPosLocationASL select 2) + EGVAR(common,mapAltitude); + private _numASL = (_targetPosLocationASL select 2) + EGVAR(common,mapAltitude); _aboveSeaLevelText = [_numASL, 5, 0] call CBA_fnc_formatNumber; _aboveSeaLevelText = if (_numASL > 0) then {"+" + _aboveSeaLevelText + " MSL"} else {_aboveSeaLevelText + " MSL"}; }; @@ -106,7 +103,7 @@ case (APP_MODE_INFODISPLAY): { }; case (APP_MODE_COMPASS): { //Heading: - _compassAngleText = if (GVAR(settingUseMils)) then { + private _compassAngleText = if (GVAR(settingUseMils)) then { [(floor ((6400 / 360) * (([ACE_player] call CBA_fnc_headDir) select 0))), 4, 0] call CBA_fnc_formatNumber; } else { ([([ACE_player] call CBA_fnc_headDir) select 0, 3, 1] call CBA_fnc_formatNumber) + "°" //degree symbol is in UTF-8 @@ -114,7 +111,7 @@ case (APP_MODE_COMPASS): { (_display displayCtrl IDC_MODECOMPASS_HEADING) ctrlSetText _compassAngleText; //Speed: - _SpeedText = format ["%1kph", (round (speed (vehicle ACE_player)))];; + private _SpeedText = format ["%1kph", (round (speed (vehicle ACE_player)))];; (_display displayCtrl IDC_MODECOMPASS_SPEED) ctrlSetText _SpeedText; if (GVAR(currentWaypoint) == -1) then { @@ -122,12 +119,12 @@ case (APP_MODE_COMPASS): { (_display displayCtrl IDC_MODECOMPASS_RANGE) ctrlSetText ""; (_display displayCtrl IDC_MODECOMPASS_TARGET) ctrlSetText ""; } else { - _targetPosName = ""; - _targetPosLocationASL = []; + private _targetPosName = ""; + private _targetPosLocationASL = []; if (GVAR(currentWaypoint) == -2) then { if (!(GVAR(rangeFinderPositionASL) isEqualTo [])) then { - _targetPos = [GVAR(rangeFinderPositionASL)] call EFUNC(common,getMapGridFromPos); + private _targetPos = [GVAR(rangeFinderPositionASL)] call EFUNC(common,getMapGridFromPos); _targetPosName = format ["[%1 %2 %3]", EGVAR(common,MGRS_data) select 1, _targetPos select 0, _targetPos select 1]; _targetPosLocationASL = GVAR(rangeFinderPositionASL); }; @@ -137,17 +134,17 @@ case (APP_MODE_COMPASS): { _targetPosLocationASL = (_waypoints select GVAR(currentWaypoint)) select 1; }; - _bearing = "---"; + _bearingText = "---"; _rangeText = "---"; if (!(_targetPosLocationASL isEqualTo [])) then { - _bearing = [(getPosASL ACE_player), _targetPosLocationASL] call BIS_fnc_dirTo; + private _bearing = [(getPosASL ACE_player), _targetPosLocationASL] call BIS_fnc_dirTo; _bearingText = if (GVAR(settingUseMils)) then { [(floor ((6400 / 360) * (_bearing))), 4, 0] call CBA_fnc_formatNumber; } else { ([_bearing, 3, 1] call CBA_fnc_formatNumber) + "°" //degree symbol is in UTF-8 }; - _2dDistanceKm = ((getPosASL ACE_player) distance2D _targetPosLocationASL) / 1000; + private _2dDistanceKm = ((getPosASL ACE_player) distance2D _targetPosLocationASL) / 1000; _rangeText = format ["%1km", ([_2dDistanceKm, 1, 1] call CBA_fnc_formatNumber)]; }; @@ -158,14 +155,14 @@ case (APP_MODE_COMPASS): { }; case (APP_MODE_WAYPOINTS): { - _wpListBox = _display displayCtrl IDC_MODEWAYPOINTS_LISTOFWAYPOINTS; - _currentIndex = lbCurSel _wpListBox; + private _wpListBox = _display displayCtrl IDC_MODEWAYPOINTS_LISTOFWAYPOINTS; + private _currentIndex = lbCurSel _wpListBox; lbClear _wpListBox; { _x params ["_wpName", "_wpPos"]; _wpListBox lbAdd _wpName; - _2dDistanceKm = ((getPosASL ACE_player) distance2D _wpPos) / 1000; + private _2dDistanceKm = ((getPosASL ACE_player) distance2D _wpPos) / 1000; _wpListBox lbSetTextRight [_forEachIndex, (format ["%1km", ([_2dDistanceKm, 1, 1] call CBA_fnc_formatNumber)])]; } forEach _waypoints; @@ -177,7 +174,7 @@ case (APP_MODE_WAYPOINTS): { }; case (APP_MODE_SETUP): { - _settingListBox = _display displayCtrl IDC_MODESETTINGS; + private _settingListBox = _display displayCtrl IDC_MODESETTINGS; lbClear _settingListBox; _settingListBox lbAdd (localize LSTRING(settingUseMils)); diff --git a/addons/microdagr/gui.hpp b/addons/microdagr/gui.hpp index fe15bb7bb2..1404f6b81d 100644 --- a/addons/microdagr/gui.hpp +++ b/addons/microdagr/gui.hpp @@ -59,10 +59,10 @@ class GVAR(TheDialog) { //Redfine Scaling for the RscTitle -#define PROFILE_X (profilenamespace getVariable ['IGUI_GRID_GPS_X', 0]) -#define PROFILE_Y (profilenamespace getVariable ['IGUI_GRID_GPS_Y', 0]) -#define PROFILE_W (profilenamespace getVariable ['IGUI_GRID_GPS_W', 1]) -#define PROFILE_H ((16/9) * (profilenamespace getVariable ['IGUI_GRID_GPS_W', 1])) +#define PROFILE_X (profilenamespace getVariable ['IGUI_grid_ACE_microDagr_X', 0]) +#define PROFILE_Y (profilenamespace getVariable ['IGUI_grid_ACE_microDagr_Y', 0]) +#define PROFILE_W (profilenamespace getVariable ['IGUI_grid_ACE_microDagr_W', 1]) +#define PROFILE_H ((16/9) * (profilenamespace getVariable ['IGUI_grid_ACE_microDagr_W', 1])) //Need undef's for pboProject #undef X_PART diff --git a/addons/microdagr/stringtable.xml b/addons/microdagr/stringtable.xml index 44b67c8773..f9015c5512 100644 --- a/addons/microdagr/stringtable.xml +++ b/addons/microdagr/stringtable.xml @@ -13,6 +13,9 @@ GPS MicroDAGR GPS MicroDAGR MicroDAGR GPS + MicroDAGR GPS + 微型军用GPS接收器 + 微型軍用GPS接收器 MicroDAGR advanced GPS receiver @@ -26,6 +29,9 @@ Ricevitore GPS avanzato MicroDAGR Recepitor GPS avançado MicroDAGR MicroDAGR は改良された GPS 受信機です + MicroDAGR 고급 위성항법 수신기 + 微型军用高级防御GPS接收器 + 微型軍用高級防禦GPS接收器 Angular Unit: @@ -38,7 +44,10 @@ Szögmértékegység: Unità angolare: Unidade Angular: - 角度の種類: + 角度の種類: + 각도의 단위: + 角密位: + 角密位: Mils @@ -51,7 +60,10 @@ Mil Mils Mils: - ミリ ラジアン + ミル + + 密位 + 密位 Show Waypoints On Map: @@ -64,7 +76,10 @@ Útvonalpontok mutatása a térképen: Mostra waypoint sulla mappa: Mostrar Waypoints no mapa: - 地図へウェイポイントを表示: + 地図へウェイポイントを表示: + 웨이포인트를 지도에 보이기: + 显示路径点在地图上: + 顯示路徑點在地圖上: Degrees @@ -78,6 +93,9 @@ Gradi Graus 角度 + 각도 + + On @@ -91,6 +109,9 @@ Encendido Be 有効 + 켜기 + 开启 + 開啟 Off @@ -104,6 +125,9 @@ Apagado Ki 無効 + 끄기 + 关闭 + 關閉 Enter Grid Cords: @@ -116,7 +140,10 @@ Add meg a rácskoordinátákat: Introduci griglia coordinate: Digite as Ccords. do Grid - 座標を入力: + 座標を入力: + 输入网格座标: + 輸入網格座標: + 좌표 입력: Name of [%1] @@ -130,6 +157,9 @@ Nome di [%1] Nome do [%1] [%1] の名前 + [%1] 의 이름 + 名称 [%1] + 名稱 [%1] MGRS-New @@ -143,6 +173,9 @@ Nuovo MGRS MGRS-Novo MGRS-New + 军事网格座标系统-新型 + 軍事網格座標系統-新型 + MGRS-New WGD @@ -156,6 +189,9 @@ WGD WGD WGD + WGD + 世界座标 + 世界座標 Range: @@ -168,7 +204,10 @@ Távolság: Distanza: Distância: - 距離: + 距離: + 거리: + 范围: + 範圍: Compass Direction @@ -182,6 +221,9 @@ Azimut Direção na bússula 方位磁石での方位 + 방위 + 指北针方位 + 指北針方位 Mark @@ -195,6 +237,9 @@ Marca Marca マーク + 표시 + 标记 + 標記 Waypoints @@ -208,6 +253,9 @@ waypoints Waypoints ウェイポイント + 웨이포인트 + 路径点 + 路徑點 Connect To @@ -221,6 +269,9 @@ Collega a Conectar à 次に接続 + 연결 + 连接到 + 連接到 Settings @@ -234,6 +285,9 @@ Impostaizoni Opções 設定 + 설정 + 设定 + 設定 SetWP @@ -246,7 +300,10 @@ UP Beállítása Definisci WayPoints Definir WP - ウェイポイント設定 + ウェイポイント設定 + 웨이포인트 설정 + 设置路径点 + 設置路徑點 Add @@ -260,6 +317,9 @@ Aggiungi Adicionar 追加 + 더하기 + 新增 + 新增 Delete @@ -273,6 +333,9 @@ Borrar Törlés 削除 + 지우기 + 删除 + 刪除 Toggle MicroDAGR Display Mode @@ -286,6 +349,9 @@ Alterna modalità display MicroDAGR Alternar Modo de Display do MicroDAGR MicroDAGR の表示モード + MicroDAGR 화면 모드 토글 + 切换微型军用GPS接收器显示模式 + 切換微型軍用GPS接收器顯示模式 Show MicoDAGR @@ -299,6 +365,9 @@ Mostra MicroDAGR Mostrar MicroDAGR MicoDAGR を表示 + MicroDAGR 꺼내기 + 显示微型军用GPS接收器 + 顯示微型軍用GPS接收器 Configure MicroDAGR @@ -312,6 +381,9 @@ ConfiguraMicroDAGR Configurar MicroDAGR MicroDAGR を設定 + MicroDAGR 설정하기 + 设定微型军用GPS接收器 + 設定微型軍用GPS接收器 Close MicroDAGR @@ -325,6 +397,9 @@ Chiudi MicroDAGR Fechar MicroDAGR MicroDAGR を閉じる + MicroDAGR 집어넣기 + 关闭微型军用GPS接收器 + 關閉微型軍用GPS接收器 MicroDAGR Map Fill @@ -338,6 +413,9 @@ Заполнение карты MicroDAGR Riempimento Mappa MicroDAGR MicroDAGR での地図情報 + MicroDAGR - 지도채우기 + 微型军用GPS接收器地图资料 + 微型軍用GPS接收器地圖資料 MicroDAGR Map Fill @@ -351,6 +429,9 @@ Заполнение карты MicroDAGR Riempimento Mappa MicroDAGR MicroDAGR での地図情報 + MicroDAGR - 지도채우기 + 微型军用GPS接收器地图资料 + 微型軍用GPS接收器地圖資料 How much map data is filled on MicroDAGR's @@ -364,6 +445,9 @@ Сколько данных должно отображаться на карте MicroDAGR Quanti dati sono trasferiti nella mappa del MicroDAGR MicroDAGR で表示する地図情報を決定します + 얼마나 많은 데이터가 MicroDAGR에 있는지에 대한 정보 + 有多少地图数据会显示在微型军用GPS接收器 + 有多少地圖數據會顯示在微型軍用GPS接收器 Full Satellite + Buildings @@ -377,6 +461,9 @@ Спутник + Здания Satellite Completo + Edifici 完全な衛星画像と建物 + 위성 사진 + 건물 + 完整卫星画面 + 建筑物位置 + 完整衛星畫面 + 建築物位置 Topographical + Roads @@ -390,6 +477,9 @@ Топография + Дороги Topografico + Strade 地形と道路 + 지형학 도표 + 도로 + 地形 + 道路 + 地形 + 道路 None (Cannot use map view) @@ -403,6 +493,9 @@ Не показывать (запрещает использовать режим карты) Nessuno (Non puoi usare la vista mappa) なし(地図表示を使えません) + 없음 (지도를 볼 수 없음) + 无 (无法检视地图) + 無 (無法檢視地圖) Controls how much data is filled on the microDAGR items. Less data restricts the map view to show less on the minimap. @@ -416,6 +509,9 @@ Контролирует, сколько данных должно отображаться на карте устройств MicroDAGR. Ограничивает объем отображаемых данных на миникарте. Controlla quanti dati sono presenti negli oggetti MicroDAGR. Meno dati costringono la vista mappa a mostrare meno informazioni nella minimappa. アイテム上で表示されるデータ量を決定します。設定を減らすと地図上での情報が少なくなります。 + MicroDAGR에 얼마나 많은 데이터가 들어있는지 정합니다. 적을 수록 지도상에도 비춰지는게 적어집니다. + 设定有多少数据会显示在微型军用GPS接收器上。这些资料的多寡会反映在迷你地图的显示上。 + 設定有多少數據會顯示在微型軍用GPS接收器上。這些資料的多寡會反映在迷你地圖的顯示上。 - \ No newline at end of file + diff --git a/addons/minedetector/CfgVehicles.hpp b/addons/minedetector/CfgVehicles.hpp index 14273b108c..ab6c06b4cb 100644 --- a/addons/minedetector/CfgVehicles.hpp +++ b/addons/minedetector/CfgVehicles.hpp @@ -1,9 +1,9 @@ class CfgVehicles { class Box_NATO_Support_F; class ACE_Box_Misc: Box_NATO_Support_F { - class TransportItems { - MACRO_ADDITEM(ACE_VMM3,4); - MACRO_ADDITEM(ACE_VMH3,4); + class TransportWeapons { + MACRO_ADDWEAPON(ACE_VMM3,4); + MACRO_ADDWEAPON(ACE_VMH3,4); }; }; diff --git a/addons/minedetector/XEH_postInit.sqf b/addons/minedetector/XEH_postInit.sqf index 4b842e3488..7ea04b5a5d 100644 --- a/addons/minedetector/XEH_postInit.sqf +++ b/addons/minedetector/XEH_postInit.sqf @@ -27,7 +27,7 @@ addMissionEventHandler ["Draw3D", { GVAR(debugDetector) params ["_detectorPointAGL", "_mines"]; drawIcon3D ["\A3\ui_f\data\map\markers\military\dot_CA.paa", [0,0,1,1], _detectorPointAGL, 1, 1, 0, "detector", 1, 0.02, "PuristaMedium"]; { - _name = format ["%1@%2", typeOf _x, (floor ((_x distance _detectorPointAGL) * 10)) / 10]; + private _name = format ["%1@%2", typeOf _x, (floor ((_x distance _detectorPointAGL) * 10)) / 10]; if ((getNumber (configFile >> "CfgVehicles" >> (typeOf _x) >> QGVAR(detectable))) == 1) then { drawIcon3D ["\A3\ui_f\data\map\markers\military\dot_CA.paa", [1,0,0,1], (ASLtoAGL (getPosASL _x)), 1, 1, 0, _name, 1, 0.02, "PuristaMedium"]; } else { diff --git a/addons/minedetector/XEH_preInit.sqf b/addons/minedetector/XEH_preInit.sqf index a7feade1c3..b47cf6628d 100644 --- a/addons/minedetector/XEH_preInit.sqf +++ b/addons/minedetector/XEH_preInit.sqf @@ -2,6 +2,8 @@ ADDON = false; +PREP_RECOMPILE_START; #include "XEH_PREP.hpp" +PREP_RECOMPILE_END; ADDON = true; diff --git a/addons/minedetector/functions/fnc_detectorLoop.sqf b/addons/minedetector/functions/fnc_detectorLoop.sqf index e5fd4d5bd3..ef05046881 100644 --- a/addons/minedetector/functions/fnc_detectorLoop.sqf +++ b/addons/minedetector/functions/fnc_detectorLoop.sqf @@ -9,6 +9,9 @@ * Return Value: * None * + * Example: + * [[args], 2] call ACE_minedetector_fnc_detectorLoop + * * Public: No */ diff --git a/addons/minedetector/functions/fnc_getDetectedObject.sqf b/addons/minedetector/functions/fnc_getDetectedObject.sqf index 0b6faa6168..ea7698dce7 100644 --- a/addons/minedetector/functions/fnc_getDetectedObject.sqf +++ b/addons/minedetector/functions/fnc_getDetectedObject.sqf @@ -42,7 +42,7 @@ private _distance = -1; private _objectType = typeOf _x; _isDetectable = GVAR(detectableClasses) getVariable _objectType; - if (isNil "_isDetectable") then { + if (isNil "_isDetectable" || {(getModelInfo _x) select 0 == "empty.p3d"}) then { _isDetectable = false; }; diff --git a/addons/minedetector/functions/fnc_getDetectorConfig.sqf b/addons/minedetector/functions/fnc_getDetectorConfig.sqf index ccafa83edd..8b78a0b9ee 100644 --- a/addons/minedetector/functions/fnc_getDetectorConfig.sqf +++ b/addons/minedetector/functions/fnc_getDetectorConfig.sqf @@ -18,6 +18,8 @@ params ["_detectorType"]; +if (_detectorType isEqualTo "") exitWith {[]}; + private _detectorConfig = GVAR(detectorConfigs) getVariable _detectorType; if (isNil "_detectorConfig") then { private _cfgEntry = (configFile >> "ACE_detector" >> "detectors" >> _detectorType); diff --git a/addons/minedetector/stringtable.xml b/addons/minedetector/stringtable.xml index ff67757cb3..0e2e31e5a6 100644 --- a/addons/minedetector/stringtable.xml +++ b/addons/minedetector/stringtable.xml @@ -1,4 +1,4 @@ - + @@ -8,6 +8,11 @@ Detektor kovů 地雷探知機 Wykrywacz metali + Metalldetektor + 지뢰탐지기 + Metal detector + 金属探测器 + 金屬探測器 Metal detector @@ -16,6 +21,11 @@ Detektor kovů 地雷探知機 Wykrywacz metali + Metalldetektor + 지뢰탐지기 + Metal detector + 金属探测器 + 金屬探測器 Activate @@ -24,6 +34,11 @@ Aktivovat 起動 Aktywuj + Aktivieren + 작동 + Attiva + 启用探测器 + 啟用探測器 Deactivate @@ -32,6 +47,11 @@ Deaktivovat 停止 Deaktywuj + Deaktivieren + 끄기 + Disattiva + 停用探测器 + 停用探測器 Connect Headphones @@ -39,6 +59,12 @@ Připojit sluchátka ヘッドホンへつなぐ Podłącz słuchawki + Kopfhörer verbinden + 헤드폰에 연결 + Connecter les écouteurs + Connetti Auricolari + 连接耳机 + 連接耳機 Disconnect Headphones @@ -46,6 +72,12 @@ Odpojit sluchátka ヘッドホンからはずす Odłącz słuchawki + Kopfhörer trennen + 헤드폰 연결끊기 + Déconnecter les écouteurs + Disconnetti Auricolari + 断开耳机 + 斷開耳機 Headphones Connected @@ -53,6 +85,12 @@ Sluchátka připojena ヘッドホンへ接続された Słuchawki podpięte + Kopfhörer verbunden + 헤드폰 연결됨 + Écouteurs connectés + Auricolari Connessi + 已连接耳机 + 已連接耳機 Headphones Disconnected @@ -60,6 +98,12 @@ Sluchátka odpojena ヘッドホンから外された Słuchawki odpięte + Kopfhörer getrennt + 헤드폰 연결끊김 + Écouteurs déconnectés + Auricolari Disconnessi + 已断开耳机 + 已斷開耳機 diff --git a/addons/missileguidance/ACE_Settings.hpp b/addons/missileguidance/ACE_Settings.hpp index e73d533c08..6394e75390 100644 --- a/addons/missileguidance/ACE_Settings.hpp +++ b/addons/missileguidance/ACE_Settings.hpp @@ -2,9 +2,8 @@ class ACE_Settings { class GVAR(enabled) { value = 2; typeName = "SCALAR"; - isClientSettable = 1; displayName = CSTRING(Title); description = CSTRING(Desc); values[] = {CSTRING(Off), CSTRING(PlayerOnly), CSTRING(PlayerAndAi)}; }; -}; \ No newline at end of file +}; diff --git a/addons/missileguidance/CfgAmmo.hpp b/addons/missileguidance/CfgAmmo.hpp index 1d2c58ad93..7c2fb90d22 100644 --- a/addons/missileguidance/CfgAmmo.hpp +++ b/addons/missileguidance/CfgAmmo.hpp @@ -14,7 +14,7 @@ class CfgAmmo { laserLock = 0; manualControl = 0; maxSpeed = 300; - + EGVAR(rearm,caliber) = 70; class ADDON { @@ -45,31 +45,11 @@ class CfgAmmo { }; }; - class ACE_Hellfire_AGM114K: ACE_Hydra70_DAGR { - displayName = CSTRING(Hellfire_AGM114K); - displayNameShort = CSTRING(Hellfire_AGM114K_Short); - - description = CSTRING(Hellfire_AGM114K_desc); - descriptionShort = CSTRING(Hellfire_AGM114K_desc); - - // @TODO: placeholder model to at least make it look different - model = "\A3\Weapons_F\Ammo\Missile_AT_03_fly_F"; - proxyShape = "\A3\Weapons_F\Ammo\Missile_AT_03_F"; - - hit = 1400; - indirectHit = 71; - indirectHitRange = 4.5; - effectsMissile = "missile2"; - - //Explicity add guidance config - class ADDON: ADDON {}; - }; - // Titan class M_Titan_AT: MissileBase {}; class ACE_Javelin_FGM148: M_Titan_AT { - irLock = 0; + irLock = 1; laserLock = 0; airLock = 0; @@ -108,6 +88,8 @@ class CfgAmmo { seekerMinRange = 0; seekerMaxRange = 2500; // Range from the missile which the seeker can visually search + seekLastTargetPos = 1; // seek last target position [if seeker loses LOS of target, continue to last known pos] + // Attack profile type selection defaultAttackProfile = "JAV_TOP"; attackProfiles[] = { "JAV_TOP", "JAV_DIR" }; diff --git a/addons/missileguidance/CfgMagazines.hpp b/addons/missileguidance/CfgMagazines.hpp index e4a84862ae..7cc33b17a3 100644 --- a/addons/missileguidance/CfgMagazines.hpp +++ b/addons/missileguidance/CfgMagazines.hpp @@ -24,30 +24,4 @@ class CfgMagazines { descriptionShort = "24 Round DAGR"; weight = 72; }; - - // Hellfires - class 6Rnd_ACE_Hellfire_AGM114K : 12Rnd_PG_missiles { - count = 12; - ammo = "ACE_Hellfire_AGM114K"; - displayName = "6Rnd_ACE_Hellfire_AGM114K"; - displayNameShort = "6Rnd_ACE_Hellfire_AGM114K"; - descriptionShort = "6Rnd_ACE_Hellfire_AGM114K"; - weight = 36; - - }; - class 12Rnd_ACE_Hellfire_AGM114K : 6Rnd_ACE_Hydra70_DAGR { - count = 12; - displayName = "12Rnd_ACE_Hellfire_AGM114K"; - displayNameShort = "12Rnd_ACE_Hellfire_AGM114K"; - descriptionShort = "12Rnd_ACE_Hellfire_AGM114K"; - weight = 72; - }; - class 24Rnd_ACE_Hellfire_AGM114K : 6Rnd_ACE_Hydra70_DAGR { - count = 24; - displayName = "24Rnd_ACE_Hellfire_AGM114K"; - displayNameShort = "24Rnd_ACE_Hellfire_AGM114K"; - descriptionShort = "24Rnd_ACE_Hellfire_AGM114K"; - weight = 72; - }; - }; diff --git a/addons/missileguidance/CfgVehicles.hpp b/addons/missileguidance/CfgVehicles.hpp deleted file mode 100644 index 6aae81b316..0000000000 --- a/addons/missileguidance/CfgVehicles.hpp +++ /dev/null @@ -1,32 +0,0 @@ -class CfgVehicles { - class Air; - class Helicopter: Air { - class Turrets; - }; - class Helicopter_Base_F: Helicopter { - class Turrets: Turrets { - class MainTurret; - }; - }; - class Heli_Attack_01_base_F: Helicopter_Base_F { - class Turrets: Turrets { - class MainTurret: MainTurret {}; - }; - }; - class B_Heli_Attack_01_F: Heli_Attack_01_base_F {}; - class ACE_Comanche_Test : B_Heli_Attack_01_F { // Comanche testbed (Hidden: Scope=1) - scope = 1; - scopeCurator = 0; - displayName = "ACE_Comanche_Test"; - author = "ACE Team"; - class Library { - libTextDesc = "ACE_Comanche_Test"; - }; - class Turrets: Turrets { - class MainTurret: MainTurret { - weapons[] = {"gatling_20mm", "ace_missileguidance_dagr", "Laserdesignator_mounted"}; - magazines[] = {"ACE_500Rnd_20mm_shells_Comanche", "6Rnd_ACE_Hydra70_DAGR", "Laserbatteries"}; - }; - }; - }; -}; diff --git a/addons/missileguidance/XEH_PREP.hpp b/addons/missileguidance/XEH_PREP.hpp index 55948e7171..ee2b7328cb 100644 --- a/addons/missileguidance/XEH_PREP.hpp +++ b/addons/missileguidance/XEH_PREP.hpp @@ -1,6 +1,6 @@ +LOG("prep"); +PREP(cycleAttackProfileKeyDown); -PREP(rotateVectLineGetMap); -PREP(rotateVectLine); PREP(changeMissileDirection); PREP(checkSeekerAngle); @@ -17,11 +17,11 @@ PREP(doHandoff); PREP(handleHandoff); // Attack Profiles -PREP(attackProfile_LIN); -PREP(attackProfile_DIR); -PREP(attackProfile_MID); -PREP(attackProfile_HI); PREP(attackProfile_AIR); +PREP(attackProfile_DIR); +PREP(attackProfile_HI); +PREP(attackProfile_LIN); +PREP(attackProfile_MID); // Javelin profiles PREP(attackProfile_JAV_DIR); diff --git a/addons/missileguidance/XEH_post_init.sqf b/addons/missileguidance/XEH_post_init.sqf index 282aac5503..cc09b1f0ac 100644 --- a/addons/missileguidance/XEH_post_init.sqf +++ b/addons/missileguidance/XEH_post_init.sqf @@ -1,3 +1,13 @@ #include "script_component.hpp" [QGVAR(handoff), {_this call FUNC(handleHandoff)}] call CBA_fnc_addEventHandler; + +["ACE3 Weapons", QGVAR(cycleFireMode), localize LSTRING(CycleFireMode), +{ + [] call FUNC(cycleAttackProfileKeyDown); + false +}, +{ + false +}, +[15, [false, true, false]], false] call CBA_fnc_addKeybind; //Ctrl+Tab Key diff --git a/addons/missileguidance/XEH_pre_init.sqf b/addons/missileguidance/XEH_pre_init.sqf index a7feade1c3..b47cf6628d 100644 --- a/addons/missileguidance/XEH_pre_init.sqf +++ b/addons/missileguidance/XEH_pre_init.sqf @@ -2,6 +2,8 @@ ADDON = false; +PREP_RECOMPILE_START; #include "XEH_PREP.hpp" +PREP_RECOMPILE_END; ADDON = true; diff --git a/addons/missileguidance/config.cpp b/addons/missileguidance/config.cpp index c97a542a7f..ce75e277b4 100644 --- a/addons/missileguidance/config.cpp +++ b/addons/missileguidance/config.cpp @@ -20,4 +20,3 @@ class CfgPatches { #include "CfgAmmo.hpp" #include "CfgMagazines.hpp" #include "CfgWeapons.hpp" -#include "CfgVehicles.hpp" diff --git a/addons/missileguidance/functions/fnc_attackProfile_AIR.sqf b/addons/missileguidance/functions/fnc_attackProfile_AIR.sqf index 9909124e2f..3d2b5f36b8 100644 --- a/addons/missileguidance/functions/fnc_attackProfile_AIR.sqf +++ b/addons/missileguidance/functions/fnc_attackProfile_AIR.sqf @@ -1,4 +1,22 @@ -//#define DEBUG_MODE_FULL +/* + * Author: jaynus / nou + * Attack profile: AIR + * TODO: falls back to Linear + * + * Arguments: + * 0: Seeker Target PosASL + * 1: Guidance Arg Array + * 2: Seeker State + * + * Return Value: + * Missile Aim PosASL + * + * Example: + * [[1,2,3], [], []] call ace_missileguidance_fnc_attackProfile_AIR; + * + * Public: No + */ +// #define DEBUG_MODE_FULL #include "script_component.hpp" -_this call FUNC(attackProfile_LIN); \ No newline at end of file +_this call FUNC(attackProfile_LIN); diff --git a/addons/missileguidance/functions/fnc_attackProfile_DIR.sqf b/addons/missileguidance/functions/fnc_attackProfile_DIR.sqf index 9909124e2f..8e049a9fe2 100644 --- a/addons/missileguidance/functions/fnc_attackProfile_DIR.sqf +++ b/addons/missileguidance/functions/fnc_attackProfile_DIR.sqf @@ -1,4 +1,22 @@ -//#define DEBUG_MODE_FULL +/* + * Author: jaynus / nou + * Attack profile: DIR + * TODO: falls back to Linear + * + * Arguments: + * 0: Seeker Target PosASL + * 1: Guidance Arg Array + * 2: Seeker State + * + * Return Value: + * Missile Aim PosASL + * + * Example: + * [[1,2,3], [], []] call ace_missileguidance_fnc_attackProfile_DIR; + * + * Public: No + */ +// #define DEBUG_MODE_FULL #include "script_component.hpp" -_this call FUNC(attackProfile_LIN); \ No newline at end of file +_this call FUNC(attackProfile_LIN); diff --git a/addons/missileguidance/functions/fnc_attackProfile_HI.sqf b/addons/missileguidance/functions/fnc_attackProfile_HI.sqf index 9909124e2f..279196a888 100644 --- a/addons/missileguidance/functions/fnc_attackProfile_HI.sqf +++ b/addons/missileguidance/functions/fnc_attackProfile_HI.sqf @@ -1,4 +1,22 @@ -//#define DEBUG_MODE_FULL +/* + * Author: jaynus / nou + * Attack profile: HI + * TODO: falls back to Linear + * + * Arguments: + * 0: Seeker Target PosASL + * 1: Guidance Arg Array + * 2: Attack Profile State + * + * Return Value: + * Missile Aim PosASL + * + * Example: + * [[1,2,3], [], []] call ace_missileguidance_fnc_attackProfile_HI; + * + * Public: No + */ +// #define DEBUG_MODE_FULL #include "script_component.hpp" -_this call FUNC(attackProfile_LIN); \ No newline at end of file +_this call FUNC(attackProfile_LIN); diff --git a/addons/missileguidance/functions/fnc_attackProfile_JAV_DIR.sqf b/addons/missileguidance/functions/fnc_attackProfile_JAV_DIR.sqf index adcdc703de..e709aed112 100644 --- a/addons/missileguidance/functions/fnc_attackProfile_JAV_DIR.sqf +++ b/addons/missileguidance/functions/fnc_attackProfile_JAV_DIR.sqf @@ -1,4 +1,21 @@ -//#define DEBUG_MODE_FULL +/* + * Author: jaynus / nou + * Attack profile: Javelin Dir + * + * Arguments: + * 0: Seeker Target PosASL + * 1: Guidance Arg Array + * 2: Attack Profile State + * + * Return Value: + * Missile Aim PosASL + * + * Example: + * [[1,2,3], [], []] call ace_missileguidance_fnc_attackProfile_JAV_DIR; + * + * Public: No + */ +// #define DEBUG_MODE_FULL #include "script_component.hpp" #define STAGE_LAUNCH 1 @@ -6,48 +23,43 @@ #define STAGE_COAST 3 #define STAGE_TERMINAL 4 -EXPLODE_7_PVT(((_this select 1) select 0),_shooter,_weapon,_muzzle,_mode,_ammo,_magazine,_projectile); -private["_targetPos", "_projectilePos", "_target", "_seekerTargetPos", "_launchParams", "_targetLaunchParams"]; -private["_distanceToTarget", "_distanceToShooter", "_addHeight", "_returnTargetPos", "_state"]; -private["_cruisAlt", "_distanceShooterToTarget", "_shooterPos"]; -_seekerTargetPos = _this select 0; -_launchParams = _this select 1; +params ["_seekerTargetPos", "_args", "_attackProfileStateParams"]; +_args params ["_firedEH"]; +_firedEH params ["_shooter","","","","","","_projectile"]; -_target = _launchParams select 0; -_targetLaunchParams = _launchParams select 1; +if (_seekerTargetPos isEqualTo [0,0,0]) exitWith {_seekerTargetPos}; -_state = _this select 2; -if( (count _state) < 1) then { - _state set[0, STAGE_LAUNCH]; +if (_attackProfileStateParams isEqualTo []) then { + _attackProfileStateParams set [0, STAGE_LAUNCH]; }; -_shooterPos = getPosASL _shooter; -_projectilePos = getPosASL _projectile; +private _shooterPos = getPosASL _shooter; +private _projectilePos = getPosASL _projectile; -_distanceToTarget = _projectilePos vectorDistance _seekerTargetPos; -_distanceToShooter = _projectilePos vectorDistance _shooterPos; -_distanceShooterToTarget = _shooterPos vectorDistance _seekerTargetPos; +private _distanceToTarget = _projectilePos vectorDistance _seekerTargetPos; +private _distanceToShooter = _projectilePos vectorDistance _shooterPos; +private _distanceShooterToTarget = _shooterPos vectorDistance _seekerTargetPos; TRACE_2("", _distanceToTarget, _distanceToShooter); // Add height depending on distance for compensate -_returnTargetPos = _seekerTargetPos; +private _returnTargetPos = _seekerTargetPos; -switch( (_state select 0) ) do { +switch (_attackProfileStateParams select 0) do { case STAGE_LAUNCH: { TRACE_1("STAGE_LAUNCH",""); - if(_distanceToShooter < 10) then { + if (_distanceToShooter < 10) then { _returnTargetPos = _seekerTargetPos vectorAdd [0,0,_distanceToTarget*2]; } else { - _state set[0, STAGE_CLIMB]; + _attackProfileStateParams set [0, STAGE_CLIMB]; }; }; case STAGE_CLIMB: { TRACE_1("STAGE_CLIMB",""); - _cruisAlt = 60 * (_distanceShooterToTarget/2000); + private _cruisAlt = 60 * (_distanceShooterToTarget/2000); - if( ((ASLToAGL _projectilePos) select 2) - ((ASLToAGL _seekerTargetPos) select 2) >= _cruisAlt) then { - _state set[0, STAGE_TERMINAL]; + if ( ((ASLToAGL _projectilePos) select 2) - ((ASLToAGL _seekerTargetPos) select 2) >= _cruisAlt) then { + _attackProfileStateParams set [0, STAGE_TERMINAL]; } else { _returnTargetPos = _seekerTargetPos vectorAdd [0,0,_distanceToTarget*1.5]; }; @@ -58,9 +70,5 @@ switch( (_state select 0) ) do { }; }; -#ifdef DEBUG_MODE_FULL -drawLine3D [(ASLtoAGL _returnTargetPos), (ASLtoAGL _seekerTargetPos), [0,1,0,1]]; -#endif - TRACE_1("Adjusted target position", _returnTargetPos); _returnTargetPos; diff --git a/addons/missileguidance/functions/fnc_attackProfile_JAV_TOP.sqf b/addons/missileguidance/functions/fnc_attackProfile_JAV_TOP.sqf index b3361ede9f..34871cba8e 100644 --- a/addons/missileguidance/functions/fnc_attackProfile_JAV_TOP.sqf +++ b/addons/missileguidance/functions/fnc_attackProfile_JAV_TOP.sqf @@ -1,4 +1,21 @@ -//#define DEBUG_MODE_FULL +/* + * Author: jaynus / nou + * Attack profile: Javelin Top + * + * Arguments: + * 0: Seeker Target PosASL + * 1: Guidance Arg Array + * 2: Attack Profile State + * + * Return Value: + * Missile Aim PosASL + * + * Example: + * [[1,2,3], [], []] call ace_missileguidance_fnc_attackProfile_JAV_TOP; + * + * Public: No + */ +// #define DEBUG_MODE_FULL #include "script_component.hpp" #define STAGE_LAUNCH 1 @@ -6,55 +23,49 @@ #define STAGE_COAST 3 #define STAGE_TERMINAL 4 -EXPLODE_7_PVT(((_this select 1) select 0),_shooter,_weapon,_muzzle,_mode,_ammo,_magazine,_projectile); -private["_targetPos", "_projectilePos", "_target", "_seekerTargetPos", "_launchParams", "_targetLaunchParams"]; -private["_distanceToTarget", "_distanceToShooter", "_addHeight", "_returnTargetPos", "_state"]; -private["_cruisAlt", "_distanceShooterToTarget", "_shooterPos"]; +params ["_seekerTargetPos", "_args", "_attackProfileStateParams"]; +_args params ["_firedEH"]; +_firedEH params ["_shooter","","","","","","_projectile"]; -_seekerTargetPos = _this select 0; -_launchParams = _this select 1; +if (_seekerTargetPos isEqualTo [0,0,0]) exitWith {_seekerTargetPos}; -_target = _launchParams select 0; -_targetLaunchParams = _launchParams select 1; - -_state = _this select 2; -if( (count _state) < 1) then { - _state set[0, STAGE_LAUNCH]; +if (_attackProfileStateParams isEqualTo []) then { + _attackProfileStateParams set [0, STAGE_LAUNCH]; }; -_shooterPos = getPosASL _shooter; -_projectilePos = getPosASL _projectile; +private _shooterPos = getPosASL _shooter; +private _projectilePos = getPosASL _projectile; -_distanceToTarget = _projectilePos vectorDistance _seekerTargetPos; -_distanceToShooter = _projectilePos vectorDistance _shooterPos; -_distanceShooterToTarget = _shooterPos vectorDistance _seekerTargetPos; +private _distanceToTarget = _projectilePos vectorDistance _seekerTargetPos; +private _distanceToShooter = _projectilePos vectorDistance _shooterPos; +private _distanceShooterToTarget = _shooterPos vectorDistance _seekerTargetPos; TRACE_2("", _distanceToTarget, _distanceToShooter); // Add height depending on distance for compensate -_returnTargetPos = _seekerTargetPos; +private _returnTargetPos = _seekerTargetPos; -switch( (_state select 0) ) do { +switch( (_attackProfileStateParams select 0) ) do { case STAGE_LAUNCH: { TRACE_1("STAGE_LAUNCH",""); - if(_distanceToShooter < 10) then { + if (_distanceToShooter < 10) then { _returnTargetPos = _seekerTargetPos vectorAdd [0,0,_distanceToTarget*2]; } else { - _state set[0, STAGE_CLIMB]; + _attackProfileStateParams set [0, STAGE_CLIMB]; }; }; case STAGE_CLIMB: { TRACE_1("STAGE_CLIMB",""); - _cruisAlt = 140; - if(_distanceShooterToTarget < 1250) then { + private _cruisAlt = 140; + if (_distanceShooterToTarget < 1250) then { _cruisAlt = 140 * (_distanceShooterToTarget/1250); TRACE_1("_cruisAlt", _cruisAlt); }; - if( ((ASLToAGL _projectilePos) select 2) - ((ASLToAGL _seekerTargetPos) select 2) >= _cruisAlt) then { - if(_cruisAlt < 140) then { - _state set[0, STAGE_TERMINAL]; + if ( ((ASLToAGL _projectilePos) select 2) - ((ASLToAGL _seekerTargetPos) select 2) >= _cruisAlt) then { + if (_cruisAlt < 140) then { + _attackProfileStateParams set [0, STAGE_TERMINAL]; } else { - _state set[0, STAGE_COAST]; + _attackProfileStateParams set [0, STAGE_COAST]; }; } else { _returnTargetPos = _seekerTargetPos vectorAdd [0,0,_distanceToTarget*1.5]; @@ -63,8 +74,8 @@ switch( (_state select 0) ) do { case STAGE_COAST: { TRACE_1("STAGE_COAST",""); TRACE_1("", ((ASLToAGL _projectilePos) select 2) - (( ASLToAGL _seekerTargetPos) select 2) ); - if(_distanceToTarget < ( ((ASLToAGL _projectilePos) select 2) - (( ASLToAGL _seekerTargetPos) select 2) ) * 1.5) then { - _state set[0, STAGE_TERMINAL]; + if (_distanceToTarget < ( ((ASLToAGL _projectilePos) select 2) - (( ASLToAGL _seekerTargetPos) select 2) ) * 2) then { + _attackProfileStateParams set [0, STAGE_TERMINAL]; } else { _returnTargetPos = _seekerTargetPos vectorAdd [0,0,(_projectilePos select 2)]; }; @@ -76,9 +87,5 @@ switch( (_state select 0) ) do { }; }; -#ifdef DEBUG_MODE_FULL -drawLine3D [(ASLtoAGL _returnTargetPos), (ASLtoAGL _seekerTargetPos), [0,1,0,1]]; -#endif - TRACE_1("Adjusted target position", _returnTargetPos); _returnTargetPos; diff --git a/addons/missileguidance/functions/fnc_attackProfile_LIN.sqf b/addons/missileguidance/functions/fnc_attackProfile_LIN.sqf index b399f9553d..de8061a27c 100644 --- a/addons/missileguidance/functions/fnc_attackProfile_LIN.sqf +++ b/addons/missileguidance/functions/fnc_attackProfile_LIN.sqf @@ -1,50 +1,65 @@ -//#define DEBUG_MODE_FULL +/* + * Author: jaynus / nou + * Attack profile: Linear (used by DAGR) + * + * Arguments: + * 0: Seeker Target PosASL + * 1: Guidance Arg Array + * 2: Attack Profile State + * + * Return Value: + * Missile Aim PosASL + * + * Example: + * [[1,2,3], [], []] call ace_missileguidance_fnc_attackProfile_LIN; + * + * Public: No + */ +// #define DEBUG_MODE_FULL #include "script_component.hpp" -EXPLODE_7_PVT(((_this select 1) select 0),_shooter,_weapon,_muzzle,_mode,_ammo,_magazine,_projectile); -private["_targetPos", "_projectilePos", "_target", "_seekerTargetPos", "_launchParams", "_targetLaunchParams"]; -private["_distanceToTarget", "_distanceToShooter", "_addHeight", "_returnTargetPos", "_shooterPos"]; -_seekerTargetPos = _this select 0; -_launchParams = _this select 1; +params ["_seekerTargetPos", "_args"]; +_args params ["_firedEH"]; +_firedEH params ["_shooter","","","","","","_projectile"]; -_target = _launchParams select 0; -_targetLaunchParams = _launchParams select 1; +if (_seekerTargetPos isEqualTo [0,0,0]) exitWith {_seekerTargetPos}; -_shooterPos = getPosASL _shooter; -_projectilePos = getPosASL _projectile; +private _shooterPos = getPosASL _shooter; +private _projectilePos = getPosASL _projectile; -_distanceToTarget = _projectilePos vectorDistance _seekerTargetPos; -_distanceToShooter = _projectilePos vectorDistance _shooterPos; +private _distanceToTarget = _projectilePos vectorDistance _seekerTargetPos; +private _distanceToShooter = _projectilePos vectorDistance _shooterPos; +private _distanceShooterToTarget = _shooterPos vectorDistance _seekerTargetPos; -TRACE_3("", _distanceToTarget, _distanceToShooter, _seekerTargetPos); +TRACE_2("", _distanceToTarget, _distanceToShooter); // Add height depending on distance for compensate -_addHeight = [0,0,0]; +private _addHeight = [0,0,0]; // Always climb an arc on initial launch if we are close to the round -if( ((ASLtoAGL _projectilePos) select 2) < 5 && _distanceToShooter < 15) then { - _addHeight = _addHeight vectorAdd [0,0,_distanceToTarget]; +if ((((ASLtoAGL _projectilePos) select 2) < 5) && {_distanceToShooter < 15}) then { + _addHeight = _addHeight vectorAdd [0,0,_distanceToTarget]; + TRACE_1("climb - near shooter",_addHeight); } else { // If we are below the target, increase the climbing arc - if((_projectilePos select 2) < (_seekerTargetPos select 2) && _distanceToTarget > 100) then { + if (((_projectilePos select 2) < (_seekerTargetPos select 2)) && {_distanceToTarget > 100}) then { _addHeight = _addHeight vectorAdd [0,0, ((_seekerTargetPos select 2) - (_projectilePos select 2))]; + TRACE_1("climb - below target and far",_addHeight); }; }; -// Handle arcing terminal low for high decent -if( (_projectilePos select 2) > (_seekerTargetPos select 2) && _distanceToTarget < 100) then { - _addHeight = _addHeight vectorDiff [0,0, ((_projectilePos select 2) - (_seekerTargetPos select 2)) * 0.5]; -} else { - if((_projectilePos select 2) > (_seekerTargetPos select 2) && _distanceToTarget > 100) then { +// Handle arcing terminal low for high decent (when projectile above target) +if ((_projectilePos select 2) > (_seekerTargetPos select 2)) then { + if (_distanceToTarget < 100) then { + _addHeight = _addHeight vectorDiff [0,0, ((_projectilePos select 2) - (_seekerTargetPos select 2)) * 0.5]; + TRACE_1("above - close",_addHeight); + } else { + TRACE_1("above - far",_addHeight); _addHeight = _addHeight vectorAdd [0,0, _distanceToTarget*0.02]; }; }; -_returnTargetPos = _seekerTargetPos vectorAdd _addHeight; +private _returnTargetPos = _seekerTargetPos vectorAdd _addHeight; -#ifdef DEBUG_MODE_FULL -drawLine3D [(ASLtoAGL _returnTargetPos) vectorAdd _addHeight, ASLtoAGL _returnTargetPos, [0,1,0,1]]; -#endif - -TRACE_1("Adjusted target position", _returnTargetPos); +TRACE_2("Adjusted target position",_returnTargetPos,_addHeight); _returnTargetPos; diff --git a/addons/missileguidance/functions/fnc_attackProfile_MID.sqf b/addons/missileguidance/functions/fnc_attackProfile_MID.sqf index 9909124e2f..0349a101e4 100644 --- a/addons/missileguidance/functions/fnc_attackProfile_MID.sqf +++ b/addons/missileguidance/functions/fnc_attackProfile_MID.sqf @@ -1,4 +1,22 @@ -//#define DEBUG_MODE_FULL +/* + * Author: jaynus / nou + * Attack profile: MID + * TODO: falls back to Linear + * + * Arguments: + * 0: Seeker Target PosASL + * 1: Guidance Arg Array + * 2: Attack Profile State + * + * Return Value: + * Missile Aim PosASL + * + * Example: + * [[1,2,3], [], []] call ace_missileguidance_fnc_attackProfile_MID; + * + * Public: No + */ +// #define DEBUG_MODE_FULL #include "script_component.hpp" -_this call FUNC(attackProfile_LIN); \ No newline at end of file +_this call FUNC(attackProfile_LIN); diff --git a/addons/missileguidance/functions/fnc_changeMissileDirection.sqf b/addons/missileguidance/functions/fnc_changeMissileDirection.sqf index f5fdee95a0..28fb46fe28 100644 --- a/addons/missileguidance/functions/fnc_changeMissileDirection.sqf +++ b/addons/missileguidance/functions/fnc_changeMissileDirection.sqf @@ -1,11 +1,26 @@ +/* + * Author: jaynus / nou + * Change a projectile's direction, maintaing speed + * + * Arguments: + * 0: Projectile + * 1: Direction (unit vector) + * + * Return Value: + * None + * + * Example: + * [missile, [0,1,0]] call ace_missileguidance_fnc_changeMissileDirection; + * + * Public: No + */ +// #define DEBUG_MODE_FULL #include "script_component.hpp" -private ["_projectile", "_v", "_l", "_r"]; -_projectile = _this select 0; -_v = _this select 1; +params ["_projectile", "_v"]; -_l = sqrt ((_v select 0) ^ 2 + (_v select 1) ^ 2); -_r = -(_v select 2) / _l; +private _l = sqrt ((_v select 0) ^ 2 + (_v select 1) ^ 2); +private _r = -(_v select 2) / _l; _projectile setVectorDirAndUp [ _v, [(_v select 0) * _r,(_v select 1) * _r, _l] ]; -_projectile setVelocity (_v vectorMultiply (vectorMagnitude (velocity _projectile))); \ No newline at end of file +_projectile setVelocity (_v vectorMultiply (vectorMagnitude (velocity _projectile))); diff --git a/addons/missileguidance/functions/fnc_checkLos.sqf b/addons/missileguidance/functions/fnc_checkLos.sqf index d41554dc65..1e1d3c7d3e 100644 --- a/addons/missileguidance/functions/fnc_checkLos.sqf +++ b/addons/missileguidance/functions/fnc_checkLos.sqf @@ -3,17 +3,25 @@ * Returns whether the seeker object can see the target position with lineIntersect * * Arguments: - * 0: Seeker [Object] - * 1: Target [Object] + * 0: Seeker + * 1: Target * * Return Value: - * Boolean + * Has LOS + * + * Example: + * [player, cursorTarget] call ace_missileguidance_fnc_checkLOS; + * + * Public: No */ #include "script_component.hpp" params ["_seeker", "_target"]; -if ((isNil "_seeker") || {isNil "_target"}) exitWith {false}; +if ((isNil "_seeker") || {isNil "_target"}) exitWith { + ERROR_2("nil",_seeker,_target); + false +}; private _targetPos = getPosASL _target; private _targetAimPos = aimPos _target; @@ -21,11 +29,11 @@ private _seekerPos = getPosASL _seeker; private _return = true; if (!((terrainIntersectASL [_seekerPos, _targetPos]) && {terrainIntersectASL [_seekerPos, _targetAimPos]})) then { - if(lineIntersects [_seekerPos, _targetPos, _seeker, _target]) then { + if (lineIntersects [_seekerPos, _targetPos, _seeker, _target]) then { _return = false; }; } else { _return = false; }; -_return; \ No newline at end of file +_return; diff --git a/addons/missileguidance/functions/fnc_checkSeekerAngle.sqf b/addons/missileguidance/functions/fnc_checkSeekerAngle.sqf index 9415f347b6..8ddc848594 100644 --- a/addons/missileguidance/functions/fnc_checkSeekerAngle.sqf +++ b/addons/missileguidance/functions/fnc_checkSeekerAngle.sqf @@ -1,31 +1,35 @@ /* * Author: jaynus - * Returns whether the target position is within the maximum angle FOV of the provided seeker + * Returns whether the target position is within the maximum angle FOV of the provided seeker * objects current direction. * * Arguments: - * 0: Seeker [Object] - * 1: Target [Position] - * 2: Max Angle [Degrees] - * + * 0: Seeker + * 1: Target PosASL + * 2: Max Angle (degrees) + * * Return Value: - * Boolean + * Can See + * + * Example: + * [player, cursorTarget, 45] call ace_missileguidance_fnc_checkSeekerAngle; + * + * Public: No */ - +// #define DEBUG_MODE_FULL #include "script_component.hpp" -private ["_seeker", "_targetPos", "_seekerMaxAngle", "_sensorPos", "_testPointVector", "_testDotProduct"]; -_seeker = _this select 0; -_targetPos = _this select 1; -_seekerMaxAngle = _this select 2; +params ["_seeker", "_targetPos", "_seekerMaxAngle"]; -_sensorPos = getPosASL _seeker; +private _sensorPos = getPosASL _seeker; -_testPointVector = vectorNormalized (_targetPos vectorDiff _sensorPos); -_testDotProduct = (vectorNormalized (velocity _seeker)) vectorDotProduct _testPointVector; +private _testPointVector = vectorNormalized (_targetPos vectorDiff _sensorPos); +private _testDotProduct = (vectorNormalized (velocity _seeker)) vectorDotProduct _testPointVector; -if(_testDotProduct < (cos _seekerMaxAngle)) exitWith { - false +TRACE_2("fov",acos _testDotProduct,_seekerMaxAngle); + +if (_testDotProduct < (cos _seekerMaxAngle)) exitWith { + false }; -true \ No newline at end of file +true diff --git a/addons/missileguidance/functions/fnc_cycleAttackProfileKeyDown.sqf b/addons/missileguidance/functions/fnc_cycleAttackProfileKeyDown.sqf new file mode 100644 index 0000000000..97531eb1e5 --- /dev/null +++ b/addons/missileguidance/functions/fnc_cycleAttackProfileKeyDown.sqf @@ -0,0 +1,77 @@ +/* + * Author: PabstMirror + * Cycles fire mode for any missileGuidance enabled ammo that has multiple attack profiles + * + * Arguments: + * None + * + * Return Value: + * None + * + * Example: + * [] call ace_missileguidance_fnc_cycleAttackProfileKeyDown + * + * Public: No + */ + +// #define DEBUG_MODE_FULL +#include "script_component.hpp" + +TRACE_1("cycle fire mode",_this); + +if (!alive ACE_player) exitWith {}; +if (!([ACE_player, objNull, ["isNotInside"]] call EFUNC(common,canInteractWith))) exitWith {}; + + +private _currentShooter = objNull; +private _currentMagazine = ""; +if (isNull (ACE_controlledUAV param [0, objNull])) then { + if (((vehicle ACE_player) == ACE_player) || {ACE_player call CBA_fnc_canUseWeapon}) then { + _currentShooter = ACE_player; + _currentMagazine = currentMagazine ACE_player; + } else { + _currentShooter = vehicle ACE_player; + private _turretPath = if (ACE_player == (driver _currentShooter)) then {[-1]} else {ACE_player call CBA_fnc_turretPath}; + _currentMagazine = _currentShooter currentMagazineTurret _turretPath; + }; +} else { + _currentShooter = ACE_controlledUAV select 0; + private _turretPath = ACE_controlledUAV select 2; + _currentMagazine = _currentShooter currentMagazineTurret _turretPath; +}; + +if (_currentMagazine == "") exitWith {TRACE_1("no magazine",_currentMagazine)}; + +private _ammo = getText (configFile >> "CfgMagazines" >> _currentMagazine >> "ammo"); + +TRACE_3("",_currentShooter,_currentMagazine,_ammo); + +// Bail if guidance is disabled for this ammo +if ((getNumber (configFile >> "CfgAmmo" >> _ammo >> QUOTE(ADDON) >> "enabled")) != 1) exitWith {TRACE_1("not enabled",_ammo)}; + +// Verify ammo has explicity added guidance config (ignore inheritances) +private _configs = configProperties [(configFile >> "CfgAmmo" >> _ammo), QUOTE(configName _x == QUOTE(QUOTE(ADDON))), false]; +if ((count _configs) < 1) exitWith {TRACE_2("not explicity enabled",_ammo,_configs)}; + +private _attackProfiles = getArray (configFile >> "CfgAmmo" >> _ammo >> QUOTE(ADDON) >> "attackProfiles"); +if ((count _attackProfiles) <= 1) exitWith {TRACE_1("no choices for attack profile",_attackProfiles)}; + +private _currentFireMode = _currentShooter getVariable [QGVAR(attackProfile), "#undefined"]; + +// Just like onFired, this is case sensitive! +private _index = _attackProfiles find _currentFireMode; +if (_index == -1) then { + _index = _attackProfiles find (getText (configFile >> "CfgAmmo" >> _ammo >> QUOTE(ADDON) >> "defaultAttackProfile")); +}; +_index = (_index + 1) % (count _attackProfiles); +private _nextFireMode = _attackProfiles select _index; +TRACE_4("",_currentFireMode,_nextFireMode,_index,_attackProfiles); + +_currentShooter setVariable [QGVAR(attackProfile), _nextFireMode, false]; + +playSound "ACE_Sound_Click"; + +if ((getNumber (configFile >> "CfgAmmo" >> _ammo >> QUOTE(ADDON) >> "showHintOnCycle")) == 1) then { + private _localizedName = getText (configFile >> QGVAR(AttackProfiles) >> _nextFireMode >> "name"); + [_localizedName] call EFUNC(common,displayTextStructured); +}; diff --git a/addons/missileguidance/functions/fnc_doAttackProfile.sqf b/addons/missileguidance/functions/fnc_doAttackProfile.sqf index 1c589838f5..0d8de543ee 100644 --- a/addons/missileguidance/functions/fnc_doAttackProfile.sqf +++ b/addons/missileguidance/functions/fnc_doAttackProfile.sqf @@ -1,29 +1,40 @@ -//#define DEBUG_MODE_FULL +/* + * Author: jaynus / nou, PabstMirror + * Do attack profile with a valid seeker target location + * + * Arguments: + * 0: Seeker Target PosASL + * 1: Guidance Arg Array + * 2: Seeker State + * + * Return Value: + * Missile Aim PosASL + * + * Example: + * [[1,2,3], [], []] call ace_missileguidance_fnc_doAttackProfile; + * + * Public: No + */ +// #define DEBUG_MODE_FULL #include "script_component.hpp" -EXPLODE_7_PVT(((_this select 1) select 0),_shooter,_weapon,_muzzle,_mode,_ammo,_magazine,_projectile); -private ["_testName", "_attackProfilePos", "_attackProfile", "_attackProfileName", "_attackProfilesCfg", "_i", "_launchParams", "_testame", "_testProfile"]; -_launchParams = ((_this select 1) select 1); -_attackProfileName = _launchParams select 3; +params ["_seekerTargetPos", "_args"]; +_args params ["", "_launchParams"]; +_launchParams params ["", "", "", "_attackProfileName"]; -TRACE_1("Attacking profile", _attackProfileName); +private _attackProfileFunction = getText (configFile >> QGVAR(AttackProfiles) >> _attackProfileName >> "functionName"); -_attackProfilesCfg = ( configFile >> QGVAR(AttackProfiles) ); +private _attackProfilePos = _this call (missionNamespace getVariable _attackProfileFunction); -_attackProfile = nil; -for [{_i=0}, {_i< (count _attackProfilesCfg) }, {_i=_i+1}] do { - _testProfile = _attackProfilesCfg select _i; - _testName = configName _testProfile; - TRACE_3("", _testName, _testProfile, _attackProfilesCfg); - - if( _testName == _attackProfileName) exitWith { - _attackProfile = _attackProfilesCfg select _i; - }; +if ((isNil "_attackProfilePos") || {_attackProfilePos isEqualTo [0,0,0]}) exitWith { + ERROR_1("attack profile returned bad pos",_attackProfilePos); + [0,0,0] }; -_attackProfilePos = [0,0,0]; -if(!isNil "_attackProfile") then { - _attackProfilePos = _this call (missionNamespace getVariable (getText (_attackProfile >> "functionName"))); -}; +#ifdef DRAW_GUIDANCE_INFO +drawLine3D [(ASLtoAGL _attackProfilePos), (ASLtoAGL _seekerTargetPos), [0,1,1,1]]; +drawIcon3D ["\a3\ui_f\data\IGUI\Cfg\Cursors\selectover_ca.paa", [0,0,1,1], ASLtoAGL _attackProfilePos, 0.5, 0.5, 0, _attackProfileName, 1, 0.025, "TahomaB"]; +#endif +TRACE_2("return",_attackProfilePos,_attackProfileName); _attackProfilePos; diff --git a/addons/missileguidance/functions/fnc_doHandoff.sqf b/addons/missileguidance/functions/fnc_doHandoff.sqf index 011c3d52d1..56abc8fbf0 100644 --- a/addons/missileguidance/functions/fnc_doHandoff.sqf +++ b/addons/missileguidance/functions/fnc_doHandoff.sqf @@ -1,4 +1,21 @@ -#include "script_component.hpp" -PARAMS_2(_target,_args); +/* + * Author: ACE + * Not currently used + * + * Arguments: + * 0: Target + * 1: Args + * + * Return Value: + * None + * + * Example: + * [target, [args]] call ace_missileguidance_fnc_doHandoff + * + * Public: No + */ -[QGVAR(handoff), [_target, _args]] call CBA_fnc_globalEvent; \ No newline at end of file +#include "script_component.hpp" +params ["_target", "_args"]; + +[QGVAR(handoff), [_target, _args]] call CBA_fnc_globalEvent; diff --git a/addons/missileguidance/functions/fnc_doSeekerSearch.sqf b/addons/missileguidance/functions/fnc_doSeekerSearch.sqf index 4eaefb6656..8dd70f0163 100644 --- a/addons/missileguidance/functions/fnc_doSeekerSearch.sqf +++ b/addons/missileguidance/functions/fnc_doSeekerSearch.sqf @@ -1,30 +1,53 @@ -//#define DEBUG_MODE_FULL +/* + * Author: jaynus / nou, PabstMirror + * Do seeker search + * Handles a nil/bad return and will attempt to use last known position if enabled on ammo + * + * Arguments: + * 1: Guidance Arg Array + * 3: Last known pos state array + * + * Return Value: + * Missile Aim PosASL + * + * Example: + * [[], [], []] call ace_missileguidance_fnc_seekerType_Optic; + * + * Public: No + */ +// #define DEBUG_MODE_FULL #include "script_component.hpp" -EXPLODE_7_PVT(((_this select 1) select 0),_shooter,_weapon,_muzzle,_mode,_ammo,_magazine,_projectile); -private ["_seekerProfilePos", "_i", "_launchParams", "_seekerType", "_seekerTypeName", "_seekerTypesCfg", "_testName", "_testProfile"]; +params ["", "_args", "", "_lastKnownPosState"]; +_args params ["", "_launchParams"]; +_launchParams params ["", "", "_seekerTypeName"]; +_lastKnownPosState params ["_seekLastTargetPos", "_lastKnownPos"]; -_launchParams = ((_this select 1) select 1); -_seekerTypeName = _launchParams select 2; +private _seekerFunction = getText (configFile >> QGVAR(SeekerTypes) >> _seekerTypeName >> "functionName"); -TRACE_1("Seeker type", _seekerTypeName); +private _seekerTargetPos = _this call (missionNamespace getVariable _seekerFunction); -_seekerTypesCfg = ( configFile >> QGVAR(SeekerTypes) ); - -_seekerType = nil; -for [{_i = 0}, {_i< (count _seekerTypesCfg) }, {_i=_i + 1}] do { - _testProfile = _seekerTypesCfg select _i; - _testName = configName _testProfile; - TRACE_3("", _testName, _testProfile, _seekerTypesCfg); - - if( _testName == _seekerTypeName) exitWith { - _seekerType = _seekerTypesCfg select _i; +if ((isNil "_seekerTargetPos") || {_seekerTargetPos isEqualTo [0,0,0]}) then { // A return of nil or [0,0,0] indicates the seeker has no target + if (_seekLastTargetPos && {!(_lastKnownPos isEqualTo [0,0,0])}) then { // if enabled for the ammo, use last known position if we have one stored + TRACE_2("seeker returned bad pos - using last known",_seekLastTargetPos,_lastKnownPos); + _seekerTargetPos = _lastKnownPos; + #ifdef DRAW_GUIDANCE_INFO + drawIcon3D ["\A3\ui_f\data\map\markers\military\unknown_CA.paa", [1,1,0,1], ASLtoAGL _lastKnownPos, 0.25, 0.25, 0, "LastKnownPos", 1, 0.02, "TahomaB"]; + #endif + } else { + TRACE_1("seeker returned no pos",_seekerTargetPos); + _seekerTargetPos = [0,0,0]; + }; +} else { + if (_seekLastTargetPos) then { // if enabled for the ammo, store last known position + TRACE_1("saving current pos",_seekLastTargetPos); + _lastKnownPosState set [1, _seekerTargetPos]; }; }; -_seekerProfilePos = [0, 0, 0]; -if(!isNil "_seekerType") then { - _seekerProfilePos = _this call (missionNamespace getVariable (getText (_seekerType >> "functionName"))); -}; +#ifdef DRAW_GUIDANCE_INFO +drawIcon3D ["\a3\ui_f\data\IGUI\Cfg\Cursors\selectover_ca.paa", [0,1,0,1], ASLtoAGL _seekerTargetPos, 0.5, 0.5, 0, _seekerTypeName, 1, 0.025, "TahomaB"]; +#endif -_seekerProfilePos; +TRACE_2("return",_seekerTargetPos,_seekerTypeName); +_seekerTargetPos; diff --git a/addons/missileguidance/functions/fnc_guidancePFH.sqf b/addons/missileguidance/functions/fnc_guidancePFH.sqf index e7fa5a4fd1..5ecb9c6dfe 100644 --- a/addons/missileguidance/functions/fnc_guidancePFH.sqf +++ b/addons/missileguidance/functions/fnc_guidancePFH.sqf @@ -1,33 +1,41 @@ -//#define DEBUG_MODE_FULL +/* + * Author: jaynus / nou + * Guidance Per Frame Handler + * + * Arguments: + * 0: Guidance Arg Array + * 1: PFID + * + * Return Value: + * None + * + * Example: + * [[], 0] call ace_missileguidance_fnc_guidancePFH; + * + * Public: No + */ +// #define DEBUG_MODE_FULL #include "script_component.hpp" +BEGIN_COUNTER(guidancePFH); + #define TIMESTEP_FACTOR 0.01 -private ["_launchParams", "_targetLaunchParams", "_flightParams", "_seekerParams", "_stateParams"]; -private ["_lastRunTime", "_runtimeDelta", "_adjustTime", "_args", "_seekerTargetPos", "_projectilePos"]; -private ["_profileAdjustedTargetPos", "_incDeflection", "_minDeflection", "_maxDeflection"]; -private ["_targetVector", "_adjustVector", "_finalAdjustVector", "_changeVector", "_pitch", "_yaw", "_roll"]; -private ["_PS", "_distanceToTarget", "_targetRelativeVector", "_vectorTo"]; +params ["_args", "_pfID"]; +_args params ["_firedEH", "_launchParams", "_flightParams", "_seekerParams", "_stateParams"]; +_firedEH params ["_shooter","","","","_ammo","","_projectile"]; +_launchParams params ["","_targetLaunchParams"]; +_stateParams params ["_lastRunTime", "_seekerStateParams", "_attackProfileStateParams", "_lastKnownPosState"]; -_args = _this select 0; -EXPLODE_7_PVT((_args select 0),_shooter,_weapon,_muzzle,_mode,_ammo,_magazine,_projectile); - -if(!alive _projectile || isNull _projectile || isNull _shooter) exitWith { - [(_this select 1)] call CBA_fnc_removePerFrameHandler; +if (!alive _projectile || isNull _projectile || isNull _shooter) exitWith { + [_pfID] call CBA_fnc_removePerFrameHandler; + END_COUNTER(guidancePFH); }; -_launchParams = _args select 1; -_targetLaunchParams = _launchParams select 1; -_flightParams = _args select 2; -_seekerParams = _args select 3; +private _runtimeDelta = diag_tickTime - _lastRunTime; +private _adjustTime = 1; -_stateParams = _args select 4; - -_lastRunTime = _stateParams select 0; -_runtimeDelta = diag_tickTime - _lastRunTime; -_adjustTime = 1; - -if(accTime > 0) then { +if (accTime > 0) then { _adjustTime = 1/accTime; _adjustTime = _adjustTime * (_runtimeDelta / TIMESTEP_FACTOR); TRACE_4("Adjust timing", 1/accTime, _adjustTime, _runtimeDelta, (_runtimeDelta / TIMESTEP_FACTOR) ); @@ -35,72 +43,72 @@ if(accTime > 0) then { _adjustTime = 0; }; -_minDeflection = ((_flightParams select 0) - ((_flightParams select 0) * _adjustTime)) max 0; -_maxDeflection = (_flightParams select 1) * _adjustTime; -_incDeflection = _flightParams select 2; +private _minDeflection = ((_flightParams select 0) - ((_flightParams select 0) * _adjustTime)) max 0; +private _maxDeflection = (_flightParams select 1) * _adjustTime; +// private _incDeflection = _flightParams select 2; // todo -_projectilePos = getPosASL _projectile; +private _projectilePos = getPosASL _projectile; -// @TODO: placeholder for "last seek target position" -// Last target pos should be optional based on the seeker unit -_seekerTargetPos = [ [0,0,0], _args, (_stateParams select 1)] call FUNC(doSeekerSearch); -if(isNil "_seekerTargetPos") then { - _seekerTargetPos = _seekerTargetPos vectorAdd ((velocity _projectile) vectorMultiply 5); -} else { - if( (vectorMagnitude _seekerTargetPos) == 0) then { - _seekerTargetPos = _seekerTargetPos vectorAdd ((velocity _projectile) vectorMultiply 5); +// Run seeker function: +private _seekerTargetPos = [[0,0,0], _args, _seekerStateParams, _lastKnownPosState] call FUNC(doSeekerSearch); + +// Run attack profile function: +private _profileAdjustedTargetPos = [_seekerTargetPos, _args, _attackProfileStateParams] call FUNC(doAttackProfile); + +// If we have no seeker target, then do not change anything +if (!(_profileAdjustedTargetPos isEqualTo [0,0,0])) then { + + private _targetVector = _projectilePos vectorFromTo _profileAdjustedTargetPos; + private _adjustVector = _targetVector vectorDiff (vectorDir _projectile); + _adjustVector params ["_adjustVectorX", "_adjustVectorY", "_adjustVectorZ"]; + + private _yaw = 0; + private _pitch = 0; + private _roll = 0; + + if (_adjustVectorX < 0) then { + _yaw = - ( (_minDeflection max ((abs _adjustVectorX) min _maxDeflection) ) ); + } else { + if (_adjustVectorX > 0) then { + _yaw = ( (_minDeflection max (_adjustVectorX min _maxDeflection) ) ); + }; + }; + if (_adjustVectorY < 0) then { + _roll = - ( (_minDeflection max ((abs _adjustVectorY) min _maxDeflection) ) ); + } else { + if (_adjustVectorY > 0) then { + _roll = ( (_minDeflection max (_adjustVectorY min _maxDeflection) ) ); + }; + }; + if (_adjustVectorZ < 0) then { + _pitch = - ( (_minDeflection max ((abs _adjustVectorZ) min _maxDeflection) ) ); + } else { + if (_adjustVectorZ > 0) then { + _pitch = ( (_minDeflection max (_adjustVectorZ min _maxDeflection) ) ); + }; + }; + private _finalAdjustVector = [_yaw, _roll, _pitch]; + + TRACE_3("", _pitch, _yaw, _roll); + TRACE_3("", _targetVector, _adjustVector, _finalAdjustVector); + + if (accTime > 0) then { + private _changeVector = (vectorDir _projectile) vectorAdd _finalAdjustVector; + TRACE_2("",_projectile,_changeVector); + [_projectile, _changeVector] call FUNC(changeMissileDirection); }; }; -_profileAdjustedTargetPos = [_seekerTargetPos,_args, (_stateParams select 2)] call FUNC(doAttackProfile); -_targetVector = _projectilePos vectorFromTo _profileAdjustedTargetPos; -_adjustVector = _targetVector vectorDiff (vectorDir _projectile); +#ifdef DRAW_GUIDANCE_INFO +TRACE_3("",_projectilePos,_seekerTargetPos,_profileAdjustedTargetPos); +drawIcon3D ["\a3\ui_f\data\IGUI\Cfg\Cursors\selectover_ca.paa", [1,0,0,1], ASLtoAGL _projectilePos, 0.75, 0.75, 0, _ammo, 1, 0.025, "TahomaB"]; -_yaw = 0; -_pitch = 0; -_roll = 0; -if((_adjustVector select 0) < 0) then { - _yaw = - ( (_minDeflection max (abs(_adjustVector select 0) min _maxDeflection) ) ); -} else { - if((_adjustVector select 0) > 0) then { - _yaw = ( (_minDeflection max ((_adjustVector select 0) min _maxDeflection) ) ); - }; -}; -if((_adjustVector select 1) < 0) then { - _roll = - ( (_minDeflection max (abs(_adjustVector select 1) min _maxDeflection) ) ); -} else { - if((_adjustVector select 1) > 0) then { - _roll = ( (_minDeflection max ((_adjustVector select 1) min _maxDeflection) ) ); - }; -}; -if((_adjustVector select 2) < 0) then { - _pitch = - ( (_minDeflection max (abs(_adjustVector select 2) min _maxDeflection) ) ); -} else { - if((_adjustVector select 2) > 0) then { - _pitch = ( (_minDeflection max ((_adjustVector select 2) min _maxDeflection) ) ); - }; -}; -_finalAdjustVector = [_yaw, _roll, _pitch]; -TRACE_2("", _pitch, _yaw); -TRACE_4("", _targetVector, _targetRelativeVector, _adjustVector, _finalAdjustVector); - -if(accTime > 0) then { - _changeVector = (vectorDir _projectile) vectorAdd _finalAdjustVector; - [_projectile, _changeVector] call FUNC(changeMissileDirection); -}; - -#ifdef DEBUG_MODE_FULL -drawIcon3D ["\a3\ui_f\data\IGUI\Cfg\Cursors\selectover_ca.paa", [1,1,1,1], ASLtoAGL _projectilePos, 0.75, 0.75, 0, str _vectorTo, 1, 0.025, "TahomaB"]; -drawLine3D [ASLtoAGL _projectilePos, ASLtoAGL _profileAdjustedTargetPos, [1,0,0,1]]; - -_ps = "#particlesource" createVehicleLocal (ASLtoAGL _projectilePos); +private _ps = "#particlesource" createVehicleLocal (ASLtoAGL _projectilePos); _PS setParticleParams [["\A3\Data_f\cl_basic", 8, 3, 1], "", "Billboard", 1, 3.0141, [0, 0, 2], [0, 0, 0], 1, 1.275, 1, 0, [1, 1], [[1, 0, 0, 1], [1, 0, 0, 1], [1, 0, 0, 1]], [1], 1, 0, "", "", nil]; _PS setDropInterval 3.0; - -//hintSilent format["d: %1", _distanceToTarget]; #endif -_stateParams set[0, diag_tickTime]; +_stateParams set [0, diag_tickTime]; + +END_COUNTER(guidancePFH); -_args set[4, _stateParams]; -_this set[0, _args]; diff --git a/addons/missileguidance/functions/fnc_handleHandoff.sqf b/addons/missileguidance/functions/fnc_handleHandoff.sqf index af23ed84d8..e2122a56a4 100644 --- a/addons/missileguidance/functions/fnc_handleHandoff.sqf +++ b/addons/missileguidance/functions/fnc_handleHandoff.sqf @@ -1,6 +1,23 @@ +/* + * Author: ACE-Team + * Not currently used + * + * Arguments: + * 0: TARGET + * 1: ARGS + * + * Return Value: + * Boolean + * + * Example: + * [bob, kevin] call ACE_missileguidance_fnc_handleHandoff + * + * Public: No + */ + #include "script_component.hpp" -PARAMS_2(_target,_args); +params ["_target", "_args"]; -if(isNil "_target" || {isNull _target} || {!local _target} ) exitWith { false }; +if (isNil "_target" || {isNull _target} || {!local _target} ) exitWith { false }; -[FUNC(guidancePFH), 0, _args] call CBA_fnc_addPerFrameHandler; \ No newline at end of file +[FUNC(guidancePFH), 0, _args] call CBA_fnc_addPerFrameHandler; diff --git a/addons/missileguidance/functions/fnc_onFired.sqf b/addons/missileguidance/functions/fnc_onFired.sqf index 2269810b94..bf256cbba0 100644 --- a/addons/missileguidance/functions/fnc_onFired.sqf +++ b/addons/missileguidance/functions/fnc_onFired.sqf @@ -1,44 +1,58 @@ -//#define DEBUG_MODE_FULL +/* + * Author: jaynus / nou + * Fired event handler, starts guidance if enabled for ammo + * + * Arguments: + * 0: Shooter (Man/Vehicle) + * 4: Ammo + * 6: Projectile + * + * Return Value: + * None + * + * Example: + * [player, "", "", "", "ACE_Javelin_FGM148", "", theMissile] call ace_missileguidance_fnc_onFired; + * + * Public: No + */ +// #define DEBUG_MODE_FULL #include "script_component.hpp" -PARAMS_7(_shooter,_weapon,_muzzle,_mode,_ammo,_magazine,_projectile); - -// Bail if guidance is disabled -// Bail on locality of the projectile, it should be local to us -if(GVAR(enabled) < 1 || {!local _projectile} ) exitWith { false }; - -//Bail if shooter isn't player AND system not enabled for AI: -if( !isPlayer _shooter && { GVAR(enabled) < 2 } ) exitWith { false }; +params ["_shooter","","","","_ammo","","_projectile"]; // Bail on not missile -if(! (_ammo isKindOf "MissileBase") ) exitWith { false }; +if (!(_ammo isKindOf "MissileBase")) exitWith {}; -private ["_config", "_configs", "_enabled", "_target", "_seekerType", "_attackProfile"]; -private ["_args", "_canUseLock", "_guidingUnit", "_launchPos", "_lockMode", "_targetPos", "_vanillaTarget"]; +// Bail if guidance is disabled for this ammo +if ((getNumber (configFile >> "CfgAmmo" >> _ammo >> QUOTE(ADDON) >> "enabled")) != 1) exitWith {}; -//Verify ammo has explicity added guidance config (ignore inheritances) -_configs = configProperties [(configFile >> "CfgAmmo" >> _ammo), QUOTE(configName _x == QUOTE(QUOTE(ADDON))), false]; -if( (count _configs) < 1) exitWith {}; +// Bail on locality of the projectile, it should be local to us +if (GVAR(enabled) < 1 || {!local _projectile} ) exitWith {}; -_config = (configFile >> "CfgAmmo" >> _ammo >> QUOTE(ADDON)); -_enabled = getNumber ( _config >> "enabled"); +// Bail if shooter isn't player AND system not enabled for AI: +if ( !isPlayer _shooter && { GVAR(enabled) < 2 } ) exitWith {}; -// Bail if guidance is not enabled -if(isNil "_enabled" || {_enabled != 1}) exitWith { false }; +// Verify ammo has explicity added guidance config (ignore inheritances) +private _configs = configProperties [(configFile >> "CfgAmmo" >> _ammo), QUOTE(configName _x == QUOTE(QUOTE(ADDON))), false]; +if ((count _configs) < 1) exitWith {}; -_target = (vehicle _shooter) getVariable [QGVAR(target), nil]; -_targetPos = (vehicle _shooter) getVariable [QGVAR(targetPosition), nil]; -_seekerType = (vehicle _shooter) getVariable [QGVAR(seekerType), nil]; -_attackProfile = (vehicle _shooter) getVariable [QGVAR(attackProfile), nil]; -_lockMode = (vehicle _shooter) getVariable [QGVAR(lockMode), nil]; +// MissileGuidance is enabled for this shot +TRACE_4("enabled",_shooter,_ammo,_projectile,typeOf _shooter); -// @TODO: make this vehicle shooter, but we need to differentiate where its set in ace_laser -_laserCode = _shooter getVariable [QEGVAR(laser,code), ACE_DEFAULT_LASER_CODE]; -_laserInfo = [_laserCode, ACE_DEFAULT_LASER_WAVELENGTH, ACE_DEFAULT_LASER_WAVELENGTH]; +private _config = configFile >> "CfgAmmo" >> _ammo >> QUOTE(ADDON); -_launchPos = getPosASL (vehicle _shooter); +private _target = _shooter getVariable [QGVAR(target), nil]; +private _targetPos = _shooter getVariable [QGVAR(targetPosition), nil]; +private _seekerType = _shooter getVariable [QGVAR(seekerType), nil]; +private _attackProfile = _shooter getVariable [QGVAR(attackProfile), nil]; +private _lockMode = _shooter getVariable [QGVAR(lockMode), nil]; -TRACE_3("Begin guidance", _target, _seekerType, _attackProfile); +private _laserCode = _shooter getVariable [QEGVAR(laser,code), ACE_DEFAULT_LASER_CODE]; +private _laserInfo = [_laserCode, ACE_DEFAULT_LASER_WAVELENGTH, ACE_DEFAULT_LASER_WAVELENGTH]; + +TRACE_6("getVars",_target,_targetPos,_seekerType,_attackProfile,_lockMode,_laserCode); + +private _launchPos = getPosASL (vehicle _shooter); if (isNil "_seekerType" || {!(_seekerType in (getArray (_config >> "seekerTypes")))}) then { _seekerType = getText (_config >> "defaultSeekerType"); @@ -51,28 +65,37 @@ if (isNil "_lockMode" || {!(_lockMode in (getArray (_config >> "seekerLockModes" }; // If we didn't get a target, try to fall back on tab locking -if(isNil "_target") then { - if(!isPlayer _shooter) then { +if (isNil "_target") then { + if (!isPlayer _shooter) then { // This was an AI shot, lets still guide it on the AI target - _target = _shooter getVariable[QGVAR(vanilla_target), nil]; + _target = _shooter getVariable [QGVAR(vanilla_target), nil]; TRACE_1("Detected AI Shooter!", _target); } else { - _canUseLock = getNumber (_config >> "canVanillaLock"); + private _canUseLock = getNumber (_config >> "canVanillaLock"); // @TODO: Get vanilla target - if(_canUseLock > 0 || difficulty < 1) then { - _vanillaTarget = cursorTarget; + if (_canUseLock > 0 || difficulty < 1) then { + private _vanillaTarget = cursorTarget; TRACE_1("Using Vanilla Locking", _vanillaTarget); - if(!isNil "_vanillaTarget") then { + if (!isNil "_vanillaTarget") then { _target = _vanillaTarget; }; }; }; }; +// Array for seek last target position +private _seekLastTargetPos = (getNumber ( _config >> "seekLastTargetPos")) == 1; +private _lastKnownPosState = [_seekLastTargetPos]; +if (_seekLastTargetPos && {!isNil "_target"}) then { + _lastKnownPosState set [1, (getPosASL _target)]; +} else { + _lastKnownPosState set [1, [0,0,0]]; +}; + TRACE_4("Beginning ACE guidance system",_target,_ammo,_seekerType,_attackProfile); -_args = [_this, - [_shooter, +private _args = [_this, + [ _shooter, [_target, _targetPos, _launchPos], _seekerType, _attackProfile, @@ -89,30 +112,50 @@ _args = [_this, getNumber ( _config >> "seekerAccuracy" ), getNumber ( _config >> "seekerMaxRange" ) ], - [ diag_tickTime, [], [] ] + [ diag_tickTime, [], [], _lastKnownPosState] ]; + +// Run the "onFired" function passing the full guidance args array +private _onFiredFunc = getText (_config >> "onFired"); +TRACE_1("",_onFiredFunc); +if (_onFiredFunc != "") then { + _args call (missionNamespace getVariable _onFiredFunc); +}; + + +// Reverse: +// _args params ["_firedEH", "_launchParams", "_flightParams", "_seekerParams", "_stateParams"]; +// _firedEH params ["_shooter","","","","_ammo","","_projectile"]; +// _launchParams params ["_shooter","_targetLaunchParams","_seekerType","_attackProfile","_lockMode","_laserInfo"]; +// _targetLaunchParams params ["_target", "_targetPos", "_launchPos"]; +// _stateParams params ["_lastRunTime", "_seekerStateParams", "_attackProfileStateParams", "_lastKnownPosState"]; +// _seekerParams params ["_seekerAngle", "_seekerAccuracy", "_seekerMaxRange"]; + + // Hand off to the guiding unit. We just use local player so local PFH fires for now // Laser code needs to give us a shooter for LOBL, or the seeker unit needs to be able to shift locality // Based on its homing laser // Lasers need to be handled in a special LOAL/LOBL case -//if(isPlayer _shooter) then { -// _guidingUnit = ACE_player; +//if (isPlayer _shooter) then { +// private _guidingUnit = ACE_player; // -// if(local _guidingUnit) then { +// if (local _guidingUnit) then { // [FUNC(guidancePFH), 0, _args ] call CBA_fnc_addPerFrameHandler; // } else { // [QGVAR(handoff), [_guidingUnit, _args] ] call FUNC(doHandoff); // }; //} else { - [FUNC(guidancePFH), 0, _args ] call CBA_fnc_addPerFrameHandler; + // [FUNC(guidancePFH), 0, _args ] call CBA_fnc_addPerFrameHandler; //}; +[FUNC(guidancePFH), 0, _args ] call CBA_fnc_addPerFrameHandler; + /* Clears locking settings (vehicle _shooter) setVariable [QGVAR(target), nil]; (vehicle _shooter) setVariable [QGVAR(seekerType), nil]; (vehicle _shooter) setVariable [QGVAR(attackProfile), nil]; (vehicle _shooter) setVariable [QGVAR(lockMode), nil]; -*/ + */ diff --git a/addons/missileguidance/functions/fnc_onIncomingMissile.sqf b/addons/missileguidance/functions/fnc_onIncomingMissile.sqf index 14902c32a5..2dcc93b793 100644 --- a/addons/missileguidance/functions/fnc_onIncomingMissile.sqf +++ b/addons/missileguidance/functions/fnc_onIncomingMissile.sqf @@ -1,8 +1,27 @@ -//#define DEBUG_MODE_FULL +/* + * Author: jaynus / nou + * Handles AI shooting a locking missile + * + * Arguments: + * 0: Target + * 1: Ammo + * 2: Shooter + * + * Return Value: + * None + * + * Example: + * [cursorTarget, "x", player] call ace_missileguidance_fnc_changeMissileDirection; + * + * Public: No + */ +// #define DEBUG_MODE_FULL #include "script_component.hpp" -PARAMS_3(_target,_ammo,_shooter); -if(GVAR(enabled) < 1) exitWith {}; // bail if enabled +params ["_target", "_ammo", "_shooter"]; + +if (GVAR(enabled) < 1) exitWith {}; // bail if enabled if !(local (gunner _shooter) || {local _shooter}) exitWith {}; // bail if not shooter -_shooter setVariable [QGVAR(vanilla_target),_target, false]; \ No newline at end of file +_shooter setVariable [QGVAR(vanilla_target),_target, false]; +TRACE_2("setting vanilla target",_shooter,_target); diff --git a/addons/missileguidance/functions/fnc_rotateVectLine.sqf b/addons/missileguidance/functions/fnc_rotateVectLine.sqf deleted file mode 100644 index 9adb283cae..0000000000 --- a/addons/missileguidance/functions/fnc_rotateVectLine.sqf +++ /dev/null @@ -1,39 +0,0 @@ -#include "script_component.hpp" -private ["_d", "_map", "_p", "_theta", "_u"]; - -_map = _this select 0; -_theta = _this select 1; - -_p = _map select 0; -_p1 = _map select 1; -_p2 = _map select 2; - -_q1 = +(_map select 3); -_q2 = +(_map select 4); -_u = _map select 5; -_d = _map select 6; - -/* Step 4 */ -_q2 set[0, (_q1 select 0) * cos(_theta) - (_q1 select 1) * sin(_theta)]; -_q2 set[1, (_q1 select 0) * sin(_theta) + (_q1 select 1) * cos(_theta)]; -_q2 set[2, (_q1 select 2)]; - -/* Inverse of step 3 */ -_q1 set[0, (_q2 select 0) * _d + (_q2 select 2) * (_u select 0)]; -_q1 set[1, (_q2 select 1)]; -_q1 set[2, - (_q2 select 0) * (_u select 0) + (_q2 select 2) * _d]; - -/* Inverse of step 2 */ -if (_d != 0) then { - _q2 set[0, (_q1 select 0)]; - _q2 set[1, (_q1 select 1) * (_u select 2) / _d + (_q1 select 2) * (_u select 1) / _d]; - _q2 set[2, - (_q1 select 1) * (_u select 1) / _d + (_q1 select 2) * (_u select 2) / _d]; -} else { - _q2 = _q1; -}; - -/* Inverse of step 1 */ -_q1 set[0, (_q2 select 0) + (_p1 select 0)]; -_q1 set[1, (_q2 select 1) + (_p1 select 1)]; -_q1 set[2, (_q2 select 2) + (_p1 select 2)]; -_q1; \ No newline at end of file diff --git a/addons/missileguidance/functions/fnc_rotateVectLineGetMap.sqf b/addons/missileguidance/functions/fnc_rotateVectLineGetMap.sqf deleted file mode 100644 index 258cc93ae2..0000000000 --- a/addons/missileguidance/functions/fnc_rotateVectLineGetMap.sqf +++ /dev/null @@ -1,37 +0,0 @@ -#include "script_component.hpp" - -private ["_p", "_theta", "_p1", "_p2", "_q1", "_q2", "_u", "_d"]; -_p = _this select 0; -_p1 = _this select 1; -_p2 = _this select 2; - -_q1 = []; -_q2 = []; -_u = []; - -/* Step 1 */ -_q1 set[0, (_p select 0) - (_p1 select 0)]; -_q1 set[1, (_p select 1) - (_p1 select 1)]; -_q1 set[2, (_p select 2) - (_p1 select 2)]; - -_u set[0, (_p2 select 0) - (_p1 select 0)]; -_u set[1, (_p2 select 1) - (_p1 select 1)]; -_u set[2, (_p2 select 2) - (_p1 select 2)]; -_u = _u call BIS_fnc_unitVector; -_d = sqrt((_u select 1)*(_u select 1) + (_u select 2)*(_u select 2)); - -/* Step 2 */ -if (_d != 0) then { - _q2 set[0, (_q1 select 0)]; - _q2 set[1, (_q1 select 1) * (_u select 2) / _d - (_q1 select 2) * (_u select 1) / _d]; - _q2 set[2, (_q1 select 1) * (_u select 1) / _d + (_q1 select 2) * (_u select 2) / _d]; -} else { - _q2 = _q1; -}; - -/* Step 3 */ -_q1 set[0, (_q2 select 0) * _d - (_q2 select 2) * (_u select 0)]; -_q1 set[1, (_q2 select 1)]; -_q1 set[2, (_q2 select 0) * (_u select 0) + (_q2 select 2) * _d]; - -[_p, _p1, _p2, _q1, _q2, _u, _d] \ No newline at end of file diff --git a/addons/missileguidance/functions/fnc_seekerType_Optic.sqf b/addons/missileguidance/functions/fnc_seekerType_Optic.sqf index b491110ac6..173b6ba708 100644 --- a/addons/missileguidance/functions/fnc_seekerType_Optic.sqf +++ b/addons/missileguidance/functions/fnc_seekerType_Optic.sqf @@ -1,52 +1,54 @@ -//#define DEBUG_MODE_FULL +/* + * Author: jaynus / nou + * Seeker Type: Optic + * + * Arguments: + * 1: Guidance Arg Array + * 2: Seeker State + * + * Return Value: + * Missile Aim PosASL + * + * Example: + * [[], [], []] call ace_missileguidance_fnc_seekerType_Optic; + * + * Public: No + */ +// #define DEBUG_MODE_FULL #include "script_component.hpp" -EXPLODE_7_PVT(((_this select 1) select 0),_shooter,_weapon,_muzzle,_mode,_ammo,_magazine,_projectile); -private ["_targets", "_foundTargetPos", "_launchParams", "_seekerParams", "_targetLaunchParams"]; -private ["_angleFov", "_angleOkay", "_losOkay", "_seekerTargetPos", "_sensorPos", "_target"]; +params ["", "_args"]; +_args params ["_firedEH", "_launchParams", "", "_seekerParams", "_stateParams"]; +_firedEH params ["","","","","","","_projectile"]; +_launchParams params ["", "_targetParams"]; +_targetParams params ["_target"]; +_seekerParams params ["_seekerAngle", "", "_seekerMaxRange"]; -_seekerTargetPos = _this select 0; +if (isNil "_target") exitWith {[0,0,0]}; -_launchParams = _this select 1; -_target = (((_launchParams select 1) select 1) select 0); -_seekerParams = _launchParams select 3; - -TRACE_1("", _this); -TRACE_1("", _launchParams); - -// TODO:: Make sure the missile maintains LOS -_foundTargetPos = [0,0,0]; -if(!isNil "_target") then { - _foundTargetPos = aimPos _target ; - //_foundTargetPos = (_target modelToWorldVisual (getCenterOfMass _target)); -}; +private _foundTargetPos = aimPos _target; // @TODO: This is seeker LOS and angle checks for LOAL only; LOBL does not need visual -_angleFov = _seekerParams select 0; -_angleOkay = [_projectile, _foundTargetPos, _angleFov] call FUNC(checkSeekerAngle); +private _angleOkay = [_projectile, _foundTargetPos, _seekerAngle] call FUNC(checkSeekerAngle); -_losOkay = false; -if(_angleOkay) then { +private _losOkay = false; +if (_angleOkay) then { _losOkay = [_projectile, _target] call FUNC(checkLos); }; TRACE_2("", _angleOkay, _losOkay); -// If we got here, it was an invalid target, just return a spot 5m in front of the missile -if(!_angleOkay || !_losOkay) then { - _foundTargetPos = _sensorPos vectorAdd ((velocity _projectile) vectorMultiply 5); -} else { - TRACE_2("", _target, _foundTargetPos); - private ["_projectileSpeed", "_distanceToTarget", "_eta", "_adjustDistance"]; - // @TODO: Configurable lead for seekers - _projectileSpeed = (vectorMagnitude velocity _projectile); - _distanceToTarget = (getPosASL _projectile) vectorDistance _foundTargetPos; +// Can't see target, return [0,0,0] and let doSeekerSearch handle it +if (!_angleOkay || !_losOkay) exitWith {[0,0,0]}; - _eta = _distanceToTarget / _projectileSpeed; +TRACE_2("", _target, _foundTargetPos); +// @TODO: Configurable lead for seekers +private _projectileSpeed = (vectorMagnitude velocity _projectile); +private _distanceToTarget = (getPosASL _projectile) vectorDistance _foundTargetPos; +private _eta = _distanceToTarget / _projectileSpeed; - _adjustDistance = (velocity _target) vectorMultiply _eta; - TRACE_3("leading target",_distanceToTarget,_eta,_adjustDistance); - _foundTargetPos = _foundTargetPos vectorAdd _adjustDistance; -}; +private _adjustDistance = (velocity _target) vectorMultiply _eta; +TRACE_3("leading target",_distanceToTarget,_eta,_adjustDistance); +_foundTargetPos = _foundTargetPos vectorAdd _adjustDistance; TRACE_2("return",_foundTargetPos,(aimPos _target) distance _foundTargetPos); _foundTargetPos; diff --git a/addons/missileguidance/functions/fnc_seekerType_SALH.sqf b/addons/missileguidance/functions/fnc_seekerType_SALH.sqf index eda26fe358..3f78f5d3c5 100644 --- a/addons/missileguidance/functions/fnc_seekerType_SALH.sqf +++ b/addons/missileguidance/functions/fnc_seekerType_SALH.sqf @@ -1,32 +1,33 @@ +/* + * Author: jaynus / nou + * Seeker Type: SALH (Laser) + * Wrapper for ace_laser_fnc_seekerFindLaserSpot + * + * Arguments: + * 1: Guidance Arg Array + * 2: Seeker State + * + * Return Value: + * Missile Aim PosASL + * + * Example: + * [[], [], []] call ace_missileguidance_fnc_seekerType_SALH; + * + * Public: No + */ // #define DEBUG_MODE_FULL #include "script_component.hpp" -params ["_lastSeekTargetPos", "_args"]; -_args params ["_firedEH", "_launchParams", "_flightParams", "_seekerParams", "_stateParams"]; -_firedEH params ["_shooter","_weapon","_muzzle","_mode","_ammo","_magazine","_projectile"]; +params ["", "_args"]; +_args params ["_firedEH", "_launchParams", "", "_seekerParams"]; +_firedEH params ["","","","","","","_projectile"]; _launchParams params ["","","","","","_laserParams"]; _seekerParams params ["_seekerAngle", "", "_seekerMaxRange"]; _laserParams params ["_code", "_wavelengthMin", "_wavelengthMax"]; -private "_foundTargetPos"; -if (!isNil "_target") then { - // Handle AI or moving vanilla lasers - _foundTargetPos = getPosASL _target; -} else { - private _laserResult = [(getPosASL _projectile), (velocity _projectile), _seekerAngle, [_wavelengthMin, _wavelengthMax], _code, _projectile] call EFUNC(laser,seekerFindLaserSpot); - _foundTargetPos = _laserResult select 0; - TRACE_1("Search", _laserResult); -}; - -if(!isNil "_foundTargetPos") then { - // Fov is already checked by laser func, check if distance - - private _canSeeTarget = _seekerMaxRange >= (_foundTargetPos vectorDistance (getPosASL _projectile)); - // If we got here, it was an invalid target, just return a spot 5m in front of the missile - if(!_canSeeTarget) then { - _foundTargetPos = _sensorPos vectorAdd ((velocity _projectile) vectorMultiply 5); - }; -}; +private _laserResult = [(getPosASL _projectile), (velocity _projectile), _seekerAngle, _seekerMaxRange, [_wavelengthMin, _wavelengthMax], _code, _projectile] call EFUNC(laser,seekerFindLaserSpot); +private _foundTargetPos = _laserResult select 0; +TRACE_1("Search", _laserResult); _foundTargetPos; diff --git a/addons/missileguidance/script_component.hpp b/addons/missileguidance/script_component.hpp index d09e1e3113..298de3a051 100644 --- a/addons/missileguidance/script_component.hpp +++ b/addons/missileguidance/script_component.hpp @@ -2,6 +2,7 @@ #define COMPONENT_BEAUTIFIED Missile Guidance #include "\z\ace\addons\main\script_mod.hpp" +// #define DRAW_GUIDANCE_INFO // #define DEBUG_MODE_FULL // #define DISABLE_COMPILE_CACHE // #define ENABLE_PERFORMANCE_COUNTERS @@ -15,5 +16,3 @@ #endif #include "\z\ace\addons\main\script_macros.hpp" - -#define FIREMODE_DIRECT_LOAL 1 diff --git a/addons/missileguidance/stringtable.xml b/addons/missileguidance/stringtable.xml index 1c7761cb43..7f03b695bc 100644 --- a/addons/missileguidance/stringtable.xml +++ b/addons/missileguidance/stringtable.xml @@ -13,6 +13,9 @@ Fejlett rakétairányító Продвинутое наведение ракет 高度なミサイルの誘導 + 고급 미사일 유도 + 进阶飞弹制导 + 進階飛彈制導 Advanced missile guidance, or AMG, provides multiple enhancements to missile locking and firing. It is also a framework required for missile weapon types. @@ -26,6 +29,9 @@ Orientação avançada de mísseis ou OAM, fornece vários aprimoramentos para travamento de mísseis e disparos. Também é um sistema requerido para disparar armas que utilizem mísseis. Pokočilé navádění raket (AMG) poskytuje několik vylepšení pro lepší zaměření a následnou střelbu. Je to prvek vyžadovaný u typu zbraní jako jsou rakety. 高度なミサイルの誘導、または AMG はミサイルの捕捉と発射に複数の強化をあたえます。これはミサイルの種類によって、枠組みを必要とします。 + 고급 미사일 유도 혹은 AMG 는 표적 획득 및 발사를 위한 여러 기능을 제공합니다. 미사일 종류에따라 체계가 필요합니다. + 进阶飞弹制导增强了多种导弹锁定和射击的能力。此系统适用于所有飞弹类型的武器。 + 進階飛彈制導增強了多種導彈鎖定和射擊的能力。此系統適用於所有飛彈類型的武器。 Hydra-70 DAGR Missile @@ -38,7 +44,10 @@ Míssil Hydra-70 DAGR Hydra-70 DAGR rakéta Hydra-70 DAGR - Hydra-70 DAGR ミサイル + ハイドラ-70 DAGR ミサイル + Hydra-70 DAGR 미사일 + 九头蛇-70 直接攻击导引飞弹 + 九頭蛇-70 直接攻擊導引飛彈 DAGR @@ -52,6 +61,9 @@ DAGR DAGR DAGR + DAGR + 直接攻击导引飞弹 + 直接攻擊導引飛彈 Hydra-70 DAGR Laser Guided Missile @@ -64,7 +76,10 @@ Míssil guiado a laser Hydra-70 DAGR Hydra-70 DAGR lézer-irányított rakéta Управляемая ракета лазерного наведения Hydra-70 DAGR - Hydra-70 DAGR レーザ誘導ミサイル + ハイドラ-70 DAGR レーザ誘導ミサイル + Hydra-70 DAGR 레이저 유도 미사일 + 九头蛇-70 直接攻击雷射导引飞弹 + 九頭蛇-70 直接攻擊雷射導引飛彈 Hellfire II AGM-114K Missile @@ -77,7 +92,10 @@ Míssil Hellfire II AGM-114K Hellfire II AGM-114K rakéta Hellfire II AGM-114K - Hellfire II AGM-114K ミサイル + ヘルファイア II AGM-114K ミサイル + Hellfire II AGM-114K 미사일 + 地狱火II型 AGM-114K 导弹 + 地獄火II型 AGM-114K 導彈 AGM-114K @@ -91,6 +109,9 @@ AGM-114K AGM-114K AGM-114K + AGM-114K + AGM-114K + AGM-114K Hellfire II AGM-114K Laser Guided Missile @@ -103,7 +124,10 @@ Míssil guiado a laser Hellfire II AGM-114K Hellfire II AGM-114K lézer-irányított rakéta Управляемая ракета лазерного наведения Hellfire II AGM-114K - Hellfire II AGM-114K レーザ誘導ミサイル + ヘルファイア II AGM-114K レーザ誘導ミサイル + Hellfire II AGM-114K 레이저 유도 미사일 + 地狱火II型 AGM-114K 雷射导引飞弹 + 地獄火II型 AGM-114K 雷射導引飛彈 Off @@ -117,6 +141,9 @@ Выкл. Spento 無効 + 끄기 + 关闭 + 關閉 Player Only @@ -130,6 +157,9 @@ Только игрок Solo Giocatore プレイヤーのみ + 오직 플레이어만 + 只有玩家 + 只有玩家 Player and AI @@ -143,6 +173,25 @@ Игрок и боты Giocatore ed IA プレイヤーと AI + 玩家和AI + 玩家和AI + 플레이어와 AI + + + Cycle Fire Mode + Wechsle Feuermodus + Переключение режимов огня + Přepínání režimů palby + Przełącz tryb ognia + Cycle mode de tir + Tüzelési mód váltása + Alterna le modalità di fuoco + Cambiar modo de disparo + Alterar Modo de Disparo + 発射モード切り替え + 발사 방식 순환 + 循环切换开火模式 + 循環切換開火模式 - \ No newline at end of file + diff --git a/addons/missionmodules/XEH_preInit.sqf b/addons/missionmodules/XEH_preInit.sqf index a7feade1c3..b47cf6628d 100644 --- a/addons/missionmodules/XEH_preInit.sqf +++ b/addons/missionmodules/XEH_preInit.sqf @@ -2,6 +2,8 @@ ADDON = false; +PREP_RECOMPILE_START; #include "XEH_PREP.hpp" +PREP_RECOMPILE_END; ADDON = true; diff --git a/addons/missionmodules/functions/fnc_moduleAmbianceSound.sqf b/addons/missionmodules/functions/fnc_moduleAmbianceSound.sqf index ddd0d4377e..f01aa8017a 100644 --- a/addons/missionmodules/functions/fnc_moduleAmbianceSound.sqf +++ b/addons/missionmodules/functions/fnc_moduleAmbianceSound.sqf @@ -8,104 +8,103 @@ * 2: Activated * * Return Value: - * Nothing + * None * * Example: - * N/A + * [LOGIC, [bob, kevin], true] call ace_missionmodules_fnc_moduleAmbianceSound * * Public: No */ #include "script_component.hpp" -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 { - _ambianceSounds = []; - _unparsedSounds = _logic getVariable ["soundFiles", ""]; - _minimalDistance = (_logic getVariable ["minimalDistance", 400]) max 1; - _maximalDistance = (_logic getVariable ["maximalDistance", 10]) max _minimalDistance; - _minDelayBetweensounds = (_logic getVariable ["minimalDelay", 10]) max 1; - _maxDelayBetweenSounds = (_logic getVariable ["maximalDelay", 170]) max _minDelayBetweensounds; - _volume = (_logic getVariable ["soundVolume", 30]) max 1; - _followPlayers = _logic getVariable ["followPlayers", false]; +if (!_activated || !local _logic) exitWith {0}; - _splittedList = _unparsedSounds splitString ","; - _missionRoot = str missionConfigFile select [0, count str missionConfigFile - 15]; +private _ambianceSounds = []; +private _unparsedSounds = _logic getVariable ["soundFiles", ""]; +private _minimalDistance = (_logic getVariable ["minimalDistance", 400]) max 1; +private _maximalDistance = (_logic getVariable ["maximalDistance", 10]) max _minimalDistance; +private _minDelayBetweensounds = (_logic getVariable ["minimalDelay", 10]) max 1; +private _maxDelayBetweenSounds = (_logic getVariable ["maximalDelay", 170]) max _minDelayBetweensounds; +private _volume = (_logic getVariable ["soundVolume", 30]) max 1; +private _followPlayers = _logic getVariable ["followPlayers", false]; - { - _x = [_x] call CBA_fnc_removeWhitespace; +private _splittedList = _unparsedSounds splitString ","; +private _missionRoot = str missionConfigFile select [0, count str missionConfigFile - 15]; - if (isClass (missionConfigFile >> "CfgSounds" >> _x)) then { - // 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); - }; +{ + _x = [_x] call CBA_fnc_removeWhitespace; + + if (isClass (missionConfigFile >> "CfgSounds" >> _x)) then { + // CfgSounds accepts a leading backslash, but a double backslash + // is not accepted in the path, so we have to filter that. + private _soundPath = getArray (missionConfigFile >> "CfgSounds" >> _x >> "sound") select 0; + if (_soundPath select [0,1] == "\") then { + _ambianceSounds pushBack (_missionRoot + (_soundPath select [1])); } else { - if (isClass (configFile >> "CfgSounds" >> _x)) then { - _soundPath = (getArray(configFile >> "CfgSounds" >> _x >> "sound")) param [0, ""]; - if ((_soundPath select [0, 1]) == "\") then {_soundPath = _soundPath select [1];}; - _ambianceSounds pushBack _soundPath; + _ambianceSounds pushBack (_missionRoot + _soundPath); + }; + } else { + if (isClass (configFile >> "CfgSounds" >> _x)) then { + _soundPath = (getArray(configFile >> "CfgSounds" >> _x >> "sound")) param [0, ""]; + if ((_soundPath select [0, 1]) == "\") then {_soundPath = _soundPath select [1];}; + _ambianceSounds pushBack _soundPath; + } else { + ERROR_1("Ambient Sounds: Sound ""%1"" not found.",_x); + }; + }; + + false +} count _splittedList; + +if (count _ambianceSounds == 0) exitWith {}; +{ + if ((_x find ".") == -1) then { + _ambianceSounds set [_forEachIndex, _x + ".wss"]; + }; +} forEach _ambianceSounds; + +TRACE_1("",_ambianceSounds); + +[{ + params ["_args", "_pfhHandle"]; + _args params ["_logic", "_ambianceSounds", "_minimalDistance", "_maximalDistance", "_minDelayBetweensounds", "_maxDelayBetweenSounds", "_volume", "_followPlayers", "_lastTimePlayed"]; + + if (!alive _logic) exitWith { + [_pfhHandle] call CBA_fnc_removePerFrameHandler; + }; + + if (CBA_missionTime - _lastTimePlayed >= ((_minDelayBetweensounds + random(_maxDelayBetweenSounds)) min _maxDelayBetweenSounds)) then { + + // Find all players in session. + private _allUnits = if (isMultiplayer) then {playableUnits} else {[ACE_player]}; + + // Check if there are enough players to even start playing this sound. + if (count _allUnits > 0) then { + // find the position from which we are going to play this sound from. + private _newPosASL = if (_followPlayers) then { + // Select a target unit at random. + private _targetUnit = selectRandom _allUnits; + AGLtoASL (_targetUnit getPos [_minimalDistance + random (_maximalDistance - _minimalDistance), random 360]); } else { - ERROR_1("Ambient Sounds: Sound ""%1"" not found.",_x); + AGLtoASL (_logic getPos [_minimalDistance + random (_maximalDistance - _minimalDistance), random 360]); + }; + + TRACE_1("",_newPosASL); + // If no unit is to close to this position, we will play the sound. + if ({(_newPosASL distance _x < (_minimalDistance / 2))}count _allUnits == 0) then { + private _soundFile = selectRandom _ambianceSounds; + TRACE_2("playing file",_soundFile,_newPosASL); + playSound3D [_soundFile, objNull, false, _newPosASL, _volume, 1, 1000]; + _args set [8, CBA_missionTime]; + } else { + TRACE_1("pos is too close to a player",_newPosASL); }; }; - - false - } count _splittedList; - - if (count _ambianceSounds == 0) exitWith {}; - { - if ((_x find ".") == -1) then { - _ambianceSounds set [_forEachIndex, _x + ".wss"]; - }; - } forEach _ambianceSounds; - - TRACE_1("",_ambianceSounds); - - [{ - params ["_args", "_pfhHandle"]; - _args params ["_logic", "_ambianceSounds", "_minimalDistance", "_maximalDistance", "_minDelayBetweensounds", "_maxDelayBetweenSounds", "_volume", "_followPlayers", "_lastTimePlayed"]; - - if (!alive _logic) exitWith { - [_pfhHandle] call CBA_fnc_removePerFrameHandler; - }; - - if (CBA_missionTime - _lastTimePlayed >= ((_minDelayBetweensounds + random(_maxDelayBetweenSounds)) min _maxDelayBetweenSounds)) then { - - // Find all players in session. - private _allUnits = if (isMultiplayer) then {playableUnits} else {[ACE_player]}; - - // Check if there are enough players to even start playing this sound. - if (count _allUnits > 0) then { - // find the position from which we are going to play this sound from. - private _newPosASL = if (_followPlayers) then { - // Select a target unit at random. - private _targetUnit = selectRandom _allUnits; - AGLtoASL (_targetUnit getPos [random 360, _minimalDistance + random (_maximalDistance - _minimalDistance)]); - } else { - AGLtoASL (_logic getPos [random 360, _minimalDistance + random (_maximalDistance - _minimalDistance)]); - }; - - TRACE_1("",_newPosASL); - // If no unit is to close to this position, we will play the sound. - if ({(_newPosASL distance _x < (_minimalDistance / 2))}count _allUnits == 0) then { - private _soundFile = selectRandom _ambianceSounds; - TRACE_2("playing file",_soundFile,_newPosASL); - playSound3D [_soundFile, objNull, false, _newPosASL, _volume, 1, 1000]; - _args set [8, CBA_missionTime]; - } else { - TRACE_1("pos is too close to a player",_newPosASL); - }; - }; - }; - }, 0.1, [_logic, _ambianceSounds, _minimalDistance, _maximalDistance, _minDelayBetweensounds, _maxDelayBetweenSounds, _volume, _followPlayers, CBA_missionTime] ] call CBA_fnc_addPerFrameHandler; -}; + }; +}, 0.1, [_logic, _ambianceSounds, _minimalDistance, _maximalDistance, _minDelayBetweensounds, _maxDelayBetweenSounds, _volume, _followPlayers, CBA_missionTime] ] call CBA_fnc_addPerFrameHandler; true; diff --git a/addons/missionmodules/stringtable.xml b/addons/missionmodules/stringtable.xml index ecdb5352f3..55a754bf85 100644 --- a/addons/missionmodules/stringtable.xml +++ b/addons/missionmodules/stringtable.xml @@ -13,6 +13,9 @@ Модули миссий ACE Moduli Missione ACE ACE ミッション モジュール + ACE 미션 모듈 + ACE 任务模块 + ACE 任務模塊 Ambiance Sounds [ACE] @@ -26,6 +29,9 @@ Звук окружения [ACE] Souni Ambientali [ACE] 環境音 [ACE] + 환경 효과음 [ACE] + 环境声音 [ACE] + 環境聲音 [ACE] Sounds @@ -39,6 +45,9 @@ Звуки Suoni 効果音 + 효과음 + 声音 + 聲音 Class names of the ambiance sounds to be played. Seperated by ',' @@ -51,6 +60,9 @@ ClassNames des sons d'ambiances. Séparation par "," Nomi classi dei suoni ambientali da eseguire. Separati da ',' 再生する環境音のクラスネームを記載。','で複数指定できます。 + 재생되는 환경 효과음의 단위와 이름입니다. ','로 구분됩니다. + 输入想使用的环境声音classname。每个classname用','做区隔 + 輸入想使用的環境聲音classname。每個classname用','做區隔 Minimal Distance @@ -64,6 +76,9 @@ Минимальная дистанция Distanza Minimale 最低距離 + 최소 거리 + 最小距离 + 最小距離 Used for calculating a random position and sets the minimal distance between the players and the played sound file(s) @@ -77,6 +92,9 @@ Используется для расчета случайной позиции и указывает минимальное расстояние между игроками и источниками звука Usati per calcolare una posizione casuale ed impostare la distanza minima tra i giocatori ed il file suono eseguito 無作為な位置への計算や、プレイヤーと再生されるファイルの間へ最低距離を設定します + 무작위 위치 계산에 사용되며 플레이어와 재생 된 사운드 파일 간의 최소 거리를 설정합니다. + 声音将随机产生在玩家附近,此选项定义该声音最近会距离玩家多少公尺 + 聲音將隨機產生在玩家附近,此選項定義該聲音最近會距離玩家多少公尺 Maximum Distance @@ -90,6 +108,9 @@ Максимальная дистанция Distanza Massima 最大距離 + 최대 거리 + 最大距离 + 最大距離 Used for calculating a random position and sets the maximum distance between the players and the played sound file(s) @@ -103,6 +124,9 @@ Используется для расчета случайной позиции и указывает максимальное расстояние между игроками и источниками звука Usato per calcolare una posizione casuale ed impostare la distanza massima tra giocatori e il file suono eseguito 無作為な位置への計算や、プレイヤーと再生されるファイルの間へ最大距離を設定します + 무작위 위치 계산에 사용되며 플레이어와 재생 된 사운드 파일 간의 최대 거리를 설정합니다. + 声音将随机产生在玩家附近,此选项定义该声音最远会距离玩家多少公尺 + 聲音將隨機產生在玩家附近,此選項定義該聲音最遠會距離玩家多少公尺 Minimal Delay @@ -116,6 +140,9 @@ Минимальная задержка Pausa Minima 最低遅延 + 최소 지연 + 最小延迟 + 最小延遲 Minimal delay between sounds played @@ -129,6 +156,9 @@ Минимальная задержка между воспроизведением звуков Pausa Minima tra suoni eseguiti 再生されるまでの最低遅延 + 재생된 소리간 최소 지연시간 + 设定每个声音档案中间最少间隔多久再进行播放 + 設定每個聲音檔案中間最少間隔多久再進行播放 Maximum Delay @@ -142,6 +172,9 @@ Максимальная задержка Pausa Massima 最大遅延 + 최대 지연 + 最大延迟 + 最大延遲 Maximum delay between sounds played @@ -155,6 +188,9 @@ Максимальная задержка между воспроизведением звуков Pausa Massima tra suoni eseguiti 再生されるまでの最大遅延 + 재생된 소리간 최대 지연시간 + 设定每个声音档案中间最多间隔多久再进行播放 + 設定每個聲音檔案中間最多間隔多久再進行播放 Follow Players @@ -168,6 +204,9 @@ Следовать за игроками Segui Giocatori プレイヤーを追随 + 플레이어 따라가기 + 跟随玩家 + 跟隨玩家 Follow players. If set to false, loop will play sounds only nearby logic position. @@ -181,6 +220,9 @@ Следовать за игроками. Если установить в Ложь, звуки будут циклически проигрываться только около позиции Логики. Segui Giocatori. Se impostato su falso, il ciclo eseguirà i suoni solo vicino ad una posizione logica. プレイヤーを追随します。False に設定するとロジックの近くで延々と再生します。 + 플레이어를 따라갑니다. 거짓으로 설정될경우 오직 한 자리에서만 반복해서 소리를 재생합니다. + 设定声音是否会在玩家的附近产生。假如关闭此功能,声音只会在模块的位置产生。 + 設定聲音是否會在玩家的附近產生。假如關閉此功能,聲音只會在模塊的位置產生。 Volume @@ -194,6 +236,9 @@ Громкость Volume 音量 + 볼륨 + 音量 + 音量 The volume of the sounds played @@ -207,6 +252,9 @@ Громкость воспроизводимых звуков Il volume dei suoni eseguiti 再生される音の大きさ + 재생되는 소리의 볼륨 + 调整声音的音量 + 調整聲音的音量 Ambiance sounds loop (synced across MP) @@ -220,6 +268,9 @@ Циклически воспроизводимые звуки окружения (синх. между игроками) Ciclo Suoni Ambientali (sincronizzato in MP) 環境音の繰り返し (MP 間で同期させます) + 환경 효과음 반복 (멀티플레이 전반적으로 동기화됨) + 循环的环境声音 (在多人游戏中会同步所有玩家的播放状态) + 循環的環境聲音 (在多人遊戲中會同步所有玩家的播放狀態) - \ No newline at end of file + diff --git a/addons/mk6mortar/CfgWeapons.hpp b/addons/mk6mortar/CfgWeapons.hpp index cb5454321d..3e247910fb 100644 --- a/addons/mk6mortar/CfgWeapons.hpp +++ b/addons/mk6mortar/CfgWeapons.hpp @@ -1,6 +1,6 @@ class CfgWeapons { class ACE_ItemCore; - class InventoryItem_Base_F; + class CBA_MiscItem_ItemInfo; class ACE_RangeTable_82mm: ACE_ItemCore { author = ECSTRING(common,ACETeam); @@ -8,7 +8,7 @@ class CfgWeapons { displayName = CSTRING(rangetable_name); descriptionShort = CSTRING(rangetable_description); picture = QPATHTOF(UI\icon_rangeTable.paa); - class ItemInfo: InventoryItem_Base_F { + class ItemInfo: CBA_MiscItem_ItemInfo { mass = 0.5; }; }; diff --git a/addons/mk6mortar/XEH_postInit.sqf b/addons/mk6mortar/XEH_postInit.sqf index aceb721d70..e3169b6dba 100644 --- a/addons/mk6mortar/XEH_postInit.sqf +++ b/addons/mk6mortar/XEH_postInit.sqf @@ -17,7 +17,25 @@ ["ace_initMortar", {_this call FUNC(mortarInit);}] call CBA_fnc_addEventHandler; -if (!hasInterface) exitWith {}; +if (hasInterface) then { + ["ace_infoDisplayChanged", FUNC(turretDisplayLoaded)] call CBA_fnc_addEventHandler; +}; -["vehicle", FUNC(handlePlayerVehicleChanged)] call CBA_fnc_addPlayerEventHandler; -["ace_infoDisplayChanged", FUNC(turretDisplayLoaded)] call CBA_fnc_addEventHandler; +["ace_settingsInitialized", { + TRACE_1("ace_settingsInitialized",GVAR(useAmmoHandling)); + + ["vehicle", FUNC(handlePlayerVehicleChanged), true] call CBA_fnc_addPlayerEventHandler; + + if (GVAR(useAmmoHandling)) then { + ["Mortar_01_base_F", "init", { + TRACE_2("mortar init",_this,(_this select 0) turretLocal [0]); + + //wait for proper turret locality change + [{ + TRACE_2("after delay",_this,(_this select 0) turretLocal [0]); + ["ace_initMortar", _this] call CBA_fnc_localEvent; + }, _this, 0.5] call CBA_fnc_waitAndExecute; + + }, true, [], true] call CBA_fnc_addClassEventHandler; + }; +}] call CBA_fnc_addEventHandler; diff --git a/addons/mk6mortar/XEH_preInit.sqf b/addons/mk6mortar/XEH_preInit.sqf index a7feade1c3..b47cf6628d 100644 --- a/addons/mk6mortar/XEH_preInit.sqf +++ b/addons/mk6mortar/XEH_preInit.sqf @@ -2,6 +2,8 @@ ADDON = false; +PREP_RECOMPILE_START; #include "XEH_PREP.hpp" +PREP_RECOMPILE_END; ADDON = true; diff --git a/addons/mk6mortar/functions/fnc_canLoadMagazine.sqf b/addons/mk6mortar/functions/fnc_canLoadMagazine.sqf index c0858a328a..2114c7d3a8 100644 --- a/addons/mk6mortar/functions/fnc_canLoadMagazine.sqf +++ b/addons/mk6mortar/functions/fnc_canLoadMagazine.sqf @@ -18,19 +18,17 @@ #include "script_component.hpp" params ["_static","_unit",["_magazineClassOptional","",[""]]]; -private ["_canLoadMagazine","_currentMagazine","_weapon","_listOfMagNames", - "_hasCompatibleMagazine","_count"]; if !(alive _static && GVAR(useAmmoHandling)) exitWith {false}; -_canLoadMagazine = false; -_hasCompatibleMagazine = false; +private _canLoadMagazine = false; +private _hasCompatibleMagazine = false; -_currentMagazine = (magazinesAllTurrets _static) select 1; -_weapon = (_static weaponsTurret [0]) select 0; +private _currentMagazine = (magazinesAllTurrets _static) select 1; +private _weapon = (_static weaponsTurret [0]) select 0; -_listOfMagNames = getArray(configFile >> "cfgWeapons" >> _weapon >> "magazines"); -_count = 0; +private _listOfMagNames = getArray(configFile >> "cfgWeapons" >> _weapon >> "magazines"); +private _count = 0; //If function is called with an optional string then check if player has that magzine otherwise check all magazines of the player to see if they are compatible with the static weapon if (_magazineClassOptional != "") then { diff --git a/addons/mk6mortar/functions/fnc_canUnloadMagazine.sqf b/addons/mk6mortar/functions/fnc_canUnloadMagazine.sqf index b1d6593574..ddb0c8d10b 100644 --- a/addons/mk6mortar/functions/fnc_canUnloadMagazine.sqf +++ b/addons/mk6mortar/functions/fnc_canUnloadMagazine.sqf @@ -17,12 +17,11 @@ #include "script_component.hpp" params ["_static","_unit"]; -private ["_canUnloadMagazine","_ammoCount"]; if !(alive _static && GVAR(useAmmoHandling) && _static getVariable [QGVAR(initialized),false]) exitWith {false}; -_canUnloadMagazine = false; +private _canUnloadMagazine = false; -_ammoCount = ((magazinesAllTurrets _static) select 1) select 2; +private _ammoCount = ((magazinesAllTurrets _static) select 1) select 2; if (_ammoCount > 0) then { _canUnloadMagazine = true; }; diff --git a/addons/mk6mortar/functions/fnc_dev_buildTable.sqf b/addons/mk6mortar/functions/fnc_dev_buildTable.sqf index 84184fcb51..6af83c27f2 100644 --- a/addons/mk6mortar/functions/fnc_dev_buildTable.sqf +++ b/addons/mk6mortar/functions/fnc_dev_buildTable.sqf @@ -7,7 +7,7 @@ * 1: Air Friction * * Return Value: - * + * None * * Example: * [100, -0.0001] spawn ace_mk6mortar_fnc_dev_buildTable; //spawn (scheduled) is slower @@ -17,21 +17,18 @@ */ #include "script_component.hpp" - -private ["_muzzleVelocity", "_airFriction", "_stillInRange", "_currentRange", "_increasePerRow", "_outputArray", "_rangeToHit", "_lineElevation", "_lineHeightElevation", "_lineTimeOfFlight", "_lineCrosswindDeg", "_lineHeadwindMeters", "_lineTailWindMeters", "_lineTempDec", "_lineTempInc", "_lineAirDensDec", "_lineAirDensInc", "_result", "_outputString"]; - -_muzzleVelocity = _this select 0; -_airFriction = _this select 1; -_stillInRange = true; -_currentRange = 100; -_increasePerRow = 50; -_outputArray = []; +private _muzzleVelocity = _this select 0; +private _airFriction = _this select 1; +private _stillInRange = true; +private _currentRange = 100; +private _increasePerRow = 50; +private _outputArray = []; //[_rangeToHit, _lineElevation, _lineHeightElevation, _lineHeightTimeDelta, _lineTimeOfFlight, _lineCrosswindDeg, _lineHeadwindMeters, _lineTailWindMeters, _lineTempDec, _lineTempInc, _lineAirDensDec, _lineAirDensInc] while {_stillInRange} do { - _result = [_muzzleVelocity, _currentRange, _airFriction] call FUNC(dev_simulateCalcRangeTableLine); + private _result = [_muzzleVelocity, _currentRange, _airFriction] call FUNC(dev_simulateCalcRangeTableLine); if (_result isEqualTo []) then { _stillInRange = false; } else { @@ -66,7 +63,7 @@ while {_stillInRange} do { }; //handle floating point rounding errors -_outputString = format ["case ((abs(_muzzleVelocity - %1) < 0.00001) && {(abs(_airFriction - %2) < 0.00001)}): { +private _outputString = format ["case ((abs(_muzzleVelocity - %1) < 0.00001) && {(abs(_airFriction - %2) < 0.00001)}): { [ ", _muzzleVelocity, _airFriction]; @@ -84,4 +81,4 @@ _outputString = format ["case ((abs(_muzzleVelocity - %1) < 0.00001) && {(abs(_a copyToClipboard _outputString; rangeTableOutput = _outputString; -hint "done"; \ No newline at end of file +hint "done"; diff --git a/addons/mk6mortar/functions/fnc_dev_formatNumber.sqf b/addons/mk6mortar/functions/fnc_dev_formatNumber.sqf index f89c3a1b8f..713daefbed 100644 --- a/addons/mk6mortar/functions/fnc_dev_formatNumber.sqf +++ b/addons/mk6mortar/functions/fnc_dev_formatNumber.sqf @@ -1,30 +1,26 @@ /* -Author: Pabst Mirror - -Description: -Converts numbers into nicely formated strings. - -Parameters: -0: NUMBER - Input number -1: STRING - Output type (see case statement) -2: BOOL - If output type is mil, convert input type from deg->mil - -Returns: -STRING - Formatted number - -Example: -[45, "mil4", true] call ace_mk6mortar_fnc_dev_formatNumber = "0800" + * Author: Pabst Mirror + * Converts numbers into nicely formated strings. + * + * Arguments: + * 0: Input number + * 1: Output type (see case statement) + * 2: If output type is mil, convert input type from deg->mil + * + * Return Value: + * Formatted number + * + * Example: + * [45, "mil4", true] call ace_mk6mortar_fnc_dev_formatNumber = "0800" + * + * Public: No */ #include "script_component.hpp" -private ["_theNumber", "_inputType", "_convertToMils", "_decimalPlaces", "_integerPlaces", "_prefix", "_return"]; +params ["_theNumber", "_inputType", "_convertToMils"]; -_theNumber = _this select 0; -_inputType = _this select 1; -_convertToMils = _this select 2; - -_decimalPlaces = -1; -_integerPlaces = -1; +private _decimalPlaces = -1; +private _integerPlaces = -1; switch (toLower _inputType) do { case ("meters"): { @@ -73,8 +69,8 @@ case ("sec"): { //CBA_fnc_formatNumber is silly: [-9.58545, 1, 1, false] call CBA_fnc_formatNumber == "-9.-6" -_prefix = if (_theNumber < 0) then {"-"} else {""}; +private _prefix = if (_theNumber < 0) then {"-"} else {""}; -_return = [abs (_theNumber), _integerPlaces, _decimalPlaces, false] call CBA_fnc_formatNumber; +private _return = [abs (_theNumber), _integerPlaces, _decimalPlaces, false] call CBA_fnc_formatNumber; (_prefix + _return) diff --git a/addons/mk6mortar/functions/fnc_dev_simulateCalcRangeTableLine.sqf b/addons/mk6mortar/functions/fnc_dev_simulateCalcRangeTableLine.sqf index d1e0a8dd05..5d83913c3c 100644 --- a/addons/mk6mortar/functions/fnc_dev_simulateCalcRangeTableLine.sqf +++ b/addons/mk6mortar/functions/fnc_dev_simulateCalcRangeTableLine.sqf @@ -1,62 +1,60 @@ /* -Author: Pabst Mirror - -Description: -Builds a rangeTable line for a certian range, given muzzle velocity and air friction, returns [] if out of range. - -Parameters: -0: NUMBER - Muzzle Velocity -1: NUMBER - Air Friction -2: NUMBER - Range To Hit - -Returns: -ARRAY - Range Table Line Data (see return line) - -Example: -[300, -0.0001, 3000] call ace_mk6mortar_fnc_simulateCalcRangeTableLine + * Author: Pabst Mirror + * Builds a rangeTable line for a certian range, given muzzle velocity and air friction, returns [] if out of range. + * + * Arguments: + * 0: Muzzle Velocity + * 1: Air Friction + * 2: Range To Hit + * + * Return Value: + * Range Table Line Data (see return line) + * + * Example: + * [300, -0.0001, 3000] call ace_mk6mortar_fnc_simulateCalcRangeTableLine + * + * Public: No */ #include "script_component.hpp" #define TIME_STEP (1/50) -private ["_startTime", "_muzzleVelocity", "_rangeToHit", "_airFriction", "_vacElevation", "_radicand", "_maxElev", "_minElev", "_error", "_solutionElevation", "_lastTestResult", "_numberOfAttempts", "_lineElevation", "_lineTimeOfFlight", "_lineHeightElevation", "_lineHeightTimeDelta", "_lineCrosswindDeg", "_lineHeadwindMeters", "_lineTailWindMeters", "_result"]; +params ["_muzzleVelocity", "_rangeToHit", "_airFriction"]; + +private _startTime = diag_tickTime; -_startTime = diag_tickTime; -_muzzleVelocity = _this select 0; -_rangeToHit = _this select 1; -_airFriction = _this select 2; //Run Binary search for correct elevation -_solution = [_rangeToHit, 0, _muzzleVelocity, _airFriction, TIME_STEP] call FUNC(dev_simulateFindSolution); +private _solution = [_rangeToHit, 0, _muzzleVelocity, _airFriction, TIME_STEP] call FUNC(dev_simulateFindSolution); if (_solution isEqualTo []) exitWith {[]}; //Real Elevation -_lineElevation = _solution select 0; +private _lineElevation = _solution select 0; //Time Of Flight: -_lineTimeOfFlight = _solution select 1; +private _lineTimeOfFlight = _solution select 1; //Height Adjustment for -100m (another binary search) -_solution = [_rangeToHit, -100, _muzzleVelocity, _airFriction, TIME_STEP] call FUNC(dev_simulateFindSolution); +private _solution = [_rangeToHit, -100, _muzzleVelocity, _airFriction, TIME_STEP] call FUNC(dev_simulateFindSolution); if (_solution isEqualTo []) exitWith {[]};//should never be triggered (lower elevation easier to hit) -_lineHeightElevation = ((_solution select 0) - _lineElevation); -_lineHeightTimeDelta = (_solution select 1) - _lineTimeOfFlight; +private _lineHeightElevation = ((_solution select 0) - _lineElevation); +private _lineHeightTimeDelta = (_solution select 1) - _lineTimeOfFlight; //Compute for 10x and divide to minimize rounding errors //Crosswind -_lastTestResult = [_lineElevation, _muzzleVelocity, _airFriction, 15, 1, 0, 10, 0, TIME_STEP] call FUNC(dev_simulateShot); -_lineCrosswindDeg = (_lastTestResult select 2) / 10; +private _lastTestResult = [_lineElevation, _muzzleVelocity, _airFriction, 15, 1, 0, 10, 0, TIME_STEP] call FUNC(dev_simulateShot); +private _lineCrosswindDeg = (_lastTestResult select 2) / 10; //Headwind: _lastTestResult = [_lineElevation, _muzzleVelocity, _airFriction, 15, 1, -10, 0, 0, TIME_STEP] call FUNC(dev_simulateShot); -_lineHeadwindMeters = (_rangeToHit - (_lastTestResult select 0)) / 10; +private _lineHeadwindMeters = (_rangeToHit - (_lastTestResult select 0)) / 10; //TailWind: _lastTestResult = [_lineElevation, _muzzleVelocity, _airFriction, 15, 1, 10, 0, 0, TIME_STEP] call FUNC(dev_simulateShot); -_lineTailWindMeters = (_rangeToHit - (_lastTestResult select 0)) / 10; +private _lineTailWindMeters = (_rangeToHit - (_lastTestResult select 0)) / 10; //Air Temp Dec _lastTestResult = [_lineElevation, _muzzleVelocity, _airFriction, (15 - 10), 1, 0, 0, 0, TIME_STEP] call FUNC(dev_simulateShot); @@ -68,11 +66,11 @@ _lineTempInc = (_rangeToHit - (_lastTestResult select 0)) / 10; //Air Density Dec _lastTestResult = [_lineElevation, _muzzleVelocity, _airFriction, 15, 0.9, 0, 0, 0, TIME_STEP] call FUNC(dev_simulateShot); -_lineAirDensDec = (_rangeToHit - (_lastTestResult select 0)) / 10; +private _lineAirDensDec = (_rangeToHit - (_lastTestResult select 0)) / 10; //Air Density Inc _lastTestResult = [_lineElevation, _muzzleVelocity, _airFriction, 15, 1.1, 0, 0, 0, TIME_STEP] call FUNC(dev_simulateShot); -_lineAirDensInc = (_rangeToHit - (_lastTestResult select 0)) / 10; +private _lineAirDensInc = (_rangeToHit - (_lastTestResult select 0)) / 10; // systemChat format ["debug: Range %1 - in %2 sec", _rangeToHit, (diag_tickTime - _startTime)]; diff --git a/addons/mk6mortar/functions/fnc_dev_simulateFindSolution.sqf b/addons/mk6mortar/functions/fnc_dev_simulateFindSolution.sqf index d302a40f40..3a91b3cf4a 100644 --- a/addons/mk6mortar/functions/fnc_dev_simulateFindSolution.sqf +++ b/addons/mk6mortar/functions/fnc_dev_simulateFindSolution.sqf @@ -3,14 +3,14 @@ * DEV to find a firing solution for a given range * * Arguments: - * 0: Range to Hit (Meters) - * 1: Height To Hit (Meters) - * 2: Muzzle Velocity (M/S) + * 0: Range to Hit (Meters) + * 1: Height To Hit (Meters) + * 2: Muzzle Velocity (M/S) * 3: Air Friction * 4: Time Step (seconds) (eg 1/50 will simulate 50 cycles per second) * * Return Value: - * ARRAY - [NUMBER - Elevation In Degrees, NUMBER - Shot Durration] + * [NUMBER - Elevation In Degrees, NUMBER - Shot Durration] * * Example: * [_rangeToHit, _heightToHit, _muzzleVelocity, _airFriction, TIME_STEP] call ace_mk6mortar_fnc_dev_simulateFindSolution; @@ -19,23 +19,16 @@ */ #include "script_component.hpp" -private ["_rangeToHit", "_heightToHit", "_muzzleVelocity", "_airFriction", "_maxElev", "_minElev", "_error", "_solutionElevation", "_lastTestResult", "_numberOfAttempts"]; - #define MAX_ATTEMPTS 22 +params ["_rangeToHit", "_heightToHit", "_muzzleVelocity", "_airFriction","_timeStep"]; -_rangeToHit = _this select 0; -_heightToHit = _this select 1; -_muzzleVelocity = _this select 2; -_airFriction = _this select 3; -_timeStep = _this select 4; +private _maxElev = 90; +private _minElev = 45; //todo - Low Angle Howitzers??? -_maxElev = 90; -_minElev = 45; //todo - Low Angle Howitzers??? - -_error = 10000; -_solutionElevation = -1; -_lastTestResult = []; -_numberOfAttempts = 0; +private _error = 10000; +private _solutionElevation = -1; +private _lastTestResult = []; +private _numberOfAttempts = 0; //(binary search) while {(_numberOfAttempts < MAX_ATTEMPTS) && {(abs _error) > 0.2}} do { diff --git a/addons/mk6mortar/functions/fnc_dev_simulateShot.sqf b/addons/mk6mortar/functions/fnc_dev_simulateShot.sqf index 0e53807a6b..fa74c842e1 100644 --- a/addons/mk6mortar/functions/fnc_dev_simulateShot.sqf +++ b/addons/mk6mortar/functions/fnc_dev_simulateShot.sqf @@ -23,35 +23,25 @@ */ #include "script_component.hpp" -private ["_angleDeg", "_muzzleVelocity", "_airFriction", "_temp", "_relDensity", "_tailWind", "_crosswind", "_heightOfTarget", "_timeStep", "_wind", "_gravity", "_currentPos", "_currentVelocity", "_currentTime", "_lastPos", "_kCoefficent", "_aparentWind", "_changeInVelocity", "_linConversion", "_middlePos", "_middlePosOld", "_middleTotalTravelTime", "_offsetDeg"]; +params ["_angleDeg", "_muzzleVelocity", "_airFriction", "_temp", "_relDensity", "_tailWind", "_crosswind", "_heightOfTarget", "_timeStep"]; -_angleDeg = _this select 0; -_muzzleVelocity = _this select 1; -_airFriction = _this select 2; -_temp = _this select 3; -_relDensity = _this select 4; -_tailWind = _this select 5; -_crosswind = _this select 6; -_heightOfTarget = _this select 7; -_timeStep = _this select 8; +private _wind = [_crosswind, _tailWind, 0]; +private _gravity = [0,0,-9.8]; -_wind = [_crosswind, _tailWind, 0]; -_gravity = [0,0,-9.8]; +private _currentPos = [0,0,0]; +private _muzzleVelocity = _muzzleVelocity * (((_temp + 273.13) / 288.13 - 1) / 40 + 1); +private _currentVelocity = [0, (_muzzleVelocity * cos _angleDeg), (_muzzleVelocity * sin _angleDeg)]; -_currentPos = [0,0,0]; -_muzzleVelocity = _muzzleVelocity * (((_temp + 273.13) / 288.13 - 1) / 40 + 1); -_currentVelocity = [0, (_muzzleVelocity * cos _angleDeg), (_muzzleVelocity * sin _angleDeg)]; +private _currentTime = 0; +private _lastPos = _currentPos; -_currentTime = 0; -_lastPos = _currentPos; - -_kCoefficent = -1 * _relDensity * _airFriction; //save time in the loop and compute once +private _kCoefficent = -1 * _relDensity * _airFriction; //save time in the loop and compute once while {((_currentVelocity select 2) > 0) || ((_currentPos select 2) >= _heightOfTarget)} do { _lastPos = _currentPos; - _aparentWind = _wind vectorDiff _currentVelocity; - _changeInVelocity = _gravity vectorAdd (_aparentWind vectorMultiply ((vectorMagnitude _aparentWind) * _kCoefficent)); + private _aparentWind = _wind vectorDiff _currentVelocity; + private _changeInVelocity = _gravity vectorAdd (_aparentWind vectorMultiply ((vectorMagnitude _aparentWind) * _kCoefficent)); _currentVelocity = _currentVelocity vectorAdd (_changeInVelocity vectorMultiply _timeStep); @@ -60,14 +50,14 @@ while {((_currentVelocity select 2) > 0) || ((_currentPos select 2) >= _heightOf }; //Uses linearConversion to get a weighted average betwen points before and after dropping below target height -_linConversion = linearConversion [(_lastPos select 2), (_currentPos select 2), _heightOfTarget, 0, 1, true]; -_middlePos = (_lastPos vectorMultiply (1 - _linConversion)) vectorAdd (_currentPos vectorMultiply (_linConversion)); -// _middlePosOld = (_lastPos vectorAdd _currentPos) vectorMultiply 0.5; +private _linConversion = linearConversion [(_lastPos select 2), (_currentPos select 2), _heightOfTarget, 0, 1, true]; +private _middlePos = (_lastPos vectorMultiply (1 - _linConversion)) vectorAdd (_currentPos vectorMultiply (_linConversion)); +// private _middlePosOld = (_lastPos vectorAdd _currentPos) vectorMultiply 0.5; //Same to find travel time -_middleTotalTravelTime = _currentTime - (_timeStep * (1-_linConversion)); +private _middleTotalTravelTime = _currentTime - (_timeStep * (1-_linConversion)); //Find shot offset (from crosswind), in degrees -_offsetDeg = (_middlePos select 0) aTan2 (_middlePos select 1); +private _offsetDeg = (_middlePos select 0) aTan2 (_middlePos select 1); [(_middlePos select 1), _middleTotalTravelTime, _offsetDeg] diff --git a/addons/mk6mortar/functions/fnc_handleFired.sqf b/addons/mk6mortar/functions/fnc_handleFired.sqf index 483a69d42b..629e66442e 100644 --- a/addons/mk6mortar/functions/fnc_handleFired.sqf +++ b/addons/mk6mortar/functions/fnc_handleFired.sqf @@ -12,7 +12,7 @@ * 6: projectile - Object of the projectile that was shot * * Return Value: - * Nothing + * None * * Example: * [clientFiredBIS-XEH] call ace_mk6mortar_fnc_handleFired @@ -21,7 +21,7 @@ */ #include "script_component.hpp" -PARAMS_7(_vehicle,_weapon,_muzzle,_mode,_ammo,_magazine,_projectile); +params ["_vehicle", "_weapon", "_muzzle", "_mode", "_ammo", "_magazine", "_projectile"]; if (GVAR(useAmmoHandling) && {_vehicle getVariable [QGVAR(initialized),false] && !(_vehicle getVariable [QGVAR(exclude),false])}) then { // if !(_vehicle getVariable [QGVAR(exclude),false]) then { @@ -32,8 +32,6 @@ if (GVAR(useAmmoHandling) && {_vehicle getVariable [QGVAR(initialized),false] && if (!GVAR(airResistanceEnabled)) exitWith {}; -private ["_shooterMan", "_temperature", "_newMuzzleVelocityCoefficent", "_bulletVelocity", "_bulletSpeed"]; - // Large enough distance to not simulate any wind deflection if (_vehicle distance ACE_player > 8000) exitWith {false}; @@ -42,17 +40,17 @@ _shooterMan = gunner _vehicle; if (!([_shooterMan] call EFUNC(common,isPlayer))) exitWith {false}; //Calculate air density: -_altitude = (getPosASL _vehicle) select 2; -_temperature = _altitude call EFUNC(weather,calculateTemperatureAtHeight); -_pressure = _altitude call EFUNC(weather,calculateBarometricPressure); -_relativeHumidity = EGVAR(weather,currentHumidity); -_airDensity = [_temperature, _pressure, _relativeHumidity] call EFUNC(weather,calculateAirDensity); -_relativeDensity = _airDensity / 1.225; +private _altitude = (getPosASL _vehicle) select 2; +private _temperature = _altitude call EFUNC(weather,calculateTemperatureAtHeight); +private _pressure = _altitude call EFUNC(weather,calculateBarometricPressure); +private _relativeHumidity = EGVAR(weather,currentHumidity); +private _airDensity = [_temperature, _pressure, _relativeHumidity] call EFUNC(weather,calculateAirDensity); +private _relativeDensity = _airDensity / 1.225; TRACE_5("FiredWeather",_temperature,_pressure,_relativeHumidity,_airDensity,_relativeDensity); //powder effects: -_newMuzzleVelocityCoefficent = (((_temperature + 273.13) / 288.13 - 1) / 40 + 1); +private _newMuzzleVelocityCoefficent = (((_temperature + 273.13) / 288.13 - 1) / 40 + 1); if (_newMuzzleVelocityCoefficent != 1) then { _bulletVelocity = velocity _projectile; _bulletSpeed = vectorMagnitude _bulletVelocity; @@ -62,26 +60,25 @@ if (_newMuzzleVelocityCoefficent != 1) then { [{ - private ["_deltaT", "_bulletVelocity", "_bulletSpeed", "_trueVelocity", "_trueSpeed", "_dragRef", "_accelRef", "_drag", "_accel"]; - PARAMS_2(_args,_pfID); - EXPLODE_4_PVT(_args,_shell,_airFriction,_time,_relativeDensity); + params ["_args", "_pfID"]; + _args params ["_shell", "_airFriction", "_time", "_relativeDensity"]; if (isNull _shell || {!alive _shell}) exitWith { [_pfID] call CBA_fnc_removePerFrameHandler; }; - _deltaT = CBA_missionTime - _time; + private _deltaT = CBA_missionTime - _time; _args set[2, CBA_missionTime]; - _bulletVelocity = velocity _shell; - _bulletSpeed = vectorMagnitude _bulletVelocity; + private _bulletVelocity = velocity _shell; + private _bulletSpeed = vectorMagnitude _bulletVelocity; - _trueVelocity = _bulletVelocity vectorDiff ACE_wind; - _trueSpeed = vectorMagnitude _trueVelocity; + private _trueVelocity = _bulletVelocity vectorDiff ACE_wind; + private _trueSpeed = vectorMagnitude _trueVelocity; - _drag = _deltaT * _airFriction * _trueSpeed * _relativeDensity; - _accel = _trueVelocity vectorMultiply (_drag); - _bulletVelocity = _bulletVelocity vectorAdd _accel; + private _drag = _deltaT * _airFriction * _trueSpeed * _relativeDensity; + private _accel = _trueVelocity vectorMultiply (_drag); + private _bulletVelocity = _bulletVelocity vectorAdd _accel; _shell setVelocity _bulletVelocity; diff --git a/addons/mk6mortar/functions/fnc_handlePlayerVehicleChanged.sqf b/addons/mk6mortar/functions/fnc_handlePlayerVehicleChanged.sqf index 69a71c63ca..568a1a326e 100644 --- a/addons/mk6mortar/functions/fnc_handlePlayerVehicleChanged.sqf +++ b/addons/mk6mortar/functions/fnc_handlePlayerVehicleChanged.sqf @@ -7,7 +7,7 @@ * 1: New Vehicle * * Return Value: - * No + * None * * Example: * [bob, mortar] call ace_mk6mortar_fnc_handlePlayerVehicleChanged; @@ -45,7 +45,6 @@ if (_lastFireMode != -1) then { }; [{ - private ["_chargeText", "_currentChargeMode", "_currentFireMode", "_display", "_elevDeg", "_elevationDiff", "_lookVector", "_notGunnerView", "_realAzimuth", "_realElevation", "_upVectorDir", "_useMils", "_weaponDir"]; params ["_args", "_pfID"]; _args params ["_mortarVeh", "_fireModes"]; @@ -53,11 +52,11 @@ if (_lastFireMode != -1) then { [_pfID] call CBA_fnc_removePerFrameHandler; } else { - _useMils = _mortarVeh getVariable [QGVAR(useMils), true]; + private _useMils = _mortarVeh getVariable [QGVAR(useMils), true]; //Compute: 'charge' from weaponstate - _currentFireMode = (weaponState [_mortarVeh, [0]]) select 2; - _currentChargeMode = _fireModes find _currentFireMode; + private _currentFireMode = (weaponState [_mortarVeh, [0]]) select 2; + private _currentChargeMode = _fireModes find _currentFireMode; //Save firemode on vehicle: _mortarVeh setVariable [QGVAR(lastFireMode), _currentChargeMode]; @@ -68,41 +67,41 @@ if (_lastFireMode != -1) then { [parseText "Computer Disabled"] call EFUNC(common,displayTextStructured); }; - _display = uiNamespace getVariable ["ACE_Mk6_RscWeaponRangeArtillery", displayNull]; + private _display = uiNamespace getVariable ["ACE_Mk6_RscWeaponRangeArtillery", displayNull]; if (isNull _display) exitWith {}; //It may be null for the first frame - _chargeText = format ["%1: %2 ", (localize LSTRING(rangetable_charge)), _currentChargeMode, QPATHTOF(UI\ui_charges.paa)]; + private _chargeText = format ["%1: %2 ", (localize LSTRING(rangetable_charge)), _currentChargeMode, QPATHTOF(UI\ui_charges.paa)]; //Hud should hidden in 3rd person - _notGunnerView = cameraView != "GUNNER"; + private _notGunnerView = cameraView != "GUNNER"; //Calc real azimuth/elevation //(looking at the sky VS looking at ground will radicaly change fire direction because BIS) - _realAzimuth = -1; - _realElevation = -1; + private _realAzimuth = -1; + private _realElevation = -1; private _useRealWeaponDir = (ctrlText (_display displayCtrl 173)) == "--"; if (_useRealWeaponDir && {(_mortarVeh ammo (currentWeapon _mortarVeh)) == 0}) then { // With no ammo, distance display will be empty, but gun will still fire at wonky angle if aimed at ground private _testSeekerPosASL = AGLtoASL (positionCameraToWorld [0,0,0]); private _testSeekerDir = _testSeekerPosASL vectorFromTo (AGLtoASL (positionCameraToWorld [0,0,1])); - private _laserRange = [_testSeekerPosASL, _testSeekerDir, _mortarVeh] call EFUNC(laser,shootRay); - _laserRange params ["", ["_rayDistance", -5]]; // ToDo: move shootRay to common - TRACE_2("",_rayDistance,viewDistance); - _useRealWeaponDir = _rayDistance > viewDistance; // If we are looking at infinity (based on viewDistance) + private _testPoint = _testSeekerPosASL vectorAdd (_testSeekerDir vectorMultiply viewDistance); + if ((terrainIntersectASL [_testSeekerPosASL, _testPoint]) || {lineIntersects [_testSeekerPosASL, _testPoint]}) then { + _useRealWeaponDir = false; // If we are not looking at infinity (based on viewDistance) + }; }; if (_useRealWeaponDir) then { //No range (looking at sky), it will follow weaponDir: - _weaponDir = _mortarVeh weaponDirection (currentWeapon _mortarVeh); + private _weaponDir = _mortarVeh weaponDirection (currentWeapon _mortarVeh); _realAzimuth = (_weaponDir select 0) atan2 (_weaponDir select 1); _realElevation = asin (_weaponDir select 2); } else { //Valid range, will fire at camera dir - _lookVector = ((positionCameraToWorld [0,0,0]) call EFUNC(common,positionToASL)) vectorFromTo ((positionCameraToWorld [0,0,10]) call EFUNC(common,positionToASL)); + private _lookVector = ((positionCameraToWorld [0,0,0]) call EFUNC(common,positionToASL)) vectorFromTo ((positionCameraToWorld [0,0,10]) call EFUNC(common,positionToASL)); _realAzimuth = ((_lookVector select 0) atan2 (_lookVector select 1)); - _upVectorDir = (((vectorUp _mortarVeh) select 0) atan2 ((vectorUp _mortarVeh) select 1)); - _elevationDiff = (cos (_realAzimuth - _upVectorDir)) * acos ((vectorUp _mortarVeh) select 2); + private _upVectorDir = (((vectorUp _mortarVeh) select 0) atan2 ((vectorUp _mortarVeh) select 1)); + private _elevationDiff = (cos (_realAzimuth - _upVectorDir)) * acos ((vectorUp _mortarVeh) select 2); _realElevation = ((180 / PI) * (_mortarVeh animationPhase "mainGun")) + 75 - _elevationDiff; }; @@ -135,7 +134,7 @@ if (_lastFireMode != -1) then { if (_notGunnerView || (!GVAR(allowComputerRangefinder))) then { (_display displayCtrl 80176) ctrlSetText ""; } else { - _elevDeg = parseNumber ctrlText (_display displayCtrl 176); + private _elevDeg = parseNumber ctrlText (_display displayCtrl 176); if (_elevDeg <= 0) then { //Bad data means "----" out of range (_display displayCtrl 80176) ctrlSetText (ctrlText (_display displayCtrl 176)); } else { diff --git a/addons/mk6mortar/functions/fnc_loadMagazine.sqf b/addons/mk6mortar/functions/fnc_loadMagazine.sqf index 37fa2f4db4..df92c820cd 100644 --- a/addons/mk6mortar/functions/fnc_loadMagazine.sqf +++ b/addons/mk6mortar/functions/fnc_loadMagazine.sqf @@ -18,8 +18,6 @@ #include "script_component.hpp" params ["_static","_unit",["_magazineClassOptional","",[""]]]; -private ["_weapon","_currentMagazine","_count","_magazines","_magazineDetails","_listOfMagNames", - "_magazineClass","_magazineClassDetails","_parsed","_roundsLeft"]; //If function has been called with an optional classname hten add that magazine to the static weapon. Otherwise add the compatible magazine if(_magazineClassOptional != "") then { @@ -27,20 +25,19 @@ if(_magazineClassOptional != "") then { [QGVAR(addMagazine), [_static, _magazineClassOptional]] call CBA_fnc_globalEvent; } else { //Get weapon & magazine information of static weapon - _weapon = (_static weaponsTurret [0]) select 0; - _currentMagazine = (magazinesAllTurrets _static) select 1; - _currentMagazineClass = _currentMagazine select 0; - _count = _currentMagazine select 2; + private _weapon = (_static weaponsTurret [0]) select 0; + private _currentMagazine = (magazinesAllTurrets _static) select 1; + private _currentMagazineClass = _currentMagazine select 0; + private _count = _currentMagazine select 2; //Check all of the players magazines to see if they are compatible with the static weapon. First magazine that is compatible is chosen //VKing: This section ought to be double checked. - _magazines = magazines _unit; - _magazineDetails = magazinesDetail _unit; - _listOfMagNames = getArray(configFile >> "cfgWeapons" >> _weapon >> "magazines"); - _magazineClass = ""; - _magazineClassDetails = ""; - _parsed =""; - _roundsLeft = 0; + private _magazines = magazines _unit; + private _magazineDetails = magazinesDetail _unit; + private _listOfMagNames = getArray(configFile >> "cfgWeapons" >> _weapon >> "magazines"); + private _magazineClass = ""; + private _magazineClassDetails = ""; + private _roundsLeft = 0; { if (_x in _listOfMagNames) exitWith { _magazineClass = _x; @@ -53,7 +50,7 @@ if(_magazineClassOptional != "") then { }; //Find out the ammo count of the compatible magazine found if (_magazineClassDetails != "") then{ - _parsed = _magazineClassDetails splitString "([]/: )"; + private _parsed = _magazineClassDetails splitString "([]/: )"; _parsed params ["_type", "", "", "_roundsLeftText", "_maxRoundsText"]; _roundsLeft = parseNumber _roundsLeftText; _magType = _type; diff --git a/addons/mk6mortar/functions/fnc_loadMagazineTimer.sqf b/addons/mk6mortar/functions/fnc_loadMagazineTimer.sqf index 16016f06e6..fa0adb28d0 100644 --- a/addons/mk6mortar/functions/fnc_loadMagazineTimer.sqf +++ b/addons/mk6mortar/functions/fnc_loadMagazineTimer.sqf @@ -1,12 +1,12 @@ /* * Author: Grey - * Loads Magazine into static weapon using a timer + * Loads Magazine into static weapon using a timer. * * Arguments: - * 0: static - * 1: unit - * 2: time to load - * 3: magazineClassOptional + * 0: Static + * 1: Unit + * 2: Time to load + * 3: Magazine Class (default: "") * * Return Value: * None @@ -20,7 +20,7 @@ params ["_static","_unit","_timeToLoad",["_magazineClassOptional","",[""]]]; -//Move player into animation if player is standing +// Move player into animation if player is standing if ((_unit call CBA_fnc_getUnitAnim) select 0 == "stand") then { [_unit, "AmovPercMstpSrasWrflDnon_diary", 1] call EFUNC(common,doAnimation); }; diff --git a/addons/mk6mortar/functions/fnc_moduleInit.sqf b/addons/mk6mortar/functions/fnc_moduleInit.sqf index 3dedbb2c9e..808fd576b1 100644 --- a/addons/mk6mortar/functions/fnc_moduleInit.sqf +++ b/addons/mk6mortar/functions/fnc_moduleInit.sqf @@ -17,7 +17,7 @@ */ #include "script_component.hpp" -PARAMS_3(_logic,_syncedUnits,_activated); +params ["_logic", "_syncedUnits", "_activated"]; if (!_activated) exitWith {WARNING("Module - placed but not active");}; if (!isServer) exitWith {}; diff --git a/addons/mk6mortar/functions/fnc_rangeTableCanUse.sqf b/addons/mk6mortar/functions/fnc_rangeTableCanUse.sqf index 1a3301d779..b98ee543f5 100644 --- a/addons/mk6mortar/functions/fnc_rangeTableCanUse.sqf +++ b/addons/mk6mortar/functions/fnc_rangeTableCanUse.sqf @@ -16,6 +16,6 @@ */ #include "script_component.hpp" -PARAMS_2(_vehicle,_player); +params ["_vehicle", "_player"]; "ACE_RangeTable_82mm" in (items _player); diff --git a/addons/mk6mortar/functions/fnc_rangeTableOpen.sqf b/addons/mk6mortar/functions/fnc_rangeTableOpen.sqf index 07e0536d24..688253038c 100644 --- a/addons/mk6mortar/functions/fnc_rangeTableOpen.sqf +++ b/addons/mk6mortar/functions/fnc_rangeTableOpen.sqf @@ -3,10 +3,10 @@ * Opens the rangetable and fills the charge listbox. * * Arguments: - * No + * None * * Return Value: - * No + * None * * Example: * [] call ace_mk6mortar_fnc_rangeTableOpen @@ -17,28 +17,26 @@ #define LIST_CHARGE ((uiNamespace getVariable "ACE_82mm_RangeTable_Dialog") displayCtrl 1501) -private ["_weaponName", "_magazines", "_initSpeed", "_fireModes", "_muzzleVelocities", "_showToPlayer", "_artilleryCharge"]; - -_weaponName = "mortar_82mm"; //todo: work on other weapons +private _weaponName = "mortar_82mm"; //todo: work on other weapons createDialog "ACE_82mm_RangeTable_Dialog"; if (isNull (uiNamespace getVariable ["ACE_82mm_RangeTable_Dialog", displayNull])) exitWith {ERROR("Dialog failed to open");}; //Get Magazine Types -_magazines = getArray (configFile >> "CfgWeapons" >> _weaponName >> "magazines"); +private _magazines = getArray (configFile >> "CfgWeapons" >> _weaponName >> "magazines"); //For now just get settings from first mag, all rounds have same flight characteristics: if ((count _magazines) < 1) exitWith {ERROR("No Magazines for weapon");}; -_initSpeed = getNumber (configFile >> "CfgMagazines" >> (_magazines select 0) >> "initSpeed"); +private _initSpeed = getNumber (configFile >> "CfgMagazines" >> (_magazines select 0) >> "initSpeed"); //Get Charge Modes -_fireModes = getArray (configFile >> "CfgWeapons" >> _weaponName >> "modes"); +private _fireModes = getArray (configFile >> "CfgWeapons" >> _weaponName >> "modes"); -_muzzleVelocities = []; +private _muzzleVelocities = []; { - _showToPlayer = getNumber (configFile >> "CfgWeapons" >> _weaponName >> _x >> "showToPlayer"); + private _showToPlayer = getNumber (configFile >> "CfgWeapons" >> _weaponName >> _x >> "showToPlayer"); if (_showToPlayer == 1) then { - _artilleryCharge = getNumber (configFile >> "CfgWeapons" >> _weaponName >> _x >> "artilleryCharge"); + private _artilleryCharge = getNumber (configFile >> "CfgWeapons" >> _weaponName >> _x >> "artilleryCharge"); LIST_CHARGE lbAdd format ["%1: %2", (localize LSTRING(rangetable_charge)), (count _muzzleVelocities)]; LIST_CHARGE lbSetData [(count _muzzleVelocities), str (_artilleryCharge * _initSpeed)]; _muzzleVelocities pushBack _artilleryCharge; diff --git a/addons/mk6mortar/functions/fnc_rangeTablePageChange.sqf b/addons/mk6mortar/functions/fnc_rangeTablePageChange.sqf index c0cc40ccdc..e78fc40574 100644 --- a/addons/mk6mortar/functions/fnc_rangeTablePageChange.sqf +++ b/addons/mk6mortar/functions/fnc_rangeTablePageChange.sqf @@ -3,10 +3,10 @@ * Called when listbox selection changes. Updates the rangetable with new values. * * Arguments: - * No + * None * * Return Value: - * No + * None * * Example: * [] call ace_mk6mortar_fnc_rangeTablePageChange @@ -18,15 +18,13 @@ #define RANGE_TABLE ((uiNamespace getVariable "ACE_82mm_RangeTable_Dialog") displayCtrl 20001) #define LIST_CHARGE ((uiNamespace getVariable "ACE_82mm_RangeTable_Dialog") displayCtrl 1501) -private ["_listBoxData", "_muzzleVelocity", "_airFriction", "_precalcArray"]; - -_listBoxData = LIST_CHARGE lbData (lbCurSel LIST_CHARGE); +private _listBoxData = LIST_CHARGE lbData (lbCurSel LIST_CHARGE); if (isNil "_listBoxData" || {_listBoxData == ""}) exitWith {ERROR("lbCurSel out of bounds or no data");}; -_muzzleVelocity = parseNumber _listBoxData; +private _muzzleVelocity = parseNumber _listBoxData; -_airFriction = if (GVAR(airResistanceEnabled)) then {MK6_82mm_AIR_FRICTION} else {0}; +private _airFriction = if (GVAR(airResistanceEnabled)) then {MK6_82mm_AIR_FRICTION} else {0}; -_precalcArray = [_muzzleVelocity, _airFriction] call FUNC(rangeTablePreCalculatedValues); +private _precalcArray = [_muzzleVelocity, _airFriction] call FUNC(rangeTablePreCalculatedValues); lnbClear RANGE_TABLE; { diff --git a/addons/mk6mortar/functions/fnc_rangeTablePreCalculatedValues.sqf b/addons/mk6mortar/functions/fnc_rangeTablePreCalculatedValues.sqf index db87cb6000..a288ee03f9 100644 --- a/addons/mk6mortar/functions/fnc_rangeTablePreCalculatedValues.sqf +++ b/addons/mk6mortar/functions/fnc_rangeTablePreCalculatedValues.sqf @@ -8,7 +8,7 @@ * 1: Air Friction * * Return Value: - * + * Array * * Example: * [200, 0] call ace_mk6mortar_fnc_rangeTablePreCalculatedValues @@ -17,7 +17,7 @@ */ #include "script_component.hpp" -PARAMS_2(_muzzleVelocity,_airFriction); +params ["_muzzleVelocity", "_airFriction"]; switch (true) do { @@ -268,4 +268,4 @@ case ((abs(_muzzleVelocity - 200) < 0.00001) && {(abs(_airFriction - 0) < 0.0000 ERROR("MuzzleVelocity not found in LUT"); [] }; -}; \ No newline at end of file +}; diff --git a/addons/mk6mortar/functions/fnc_toggleMils.sqf b/addons/mk6mortar/functions/fnc_toggleMils.sqf index 5c27bf64e4..cd2c7cf76f 100644 --- a/addons/mk6mortar/functions/fnc_toggleMils.sqf +++ b/addons/mk6mortar/functions/fnc_toggleMils.sqf @@ -7,7 +7,7 @@ * 1: Player * * Return Value: - * No + * None * * Example: * [mortar,bob] call ace_mk6mortar_fnc_toggleMils; @@ -16,7 +16,7 @@ */ #include "script_component.hpp" -PARAMS_2(_mortarVeh,_unit); +params ["_mortarVeh", "_unit"]; private _currentSetting = _mortarVeh getVariable [QGVAR(useMils), true]; _mortarVeh setVariable [QGVAR(useMils), (!_currentSetting)]; diff --git a/addons/mk6mortar/functions/fnc_turretDisplayLoaded.sqf b/addons/mk6mortar/functions/fnc_turretDisplayLoaded.sqf index da7a529d86..924b00a90e 100644 --- a/addons/mk6mortar/functions/fnc_turretDisplayLoaded.sqf +++ b/addons/mk6mortar/functions/fnc_turretDisplayLoaded.sqf @@ -24,8 +24,6 @@ TRACE_2("params",_display,_rscType); if (_rscType != "Mk6Mortar") exitWith {}; if (isNull _display) exitWith {}; -private ["_fnc_hideControl", "_xPos", "_yPos", "_wPos", "_hPos"]; - #define CTRL_CA_OPTICSPITCH (configFile >> "RscInGameUI" >> "ACE_Mk6_RscWeaponRangeArtillery" >> "CA_IGUI_elements_group" >> "controls" >> "CA_OPTICSPITCH") #define CTRL_CA_OPTICSZOOM (configFile >> "RscInGameUI" >> "ACE_Mk6_RscWeaponRangeArtillery" >> "CA_IGUI_elements_group" >> "controls" >> "CA_OPTICSZOOM") #define CTRL_CA_SOLUTION_TEXT (configFile >> "RscInGameUI" >> "ACE_Mk6_RscWeaponRangeArtillery" >> "CA_IGUI_elements_group" >> "controls" >> "CA_SOLUTION_TEXT") @@ -40,11 +38,10 @@ private ["_fnc_hideControl", "_xPos", "_yPos", "_wPos", "_hPos"]; #define CTRL_CA_ELEV (configFile >> "RscInGameUI" >> "ACE_Mk6_RscWeaponRangeArtillery" >> "CA_IGUI_elements_group" >> "controls" >> "CA_ELEV") #define CTRL_CA_ELEV_NEED (configFile >> "RscInGameUI" >> "ACE_Mk6_RscWeaponRangeArtillery" >> "CA_IGUI_elements_group" >> "controls" >> "CA_ELEV_NEED") -_fnc_hideControl = { - private ["_idc", "_pos"]; - PARAMS_2(_path,_hideCtrl); - _idc = getNumber (_path >> "IDC"); - _pos = []; +private _fnc_hideControl = { + params ["_path", "_hideCtrl"]; + private _idc = getNumber (_path >> "IDC"); + private _pos = []; if (_hideCtrl) then { _pos = [-9,-9,0,0]; } else { diff --git a/addons/mk6mortar/functions/fnc_unloadMagazine.sqf b/addons/mk6mortar/functions/fnc_unloadMagazine.sqf index c485a39a3a..9aa0fa0437 100644 --- a/addons/mk6mortar/functions/fnc_unloadMagazine.sqf +++ b/addons/mk6mortar/functions/fnc_unloadMagazine.sqf @@ -18,12 +18,11 @@ #include "script_component.hpp" params ["_static","_unit"]; -private ["_currentMagazine","_currentMagazineClass","_ammoCount"]; //Get weapon & magazine information about static weapon -_currentMagazine = (magazinesAllTurrets _static) select 1; -_currentMagazineClass = _currentMagazine select 0; -_ammoCount = _currentMagazine select 2; +private _currentMagazine = (magazinesAllTurrets _static) select 1; +private _currentMagazineClass = _currentMagazine select 0; +private _ammoCount = _currentMagazine select 2; // Try to add the round to player inventory, otherwise place it on the ground near the player if (_ammoCount > 0) then { diff --git a/addons/mk6mortar/stringtable.xml b/addons/mk6mortar/stringtable.xml index 5328ca9a10..986eadb3d3 100644 --- a/addons/mk6mortar/stringtable.xml +++ b/addons/mk6mortar/stringtable.xml @@ -13,6 +13,9 @@ 82mm Rangetable Tavola di tiro 82mm 82mm 射表 + 82mm 사거리표 + 82mm迫击炮射表 + 82mm迫擊炮射表 Range Table for the Mk6 82mm Mortar @@ -26,6 +29,9 @@ Rangetable pro Mk6 82mm minomet Tavola di tiro per il mortaio calibro 82mm Mk6 Mk6 82mm 迫撃砲の射表 + Mk6 82mm 박격포 사격을 위한 사거리표 + MK6 82mm迫击炮射表 + MK6 82mm迫擊炮射表 Open 82mm Rangetable @@ -39,6 +45,9 @@ Otevřít 82mm Rangetable Apri la tavola di tiro 82mm 82mm 射表を開く + 82mm 사거리표 열기 + 开启82mm迫击炮射表 + 開啟82mm迫擊炮射表 Charge @@ -52,6 +61,9 @@ Charge Carica 装薬 + 장약 + 装药 + 裝藥 Mk6 Settings @@ -65,6 +77,9 @@ Настройки Mk6 Impostazioni Mk6 Mk6 設定 + Mk6 설정 + MK6设定 + MK6設定 Air Resistance @@ -78,6 +93,9 @@ Сопротивление воздуха Resistenza dell'Aria 空気抵抗 + 공기저항 + 空气阻力 + 空氣阻力 For Player Shots, Model Air Resistance and Wind Effects @@ -91,6 +109,9 @@ Для выстрелов игрока. Моделирует сопротивление воздуха и эффект ветра Per Proiettili dei Giocatori, simula la Resistenza dell'Aria e gli Effetti del Vento プレイヤが射撃すると、空気抵抗モデルと風による影響をあたえます。 + 플레이어 사격시 공기저항과 바람에 영향을 받습니다 + 设定由玩家射击的迫击炮,将会受到空气阻力与风力的影响 + 設定由玩家射擊的迫擊砲,將會受到空氣阻力與風力的影響 Allow Mk6 Computer @@ -104,6 +125,9 @@ Разрешить компьютер Mk6 Consenti Computer Mk6 Mk6 コンピュータを許可 + Mk6 탄도계산컴퓨터 허가 + 允许使用MK6射控电脑 + 允許使用MK6射控電腦 Show the Computer and Rangefinder (these NEED to be removed if you enable air resistance) @@ -117,6 +141,9 @@ Показывает компьютер и дальномер (это НУЖНО отключить, если вы включаете сопротивление воздуха) Mostra il Computer e Distaziometro (questi DEVONO essere rimossi se vuoi abilitare la resistenza dell'aria) コンピュータと距離を表示します (空気抵抗を有効化している場合は必ず削除してください) + 탄도계산컴퓨터와 거리측정기를 보여줍니다(공기저항을 활성화했을경우 이 항목은 비활성화 되어야만 합니다) + 显示射控电脑和测距仪 (如果有启用空气阻力功能时,须停用此项功能) + 顯示射控電腦和測距儀 (如果有啟用空氣阻力功能時,須停用此項功能) Allow Mk6 Compass @@ -130,6 +157,9 @@ Разрешить компас Mk6 Consenti Bussola Mk6 Mk6 への方位磁石を有効化 + Mk6 나침반 허용 + 允许使用MK6指北针 + 允許使用MK6指北針 Show the Mk6 Digital Compass @@ -143,6 +173,9 @@ Показывает цифровой компас Mk6 Mostra la Bussola Digitale Mk6 Mk6 のデジタル方位磁石を表示 + Mk6 에서 전자 나침반을 보여줍니다 + 显示MK6的数位指北针 + 顯示MK6的數位指北針 This module allows you to setup Mk6 mortar settings. @@ -155,6 +188,9 @@ Questo modulo ti consente di impostare i parametri del mortaio Mk6. Este módulo permite configurar los parámetros del mortero Mk6. Mk6 迫撃砲への設定をできます。 + 이 모듈은 Mk6 설치 설정을 가능케 합니다. + 这个模块允许你设定MK6迫击炮的相关功能 + 這個模塊允許你設定MK6迫擊砲的相關功能 Use Ammunition handling @@ -166,6 +202,9 @@ Usar manejo de munição Использовать манипуляции с боеприпасами 弾薬の取り扱い + 탄약 관리 활성화 + 使用手动弹药装卸 + 使用手動彈藥裝卸 Removes mortar magazines, requiring individual rounds to be loaded by the gunner or loader. Does not affect AI mortars. @@ -177,6 +216,9 @@ Elimina os carregadores do morteiro, requerendo que o atirador ou carregador utilize de forma individual a munição. Não afeta os morteiros controlados pela IA. Удаляет артиллерийские магазины, требует загрузку отдельных снарядов стрелком или заряжащим. Не влияет на артиллерию ИИ. 迫撃砲から弾薬を除去します。射手か装填手により予め装填されている必要があります。AI 迫撃砲へ影響を与えません。 + 박격포 탄창을 제거합니다, 사수나 장전수가 개별적으로 탄환을 넣어줘야만 합니다. 인공지능은 영향을 받지 않습니다. + 开启此功能时。迫击炮的弹药需由炮手与装填手共同合作来进行装填。此功能并不影响由AI射击的迫击炮 + 開啟此功能時。迫擊砲的彈藥需由砲手與裝填手共同合作來進行裝填。此功能並不影響由AI射擊的迫擊砲 Remove Round @@ -189,6 +231,9 @@ Remover munição Извлечь снаряд 弾薬を除去 + 탄약 제거 + 卸除弹头 + 卸除彈頭 Load Mortar @@ -201,6 +246,9 @@ Carregar morteiro Зарядить миномет 弾薬を装填 + 탄약 장전 + 装载弹头 + 裝載彈頭 Unloading Round @@ -212,6 +260,9 @@ Descarregar munição Извлечение снаряда 弾薬を除去しています + 탄약 제거중 + 卸除弹头中 + 卸除彈頭中 Preparing Round @@ -224,6 +275,9 @@ Preparar munição Подготовка снаряда 事前に装填 + 탄약 준비중 + 准备弹头中 + 準備彈頭中 Load HE @@ -236,6 +290,9 @@ Carregar HE Зарядить фугасный りゅう弾を装填 + 고폭탄 장전 + 装载高爆弹 + 裝載高爆彈 Load Smoke @@ -248,6 +305,9 @@ Carregar Fumaça Зарядить дымовой 煙幕弾を装填 + 연막탄 장전 + 装载烟雾弹 + 裝載煙霧彈 Load Illumination @@ -260,6 +320,9 @@ Carregar Iluminação Зарядить осветительный 照明弾を装填 + 조명탄 장전 + 装载照明弹 + 裝載照明彈 Load Guided HE @@ -272,6 +335,9 @@ Carregar HE Guiada Зарядить фугасный управляемый 誘導りゅう弾を装填 + 유도 고폭탄 장전 + 装载导引高爆弹 + 裝載導引高爆彈 Load Laser Guided HE @@ -284,6 +350,9 @@ Carregar HE Guiada por Laser Зарядить фугасный управляемый по ЛЦУ レーザ誘導りゅう弾を装填 + 레이저 유도 고폭탄 장전 + 装载雷射导引高爆弹 + 裝載雷射導引高爆彈 82mm HE Round @@ -296,6 +365,9 @@ Munição 82mm HE Фугасный снаряд 82мм 82mm りゅう弾 + 82mm 고폭탄 + 82mm高爆弹 + 82mm高爆彈 82mm Smoke Round @@ -308,6 +380,9 @@ Munição 82mm Fumaça Дымовой снаряд 82мм 82mm 煙幕弾 + 82mm 연막탄 + 82mm烟雾弹 + 82mm煙霧彈 82mm Illumination Round @@ -320,6 +395,9 @@ Munição 82mm Iluminação Осветительный снаряд 82мм 82mm 照明弾 + 82mm 조명탄 + 82mm照明弹 + 82mm照明彈 82mm Guided HE Round @@ -332,6 +410,9 @@ Munição 82mm HE Guiada Фугасный снаряд управляемый 82мм 82mm 誘導りゅう弾 + 82mm 유도 고폭탄 + 82mm导引高爆弹 + 82mm導引高爆彈 82mm Laser Guided HE Round @@ -344,6 +425,9 @@ Munição 82mm HE Guiada por Laser Фугасный снаряд управляемый по ЛЦУ 82мм 82mm レーザ誘導りゅう弾 + 82mm 레이저 유도 고폭탄 + 82mm雷射导引高爆弹 + 82mm雷射導引高爆彈 Used in Mk6 mortar @@ -356,6 +440,9 @@ Usada no Morteiro MK6 Использовался в миномете Mk6 Mk6 mortar で使います + Mk6 박격포에 사용됨 + 用于Mk6迫击炮 + 用於Mk6迫擊砲 [ACE] 82mm HE Rounds Box @@ -368,6 +455,9 @@ [ACE] Caixa de Munição 82mm HE [ACE] Ящик фугасных снарядов 82мм [ACE] 82mm りゅう弾入り弾薬箱 + [ACE] 82mm 고폭탄 상자 + [ACE] 82mm高爆弹药箱 + [ACE] 82mm高爆彈藥箱 [ACE] 82mm Smoke Rounds Box @@ -380,6 +470,9 @@ [ACE] Caixa de Munição 82mm Fumaça [ACE] Ящик дымовых снарядов 82мм [ACE] 82mm 煙幕弾入り弾薬箱 + [ACE] 82mm 연막탄 상자 + [ACE] 82mm烟雾弹药箱 + [ACE] 82mm煙霧彈藥箱 [ACE] 82mm Illumination Rounds Box @@ -392,6 +485,9 @@ [ACE] Caixa de Munição 82mm Iluminação [ACE] Ящик осветительных снарядов 82мм [ACE] 82mm 照明弾入り弾薬箱 + [ACE] 82mm 조명탄 상자 + [ACE] 82mm照明弹药箱 + [ACE] 82mm照明彈藥箱 [ACE] 82mm Default Loadout Box @@ -404,6 +500,9 @@ [ACE] Caixa de Munição 82mm Padrão [ACE] Ящик снарядов 82мм (стандартный) [ACE] 82mm 梱包箱 + [ACE] 82mm 기본 장비 상자 + [ACE] 82mm预设弹药箱 + [ACE] 82mm預設彈藥箱 - \ No newline at end of file + diff --git a/addons/modules/CfgEventHandlers.hpp b/addons/modules/CfgEventHandlers.hpp index cd12d1938e..dc1da95f37 100644 --- a/addons/modules/CfgEventHandlers.hpp +++ b/addons/modules/CfgEventHandlers.hpp @@ -1,4 +1,3 @@ - class Extended_PreStart_EventHandlers { class ADDON { init = QUOTE(call COMPILE_FILE(XEH_preStart)); @@ -11,7 +10,6 @@ class Extended_PreInit_EventHandlers { }; }; - class Extended_PostInit_EventHandlers { class _ACE_modules { // using a _ so it is the first postInit to be executed init = QUOTE(call COMPILE_FILE(XEH_postInit)); diff --git a/addons/modules/XEH_PREP.hpp b/addons/modules/XEH_PREP.hpp index 66edc4e817..ab0c69eab9 100644 --- a/addons/modules/XEH_PREP.hpp +++ b/addons/modules/XEH_PREP.hpp @@ -1,2 +1 @@ - PREP(moduleInit); diff --git a/addons/modules/XEH_postInit.sqf b/addons/modules/XEH_postInit.sqf index 25049d60a3..dcd6277aed 100644 --- a/addons/modules/XEH_postInit.sqf +++ b/addons/modules/XEH_postInit.sqf @@ -1,4 +1,3 @@ - #include "script_component.hpp" [QEGVAR(common,initSettingsFromModules), { @@ -10,7 +9,7 @@ [_x] call { params ["_logic"]; private _logicType = typeOf _logic; - _logic hideobject true; + _logic hideObject true; if (_logic getVariable [QGVAR(initalized), false]) exitWith {}; private _config = (configFile >> "CfgVehicles" >> _logicType); @@ -18,7 +17,7 @@ private _isGlobal = getNumber (_config >> "isGlobal") > 0; private _isDisposable = getNumber (_config >> "isDisposable") > 0; - private _isPersistent = getNumber (_config >> "isPersistent") > 0 || getnumber (_config >> "isGlobal") > 1; + 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 { diff --git a/addons/modules/XEH_preInit.sqf b/addons/modules/XEH_preInit.sqf index 419cd902b5..cb884af1f5 100644 --- a/addons/modules/XEH_preInit.sqf +++ b/addons/modules/XEH_preInit.sqf @@ -2,7 +2,9 @@ ADDON = false; +PREP_RECOMPILE_START; #include "XEH_PREP.hpp" +PREP_RECOMPILE_END; GVAR(moduleInitCollection) = []; diff --git a/addons/modules/config.cpp b/addons/modules/config.cpp index 662b1cb349..6475b90cf4 100644 --- a/addons/modules/config.cpp +++ b/addons/modules/config.cpp @@ -14,6 +14,7 @@ class CfgPatches { }; }; +class CBA_Extended_EventHandlers; class CfgVehicles { class Logic; class Module_F: Logic { @@ -23,6 +24,7 @@ class CfgVehicles { class ACE_Module: Module_F { class EventHandlers { init = QUOTE(_this call DFUNC(moduleInit)); + class CBA_Extended_EventHandlers: CBA_Extended_EventHandlers {}; }; }; }; diff --git a/addons/modules/functions/fnc_moduleInit.sqf b/addons/modules/functions/fnc_moduleInit.sqf index 5d42b4fa87..e4ab737db3 100644 --- a/addons/modules/functions/fnc_moduleInit.sqf +++ b/addons/modules/functions/fnc_moduleInit.sqf @@ -7,7 +7,10 @@ * * * Return Value: - * nil + * None + * + * Example: + * [LOGIC] call ace_modules_fnc_moduleInit * * Public: No */ diff --git a/addons/movement/XEH_preInit.sqf b/addons/movement/XEH_preInit.sqf index a7feade1c3..b47cf6628d 100644 --- a/addons/movement/XEH_preInit.sqf +++ b/addons/movement/XEH_preInit.sqf @@ -2,6 +2,8 @@ ADDON = false; +PREP_RECOMPILE_START; #include "XEH_PREP.hpp" +PREP_RECOMPILE_END; ADDON = true; diff --git a/addons/movement/functions/fnc_addLoadToUnitContainer.sqf b/addons/movement/functions/fnc_addLoadToUnitContainer.sqf index a79b2ab917..fa788c92a2 100644 --- a/addons/movement/functions/fnc_addLoadToUnitContainer.sqf +++ b/addons/movement/functions/fnc_addLoadToUnitContainer.sqf @@ -10,6 +10,9 @@ * Return Value: * Success? * + * Example: + * [bob, box, 5] call ace_movement_fnc_addLoadToUnitContainer + * * Public: No */ #include "script_component.hpp" diff --git a/addons/movement/functions/fnc_climb.sqf b/addons/movement/functions/fnc_climb.sqf index 57df4e5991..1f2ecf72f4 100644 --- a/addons/movement/functions/fnc_climb.sqf +++ b/addons/movement/functions/fnc_climb.sqf @@ -6,7 +6,7 @@ * 0: The Unit (usually the player) * * Return Value: - * Nothing + * None * * Example: * [player] call ace_movement_fnc_climb diff --git a/addons/movement/functions/fnc_handleClimb.sqf b/addons/movement/functions/fnc_handleClimb.sqf index e6d8fed12c..ed3ff93d7e 100644 --- a/addons/movement/functions/fnc_handleClimb.sqf +++ b/addons/movement/functions/fnc_handleClimb.sqf @@ -7,7 +7,7 @@ * 1: The finisehd animation * * Return Value: - * Nothing + * None * * Example: * [player, "ACE_climb"] call ace_movement_fnc_handleClimb diff --git a/addons/movement/functions/fnc_handleVirtualMass.sqf b/addons/movement/functions/fnc_handleVirtualMass.sqf index 8e33197089..814a0eeecb 100644 --- a/addons/movement/functions/fnc_handleVirtualMass.sqf +++ b/addons/movement/functions/fnc_handleVirtualMass.sqf @@ -6,7 +6,10 @@ * 0: The Unit (usually the player) * * Return Value: - * Nothing + * None + * + * Example: + * [bob] call ace_movement_fnc_handleVirtualMass * * Public: No */ @@ -28,6 +31,8 @@ private _virtualLoad = 0; backpackContainer _unit ]; +_unit setVariable [QGVAR(totalLoad), (loadAbs _unit + _virtualLoad)]; + // get absolute vanilla load private _absLoad = getNumber (configFile >> "CfgInventoryGlobalVariable" >> "maxSoldierLoad"); diff --git a/addons/movement/stringtable.xml b/addons/movement/stringtable.xml index ccbef7f66f..0eb4434b42 100644 --- a/addons/movement/stringtable.xml +++ b/addons/movement/stringtable.xml @@ -13,12 +13,15 @@ Súly megjelenítése fontban. Показывать вес в фунтах ポンドで重量を表示する + 무게를 파운드(lb)로 보여줍니다 + 使用磅来显示重量 + 使用磅來顯示重量 Weight: Gewicht: Peso: - Poids: + Poids : Waga: Váha: Peso: @@ -26,6 +29,9 @@ Súly: Вес: 重量: + 무게: + 重量: + 重量: Climb @@ -39,6 +45,9 @@ Arrampicati Subir 登る + 오르기 + 攀爬 + 攀爬 Can't climb here @@ -52,6 +61,9 @@ Non puoi arrampicarti qui Não se pode subir aqui ここは登れない + 这里无法攀爬 + 這裡無法攀爬 + 여기는 올라갈 수 없다 - \ No newline at end of file + diff --git a/addons/mx2a/CfgVehicles.hpp b/addons/mx2a/CfgVehicles.hpp index c450133ba7..51038b9625 100644 --- a/addons/mx2a/CfgVehicles.hpp +++ b/addons/mx2a/CfgVehicles.hpp @@ -6,15 +6,15 @@ class CfgVehicles { scopeCurator = 2; displayName = CSTRING(DisplayName); vehicleClass = "Items"; - class TransportWeapons { - MACRO_ADDWEAPON(ACE_MX2A,1); + class TransportItems { + MACRO_ADDITEM(ACE_MX2A,1); }; }; class Box_NATO_Support_F; class ACE_Box_Misc: Box_NATO_Support_F { - class TransportWeapons { - MACRO_ADDWEAPON(ACE_MX2A,6); + class TransportItems { + MACRO_ADDITEM(ACE_MX2A,6); }; }; }; diff --git a/addons/mx2a/stringtable.xml b/addons/mx2a/stringtable.xml index 97c937483a..3239aef1ed 100644 --- a/addons/mx2a/stringtable.xml +++ b/addons/mx2a/stringtable.xml @@ -1,4 +1,4 @@ - + @@ -13,6 +13,9 @@ MX-2A MX-2A MX-2A + MX-2A + MX-2A + MX-2A Thermal imaging device @@ -26,6 +29,9 @@ Тепловизионный прибор Dispositivo di visione termica サーマル画像表示双眼鏡 + 열영상 장치 + 热成像装置 + 熱成像裝置 - \ No newline at end of file + diff --git a/addons/nametags/XEH_PREP.hpp b/addons/nametags/XEH_PREP.hpp index 5d99258d27..a27102a4e5 100644 --- a/addons/nametags/XEH_PREP.hpp +++ b/addons/nametags/XEH_PREP.hpp @@ -2,6 +2,7 @@ PREP(canShow); PREP(doShow); PREP(drawNameTagIcon); +PREP(getCachedFlags); PREP(getVehicleData); PREP(initIsSpeaking); PREP(moduleNameTags); diff --git a/addons/nametags/XEH_postInit.sqf b/addons/nametags/XEH_postInit.sqf index bebe840b47..2df7565cd6 100644 --- a/addons/nametags/XEH_postInit.sqf +++ b/addons/nametags/XEH_postInit.sqf @@ -15,7 +15,7 @@ GVAR(showNamesTime) = -10; // Statement GVAR(showNamesTime) = CBA_missionTime; - if (call FUNC(canShow)) then{ call FUNC(doShow); }; + // if (call FUNC(canShow)) then{ call FUNC(doShow); }; // This code doesn't work (canShow has a nil / has never worked??) // Return false so it doesn't block other actions false }, @@ -34,4 +34,14 @@ GVAR(showNamesTime) = -10; if (_name == QGVAR(showPlayerNames)) then { call FUNC(updateSettings); }; + // Reset nametag flag cache on setting change: + ACE_player setVariable [QGVAR(flagsCache), nil]; }] call CBA_fnc_addEventHandler; + +["cba_events_visionModeEvent", { + // Reset nametag flag cache on vision mode change: + ACE_player setVariable [QGVAR(flagsCache), nil]; +}] call CBA_fnc_addEventHandler; + +// civilians don't use military ranks +["CIV_F", ["","","","","","",""]] call FUNC(setFactionRankIcons); diff --git a/addons/nametags/XEH_preInit.sqf b/addons/nametags/XEH_preInit.sqf index a7feade1c3..b47cf6628d 100644 --- a/addons/nametags/XEH_preInit.sqf +++ b/addons/nametags/XEH_preInit.sqf @@ -2,6 +2,8 @@ ADDON = false; +PREP_RECOMPILE_START; #include "XEH_PREP.hpp" +PREP_RECOMPILE_END; ADDON = true; diff --git a/addons/nametags/functions/fnc_doShow.sqf b/addons/nametags/functions/fnc_doShow.sqf index 1f689704b9..08ab633f28 100644 --- a/addons/nametags/functions/fnc_doShow.sqf +++ b/addons/nametags/functions/fnc_doShow.sqf @@ -14,26 +14,24 @@ * Public: No */ #include "script_component.hpp" -#include "common.hpp"; +#include "common.hpp" -private ["_roleImages", "_player", "_vehicle", "_type", "_config", "_text", "_data", "_isAir", "_turretUnits", "_turretRoles", "_index", "_roleType", "_unit", "_toShow"]; +private _player = ACE_player; +private _vehicle = vehicle _player; +private _type = typeOf _vehicle; +private _config = configFile >> "CfgVehicles" >> _type; +private _text = format[" %2
", getText(_config>>"picture"), getText (_config >> "DisplayName")]; -_player = ACE_player; -_vehicle = vehicle _player; -_type = typeOf _vehicle; -_config = configFile >> "CfgVehicles" >> _type; -_text = format[" %2
", getText(_config>>"picture"), getText (_config >> "DisplayName")]; +private _data = [_type] call FUNC(getVehicleData); -_data = [_type] call FUNC(getVehicleData); +private _isAir = _data select 0; +private _data = _data select 1; -_isAir = _data select 0; -_data = _data select 1; +private _turretUnits = _data apply {_vehicle turretUnit (_x select 0)}; +private _turretRoles = _data apply {_x select 1}; -_turretUnits = _data apply {_vehicle turretUnit (_x select 0)}; -_turretRoles = _data apply {_x select 1}; - -_roleType = CARGO; -_toShow = []; +private _roleType = CARGO; +private _toShow = []; { switch (_x) do { case commander _vehicle: { @@ -70,10 +68,10 @@ _toShow = [ } ] call BIS_fnc_sortBy; -_roleImages = ROLE_IMAGES; +private _roleImages = ROLE_IMAGES; { - _unit = _x select 0; - _roleType = _x select 1; + private _unit = _x select 0; + private _roleType = _x select 1; _text = _text + format["%1
", [_unit] call EFUNC(common,getName), _roleImages select _roleType]; } forEach _toShow; diff --git a/addons/nametags/functions/fnc_getCachedFlags.sqf b/addons/nametags/functions/fnc_getCachedFlags.sqf new file mode 100644 index 0000000000..6e1223c8be --- /dev/null +++ b/addons/nametags/functions/fnc_getCachedFlags.sqf @@ -0,0 +1,56 @@ +/* + * Author: + * Get's flags used for onDraw3D that can be cached + * + * Arguments: + * None + * + * Return Value: + * [_drawName,_drawRank,_enabledTagsNearby,_enabledTagsCursor,_maxDistance] + * + * Example: + * call ace_nametags_fnc_getCachedFlags + * + * Public: No + */ +#include "script_component.hpp" + +// Determine flags from current settings +private _drawName = true; +private _enabledTagsNearby = false; +private _enabledTagsCursor = false; + +switch (GVAR(showPlayerNames)) do { + case 0: { + // Player names Disabled [Note: this should be unreachable as the drawEH will be removed] + _drawName = false; + _enabledTagsNearby = (GVAR(showSoundWaves) == 2); + }; + case 1: { + // Player names Enabled + _enabledTagsNearby = true; + }; + case 2: { + // Player names Only cursor + _enabledTagsNearby = (GVAR(showSoundWaves) == 2); + _enabledTagsCursor = true; + }; + case 3: { + // Player names Only Keypress + _enabledTagsNearby = GVAR(showSoundWaves) == 2; // non-cached: || _onKeyPressAlphaMax) > 0 + }; + case 4: { + // Player names Only Cursor and Keypress + _enabledTagsNearby = (GVAR(showSoundWaves) == 2); + // non-cached: _enabledTagsCursor = _onKeyPressAlphaMax > 0; + }; + case 5: { + // Fade on border + _enabledTagsNearby = true; + }; +}; + +private _ambientBrightness = ((([] call EFUNC(common,ambientBrightness)) + ([0, 0.4] select ((currentVisionMode ace_player) != 0))) min 1) max 0; +private _maxDistance = _ambientBrightness * GVAR(PlayerNamesViewDistance); + +[_drawName, GVAR(showPlayerRanks),_enabledTagsNearby,_enabledTagsCursor,_maxDistance] diff --git a/addons/nametags/functions/fnc_getVehicleData.sqf b/addons/nametags/functions/fnc_getVehicleData.sqf index 1c916f81aa..59f5284faf 100644 --- a/addons/nametags/functions/fnc_getVehicleData.sqf +++ b/addons/nametags/functions/fnc_getVehicleData.sqf @@ -18,7 +18,7 @@ * Public: No */ #include "script_component.hpp" -#include "common.hpp"; +#include "common.hpp" params ["_type"]; diff --git a/addons/nametags/functions/fnc_initIsSpeaking.sqf b/addons/nametags/functions/fnc_initIsSpeaking.sqf index 9428768ec8..6624f59485 100644 --- a/addons/nametags/functions/fnc_initIsSpeaking.sqf +++ b/addons/nametags/functions/fnc_initIsSpeaking.sqf @@ -54,9 +54,8 @@ if (isClass (configFile >> "CfgPatches" >> "acre_api")) then { //Note: class RscDisplayVoiceChat {idd = 55} - only present when talking [{ - private ["_oldSetting", "_newSetting"]; - _oldSetting = ACE_player getVariable [QGVAR(isSpeakingInGame), false]; - _newSetting = (!(isNull findDisplay 55)); + private _oldSetting = ACE_player getVariable [QGVAR(isSpeakingInGame), false]; + private _newSetting = (!(isNull findDisplay 55)); if (!(_oldSetting isEqualTo _newSetting)) then { ACE_player setVariable [QGVAR(isSpeakingInGame), _newSetting, true]; }; diff --git a/addons/nametags/functions/fnc_moduleNameTags.sqf b/addons/nametags/functions/fnc_moduleNameTags.sqf index ca513d0c1f..e1fa1a5dc7 100644 --- a/addons/nametags/functions/fnc_moduleNameTags.sqf +++ b/addons/nametags/functions/fnc_moduleNameTags.sqf @@ -7,6 +7,11 @@ * * Return Value: * None + * + * Example: + * [] call ace_nametags_fnc_moduleNameTags + * + * Public: No */ #include "script_component.hpp" diff --git a/addons/nametags/functions/fnc_onDraw3d.sqf b/addons/nametags/functions/fnc_onDraw3d.sqf index dc4b130a52..f937b230b3 100644 --- a/addons/nametags/functions/fnc_onDraw3d.sqf +++ b/addons/nametags/functions/fnc_onDraw3d.sqf @@ -15,67 +15,33 @@ */ #include "script_component.hpp" -private ["_defaultIcon", "_distance", "_alpha", "_icon", "_targets", "_relPos", "_projDist", "_target"]; - BEGIN_COUNTER(GVAR(onDraw3d)); // Don't show nametags in spectator or if RscDisplayMPInterrupt is open if ((isNull ACE_player) || {!alive ACE_player} || {!isNull (findDisplay 49)}) exitWith {}; -// Determine flags from current settings -private _drawName = true; -private _drawRank = GVAR(showPlayerRanks); -private _enabledTagsNearby = false; -private _enabledTagsCursor = false; -private _onKeyPressAlphaMax = 1; -switch (GVAR(showPlayerNames)) do { - case 0: { - // Player names Disabled - _drawName = false; - _enabledTagsNearby = (GVAR(showSoundWaves) == 2); - _enabledTagsCursor = false; - }; - case 1: { - // Player names Enabled - _enabledTagsNearby = true; - _enabledTagsCursor = false; - }; - case 2: { - // Player names Only cursor - _enabledTagsNearby = (GVAR(showSoundWaves) == 2); - _enabledTagsCursor = true; - }; - case 3: { - // Player names Only Keypress - _onKeyPressAlphaMax = 2 + (GVAR(showNamesTime) - CBA_missionTime); - _enabledTagsNearby = (_onKeyPressAlphaMax) > 0 || (GVAR(showSoundWaves) == 2); - _enabledTagsCursor = false; - }; - case 4: { - // Player names Only Cursor and Keypress - _onKeyPressAlphaMax = 2 + (GVAR(showNamesTime) - CBA_missionTime); - _enabledTagsNearby = (GVAR(showSoundWaves) == 2); - _enabledTagsCursor = _onKeyPressAlphaMax > 0; - }; - case 5: { - // Fade on border - _enabledTagsNearby = true; - _enabledTagsCursor = false; - }; -}; +private _flags = [[], DFUNC(getCachedFlags), ACE_player, QGVAR(flagsCache), 2] call EFUNC(common,cachedCall); -private _ambientBrightness = ((([] call EFUNC(common,ambientBrightness)) + ([0, 0.4] select ((currentVisionMode ace_player) != 0))) min 1) max 0; -private _maxDistance = _ambientBrightness * GVAR(PlayerNamesViewDistance); +_flags params ["_drawName", "_drawRank", "_enabledTagsNearby", "_enabledTagsCursor", "_maxDistance"]; + +private _onKeyPressAlphaMax = 1; +if (GVAR(showPlayerNames) == 3) then { + _onKeyPressAlphaMax = 2 + (GVAR(showNamesTime) - CBA_missionTime); + _enabledTagsNearby = _enabledTagsNearby || {_onKeyPressAlphaMax > 0} +}; +if (GVAR(showPlayerNames) == 4) then { + _onKeyPressAlphaMax = 2 + (GVAR(showNamesTime) - CBA_missionTime); + _enabledTagsCursor = _onKeyPressAlphaMax > 0; +}; private _camPosAGL = positionCameraToWorld [0, 0, 0]; if !((_camPosAGL select 0) isEqualType 0) exitWith {}; // handle RHS / bugged vehicle slots private _camPosASL = AGLtoASL _camPosAGL; -private _vecy = (AGLtoASL positionCameraToWorld [0, 0, 1]) vectorDiff _camPosASL; // Show nametag for the unit behind the cursor or its commander if (_enabledTagsCursor) then { - _target = cursorTarget; + private _target = cursorTarget; if !(_target isKindOf "CAManBase") then { // When cursorTarget is on a vehicle show the nametag for the commander. if !(_target in allUnitsUAV) then { @@ -92,7 +58,7 @@ if (_enabledTagsCursor) then { {lineIntersectsSurfaces [_camPosASL, eyePos _target, ACE_player, _target] isEqualTo []} && {!isObjectHidden _target}) then { - _distance = ACE_player distance _target; + private _distance = ACE_player distance _target; private _drawSoundwave = (GVAR(showSoundWaves) > 0) && {[_target] call FUNC(isSpeaking)}; // Alpha: @@ -137,6 +103,9 @@ if (_enabledTagsNearby) then { private _target = _x; if !(isNull _target) then { + private _drawSoundwave = (GVAR(showSoundWaves) > 0) && {[_target] call FUNC(isSpeaking)}; + if (_enabledTagsCursor && {!_drawSoundwave}) exitWith {}; // (Cursor Only && showSoundWaves==2) - quick exit + private _relPos = (visiblePositionASL _target) vectorDiff _camPosASL; private _distance = vectorMagnitude _relPos; @@ -152,7 +121,6 @@ if (_enabledTagsNearby) then { }; }; - private _drawSoundwave = (GVAR(showSoundWaves) > 0) && {[_target] call FUNC(isSpeaking)}; private _alphaMax = _onKeyPressAlphaMax; if ((GVAR(showSoundWaves) == 2) && _drawSoundwave) then { _drawName = _drawSoundwave; diff --git a/addons/nametags/functions/fnc_setText.sqf b/addons/nametags/functions/fnc_setText.sqf index 9bc084cfd4..688ecabc4a 100644 --- a/addons/nametags/functions/fnc_setText.sqf +++ b/addons/nametags/functions/fnc_setText.sqf @@ -19,10 +19,8 @@ params ["_text"]; -private ["_ctrl"]; - disableSerialization; -_ctrl = (uiNamespace getVariable QGVAR(dialog)) displayCtrl TextIDC; +private _ctrl = (uiNamespace getVariable QGVAR(dialog)) displayCtrl TextIDC; _ctrl ctrlSetStructuredText parseText _text; _ctrl ctrlCommit 0; diff --git a/addons/nametags/stringtable.xml b/addons/nametags/stringtable.xml index 9a0ba8d53e..a130a002f7 100644 --- a/addons/nametags/stringtable.xml +++ b/addons/nametags/stringtable.xml @@ -13,6 +13,9 @@ Mostra i nomi Mostrar nomes 名前の表示 + 이름 표시 + 显示名称 + 顯示名稱 Show player names @@ -26,6 +29,9 @@ Mostra i nomi dei giocatori Показывать имена игроков (включить имена) プレイヤ名を表示 + 플레이어 이름 표시 + 显示玩家名称 + 顯示玩家名稱 Show player name only on cursor (requires player names) @@ -38,7 +44,10 @@ Mostrar nome de jogador somente no cursor (requer nome de jogadores) Játékosok nevének mutatása csak a kurzoron (a nevek mutatása szükséges) Показать имена игроков только под курсором (при включенных именах) - カーソルを合わせた時だけプレイヤ名を表示 (プレイヤ名が必要 + カーソルを合わせた時だけプレイヤ名を表示 (プレイヤ名が必要) + 커서로 지시할때만 플레이어 이름 표시(플레이어 이름 필요) + 仅在准心指到后显示玩家名称 (玩家必须有设定名称) + 僅在準心指到後顯示玩家名稱 (玩家必須有設定名稱) Show player name only on keypress (requires player names) @@ -52,6 +61,9 @@ Mostra i nomi solo se si preme il tasto (insieme ai nomi) Mostrar nomes somente ao pressionar teclar (requer nome de jogadores) キーを押した時だけプレイヤ名を表示 (プレイヤ名が必要) + 키를 누를때만 플레이어 이름 표시(플레이어 이름 필요) + 仅在按按键后显示玩家名称 (玩家必须有设定名称) + 僅在按按鍵後顯示玩家名稱 (玩家必須有設定名稱) Show player ranks (requires player names) @@ -65,6 +77,9 @@ Játékosok rendfokozatának mutatása (a nevek mutatása szükséges) Показывать звания игроков (при вкл. именах) プレイヤの階級を表示 (プレイヤ名が必要) + 플레이어 계급 표시 (플레이어 이름 필요) + 显示玩家军阶 (玩家必须有设定名称) + 顯示玩家軍階 (玩家必須有設定名稱) Show vehicle crew info @@ -78,6 +93,9 @@ Mostrar tripulantes Mostra l'elenco del personale a bordo 車両の乗員を表示 + 차량 승무원 정보 표시 + 显示载具成员信息 + 顯示載具成員信息 Show name tags for AI units @@ -91,6 +109,9 @@ Mostra i nomi delle le unità AI Mostrar nomes para unidades de IA AI ユニットの名札を表示 + 인공지능 인원 이름 표시 + 显示AI单位名称 + 顯示AI單位名稱 Show SoundWaves (requires player names) @@ -104,6 +125,9 @@ Mostra movimento audio (insieme ai nomi) Mostrar onda sonora (requer nome de jogadores) 音波形を表示 (プレイヤ名が必要) + 음파 표시 (플레이어 이름 필요) + 当玩家讲话时,显示声波图案 (玩家必须有设定名称) + 當玩家講話時,顯示聲波圖案 (玩家必須有設定名稱) Default Nametag Color (Non Group Members) @@ -117,6 +141,9 @@ Colore dei nomi non appartenenti al gruppo Cor padrão do nome (unidades fora do grupo) 標準の名札の色(グループ メンバ以外) + 기본 이름표 색상 (비-그룹 멤버) + 预设名称颜色 (非同小队队友) + 預設名稱顏色 (非同小隊隊友) Name Tags @@ -130,6 +157,9 @@ Имена игроков Etichette Nomi 名札 + 이름표 + 玩家名称 + 玩家名稱 Player Names View Dist. @@ -143,6 +173,9 @@ Дистанция отображения имен Distanza Visiva Etichette Nomi プレイヤ名が見える範囲 + 플레이어 이름 표시 거리 + 玩家名称显示距离 + 玩家名稱顯示距離 Distance in meters at which player names are shown. Default: 5 @@ -155,7 +188,10 @@ Méterben megadott érték a játékosok nevének mutatására. Alapértelmezett: 5 Дистанция в метрах, на которой отображаются имена игроков. По-умолчанию: 5 Distanza in metri a cui sono visibili i nomi giocatori. Default: 5 - プレイヤの周り何メートルまで名札を表示できます。標準:5 + プレイヤの周り何メートルまで名札を表示できます。標準: 5 + 플레이어 이름이 표시되는 미터. 기본설정: 5 + 设定名称在多少距离以内显示。预设:5公尺 + 設定名稱在多少距離以內顯示。預設:5公尺 Show name tags for AI? @@ -169,6 +205,9 @@ Показывать имена ботов? Mostra etichette nomi per IA? AI の名札も表示しますか? + 인공지능의 이름도 표시합니까? + 显示AI名称? + 顯示AI名稱? Show the name and rank tags for friendly AI units? Default: Do not force @@ -181,7 +220,10 @@ Mutassa-e a szövetséges AI egységek nevét és rangját? Alapértelmezett: Nincs felülbírálás Показывать имена и звания дружественных ботов? По-умолчанию: Не обязывать Mostra etichette nomi ed etichette gradi per unità IA alleate? Default: Non forzare - 友軍の AI にも名前と階級を表示しますか?標準:強制しない + 友軍の AI にも名前と階級を表示しますか?標準: 強制しない + 아군 인공지능의 계급을 표시합니까? 기본설정: 강제하지 않음 + 显示友军AI的名称和军阶? 预设: 不显示 + 顯示友軍AI的名稱和軍階? 預設: 不顯示 Force Hide @@ -195,6 +237,9 @@ Обязательно: Скрывать Forza Nascosto 強制で非表示 + 강제로 숨기기 + 强迫隐藏 + 強迫隱藏 Force Show @@ -208,6 +253,9 @@ Обязательно: Показывать Forza Mostra 強制で表示 + 강제로 표시 + 强迫显示 + 強迫顯示 Show crew info? @@ -221,6 +269,9 @@ Показывать экипаж? Mostra informazioni equipaggio? 乗員の情報を表示 + 승무원 정보 표시? + 显示载具成员讯息? + 顯示載具成員訊息? Show vehicle crew info, or by default allows players to choose it on their own. Default: Do Not Force @@ -233,7 +284,10 @@ A legénységi adatok mutatása, alapértelmezett esetben a játékos által kiválasztható. Alapértelmezett: Nincs felülbírálás Показывать информацию об экипаже техники, или по-умолчанию, позволяет игрокам выбрать свою настройку. По-умолчанию: Не обязывать Mostra informazioni sull'equipaggio del veicolo, oppure consenti di default di lasciare che siano i giocatori a scegliere. Default: Non Forzare - 車両の乗員を表示します。標準ではプレイヤ各々が選べられます。標準:強制しない + 車両の乗員を表示します。標準ではプレイヤ各々が選べられます。標準: 強制しない + 승무원 정보를 표시하거나 플레이어가 직접 고르게 냅둡니다. 기본설정: 강제하지 않음 + 显示载具成员讯息。在预设的情况下,系统允许玩家自己决定开关此讯息。预设: 不显示 + 顯示載具成員訊息。在預設的情況下,系統允許玩家自己決定開關此訊息。預設: 不顯示 Show for Vehicles @@ -247,6 +301,9 @@ Показывать для техники Mostra per Veicoli 車両への表示 + 차량 표시 + 显示给载具指挥官 + 顯示給載具指揮官 Show cursor NameTag for vehicle commander (only if client has name tags enabled) Default: No @@ -258,7 +315,10 @@ Показывать имя командира техники (только, если клиент включил отображение имен). По-умолчанию: Нет Afficher les étiquettes de nom pour les commandants de véhicule (uniquement si l'affichage est activé pour le client). Défaut: non Mostra il nome sul cursore per il comandante del veicolo (solo se il client ha le Etichette Nomi attive) Default: No - 車長の名札をカーソルを当てて表示します (クライアント側で名札を有効化する必要があります) 標準:無効 + 車長の名札をカーソルを当てて表示します (クライアント側で名札を有効化する必要があります) 標準: 無効 + 차량의 사령관의 이름표를 표시합니다 (오직 클라이언트가 이름표를 활성화 할시에만 보입니다) 기본설정: 아니요 + 使载具指挥官能透过准心指到别的单位来显示其名称 (仅当客户端的名称功能已启用)。预设: 关闭 + 使載具指揮官能透過準心指到別的單位來顯示其名稱 (僅當客戶端的名稱功能已啟用)。預設: 關閉 This module allows you to customize settings and range of Name Tags. @@ -272,6 +332,9 @@ Этот модуль позволяет настроить опции и дистанцию отображения имен игроков. Questo modulo ti consente di personalizzare le impostazioni ed il raggio delle Etichette Nomi このモジュールは名札の表示範囲と設定を変更できます。 + 이 모듈은 당신이 이름표의 범위를 임의로 수정할 수 있게 해줍니다. + 这个模块允许您设定名称和显示范围等设定 + 這個模塊允許您設定名稱和顯示範圍等設定 Only on Cursor @@ -285,6 +348,9 @@ Только под курсором Solo su Cursore カーソルでのみ + 커서만 해당 + 只有准心指到时 + 只有準心指到時 Only on Keypress @@ -298,6 +364,9 @@ Только по нажатию клавиши Solo quando Premi Tasto キー押下のみ + 키를 누를경우만 + 只有按按键时 + 只有按按鍵時 Only on Cursor and Keypress @@ -311,6 +380,9 @@ Под курсором или по нажатию клавиши Solo su Cursore e quando Premi Tasto カーソルとキー押下のみ + 커서와 키를 누를경우만 + 只有在准心指到和按按键时 + 只有在準心指到和按按鍵時 Force Show Only on Cursor @@ -324,6 +396,9 @@ Обязательно: Только под курсором Forza Mostra solo su Cursore カーソルでのみに強制する + 커서만 강제로 해당 + 强制仅显示在准心指到时 + 強制僅顯示在準心指到時 Force Show Only on Keypress @@ -337,6 +412,9 @@ Обязательно: Только по нажатию клавиши Forza Mostra solo quando Premi Tasto キー押下のみに強制する + 키를 누를경우만 강제로 해당 + 强制仅显示在按按键时 + 強制僅顯示在按按鍵時 Force Show Only on Cursor and Keypress @@ -350,6 +428,9 @@ Обязательно: Под курсором или по нажатию клавиши Forza Mostra solo su Cursore e quando Premi Tasto カーソルとキー押下のみに強制する + 커서와 키를 누를경우만 강제로 해당 + 强制显示在准心指到和按按键时 + 強制顯示在準心指到和按按鍵時 Use Nametag settings @@ -363,6 +444,9 @@ Так же, как имена Usa impostazioni Etichette Nomi 名札の設定 + 이름표 설정 사용 + 玩家名称设定 + 玩家名稱設定 Always Show All @@ -376,6 +460,9 @@ Всегда показывать Mostra Sempre Tutto 常に表示する + 항상 모두 표시 + 永远显示全部 + 永遠顯示全部 Show player names and set their activation. Default: Enabled @@ -388,7 +475,10 @@ Mutassa a játékosok nevét és kezelje az aktivációjukat. Alapértelmezett: Engedélyezve Показывать имена игроков и установить их активацию. По-умолчанию: Включено Mostra nomi giocatori ed imposta la loro attivazione. Default: Abilitato - プレイヤ名の表示と設定を有効化します。標準:有効 + プレイヤ名の表示と設定を有効化します。標準: 有効 + 플레이어 이름의 표시와 설정을 활성화합니다. 기본설정: 활성화 + 显示玩家的名称并设置其启动方式。预设: 启用 + 顯示玩家的名稱並設置其啟動方式。預設: 啟用 Effect of sound waves above the heads of speaking players after holding the PTT key. This option works with TFAR and ACRE2. @@ -402,6 +492,9 @@ Эффект звуковой волны над головами говорящих игроков при удерживании кнопки push-to-talk. Эта опация работает также с рациями TFAR и ACRE2. Effetto delle onde sonore sopra la testa dei giocatori parlanti quando premono il tasto PTT. Questa opzione funziona con TFAR ed ACRE2 プレイヤーが PTT キーを押している間は、音波形を表示します。このオプションは TFAR と ACRE2 で動作します。 + 플레이어가 PTT로 말할시 머리위에 음파효과를 적용합니다. 이 옵션은 TFAR과 ACRE2가 있을때만 적용됩니다. + 当玩家使用按键发话时,其头上的角色名称旁会显示声波的图案。此功能可搭配TFAR、ACRE2等模组使用。 + 當玩家使用按鍵發話時,其頭上的角色名稱旁會顯示聲波的圖案。此功能可搭配TFAR、ACRE2等模組使用。 Nametags Size @@ -415,6 +508,9 @@ Размер имен игроков Dimensione Etichette Nome 名札の大きさ + 이름표 크기 + 玩家名称标记大小 + 玩家名稱標記大小 Text and Icon Size Scaling @@ -428,12 +524,20 @@ Масштабирование размера текста и иконок Proporzione Dimensioni Testo ed Icone 文字とアイコンの大きさ + 글자와 아이콘 크기 비례 + 文字和图示大小设定 + 文字和圖示大小設定 Fade on screen border Am Bildschirmrand ausblenden 画面端では非表示 Ukryj na brzegach ekranu + 화면 가장자리에서 사라짐 + Estomper sur les bords de l'écran + Sfocatura nei bordi dello schermo + 在荧幕边框旁淡出 + 在螢幕邊框旁淡出 diff --git a/addons/nightvision/XEH_postInitClient.sqf b/addons/nightvision/XEH_postInitClient.sqf index de0b629d76..bbc31d2b74 100644 --- a/addons/nightvision/XEH_postInitClient.sqf +++ b/addons/nightvision/XEH_postInitClient.sqf @@ -40,7 +40,7 @@ GVAR(ppEffectMuzzleFlash) ppEffectCommit 0; // Add keybinds ["ACE3 Equipment", QGVAR(IncreaseNVGBrightness), localize LSTRING(IncreaseNVGBrightness), { // Conditions: canInteract - if !([ACE_player, objNull, ["isNotEscorting", "isNotInside", "isNotSitting"]] call EFUNC(common,canInteractWith)) exitWith {false}; + if !([ACE_player, objNull, ["isNotEscorting", "isNotInside", "isNotSitting", "isNotRefueling"]] call EFUNC(common,canInteractWith)) exitWith {false}; // Conditions: specific if ((currentVisionMode ACE_player != 1)) exitWith {false}; @@ -51,7 +51,7 @@ GVAR(ppEffectMuzzleFlash) ppEffectCommit 0; ["ACE3 Equipment", QGVAR(DecreaseNVGBrightness), localize LSTRING(DecreaseNVGBrightness), { // Conditions: canInteract - if !([ACE_player, objNull, ["isNotEscorting", "isNotInside", "isNotSitting"]] call EFUNC(common,canInteractWith)) exitWith {false}; + if !([ACE_player, objNull, ["isNotEscorting", "isNotInside", "isNotSitting", "isNotRefueling"]] call EFUNC(common,canInteractWith)) exitWith {false}; // Conditions: specific if ((currentVisionMode ACE_player != 1)) exitWith {false}; diff --git a/addons/nightvision/XEH_preInit.sqf b/addons/nightvision/XEH_preInit.sqf index a7feade1c3..b47cf6628d 100644 --- a/addons/nightvision/XEH_preInit.sqf +++ b/addons/nightvision/XEH_preInit.sqf @@ -2,6 +2,8 @@ ADDON = false; +PREP_RECOMPILE_START; #include "XEH_PREP.hpp" +PREP_RECOMPILE_END; ADDON = true; diff --git a/addons/nightvision/functions/fnc_blending.sqf b/addons/nightvision/functions/fnc_blending.sqf index 2616cb83f5..4a858838d3 100644 --- a/addons/nightvision/functions/fnc_blending.sqf +++ b/addons/nightvision/functions/fnc_blending.sqf @@ -6,7 +6,7 @@ * None. Parameters inherited from EFUNC(common,firedEH) * * Return Value: - * Nothing + * Noneg * * Example: * [clientFiredBIS-XEH] call ace_nightvision_fnc_blending diff --git a/addons/nightvision/functions/fnc_changeNVGBrightness.sqf b/addons/nightvision/functions/fnc_changeNVGBrightness.sqf index 04cea0f214..5bb5d52721 100644 --- a/addons/nightvision/functions/fnc_changeNVGBrightness.sqf +++ b/addons/nightvision/functions/fnc_changeNVGBrightness.sqf @@ -7,7 +7,7 @@ * 1: Change in brightness (1 or -1) * * Return Value: - * Nothing + * None * * Example: * [player, 1] call ace_nightvision_fnc_changeNVGBrightness diff --git a/addons/nightvision/functions/fnc_updatePPEffects.sqf b/addons/nightvision/functions/fnc_updatePPEffects.sqf index 9bf8321353..f80b0fa57e 100644 --- a/addons/nightvision/functions/fnc_updatePPEffects.sqf +++ b/addons/nightvision/functions/fnc_updatePPEffects.sqf @@ -3,10 +3,10 @@ * Update the ppEffects everytime something changes * * Arguments: - * Nothing + * None * * Return Value: - * Nothing + * None * * Example: * [someEvent] call ace_nightvision_fnc_updatePPEffects @@ -25,9 +25,7 @@ if !(_display isEqualType displayNull) then { _display = displayNull; }; -private ["_currentVehicle", "_grainSetting", "_blurSetting", "_radBlurSetting", "_config", "_hmd", "_cameraView", "_turret"]; - -_currentVehicle = vehicle ACE_player; +private _currentVehicle = vehicle ACE_player; // If the Zeus display is on or the player has no nightvision if (ctrlIDD _display == 312 || currentVisionMode ACE_player != 1) exitWith { @@ -38,23 +36,22 @@ if (ctrlIDD _display == 312 || currentVisionMode ACE_player != 1) exitWith { }; // The unit has nightvision -_config = configFile >> "CfgVehicles" >> typeOf _currentVehicle; -_hmd = hmd ACE_player; -_cameraView = cameraView; -_turret = [ACE_player] call EFUNC(common,getTurretIndex); +private _config = configFile >> "CfgVehicles" >> typeOf _currentVehicle; +private _hmd = hmd ACE_player; +private _cameraView = cameraView; +private _turret = [ACE_player] call EFUNC(common,getTurretIndex); -_fnc_isUsingHMD = { +private _fnc_isUsingHMD = { if (_cameraView != "GUNNER") exitWith {true}; // asume hmd usage outside of gunner view if (ACE_player == (driver _currentVehicle)) exitWith { !("NVG" in getArray (_config >> "ViewOptics" >> "visionMode")); }; - private ["_result", "_turretConfig", "_turretConfigOpticsIn", "_index"]; - _result = true; - _turretConfig = [_config, _turret] call EFUNC(common,getTurretConfigPath); - _turretConfigOpticsIn = _turretConfig >> "OpticsIn"; + private _result = true; + private _turretConfig = [_config, _turret] call EFUNC(common,getTurretConfigPath); + private _turretConfigOpticsIn = _turretConfig >> "OpticsIn"; if (isClass _turretConfigOpticsIn) then { for "_index" from 0 to (count _turretConfigOpticsIn - 1) do { @@ -67,6 +64,10 @@ _fnc_isUsingHMD = { _result }; +private _grainSetting = 0; +private _blurSetting = 0; +private _radBlurSetting = 0; + if ((_currentVehicle == ACE_player) || _fnc_isUsingHMD) then { _grainSetting = getNumber (configFile >> "CfgWeapons" >> _hmd >> "ACE_NightVision_grain"); _blurSetting = getNumber (configFile >> "CfgWeapons" >> _hmd >> "ACE_NightVision_blur"); diff --git a/addons/nightvision/stringtable.xml b/addons/nightvision/stringtable.xml index 84e2e11787..3efe2e5ea7 100644 --- a/addons/nightvision/stringtable.xml +++ b/addons/nightvision/stringtable.xml @@ -12,7 +12,10 @@ ПНВ (Gen1) Gafas de visión nocturna (Gen1) Éjjellátó szemüveg (1. Gen.) - 夜間暗視装置つきゴーグル (第1世代) + 暗視装置 (第1世代) + 야투경 (1세대) + 夜视镜 (初代) + 夜視鏡 (初代) NV Goggles (Gen2) @@ -25,7 +28,10 @@ ПНВ (Gen2) Gafas de visión nocturna (Gen2) Éjjellátó szemüveg (2. Gen.) - 夜間暗視装置つきゴーグル (第2世代) + 暗視装置 (第2世代) + 야투경 (2세대) + 夜视镜 (二代) + 夜視鏡 (二代) NV Goggles (Gen3) @@ -38,7 +44,10 @@ ПНВ (Gen3) Gafas de visión nocturna (Gen3) Éjjellátó szemüveg (3. Gen.) - 夜間暗視装置つきゴーグル (第3世代) + 暗視装置 (第3世代) + 야투경 (3세대) + 夜视镜 (三代) + 夜視鏡 (三代) NV Goggles (Gen3, Brown) @@ -51,7 +60,10 @@ ПНВ (Gen3, Коричневый) Gafas de visión nocturna (Gen3, marrón) Éjjellátó szemüveg (3. Gen., barna) - 夜間暗視装置つきゴーグル (第3世代、ブラウン) + 暗視装置 (第3世代、ブラウン) + 야투경 (3세대, 갈색) + 夜视镜 (三代, 棕色) + 夜視鏡 (三代, 棕色) NV Goggles (Gen3, Green) @@ -64,7 +76,10 @@ ПНВ (Gen3, Зелёный) Gafas de visión nocturna (Gen3, verde) Éjjellátó szemüveg (3. Gen., zöld) - 夜間暗視装置つきゴーグル (第3世代、グリーン) + 暗視装置 (第3世代、グリーン) + 야투경 (3세대, 녹색) + 夜视镜 (三代, 绿色) + 夜視鏡 (三代, 綠色) NV Goggles (Gen3, Black) @@ -77,7 +92,10 @@ ПНВ (Gen3, Чёрный) Gafas de visión nocturna (Gen3, negro) Éjjellátó szemüveg (3. Gen., fekete) - 夜間暗視装置つきゴーグル (第3世代、ブラック) + 暗視装置 (第3世代、ブラック) + 야투경 (3세대, 검정색) + 夜视镜 (三代, 黑色) + 夜視鏡 (三代, 黑色) NV Goggles (Gen4) @@ -90,7 +108,10 @@ ПНВ (Gen4) Gafas de visión nocturna (Gen4) Éjjellátó szemüveg (4. Gen.) - 夜間暗視装置つきゴーグル (第4世代) + 暗視装置 (第4世代) + 야투경 (4세대) + 夜视镜 (四代) + 夜視鏡 (四代) NV Goggles (Wide) @@ -103,7 +124,10 @@ Éjjellátó szemüveg (széles látószögű) Óculos de visão noturna (Panorâmico) Occhiali notturni (Larghi) - 夜間暗視装置つきゴーグル (ワイド) + 暗視装置 (ワイド) + 야투경 (넓음) + 夜视镜 (宽版) + 夜視鏡 (寬版) Brightness: %1 @@ -116,7 +140,10 @@ Fényerő: %1 Luminosidade: %1 Luminosità: %1 - 光度:%1 + 明度: %1 + 밝기: %1 + 亮度: %1 + 亮度: %1 Increase NVG Brightness @@ -129,7 +156,10 @@ Éjjellátó fényerejének növelése Aumentar Luminosidade do EVN Aumenta la luminosità dell'NVG - 夜間暗視装置の光度を上げる + 暗視装置の明度を上げる + 야투경 밝기 높이기 + 增加夜视镜亮度 + 增加夜視鏡亮度 Decrease NVG Brightness @@ -142,7 +172,10 @@ Éjjellátó fényerejének csökkentése Diminuir Luminosidade do EVN Riduci la luminosità dell'NVG - 夜間暗視装置の光度を下げる + 暗視装置の明度を下げる + 야투경 밝기 줄이기 + 减少夜视镜亮度 + 減少夜視鏡亮度 Nightvision @@ -154,7 +187,10 @@ Visione Notturna Visión Nocturna Vision nocturne - 夜間暗視装置 + 暗視装置 + 야간투시경 + 夜视 + 夜視 Settings for night vision. @@ -166,7 +202,10 @@ Impostazioni per visione notturna. Parámetros para visión nocturna Réglage pour la vision nocturne - 夜間暗視装置の設定。 + 暗視装置の設定。 + 야간투시경 설정 + 设定夜视选项. + 設定夜視選項. Disable NVGs in scope @@ -178,7 +217,10 @@ Disabilita NVG nei mirini Desactivar NVG en miras Desactiver les JVN dans les viseurs. - スコープを覗くと夜間暗視装置を無効化 + スコープを覗くと暗視装置を無効化 + 조준경 사용시 야투경 비활성화 + 使用瞄准镜时关闭夜视镜 + 使用瞄準鏡時關閉夜視鏡 Blocks the usage of night vision goggles whilst aiming down the sight. @@ -190,7 +232,10 @@ Blocca l'uso di visori notturni mentre miri con ottiche. Desactiva el uso de gafas visión nocturna cuando se utilizan miras normales. Bloque l'usage des JVN pendant la visée. - スコープを使い狙いを付けると、夜間暗視装置を無効化します。 + スコープを使い狙いを付けると、暗視装置を無効化します。 + 조준시 야투경의 사용을 제한합니다. + 此功能开启后,当要使用瞄准镜时,为避免夜视镜镜头碰撞到瞄准镜,会先拿开夜视镜后再进行瞄准镜瞄准。 + 此功能開啟後,當要使用瞄準鏡時,為避免夜視鏡鏡頭碰撞到瞄準鏡,會先拿開夜視鏡後再進行瞄準鏡瞄準。 - \ No newline at end of file + diff --git a/addons/nlaw/$PBOPREFIX$ b/addons/nlaw/$PBOPREFIX$ new file mode 100644 index 0000000000..cbcdbb46de --- /dev/null +++ b/addons/nlaw/$PBOPREFIX$ @@ -0,0 +1 @@ +z\ace\addons\nlaw diff --git a/addons/nlaw/ACE_GuidanceConfig.hpp b/addons/nlaw/ACE_GuidanceConfig.hpp new file mode 100644 index 0000000000..e04753d681 --- /dev/null +++ b/addons/nlaw/ACE_GuidanceConfig.hpp @@ -0,0 +1,14 @@ +class EGVAR(missileguidance,AttackProfiles) { + class GVAR(directAttack) { + name = CSTRING(directAttack); + functionName = QFUNC(attackProfile); + }; + class GVAR(overflyTopAttack): GVAR(directAttack) { + name = CSTRING(overflyTopAttack); + }; +}; +class EGVAR(missileguidance,SeekerTypes) { + class GVAR(seeker) { + functionName = QFUNC(seeker); + }; +}; diff --git a/addons/nlaw/CfgAmmo.hpp b/addons/nlaw/CfgAmmo.hpp new file mode 100644 index 0000000000..f0649b2ba4 --- /dev/null +++ b/addons/nlaw/CfgAmmo.hpp @@ -0,0 +1,55 @@ +class CfgAmmo { + class M_NLAW_AT_F; + class ACE_NLAW: M_NLAW_AT_F { + hit = 400; // Default was 500 + indirectHit = 20; // Default was 15 + class ace_missileguidance { + enabled = 1; + + minDeflection = 0.0005; // Minium flap deflection for guidance + maxDeflection = 0.01; // Maximum flap deflection for guidance + incDeflection = 0.0005; // The incrmeent in which deflection adjusts. + + canVanillaLock = 0; // Can this default vanilla lock? Only applicable to non-cadet mode + + // Guidance type for munitions + defaultSeekerType = QGVAR(seeker); + seekerTypes[] = {QGVAR(seeker)}; + + defaultSeekerLockMode = "LOBL"; + seekerLockModes[] = {"LOBL"}; + + seekLastTargetPos = 0; // seek last target position [if seeker loses LOS of target, continue to last known pos] + seekerAngle = 45; // Angle in front of the missile which can be searched + seekerAccuracy = 1; // seeker accuracy multiplier + + seekerMinRange = 0; + seekerMaxRange = 10; // Range from the missile which the seeker can visually search + + // Attack profile type selection + defaultAttackProfile = QGVAR(directAttack); + attackProfiles[] = {QGVAR(directAttack), QGVAR(overflyTopAttack)}; + showHintOnCycle = 1; + + // Run once at fired event + onFired = QFUNC(onFired); + }; + }; + + // Sub ammos used in OTA mode (see fnc_seeker.sqf) + class ACE_NLAW_Explosion: ACE_NLAW { // Based on FCS-Airburst, will explode right away + timeToLive = 0; + model = ""; + }; + class ACE_NLAW_ShapedCharge: ACE_NLAW { // Shaped charge from rocket explosion, no effects + timeToLive = 1; + model = ""; + hit = 750; + indirectHit = 0; + indirectHitRange = 0; + explosionSoundEffect = ""; + explosionEffects = ""; + CraterEffects = ""; + muzzleEffect = ""; + }; +}; diff --git a/addons/nlaw/CfgEventhandlers.hpp b/addons/nlaw/CfgEventhandlers.hpp new file mode 100644 index 0000000000..0d3301d6e0 --- /dev/null +++ b/addons/nlaw/CfgEventhandlers.hpp @@ -0,0 +1,17 @@ +class Extended_PreStart_EventHandlers { + class ADDON { + init = QUOTE(call COMPILE_FILE(XEH_preStart)); + }; +}; + +class Extended_PreInit_EventHandlers { + class ADDON { + init = QUOTE(call COMPILE_FILE(XEH_preInit)); + }; +}; + +class Extended_PostInit_EventHandlers { + class ADDON { + init = QUOTE(call COMPILE_FILE(XEH_postInit)); + }; +}; diff --git a/addons/nlaw/CfgMagazines.hpp b/addons/nlaw/CfgMagazines.hpp new file mode 100644 index 0000000000..fe2e2ecf8d --- /dev/null +++ b/addons/nlaw/CfgMagazines.hpp @@ -0,0 +1,6 @@ +class CfgMagazines { + class CA_LauncherMagazine; + class NLAW_F: CA_LauncherMagazine { + ammo = "ACE_NLAW"; + }; +}; diff --git a/addons/nlaw/CfgWeapons.hpp b/addons/nlaw/CfgWeapons.hpp new file mode 100644 index 0000000000..35f5b17122 --- /dev/null +++ b/addons/nlaw/CfgWeapons.hpp @@ -0,0 +1,13 @@ +class CfgWeapons { + class Launcher_Base_F; + class launch_NLAW_F: Launcher_Base_F { + GVAR(enabled) = 1; + canLock = 1; + class OpticsModes { + class optic { + distanceZoomMin = 0; + distanceZoomMax = 0; + }; + }; + }; +}; diff --git a/addons/nlaw/README.md b/addons/nlaw/README.md new file mode 100644 index 0000000000..dd62b36014 --- /dev/null +++ b/addons/nlaw/README.md @@ -0,0 +1,10 @@ +ace_nlaw +=============== + +Adds Predicted Line Of Sight guidance to the NLAW. + +## Maintainers + +The people responsible for merging changes to this component or answering potential questions. + +- [PabstMirror](https://github.com/PabstMirror) diff --git a/addons/nlaw/XEH_PREP.hpp b/addons/nlaw/XEH_PREP.hpp new file mode 100644 index 0000000000..aad1e57efb --- /dev/null +++ b/addons/nlaw/XEH_PREP.hpp @@ -0,0 +1,6 @@ +LOG("prep"); + +PREP(attackProfile); +PREP(keyDown); +PREP(onFired); +PREP(seeker); diff --git a/addons/nlaw/XEH_postInit.sqf b/addons/nlaw/XEH_postInit.sqf new file mode 100644 index 0000000000..885e2d5e2f --- /dev/null +++ b/addons/nlaw/XEH_postInit.sqf @@ -0,0 +1,46 @@ +#include "script_component.hpp" + +if (!hasInterface) exitWith {}; + +GVAR(isLockKeyDown) = false; + +// Degrees per second +GVAR(yawChange) = 0; +GVAR(pitchChange) = 0; + +// Add keybind +["ACE3 Weapons", QGVAR(trackTarget), localize LSTRING(trackTarget), { + call FUNC(keyDown); + false // Return false so it doesn't block the rest weapon action +}, { + TRACE_1("lock key up",GVAR(isLockKeyDown)); + GVAR(isLockKeyDown) = false; + false +}, [15, [false, false, false]], false] call CBA_fnc_addKeybind; //Tab Key + + + +// Visual debuging, idealy used with a moving vehicle called "testTarget" +#ifdef DRAW_NLAW_INFO +addMissionEventHandler ["Draw3d", { + // GREEN - Draw an object called "testTarget"'s aim pos and 1 sec aimpos predicted by velocity + if ((!isNil "testTarget") && {!isNull testTarget}) then { + { + drawIcon3D ["\a3\ui_f\data\IGUI\Cfg\Cursors\selectover_ca.paa", [0,1,0,1], ASLtoAGL ((aimPos testTarget) vectorAdd ((velocity testTarget) vectorMultiply _x)), 0.75, 0.75, 0, format ["%1", _x], 1, 0.025, "TahomaB"]; + } forEach [0, 1, 2, 3]; + }; + + // RED - If lock key is down, draw weapon dir and predicted path at various times + if (GVAR(yawChange) != 0) then { + { + private _viewASL = AGLtoASL positionCameraToWorld [0,0,0]; + private _viewDir = ACE_player weaponDirection (currentWeapon ACE_player); + (_viewDir call CBA_fnc_vect2Polar) params ["", "_yaw", "_pitch"]; + private _realYaw = _yaw + GVAR(yawChange) * _x; + private _realPitch = _pitch + GVAR(pitchChange) * _x; + private _returnTargetPos = _viewASL vectorAdd ([1000, _realYaw, _realPitch] call CBA_fnc_polar2vect); + drawIcon3D ["\a3\ui_f\data\IGUI\Cfg\Cursors\selectover_ca.paa", [1,0,0,1], ASLtoAGL _returnTargetPos, 0.75, 0.75, 0, format ["%1", _x], 1, 0.025, "TahomaB"]; + } forEach [0, 1, 2, 3]; + }; +}]; +#endif diff --git a/addons/nlaw/XEH_preInit.sqf b/addons/nlaw/XEH_preInit.sqf new file mode 100644 index 0000000000..b47cf6628d --- /dev/null +++ b/addons/nlaw/XEH_preInit.sqf @@ -0,0 +1,9 @@ +#include "script_component.hpp" + +ADDON = false; + +PREP_RECOMPILE_START; +#include "XEH_PREP.hpp" +PREP_RECOMPILE_END; + +ADDON = true; diff --git a/addons/nlaw/XEH_preStart.sqf b/addons/nlaw/XEH_preStart.sqf new file mode 100644 index 0000000000..022888575e --- /dev/null +++ b/addons/nlaw/XEH_preStart.sqf @@ -0,0 +1,3 @@ +#include "script_component.hpp" + +#include "XEH_PREP.hpp" diff --git a/addons/nlaw/config.cpp b/addons/nlaw/config.cpp new file mode 100644 index 0000000000..7109459066 --- /dev/null +++ b/addons/nlaw/config.cpp @@ -0,0 +1,22 @@ +#include "script_component.hpp" + +class CfgPatches { + class ADDON { + name = COMPONENT_NAME; + units[] = {}; + weapons[] = {}; + requiredVersion = REQUIRED_VERSION; + requiredAddons[] = {"ace_missileguidance"}; + author = ECSTRING(common,ACETeam); + url = ECSTRING(main,URL); + VERSION_CONFIG; + }; +}; + +#include "CfgEventhandlers.hpp" + +#include "CfgAmmo.hpp" +#include "CfgMagazines.hpp" +#include "CfgWeapons.hpp" + +#include "ACE_GuidanceConfig.hpp" diff --git a/addons/nlaw/functions/fnc_attackProfile.sqf b/addons/nlaw/functions/fnc_attackProfile.sqf new file mode 100644 index 0000000000..778a1924b3 --- /dev/null +++ b/addons/nlaw/functions/fnc_attackProfile.sqf @@ -0,0 +1,60 @@ +/* + * Author: PabstMirror + * NLAW missile guidance attack profile. + * + * Arguments: + * 0: Seeker Target PosASL + * 1: Guidance Arg Array + * 2: Attack Profile State + * + * Return Value: + * Missile Aim PosASL + * + * Example: + * [[1,2,3], [], []] call ace_nlaw_fnc_attackProfile + * + * Public: No + */ +#include "script_component.hpp" + +params ["_seekerTargetPos", "_args", "_attackProfileStateParams"]; +_args params ["_firedEH", "_launchParams"]; +_launchParams params ["","_targetLaunchParams", "", "_attackProfile"]; +_targetLaunchParams params ["", "", "_launchPos"]; +_firedEH params ["","","","","","","_projectile"]; + +// Use seeker (if terminal) +if (!(_seekerTargetPos isEqualTo [0,0,0])) exitWith {_seekerTargetPos}; + +_attackProfileStateParams params ["_startTime", "_startLOS", "_yawChange", "_pitchChange"]; +(_startLOS call CBA_fnc_vect2Polar) params ["", "_yaw", "_pitch"]; + +private _projectilePos = getPosASL _projectile; +private _distanceFromLaunch = (_launchPos distance _projectilePos) + 10; +private _flightTime = CBA_missionTime - _startTime; + +private _realYaw = _yaw + _yawChange * _flightTime; +private _realPitch = _pitch + _pitchChange * _flightTime; + +private _returnTargetPos = _launchPos vectorAdd ([_distanceFromLaunch, _realYaw, _realPitch] call CBA_fnc_polar2vect); + +if (_attackProfile == QGVAR(overflyTopAttack)) then { // Add 2m height in OTA attack mode + _returnTargetPos = _returnTargetPos vectorAdd [0,0,2]; +}; + + +#ifdef DRAW_NLAW_INFO +drawIcon3D ["\a3\ui_f\data\IGUI\Cfg\Cursors\selectover_ca.paa", [1,0,1,1], ASLtoAGL _launchPos, 0.75, 0.75, 0, "LAUNCH", 1, 0.025, "TahomaB"]; +drawIcon3D ["\a3\ui_f\data\IGUI\Cfg\Cursors\selectover_ca.paa", [0,1,1,1], ASLtoAGL (_launchPos vectorAdd (_startLOS vectorMultiply (_distanceFromLaunch + 50))), 0.75, 0.75, 0, "Original LOS", 1, 0.025, "TahomaB"]; +drawIcon3D ["\a3\ui_f\data\IGUI\Cfg\Cursors\selectover_ca.paa", [1,1,0,1], ASLtoAGL (_launchPos vectorAdd ([_distanceFromLaunch + 50, _realYaw, _realPitch] call CBA_fnc_polar2vect)), 0.75, 0.75, 0, format ["Predicted @%1sec",(floor(_flightTime * 10)/10)], 1, 0.025, "TahomaB"]; +drawLine3D [ASLtoAGL _launchPos, ASLtoAGL (_launchPos vectorAdd (_startLOS vectorMultiply (_distanceFromLaunch + 50))), [1,0,0,1]]; +drawLine3D [ASLtoAGL _launchPos, ASLtoAGL (_launchPos vectorAdd ([_distanceFromLaunch + 50, _realYaw, _realPitch] call CBA_fnc_polar2vect)), [1,1,0,1]]; +private _test = lineIntersectsSurfaces [_launchPos, _launchPos vectorAdd (_startLOS vectorMultiply 3000), player, _projectile]; +if ((count _test) > 0) then { + private _posAGL = ASLtoAGL ((_test select 0) select 0); + drawIcon3D ["\a3\ui_f\data\IGUI\Cfg\Cursors\selectover_ca.paa", [1,0,0,1], _posAGL, 0.75, 0.75, 0, "Original Impact", 1, 0.025, "TahomaB"]; +}; +#endif + +// TRACE_1("Adjusted target position", _returnTargetPos); +_returnTargetPos; diff --git a/addons/nlaw/functions/fnc_keyDown.sqf b/addons/nlaw/functions/fnc_keyDown.sqf new file mode 100644 index 0000000000..82dfbbcc2e --- /dev/null +++ b/addons/nlaw/functions/fnc_keyDown.sqf @@ -0,0 +1,81 @@ +/* + * Author: PabstMirror + * Handles the track key being held down. + * Tracks change in direction of weapon and computes angle change per second. + * + * Arguments: + * None + * + * Return Value: + * None + * + * Example: + * [] call ace_nlaw_fnc_keyDown + * + * Public: No + */ +// #define DEBUG_MODE_FULL +#include "script_component.hpp" + +TRACE_1("lock key down",GVAR(isLockKeyDown)); + +if (!alive ACE_player) exitWith {}; +if (!([ACE_player, objNull, ["isNotInside"]] call EFUNC(common,canInteractWith))) exitWith {}; +if (!(ACE_player call CBA_fnc_canUseWeapon)) exitWith {}; +if ((getNumber (configFile >> "CfgWeapons" >> (currentWeapon ACE_player) >> QGVAR(enabled))) == 0) exitWith {}; +if (GVAR(isLockKeyDown)) exitWith {ERROR("already running?");}; + +GVAR(isLockKeyDown) = true; +playSound "ACE_Sound_Click"; + +// Get starting weapon dir +((ACE_player weaponDirection (currentWeapon ACE_player)) call CBA_fnc_vect2Polar) params ["", "_yaw", "_pitch"]; + +[{ + params ["_args", "_pfID"]; + _args params ["_lastTime", "_lastYaw", "_lastPitch", "_initPhase"]; + + if ((!alive ACE_player) || + {!([ACE_player, objNull, ["isNotInside"]] call EFUNC(common,canInteractWith))} || + {!GVAR(isLockKeyDown)} || + {!(ACE_player call CBA_fnc_canUseWeapon)} || + {(getNumber (configFile >> "CfgWeapons" >> (currentWeapon ACE_player) >> QGVAR(enabled))) == 0}) + exitWith { + TRACE_1("ending track",_pfID); + [_pfID] call CBA_fnc_removePerFrameHandler; + playSound "ACE_Sound_Click"; + + [{ // reset gvars after a short delay + TRACE_1("reset vars",_this); + GVAR(yawChange) = 0; + GVAR(pitchChange) = 0; + }, [], 0.5] call CBA_fnc_waitAndExecute; + }; + + private _deltaT = CBA_missionTime - _lastTime; + if (_deltaT == 0) exitWith {}; + if (_initPhase && {_deltaT < 0.75}) exitWith {}; + + ((ACE_player weaponDirection (currentWeapon ACE_player)) call CBA_fnc_vect2Polar) params ["", "_yaw", "_pitch"]; + private _yawChange = ([_yaw - _lastYaw] call CBA_fnc_simplifyAngle180) / _deltaT; + private _pitchChange = ([_pitch - _lastPitch] call CBA_fnc_simplifyAngle180) / _deltaT; + + if (_initPhase) then { // initial value will use first 0.75 seconds of input + GVAR(yawChange) = _yawChange; + GVAR(pitchChange) = _pitchChange; + _args set [3, false]; + } else { + // smoothing factor alpha - higher values will be more responsive to change, but also spike higher on jerky mouse movmeent + private _alpha = _deltaT / 3; + GVAR(yawChange) = (_yawChange * _alpha) + GVAR(yawChange) * (1 - _alpha); + GVAR(pitchChange) = (_pitchChange * _alpha) + GVAR(pitchChange) * (1 - _alpha); + }; + + _args set [0, CBA_missionTime]; + _args set [1, _yaw]; + _args set [2, _pitch]; + + #ifdef DEBUG_MODE_FULL + hintSilent format ["Instantaneous\nYaw: %1\n Pitch: %2\nGVAR\nYaw: %3\nPitch: %4", _yawChange, _pitchChange, GVAR(yawChange), GVAR(pitchChange)]; + #endif +}, .25, [CBA_missionTime, _yaw, _pitch, true]] call CBA_fnc_addPerFrameHandler; diff --git a/addons/nlaw/functions/fnc_onFired.sqf b/addons/nlaw/functions/fnc_onFired.sqf new file mode 100644 index 0000000000..7049dfb918 --- /dev/null +++ b/addons/nlaw/functions/fnc_onFired.sqf @@ -0,0 +1,62 @@ +/* + * Author: PabstMirror + * Sets up missile guidance state arrays (called from missileGuidance's onFired). + * + * Arguments: + * Guidance Arg Array + * + * Return Value: + * None + * + * Example: + * [] call ace_nlaw_fnc_onFired + * + * Public: No + */ +#include "script_component.hpp" + +params ["_firedEH", "_launchParams", "_flightParams", "_seekerParams", "_stateParams"]; +_firedEH params ["_shooter","","","","","","_projectile"]; +_launchParams params ["","_targetLaunchParams","","_attackProfile"]; +_targetLaunchParams params ["_target"]; +_stateParams params ["", "", "_attackProfileStateParams"]; + +// Reset _launchPos origin as projectile's height instead of player's foot +_targetLaunchParams set [2, getPosASL _projectile]; + +// Get state params: +TRACE_3("start of attack profile",_attackProfile,_shooter,vectorDir _projectile); + +private _firedLOS = _shooter weaponDirection (currentWeapon _shooter); +private _yawChange = 0; +private _pitchChange = 0; + +if (_shooter == ACE_player) then { + TRACE_2("isPlayer",GVAR(yawChange),GVAR(pitchChange)); + _yawChange = GVAR(yawChange); + _pitchChange = GVAR(pitchChange); + TRACE_1("los check",_firedLOS call CBA_fnc_vect2Polar); +} else { + if ((!isNil "_target") && {!isNull _target}) then { + _firedLOS = (getPosASL _projectile) vectorFromTo (aimPos _target); + (((eyePos _shooter) vectorFromTo (aimPos _target)) call CBA_fnc_vect2Polar) params ["", "_startYaw", "_startPitch"]; + // Add some random error to AI's velocity prediction: + private _random = random [(_shooter skillFinal "aimingAccuracy") min 0.9, 1, 2-((_shooter skillFinal "aimingAccuracy") min 0.9)]; + (((eyePos _shooter) vectorFromTo ((aimPos _target) vectorAdd ((velocity _target) vectorMultiply (_random)))) call CBA_fnc_vect2Polar) params ["", "_predictedYaw", "_predictedPitch"]; + _yawChange = ([_predictedYaw - _startYaw] call CBA_fnc_simplifyAngle180); + _pitchChange = ([_predictedPitch - _startPitch] call CBA_fnc_simplifyAngle180); + TRACE_1("AI",_target); + } else { + TRACE_1("AI - no target",_target); + }; +}; + +// Limit Max Deflection +_yawChange = -10 max _yawChange min 10; +_pitchChange = -10 max _pitchChange min 10; + +TRACE_3("attackProfileStateParams",_firedLOS,_yawChange,_pitchChange); +_attackProfileStateParams set [0, CBA_missionTime]; +_attackProfileStateParams set [1, _firedLOS]; +_attackProfileStateParams set [2, _yawChange]; +_attackProfileStateParams set [3, _pitchChange]; diff --git a/addons/nlaw/functions/fnc_seeker.sqf b/addons/nlaw/functions/fnc_seeker.sqf new file mode 100644 index 0000000000..850c966f56 --- /dev/null +++ b/addons/nlaw/functions/fnc_seeker.sqf @@ -0,0 +1,94 @@ +/* + * Author: PabstMirror + * Handles the top down attack seeker for missile guidance. + * Has a very short range (IR/Magnetic?) seeker that will trigger the shaped charge midair above the target. + * + * Arguments: + * 1: Guidance Arg Array + * 2: Seeker State + * + * Return Value: + * Seeker Pos + * + * Example: + * [] call ace_nlaw_fnc_seeker + * + * Public: No + */ +// #define DEBUG_MODE_FULL +#include "script_component.hpp" + +params ["", "_args", "_seekerStateParams"]; +_args params ["_firedEH", "_launchParams", "", "_seekerParams", "_stateParams"]; +_firedEH params ["","","","","","","_projectile"]; +_launchParams params ["", "_targetLaunchParams", "", "_attackProfile"]; +_targetLaunchParams params ["", "", "_launchPos"]; + +if (_attackProfile == QGVAR(directAttack)) exitWith {[0,0,0]}; + +private _projPos = getPosASL _projectile; + +// Arm seeker after 20 meters +if ((_projPos distance _launchPos) >= 20) then { + scopeName "targetScan"; + BEGIN_COUNTER(targetScan); + + if (_seekerStateParams isEqualTo []) then { + TRACE_2("Seeker Armed",_projPos distance _launchPos,diag_fps); + _seekerStateParams set [0, _projPos]; // Set _lastPos to current position + }; + + _seekerStateParams params ["_lastPos", "_terminal"]; + if (_terminal) exitWith {}; + + private _vectorDir = _lastPos vectorFromTo _projPos; + private _frameDistance = _lastPos vectorDistance _projPos; + + // Distance traveled depends on velocity and FPS - at 60fps it will be ~4m + // Step size will effect accuracy and performance costs + for "_stepSize" from 0 to _frameDistance step 0.5 do { + // This represents a position that the missile was at between the last frame and now + private _virtualPos = _lastPos vectorAdd (_vectorDir vectorMultiply _stepSize); + #ifdef DRAW_NLAW_INFO + drawLine3D [ASLtoAGL _virtualPos, ASLtoAGL (_virtualPos vectorAdd [0,0,-5]), [1,0,_stepSize/(_frameDistance max 0.1),1]]; + #endif + + // Limit scan to 5 meters directly down (shaped charge jet has a very limited range) + private _res = lineIntersectsSurfaces [_virtualPos, (_virtualPos vectorAdd [0,0,-5]), _projectile]; + if (!(_res isEqualTo [])) then { + (_res select 0) params ["_targetPos", "", "_target"]; + if ((_target isKindOf "Tank") || {_target isKindOf "Car"} || {_target isKindOf "Air"}) exitWith { + TRACE_3("Firing shaped charge down",_target,_targetPos distance _virtualPos,_frameDistance); + TRACE_2("",_target worldToModel (ASLtoAGL _virtualPos),boundingBoxReal _target); + _virtualPos = _virtualPos vectorAdd (_vectorDir vectorMultiply 1.25); + + deleteVehicle _projectile; + + // Damage and effects of missile exploding (timeToLive is 0 so should happen next frame) + private _explosion = "ACE_NLAW_Explosion" createVehicle _virtualPos; + _explosion setPosASL _virtualPos; + + // Just damage from shaped charge + private _shapedCharage = "ACE_NLAW_ShapedCharge" createVehicle _virtualPos; + _shapedCharage setPosASL _virtualPos; + _shapedCharage setVectorDirAndUp [[0,0,-1], [1,0,0]]; + _shapedCharage setVelocity [0,0,-300]; + + _seekerStateParams set [1, true]; + + END_COUNTER(targetScan); + breakOut "targetScan"; + }; + }; + }; + _seekerStateParams set [0, _projPos]; + END_COUNTER(targetScan); +}; + +// Exploded, return dummy value +if (_seekerStateParams param [1, false]) exitWith { + [0,0,1] +}; + +// return: +[0,0,0] diff --git a/addons/nlaw/functions/script_component.hpp b/addons/nlaw/functions/script_component.hpp new file mode 100644 index 0000000000..50d8cac4c1 --- /dev/null +++ b/addons/nlaw/functions/script_component.hpp @@ -0,0 +1 @@ +#include "\z\ace\addons\nlaw\script_component.hpp" diff --git a/addons/nlaw/script_component.hpp b/addons/nlaw/script_component.hpp new file mode 100644 index 0000000000..2cabaf7e47 --- /dev/null +++ b/addons/nlaw/script_component.hpp @@ -0,0 +1,18 @@ +#define COMPONENT nlaw +#define COMPONENT_BEAUTIFIED NLAW +#include "\z\ace\addons\main\script_mod.hpp" + +// #define DRAW_NLAW_INFO +// #define DEBUG_MODE_FULL +// #define DISABLE_COMPILE_CACHE +// #define ENABLE_PERFORMANCE_COUNTERS + +#ifdef DEBUG_ENABLED_NLAW + #define DEBUG_MODE_FULL +#endif + +#ifdef DEBUG_SETTINGS_NLAW + #define DEBUG_SETTINGS DEBUG_SETTINGS_NLAW +#endif + +#include "\z\ace\addons\main\script_macros.hpp" diff --git a/addons/nlaw/stringtable.xml b/addons/nlaw/stringtable.xml new file mode 100644 index 0000000000..7027490066 --- /dev/null +++ b/addons/nlaw/stringtable.xml @@ -0,0 +1,32 @@ + + + + + NLAW Track Target (Hold) + NLAW Zielverfolgung + NLAW Traccia Bersaglio (Mantieni) + NALW 目標の追跡 (押しっぱ) + 次世代轻型反坦克导弹发射器追踪目标 (按住) + 次世代輕型反坦克導彈發射器追蹤目標 (按住) + Śledzenie Celu NLAW (Przytrzymaj) + + + Direct Attack + Direkter Angriff + Attacco Diretto + ダイレクト アタック + 直射模式 + 直射模式 + Bezpośredni atak + + + Overfly Top Attack + Überflugangriff + Attacco dall'alto + オーバーフライ トップ アタック + 攻顶模式 + 攻頂模式 + Atak z góry + + + diff --git a/addons/noidle/CfgMoves.hpp b/addons/noidle/CfgMoves.hpp index 1b8848ff00..2b5b06529a 100644 --- a/addons/noidle/CfgMoves.hpp +++ b/addons/noidle/CfgMoves.hpp @@ -1,4 +1,3 @@ - class CfgMovesBasic { class StandBase; }; @@ -7,29 +6,29 @@ class CfgMovesMaleSdr: CfgMovesBasic { class States { // rifle class AmovPercMstpSlowWrflDnon: StandBase { - variantsPlayer[] = {/*"AidlPercMstpSlowWrflDnon_G01",0.5,"AidlPercMstpSlowWrflDnon_G02",0.125,"AidlPercMstpSlowWrflDnon_G03",0.125,"AidlPercMstpSlowWrflDnon_G04",0.125,"AidlPercMstpSlowWrflDnon_G05",0.125*/}; + variantsPlayer[] = {/*"AidlPercMstpSlowWrflDnon_G01", 0.5, "AidlPercMstpSlowWrflDnon_G02", 0.125, "AidlPercMstpSlowWrflDnon_G03", 0.125, "AidlPercMstpSlowWrflDnon_G04", 0.125, "AidlPercMstpSlowWrflDnon_G05", 0.125*/}; }; class AmovPknlMstpSlowWrflDnon: AmovPercMstpSlowWrflDnon { - variantsPlayer[] = {/*"AidlPknlMstpSlowWrflDnon_G01",0.25,"AidlPknlMstpSlowWrflDnon_G02",0.25,"AidlPknlMstpSlowWrflDnon_G03",0.25*/}; + variantsPlayer[] = {/*"AidlPknlMstpSlowWrflDnon_G01", 0.25, "AidlPknlMstpSlowWrflDnon_G02", 0.25, "AidlPknlMstpSlowWrflDnon_G03", 0.25*/}; }; // pistol class AmovPercMstpSrasWpstDnon; class AmovPercMstpSlowWpstDnon: AmovPercMstpSrasWpstDnon { - variantsPlayer[] = {/*"AidlPercMstpSlowWpstDnon_G01",0.333,"AidlPercMstpSlowWpstDnon_G02",0.333,"AidlPercMstpSlowWpstDnon_G03",0.334*/}; + variantsPlayer[] = {/*"AidlPercMstpSlowWpstDnon_G01", 0.333, "AidlPercMstpSlowWpstDnon_G02", 0.333, "AidlPercMstpSlowWpstDnon_G03", 0.334*/}; }; class AmovPknlMstpSrasWpstDnon; class AmovPknlMstpSlowWpstDnon: AmovPknlMstpSrasWpstDnon { - variantsPlayer[] = {/*"AidlPknlMstpSlowWpstDnon_G03",0.333,"AidlPknlMstpSlowWpstDnon_G02",0.333,"AidlPknlMstpSlowWpstDnon_G01",0.334*/}; + variantsPlayer[] = {/*"AidlPknlMstpSlowWpstDnon_G03", 0.333, "AidlPknlMstpSlowWpstDnon_G02", 0.333, "AidlPknlMstpSlowWpstDnon_G01", 0.334*/}; }; // none class AmovPercMstpSnonWnonDnon: StandBase { - variantsPlayer[] = {/*"AidlPercMstpSnonWnonDnon_G01",0.16,"AidlPercMstpSnonWnonDnon_G02",0.16,"AidlPercMstpSnonWnonDnon_G03",0.16,"AidlPercMstpSnonWnonDnon_G04",0.16,"AidlPercMstpSnonWnonDnon_G05",0.16,"AidlPercMstpSnonWnonDnon_G06",0.16*/}; + variantsPlayer[] = {/*"AidlPercMstpSnonWnonDnon_G01", 0.16, "AidlPercMstpSnonWnonDnon_G02", 0.16, "AidlPercMstpSnonWnonDnon_G03", 0.16, "AidlPercMstpSnonWnonDnon_G04", 0.16, "AidlPercMstpSnonWnonDnon_G05", 0.16, "AidlPercMstpSnonWnonDnon_G06", 0.16*/}; }; class AmovPknlMstpSnonWnonDnon: AmovPercMstpSnonWnonDnon { - variantsPlayer[] = {/*"AidlPknlMstpSnonWnonDnon_G01",0.33,"AidlPknlMstpSnonWnonDnon_G02",0.33,"AidlPknlMstpSnonWnonDnon_G03",0.33*/}; + variantsPlayer[] = {/*"AidlPknlMstpSnonWnonDnon_G01", 0.33, "AidlPknlMstpSnonWnonDnon_G02", 0.33, "AidlPknlMstpSnonWnonDnon_G03", 0.33*/}; }; }; }; diff --git a/addons/noradio/CfgEventhandlers.hpp b/addons/noradio/CfgEventhandlers.hpp index 386d98d241..b0cc92b513 100644 --- a/addons/noradio/CfgEventhandlers.hpp +++ b/addons/noradio/CfgEventhandlers.hpp @@ -1,4 +1,3 @@ - class Extended_PostInit_EventHandlers { class ADDON { init = QUOTE(call COMPILE_FILE(XEH_postInit)); diff --git a/addons/noradio/XEH_postInit.sqf b/addons/noradio/XEH_postInit.sqf index 722a1d358c..6ca39e0c23 100644 --- a/addons/noradio/XEH_postInit.sqf +++ b/addons/noradio/XEH_postInit.sqf @@ -1,7 +1,7 @@ -// by commy2 +// By commy2 #include "script_component.hpp" -// unmute unit if that player disconnects +// Unmute unit if that player disconnects if (isServer) then { addMissionEventHandler ["HandleDisconnect", { [_this select 0, "isPlayer"] call EFUNC(common,unmuteUnit); @@ -15,14 +15,14 @@ if (!isNull ace_player) then { [ace_player, "isPlayer"] call EFUNC(common,muteUnit); }; -// mutes/unmutes units when the player changes +// Mutes/unmutes units when the player changes ["unit", { params ["_newPlayer", "_oldPlayer"]; - // mute the new player + // Mute the new player [_newPlayer, "isPlayer"] call EFUNC(common,muteUnit); - // unmute the old player + // Unmute the old player if (alive _oldPlayer) then { [_oldPlayer, "isPlayer"] call EFUNC(common,unmuteUnit); }; diff --git a/addons/norearm/CfgActions.hpp b/addons/norearm/CfgActions.hpp index 336c31273a..003ad3ae67 100644 --- a/addons/norearm/CfgActions.hpp +++ b/addons/norearm/CfgActions.hpp @@ -1,4 +1,3 @@ - class CfgActions { class None; class Rearm: None { diff --git a/addons/optics/CfgEventHandlers.hpp b/addons/optics/CfgEventHandlers.hpp index becf395052..0d3301d6e0 100644 --- a/addons/optics/CfgEventHandlers.hpp +++ b/addons/optics/CfgEventHandlers.hpp @@ -1,4 +1,3 @@ - class Extended_PreStart_EventHandlers { class ADDON { init = QUOTE(call COMPILE_FILE(XEH_preStart)); diff --git a/addons/optics/CfgOpticsEffect.hpp b/addons/optics/CfgOpticsEffect.hpp index 8638277732..30c372fdac 100644 --- a/addons/optics/CfgOpticsEffect.hpp +++ b/addons/optics/CfgOpticsEffect.hpp @@ -1,7 +1,7 @@ class CfgOpticsEffect { class ACE_OpticsRadBlur1 { type = "radialblur"; - params[] = {0.015,0,0.14,0.2}; + params[] = {0.015, 0, 0.14, 0.2}; priority = 950; }; }; diff --git a/addons/optics/CfgRscTitles.hpp b/addons/optics/CfgRscTitles.hpp index 42a2326a0e..3df4632e16 100644 --- a/addons/optics/CfgRscTitles.hpp +++ b/addons/optics/CfgRscTitles.hpp @@ -9,12 +9,12 @@ class RscInGameUI { }; class ACE_RscWeaponZeroing: RscWeaponZeroing { - controls[] = {"CA_Zeroing","CA_FOVMode","ACE_DrawReticleHelper","ACE_ScriptedReticle"}; + controls[] = {"CA_Zeroing", "CA_FOVMode", "ACE_DrawReticleHelper", "ACE_ScriptedReticle"}; - class CA_FOVMode: RscOpticsValue { // idea by Taosenai. Apparently this can be used via isNil check to determine wheter the scope or the kolimator is used + class CA_FOVMode: RscOpticsValue { // Idea by Taosenai. Apparently this can be used via isNil check to determine wheter the scope or the kolimator is used idc = 154; style = 2; - colorText[] = {0,0,0,0}; + colorText[] = {0, 0, 0, 0}; x = 0; y = 0; w = 0; @@ -40,12 +40,12 @@ class RscInGameUI { }; class ACE_RscWeapon_base: RscWeaponZeroing { - controls[] = {"CA_Zeroing","CA_FOVMode","ACE_DrawReticleHelper","ReticleDay","ReticleNight","BodyNight","BodyDay", "trippleHeadLeft", "trippleHeadRight"}; // don't change this order + controls[] = {"CA_Zeroing", "CA_FOVMode", "ACE_DrawReticleHelper", "ReticleDay", "ReticleNight", "BodyNight", "BodyDay", "trippleHeadLeft", "trippleHeadRight"}; // Don't change this order - class CA_FOVMode: RscOpticsValue { // idea by Taosenai. Apparently this can be used via isNil check to determine wheter the scope or the kolimator is used + class CA_FOVMode: RscOpticsValue { // Idea by Taosenai. Apparently this can be used via isNil check to determine wheter the scope or the kolimator is used idc = 154; style = 2; - colorText[] = {0,0,0,0}; + colorText[] = {0, 0, 0, 0}; x = 0; y = 0; w = 0; @@ -66,12 +66,12 @@ class RscInGameUI { size = 0; sizeEx = 1; text = ""; - colorText[] = {1,1,1,0}; - colorBackground[] = {0,0,0,0}; - x = safezoneX+0.5*safezoneW-0.5*SIZEX; - y = safezoneY+0.5*safezoneH-0.5*SIZEX*(4/3); + colorText[] = {1, 1, 1, 0}; + colorBackground[] = {0, 0, 0, 0}; + x = safezoneX + 0.5 * safezoneW - 0.5 * SIZEX; + y = safezoneY + 0.5 * safezoneH - 0.5 * SIZEX * (4 / 3); w = SIZEX; - h = SIZEX*(4/3); + h = SIZEX * (4 / 3); }; class ReticleNight: ReticleDay { @@ -84,10 +84,10 @@ class RscInGameUI { class BodyDay: ReticleDay { idc = 1713005; text = ""; - x = safezoneX+0.5*safezoneW-0.5*SIZEX; - y = safezoneY+0.5*safezoneH-0.5*SIZEX*(4/3); + x = safezoneX + 0.5 * safezoneW - 0.5 * SIZEX; + y = safezoneY + 0.5 * safezoneH - 0.5 * SIZEX * (4 / 3); w = SIZEX; - h = SIZEX*(4/3); + h = SIZEX * (4 / 3); }; class BodyNight: BodyDay { @@ -95,21 +95,21 @@ class RscInGameUI { text = ""; }; - //These are just black side panels to cover the areas that the optics p3d doesn't cover - //It will ONLY effect tripple head users as (safezoneX == safeZoneXAbs) for everyone else - //Reference PR #1156: + // These are just black side panels to cover the areas that the optics p3d doesn't cover + // It will ONLY effect tripple head users as (safezoneX == safeZoneXAbs) for everyone else + // Reference PR #1156: class trippleHeadLeft: RscText { idc = 1713010; x = "safeZoneXAbs"; Y = "safezoneY"; - W = "(safezoneX - safeZoneXAbs) * ((getResolution select 4)/(16/3))"; + W = "(safezoneX - safeZoneXAbs) * ((getResolution select 4) / (16 / 3))"; H = "safeZoneH"; - colorBackground[] = {0,0,0,1}; + colorBackground[] = {0, 0, 0, 1}; }; class trippleHeadRight: trippleHeadLeft { idc = 1713011; - x = "safeZoneXAbs + safeZoneWAbs - (safezoneX - safeZoneXABS) * ((getResolution select 4)/(16/3))"; - colorBackground[] = {0,0,0,1}; + x = "safeZoneXAbs + safeZoneWAbs - (safezoneX - safeZoneXABS) * ((getResolution select 4) / (16 / 3))"; + colorBackground[] = {0, 0, 0, 1}; }; }; @@ -190,12 +190,12 @@ class RscInGameUI { _ctrl = (D displayCtrl 1713006); -_sizeX = 1.54/(getResolution select 5); -_sizeY = _sizeX*safezoneW/safezoneH; +_sizeX = 1.54 / (getResolution select 5); +_sizeY = _sizeX * safezoneW / safezoneH; _ctrl ctrlSetPosition [ - safezoneX+0.5*safezoneW-0.5*_sizeX, - safezoneY+0.5*safezoneH-0.5*_sizeY, + safezoneX + 0.5 * safezoneW - 0.5 * _sizeX, + safezoneY + 0.5 * safezoneH - 0.5 * _sizeY, _sizeX, _sizeY ]; diff --git a/addons/optics/CfgWeapons.hpp b/addons/optics/CfgWeapons.hpp index 75b0319b62..c9dfbb8d7b 100644 --- a/addons/optics/CfgWeapons.hpp +++ b/addons/optics/CfgWeapons.hpp @@ -86,9 +86,9 @@ class CfgWeapons { opticsZoomInit = 0.0872664626; opticsZoomMax = 0.0872664626; opticsZoomMin = 0.0872664626; - opticsPPEffects[] = {"OpticsCHAbera5","OpticsBlur5","ACE_OpticsRadBlur1"}; + opticsPPEffects[] = {"OpticsCHAbera5", "OpticsBlur5", "ACE_OpticsRadBlur1"}; opticsDisablePeripherialVision = 0; - visionMode[] = {"Normal","NVG"}; + visionMode[] = {"Normal", "NVG"}; }; }; }; @@ -135,7 +135,7 @@ class CfgWeapons { opticsZoomInit = 0.0872664626; opticsZoomMax = 0.0872664626; opticsZoomMin = 0.0872664626; - opticsPPEffects[] = {"OpticsCHAbera5","OpticsBlur5","ACE_OpticsRadBlur1"}; + opticsPPEffects[] = {"OpticsCHAbera5", "OpticsBlur5", "ACE_OpticsRadBlur1"}; opticsDisablePeripherialVision = 0; visionMode[] = {"Normal"}; }; @@ -184,7 +184,7 @@ class CfgWeapons { opticsZoomInit = 0.0872664626; opticsZoomMax = 0.0872664626; opticsZoomMin = 0.0872664626; - opticsPPEffects[] = {"OpticsCHAbera5","OpticsBlur5","ACE_OpticsRadBlur1"}; + opticsPPEffects[] = {"OpticsCHAbera5", "OpticsBlur5", "ACE_OpticsRadBlur1"}; opticsDisablePeripherialVision = 0; visionMode[] = {"Normal"}; }; @@ -227,13 +227,13 @@ class CfgWeapons { class ItemInfo: ItemInfo { class OpticsModes: OpticsModes { class Snip: Snip { - modelOptics[] = {QPATHTOF(models\ace_optics_reticle90.p3d),QPATHTOF(models\ace_optics_reticle90.p3d)}; + modelOptics[] = {QPATHTOF(models\ace_optics_reticle90.p3d), QPATHTOF(models\ace_optics_reticle90.p3d)}; useModelOptics = 1; opticsZoomInit = 0.0116; opticsZoomMax = 0.0464; opticsZoomMin = 0.0116; discreteFOV[] = {0.0464, 0.0116}; - opticsPPEffects[] = {"OpticsCHAbera1","OpticsBlur1","ACE_OpticsRadBlur1"}; + opticsPPEffects[] = {"OpticsCHAbera1", "OpticsBlur1", "ACE_OpticsRadBlur1"}; opticsDisablePeripherialVision = 0; }; class Iron: Iron {}; @@ -250,7 +250,7 @@ class CfgWeapons { class ItemInfo: ItemInfo { class OpticsModes: OpticsModes { class Snip: Snip { - modelOptics[] = {QPATHTOF(models\ace_optics_pip.p3d),QPATHTOF(models\ace_optics_pip.p3d)}; + modelOptics[] = {QPATHTOF(models\ace_optics_pip.p3d), QPATHTOF(models\ace_optics_pip.p3d)}; }; class Iron: Iron {}; }; @@ -279,13 +279,13 @@ class CfgWeapons { class ItemInfo: ItemInfo { class OpticsModes: OpticsModes { class Snip: Snip { - modelOptics[] = {QPATHTOF(models\ace_optics_reticle90.p3d),QPATHTOF(models\ace_optics_reticle90.p3d)}; + modelOptics[] = {QPATHTOF(models\ace_optics_reticle90.p3d), QPATHTOF(models\ace_optics_reticle90.p3d)}; useModelOptics = 1; opticsZoomInit = 0.0116; opticsZoomMax = 0.0464; opticsZoomMin = 0.0116; discreteFOV[] = {}; - opticsPPEffects[] = {"OpticsCHAbera1","OpticsBlur1","ACE_OpticsRadBlur1"}; + opticsPPEffects[] = {"OpticsCHAbera1", "OpticsBlur1", "ACE_OpticsRadBlur1"}; opticsDisablePeripherialVision = 0; }; }; @@ -301,7 +301,7 @@ class CfgWeapons { class ItemInfo: ItemInfo { class OpticsModes: OpticsModes { class Snip: Snip { - modelOptics[] = {QPATHTOF(models\ace_optics_pip.p3d),QPATHTOF(models\ace_optics_pip.p3d)}; + modelOptics[] = {QPATHTOF(models\ace_optics_pip.p3d), QPATHTOF(models\ace_optics_pip.p3d)}; }; }; }; diff --git a/addons/optics/XEH_PREP.hpp b/addons/optics/XEH_PREP.hpp index 2b846a552a..8eb8eb1eb5 100644 --- a/addons/optics/XEH_PREP.hpp +++ b/addons/optics/XEH_PREP.hpp @@ -1,4 +1,3 @@ - PREP(handleFired); PREP(onDrawScope); PREP(onDrawScope2D); diff --git a/addons/optics/XEH_postInit.sqf b/addons/optics/XEH_postInit.sqf index a4f118619b..2c02e72638 100644 --- a/addons/optics/XEH_postInit.sqf +++ b/addons/optics/XEH_postInit.sqf @@ -18,7 +18,7 @@ GVAR(camera) = objNull; params ["", "_isfeatureCameraActive"]; TRACE_1("ace_activeCameraChanged",_isfeatureCameraActive); if (!_isfeatureCameraActive) then { - //Destroy the camera, and it will be re-created in the onDrawScope2d helper + // Destroy the camera, and it will be re-created in the onDrawScope2d helper if (!isNull GVAR(camera)) then { GVAR(camera) cameraEffect ["TERMINATE", "BACK"]; camDestroy GVAR(camera); diff --git a/addons/optics/XEH_preInit.sqf b/addons/optics/XEH_preInit.sqf index a7feade1c3..b47cf6628d 100644 --- a/addons/optics/XEH_preInit.sqf +++ b/addons/optics/XEH_preInit.sqf @@ -2,6 +2,8 @@ ADDON = false; +PREP_RECOMPILE_START; #include "XEH_PREP.hpp" +PREP_RECOMPILE_END; ADDON = true; diff --git a/addons/optics/functions/fnc_handleFired.sqf b/addons/optics/functions/fnc_handleFired.sqf index f1216fb15d..435e7e8e7c 100644 --- a/addons/optics/functions/fnc_handleFired.sqf +++ b/addons/optics/functions/fnc_handleFired.sqf @@ -1,5 +1,5 @@ /* - * Original Author: Taosenai + * Author: Taosenai * Adapted By: KoffeinFlummi, commy2 * * Animates the scope when firing. Called from the unified fired EH only for the local player. @@ -9,15 +9,21 @@ * * Return Value: * None + * + * Example: + * call ace_optics_fnc_handleFired + * + * Public: No */ + #include "script_component.hpp" -//IGNORE_PRIVATE_WARNING ["_unit", "_weapon", "_muzzle", "_mode", "_ammo", "_magazine", "_projectile", "_vehicle", "_gunner", "_turret"]; +// IGNORE_PRIVATE_WARNING ["_unit", "_weapon", "_muzzle", "_mode", "_ammo", "_magazine", "_projectile", "_vehicle", "_gunner", "_turret"]; TRACE_10("firedEH:",_unit, _weapon, _muzzle, _mode, _ammo, _magazine, _projectile, _vehicle, _gunner, _turret); disableSerialization; -// check if compatible scope is used +// Check if compatible scope is used private _display = uiNamespace getVariable [QGVAR(RscWeaponInfo2D), displayNull]; if (isNull _display) exitWith {}; @@ -30,25 +36,23 @@ private _recoilCoef = switch (true) do { }; // Constants which determine how the scope recoils -private ["_recoilScope", "_reticleShiftX", "_reticleShiftY", "_scopeShiftX", "_scopeShiftY"]; -_recoilScope = _recoilCoef * linearConversion [0, 1, random 1, SCOPE_RECOIL_MIN, SCOPE_RECOIL_MAX, false]; +private _recoilScope = _recoilCoef * linearConversion [0, 1, random 1, SCOPE_RECOIL_MIN, SCOPE_RECOIL_MAX, false]; -_reticleShiftX = _recoilCoef * linearConversion [0, 1, random 1, RETICLE_SHIFT_X_MIN, RETICLE_SHIFT_X_MAX, false]; -_reticleShiftY = _recoilCoef * linearConversion [0, 1, random 1, RETICLE_SHIFT_Y_MIN, RETICLE_SHIFT_Y_MAX, false]; +private _reticleShiftX = _recoilCoef * linearConversion [0, 1, random 1, RETICLE_SHIFT_X_MIN, RETICLE_SHIFT_X_MAX, false]; +private _reticleShiftY = _recoilCoef * linearConversion [0, 1, random 1, RETICLE_SHIFT_Y_MIN, RETICLE_SHIFT_Y_MAX, false]; -_scopeShiftX = _recoilCoef * linearConversion [0, 1, random 1, SCOPE_SHIFT_X_MIN, SCOPE_SHIFT_X_MAX, false]; -_scopeShiftY = _recoilCoef * linearConversion [0, 1, random 1, SCOPE_SHIFT_Y_MIN, SCOPE_SHIFT_Y_MAX, false]; +private _scopeShiftX = _recoilCoef * linearConversion [0, 1, random 1, SCOPE_SHIFT_X_MIN, SCOPE_SHIFT_X_MAX, false]; +private _scopeShiftY = _recoilCoef * linearConversion [0, 1, random 1, SCOPE_SHIFT_Y_MIN, SCOPE_SHIFT_Y_MAX, false]; // Create and commit recoil effect -private ["_sizeX", "_sizeY"]; -_sizeX = (0.75 + _recoilScope)/(getResolution select 5); -_sizeY = _sizeX*(4/3); +private _sizeX = (0.75 + _recoilScope) / (getResolution select 5); +private _sizeY = _sizeX * (4 / 3); private _positionReticle = [ - safezoneX + 0.5 * safezoneW - 0.5*(_sizeX + _reticleShiftX), - safezoneY + 0.5 * safezoneH - 0.5*(_sizeY + _reticleShiftY), + safezoneX + 0.5 * safezoneW - 0.5 * (_sizeX + _reticleShiftX), + safezoneY + 0.5 * safezoneH - 0.5 * (_sizeY + _reticleShiftY), _sizeX, _sizeY ]; @@ -57,8 +61,8 @@ private _positionReticle = [ (_display displayCtrl 1713002) ctrlSetPosition _positionReticle; private _positionBody = [ - safezoneX + 0.5 * safezoneW - 0.5*(2 * _sizeX + _scopeShiftX), - safezoneY + 0.5 * safezoneH - 0.5*(2 * _sizeY + _scopeShiftY), + safezoneX + 0.5 * safezoneW - 0.5 * (2 * _sizeX + _scopeShiftX), + safezoneY + 0.5 * safezoneH - 0.5 * (2 * _sizeY + _scopeShiftY), 2 * _sizeX, 2 * _sizeY ]; @@ -72,8 +76,8 @@ private _positionBody = [ (_display displayCtrl 1713006) ctrlCommit 0; // Bring them all back -_sizeX = 0.75/(getResolution select 5); -_sizeY = _sizeX*(4/3); +_sizeX = 0.75 / (getResolution select 5); +_sizeY = _sizeX * (4 / 3); _positionReticle = [ safezoneX + 0.5 * safezoneW - 0.5 * _sizeX, diff --git a/addons/optics/functions/fnc_onDrawScope.sqf b/addons/optics/functions/fnc_onDrawScope.sqf index fd899b5a02..1f2f86e21a 100644 --- a/addons/optics/functions/fnc_onDrawScope.sqf +++ b/addons/optics/functions/fnc_onDrawScope.sqf @@ -1,4 +1,19 @@ -// by commy2 +/* + * Author: commy2 + * + * + * Arguments: + * 0: Display + * + * Return Value: + * None + * + * Example: + * [DISPLAY] call ace_optics_fnc_onDrawScope + * + * Public: No + */ + #include "script_component.hpp" disableSerialization; @@ -11,12 +26,12 @@ if (!ctrlShown (_display displayCtrl 154)) exitWith { _control ctrlShow false; }; -private _sizeX = (call EFUNC(common,getZoom))/4; -private _sizeY = _sizeX*safezoneW/safezoneH; +private _sizeX = (call EFUNC(common,getZoom)) / 4; +private _sizeY = _sizeX * safezoneW / safezoneH; _control ctrlSetPosition [ - safezoneX+0.5*safezoneW-0.5*_sizeX, - safezoneY+0.5*safezoneH-0.5*_sizeY, + safezoneX + 0.5 * safezoneW - 0.5 * _sizeX, + safezoneY + 0.5 * safezoneH - 0.5 * _sizeY, _sizeX, _sizeY ]; diff --git a/addons/optics/functions/fnc_onDrawScope2D.sqf b/addons/optics/functions/fnc_onDrawScope2D.sqf index e8b26dca65..cdfcca6b00 100644 --- a/addons/optics/functions/fnc_onDrawScope2D.sqf +++ b/addons/optics/functions/fnc_onDrawScope2D.sqf @@ -7,7 +7,7 @@ * 0: Display (RscInGameUI for a weapon) * * Return Value: - * Nothing + * None * * Example: * [ACE_RscWeapon_Arco's Display] call ace_optics_fnc_onDrawScope2D @@ -32,7 +32,7 @@ if (_isPIP) then { }; // PiP technique by BadBenson - GVAR(camera) = "camera" camCreate positionCameraToWorld [0,0,0]; + GVAR(camera) = "camera" camCreate positionCameraToWorld [0, 0, 0]; GVAR(camera) camSetFov 0.7; GVAR(camera) camSetTarget ACE_player; GVAR(camera) camCommit 1; @@ -42,7 +42,7 @@ if (_isPIP) then { TRACE_2("created new pip camera",GVAR(camera),isNull GVAR(camera)); - //Start a waitUntil to handle destruction after GVAR(pipLastFrame) is no longer updated + // Start a waitUntil to handle destruction after GVAR(pipLastFrame) is no longer updated [{ (abs (diag_frameno - GVAR(pipLastFrame))) > 1 }, { @@ -64,8 +64,8 @@ if (!ctrlShown (_display displayCtrl 154)) exitWith { }; if (_isPIP) then { - GVAR(camera) setPosATL positionCameraToWorld [0,0,0.4]; - GVAR(camera) camPrepareTarget positionCameraToWorld [0,0,50]; + GVAR(camera) setPosATL positionCameraToWorld [0, 0, 0.4]; + GVAR(camera) camPrepareTarget positionCameraToWorld [0, 0, 50]; GVAR(camera) camCommitPrepared 0; // @todo, check if that needs to be done at all @@ -78,15 +78,15 @@ if (_isPIP) then { }; }; -// calculate lighting +// Calculate lighting private _dayOpacity = call EFUNC(common,ambientBrightness); -private _nightOpacity = [1,0] select (_dayOpacity == 1); +private _nightOpacity = [1, 0] select (_dayOpacity == 1); // Apply lighting and make layers visible -(_display displayCtrl 1713001) ctrlSetTextColor [1,1,1,1]; -(_display displayCtrl 1713002) ctrlSetTextColor [1,1,1,[0,1] select (_dayOpacity < 0.5)]; -(_display displayCtrl 1713005) ctrlSetTextColor [1,1,1,_dayOpacity]; -(_display displayCtrl 1713006) ctrlSetTextColor [1,1,1,_nightOpacity]; +(_display displayCtrl 1713001) ctrlSetTextColor [1, 1, 1, 1]; +(_display displayCtrl 1713002) ctrlSetTextColor [1, 1, 1, [0, 1] select (_dayOpacity < 0.5)]; +(_display displayCtrl 1713005) ctrlSetTextColor [1, 1, 1, _dayOpacity]; +(_display displayCtrl 1713006) ctrlSetTextColor [1, 1, 1, _nightOpacity]; /* (_display displayCtrl 1713001) ctrlCommit 0; diff --git a/addons/optics/stringtable.xml b/addons/optics/stringtable.xml index f3237144fa..377cca28bc 100644 --- a/addons/optics/stringtable.xml +++ b/addons/optics/stringtable.xml @@ -1,4 +1,4 @@ - + @@ -13,6 +13,9 @@ RCO (2D) RCO (2D) RCO (2D) + RCO (2D) + 步枪战斗光学瞄准镜(2D) + 步槍戰鬥光學瞄準鏡(2D) RCO (PIP) @@ -26,6 +29,9 @@ RCO (PIP) RCO (PIP) RCO (PIP) + RCO (PIP) + 步枪战斗光学瞄准镜(拟真版) + 步槍戰鬥光學瞄準鏡(擬真版) ARCO (2D) @@ -39,6 +45,9 @@ ARCO (2D) ARCO (2D) ARCO (2D) + ARCO (2D) + 先进步枪战斗光学瞄准镜(2D) + 先進步槍戰鬥光學瞄準鏡(2D) ARCO (PIP) @@ -52,6 +61,9 @@ ARCO (PIP) ARCO (PIP) ARCO (PIP) + ARCO (PIP) + 先进步枪战斗光学瞄准镜(拟真版) + 先進步槍戰鬥光學瞄準鏡(擬真版) MRCO (2D) @@ -65,6 +77,9 @@ MRCO (2D) MRCO (2D) MRCO (2D) + MRCO (2D) + 多距离战斗瞄准镜(2D) + 多距離戰鬥瞄準鏡(2D) MRCO (PIP) @@ -78,6 +93,9 @@ MRCO (PIP) MRCO (PIP) MRCO (PIP) + MRCO (PIP) + 多距离战斗瞄准镜(拟真版) + 多距離戰鬥瞄準鏡(擬真版) MOS (2D) @@ -91,6 +109,9 @@ MOS (2D) MOS (2D) MOS (2D) + MOS (2D) + 精准光学瞄准镜(2D) + 精準光學瞄準鏡(2D) MOS (PIP) @@ -104,6 +125,9 @@ MOS (PIP) MOS (PIP) MOS (PIP) + MOS (PIP) + 精准光学瞄准镜(拟真版) + 精準光學瞄準鏡(擬真版) LRPS (2D) @@ -117,6 +141,9 @@ MPLD (2D) LRPS (2D) LRPS (2D) + LRPS (2D) + 长距离精确瞄准镜(2D) + 長距離精確瞄準鏡(2D) LRPS (PIP) @@ -130,6 +157,9 @@ MPLD (PIP) LRPS (PIP) LRPS (PIP) + LRPS (PIP) + 长距离精确瞄准镜(拟真版) + 長距離精確瞄準鏡(擬真版) - \ No newline at end of file + diff --git a/addons/optionsmenu/XEH_preInit.sqf b/addons/optionsmenu/XEH_preInit.sqf index 8b6f55a0ca..57e017e054 100644 --- a/addons/optionsmenu/XEH_preInit.sqf +++ b/addons/optionsmenu/XEH_preInit.sqf @@ -2,7 +2,9 @@ ADDON = false; +PREP_RECOMPILE_START; #include "XEH_PREP.hpp" +PREP_RECOMPILE_END; GVAR(clientSideOptions) = []; GVAR(clientSideColors) = []; diff --git a/addons/optionsmenu/config.cpp b/addons/optionsmenu/config.cpp index a239e55498..650f9eb74a 100644 --- a/addons/optionsmenu/config.cpp +++ b/addons/optionsmenu/config.cpp @@ -22,7 +22,6 @@ class CfgAddons { }; }; - #include "CfgEventHandlers.hpp" #include "gui\define.hpp" #include "gui\settingsMenu.hpp" @@ -35,9 +34,8 @@ class ACE_Extensions { extensions[] += {"ace_clipboard"}; }; - class CfgCommands { allowedHTMLLoadURIs[] += { - "http://ace3mod.com/version.html" + "https://ace3mod.com/version.html" }; }; diff --git a/addons/optionsmenu/functions/fnc_debugDumpToClipboard.sqf b/addons/optionsmenu/functions/fnc_debugDumpToClipboard.sqf index dd2c187bf7..fcaca6a9de 100644 --- a/addons/optionsmenu/functions/fnc_debugDumpToClipboard.sqf +++ b/addons/optionsmenu/functions/fnc_debugDumpToClipboard.sqf @@ -15,17 +15,15 @@ */ #include "script_component.hpp" -private ["_var", "_unit", "_outputText", "_text"]; - #define MIN_ARRAY_SIZE 50 -_outputText = { +private _outputText = { diag_log text (_this select 0); "ace_clipboard" callExtension ((_this select 0) + " "); }; -_text = format ["~~~~~~~~~ACE Debug~~~~~~~~~ +private _text = format ["~~~~~~~~~ACE Debug~~~~~~~~~ time = %1 ------Performance------ @@ -82,9 +80,9 @@ _text = format [" } forEach (allVariables missionNamespace); { - _unit = _x; + private _unit = _x; { - _var = _unit getVariable [_x, nil]; + private _var = _unit getVariable [_x, nil]; if(!isnil "_var" && {_var isEqualType []} && {(count _var) > MIN_ARRAY_SIZE}) then { _text = format ["%1 on [%2] - ARRAY SIZE: %3", _x, _unit, (count _var)]; [_text] call _outputText; diff --git a/addons/optionsmenu/functions/fnc_exportSettings.sqf b/addons/optionsmenu/functions/fnc_exportSettings.sqf index e798784871..907f1d0899 100644 --- a/addons/optionsmenu/functions/fnc_exportSettings.sqf +++ b/addons/optionsmenu/functions/fnc_exportSettings.sqf @@ -16,8 +16,6 @@ #include "script_component.hpp" -private ["_compiledConfig", "_name", "_typeName", "_isClientSetable", "_localizedName", "_localizedDescription", "_possibleValues", "_defaultValue", "_value", "_compiledConfigEntry", "_formatedValue"]; - { /*_settingData = [ _name, @@ -29,18 +27,11 @@ private ["_compiledConfig", "_name", "_typeName", "_isClientSetable", "_localize _isForced, _defaultValue ];*/ - - _name = _x select 0; - _typeName = _x select 1; - _isClientSetable = _x select 2; - _localizedName = _x select 3; - _localizedDescription = _x select 4; - _possibleValues = _x select 5; - _defaultValue = _x select 6; + _x params ["_name", "_typeName", "_isClientSetable", "_localizedName", "_localizedDescription", "_possibleValues", "_defaultValue"]; if (GVAR(ClientSettingsExportIncluded) || !_isClientSetable) then { - _value = missionNamespace getVariable [_name, _defaultValue]; - _formatedValue = switch (toLower _typeName) do { + private _value = missionNamespace getVariable [_name, _defaultValue]; + private _formatedValue = switch (toLower _typeName) do { case ("scalar"): { format['value = %1;', _value]; }; @@ -62,7 +53,7 @@ private ["_compiledConfig", "_name", "_typeName", "_isClientSetable", "_localize }; }; - _compiledConfigEntry = format [" + private _compiledConfigEntry = format [" class %1 { %2 typeName = %3; diff --git a/addons/optionsmenu/functions/fnc_moduleAllowConfigExport.sqf b/addons/optionsmenu/functions/fnc_moduleAllowConfigExport.sqf index 633a9aa162..2426bb2f26 100644 --- a/addons/optionsmenu/functions/fnc_moduleAllowConfigExport.sqf +++ b/addons/optionsmenu/functions/fnc_moduleAllowConfigExport.sqf @@ -3,11 +3,14 @@ * * * Arguments: - * none + * None * * Return Value: * None * + * Example: + * call ace_optionsmenu_fnc_moduleAllowConfigExport + * * Public: No */ diff --git a/addons/optionsmenu/functions/fnc_onListBoxShowSelectionChanged.sqf b/addons/optionsmenu/functions/fnc_onListBoxShowSelectionChanged.sqf index 0ddcc8d2a9..abade6aaee 100644 --- a/addons/optionsmenu/functions/fnc_onListBoxShowSelectionChanged.sqf +++ b/addons/optionsmenu/functions/fnc_onListBoxShowSelectionChanged.sqf @@ -16,17 +16,15 @@ #include "script_component.hpp" -private ["_settingsMenu", "_localizedHeader"]; - -PARAMS_1(_openTab); +params ["_openTab"]; GVAR(optionMenu_openTab) = _openTab; disableSerialization; -_settingsMenu = uiNamespace getVariable 'ACE_settingsMenu'; +private _settingsMenu = uiNamespace getVariable 'ACE_settingsMenu'; switch (GVAR(optionMenu_openTab)) do { case (MENU_TAB_OPTIONS): { - _localizedHeader = format ["%1: %2", (localize LSTRING(OpenConfigMenu)), (localize LSTRING(TabOptions))]; + private _localizedHeader = format ["%1: %2", (localize LSTRING(OpenConfigMenu)), (localize LSTRING(TabOptions))]; ctrlSetText [13, _localizedHeader]; lbClear 400; @@ -39,7 +37,7 @@ case (MENU_TAB_OPTIONS): { (_settingsMenu displayCtrl 413) ctrlShow false; }; case (MENU_TAB_COLORS): { - _localizedHeader = format ["%1: %2", (localize LSTRING(OpenConfigMenu)), (localize LSTRING(TabColors))]; + private _localizedHeader = format ["%1: %2", (localize LSTRING(OpenConfigMenu)), (localize LSTRING(TabColors))]; ctrlSetText [13, _localizedHeader]; lbClear 400; diff --git a/addons/optionsmenu/functions/fnc_onServerCategorySelectChanged.sqf b/addons/optionsmenu/functions/fnc_onServerCategorySelectChanged.sqf index d134cda993..2ac7d0c01d 100644 --- a/addons/optionsmenu/functions/fnc_onServerCategorySelectChanged.sqf +++ b/addons/optionsmenu/functions/fnc_onServerCategorySelectChanged.sqf @@ -16,11 +16,10 @@ #include "script_component.hpp" -private ["_settingsMenu", "_ctrlComboBox"]; disableSerialization; -_settingsMenu = uiNamespace getVariable 'ACE_serverSettingsMenu'; +private _settingsMenu = uiNamespace getVariable 'ACE_serverSettingsMenu'; -_ctrlComboBox = (_settingsMenu displayCtrl 14); +private _ctrlComboBox = (_settingsMenu displayCtrl 14); GVAR(currentCategorySelection) = lbCurSel _ctrlComboBox; [true] call FUNC(serverSettingsMenuUpdateList); diff --git a/addons/optionsmenu/functions/fnc_onServerListBoxShowSelectionChanged.sqf b/addons/optionsmenu/functions/fnc_onServerListBoxShowSelectionChanged.sqf index 669faf74ed..ab04df5ef5 100644 --- a/addons/optionsmenu/functions/fnc_onServerListBoxShowSelectionChanged.sqf +++ b/addons/optionsmenu/functions/fnc_onServerListBoxShowSelectionChanged.sqf @@ -16,17 +16,15 @@ #include "script_component.hpp" -private ["_settingsMenu", "_localizedHeader"]; - -PARAMS_1(_openTab); +params ["_openTab"]; GVAR(optionMenu_openTab) = _openTab; disableSerialization; -_settingsMenu = uiNamespace getVariable 'ACE_serverSettingsMenu'; +private _settingsMenu = uiNamespace getVariable 'ACE_serverSettingsMenu'; switch (GVAR(optionMenu_openTab)) do { case (MENU_TAB_SERVER_OPTIONS): { - _localizedHeader = format ["%1: %2", (localize LSTRING(OpenConfigMenu)), (localize LSTRING(TabOptions))]; + private _localizedHeader = format ["%1: %2", (localize LSTRING(OpenConfigMenu)), (localize LSTRING(TabOptions))]; ctrlSetText [13, _localizedHeader]; lbClear 400; @@ -43,7 +41,7 @@ case (MENU_TAB_SERVER_OPTIONS): { (_settingsMenu displayCtrl 416) ctrlEnable false; }; case (MENU_TAB_SERVER_COLORS): { - _localizedHeader = format ["%1: %2", (localize LSTRING(OpenConfigMenu)), (localize LSTRING(TabColors))]; + private _localizedHeader = format ["%1: %2", (localize LSTRING(OpenConfigMenu)), (localize LSTRING(TabColors))]; ctrlSetText [13, _localizedHeader]; lbClear 400; @@ -67,7 +65,7 @@ case (MENU_TAB_SERVER_COLORS): { (_settingsMenu displayCtrl 416) ctrlEnable false; }; case (MENU_TAB_SERVER_VALUES): { - _localizedHeader = format ["%1: %2", (localize LSTRING(OpenConfigMenu)), (localize LSTRING(TabValues))]; + private _localizedHeader = format ["%1: %2", (localize LSTRING(OpenConfigMenu)), (localize LSTRING(TabValues))]; ctrlSetText [13, _localizedHeader]; lbClear 400; diff --git a/addons/optionsmenu/functions/fnc_onServerSaveInputField.sqf b/addons/optionsmenu/functions/fnc_onServerSaveInputField.sqf index fde370426f..f98abfc97b 100644 --- a/addons/optionsmenu/functions/fnc_onServerSaveInputField.sqf +++ b/addons/optionsmenu/functions/fnc_onServerSaveInputField.sqf @@ -16,11 +16,9 @@ #include "script_component.hpp" -private ["_settingIndex", "_inputText", "_setting", "_settingName", "_convertedValue"]; +private _inputText = ctrlText 414; //Index of right drop down -_inputText = ctrlText 414; //Index of right drop down - -_settingIndex = -1; +private _settingIndex = -1; if (((lnbCurSelRow 200) >= 0) && {(lnbCurSelRow 200) < ((lnbSize 200) select 0)}) then { _settingIndex = lnbValue [200, [(lnbCurSelRow 200), 0]]; }; @@ -29,10 +27,10 @@ switch (GVAR(optionMenu_openTab)) do { case (MENU_TAB_SERVER_VALUES): { if ((_settingIndex >= 0) && (_settingIndex < (count GVAR(serverSideValues)))) then { try { - _setting = (GVAR(serverSideValues) select _settingIndex); - _settingName = _setting select 0; + private _setting = (GVAR(serverSideValues) select _settingIndex); + private _settingName = _setting select 0; - _convertedValue = switch (toUpper (_setting select 1)) do { + private _convertedValue = switch (toUpper (_setting select 1)) do { case "STRING": { ctrlSetText [414, _inputText call FUNC(stringEscape)]; format ['%1', _inputText call FUNC(stringEscape)]; diff --git a/addons/optionsmenu/functions/fnc_onServerSettingsMenuOpen.sqf b/addons/optionsmenu/functions/fnc_onServerSettingsMenuOpen.sqf index 6a9e5c9fb8..5e8b9b7cf6 100644 --- a/addons/optionsmenu/functions/fnc_onServerSettingsMenuOpen.sqf +++ b/addons/optionsmenu/functions/fnc_onServerSettingsMenuOpen.sqf @@ -16,8 +16,6 @@ #include "script_component.hpp" -private ["_setting", "_settingsMenu"]; - if (GVAR(serverConfigGeneration) == 0 || isMultiplayer) exitWith {closeDialog 145246;}; // Filter only user setable setting @@ -30,7 +28,7 @@ GVAR(serverSideValues) = []; // Exclude client side options if they are not included for the export if (!(_isClientSetable) || GVAR(ClientSettingsExportIncluded)) then { // Append the current value to the setting metadata - _setting = + _x; + private _setting = + _x; _setting pushBack (missionNamespace getVariable (_x select 0)); // Categorize the setting according to types diff --git a/addons/optionsmenu/functions/fnc_onSettingsMenuOpen.sqf b/addons/optionsmenu/functions/fnc_onSettingsMenuOpen.sqf index 42157f230f..1b86f95e82 100644 --- a/addons/optionsmenu/functions/fnc_onSettingsMenuOpen.sqf +++ b/addons/optionsmenu/functions/fnc_onSettingsMenuOpen.sqf @@ -16,8 +16,6 @@ #include "script_component.hpp" -private ["_setting", "_menu"]; - // Filter only user setable setting GVAR(clientSideOptions) = []; GVAR(clientSideColors) = []; @@ -27,7 +25,7 @@ private _clientSettableCategories = [""]; // If the setting is user setable and not forced if ((_x select 2) && !(_x select 6)) then { // Append the current value to the setting metadata - _setting = + _x; + private _setting = + _x; _setting pushBack (missionNamespace getVariable (_x select 0)); // Categorize the setting according to types @@ -46,7 +44,7 @@ private _clientSettableCategories = [""]; [{ [MENU_TAB_OPTIONS] call FUNC(onListBoxShowSelectionChanged) }, []] call CBA_fnc_execNextFrame; disableSerialization; -_menu = uiNamespace getVariable "ACE_settingsMenu"; +private _menu = uiNamespace getVariable "ACE_settingsMenu"; (_menu displayCtrl 1002) ctrlEnable false; (_menu displayCtrl 1003) ctrlEnable false; @@ -67,5 +65,3 @@ lbClear (_menu displayCtrl 14); } forEach GVAR(categories); (_menu displayCtrl 14) lbSetCurSel GVAR(currentCategorySelection); //All Catagoies - - diff --git a/addons/optionsmenu/functions/fnc_onSliderPosChanged.sqf b/addons/optionsmenu/functions/fnc_onSliderPosChanged.sqf index 7df198cc5f..979b305be5 100644 --- a/addons/optionsmenu/functions/fnc_onSliderPosChanged.sqf +++ b/addons/optionsmenu/functions/fnc_onSliderPosChanged.sqf @@ -16,9 +16,7 @@ #include "script_component.hpp" -private ["_newColor", "_settingIndex"]; - -_settingIndex = -1; +private _settingIndex = -1; if (((lnbCurSelRow 200) >= 0) && {(lnbCurSelRow 200) < ((lnbSize 200) select 0)}) then { _settingIndex = lnbValue [200, [(lnbCurSelRow 200), 0]]; }; @@ -27,7 +25,7 @@ if (_settingIndex == -1) exitWith {}; switch (GVAR(optionMenu_openTab)) do { case (MENU_TAB_COLORS): { - _newColor = []; + private _newColor = []; { _newColor pushBack ((sliderPosition _x) / 255); } forEach [410, 411, 412, 413]; @@ -40,7 +38,7 @@ switch (GVAR(optionMenu_openTab)) do { }; case (MENU_TAB_SERVER_COLORS): { - _newColor = []; + private _newColor = []; { _newColor pushBack ((sliderPosition _x) / 255); } forEach [410, 411, 412, 413]; diff --git a/addons/optionsmenu/functions/fnc_resetSettings.sqf b/addons/optionsmenu/functions/fnc_resetSettings.sqf index 8d6c3958c6..f4957e58c8 100644 --- a/addons/optionsmenu/functions/fnc_resetSettings.sqf +++ b/addons/optionsmenu/functions/fnc_resetSettings.sqf @@ -16,21 +16,19 @@ #include "script_component.hpp" -private ["_name", "_default", "_lastSelected"]; - { - _name = _x select 0; - _default = _x select 7; + private _name = _x select 0; + private _default = _x select 7; [MENU_TAB_OPTIONS, _name, _default] call FUNC(updateSetting); } forEach GVAR(clientSideOptions); { - _name = _x select 0; - _default = _x select 7; + private _name = _x select 0; + private _default = _x select 7; [MENU_TAB_COLORS, _name, _default] call FUNC(updateSetting); } forEach GVAR(clientSideColors); -_lastSelected = lnbCurSelRow 200; +private _lastSelected = lnbCurSelRow 200; [GVAR(optionMenu_openTab)] call FUNC(onListBoxShowSelectionChanged); if (_lastSelected != -1) then { lnbSetCurSelRow [200, _lastSelected]; diff --git a/addons/optionsmenu/functions/fnc_serverResetSettings.sqf b/addons/optionsmenu/functions/fnc_serverResetSettings.sqf index d9f6a4ad96..a8abd217dd 100644 --- a/addons/optionsmenu/functions/fnc_serverResetSettings.sqf +++ b/addons/optionsmenu/functions/fnc_serverResetSettings.sqf @@ -16,27 +16,25 @@ #include "script_component.hpp" -private ["_name", "_default", "_lastSelected"]; - { - _name = _x select 0; - _default = _x select 7; + private _name = _x select 0; + private _default = _x select 7; [MENU_TAB_SERVER_OPTIONS, _name, _default] call FUNC(updateSetting); } forEach GVAR(serverSideOptions); { - _name = _x select 0; - _default = _x select 7; + private _name = _x select 0; + private _default = _x select 7; [MENU_TAB_SERVER_COLORS, _name, _default] call FUNC(updateSetting); } forEach GVAR(serverSideColors); { - _name = _x select 0; - _default = _x select 7; + private _name = _x select 0; + private _default = _x select 7; [MENU_TAB_SERVER_VALUES, _name, _default] call FUNC(updateSetting); } forEach GVAR(serverSideVakyes); -_lastSelected = lnbCurSelRow 200; +private _lastSelected = lnbCurSelRow 200; [GVAR(optionMenu_openTab)] call FUNC(onserverListBoxShowSelectionChanged); if (_lastSelected != -1) then { lbSetCurSel [200, _lastSelected]; diff --git a/addons/optionsmenu/functions/fnc_serverSettingsMenuUpdateKeyView.sqf b/addons/optionsmenu/functions/fnc_serverSettingsMenuUpdateKeyView.sqf index dfffbca6a6..4b5b99547f 100644 --- a/addons/optionsmenu/functions/fnc_serverSettingsMenuUpdateKeyView.sqf +++ b/addons/optionsmenu/functions/fnc_serverSettingsMenuUpdateKeyView.sqf @@ -16,29 +16,28 @@ #include "script_component.hpp" -private ["_settingsMenu", "_collection", "_settingIndex", "_setting", "_entryName", "_localizedName", "_localizedDescription", "_possibleValues", "_settingsValue", "_currentColor", "_expectedType"]; disableSerialization; -_settingsMenu = uiNamespace getVariable 'ACE_serverSettingsMenu'; +private _settingsMenu = uiNamespace getVariable 'ACE_serverSettingsMenu'; -_collection = switch (GVAR(optionMenu_openTab)) do { +private _collection = switch (GVAR(optionMenu_openTab)) do { case MENU_TAB_SERVER_OPTIONS: {GVAR(serverSideOptions)}; case MENU_TAB_SERVER_COLORS: {GVAR(serverSideColors)}; case MENU_TAB_SERVER_VALUES: {GVAR(serverSideValues)}; default {[]}; }; -_settingIndex = -1; +private _settingIndex = -1; if (((lnbCurSelRow 200) >= 0) && {(lnbCurSelRow 200) < ((lnbSize 200) select 0)}) then { _settingIndex = lnbValue [200, [(lnbCurSelRow 200), 0]]; }; if ((_settingIndex >= 0) && {_settingIndex <= (count _collection)}) then { - _setting = _collection select _settingIndex; + private _setting = _collection select _settingIndex; - _entryName = _setting select 0; - _localizedName = _setting select 3; - _localizedDescription = _setting select 4; + private _entryName = _setting select 0; + private _localizedName = _setting select 3; + private _localizedDescription = _setting select 4; if (_localizedName == "") then {_localizedName = _entryName;}; (_settingsMenu displayCtrl 250) ctrlSetText _localizedName; @@ -47,8 +46,8 @@ if ((_settingIndex >= 0) && {_settingIndex <= (count _collection)}) then { switch (GVAR(optionMenu_openTab)) do { case (MENU_TAB_SERVER_OPTIONS): { - _possibleValues = _setting select 5; - _settingsValue = _setting select 9; + private _possibleValues = _setting select 5; + private _settingsValue = _setting select 9; // Created disable/enable options for bools if ((_setting select 1) == "BOOL") then { lbClear 400; @@ -62,17 +61,17 @@ if ((_settingIndex >= 0) && {_settingIndex <= (count _collection)}) then { (_settingsMenu displayCtrl 400) lbSetCurSel _settingsValue; }; case (MENU_TAB_SERVER_COLORS): { - _currentColor = _setting select 9; + private _currentColor = _setting select 9; { sliderSetPosition [_x, (255 * (_currentColor select _forEachIndex))]; } forEach [410, 411, 412, 413]; }; case (MENU_TAB_SERVER_VALUES): { // TODO implement - _settingsValue = _setting select 9; + private _settingsValue = _setting select 9; // Created disable/enable options for bools - _expectedType = switch (_setting select 1) do { + private _expectedType = switch (_setting select 1) do { case "STRING": {LSTRING(stringType)}; case "ARRAY": {LSTRING(arrayType)}; case "SCALAR": {LSTRING(scalarType)}; diff --git a/addons/optionsmenu/functions/fnc_serverSettingsMenuUpdateList.sqf b/addons/optionsmenu/functions/fnc_serverSettingsMenuUpdateList.sqf index 9718da3988..b9a9072ead 100644 --- a/addons/optionsmenu/functions/fnc_serverSettingsMenuUpdateList.sqf +++ b/addons/optionsmenu/functions/fnc_serverSettingsMenuUpdateList.sqf @@ -16,38 +16,36 @@ #include "script_component.hpp" -private ["_settingName", "_added", "_settingsMenu", "_ctrlList", "_settingsText", "_color", "_settingsColor", "_updateKeyView", "_settingsValue", "_selectedCategory"]; -DEFAULT_PARAM(0,_updateKeyView,true); +params [["_updateKeyView", true, [true]]]; disableSerialization; -_settingsMenu = uiNamespace getVariable 'ACE_serverSettingsMenu'; -_ctrlList = _settingsMenu displayCtrl 200; +private _settingsMenu = uiNamespace getVariable 'ACE_serverSettingsMenu'; +private _ctrlList = _settingsMenu displayCtrl 200; lnbClear _ctrlList; -_selectedCategory = GVAR(categories) select GVAR(currentCategorySelection); +private _selectedCategory = GVAR(categories) select GVAR(currentCategorySelection); -_added = 0; switch (GVAR(optionMenu_openTab)) do { case (MENU_TAB_SERVER_OPTIONS): { { if (_selectedCategory == "" || {_selectedCategory == (_x select 8)}) then { - _settingName = if ((_x select 3) != "") then { + private _settingName = if ((_x select 3) != "") then { (_x select 3); } else { (_x select 0); }; - _settingsValue = _x select 9; + private _settingsValue = _x select 9; // Created disable/enable options for bools - _settingsText = if ((_x select 1) == "BOOL") then { + private _settingsText = if ((_x select 1) == "BOOL") then { [(localize ELSTRING(common,No)), (localize ELSTRING(common,Yes))] select _settingsValue; } else { (_x select 5) select _settingsValue; }; - _added = _ctrlList lnbAddRow [_settingName, _settingsText]; + private _added = _ctrlList lnbAddRow [_settingName, _settingsText]; _ctrlList lnbSetValue [[_added, 0], _forEachIndex]; }; }forEach GVAR(serverSideOptions); @@ -55,18 +53,18 @@ switch (GVAR(optionMenu_openTab)) do { case (MENU_TAB_SERVER_COLORS): { { if (_selectedCategory == "" || {_selectedCategory == (_x select 8)}) then { - _color = +(_x select 9); + private _color = +(_x select 9); { _color set [_forEachIndex, ((round (_x * 100))/100)]; } forEach _color; - _settingsColor = str _color; - _settingName = if ((_x select 3) != "") then { + private _settingsColor = str _color; + private _settingName = if ((_x select 3) != "") then { (_x select 3); } else { (_x select 0); }; - _added = _ctrlList lnbAddRow [_settingName, _settingsColor]; + private _added = _ctrlList lnbAddRow [_settingName, _settingsColor]; _ctrlList lnbSetColor [[_added, 1], (_x select 9)]; _ctrlList lnbSetValue [[_added, 0], _forEachIndex]; }; @@ -75,16 +73,16 @@ switch (GVAR(optionMenu_openTab)) do { case (MENU_TAB_SERVER_VALUES): { { if (_selectedCategory == "" || {_selectedCategory == (_x select 8)}) then { - _settingName = if ((_x select 3) != "") then { + private _settingName = if ((_x select 3) != "") then { (_x select 3); } else { (_x select 0); }; - _settingsValue = _x select 9; + private _settingsValue = _x select 9; if (!(_settingsValue isEqualType "")) then { _settingsValue = format["%1", _settingsValue]; }; - _added = _ctrlList lnbAddRow [_settingName, _settingsValue]; + private _added = _ctrlList lnbAddRow [_settingName, _settingsValue]; _ctrlList lnbSetValue [[_added, 0], _forEachIndex]; }; }forEach GVAR(serverSideValues); diff --git a/addons/optionsmenu/functions/fnc_settingsMenuUpdateKeyView.sqf b/addons/optionsmenu/functions/fnc_settingsMenuUpdateKeyView.sqf index defef99395..ee2e5f25c1 100644 --- a/addons/optionsmenu/functions/fnc_settingsMenuUpdateKeyView.sqf +++ b/addons/optionsmenu/functions/fnc_settingsMenuUpdateKeyView.sqf @@ -16,29 +16,28 @@ #include "script_component.hpp" -private ["_settingsMenu", "_ctrlList", "_collection", "_settingIndex", "_setting", "_entryName", "_localizedName", "_localizedDescription", "_possibleValues", "_settingsValue", "_currentColor"]; disableSerialization; -_settingsMenu = uiNamespace getVariable 'ACE_settingsMenu'; -_ctrlList = _settingsMenu displayCtrl 200; +private _settingsMenu = uiNamespace getVariable 'ACE_settingsMenu'; +private _ctrlList = _settingsMenu displayCtrl 200; -_collection = switch (GVAR(optionMenu_openTab)) do { +private _collection = switch (GVAR(optionMenu_openTab)) do { case MENU_TAB_OPTIONS: {GVAR(clientSideOptions)}; case MENU_TAB_COLORS: {GVAR(clientSideColors)}; default {[]}; }; -_settingIndex = -1; +private _settingIndex = -1; if (((lnbCurSelRow 200) >= 0) && {(lnbCurSelRow 200) < ((lnbSize 200) select 0)}) then { _settingIndex = lnbValue [200, [(lnbCurSelRow 200), 0]]; }; if ((_settingIndex >= 0) && {_settingIndex <= (count _collection)}) then { - _setting = _collection select _settingIndex; + private _setting = _collection select _settingIndex; - _entryName = _setting select 0; - _localizedName = _setting select 3; - _localizedDescription = _setting select 4; + private _entryName = _setting select 0; + private _localizedName = _setting select 3; + private _localizedDescription = _setting select 4; if (_localizedName == "") then {_localizedName = _entryName;}; (_settingsMenu displayCtrl 250) ctrlSetText _localizedName; @@ -47,8 +46,8 @@ if ((_settingIndex >= 0) && {_settingIndex <= (count _collection)}) then { switch (GVAR(optionMenu_openTab)) do { case (MENU_TAB_OPTIONS): { - _possibleValues = _setting select 5; - _settingsValue = _setting select 9; + private _possibleValues = _setting select 5; + private _settingsValue = _setting select 9; // Created disable/enable options for bools if ((_setting select 1) == "BOOL") then { @@ -63,7 +62,7 @@ if ((_settingIndex >= 0) && {_settingIndex <= (count _collection)}) then { (_settingsMenu displayCtrl 400) lbSetCurSel _settingsValue; }; case (MENU_TAB_COLORS): { - _currentColor = _setting select 9; + private _currentColor = _setting select 9; { sliderSetPosition [_x, (255 * (_currentColor select _forEachIndex))]; } forEach [410, 411, 412, 413]; diff --git a/addons/optionsmenu/functions/fnc_settingsMenuUpdateList.sqf b/addons/optionsmenu/functions/fnc_settingsMenuUpdateList.sqf index ed64ebde69..ea6f904ade 100644 --- a/addons/optionsmenu/functions/fnc_settingsMenuUpdateList.sqf +++ b/addons/optionsmenu/functions/fnc_settingsMenuUpdateList.sqf @@ -16,26 +16,25 @@ #include "script_component.hpp" -private ["_settingName", "_added", "_settingsMenu", "_ctrlList", "_settingsText", "_color", "_settingsColor", "_updateKeyView", "_settingsValue", "_selectedCategory"]; -DEFAULT_PARAM(0,_updateKeyView,true); +params [["_updateKeyView", true, [true]]]; disableSerialization; -_settingsMenu = uiNamespace getVariable 'ACE_settingsMenu'; -_ctrlList = _settingsMenu displayCtrl 200; +private _settingsMenu = uiNamespace getVariable 'ACE_settingsMenu'; +private _ctrlList = _settingsMenu displayCtrl 200; lnbClear _ctrlList; -_selectedCategory = GVAR(categories) select GVAR(currentCategorySelection); +private _selectedCategory = GVAR(categories) select GVAR(currentCategorySelection); switch (GVAR(optionMenu_openTab)) do { case (MENU_TAB_OPTIONS): { { if (_selectedCategory == "" || {_selectedCategory == (_x select 8)}) then { - _settingName = (_x select 3); - _settingsValue = _x select 9; + private _settingName = (_x select 3); + private _settingsValue = _x select 9; // Created disable/enable options for bools - _settingsText = if ((_x select 1) == "BOOL") then { + private _settingsText = if ((_x select 1) == "BOOL") then { [(localize ELSTRING(common,No)), (localize ELSTRING(common,Yes))] select _settingsValue; } else { private _values = _x select 5; @@ -45,7 +44,7 @@ switch (GVAR(optionMenu_openTab)) do { }; _values select _settingsValue; }; - _added = _ctrlList lnbAddRow [_settingName, _settingsText]; + private _added = _ctrlList lnbAddRow [_settingName, _settingsText]; _ctrlList lnbSetValue [[_added, 0], _forEachIndex]; }; } forEach GVAR(clientSideOptions); @@ -53,14 +52,14 @@ switch (GVAR(optionMenu_openTab)) do { case (MENU_TAB_COLORS): { { if (_selectedCategory == "" || {_selectedCategory == (_x select 8)}) then { - _color = +(_x select 9); + private _color = +(_x select 9); { _color set [_forEachIndex, ((round (_x * 100))/100)]; } forEach _color; - _settingsColor = str _color; - _settingName = (_x select 3); + private _settingsColor = str _color; + private _settingName = (_x select 3); - _added = _ctrlList lnbAddRow [_settingName, _settingsColor]; + private _added = _ctrlList lnbAddRow [_settingName, _settingsColor]; _ctrlList lnbSetColor [[_added, 1], (_x select 9)]; _ctrlList lnbSetValue [[_added, 0], _forEachIndex]; }; diff --git a/addons/optionsmenu/functions/fnc_stringEscape.sqf b/addons/optionsmenu/functions/fnc_stringEscape.sqf index 09e1357a31..089fbeb054 100644 --- a/addons/optionsmenu/functions/fnc_stringEscape.sqf +++ b/addons/optionsmenu/functions/fnc_stringEscape.sqf @@ -14,13 +14,11 @@ * Public: No */ -private ["_str", "_array", "_maxIndex", "_isEven"]; -_str = _this; +private _str = _this; -_isEven = { +private _isEven = { params ["_array", "_index"]; - private [ "_count"]; - _count = 0; + private _count = 0; { if (_forEachIndex <= _index && {_x == 39}) then { _count = _count + 1; @@ -32,14 +30,14 @@ _isEven = { // reg: 34 // single: 39 -_array = toArray _str; +private _array = toArray _str; { if (_x == 34) then { _array set [_forEachIndex, 39]; }; }forEach _array; -_maxIndex = count _array; +private _maxIndex = count _array; for "_i" from 0 to _maxIndex /* step +1 */ do { if (((_i + 1) < _maxIndex - 1) && {_array select _i == 39 && (_array select (_i + 1)) == 39}) then { if ([_array, _i] call _isEven) then { diff --git a/addons/optionsmenu/functions/fnc_toggleIncludeClientSettings.sqf b/addons/optionsmenu/functions/fnc_toggleIncludeClientSettings.sqf index 8fd52d8d72..2256620cf6 100644 --- a/addons/optionsmenu/functions/fnc_toggleIncludeClientSettings.sqf +++ b/addons/optionsmenu/functions/fnc_toggleIncludeClientSettings.sqf @@ -8,6 +8,9 @@ * Return Value: * None * + * Example: + * call ace_optionsmenu_fnc_toggleIncludeClientSettings + * * Public: No */ diff --git a/addons/optionsmenu/functions/fnc_updateSetting.sqf b/addons/optionsmenu/functions/fnc_updateSetting.sqf index 7374d1f2c1..ffec62d353 100644 --- a/addons/optionsmenu/functions/fnc_updateSetting.sqf +++ b/addons/optionsmenu/functions/fnc_updateSetting.sqf @@ -18,10 +18,9 @@ #include "script_component.hpp" -private ["_changed"]; -PARAMS_3(_type,_name,_newValue); +params ["_type", "_name", "_newValue"]; -_changed = false; +private _changed = false; switch (_type) do { case (MENU_TAB_OPTIONS): { diff --git a/addons/optionsmenu/gui/pauseMenu.hpp b/addons/optionsmenu/gui/pauseMenu.hpp index 79aed168de..304cd7e8d1 100644 --- a/addons/optionsmenu/gui/pauseMenu.hpp +++ b/addons/optionsmenu/gui/pauseMenu.hpp @@ -45,7 +45,7 @@ class ACE_Open_SettingsMenu_BtnBase : ACE_gui_buttonBase { colorDisabled[] = {1,1,1,0.25}; colorFocused[] = {0,0,0,1}; colorText[] = {1,1,1,1}; - default = 0; + //default = 0; font = "RobotoCondensed"; idc = -1; period = 1.2; @@ -77,69 +77,63 @@ class ACE_Open_SettingsMenu_BtnBase : ACE_gui_buttonBase { class RscStandardDisplay; class RscDisplayMPInterrupt: RscStandardDisplay { class controls { - class ACE_Open_settingsMenu_Btn : ACE_Open_SettingsMenu_BtnBase {}; + class ACE_Open_settingsMenu_Btn: ACE_Open_SettingsMenu_BtnBase {}; }; }; + class RscDisplayInterruptEditorPreview: RscStandardDisplay { class controls { - class ACE_Open_settingsMenu_Btn : ACE_Open_SettingsMenu_BtnBase {}; + class ACE_Open_settingsMenu_Btn: ACE_Open_SettingsMenu_BtnBase {}; }; }; + class RscDisplayInterrupt: RscStandardDisplay { class controls { - class ACE_Open_settingsMenu_Btn : ACE_Open_SettingsMenu_BtnBase {}; + class ACE_Open_settingsMenu_Btn: ACE_Open_SettingsMenu_BtnBase {}; }; }; + class RscDisplayInterruptEditor3D: RscStandardDisplay { class controls { - class ACE_Open_settingsMenu_Btn : ACE_Open_SettingsMenu_BtnBase {}; + class ACE_Open_settingsMenu_Btn: ACE_Open_SettingsMenu_BtnBase {}; }; }; + class RscDisplayMovieInterrupt: RscStandardDisplay { class controls { - class ACE_Open_settingsMenu_Btn : ACE_Open_SettingsMenu_BtnBase {}; + class ACE_Open_settingsMenu_Btn: ACE_Open_SettingsMenu_BtnBase {}; }; }; + class RscDisplayMain: RscStandardDisplay { class controls { - class ACE_news_apex: RscControlsGroupNoHScrollbars { - idc = 80090; - x = "safezoneX + safezoneW - 10 * (pixelW * pixelGrid * 2) - (4 * pixelH)"; - y = "safezoneY + safezoneH - (3 * 2 + 1) * (pixelH * pixelGrid * 2) - 3 * (4 * pixelH)"; - w = "10 * (pixelW * pixelGrid * 2)"; - h = "2 * (pixelH * pixelGrid * 2)"; - class Controls { - class Background: RscPicture { - idc = 80091; - text = "\a3\Ui_f\data\GUI\Rsc\RscDisplayMain\gradientMods_ca.paa"; - colorText[] = {0,0,0,0.75}; - x = "(10 - 4 * 2) * (pixelW * pixelGrid * 2)"; - y = 0; - w = "4 * 2 * (pixelW * pixelGrid * 2)"; - h = "2 * (pixelH * pixelGrid * 2)"; - angle = 180; - }; - class BackgroundIcon: RscPicture { - idc = 80092; - text = "\a3\Ui_f\data\GUI\Rsc\RscDisplayMain\backgroundModsIcon_ca.paa"; - colorText[] = {0,0,0,0.75}; - x = "(10 - 2 * 2) * (pixelW * pixelGrid * 2)"; - y = 0; - w = "2 * 2 * (pixelW * pixelGrid * 2)"; - h = "2 * (pixelH * pixelGrid * 2)"; - angle = 180; - }; - class Icon: RscPicture { - idc = 80093; + class InfoMods: RscControlsGroupNoHScrollbars { + class Controls; + }; + + class InfoNews: InfoMods { + class Controls: Controls { + class Background; + class BackgroundIcon; + class Icon; + class News; + class Notification; + class Button; + }; + }; + + class ACE_news_apex: InfoNews { + idc = IDC_MAIN_INFO; + y = "safezoneY + safezoneH - (3 * 2 + 1) * (pixelH * pixelGrid * 2) - 4 * (4 * pixelH)"; + + class Controls: Controls { + class Background: Background {}; + class BackgroundIcon: BackgroundIcon {}; + class Icon: Icon { text = QPATHTOF(gui\aceMenuIcon_ca.paa); - colorText[] = {1,1,1,0.5}; - x = "(10 - 2) * (pixelW * pixelGrid * 2)"; - y = 0; - w = "2 * (pixelW * pixelGrid * 2)"; - h = "2 * (pixelH * pixelGrid * 2)"; }; class CurrentVersionInfo: RscText { - idc = 80094; + idc = IDC_MAIN_INFO_CURRENT_VERSION_INFO; style = 1; text = ""; sizeEx = "(pixelH * pixelGrid * 1.5)"; @@ -149,12 +143,13 @@ class RscDisplayMain: RscStandardDisplay { x = 0; y = 0; w = "(10 - 1.25 * 2) * (pixelW * pixelGrid * 2)"; - h = "2 * (pixelH * pixelGrid * 1)"; + h = "1 * (pixelH * pixelGrid * 2)"; onLoad = "(_this select 0) ctrlenable false;"; }; class HTTPVersionInfo: RscHTML { - idc = 80095; + idc = IDC_MAIN_INFO_NEWEST_VERSION_INFO; shadow = 0; + class H1 { sizeEx = "(pixelH * pixelGrid * 1.5)"; font = "RobotoCondensedLight"; @@ -167,24 +162,16 @@ class RscDisplayMain: RscStandardDisplay { class P: H1 { sizeEx = "(pixelH * pixelGrid * 1.5)"; }; + x = 0; - y = "2 * (pixelH * pixelGrid * 1)"; + y = "1 * (pixelH * pixelGrid * 2)"; w = "(10 - 1.25 * 2) * (pixelW * pixelGrid * 2)"; - h = "2 * (pixelH * pixelGrid * 1)"; + h = "1 * (pixelH * pixelGrid * 2)"; onLoad = "(_this select 0) ctrlenable false;"; }; - class Button: RscButtonMenu { - idc = 80096; - colorBackground[] = {0,0,0,0}; - colorBackgroundFocused[] = {0,0,0,0}; - colorBackground2[] = {0,0,0,0}; - x = 0; - y = 0; - w = "10 * (pixelW * pixelGrid * 2)"; - h = "2 * (pixelH * pixelGrid * 2)"; - + class Button: Button { tooltip = "Download latest and report issues:"; - url = "https://github.com/acemod/ACE3"; + url = "https://github.com/acemod/ACE3/releases"; }; }; }; diff --git a/addons/optionsmenu/init_loadMainMenuBox.sqf b/addons/optionsmenu/init_loadMainMenuBox.sqf index a9b8f5a02a..894bd45124 100644 --- a/addons/optionsmenu/init_loadMainMenuBox.sqf +++ b/addons/optionsmenu/init_loadMainMenuBox.sqf @@ -13,17 +13,47 @@ * * Public: No */ +#include "\a3\ui_f\hpp\defineResinclDesign.inc" #include "script_component.hpp" +params ["_display"]; +private _controlsGroup = _display displayCtrl IDC_MAIN_INFO; + //Need to load from profileNamespace because ace_settings might not be init if world = empty if (profileNamespace getVariable [QGVAR(showNewsOnMainMenu), true]) then { - ((_this select 0) displayCtrl 80090) ctrlShow true; + _controlsGroup ctrlShow true; - private _ace3VersionStr = (getText (configFile >> "CfgPatches" >> "ace_main" >> "versionStr")) select [0,5]; - ((_this select 0) displayCtrl 80094) ctrlSetText format ["Version: %1", _ace3VersionStr]; - ((_this select 0) displayCtrl 80095) htmlLoad "http://ace3mod.com/version.html"; + private _fnc_onSetFocus = { + params ["_control"]; + private _controlsGroup = ctrlParentControlsGroup _control; + + (_controlsGroup controlsGroupCtrl IDC_MAIN_INFO_BACKGROUND) ctrlSetTextColor [1,1,1,1]; + (_controlsGroup controlsGroupCtrl IDC_MAIN_INFO_BACKGROUND_ICON) ctrlSetTextColor [1,1,1,1]; + (_controlsGroup controlsGroupCtrl IDC_MAIN_INFO_ICON) ctrlSetTextColor [0,0,0,1]; + }; + + private _fnc_onKillFocus = { + params ["_control"]; + private _controlsGroup = ctrlParentControlsGroup _control; + + (_controlsGroup controlsGroupCtrl IDC_MAIN_INFO_BACKGROUND) ctrlSetTextColor [0,0,0,0.75]; + (_controlsGroup controlsGroupCtrl IDC_MAIN_INFO_BACKGROUND_ICON) ctrlSetTextColor [0,0,0,0.75]; + (_controlsGroup controlsGroupCtrl IDC_MAIN_INFO_ICON) ctrlSetTextColor [1,1,1,0.5]; + }; + + (_controlsGroup controlsGroupCtrl IDC_MAIN_INFO_BUTTON) ctrlAddEventHandler ["MouseEnter", _fnc_onSetFocus]; + (_controlsGroup controlsGroupCtrl IDC_MAIN_INFO_BUTTON) ctrlAddEventHandler ["SetFocus", _fnc_onSetFocus]; + (_controlsGroup controlsGroupCtrl IDC_MAIN_INFO_BUTTON) ctrlAddEventHandler ["MouseExit", _fnc_onKillFocus]; + (_controlsGroup controlsGroupCtrl IDC_MAIN_INFO_BUTTON) ctrlAddEventHandler ["KillFocus", _fnc_onKillFocus]; + + private _versionStr = getText (configFile >> "CfgPatches" >> "ace_main" >> "versionStr") splitString "."; + _versionStr resize 3; // MAJOR, MINOR, PATCH + _versionStr = _versionStr joinString "."; + + (_display displayCtrl IDC_MAIN_INFO_CURRENT_VERSION_INFO) ctrlSetText format ["Version: %1", _versionStr]; + (_display displayCtrl IDC_MAIN_INFO_NEWEST_VERSION_INFO) htmlLoad "https://ace3mod.com/version.html"; } else { - ((_this select 0) displayCtrl 80090) ctrlShow false; + _controlsGroup ctrlShow false; }; /* diff --git a/addons/optionsmenu/script_component.hpp b/addons/optionsmenu/script_component.hpp index 8fac89ba9a..c13e915702 100644 --- a/addons/optionsmenu/script_component.hpp +++ b/addons/optionsmenu/script_component.hpp @@ -17,6 +17,10 @@ #include "\z\ace\addons\main\script_macros.hpp" +#define IDC_MAIN_INFO 80090 +#define IDC_MAIN_INFO_CURRENT_VERSION_INFO 80091 +#define IDC_MAIN_INFO_NEWEST_VERSION_INFO 80092 + #define MENU_TAB_OPTIONS 0 #define MENU_TAB_COLORS 1 diff --git a/addons/optionsmenu/stringtable.xml b/addons/optionsmenu/stringtable.xml index d94ca8726c..fda346cf3f 100644 --- a/addons/optionsmenu/stringtable.xml +++ b/addons/optionsmenu/stringtable.xml @@ -13,6 +13,9 @@ ACE Beállítások Opzioni ACE ACE オプション + ACE 옵션 + ACE 设定 + ACE 設定 Fix Animation @@ -23,9 +26,12 @@ Napraw animację Corriger animation Animációk kijavítása - Fixa l'animazione + Sistema l'animazione Arrumar Animação アニメーションを修正 + 동작 고정 + 修复动作BUG + 修復動作BUG Reset All @@ -39,6 +45,9 @@ Resetta tutto Resetar Tudo すべて初期化 + 모두 초기화 + 重置为预设值 + 重置為預設值 Colors @@ -52,6 +61,9 @@ Colori Cores + 색상 + 颜色 + 顏色 Options @@ -65,6 +77,9 @@ Beállítások Opzioni オプション + 옵션 + 设定 + 設定 Values @@ -78,6 +93,9 @@ Valori Valores + + 数值 + 數值 Setting: @@ -91,6 +109,9 @@ Parametri: Opção: 設定: + 설정: + 设定: + 設定: Export @@ -104,6 +125,9 @@ Esporta Exportar 出力 + 내보내기 + 输出 + 輸出 Open Export Menu @@ -117,6 +141,9 @@ Apri menù esportazione Abrir menu de exportação 出力メニューを開く + 내보내기 메뉴 열기 + 开启输出选单 + 開啟輸出選單 String input. @@ -130,6 +157,9 @@ Stringa di unput. Input de String 文字列の入力 + 문자열 입력 + 输入数值 + 輸入數值 Array. Seperate elements by using ,. @@ -140,9 +170,12 @@ Tableau. Séparation par ,. Tabulka. Odděl elementy použitím ,. Array. Válasszad el az elemeket vesszővel. - Array. Separa gli elementi usando ,. + Vettor. Separa gli elementi usando ,. Vetor. Separe elementos usando *,*. - アライ。,を使うことで区別できます。 + アレイ。,を使うことで区切れます。 + 배열. 요소를 ,. 로 나눔 + 阵列。使用','来做每个值的区隔 + 陣列。使用','來做每個值的區隔 Number @@ -156,6 +189,9 @@ Numero Número + 숫자 + 数字 + 數字 Uknown input type @@ -169,6 +205,9 @@ Input inserito sconosciuto Tipo desonhecido de input 不明な入力です + 불분명한 입력입니다 + 未知输入类型 + 未知輸入類型 Save input @@ -182,6 +221,9 @@ Salva input Salvar input 入力を保存 + 입력 저장 + 储存输入 + 儲存輸入 Include Client Settings @@ -195,6 +237,9 @@ Includi i parametri del client Incluir opções do cliente クライアント設定を含む + 클라이언트 설정 포함 + 包含客户端设定 + 包含客戶端設定 Exclude Client Settings @@ -208,6 +253,9 @@ Escludi i parametri del client Excluir opções do cliente クライアント設定を実行する + 클라이언트 설정 제외 + 不包含客户端设定 + 不包含客戶端設定 Settings exported to clipboard @@ -221,6 +269,9 @@ Parametri esportati alla clipboard Opções exportadas para o clipboard. クリップボードに設定を出力する + 클립보드로 설정 내보내기 + 设定输出至剪贴簿 + 設定輸出至剪貼簿 Option Menu UI Scaling @@ -234,6 +285,9 @@ Escalar o menu de opções Proporzioni della interfaccia utente オプション メニューにあるユーザ インタフェイスの大きさ + 옵션메뉴 UI 비례도 + 调整设定选单视窗大小 + 調整設定選單視窗大小 Allow Config Export [ACE] @@ -247,6 +301,9 @@ Разрешить экспорт настроек [ACE] Consenti Esportazione del Config [ACE] 設定の出力を許可 [ACE] + 설정 내보내기 허가 [ACE] + 允许配置导出 [ACE] + 允許配置導出 [ACE] Allow @@ -260,6 +317,9 @@ Разрешить Consenti 許可 + 허가 + 允许 + 允許 Allow export of all settings to a server config formatted. @@ -273,6 +333,9 @@ Разрешить экспорт всех настроек в формате серверного конфига. Consenti esportazione di tutti i parametri ad config formato per server. 全ての設定をサーバ用設定の形式へと出力できるようにします。 + 모든 설정을 서버 설정 형식으로 내보내는것을 허락합니다. + 允许导出所有设定成伺服器配置格式的档案。 + 允許導出所有設定成伺服器配置格式的檔案。 When allowed, you have access to the settings modification and export in SP. Clicking export will place the formated config on your clipboard. @@ -286,6 +349,9 @@ Когда разршен, у вас появляется доступ к модификации настроек и экспорту их в одинночном режиме. Нажатие на кнопку Экспорт поместит форматированные настройки в буфер обмена. Quando consentito, hai accesso alle modifiche delle impostazioni ed esportazione in SP. Cliccando Esporta piazzera il config formattato sul tuo Blocco Note. 許可の場合、あなたは設定の変更と出力をシングルプレイで可能です。出力をクリックすると、サーバ用設定の形式となっている設定がクリップボードに保存されます。 + 허락하는 경우 싱글플레이에서 설정의 변경과 내보내기가 가능해집니다. 내보내기를 눌러서 서버 형성의 설정을 클립보드로 보냅니다. + 当本功能开启时,你将能在单人模式中调整并输出设定。点击输出按钮后将会让相关设定参数复制到剪贴簿上。 + 當本功能開啟時,你將能在單人模式中調整並輸出設定。點擊輸出按鈕後將會讓相關設定參數複製到剪貼簿上。 Hide @@ -299,6 +365,9 @@ Скрыть Nascondi 非表示 + 숨기기 + 隐藏 + 隱藏 Top right, downwards @@ -312,6 +381,9 @@ Справа — сверху вниз In Alto a Destra, verso il Basso 右上、下側 + 오른쪽 위에서 아래로 + 右上角,向下 + 右上角,向下 Top right, to the left @@ -325,6 +397,9 @@ Сверху — справа налево In Alto a Destra, verso Sinistra 右上、左詰 + 오른쪽 위에서 왼쪽으로 + 右上角,向左 + 右上角,向左 Top left, downwards @@ -338,6 +413,9 @@ Слева - сверху вниз In Alto a Sinistra, verso il Basso 左上、下側 + 왼쪽 위에서 아래로 + 左上角,向下 + 左上角,向下 Top left, to the right @@ -351,6 +429,9 @@ Сверху — слева направо In Alto a Sinistra, verso Destra 右上、右詰 + 왼쪽 위에서 오른쪽으로 + 左上角,向右 + 左上角,向右 Top @@ -364,6 +445,9 @@ Сверху Alto 上側 + 상단 + 上方 + 上方 Bottom @@ -377,6 +461,9 @@ Снизу Basso 下側 + 하단 + 下方 + 下方 Debug To Clipboard @@ -389,7 +476,10 @@ Debug a vágólapra Отладка в буфер обмена Debug su Blocco Note - クリップボードへデバッグ + クリップボードにデバッグ + 디버그를 클립보드로 + 复制除错讯息至剪贴簿 + 複製除錯訊息至剪貼簿 Sends debug information to RPT and clipboard. @@ -402,7 +492,10 @@ Debug információt küld az RPT-be és a vágólapra. Отправляет отладочную информацию в RPT и буфер обмена. Invia informazioni di debug all'RPT e al Blocco Note - デバッグ情報の RPT とクリップボードに送ります。 + デバッグ情報を RPT とクリップボードに送ります。 + 디버그 정보를 보고하기 및 클립보드에 복사하기 위해 보냅니다. + 复制除错讯息至剪贴簿与RPT报告档中。 + 複製除錯訊息至剪貼簿與RPT報告檔中。 Headbug Fix @@ -414,8 +507,11 @@ Fix Headbug Fix Headbug Corregir error de cabeza (headbug) - Sistema Headbug + Sistema Bug della Testa ヘッドバグ修正 + 헤드버그 수정 + 修复动作BUG + 修復動作BUG Resets your animation state. @@ -429,6 +525,9 @@ Restablece tu estado de animación. Resetta il tuo stato animazione 現在のアニメーションの状況を初期化します。 + 자신의 동작 상태 초기화 + 当ACE发生动作BUG时,点此修复。 + 當ACE發生動作BUG時,點此修復。 ACE News @@ -440,8 +539,11 @@ Nouveautés ACE ACE hírek Новости ACE - News ACE - ACE からのお知らせ + Novità ACE + ACE ニュース + ACE 새소식 + ACE新闻 + ACE新聞 Show News on Main Menu @@ -454,7 +556,10 @@ Показывать новости в Главном Меню Zobrazit zprávy v hlavním menu Mostra News nel Menù Princinpale - メイン メニュにお知らせを表示します + メイン画面にニュースを表示します + 메인메뉴에 새소식을 표시합니다 + 显示新闻消息于主选单 + 顯示新聞消息於主選單 All Categories @@ -467,6 +572,9 @@ Tutte le Categorie Toutes les catégories 全カテゴリ + 모든 카테고리 + 全局设定 + 全局設定 Logistics @@ -479,6 +587,9 @@ Logistica Logistique ロジスティクス + 보급 + 后勤设定 + 後勤設定 - \ No newline at end of file + diff --git a/addons/overheating/CfgVehicles.hpp b/addons/overheating/CfgVehicles.hpp index a096754ce3..aa9d4e8535 100644 --- a/addons/overheating/CfgVehicles.hpp +++ b/addons/overheating/CfgVehicles.hpp @@ -7,15 +7,16 @@ class CfgVehicles { class GVAR(UnJam) { displayName = CSTRING(UnjamWeapon); condition = QUOTE( GVAR(enabled) && {[_player] call FUNC(canUnjam)} ); - exceptions[] = {"isNotInside", "isNotSitting"}; + exceptions[] = {"isNotInside", "isNotSwimming", "isNotSitting"}; statement = QUOTE( [ARR_2(_player, currentMuzzle _player)] call FUNC(clearJam); ); showDisabled = 0; priority = 4; - icon = QPATHTOF(UI\unjam_ca.paa); + icon = QPATHTOEF(common,UI\repack_ca.paa); }; class GVAR(SwapBarrel) { displayName = CSTRING(SwapBarrel); condition = QUOTE( [ARR_2(_player, currentWeapon _player)] call FUNC(canSwapBarrel) ); + exceptions[] = {"isNotInside", "isNotSwimming", "isNotSitting"}; statement = QUOTE( [ARR_3(_player, _player, currentWeapon _player)] call FUNC(swapBarrel); ); showDisabled = 0; priority = 3; @@ -24,7 +25,7 @@ class CfgVehicles { class GVAR(CheckTemperature) { displayName = CSTRING(CheckTemperatureShort); condition = QUOTE( GVAR(enabled) && {switch (currentWeapon _player) do {case (''): {false}; case (primaryWeapon _player); case (handgunWeapon _player): {true}; default {false}}} ); - exceptions[] = {"isNotInside", "isNotSitting"}; + exceptions[] = {"isNotInside", "isNotSwimming", "isNotSitting"}; statement = QUOTE( [ARR_3(_player, _player, currentWeapon _player)] call FUNC(checkTemperature); ); showDisabled = 0; priority = 2.9; @@ -33,7 +34,7 @@ class CfgVehicles { class GVAR(CheckTemperatureSpareBarrels) { displayName = CSTRING(CheckTemperatureSpareBarrelsShort); condition = QUOTE((_player) call FUNC(canCheckSpareBarrelsTemperatures) ); - exceptions[] = {"isNotInside", "isNotSitting"}; + exceptions[] = {"isNotInside", "isNotSwimming", "isNotSitting"}; statement = QUOTE( [_player] call FUNC(checkSpareBarrelsTemperatures); ); showDisabled = 0; priority = 2.8; @@ -48,12 +49,13 @@ class CfgVehicles { displayName = CSTRING(SwapBarrel); condition = QUOTE( [ARR_2(_player, currentWeapon _target)] call FUNC(canSwapBarrel) ); statement = QUOTE([ARR_3(_player, _target, currentWeapon _target)] call FUNC(swapBarrelAssistant);); + exceptions[] = {"isNotInside", "isNotSwimming", "isNotSitting"}; icon = QUOTE(PATHTOF(UI\spare_barrel_ca.paa)); }; class GVAR(CheckTemperature) { displayName = CSTRING(CheckTemperatureShort); - condition = QUOTE( GVAR(enabled) && {switch (currentWeapon _target) do {case (''): {false}; case (primaryWeapon _target); case (handgunWeapon _target): {true}; default {false}}} ); - exceptions[] = {"isNotInside", "isNotSitting"}; + condition = QUOTE( GVAR(enabled) && {switch (currentWeapon _target) do {case ('ACE_FakePrimaryWeapon'); case (''): {false}; case (primaryWeapon _target); case (handgunWeapon _target): {true}; default {false}}} ); + exceptions[] = {"isNotInside", "isNotSwimming", "isNotSitting"}; statement = QUOTE( [ARR_3(_player, _target, currentWeapon _target)] call FUNC(checkTemperature); ); icon = QUOTE(PATHTOF(UI\temp_ca.paa)); }; @@ -68,62 +70,62 @@ class CfgVehicles { class FIA_Box_Base_F; class Box_NATO_Support_F: NATO_Box_Base { - class TransportItems { - MACRO_ADDITEM(ACE_SpareBarrel,2); + class TransportMagazines { + MACRO_ADDMAGAZINE(ACE_SpareBarrel,2); }; }; class B_supplyCrate_F: ReammoBox_F { - class TransportItems { - MACRO_ADDITEM(ACE_SpareBarrel,2); + class TransportMagazines { + MACRO_ADDMAGAZINE(ACE_SpareBarrel,2); }; }; class Box_East_Support_F: EAST_Box_Base { - class TransportItems { - MACRO_ADDITEM(ACE_SpareBarrel,2); + class TransportMagazines { + MACRO_ADDMAGAZINE(ACE_SpareBarrel,2); }; }; class O_supplyCrate_F: B_supplyCrate_F { - class TransportItems { - MACRO_ADDITEM(ACE_SpareBarrel,2); + class TransportMagazines { + MACRO_ADDMAGAZINE(ACE_SpareBarrel,2); }; }; class Box_IND_Support_F: IND_Box_Base { - class TransportItems { - MACRO_ADDITEM(ACE_SpareBarrel,2); + class TransportMagazines { + MACRO_ADDMAGAZINE(ACE_SpareBarrel,2); }; }; class Box_FIA_Support_F: FIA_Box_Base_F { - class TransportItems { - MACRO_ADDITEM(ACE_SpareBarrel,2); + class TransportMagazines { + MACRO_ADDMAGAZINE(ACE_SpareBarrel,2); }; }; class I_supplyCrate_F: B_supplyCrate_F { - class TransportItems { - MACRO_ADDITEM(ACE_SpareBarrel,2); + class TransportMagazines { + MACRO_ADDMAGAZINE(ACE_SpareBarrel,2); }; }; class IG_supplyCrate_F: ReammoBox_F { - class TransportItems { - MACRO_ADDITEM(ACE_SpareBarrel,2); + class TransportMagazines { + MACRO_ADDMAGAZINE(ACE_SpareBarrel,2); }; }; class C_supplyCrate_F: ReammoBox_F { - class TransportItems { - MACRO_ADDITEM(ACE_SpareBarrel,2); + class TransportMagazines { + MACRO_ADDMAGAZINE(ACE_SpareBarrel,2); }; }; class ACE_Box_Misc: Box_NATO_Support_F { - class TransportItems { - MACRO_ADDITEM(ACE_SpareBarrel,6); + class TransportMagazines { + MACRO_ADDMAGAZINE(ACE_SpareBarrel,6); }; }; }; diff --git a/addons/overheating/CfgWeapons.hpp b/addons/overheating/CfgWeapons.hpp index c7a83eec6e..f094ec7b27 100644 --- a/addons/overheating/CfgWeapons.hpp +++ b/addons/overheating/CfgWeapons.hpp @@ -1,7 +1,4 @@ class CfgWeapons { - class ACE_ItemCore; - class InventoryItem_Base_F; - class RifleCore; class Rifle: RifleCore { //Mean Rounds Between Stoppages (this will be scaled based on the barrel temp) diff --git a/addons/overheating/UI/unjam_ca.paa b/addons/overheating/UI/unjam_ca.paa deleted file mode 100644 index 45f7dadcea..0000000000 Binary files a/addons/overheating/UI/unjam_ca.paa and /dev/null differ diff --git a/addons/overheating/XEH_preInit.sqf b/addons/overheating/XEH_preInit.sqf index a7feade1c3..b47cf6628d 100644 --- a/addons/overheating/XEH_preInit.sqf +++ b/addons/overheating/XEH_preInit.sqf @@ -2,6 +2,8 @@ ADDON = false; +PREP_RECOMPILE_START; #include "XEH_PREP.hpp" +PREP_RECOMPILE_END; ADDON = true; diff --git a/addons/overheating/functions/fnc_canCheckSpareBarrelsTemperatures.sqf b/addons/overheating/functions/fnc_canCheckSpareBarrelsTemperatures.sqf index 29c08275ef..ae0dc760d3 100644 --- a/addons/overheating/functions/fnc_canCheckSpareBarrelsTemperatures.sqf +++ b/addons/overheating/functions/fnc_canCheckSpareBarrelsTemperatures.sqf @@ -6,12 +6,16 @@ * 0: Player * * Return Value: - * Bool + * Bool + * + * Example: + * [bob] call ace_overheating_fnc_canCheckSpareBarrelsTemperatures * * Public: No */ #include "script_component.hpp" -params ["_unit"]; + +params ["_player"]; //Get the classname of the spare barrel for the weapon private _weaponBarrelClass = getText (configFile >> 'CfgWeapons' >> currentWeapon _player >> QGVAR(barrelClassname)); @@ -22,4 +26,4 @@ if(_weaponBarrelClass == "") then { //Check if the player has the barrel and the weapon can have its barrel swapped private _canCheckTemperature = GVAR(enabled) && {_weaponBarrelClass in magazines _player}; -_canCheckTemperature; \ No newline at end of file +_canCheckTemperature; diff --git a/addons/overheating/functions/fnc_canSwapBarrel.sqf b/addons/overheating/functions/fnc_canSwapBarrel.sqf index e183490439..560183e382 100644 --- a/addons/overheating/functions/fnc_canSwapBarrel.sqf +++ b/addons/overheating/functions/fnc_canSwapBarrel.sqf @@ -5,8 +5,12 @@ * Arguments: * 0: Player * 1: Weapon + * * Return Value: - * Bool + * Bool + * + * Example: + * [bob, "weapon"] call ace_overheating_fnc_canSwapBarrel * * Public: No */ @@ -23,4 +27,4 @@ if(_weaponBarrelClass == "") then { _weaponBarrelClass = "ACE_SpareBarrel"; }; //If the player has the spare barrel then it can be swapped -(_weaponBarrelClass in magazines _unit) \ No newline at end of file +(_weaponBarrelClass in magazines _unit) diff --git a/addons/overheating/functions/fnc_canUnjam.sqf b/addons/overheating/functions/fnc_canUnjam.sqf index 610fa9ca22..f2ab7e8cc6 100644 --- a/addons/overheating/functions/fnc_canUnjam.sqf +++ b/addons/overheating/functions/fnc_canUnjam.sqf @@ -6,7 +6,10 @@ * 0: Player * * Return Value: - * Bool + * Bool + * + * Example: + * [bob] call ace_overheating_fnc_canUnjam * * Public: No */ diff --git a/addons/overheating/functions/fnc_checkSpareBarrelsTemperatures.sqf b/addons/overheating/functions/fnc_checkSpareBarrelsTemperatures.sqf index 8a634409ee..8f4280b261 100644 --- a/addons/overheating/functions/fnc_checkSpareBarrelsTemperatures.sqf +++ b/addons/overheating/functions/fnc_checkSpareBarrelsTemperatures.sqf @@ -8,6 +8,9 @@ * Return Value: * None * + * Example: + * [bob] call ace_overheating_fnc_checkSpareBarrelsTemperature + * * * Public: No */ @@ -15,9 +18,6 @@ params ["_player"]; -// Check canInteractWith: -if (!([_player, objNull, ["isNotInside", "isNotSitting"]] call EFUNC(common,canInteractWith))) exitWith {}; - // Make the unit go kneeling [_player] call EFUNC(common,goKneeling); @@ -34,5 +34,5 @@ if (!([_player, objNull, ["isNotInside", "isNotSitting"]] call EFUNC(common,canI {}, (localize LSTRING(CheckingSpareBarrelsTemperatures)), {true}, - ["isNotInside", "isNotSitting"] + ["isNotInside", "isNotSitting", "isNotSwimming"] ] call EFUNC(common,progressBar); diff --git a/addons/overheating/functions/fnc_firedEH.sqf b/addons/overheating/functions/fnc_firedEH.sqf index d641e82d07..d690b85aa7 100644 --- a/addons/overheating/functions/fnc_firedEH.sqf +++ b/addons/overheating/functions/fnc_firedEH.sqf @@ -8,6 +8,9 @@ * Return Value: * None * + * Example: + * call ace_overheating_fnc_firedEH + * * Public: No */ #include "script_component.hpp" @@ -94,7 +97,7 @@ if (GVAR(showParticleEffects) && {(CBA_missionTime > ((_unit getVariable [QGVAR( // Only compute jamming for the local player if (_unit != ACE_player) exitWith {END_COUNTER(firedEH);}; -_jamChance = _jamChance * ([[0.5, 1.5, 15, 150], 3 * _scaledTemperature] call EFUNC(common,interpolateFromArray)); +_jamChance = _jamChance * ([[0.5, 1, 2, 8, 20, 150], 5 * _scaledTemperature] call EFUNC(common,interpolateFromArray)); // increase jam chance on dusty grounds if prone (and at ground level) if ((stance _unit == "PRONE") && {((getPosATL _unit) select 2) < 1}) then { diff --git a/addons/overheating/functions/fnc_getWeaponData.sqf b/addons/overheating/functions/fnc_getWeaponData.sqf index b1525f0f41..21f6f156b8 100644 --- a/addons/overheating/functions/fnc_getWeaponData.sqf +++ b/addons/overheating/functions/fnc_getWeaponData.sqf @@ -10,10 +10,15 @@ * 1: slowdownFactor * 2: jamChance * + * Example: + * ["gun"] call ace_overheating_fnc_getWeaponData + * * Public: No */ #include "script_component.hpp" +params ["_weapon"]; + // Look in the cache first private _weaponData = GVAR(cacheWeaponData) getVariable _weapon; if (!isNil "_weaponData") exitWith {_weaponData}; diff --git a/addons/overheating/functions/fnc_handleTakeEH.sqf b/addons/overheating/functions/fnc_handleTakeEH.sqf index b4eecbf236..0196629a45 100644 --- a/addons/overheating/functions/fnc_handleTakeEH.sqf +++ b/addons/overheating/functions/fnc_handleTakeEH.sqf @@ -11,6 +11,9 @@ * Return Value: * None * + * Example: + * [bob, thing, "thing"] call ace_overheating_fnc_handleTakeEH + * * Public: No */ #include "script_component.hpp" diff --git a/addons/overheating/functions/fnc_loadCoolestSpareBarrel.sqf b/addons/overheating/functions/fnc_loadCoolestSpareBarrel.sqf index fa5cdd1c43..6a155a29b7 100644 --- a/addons/overheating/functions/fnc_loadCoolestSpareBarrel.sqf +++ b/addons/overheating/functions/fnc_loadCoolestSpareBarrel.sqf @@ -13,6 +13,9 @@ * Return Value: * None * + * Example: + * [bob, bob, "weapon",5, 2] call ace_overheating_fnc_loadCoolestSpareBarrel + * * * Public: No */ diff --git a/addons/overheating/functions/fnc_overheat.sqf b/addons/overheating/functions/fnc_overheat.sqf index 84ab7e152f..c29f2d5dd1 100644 --- a/addons/overheating/functions/fnc_overheat.sqf +++ b/addons/overheating/functions/fnc_overheat.sqf @@ -13,6 +13,9 @@ * Return Value: * None * + * Example: + * [bob, "weapon", "muzzle", "ammo", "magazine", bullet] call ace_overheating_fnc_overheat + * * Public: No */ #include "script_component.hpp" diff --git a/addons/overheating/functions/fnc_sendSpareBarrelsTemperaturesHint.sqf b/addons/overheating/functions/fnc_sendSpareBarrelsTemperaturesHint.sqf index 3855f96d3f..0486dd5208 100644 --- a/addons/overheating/functions/fnc_sendSpareBarrelsTemperaturesHint.sqf +++ b/addons/overheating/functions/fnc_sendSpareBarrelsTemperaturesHint.sqf @@ -10,6 +10,9 @@ * Return Value: * None * + * Example: + * [bob, "bob"] call ace_overheating_fnc_sendSpareBarrelsIsTemperaturesHint + * * * Public: No */ diff --git a/addons/overheating/functions/fnc_swapBarrel.sqf b/addons/overheating/functions/fnc_swapBarrel.sqf index 3ad49df7d7..40e4f193b8 100644 --- a/addons/overheating/functions/fnc_swapBarrel.sqf +++ b/addons/overheating/functions/fnc_swapBarrel.sqf @@ -34,4 +34,4 @@ if (_assistant isEqualTo _gunner) then { _duration = 5.0; }; -[_duration, [_assistant,_gunner,_weapon], {(_this select 0) call FUNC(swapBarrelCallback)}, {}, (localize LSTRING(SwappingBarrel))] call EFUNC(common,progressBar); +[_duration, [_assistant,_gunner,_weapon], {(_this select 0) call FUNC(swapBarrelCallback)}, {}, localize LSTRING(SwappingBarrel), nil, ["isNotInside", "isNotSitting", "isNotSwimming"]] call EFUNC(common,progressBar); diff --git a/addons/overheating/functions/fnc_swapBarrelAssistant.sqf b/addons/overheating/functions/fnc_swapBarrelAssistant.sqf index 2a98e0fa8b..fd75130be3 100644 --- a/addons/overheating/functions/fnc_swapBarrelAssistant.sqf +++ b/addons/overheating/functions/fnc_swapBarrelAssistant.sqf @@ -28,6 +28,6 @@ if (stance _assistant != "PRONE") then { // Barrel dismount gesture playSound "ACE_BarrelSwap"; -[3, [_assistant, _gunner, _weapon], {}, {}, (localize LSTRING(SwappingBarrel))] call EFUNC(common,progressBar); +[3, [_assistant, _gunner, _weapon], {}, {}, localize LSTRING(SwappingBarrel), nil, ["isNotInside", "isNotSitting", "isNotSwimming"]] call EFUNC(common,progressBar); [QGVAR(initiateSwapBarrelAssisted), [_assistant, _gunner, _weapon], _gunner] call CBA_fnc_targetEvent; diff --git a/addons/overheating/functions/fnc_swapBarrelCallback.sqf b/addons/overheating/functions/fnc_swapBarrelCallback.sqf index 0e4326cfea..99cf8298f5 100644 --- a/addons/overheating/functions/fnc_swapBarrelCallback.sqf +++ b/addons/overheating/functions/fnc_swapBarrelCallback.sqf @@ -31,7 +31,7 @@ if (_assistant isEqualTo _gunner) then { [localize LSTRING(SwappedBarrel), QPATHTOF(UI\spare_barrel_ca.paa)] call EFUNC(common,displayTextPicture); private _temp = _gunner getVariable [format [QGVAR(%1_temp), _weapon], 0]; -private _barrelMass = 0.50 * (getNumber (configFile >> "CfgWeapons" >> _weapon >> "WeaponSlotsInfo" >> "mass") / 22.0) max 1.0; +private _barrelMass = METAL_MASS_RATIO * (getNumber (configFile >> "CfgWeapons" >> _weapon >> "WeaponSlotsInfo" >> "mass") / 22.0) max 1.0; // Instruct the server to load the coolest spare barrel into the weapon and // store the removed barrel with the former weapon temperature. The server diff --git a/addons/overheating/functions/fnc_updateSpareBarrelsTemperaturesThread.sqf b/addons/overheating/functions/fnc_updateSpareBarrelsTemperaturesThread.sqf index 0bb240533c..aaefe4f037 100644 --- a/addons/overheating/functions/fnc_updateSpareBarrelsTemperaturesThread.sqf +++ b/addons/overheating/functions/fnc_updateSpareBarrelsTemperaturesThread.sqf @@ -18,7 +18,10 @@ private _pairs = []; TRACE_1("updateSpareBarrelsTemperaturesThread1",GVAR(storedSpareBarrels)); -[GVAR(storedSpareBarrels), {_pairs pushBack [_key, _value];}] call CBA_fnc_hashEachPair; +[GVAR(storedSpareBarrels), { + //IGNORE_PRIVATE_WARNING ["_key", "_value"]; + _pairs pushBack [_key, _value]; +}] call CBA_fnc_hashEachPair; TRACE_1("updateSpareBarrelsTemperaturesThread2",_pairs); { _x params ["_barrelMagazineID","_value"]; diff --git a/addons/overheating/functions/fnc_updateTemperature.sqf b/addons/overheating/functions/fnc_updateTemperature.sqf index 51b4b13ae3..f56fc05e92 100644 --- a/addons/overheating/functions/fnc_updateTemperature.sqf +++ b/addons/overheating/functions/fnc_updateTemperature.sqf @@ -27,7 +27,7 @@ private _timeVarName = format [QGVAR(%1_time), _weapon]; private _temperature = _unit getVariable [_tempVarName, 0]; private _lastTime = _unit getVariable [_timeVarName, 0]; -private _barrelMass = 0.50 * (getNumber (configFile >> "CfgWeapons" >> _weapon >> "WeaponSlotsInfo" >> "mass") / 22.0) max 1.0; +private _barrelMass = METAL_MASS_RATIO * (getNumber (configFile >> "CfgWeapons" >> _weapon >> "WeaponSlotsInfo" >> "mass") / 22.0) max 1.0; // Calculate cooling _temperature = [_temperature, _barrelMass, CBA_missionTime - _lastTime] call FUNC(calculateCooling); diff --git a/addons/overheating/script_component.hpp b/addons/overheating/script_component.hpp index 2eef9e2309..d7dde59da2 100644 --- a/addons/overheating/script_component.hpp +++ b/addons/overheating/script_component.hpp @@ -17,6 +17,7 @@ #include "\z\ace\addons\main\script_macros.hpp" #define TEMP_TOLERANCE 50 +#define METAL_MASS_RATIO 0.55 #ifdef DEBUG_MODE_FULL #define TRACE_PROJECTILE_INFO(BULLET) _vdir = vectorNormalized velocity BULLET; _dir = (_vdir select 0) atan2 (_vdir select 1); _up = asin (_vdir select 2); _mv = vectorMagnitude velocity BULLET; TRACE_3("adjusted projectile",_dir,_up,_mv); diff --git a/addons/overheating/stringtable.xml b/addons/overheating/stringtable.xml index cd5559282b..834dcf4c09 100644 --- a/addons/overheating/stringtable.xml +++ b/addons/overheating/stringtable.xml @@ -13,6 +13,9 @@ Mostrar texto quando trava acontecer Visualizza testo in caso di inceppamento 弾詰りを文章で表示 + 탄걸림의 경우 화면에 표시 + 在卡弹时显示提示讯息 + 在卡彈時顯示提示訊息 Display a notification whenever your weapon gets jammed @@ -26,6 +29,9 @@ Mostra uma notificação quando sua arma sofre um travamento. Visualizza una notifica in caso la tua arma si inceppasse 持っている武器が弾詰りをすると、通知を表示します + 총알이 무기에 걸릴경우 화면에 알림을 띄웁니다 + 当武器卡弹时显示提示讯息 + 當武器卡彈時顯示提示訊息 Overheating Particle Effects @@ -38,6 +44,9 @@ Efeito de parícula de superaquecimento Эффект частиц при перегреве 過熱の視覚効果 + 과열 입자 효과 + 枪管过热特效 + 槍管過熱特效 Show particle effects when weapon overheats @@ -50,6 +59,9 @@ Показывать эффект частиц, когда оружие перегревается Zobrazit částicové efekty když se zbraň přehřije 武器を過熱すると視覚表現を表示します + 무기가 과열되면 입자 효과를 보여줍니다 + 显示枪管过热特效 + 顯示槍管過熱特效 Overheating Particle Effects for everyone @@ -62,6 +74,9 @@ Efeito de partícula de superaquecimento para todos Эффект частиц при перегреве для всех 過熱の視覚表現を全体に与えます + 모두에게 과열 입자 효과 적용 + 显示其他玩家的枪管过热特效 + 顯示其他玩家的槍管過熱特效 Show particle effects when other players weapon overheats @@ -74,6 +89,9 @@ Показывать эффект частиц, когда оружие других игроков перегревается Zobrazit částicové efekty když se zbraň přehřije jinému hráči 他のプレイヤの過熱の視覚表現を表示します + 모든 인원이 무기가 과열될시 입자 효과가 나타납니다. + 当其他玩家的武器过热时显示特效 + 當其他玩家的武器過熱時顯示特效 Overheating Dispersion @@ -86,6 +104,9 @@ Разброс при перегреве Důsledky přehřátí zbraně 過熱による精度の低下 + 과열 명중률 저하 + 过热散射 + 過熱散射 Overheated weapons will be less accurate and have decreased muzzle velocity. Applys for all players. @@ -98,6 +119,9 @@ Перегретое оружие будет менее точным, а дульная скорость будет снижена. Применяется ко всем игрокам. Přehřátá zbraň bude méně přesná a bude mít menší úsťovou rychlost. Platí pro všechny hráče. 過熱は精度を減少させたり、初速を低下させます、これは全プレイヤに適用します。 + 무기 과열시 무기의 명중률이 저하되고 총구속도가 감소합니다. 이는 모든 플레이어에게 적용됩니다. + 过热的武器将会有打不准和减少射击初速的情况。适用于所有玩家 + 過熱的武器將會有打不準和減少射擊初速的情況。適用於所有玩家 Unjam weapon on reload @@ -110,6 +134,9 @@ Desemperrar arma no recarregamento Исправлять клин при перезарядке 再装填による弾詰りの解消 + 재장전시 탄걸림 해결 + 重装弹匣以解决卡弹 + 重裝彈匣以解決卡彈 Reloading clears a weapon jam. @@ -122,6 +149,9 @@ Recarregar desemperra arma. Перезарядка устраняет заклинивание оружия. 再装填により、弾詰りを除去します。 + 탄걸림이 재장전시 해결됩니다. + 利用重装弹匣来解决卡弹 + 利用重裝彈匣來解決卡彈 Chance of unjam failing @@ -134,6 +164,9 @@ Chance de falha de desemperramento Шанс неудачи при устранении клина 弾詰りの除去を失敗する可能性 + 탄걸림 해결 시도 실패확률 + 解决卡弹失败机率 + 解決卡彈失敗機率 Probability that an unjam action might fail, requiring to be repeated. @@ -146,6 +179,9 @@ Вертоятность того, что устранение заклинивания не сработает, и его придется повторить. Pravděpodobnost, že uvolnění zbraně selže, je proto nutné tuto akci opakovat. 弾詰りの除去を失敗する可能性が生まれ、もう一度動作を行う必要があります。 + 탄걸림 해결 시도시 실패할 확률이 있습니다. 이는 다시 탄걸림 해결을 시도해야함을 의미합니다. + 清除卡弹时有可能会失败,需要反覆进行清枪。 + 清除卡彈時有可能會失敗,需要反覆進行清槍。 Spare barrel @@ -159,6 +195,9 @@ Cano Reserva Canna di ricambio 予備銃身 + 예비 총열 + 备用枪管 + 備用槍管 Use to swap barrel. @@ -172,6 +211,9 @@ Use para trocar o cano/estriamento. Usata per cambiare la canna. 予備銃身に交換する。 + 총열을 바꿀때 사용합니다. + 用来更换枪管 + 用來更換槍管 Weapon jammed! @@ -185,6 +227,9 @@ Arma travada! Arma inceppata! 武器が詰まった! + 탄걸림! + 武器卡弹! + 武器卡彈! Clear jam @@ -198,6 +243,9 @@ Destravar arma Ripulisci l'arma 弾詰りを除去する + 탄걸림 해결 + 清除卡弹 + 清除卡彈 Jam cleared @@ -211,6 +259,9 @@ Arma destravada Arma pronta al fuoco 弾詰りが除去された + 탄걸림 해결됨 + 卡弹已清除 + 卡彈已清除 Jam failed to clear @@ -223,6 +274,9 @@ Falha no desemperramento Не удалось исправить клин 弾詰りの除去に失敗した + 탄걸림 해결 실패 + 卡弹未能清除 + 卡彈未能清除 Swap barrel @@ -236,10 +290,13 @@ Substituir cano Sostiuisci la canna 銃身を交換 + 총열 교체 + 换枪管 + 換槍管 Swapping barrel... - Lauf wird gewechselt... + Lauf wird gewechselt ... Cambiando el cañón... Wymienianie lufy... Měním hlaveň... @@ -247,8 +304,11 @@ Смена ствола... Cső kicserélése folyamatban... Substituindo cano... - Sto sostituendo la canna... + Sostituendo la canna... 銃身を交換中・・・ + 총열 교체중... + 换枪管中... + 換槍管中... Swapped barrel @@ -262,6 +322,9 @@ Cano substituído Canna sostituita 銃身を交換した + 교체된 총열 + 完成换枪管 + 完成換槍管 Check weapon temperature @@ -275,6 +338,9 @@ Controlla la temperatura della canna Проверить температуру оружия 武器の温度を測る + 무기 온도 확인 + 检查枪管温度 + 檢查槍管溫度 Check weapon temperature @@ -288,19 +354,25 @@ Conferir temperatura Controlla la temperatura della canna 武器の温度を測る + 무기 온도 확인 + 检查枪管温度 + 檢查槍管溫度 Checking temperature... - Prüfe Temperatur... + Prüfe Temperatur ... Verificando temperatura... Sprawdzanie temperatury... Vérification de la température... Hőmérséklet ellenőrzése... Zjišťuju teplotu... Conferindo temperatura... - Sto controllando la temperatura... + Controllando la temperatura... Проверка температуры... 温度を測っている・・・ + 무기 온도 확인중... + 检查枪管温度中... + 檢查槍管溫度中... Check spare barrels temperatures @@ -310,6 +382,11 @@ Zkontrolovat teplotu náhradní hlavně 予備銃身の温度を測る Sprawdź temperaturę zapasowych luf + Temperatur der Wechselläufe prüfen + 총열 온도 확인 + Controlla la temperatura della canna di ricambio + 检查备用枪管温度 + 檢查備用槍管溫度 Checking spare barrels temperatures... @@ -319,6 +396,11 @@ Kontroluji teplotu náhradní hlavně... 予備銃身の温度を測っている・・・ Sprawdzanie temperatury zapasowych luf... + Prüfe Temperatur der Wechselläufe ... + 총열 온도 확인중... + Controllando la temperatura della canna di ricambio... + 检查枪管温度中... + 檢查槍管溫度中... Temperature @@ -332,6 +414,9 @@ Temperatura Температура 温度 + 온도 + 温度 + 溫度 Cool Spare Barrel/s @@ -341,6 +426,11 @@ Studená náhrandí hlaveň 予備銃身は冷たい Zimne zapasowe lufy + Kalte Wechselläufe + 차가운 예비 총열 + Canna/e di Ricambio Fredda + 备用枪管温度正常 + 備用槍管溫度正常 Warm Spare Barrel/s @@ -350,6 +440,11 @@ Teplá náhrandí hlaveň 予備銃身は温かい Ciepłe zapasowe lufy + Warme Wechselläufe + 따뜻한 예비 총열 + Canna/e di Ricambio Calda + 备用枪管温度偏温 + 備用槍管溫度偏溫 Hot Spare Barrel/s @@ -359,6 +454,11 @@ Horká náhrandí hlaveň 予備銃身は熱い Gorące zapasowe lufy + Heiße Wechselläufe + 뜨거운 예비 총열 + Canna/e di Ricambio Molto Calda + 备用枪管温度偏热 + 備用槍管溫度偏熱 Very Hot Spare Barrel/s @@ -368,6 +468,11 @@ Velmi horká náhrandí hlaveň 予備銃身はとても熱い Bardzo gorące zapasowe lufy + Sehr heiße Wechselläufe + 매우 뜨거운 예비 총열 + Canna/e di Ricambio Estremamente Calda + 备用枪管温度过热 + 備用槍管溫度過熱 Extremely Hot Spare Barrel/s @@ -377,10 +482,15 @@ Extrémně horká náhrandí hlaveň 予備銃身は極めて熱い Ekstremalnie gorące zapasowe lufy + Extrem heiße Wechselläufe + 엄청나게 뜨거운 예비 총열 + Canna/e di Ricambio Rovente + 备用枪管温度超级热 + 備用槍管溫度超級熱 Overheating Enabled - Überhitzen Aktiviert + Überhitzung aktiviert Activada Sobrecalentamiento Superaquecimento ativado Surchauffe activée @@ -388,6 +498,10 @@ Přehřívání povoleno 過熱を有効化 Przegrzewanie włączone + 과열 활성화 + Surriscaldamento Abilitato + 启用过热 + 啟用過熱 Master enable for the overheating/jamming module @@ -396,6 +510,11 @@ Главный включатель для модуля перегрева/заклинивания 過熱と弾詰まりモジュールを全て有効化します Główny włącznik modułu przegrzewania/zacinania się broni + Hauptschalter, um die Überhitzung-/Ladehemmung-Module zu aktivieren + 과열/탄걸림 최종 활성화 + Abilitazione master per il modulo di surriscaldamento / inceppamento + 启用枪管过热/干扰模块 + 啟用槍管過熱/干擾模塊 diff --git a/addons/overpressure/ACE_Settings.hpp b/addons/overpressure/ACE_Settings.hpp new file mode 100644 index 0000000000..f2ddb5e302 --- /dev/null +++ b/addons/overpressure/ACE_Settings.hpp @@ -0,0 +1,8 @@ +class ACE_Settings { + class GVAR(distanceCoefficient) { + displayName = CSTRING(distanceCoefficient_displayName); + description = CSTRING(distanceCoefficient_toolTip); + typeName = "SCALAR"; + value = 1; + }; +}; diff --git a/addons/overpressure/XEH_postInit.sqf b/addons/overpressure/XEH_postInit.sqf index dd74ec5c3a..02b0e71bb6 100644 --- a/addons/overpressure/XEH_postInit.sqf +++ b/addons/overpressure/XEH_postInit.sqf @@ -1,7 +1,12 @@ #include "script_component.hpp" -["ace_overpressure", FUNC(overpressureDamage)] call CBA_fnc_addEventHandler; +["ace_settingsInitialized", { + TRACE_1("settingsInit eh",GVAR(distanceCoefficient)); + if (GVAR(distanceCoefficient) <= 0) exitWith {}; -// Register fire event handler -["ace_firedPlayer", DFUNC(firedEHBB)] call CBA_fnc_addEventHandler; -["ace_firedPlayerVehicle", DFUNC(firedEHOP)] call CBA_fnc_addEventHandler; + ["ace_overpressure", LINKFUNC(overpressureDamage)] call CBA_fnc_addEventHandler; + + // Register fire event handler + ["ace_firedPlayer", LINKFUNC(firedEHBB)] call CBA_fnc_addEventHandler; + ["ace_firedPlayerVehicle", LINKFUNC(firedEHOP)] call CBA_fnc_addEventHandler; +}] call CBA_fnc_addEventHandler; diff --git a/addons/overpressure/XEH_preInit.sqf b/addons/overpressure/XEH_preInit.sqf index a7feade1c3..b47cf6628d 100644 --- a/addons/overpressure/XEH_preInit.sqf +++ b/addons/overpressure/XEH_preInit.sqf @@ -2,6 +2,8 @@ ADDON = false; +PREP_RECOMPILE_START; #include "XEH_PREP.hpp" +PREP_RECOMPILE_END; ADDON = true; diff --git a/addons/overpressure/config.cpp b/addons/overpressure/config.cpp index 75b58d5988..d99cbb1cc7 100644 --- a/addons/overpressure/config.cpp +++ b/addons/overpressure/config.cpp @@ -14,5 +14,6 @@ class CfgPatches { }; }; +#include "ACE_Settings.hpp" #include "CfgEventHandlers.hpp" #include "CfgWeapons.hpp" diff --git a/addons/overpressure/functions/fnc_cacheOverPressureValues.sqf b/addons/overpressure/functions/fnc_cacheOverPressureValues.sqf index 4b447b5012..96d45ffe04 100644 --- a/addons/overpressure/functions/fnc_cacheOverPressureValues.sqf +++ b/addons/overpressure/functions/fnc_cacheOverPressureValues.sqf @@ -46,7 +46,7 @@ TRACE_1("ConfigPath",_config); // get the Variables out of the Configes and create a array with then private _return = [ (getNumber (_config >> QGVAR(angle))), - (getNumber (_config >> QGVAR(range))), + (getNumber (_config >> QGVAR(range))) * GVAR(distanceCoefficient), (getNumber (_config >> QGVAR(damage))) ]; diff --git a/addons/overpressure/functions/fnc_getDistance.sqf b/addons/overpressure/functions/fnc_getDistance.sqf index febb4ea747..5f76c12d1a 100644 --- a/addons/overpressure/functions/fnc_getDistance.sqf +++ b/addons/overpressure/functions/fnc_getDistance.sqf @@ -3,9 +3,9 @@ * Calculate the distance to the first intersection of a line * * Arguments: - * 0: Pos ASL of origin (ARRAY> + * 0: Pos ASL of origin * 1: Direction - * 2: Max distance to search + * 2: Max distance to search * 3: Shooter * * Return Value: @@ -38,7 +38,7 @@ private _distance = 999; if (isNull _intersectObject) then { //Terrain: // Calculate the angle between the terrain and the back blast direction - _angle = 90 - acos (- (_surfaceNormal vectorDotProduct _direction)); + private _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}; diff --git a/addons/overpressure/functions/fnc_overpressureDamage.sqf b/addons/overpressure/functions/fnc_overpressureDamage.sqf index 75286a968b..f75568e29b 100644 --- a/addons/overpressure/functions/fnc_overpressureDamage.sqf +++ b/addons/overpressure/functions/fnc_overpressureDamage.sqf @@ -51,6 +51,7 @@ TRACE_3("cache",_overpressureAngle,_overpressureRange,_overpressureDamage); private _beta = sqrt (1 - _angle / _overpressureAngle); private _damage = _alpha * _beta * _overpressureDamage; + TRACE_1("",_damage); // If the target is the ACE_player if (_x == ACE_player) then {[_damage * 100] call BIS_fnc_bloodEffect}; diff --git a/addons/overpressure/stringtable.xml b/addons/overpressure/stringtable.xml new file mode 100644 index 0000000000..9d909f918e --- /dev/null +++ b/addons/overpressure/stringtable.xml @@ -0,0 +1,27 @@ + + + + + Overpressure Distance Coefficient + Überdruckentfernungskoeffizient + 過圧の距離係数 + 초과압력 거리 계수 + Mnożnik dystansu nadciśnienia + Coéfficient de distance pour la surpression + Coefficente Distanza Sovrapressione + 高压影响距离系数 + 高壓影響距離係數 + + + Scales the overpressure effect [Default: 1] + Stellt den Koeffizient für die Überdruckentfernung ein [Standard: 1] + 過圧効果の範囲 [標準: 1] + 초과압력의 효과 크기 [기본설정: 1] + Skaluje efekt nadciśnienia [Domyślne: 1] + Échelonne les effets de la surpression [Par défaut : 1] + Scala l'effetto di sovrapressione [Predefinito: 1] + 高压影响的范围 [预设: 1] + 高壓影響的範圍 [預設: 1] + + + diff --git a/addons/parachute/XEH_preInit.sqf b/addons/parachute/XEH_preInit.sqf index bffa5623b8..227fa9e38c 100644 --- a/addons/parachute/XEH_preInit.sqf +++ b/addons/parachute/XEH_preInit.sqf @@ -17,6 +17,8 @@ ADDON = false; +PREP_RECOMPILE_START; #include "XEH_PREP.hpp" +PREP_RECOMPILE_END; ADDON = true; diff --git a/addons/parachute/functions/fnc_checkCutParachute.sqf b/addons/parachute/functions/fnc_checkCutParachute.sqf index 94137ed67c..67fd842f92 100644 --- a/addons/parachute/functions/fnc_checkCutParachute.sqf +++ b/addons/parachute/functions/fnc_checkCutParachute.sqf @@ -3,10 +3,10 @@ * Reset the parachute system. * * Arguments: - * 0: Object + * 0: Object * * Return Value: - * Boolean + * Boolean * * Example: * [player] call FUNC(checkCutParachute); @@ -15,4 +15,4 @@ */ #include "script_component.hpp" params ["_unit"]; -(vehicle _unit isKindOf 'ParachuteBase' && !(_unit getVariable [QGVAR(chuteIsCut),false]) && (_unit getVariable [QGVAR(hasReserve),false])) \ No newline at end of file +(vehicle _unit isKindOf 'ParachuteBase' && !(_unit getVariable [QGVAR(chuteIsCut),false]) && (_unit getVariable [QGVAR(hasReserve),false])) diff --git a/addons/parachute/functions/fnc_cutParachute.sqf b/addons/parachute/functions/fnc_cutParachute.sqf index f7aa86991b..34b808d9d8 100644 --- a/addons/parachute/functions/fnc_cutParachute.sqf +++ b/addons/parachute/functions/fnc_cutParachute.sqf @@ -3,10 +3,10 @@ * Cut Parachute and delete Old * * Arguments: - * 0: Object + * 0: Object * * Return Value: - * Nothing + * None * * Example: * [player] call FUNC(cutParachute); diff --git a/addons/parachute/functions/fnc_handleInfoDisplayChanged.sqf b/addons/parachute/functions/fnc_handleInfoDisplayChanged.sqf index b27849a0c8..7bb500912e 100644 --- a/addons/parachute/functions/fnc_handleInfoDisplayChanged.sqf +++ b/addons/parachute/functions/fnc_handleInfoDisplayChanged.sqf @@ -3,11 +3,14 @@ * Hides the height and velocity display while freefalling or parachuting on higher difficulties. * * Arguments: - * Stuff from infoDisplayChanged eventhandler. + * Stuff from infoDisplayChanged eventhandler. * * Return Value: * None * + * Example: + * [?] call ACE_parachute_fnc_handleInfoDisplayChanged + * * Public: No */ #include "script_component.hpp" diff --git a/addons/parachute/functions/fnc_onEachFrame.sqf b/addons/parachute/functions/fnc_onEachFrame.sqf index 0c6809b648..f25fca8f49 100644 --- a/addons/parachute/functions/fnc_onEachFrame.sqf +++ b/addons/parachute/functions/fnc_onEachFrame.sqf @@ -20,8 +20,7 @@ if (isNull _player) exitWith {[(_this select 1)] call CALLSTACK(CBA_fnc_removePe if !((vehicle _player) isKindOf "ParachuteBase") exitWith {[(_this select 1)] call CALLSTACK(CBA_fnc_removePerFrameHandler);GVAR(PFH) = false;}; if (isTouchingGround _player) exitWith {[(_this select 1)] call CALLSTACK(CBA_fnc_removePerFrameHandler);GVAR(PFH) = false;}; -private ["_pos"]; -_pos = getPosASL (vehicle _player); +private _pos = getPosASL (vehicle _player); if ((lineIntersects [_pos, _pos vectorAdd [0,0,-0.5], vehicle _player, _player]) || {((ASLtoATL _pos) select 2) < 0.75}) then { [(_this select 1)] call CALLSTACK(CBA_fnc_removePerFrameHandler); diff --git a/addons/parachute/functions/fnc_showAltimeter.sqf b/addons/parachute/functions/fnc_showAltimeter.sqf index b8ee8add6d..ff9a560fd8 100644 --- a/addons/parachute/functions/fnc_showAltimeter.sqf +++ b/addons/parachute/functions/fnc_showAltimeter.sqf @@ -28,18 +28,16 @@ GVAR(AltimeterActive) = true; (_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"]; + private _HeightText = _display displayCtrl 1100; + private _DecendRate = _display displayCtrl 1000; + private _TimeText = _display displayCtrl 1001; + private _hour = floor daytime; + private _minute = floor ((daytime - _hour) * 60); - _HeightText = _display displayCtrl 1100; - _DecendRate = _display displayCtrl 1000; - _TimeText = _display displayCtrl 1001; - _hour = floor daytime; - _minute = floor ((daytime - _hour) * 60); - - _height = ((getPosASL _unit) select 2) + EGVAR(common,mapAltitude); - _curTime = CBA_missionTime; - _timeDiff = _curTime - _prevTime; - _descentRate = if(_timeDiff > 0) then {floor((_oldHeight - _height) / _timeDiff)} else {0}; + private _height = ((getPosASL _unit) select 2) + EGVAR(common,mapAltitude); + private _curTime = CBA_missionTime; + private _timeDiff = _curTime - _prevTime; + private _descentRate = if(_timeDiff > 0) then {floor((_oldHeight - _height) / _timeDiff)} else {0}; _TimeText ctrlSetText (format ["%1:%2",[_hour, 2] call EFUNC(common,numberToDigitsString),[_minute, 2] call EFUNC(common,numberToDigitsString)]); _HeightText ctrlSetText (format ["%1", floor(_height)]); diff --git a/addons/parachute/functions/fnc_storeParachute.sqf b/addons/parachute/functions/fnc_storeParachute.sqf index 8980a8ff82..adc513fbf9 100644 --- a/addons/parachute/functions/fnc_storeParachute.sqf +++ b/addons/parachute/functions/fnc_storeParachute.sqf @@ -1,18 +1,19 @@ /* - * Author: joko // Jonas - * Add the Reserve Parachute to Units or Save Backpack if is a Parachute in Unit - * - * Arguments: - * None - * - * Return Value: - * 0: Unit - * - * Example: - * None - * - * Public: No - */ + * Author: joko // Jonas + * Add the Reserve Parachute to Units or Save Backpack if is a Parachute in Unit + * + * Arguments: + * None + * + * Return Value: + * 0: Unit + * + * Example: + * call ace_parachute_fnc_storeParachute + * + * Public: No + */ + #include "script_component.hpp" params ["_unit"]; diff --git a/addons/parachute/stringtable.xml b/addons/parachute/stringtable.xml index 4521aa8780..3d8408aacf 100644 --- a/addons/parachute/stringtable.xml +++ b/addons/parachute/stringtable.xml @@ -13,6 +13,9 @@ Altimetro Altímetro 高度計 + 고도계 + 高度计 + 高度計 Altimeter Watch @@ -26,6 +29,9 @@ Controlla l'altimetro Relógio Altímetro 時計型高度計 + 고도계 시계 + 高度计手表 + 高度計手錶 Used to show height, descent rate and the time. @@ -39,6 +45,9 @@ Usato per mostrare l'altitudine, la velocità di discesa e l'ora. Usado para mostrar altura, taxa de descida e o tempo. 高度や降下率、時間を見るのに使います。 + 높이와, 하강속도 그리고 시간을 보여줍니다. + 用于显示高度,下降率和时间。 + 用於顯示高度,下降率和時間。 Non-Steerable Parachute @@ -52,6 +61,9 @@ Paracadute non manovrabile Para-querdas não controlável 非操作型パラシュート + 비-조종 낙하산 + 非可操控降落伞 + 非可操控降落傘 Cut Parachute @@ -65,6 +77,9 @@ Cortar paracaídas Taglia Paracadute パラシュートを切断 + 낙하산 자르기 + 剪断降落伞 + 剪斷降落傘 Reserve Parachute @@ -78,6 +93,9 @@ Paracaídas de reserva Paracadute di Riserva 予備パラシュート + 예비 낙하산 + 备用降落伞 + 備用降落傘 - \ No newline at end of file + diff --git a/addons/pylons/$PBOPREFIX$ b/addons/pylons/$PBOPREFIX$ new file mode 100644 index 0000000000..4da952ebb7 --- /dev/null +++ b/addons/pylons/$PBOPREFIX$ @@ -0,0 +1 @@ +z\ace\addons\pylons diff --git a/addons/pylons/ACE_Settings.hpp b/addons/pylons/ACE_Settings.hpp new file mode 100644 index 0000000000..696fcc1eeb --- /dev/null +++ b/addons/pylons/ACE_Settings.hpp @@ -0,0 +1,44 @@ +class ACE_Settings { + class GVAR(enabled) { + category = CSTRING(Category_Pylons); + displayName = CSTRING(Enabled); + description = CSTRING(Enabled_description); + value = 1; + typeName = "BOOL"; + }; + class GVAR(rearmNewPylons) { + category = CSTRING(Category_Pylons); + displayName = CSTRING(RearmNewPylons); + description = CSTRING(RearmNewPylons_description); + value = 0; + typeName = "BOOL"; + }; + class GVAR(searchDistance) { + category = CSTRING(Category_Pylons); + displayName = CSTRING(SearchDistance); + description = CSTRING(SearchDistance_description); + value = 15; + typeName = "SCALAR"; + }; + class GVAR(timePerPylon) { + category = CSTRING(Category_Pylons); + displayName = CSTRING(TimePerPylon); + description = CSTRING(TimePerPylon_description); + value = 5; + typeName = "SCALAR"; + }; + class GVAR(requireEngineer) { + category = CSTRING(Category_Pylons); + displayName = CSTRING(RequireEngineer); + description = CSTRING(RequireEngineer_description); + value = 0; + typeName = "BOOL"; + }; + class GVAR(requireToolkit) { + category = CSTRING(Category_Pylons); + displayName = CSTRING(RequireToolkit); + description = CSTRING(RequireToolkit_description); + value = 1; + typeName = "BOOL"; + }; +}; diff --git a/addons/pylons/CfgEventHandlers.hpp b/addons/pylons/CfgEventHandlers.hpp new file mode 100644 index 0000000000..0d3301d6e0 --- /dev/null +++ b/addons/pylons/CfgEventHandlers.hpp @@ -0,0 +1,17 @@ +class Extended_PreStart_EventHandlers { + class ADDON { + init = QUOTE(call COMPILE_FILE(XEH_preStart)); + }; +}; + +class Extended_PreInit_EventHandlers { + class ADDON { + init = QUOTE(call COMPILE_FILE(XEH_preInit)); + }; +}; + +class Extended_PostInit_EventHandlers { + class ADDON { + init = QUOTE(call COMPILE_FILE(XEH_postInit)); + }; +}; diff --git a/addons/pylons/README.md b/addons/pylons/README.md new file mode 100644 index 0000000000..b2b6d9d064 --- /dev/null +++ b/addons/pylons/README.md @@ -0,0 +1,11 @@ +ace_pylons +============ + +Adds an interface that allows players to configure aircraft pylons. + + +## Maintainers + +The people responsible for merging changes to this component or answering potential questions. + +- [654wak654](https://github.com/654wak654) diff --git a/addons/pylons/XEH_PREP.hpp b/addons/pylons/XEH_PREP.hpp new file mode 100644 index 0000000000..56388b09b4 --- /dev/null +++ b/addons/pylons/XEH_PREP.hpp @@ -0,0 +1,13 @@ +PREP(canConfigurePylons); +PREP(configurePylons); +PREP(handleDisconnect); +PREP(onButtonApply); +PREP(onButtonClose); +PREP(onButtonDelete); +PREP(onButtonLoad); +PREP(onButtonSave); +PREP(onButtonTurret); +PREP(onComboSelChange); +PREP(onNameChange); +PREP(onPylonMirror); +PREP(showDialog); diff --git a/addons/pylons/XEH_postInit.sqf b/addons/pylons/XEH_postInit.sqf new file mode 100644 index 0000000000..8dae8d4552 --- /dev/null +++ b/addons/pylons/XEH_postInit.sqf @@ -0,0 +1,48 @@ +#include "script_component.hpp" + +["ace_settingsInitialized", { + if (!GVAR(enabled)) exitWith {}; + + private _filter = "isClass (_x >> 'Components' >> 'TransportPylonsComponent') && {(getNumber (_x >> 'scope')) > 0}"; + GVAR(aircraftWithPylons) = (_filter configClasses (configFile >> "CfgVehicles")) apply {configName _x}; + { + [_x, "init", { + params ["_aircraft"]; + + private _loadoutAction = [ + QGVAR(loadoutAction), + localize LSTRING(ConfigurePylons), + "", + {[_target] call FUNC(showDialog)}, + { + private _vehicles = nearestObjects [_target, ["Air", "LandVehicle", "Slingload_base_F", "ReammoBox_F"], GVAR(searchDistance) + 10]; + private _filter = ["transportAmmo", QEGVAR(rearm,defaultSupply)] select (["ace_rearm"] call EFUNC(common,isModLoaded)); + private _rearmVehicles = {(getNumber (configFile >> "CfgVehicles" >> typeOf _x >> _filter)) > 0} count _vehicles; + + (_rearmVehicles > 0 && {[ace_player, _target] call FUNC(canConfigurePylons)}) + } + ] call EFUNC(interact_menu,createAction); + + [_aircraft, 0, ["ACE_MainActions"], _loadoutAction] call EFUNC(interact_menu,addActionToObject); + }, false, [], true] call CBA_fnc_addClassEventHandler; + } forEach GVAR(aircraftWithPylons); + + [QGVAR(setPylonLoadOutEvent), { + params ["_aircraft", "_pylonIndex", "_pylon", "_turret"]; + _aircraft setPylonLoadOut [_pylonIndex, _pylon, false, _turret]; + }] call CBA_fnc_addEventHandler; + + [QGVAR(setAmmoOnPylonEvent), { + params ["_aircraft", "_pylonIndex", "_count"]; + _aircraft setAmmoOnPylon [_pylonIndex, _count]; + }] call CBA_fnc_addEventHandler; + + if (isServer) then { + GVAR(currentAircraftNamespace) = true call CBA_fnc_createNamespace; + publicVariable QGVAR(currentAircraftNamespace); + + addMissionEventHandler ["HandleDisconnect", LINKFUNC(handleDisconnect)]; + }; + + GVAR(searchDistanceSqr) = GVAR(searchDistance) ^ 2; +}] call CBA_fnc_addEventHandler; diff --git a/addons/pylons/XEH_preInit.sqf b/addons/pylons/XEH_preInit.sqf new file mode 100644 index 0000000000..b47cf6628d --- /dev/null +++ b/addons/pylons/XEH_preInit.sqf @@ -0,0 +1,9 @@ +#include "script_component.hpp" + +ADDON = false; + +PREP_RECOMPILE_START; +#include "XEH_PREP.hpp" +PREP_RECOMPILE_END; + +ADDON = true; diff --git a/addons/pylons/XEH_preStart.sqf b/addons/pylons/XEH_preStart.sqf new file mode 100644 index 0000000000..022888575e --- /dev/null +++ b/addons/pylons/XEH_preStart.sqf @@ -0,0 +1,3 @@ +#include "script_component.hpp" + +#include "XEH_PREP.hpp" diff --git a/addons/pylons/config.cpp b/addons/pylons/config.cpp new file mode 100644 index 0000000000..fc7159e08b --- /dev/null +++ b/addons/pylons/config.cpp @@ -0,0 +1,19 @@ +#include "script_component.hpp" + +class CfgPatches { + class ADDON { + name = COMPONENT_NAME; + units[] = {}; + weapons[] = {}; + requiredVersion = REQUIRED_VERSION; + requiredAddons[] = {"ace_interact_menu"}; + author = ECSTRING(common,ACETeam); + authors[] = {"654wak654"}; + url = ECSTRING(main,URL); + VERSION_CONFIG; + }; +}; + +#include "ACE_Settings.hpp" +#include "CfgEventHandlers.hpp" +#include "menu.hpp" diff --git a/addons/pylons/functions/fnc_canConfigurePylons.sqf b/addons/pylons/functions/fnc_canConfigurePylons.sqf new file mode 100644 index 0000000000..c679b9592d --- /dev/null +++ b/addons/pylons/functions/fnc_canConfigurePylons.sqf @@ -0,0 +1,27 @@ +/* + * Author: 654wak654 + * Checks if given unit can access the pylon configuration dialog for the given aircraft. + * + * Arguments: + * 0: Unit + * 1: Aircraft + * + * Return Value: + * Unit can configure the aircraft's pylons + * + * Example: + * [ace_player, cursorObject] call ace_pylons_fnc_canConfigurePylons + * + * Public: No + */ +#include "script_component.hpp" + +params ["_unit", "_aircraft"]; + +if (GVAR(requireEngineer) && {!([_unit] call EFUNC(common,isEngineer))}) exitWith {false}; + +if (GVAR(requireToolkit) && {!([_unit, "ToolKit"] call EFUNC(common,hasItem))}) exitWith {false}; + +if ((_unit distanceSqr _aircraft) > GVAR(searchDistanceSqr)) exitWith {false}; + +[_unit, _aircraft] call EFUNC(common,canInteractWith) diff --git a/addons/pylons/functions/fnc_configurePylons.sqf b/addons/pylons/functions/fnc_configurePylons.sqf new file mode 100644 index 0000000000..2fbc91e949 --- /dev/null +++ b/addons/pylons/functions/fnc_configurePylons.sqf @@ -0,0 +1,74 @@ +/* + * Author: 654wak654 + * Recursively shows the progress bar for each configured pylon. + * + * Arguments: + * 0: Indexes of pylons to configure + * 1: Current index + * + * Return Value: + * None + * + * Example: + * [_pylonsToConfigure, 0] call ace_pylons_fnc_configurePylons + * + * Public: No + */ +#include "script_component.hpp" + +params ["_pylonsToConfigure", "_currentPylon"]; + +if (_currentPylon == count _pylonsToConfigure) exitWith {}; + +// TODO: Animation and sound +[ + [GVAR(timePerPylon), 0] select GVAR(isCurator), + _this, + { + (_this select 0) params ["_pylonsToConfigure", "_currentPylon"]; + private _pylonIndex = _pylonsToConfigure select _currentPylon; + + // Remove the weapon of current pylon from aircraft IF weapon is only on this pylon + private _currentPylonMagazine = (getPylonMagazines GVAR(currentAircraft)) select _pylonIndex; + if (_currentPylonMagazine != "") then { + private _allPylonWeapons = (getPylonMagazines GVAR(currentAircraft)) apply { + getText (configFile >> "CfgMagazines" >> _x >> "pylonWeapon") + }; + private _pylonWeapon = _allPylonWeapons select _pylonIndex; + if (({_x == _pylonWeapon} count _allPylonWeapons) == 1) then { + GVAR(currentAircraft) removeWeaponGlobal _pylonWeapon; + }; + }; + + private _combo = GVAR(comboBoxes) select _pylonIndex select 0; + private _pylonMagazine = _combo lbData (lbCurSel _combo); + private _turret = (GVAR(comboBoxes) select _pylonIndex select 2) getVariable [QGVAR(turret), []]; + if (_turret isEqualTo [-1]) then {_turret = [];}; + + [ + QGVAR(setPylonLoadOutEvent), + [GVAR(currentAircraft), _pylonIndex + 1, _pylonMagazine, _turret] + ] call CBA_fnc_globalEvent; + + private _count = if (GVAR(rearmNewPylons) || {GVAR(isCurator)}) then { + getNumber (configFile >> "CfgMagazines" >> _pylonMagazine >> "count") + } else { + 0 + }; + + [ + QGVAR(setAmmoOnPylonEvent), + [GVAR(currentAircraft), _pylonIndex + 1, _count], + GVAR(currentAircraft) + ] call CBA_fnc_targetEvent; + + [_pylonsToConfigure, _currentPylon + 1] call FUNC(configurePylons); + }, + { + (_this select 0) params ["", "_currentPylon"]; + [format [localize LSTRING(Stopped), _currentPylon + 1], false, 5] call EFUNC(common,displayText); + }, + format [localize LSTRING(ReplacingPylon), _currentPylon + 1, count _pylonsToConfigure], + {GVAR(isCurator) || {(ace_player distanceSqr GVAR(currentAircraft)) <= GVAR(searchDistanceSqr)}}, + ["isNotInZeus"] +] call EFUNC(common,progressBar); diff --git a/addons/pylons/functions/fnc_handleDisconnect.sqf b/addons/pylons/functions/fnc_handleDisconnect.sqf new file mode 100644 index 0000000000..f255b36535 --- /dev/null +++ b/addons/pylons/functions/fnc_handleDisconnect.sqf @@ -0,0 +1,25 @@ +/* + * Author: 654wak654 + * Cleans up pylons on client disconnect. + * + * Arguments: + * 0: Player + * + * Return Value: + * None + * + * Example: + * [] call ace_pylons_fnc_handleDisconnect + * + * Public: No + */ +#include "script_component.hpp" + +params ["", "", "_uid"]; + +private _aircraft = GVAR(currentAircraftNamespace) getVariable ["_uid", objNull]; +if (!isNull _aircraft) then { + _aircraft setVariable [QGVAR(currentUser), objNull, true]; + + GVAR(currentAircraftNamespace) setVariable [_uid, nil, true]; // Remove var from namespace, no need to keep objNull +}; diff --git a/addons/pylons/functions/fnc_onButtonApply.sqf b/addons/pylons/functions/fnc_onButtonApply.sqf new file mode 100644 index 0000000000..ae27e98d4c --- /dev/null +++ b/addons/pylons/functions/fnc_onButtonApply.sqf @@ -0,0 +1,46 @@ +/* + * Author: 654wak654 + * Starts the pylon configuration. + * + * Arguments: + * None + * + * Return Value: + * None + * + * Example: + * [] call ace_pylons_fnc_onButtonApply + * + * Public: No + */ +#include "script_component.hpp" + +// Check for FRIES change +private _checkbox = CONTROL(ID_DIALOG) ID_CHECKBOX_FRIES; +if (ctrlShown _checkbox && {!((cbChecked _checkbox) isEqualTo (_checkbox getVariable QGVAR(originalState)))}) then { + if (cbChecked _checkbox) then { + [GVAR(currentAircraft)] call EFUNC(fastroping,equipFRIES); + } else { + [GVAR(currentAircraft)] call EFUNC(fastroping,cutRopes); + private _fries = GVAR(currentAircraft) getVariable [QEGVAR(fastroping,FRIES), objNull]; + deleteVehicle _fries; + }; + _checkbox setVariable [QGVAR(originalState), cbChecked _checkbox]; +}; + +private _pylonsToConfigure = []; +{ + // Pick combo boxes where current selection doesn't match original selection + if ((lbCurSel (_x select 0)) != (_x select 3)) then { + _pylonsToConfigure pushBack _forEachIndex; + }; +} forEach GVAR(comboBoxes); + +if (_pylonsToConfigure isEqualTo []) exitWith {}; + +[_pylonsToConfigure, 0] call FUNC(configurePylons); + +// As a zeus you expect module dialogs to close once you click apply +if (GVAR(isCurator)) then { + call FUNC(onButtonClose); +}; diff --git a/addons/pylons/functions/fnc_onButtonClose.sqf b/addons/pylons/functions/fnc_onButtonClose.sqf new file mode 100644 index 0000000000..fa06f3d506 --- /dev/null +++ b/addons/pylons/functions/fnc_onButtonClose.sqf @@ -0,0 +1,20 @@ +/* + * Author: 654wak654 + * Handles the closing of the dialog. + * + * Arguments: + * None + * + * Return Value: + * None + * + * Example: + * [] call ace_pylons_fnc_onButtonClose + * + * Public: No + */ +#include "script_component.hpp" + +GVAR(currentAircraft) setVariable [QGVAR(currentUser), objNull, true]; +GVAR(currentAircraftNamespace) setVariable [getPlayerUID ace_player, nil, true]; // Remove var from namespace, no need to keep objNull +closeDialog 2; diff --git a/addons/pylons/functions/fnc_onButtonDelete.sqf b/addons/pylons/functions/fnc_onButtonDelete.sqf new file mode 100644 index 0000000000..8d1fdee6de --- /dev/null +++ b/addons/pylons/functions/fnc_onButtonDelete.sqf @@ -0,0 +1,29 @@ +/* + * Author: 654wak654 + * Deletes the selected pylon configuration from profileNamespace. + * + * Arguments: + * None + * + * Return Value: + * None + * + * Example: + * [] call ace_pylons_fnc_onButtonDelete + * + * Public: No + */ +#include "script_component.hpp" + +private _loadoutName = lbText [ID_LIST_LOADOUTS, lbCurSel ID_LIST_LOADOUTS]; + +lbDelete [ID_LIST_LOADOUTS, lbCurSel ID_LIST_LOADOUTS]; + +private _aircraftLoadouts = profileNamespace getVariable [QGVAR(aircraftLoadouts), []]; +private _index = { + if ((_x select 0) isEqualTo _loadoutName && {(_x select 3) isEqualTo typeOf GVAR(currentAircraft)}) exitWith { + _forEachIndex + }; +} forEach _aircraftLoadouts; +_aircraftLoadouts deleteAt _index; +profileNamespace setVariable [QGVAR(aircraftLoadouts), _aircraftLoadouts]; diff --git a/addons/pylons/functions/fnc_onButtonLoad.sqf b/addons/pylons/functions/fnc_onButtonLoad.sqf new file mode 100644 index 0000000000..9092d0a910 --- /dev/null +++ b/addons/pylons/functions/fnc_onButtonLoad.sqf @@ -0,0 +1,58 @@ +/* + * Author: 654wak654 + * Loads selected pylon configuration from either config or profileNamespace. + * + * Arguments: + * None + * + * Return Value: + * None + * + * Example: + * [] call ace_pylons_fnc_onButtonLoad + * + * Public: No + */ +#include "script_component.hpp" + +[false] call FUNC(onPylonMirror); +(CONTROL(ID_DIALOG) ID_CHECKBOX_MIRROR) cbSetChecked false; + +private _loadoutName = ctrlText ID_EDIT_LOADOUTNAME; +private _fnc_setSelections = { + params ["_mags", "_turrets"]; + + { + _x params ["_combo", "_mirroredIndex", "_button"]; + + private _index = 0; + for "_i" from 1 to ((lbSize _combo) - 1) do { + if ((_combo lbData _i) == (_mags param [_forEachIndex, ""])) exitWith { + _index = _i; + }; + }; + _combo lbSetCurSel _index; + + [_button, false, _turrets select _forEachIndex] call FUNC(onButtonTurret); + } forEach GVAR(comboBoxes); +}; + +private _pylonComponent = configFile >> "CfgVehicles" >> typeOf GVAR(currentAircraft) >> "Components" >> "TransportPylonsComponent"; +private _loadoutFound = { + if (getText (_x >> "displayName") isEqualTo _loadoutName) exitWith { + // Get default turrets from config + private _turrets = ("true" configClasses (_pylonComponent >> "Pylons")) apply {getArray (_x >> "turret")}; + [getArray (_x >> "attachment"), _turrets] call _fnc_setSelections; + true + }; + false +} forEach ("true" configClasses (_pylonComponent >> "Presets")); + +if (_loadoutFound) exitWith {}; + +private _aircraftLoadouts = profileNamespace getVariable [QGVAR(aircraftLoadouts), []]; +{ + if ((_x select 0) isEqualTo _loadoutName && {(_x select 3) isEqualTo typeOf GVAR(currentAircraft)}) exitWith { + [_x select 1, _x select 2] call _fnc_setSelections; + }; +} forEach _aircraftLoadouts; diff --git a/addons/pylons/functions/fnc_onButtonSave.sqf b/addons/pylons/functions/fnc_onButtonSave.sqf new file mode 100644 index 0000000000..c20c8928ec --- /dev/null +++ b/addons/pylons/functions/fnc_onButtonSave.sqf @@ -0,0 +1,37 @@ +/* + * Author: 654wak654 + * Saves the selected pylon configuration to profileNamespace. + * + * Arguments: + * None + * + * Return Value: + * None + * + * Example: + * [] call ace_pylons_fnc_onButtonSave + * + * Public: No + */ +#include "script_component.hpp" + +private _loadoutName = ctrlText ID_EDIT_LOADOUTNAME; +private _aircraftLoadouts = profileNamespace getVariable [QGVAR(aircraftLoadouts), []]; +private _loadoutPylons = GVAR(comboBoxes) apply {(_x select 0) lbData (lbCurSel (_x select 0))}; +private _turretOwners = GVAR(comboBoxes) apply {(_x select 2) getVariable [QGVAR(turret), [-1]]}; + +private _found = false; +{ + if ((_x select 0) isEqualTo _loadoutName && {(_x select 2) isEqualTo typeOf GVAR(currentAircraft)}) exitWith { + _aircraftLoadouts set [_forEachIndex, [_loadoutName, _loadoutPylons, _turretOwners, typeOf GVAR(currentAircraft)]]; + _found = true; + }; +} forEach _aircraftLoadouts; + +if (!_found) then { + private _index = lbAdd [ID_LIST_LOADOUTS, _loadoutName]; + lbSetCurSel [ID_LIST_LOADOUTS, _index]; + _aircraftLoadouts pushBack [_loadoutName, _loadoutPylons, _turretOwners, typeOf GVAR(currentAircraft)]; +}; + +profileNamespace setVariable [QGVAR(aircraftLoadouts), _aircraftLoadouts]; diff --git a/addons/pylons/functions/fnc_onButtonTurret.sqf b/addons/pylons/functions/fnc_onButtonTurret.sqf new file mode 100644 index 0000000000..4554075c37 --- /dev/null +++ b/addons/pylons/functions/fnc_onButtonTurret.sqf @@ -0,0 +1,48 @@ +/* + * Author: 654wak654 + * Handles init and click events of turret switch buttons. + * + * Arguments: + * 0: Button + * 1: Should switch icons + * 2: Turret path + * + * Return Value: + * None + * + * Example: + * [_button, true, []] call ace_pylons_fnc_onButtonTurret + * + * Public: No + */ +#include "script_component.hpp" + +params ["_ctrl", "_switch", "_turret"]; + +if (_switch) then { + _turret = [[0], [-1]] select ((_ctrl getVariable QGVAR(turret)) isEqualTo [0]); + + { + _x params ["", "_mirroredIndex", "_button"]; + if (_ctrl == _button) exitWith { + if (_mirroredIndex == -1) then { + private _indexOf = _forEachIndex; + { + _x params ["", "_mirroredIndex", "_button"]; + if (_mirroredIndex == _indexOf && {!ctrlEnabled _button}) exitWith { + [_button, false, _turret] call FUNC(onButtonTurret); + }; + } forEach GVAR(comboBoxes); + }; + }; + } forEach GVAR(comboBoxes); +}; +_ctrl setVariable [QGVAR(turret), _turret]; + +if (_turret isEqualTo [-1]) then { + _ctrl ctrlSetText "a3\ui_f\data\IGUI\RscIngameUI\RscUnitInfo\role_driver_ca.paa"; + _ctrl ctrlSetTooltip localize "str_driver"; +} else { + _ctrl ctrlSetText "a3\ui_f\data\IGUI\RscIngameUI\RscUnitInfo\role_gunner_ca.paa"; + _ctrl ctrlSetTooltip localize "str_gunner"; +}; diff --git a/addons/pylons/functions/fnc_onComboSelChange.sqf b/addons/pylons/functions/fnc_onComboSelChange.sqf new file mode 100644 index 0000000000..97130ea54d --- /dev/null +++ b/addons/pylons/functions/fnc_onComboSelChange.sqf @@ -0,0 +1,38 @@ +/* + * Author: 654wak654 + * Handles various UI changes when a combobox' selection changes. + * + * Arguments: + * 0: Combobox + * 1: Selected index + * + * Return Value: + * None + * + * Example: + * [_combo, 5] call ace_pylons_fnc_onComboSelChange + * + * Public: No + */ +#include "script_component.hpp" + +params ["_ctrl", "_index"]; + +{ + _x params ["_combo", "_mirroredIndex", "", "_originalIndex"]; + if (_ctrl == _combo) exitWith { + if (_mirroredIndex == -1) then { + private _indexOf = _forEachIndex; + { + _x params ["_combo", "_mirroredIndex"]; + if (_mirroredIndex == _indexOf && {!ctrlEnabled _combo}) exitWith { + _combo lbSetCurSel _index; + }; + } forEach GVAR(comboBoxes); + }; + if !(GVAR(rearmNewPylons) || {GVAR(isCurator)}) then { + private _color = [[0.5, 0.05, 0.05, 1], [0.05, 0.05, 0.05, 1]] select (_index == _originalIndex); + _combo ctrlSetBackgroundColor _color; + }; + }; +} forEach GVAR(comboBoxes); diff --git a/addons/pylons/functions/fnc_onNameChange.sqf b/addons/pylons/functions/fnc_onNameChange.sqf new file mode 100644 index 0000000000..9915aeee70 --- /dev/null +++ b/addons/pylons/functions/fnc_onNameChange.sqf @@ -0,0 +1,25 @@ +/* + * Author: 654wak654 + * Called when current loadout name is changed. + * Prevents default presets from gettings deleted / overwritten. + * + * Arguments: + * None + * + * Return Value: + * None + * + * Example: + * [] call ace_pylons_fnc_onNameChange + * + * Public: No + */ +#include "script_component.hpp" + +if ((ctrlText ID_EDIT_LOADOUTNAME) in GVAR(defaultLoadoutNames)) then { + ctrlEnable [ID_BUTTON_SAVE, false]; + ctrlEnable [ID_BUTTON_DELETE, false]; +} else { + ctrlEnable [ID_BUTTON_SAVE, true]; + ctrlEnable [ID_BUTTON_DELETE, true]; +}; diff --git a/addons/pylons/functions/fnc_onPylonMirror.sqf b/addons/pylons/functions/fnc_onPylonMirror.sqf new file mode 100644 index 0000000000..55987b2b94 --- /dev/null +++ b/addons/pylons/functions/fnc_onPylonMirror.sqf @@ -0,0 +1,41 @@ +/* + * Author: 654wak654 + * Called when the "mirror" checkbox on the loadout dialog is checked. + * Changes the comboboxes and buttons to be mirrored / normal. + * + * Arguments: + * 0: Checked status + * + * Return Value: + * None + * + * Example: + * [false] call ace_pylons_fnc_onPylonMirror + * + * Public: No + */ +#include "script_component.hpp" + +params ["_checked"]; + +if (_checked) then { + { + _x params ["_combo", "_mirroredIndex", "_button"]; + + if (_mirroredIndex != -1) then { + private _selection = lbCurSel ((GVAR(comboBoxes) select _mirroredIndex) select 0); + _combo lbSetCurSel _selection; + _combo ctrlEnable false; + + private _mirroredButton = (GVAR(comboBoxes) select _mirroredIndex) select 2; + private _turret = _mirroredButton getVariable [QGVAR(turret), [-1]]; + [_button, false, _turret] call FUNC(onButtonTurret); + _button ctrlEnable false; + }; + } forEach GVAR(comboBoxes); +} else { + { + (_x select 0) ctrlEnable true; + (_x select 2) ctrlEnable true; + } forEach GVAR(comboBoxes); +}; diff --git a/addons/pylons/functions/fnc_showDialog.sqf b/addons/pylons/functions/fnc_showDialog.sqf new file mode 100644 index 0000000000..b0f9b6c271 --- /dev/null +++ b/addons/pylons/functions/fnc_showDialog.sqf @@ -0,0 +1,149 @@ +/* +* Author: 654wak654 +* Shows the aircraft loadout dialog for given aircraft. +* +* Arguments: +* 0: Aircraft +* 1: Is curator. Disables time and resource requirements. (default: false) +* +* Return Value: +* None +* +* Example: +* [vehicle ace_player] call ace_pylons_fnc_showDialog +* +* Public: Yes +*/ +#include "script_component.hpp" + +params ["_aircraft", ["_isCurator", false]]; + +if (!GVAR(enabled) || {!(typeOf _aircraft in GVAR(aircraftWithPylons))}) exitWith {}; + +private _currentUser = _aircraft getVariable [QGVAR(currentUser), objNull]; +if (!isNull _currentUser) exitWith { + [format [localize LSTRING(InUse), name _currentUser], false, 5] call EFUNC(common,displayText); +}; +_aircraft setVariable [QGVAR(currentUser), ace_player, true]; +GVAR(currentAircraftNamespace) setVariable [getPlayerUID ace_player, _aircraft, true]; + +GVAR(isCurator) = _isCurator; +GVAR(currentAircraft) = _aircraft; + +createDialog QGVAR(DialogLoadout); +private _display = DISPLAY(ID_DIALOG); +_display displayAddEventHandler ["Unload", LINKFUNC(onButtonClose)]; + +if (GVAR(rearmNewPylons) || {_isCurator}) then { + ctrlShow [ID_TEXT_BANNER, false]; +}; + +private _config = configFile >> "CfgVehicles" >> typeOf _aircraft; +private _pylonComponent = _config >> "Components" >> "TransportPylonsComponent"; + +ctrlSetText [ID_PICTURE_AIRCRAFT, getText (_pylonComponent >> "uiPicture")]; + +private _hasFRIES = getNumber (_config >> QEGVAR(fastroping,enabled)); +if (["ace_fastroping"] call EFUNC(common,isModLoaded) && {_hasFRIES > 1}) then { + private _checkbox = _display displayCtrl ID_CHECKBOX_FRIES; + private _fries = _aircraft getVariable [QEGVAR(fastroping,FRIES), objNull]; + _checkbox cbSetChecked (!isNull _fries); + _checkbox setVariable [QGVAR(originalState), !isNull _fries]; +} else { + ctrlShow [ID_CHECKBOX_FRIES, false]; + ctrlShow [ID_TEXT_FRIES, false]; +}; + +GVAR(comboBoxes) = []; +{ + private _combo = _display ctrlCreate [QGVAR(CtrlCombo), -1]; + private _picturePos = ctrlPosition (_display displayCtrl ID_PICTURE_AIRCRAFT); + private _uiPos = getArray (_x >> "UIposition"); + MAP(_uiPos,if (_x isEqualType 0) then {_x} else {call compile _x}); // Handle string positions + _combo ctrlSetPosition [ + (_picturePos select 0) + (_uiPos select 0), + (_picturePos select 1) + (_uiPos select 1), + 0.1 * safezoneW, + 0.028 * safezoneH + ]; + _combo ctrlCommit 0; + + _combo lbAdd localize LSTRING(Empty); + _combo lbSetData [0, ""]; + + private _mag = (getPylonMagazines _aircraft) select _forEachIndex; + private _mags = _aircraft getCompatiblePylonMagazines (_forEachIndex + 1); + private _index = 0; + { + _combo lbAdd getText (configFile >> "CfgMagazines" >> _x >> "displayName"); + _combo lbSetData [_forEachIndex + 1, _x]; + + if (_x == _mag) then { + _index = _forEachIndex + 1; + }; + } forEach _mags; + _combo lbSetCurSel _index; + _combo ctrlAddEventHandler ["LBSelChanged", LINKFUNC(onComboSelChange)]; + // TODO: Allow pylon priority selection? + + private _mirroredIndex = getNumber (_x >> "mirroredMissilePos"); + + private _button = controlNull; + if (count allTurrets [_aircraft, false] > 0) then { + _button = _display ctrlCreate ["ctrlButtonPictureKeepAspect", -1]; + private _turret = [_aircraft, _forEachIndex] call EFUNC(common,getPylonTurret); + [_button, false, _turret] call FUNC(onButtonTurret); + _button ctrlAddEventHandler ["ButtonClick", {[_this select 0, true, []] call FUNC(onButtonTurret)}]; + _button ctrlSetPosition [ + (_picturePos select 0) + (_uiPos select 0) - (0.0165 * safezoneW), + (_picturePos select 1) + (_uiPos select 1), + 0.0165 * safezoneW, + 0.028 * safezoneH + ]; + _button ctrlCommit 0; + }; + + GVAR(comboBoxes) pushBack [_combo, _mirroredIndex - 1, _button, _index]; +} forEach ("true" configClasses (_pylonComponent >> "Pylons")); + +GVAR(defaultLoadoutNames) = []; +{ + lbAdd [ID_LIST_LOADOUTS, getText (_x >> "displayName")]; + lbSetPicture [ID_LIST_LOADOUTS, _forEachIndex, "a3\data_f_jets\logos\jets_logo_small_ca.paa"]; + + GVAR(defaultLoadoutNames) pushBack getText (_x >> "displayName"); +} forEach ("true" configClasses (_pylonComponent >> "Presets")); + +{ + if ((_x select 3) == typeOf _aircraft) then { + lbAdd [ID_LIST_LOADOUTS, _x select 0]; + }; +} forEach (profileNamespace getVariable [QGVAR(aircraftLoadouts), []]); + +private _displayName = getText (_config >> "displayName"); +ctrlSetText [ID_TEXT_LISTTITLE, format [localize LSTRING(LoadoutsFor), _displayName]]; + +private _list = _display displayCtrl ID_LIST_LOADOUTS; +_list ctrlAddEventHandler ["LBSelChanged", { + params ["_ctrl"]; + + ctrlSetText [ID_EDIT_LOADOUTNAME, _ctrl lbText (lbCurSel _ctrl)]; + call FUNC(onNameChange); +}]; + +private _edit = _display displayCtrl ID_EDIT_LOADOUTNAME; +_edit ctrlAddEventHandler ["KeyUp", LINKFUNC(onNameChange)]; +_edit ctrlAddEventHandler ["KeyDown", LINKFUNC(onNameChange)]; + +private _checkbox = _display displayCtrl ID_CHECKBOX_MIRROR; +_checkbox ctrlAddEventHandler ["CheckedChanged", {[(_this select 1) == 1] call FUNC(onPylonMirror)}]; + +if (!GVAR(isCurator)) then { + [{ + isNull (GVAR(currentAircraft) getVariable [QGVAR(currentUser), objNull]) || + {(ace_player distanceSqr GVAR(currentAircraft)) > GVAR(searchDistanceSqr)} + }, { + [localize LSTRING(TooFar), false, 5] call EFUNC(common,displayText); + call FUNC(onButtonClose); + }] call CBA_fnc_waitUntilAndExecute; +}; diff --git a/addons/pylons/functions/script_component.hpp b/addons/pylons/functions/script_component.hpp new file mode 100644 index 0000000000..62e8ea51a0 --- /dev/null +++ b/addons/pylons/functions/script_component.hpp @@ -0,0 +1 @@ +#include "\z\ace\addons\pylons\script_component.hpp" diff --git a/addons/pylons/menu.hpp b/addons/pylons/menu.hpp new file mode 100644 index 0000000000..85ca6b1c95 --- /dev/null +++ b/addons/pylons/menu.hpp @@ -0,0 +1,166 @@ +// combo box that looks good + doesn't get cut off +class RscCombo; +class GVAR(CtrlCombo): RscCombo { + arrowEmpty = "\a3\3DEN\Data\Controls\ctrlCombo\arrowEmpty_ca.paa"; + arrowFull = "\a3\3DEN\Data\Controls\ctrlCombo\arrowFull_ca.paa"; + colorSelectBackground[] = {"(profileNamespace getVariable ['GUI_BCG_RGB_R', 0.13])","(profileNamespace getVariable ['GUI_BCG_RGB_G', 0.54])","(profileNamespace getVariable ['GUI_BCG_RGB_B', 0.21])",1}; +}; + +class IGUIBack; +class RscCheckBox; +class RscListBox; +class RscEdit; +class RscButtonMenu; +class RscText; +class RscPictureKeepAspect; + +class GVAR(DialogLoadout) { + idd = ID_DIALOG; + name = QGVAR(DialogLoadout); + enableSimulation = 1; + + class Controls { + class TextTitlebar: RscText { + idc = ID_TEXT_TITLEBAR; + text = CSTRING(AircraftLoadoutTitle); + x = 0.15835 * safezoneW + safezoneX; + y = 0.262 * safezoneH + safezoneY; + w = 0.68304 * safezoneW; + h = 0.028 * safezoneH; + colorBackground[] = {"(profileNamespace getVariable ['GUI_BCG_RGB_R', 0.13])","(profileNamespace getVariable ['GUI_BCG_RGB_G', 0.54])","(profileNamespace getVariable ['GUI_BCG_RGB_B', 0.21])",1}; + }; + class BackgroundDialog: IGUIBack { + idc = ID_BACKGROUND_DIALOG; + x = 0.15835 * safezoneW + safezoneX; + y = 0.29 * safezoneH + safezoneY; + w = 0.68304 * safezoneW; + h = 0.448 * safezoneH; + colorBackground[] = {0,0,0,0.3}; + }; + class BackgroundPicture: IGUIBack { + idc = ID_BACKGROUND_PICTURE; + x = 0.171616 * safezoneW + safezoneX; + y = 0.318 * safezoneH + safezoneY; + w = 0.440035 * safezoneW; + h = 0.392 * safezoneH; + colorBackground[] = {0.3,0.3,0.3,1}; + }; + class PictureAircraft: RscPictureKeepAspect { + idc = ID_PICTURE_AIRCRAFT; + x = 0.171616 * safezoneW + safezoneX; + y = 0.318 * safezoneH + safezoneY; + w = 0.440035 * safezoneW; + h = 0.392 * safezoneH; + }; + class CheckboxMirror: RscCheckBox { + idc = ID_CHECKBOX_MIRROR; + x = 0.171616 * safezoneW + safezoneX; + y = 0.318 * safezoneH + safezoneY; + w = 0.0165 * safezoneW; + h = 0.028 * safezoneH; + }; + class TextMirror: RscText { + idc = ID_TEXT_MIRROR; + text = "$STR_3DEN_Object_Attribute_PylonsMirror_displayName"; + tooltip="$STR_3DEN_Object_Attribute_PylonsMirror_tooltip"; + x = 0.188116 * safezoneW + safezoneX; + y = 0.318 * safezoneH + safezoneY; + w = 0.0656768 * safezoneW; + h = 0.028 * safezoneH; + colorBackground[] = {0,0,0,0.5}; + }; + class CheckboxFRIES: RscCheckBox { + idc = ID_CHECKBOX_FRIES; + x = 0.171616 * safezoneW + safezoneX; + y = 0.346 * safezoneH + safezoneY; + w = 0.0165 * safezoneW; + h = 0.028 * safezoneH; + }; + class TextFRIES: RscText { + idc = ID_TEXT_FRIES; + text = "FRIES"; + x = 0.188116 * safezoneW + safezoneX; + y = 0.346 * safezoneH + safezoneY; + w = 0.0656768 * safezoneW; + h = 0.028 * safezoneH; + colorBackground[] = {0,0,0,0.5}; + }; + class TextListTitle: RscText { + idc = ID_TEXT_LISTTITLE; + x = 0.624786 * safezoneW + safezoneX; + y = 0.318 * safezoneH + safezoneY; + w = 0.203437 * safezoneW; + h = 0.028 * safezoneH; + colorBackground[] = {0,0,0,0.5}; + }; + class ListLoadouts: RscListBox { + idc = ID_LIST_LOADOUTS; + x = 0.624786 * safezoneW + safezoneX; + y = 0.346 * safezoneH + safezoneY; + w = 0.203437 * safezoneW; + h = 0.294 * safezoneH; + }; + class EditLoadoutName: RscEdit { + idc = ID_EDIT_LOADOUTNAME; + x = 0.624786 * safezoneW + safezoneX; + y = 0.64 * safezoneH + safezoneY; + w = 0.203437 * safezoneW; + h = 0.028 * safezoneH; + colorBackground[] = {0,0,0,0.7}; + }; + class ButtonSave: RscButtonMenu { + idc = ID_BUTTON_SAVE; + action = QUOTE(call FUNC(onButtonSave)); + text = "$STR_disp_int_save"; + x = 0.624786 * safezoneW + safezoneX; + y = 0.682 * safezoneH + safezoneY; + w = 0.0590625 * safezoneW; + h = 0.028 * safezoneH; + }; + class ButtonLoad: RscButtonMenu { + idc = ID_BUTTON_LOAD; + action = QUOTE(call FUNC(onButtonLoad)); + text = "$STR_disp_int_load"; + x = 0.69703 * safezoneW + safezoneX; + y = 0.682 * safezoneH + safezoneY; + w = 0.0590625 * safezoneW; + h = 0.028 * safezoneH; + }; + class ButtonDelete: RscButtonMenu { + idc = ID_BUTTON_DELETE; + action = QUOTE(call FUNC(onButtonDelete)); + text = "$STR_disp_delete"; + x = 0.769275 * safezoneW + safezoneX; + y = 0.682 * safezoneH + safezoneY; + w = 0.0590625 * safezoneW; + h = 0.028 * safezoneH; + }; + class ButtonApply: RscButtonMenu { + idc = ID_BUTTON_APPLY; + action = QUOTE(call FUNC(onButtonApply)); + text = "$STR_ui_debug_but_apply"; + x = 0.683895 * safezoneW + safezoneX; + y = 0.738 * safezoneH + safezoneY; + w = 0.0721875 * safezoneW; + h = 0.028 * safezoneH; + }; + class ButtonClose: RscButtonMenu { + idc = ID_BUTTON_CLOSE; + text = "$STR_disp_cancel"; + action = QUOTE(call FUNC(onButtonClose)); + x = 0.769275 * safezoneW + safezoneX; + y = 0.738 * safezoneH + safezoneY; + w = 0.0721875 * safezoneW; + h = 0.028 * safezoneH; + }; + class TextBanner: RscText { + idc = ID_TEXT_BANNER; + text = CSTRING(BannerText); + x = 0.171616 * safezoneW + safezoneX; + y = 0.738 * safezoneH + safezoneY; + w = 0.440035 * safezoneW; + h = 0.028 * safezoneH; + colorBackground[] = {0.5,0,0,0.5}; + }; + }; +}; diff --git a/addons/pylons/script_component.hpp b/addons/pylons/script_component.hpp new file mode 100644 index 0000000000..fd511edc06 --- /dev/null +++ b/addons/pylons/script_component.hpp @@ -0,0 +1,37 @@ +#define COMPONENT pylons +#define COMPONENT_BEAUTIFIED Pylons +#include "\z\ace\addons\main\script_mod.hpp" + +// #define DEBUG_MODE_FULL +// #define DISABLE_COMPILE_CACHE +// #define ENABLE_PERFORMANCE_COUNTERS + +#ifdef DEBUG_ENABLED_PYLONS + #define DEBUG_MODE_FULL +#endif + +#ifdef DEBUG_SETTINGS_PYLONS + #define DEBUG_SETTINGS DEBUG_SETTINGS_PYLONS +#endif + +#include "\z\ace\addons\main\script_macros.hpp" + + +#define ID_DIALOG 654654 +#define ID_TEXT_TITLEBAR 100 +#define ID_BACKGROUND_DIALOG 110 +#define ID_BACKGROUND_PICTURE 111 +#define ID_PICTURE_AIRCRAFT 120 +#define ID_CHECKBOX_MIRROR 130 +#define ID_TEXT_MIRROR 140 +#define ID_CHECKBOX_FRIES 141 +#define ID_TEXT_FRIES 142 +#define ID_TEXT_LISTTITLE 150 +#define ID_LIST_LOADOUTS 160 +#define ID_EDIT_LOADOUTNAME 170 +#define ID_BUTTON_SAVE 180 +#define ID_BUTTON_LOAD 190 +#define ID_BUTTON_DELETE 200 +#define ID_BUTTON_APPLY 210 +#define ID_BUTTON_CLOSE 211 +#define ID_TEXT_BANNER 220 diff --git a/addons/pylons/stringtable.xml b/addons/pylons/stringtable.xml new file mode 100644 index 0000000000..241b358b04 --- /dev/null +++ b/addons/pylons/stringtable.xml @@ -0,0 +1,155 @@ + + + + + AIRCRAFT LOADOUT + 航空機の兵装 + LOADOUT AEREO + 飛機武裝配置 + 飞机武装配置 + + + Loadouts for %1 + %1の兵装 + Loadouts per %1 + %1用的武裝配置 + %1用的武装配置 + + + Configure Pylons + パイロン設定 + Configura Piloni + 定義派龍架 + 定义派龙架 + + + Pylons + パイロン + Piloni + 派龍架 + 派龙架 + + + <empty> + <空> + <vuoto> + <空> + <空> + + + Pylons that are colored red will have to be manually rearmed. + 赤色に設定されたパイロンは手動で再武装する必要があります。 + I Piloni di colore rosso devono essere riarmati manualmente. + 以紅色標記出的派龍架必須以手動方式進行彈藥整補。 + 以红色标记出的派龙架必须以手动方式进行弹药整补。 + + + %1 is already configuring this aircraft! + %1はすでにこの機体へ設定されています! + % sta già configurando questo aereo! + %1已經正在定義此飛機的武裝配置! + %1已经正在定义此飞机的武装配置! + + + Replacing pylon %1 out of %2... + パイロン%1を作業し残り%2・・・ + Sostituendo pilone %1 al posto di %2... + 共有%2個派龍架,正在整補%1號派龍架中... + 共有%2个派龙架,正在整补%1号派龙架中... + + + Stopped at pylon %1! + パイロン%1で停止しました! + Fermato al pilone %1! + 已停止在%1號派龍架! + 已停止在%1号派龙架! + + + Vehicle too far + + + Enable Pylons Menu + パイロン メニューを有効化 + Abilita Menu Piloni + 啟用派龍架選單 + 启用派龙架选单 + + + Enable pylon configuration menu for aircraft. + 航空機へのパイロン設定メニューを有効化します。 + Abilita il menù di configurazione piloni per aereo. + 啟用後可透過派龍架選單來定義飛機的武裝配置。 + 启用后可透过派龙架选单来定义飞机的武装配置。 + + + Rearm New Pylons + 新規パイロンの再武装 + Riarma Nuovi Piloni + 重新武裝新的派龍架 + 重新武装新的派龙架 + + + Automatically rearm new pylons from the nearest rearm vehicle. + 近くの補給車両から自動的に新規パイロンを再武装します。 + Riarma automaticamente i nuovi piloni dal veicoli di riarmo più vicino. + 自動從附近的整補載具中為派龍架進行彈藥整補。 + 自动从附近的整补载具中为派龙架进行弹药整补。 + + + Time Per Pylon + パイロンへの時間 + Tempo Per Pilone + 派龍架整補所需時間(個別) + 派龙架整补所需时间(个别) + + + The time it takes to replace each pylon (in seconds). + 各パイロンの置き換えにかかる時間を設定します。(秒) + Il tempo che impiega ogni pilone ad essere sostituito (in secondi). + 每個派龍架需花多久時間進行整補(單位為秒)。 + 每个派龙架需花多久时间进行整补(单位为秒)。 + + + Search Distance + 検索距離 + Distanza di Ricerca + 搜索距離 + 搜索距离 + + + The distance an aircraft needs to be from a rearm vehicle. + 補給車両から航空機までの必要な距離。 + La distanza necessaria per un aereo da un veicolo di riarmo. + 設定飛機必須距離整補載具多少公尺才能進行彈藥整補。 + 设定飞机必须距离整补载具多少公尺才能进行弹药整补。 + + + Require Engineer + 工兵の必須化 + Necessita Ingegnere + 需要工兵 + 需要工兵 + + + Require an engineer. + 工兵を必須とします。 + Necessita un ingegnere. + 需要工兵才能進行彈藥整補。 + 需要工兵才能进行弹药整补。 + + + Require Toolkit + ツールキットの必須化 + Necessita Kit Riparazione + 需要工具包 + 需要工具包 + + + Require a toolkit in inventory. + インベントリ内にツールキットの存在を必須とします。 + Necessita un kit di riparazione nell'inventario + 需要工具包才能進行彈藥整補。 + 需要工具包才能进行弹药整补。 + + + diff --git a/addons/quickmount/$PBOPREFIX$ b/addons/quickmount/$PBOPREFIX$ new file mode 100644 index 0000000000..2251bc0b6e --- /dev/null +++ b/addons/quickmount/$PBOPREFIX$ @@ -0,0 +1 @@ +z\ace\addons\quickmount diff --git a/addons/quickmount/ACE_Settings.hpp b/addons/quickmount/ACE_Settings.hpp new file mode 100644 index 0000000000..b4e07be4b4 --- /dev/null +++ b/addons/quickmount/ACE_Settings.hpp @@ -0,0 +1,41 @@ +class ACE_Settings { + class GVAR(enabled) { + value = 0; + typeName = "BOOL"; + category = CSTRING(Category); + displayName = ECSTRING(common,Enabled); + description = CSTRING(KeybindDescription); + isClientSettable = 1; + force = 0; + }; + class GVAR(distance) { + value = DEFAULT_DISTANCE; + typeName = "SCALAR"; + category = CSTRING(Category); + displayName = CSTRING(Distance); + description = CSTRING(DistanceDescription); + isClientSettable = 0; + force = 0; + values[] = {"0m", "1m", "2m", "3m", "4m", "5m", "6m", "7m", "8m", "9m", "10m"}; + }; + class GVAR(speed) { + value = DEFAULT_SPEED; + typeName = "SCALAR"; + category = CSTRING(Category); + displayName = CSTRING(Speed); + description = CSTRING(SpeedDescription); + isClientSettable = 0; + force = 0; + values[] = {"0","1","2","3","4","5","6","7","8","9","10","11","12","13","14","15","16","17","18","19","20","21","22","23","24","25","26","27","28","29","30"}; + }; + class GVAR(priority) { + value = DEFAULT_PRIORITY; + typeName = "SCALAR"; + category = CSTRING(Category); + displayName = CSTRING(Priority); + description = CSTRING(PriorityDescription); + isClientSettable = 1; + force = 0; + values[] = {"$str_getin_pos_driver", "$str_getin_pos_gunn", "$str_getin_pos_comm", "$STR_GETIN_POS_PASSENGER"}; + }; +}; diff --git a/addons/quickmount/CfgEventHandlers.hpp b/addons/quickmount/CfgEventHandlers.hpp new file mode 100644 index 0000000000..9426fa861e --- /dev/null +++ b/addons/quickmount/CfgEventHandlers.hpp @@ -0,0 +1,17 @@ +class Extended_PreStart_EventHandlers { + class ADDON { + init = QUOTE(call COMPILE_FILE(XEH_preStart)); + }; +}; + +class Extended_PreInit_EventHandlers { + class ADDON { + init = QUOTE(call COMPILE_FILE(XEH_preInit)); + }; +}; + +class Extended_PostInit_EventHandlers { + class ADDON { + clientInit = QUOTE(call COMPILE_FILE(XEH_postInitClient)); + }; +}; diff --git a/addons/quickmount/CfgVehicles.hpp b/addons/quickmount/CfgVehicles.hpp new file mode 100644 index 0000000000..0d141d7bc3 --- /dev/null +++ b/addons/quickmount/CfgVehicles.hpp @@ -0,0 +1,37 @@ +class CfgVehicles { + class ACE_Module; + class GVAR(module): ACE_Module { + author = ECSTRING(common,ACETeam); + category = "ACE"; + displayName = CSTRING(Category); + function = QFUNC(moduleInit); + scope = 2; + isGlobal = 1; + isTriggerActivated = 0; + isDisposable = 0; + icon = "a3\ui_f\data\IGUI\Cfg\Actions\Obsolete\ui_action_getin_ca.paa"; + class Arguments { + class enabled { + displayName = ECSTRING(common,Enabled); + description = CSTRING(KeybindDescription); + typeName = "BOOL"; + defaultValue = 1; + }; + class distance { + displayName = CSTRING(Distance); + description = CSTRING(DistanceDescription); + typeName = "NUMBER"; + defaultValue = DEFAULT_DISTANCE; + }; + class speed { + displayName = CSTRING(Speed); + description = CSTRING(SpeedDescription); + typeName = "NUMBER"; + defaultValue = DEFAULT_SPEED; + }; + }; + class ModuleDescription { + description = CSTRING(KeybindDescription); + }; + }; +}; diff --git a/addons/quickmount/README.md b/addons/quickmount/README.md new file mode 100644 index 0000000000..6e11fc8ae4 --- /dev/null +++ b/addons/quickmount/README.md @@ -0,0 +1,9 @@ +ace_quickmount +============ +Adds a keybind to quickly enter the vehicle you are directly looking at. + +## Maintainers + +The people responsible for merging changes to this component or answering potential questions. + +- [Kingsley](https://github.com/jameslkingsley) diff --git a/addons/quickmount/XEH_PREP.hpp b/addons/quickmount/XEH_PREP.hpp new file mode 100644 index 0000000000..eba2f68296 --- /dev/null +++ b/addons/quickmount/XEH_PREP.hpp @@ -0,0 +1,2 @@ +PREP(getInNearest); +PREP(moduleInit); diff --git a/addons/quickmount/XEH_postInitClient.sqf b/addons/quickmount/XEH_postInitClient.sqf new file mode 100644 index 0000000000..718c08b843 --- /dev/null +++ b/addons/quickmount/XEH_postInitClient.sqf @@ -0,0 +1,10 @@ +#include "script_component.hpp" + +if (!hasInterface) exitWith {}; + +["ACE3 Movement", QGVAR(mount), [localize LSTRING(KeybindName), localize LSTRING(KeybindDescription)], "", { + if (!dialog) then { + call FUNC(getInNearest); + }; + false +}] call CBA_fnc_addKeybind; diff --git a/addons/quickmount/XEH_preInit.sqf b/addons/quickmount/XEH_preInit.sqf new file mode 100644 index 0000000000..b47cf6628d --- /dev/null +++ b/addons/quickmount/XEH_preInit.sqf @@ -0,0 +1,9 @@ +#include "script_component.hpp" + +ADDON = false; + +PREP_RECOMPILE_START; +#include "XEH_PREP.hpp" +PREP_RECOMPILE_END; + +ADDON = true; diff --git a/addons/quickmount/XEH_preStart.sqf b/addons/quickmount/XEH_preStart.sqf new file mode 100644 index 0000000000..022888575e --- /dev/null +++ b/addons/quickmount/XEH_preStart.sqf @@ -0,0 +1,3 @@ +#include "script_component.hpp" + +#include "XEH_PREP.hpp" diff --git a/addons/quickmount/config.cpp b/addons/quickmount/config.cpp new file mode 100644 index 0000000000..063897aebc --- /dev/null +++ b/addons/quickmount/config.cpp @@ -0,0 +1,18 @@ +#include "script_component.hpp" + +class CfgPatches { + class ADDON { + units[] = {}; + weapons[] = {}; + requiredVersion = REQUIRED_VERSION; + requiredAddons[] = {"ace_common"}; + author = ECSTRING(common,ACETeam); + authors[] = {"Kingsley"}; + url = ECSTRING(main,URL); + VERSION_CONFIG; + }; +}; + +#include "CfgEventHandlers.hpp" +#include "ACE_Settings.hpp" +#include "CfgVehicles.hpp" diff --git a/addons/quickmount/functions/fnc_getInNearest.sqf b/addons/quickmount/functions/fnc_getInNearest.sqf new file mode 100644 index 0000000000..5215f6a33b --- /dev/null +++ b/addons/quickmount/functions/fnc_getInNearest.sqf @@ -0,0 +1,110 @@ +/* + * Author: Kingsley + * Mount the player in the vehicle they are directly looking at based on their distance. + * + * Arguments: + * None + * + * Return Value: + * None + * + * Example: + * [] call ace_quickmount_fnc_getInNearest; + * + * Public: No + */ +#include "script_component.hpp" + +if (!GVAR(enabled) || + {isNull ACE_player} || + {vehicle ACE_player != ACE_player} || + {!alive ACE_player} || + {ACE_player getVariable ["ace_unconscious", false]} +) exitWith {}; + +private _start = AGLtoASL (ACE_player modelToWorldVisual (ACE_player selectionPosition "pilot")); +private _end = (_start vectorAdd (getCameraViewDirection ACE_player vectorMultiply GVAR(distance))); +private _objects = lineIntersectsSurfaces [_start, _end, ACE_player]; +private _target = (_objects param [0, []]) param [2, objNull]; + +if (locked _target in [2,3]) exitWith { + [localize LSTRING(VehicleLocked)] call EFUNC(common,displayTextStructured); + true +}; + +TRACE_1("",_target); + +if (!isNull _target && + {alive _target} && + {{_target isKindOf _x} count ["Air","LandVehicle","Ship","StaticMortar"] > 0} && + {([ACE_player, _target] call EFUNC(common,canInteractWith))} && + {speed _target <= GVAR(speed)} + ) then { + + + if (GVAR(priority) > 3 || GVAR(priority) < 0) then { + GVAR(priority) = 0; + }; + + private _seats = ["Driver", "Gunner", "Commander", "Cargo"]; + private _sortedSeats = [_seats select GVAR(priority)]; + _seats deleteAt GVAR(priority); + _sortedSeats append _seats; + + + private _hasAction = false; + scopeName "SearchForSeat"; + { + private _desiredRole = _x; + { + _x params ["_unit", "_role", "_cargoIndex", "_turretPath"]; + if ((isNull _unit) || {!alive _unit}) then { + private _effectiveRole = toLower _role; + + if ((_effectiveRole in ["driver", "gunner"]) && {unitIsUAV _target}) exitWith {}; // Ignoring UAV Driver/Gunner + if ((_effectiveRole == "driver") && {(getNumber (([_target] call CBA_fnc_getObjectConfig) >> "hasDriver")) == 0}) exitWith {}; // Ignoring Non Driver (static weapons) + + // Seats can be locked independently of the main vehicle + if ((_role == "driver") && {lockedDriver _target}) exitWith {TRACE_1("lockedDriver",_x);}; + if ((_cargoIndex >= 0) && {_target lockedCargo _cargoIndex}) exitWith {TRACE_1("lockedCargo",_x);}; + if ((!(_turretPath isEqualTo [])) && {_target lockedTurret _turretPath}) exitWith {TRACE_1("lockedTurret",_x);}; + + if (_effectiveRole == "turret") then { + if ((getNumber (([_target, _turretPath] call CBA_fnc_getTurret) >> "isCopilot")) == 1) exitWith { + _effectiveRole = "driver"; + }; + if (_cargoIndex < 0) exitWith { + _effectiveRole = "gunner"; // door gunners / 2nd turret + }; + _effectiveRole = "cargo"; // probably a FFV + }; + TRACE_2("",_effectiveRole,_x); + if (_effectiveRole != _desiredRole) exitWith {}; + + if (!(_turretPath isEqualTo [])) then { + // Using GetInTurret seems to solve problems with incorrect GetInEH params when gunner/commander + ACE_player action ["GetInTurret", _target, _turretPath]; + TRACE_3("Geting In Turret",_x,_role,_turretPath); + } else { + if (_cargoIndex > -1) then { + ACE_player action ["GetInCargo", _target, _cargoIndex]; + TRACE_3("Geting In Cargo",_x,_role,_cargoIndex); + } else { + ACE_player action ["GetIn" + _role, _target]; + TRACE_2("Geting In",_x,_role); + }; + }; + + _hasAction = true; + breakTo "SearchForSeat"; + }; + } forEach (fullCrew [_target, "", true]); + } forEach _sortedSeats; + + if (!_hasAction) then { + TRACE_1("no empty seats",_hasAction); + [localize LSTRING(VehicleFull)] call EFUNC(common,displayTextStructured); + }; +}; + +true diff --git a/addons/quickmount/functions/fnc_moduleInit.sqf b/addons/quickmount/functions/fnc_moduleInit.sqf new file mode 100644 index 0000000000..92df787737 --- /dev/null +++ b/addons/quickmount/functions/fnc_moduleInit.sqf @@ -0,0 +1,25 @@ +/* + * Author: Kingsley + * Initializes the quick-mount module. + * + * Arguments: + * 0: The module logic + * 1: Units (Unused) + * 2: Activated + * + * Return Value: + * None + * + * Public: No + */ +#include "script_component.hpp" + +if (!isServer) exitWith {}; + +params ["_logic", "", "_activated"]; + +if (!_activated) exitWith {}; + +[_logic, QGVAR(enabled), "enabled"] call EFUNC(common,readSettingFromModule); +[_logic, QGVAR(distance), "distance"] call EFUNC(common,readSettingFromModule); +[_logic, QGVAR(speed), "speed"] call EFUNC(common,readSettingFromModule); diff --git a/addons/quickmount/functions/script_component.hpp b/addons/quickmount/functions/script_component.hpp new file mode 100644 index 0000000000..a91c3e1665 --- /dev/null +++ b/addons/quickmount/functions/script_component.hpp @@ -0,0 +1 @@ +#include "\z\ace\addons\quickmount\script_component.hpp" diff --git a/addons/quickmount/script_component.hpp b/addons/quickmount/script_component.hpp new file mode 100644 index 0000000000..a0ec1debd0 --- /dev/null +++ b/addons/quickmount/script_component.hpp @@ -0,0 +1,21 @@ +#define COMPONENT quickmount +#define COMPONENT_BEAUTIFIED Quick Mount +#include "\z\ace\addons\main\script_mod.hpp" + +// #define DEBUG_MODE_FULL +// #define DISABLE_COMPILE_CACHE +// #define ENABLE_PERFORMANCE_COUNTERS + +#ifdef DEBUG_ENABLED_QUICKMOUNT + #define DEBUG_MODE_FULL +#endif + +#ifdef DEBUG_SETTINGS_QUICKMOUNT + #define DEBUG_SETTINGS DEBUG_SETTINGS_QUICKMOUNT +#endif + +#include "\z\ace\addons\main\script_macros.hpp" + +#define DEFAULT_DISTANCE 3 +#define DEFAULT_SPEED 18 +#define DEFAULT_PRIORITY 0 diff --git a/addons/quickmount/stringtable.xml b/addons/quickmount/stringtable.xml new file mode 100644 index 0000000000..ce9bb9465f --- /dev/null +++ b/addons/quickmount/stringtable.xml @@ -0,0 +1,104 @@ + + + + + Quick Mount + Schnellzugang + Entrata Rapida + クイック マウント + 快速搭乘 + 快速搭乘 + Szybkie wsiadanie + + + Vehicle quick mount + Fahrzeug-Schnellzugang + Szybkie wsiadanie do pojazdu + Entrata rapida veicolo + 車両クイック マウント + 快速搭乘载具 + 快速搭乘載具 + + + Quickly enter the vehicle you are directly looking at. + Schnellzugang in das Fahrzeug, welches man direkt anschaut. + Entra velocemente nel veicolo che stai guardando. + 直接見ている車両へ迅速に搭乗します。 + 快速进入你正在看的载具之中 + 快速進入你正在看的載具之中 + Szybko wsiądź do pojazdu, na który patrzysz. + + + Vehicle Full + Fahrzeug voll + Veicolo Pieno + 車両は満員 + 载具已满 + 載具已滿 + Pojazd pełny + + + Distance + Entfernung + Distanza + 距離 + 距离 + 距離 + Odległość + + + Maximum distance to check for vehicles. + Maximale Entfernung zu Fahrzeugen + Distanza massima per controllare i veicoli. + 車両を確認できる最大距離 + 最大可检查载具的距离. + 最大可檢查載具的距離. + Maksymalna odległość do pojazdu. + + + Vehicle Locked + Fahrzeug abgeschlossen + Veicolo Bloccato. + 車両は施錠されている + 载具已上锁 + 載具已上鎖 + Pojazd zablokowany + + + Maximum Speed (km/h) + Maximale Geschwindigkeit (km/h) + Velocità Massima (km/h) + 最高速度 (km/h) + 最高速度 (公里/小时) + 最高速度 (公里/小時) + Maksymalna prędkość (km/h) + + + Maximum vehicle speed (km/h) allowed for player entry + Maximale Geschwindigkeit (km/h) für Schnellzugang + Velocità massima del veicolo (km/h) consentita per far salire un giocatore + プレイヤーが搭乗できる限界速度 (km/h) + 设置玩家能在最高多少的速度之下进入载具。 + 設置玩家能在最高多少的速度之下進入載具。 + Maksymalna prędkość pojazdu (km/h) pozwalająca graczowi wsiąść. + + + Prioritize Seat + Priorisierter Sitzplatz + Priorità Sedile + 優先席 + 优先座位 + 優先座位 + Priorytet zajmowanych pozycji + + + Seat priority on entry + Priorisierter Sitzplatz zum Schnellzugang + Priorità del sedile in entrata + 搭乗の際の優先順位 + 优先想进入哪个座位。 + 優先想進入哪個座位。 + Priorytet pozycji w pojeździe + + + diff --git a/addons/rangecard/CfgVehicles.hpp b/addons/rangecard/CfgVehicles.hpp index e7df701409..7abc8d979b 100644 --- a/addons/rangecard/CfgVehicles.hpp +++ b/addons/rangecard/CfgVehicles.hpp @@ -34,7 +34,7 @@ class CfgVehicles { class GVAR(makeCopy) { displayName = CSTRING(CopyRangeCard); condition = QUOTE(call FUNC(canShow) && !GVAR(RangeCardOpened)); - statement = QUOTE(GVAR(ammoClassCopy) = GVAR(ammoClass); GVAR(magazineClassCopy) = GVAR(magazineClass); GVAR(weaponClassCopy) = GVAR(ammoClass);); + statement = QUOTE(GVAR(zeroRangeCopy)=GVAR(zeroRange); GVAR(boreHeightCopy)=GVAR(boreHeight); GVAR(ammoClassCopy)=GVAR(ammoClass); GVAR(magazineClassCopy)=GVAR(magazineClass); GVAR(weaponClassCopy)=GVAR(weaponClass);); showDisabled = 0; priority = 0.1; icon = QPATHTOF(UI\RangeCard_Icon.paa); diff --git a/addons/rangecard/CfgWeapons.hpp b/addons/rangecard/CfgWeapons.hpp index dfc643fa47..0ad18f83e1 100644 --- a/addons/rangecard/CfgWeapons.hpp +++ b/addons/rangecard/CfgWeapons.hpp @@ -1,7 +1,7 @@ class CfgWeapons { class ACE_ItemCore; - class InventoryItem_Base_F; + class CBA_MiscItem_ItemInfo; class ACE_RangeCard: ACE_ItemCore { author[] = {"Ruthberg"}; @@ -12,7 +12,7 @@ class CfgWeapons { icon = "iconObject_circle"; mapSize = 0.034; - class ItemInfo: InventoryItem_Base_F { + class ItemInfo: CBA_MiscItem_ItemInfo { mass = 1; }; }; diff --git a/addons/rangecard/XEH_PREP.hpp b/addons/rangecard/XEH_PREP.hpp index 6b13dcc45a..abbeaa2803 100644 --- a/addons/rangecard/XEH_PREP.hpp +++ b/addons/rangecard/XEH_PREP.hpp @@ -1,5 +1,5 @@ -PREP(calculateSolution); +PREP(calculateRangeCard); PREP(canCopy); PREP(canShow); PREP(canShowCopy); diff --git a/addons/rangecard/XEH_postInit.sqf b/addons/rangecard/XEH_postInit.sqf index 8396d76b39..9e60821fc1 100644 --- a/addons/rangecard/XEH_postInit.sqf +++ b/addons/rangecard/XEH_postInit.sqf @@ -6,10 +6,14 @@ GVAR(RangeCardOpened) = false; GVAR(controls) = []; +GVAR(zeroRange) = 100; +GVAR(boreHeight) = 3.81; GVAR(ammoClass) = "B_65x39_Caseless"; GVAR(magazineClass) = "30Rnd_65x39_caseless_mag"; GVAR(weaponClass) = "arifle_MXM_F"; +GVAR(zeroRangeCopy) = 100; +GVAR(boreHeightCopy) = 3.81; GVAR(ammoClassCopy) = "";//"ACE_762x51_Ball_M118LR"; GVAR(magazineClassCopy) = "";//"ACE_20Rnd_762x51_M118LR_Mag"; GVAR(weaponClassCopy) = "";//srifle_DMR_06_olive_F"; diff --git a/addons/rangecard/XEH_preInit.sqf b/addons/rangecard/XEH_preInit.sqf index a7feade1c3..b47cf6628d 100644 --- a/addons/rangecard/XEH_preInit.sqf +++ b/addons/rangecard/XEH_preInit.sqf @@ -2,6 +2,8 @@ ADDON = false; +PREP_RECOMPILE_START; #include "XEH_PREP.hpp" +PREP_RECOMPILE_END; ADDON = true; diff --git a/addons/rangecard/config.cpp b/addons/rangecard/config.cpp index 9017583606..f300fb1a30 100644 --- a/addons/rangecard/config.cpp +++ b/addons/rangecard/config.cpp @@ -6,7 +6,7 @@ class CfgPatches { units[] = {"ACE_Item_RangeCard"}; weapons[] = {"ACE_RangeCard"}; requiredVersion = REQUIRED_VERSION; - requiredAddons[] = {"ACE_Advanced_Ballistics"}; + requiredAddons[] = {"ACE_Advanced_Ballistics","ace_scopes"}; author = ECSTRING(common,ACETeam); authors[] = {"Ruthberg"}; url = ECSTRING(main,URL); diff --git a/addons/rangecard/functions/fnc_calculateRangeCard.sqf b/addons/rangecard/functions/fnc_calculateRangeCard.sqf new file mode 100644 index 0000000000..694d234caf --- /dev/null +++ b/addons/rangecard/functions/fnc_calculateRangeCard.sqf @@ -0,0 +1,148 @@ +/* + * Author: Ruthberg + * Calculates the range card data + * + * Arguments: + * 0: Scope base angle + * 1: Bore height + * 2: air friction + * 3: muzzle velocity + * 4: temperature + * 5: barometric pressure + * 6: relative humidity + * 7: simulation steps + * 8: wind speed + * 9: target speed + * 10: target range + * 11: ballistic coefficient + * 12: drag model + * 13: atmosphere model + * 14: transonicStabilityCoef + * 15: Range Card Slot + * 16: Use advanced ballistics config? + * + * Return Value: + * None + * + * Example: + * [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13 ,14, 15, 16, true] call ace_rangecard_fnc_calculateRangeCard + * + * Public: No + */ +#include "script_component.hpp" +params [ + "_scopeBaseAngle", "_boreHeight", "_airFriction", "_muzzleVelocity", + "_temperature", "_barometricPressure", "_relativeHumidity", "_simSteps", + "_windSpeed", "_targetSpeed", "_targetRange", "_bc", "_dragModel", "_atmosphereModel", + "_transonicStabilityCoef", "_rangeCardSlot", "_useABConfig" +]; + +GVAR(rangeCardDataMVs) set [_rangeCardSlot, format[" %1", round(_muzzleVelocity)]]; + +private _tx = 0; +private _tz = 0; +private _lastBulletPos = [0, 0, 0]; +private _bulletPos = [0, 0, 0]; +private _bulletVelocity = [0, 0, 0]; +private _bulletAccel = [0, 0, 0]; +private _bulletSpeed = 0; +private _gravity = [0, sin(_scopeBaseAngle) * -9.80665, cos(_scopeBaseAngle) * -9.80665]; +private _deltaT = 1 / _simSteps; +private _speedOfSound = 0; +if (missionNamespace getVariable [QEGVAR(advanced_ballistics,enabled), false]) then { + _speedOfSound = _temperature call EFUNC(weather,calculateSpeedOfSound); +}; + +private _elevation = 0; +private _windage = 0; +private _lead = 0; +private _TOF = 0; +private _trueVelocity = [0, 0, 0]; +private _trueSpeed = 0; + +private _n = 0; +private _range = 0; + +if (_useABConfig) then { + _bc = parseNumber(("ace_advanced_ballistics" callExtension format["atmosphericCorrection:%1:%2:%3:%4:%5", _bc, _temperature, _barometricPressure, _relativeHumidity, _atmosphereModel])); +}; + +private _airFrictionCoef = 1; +if (!_useABConfig && (missionNamespace getVariable [QEGVAR(advanced_ballistics,enabled), false])) then { + private _airDensity = [_temperature, _barometricPressure, _relativeHumidity] call EFUNC(weather,calculateAirDensity); + _airFrictionCoef = _airDensity / 1.22498; +}; + +private _speedTotal = 0; +private _stepsTotal = 0; +private _speedAverage = 0; + +_bulletPos set [0, 0]; +_bulletPos set [1, 0]; +_bulletPos set [2, -(_boreHeight / 100)]; + +_bulletVelocity set [0, 0]; +_bulletVelocity set [1, Cos(_scopeBaseAngle) * _muzzleVelocity]; +_bulletVelocity set [2, Sin(_scopeBaseAngle) * _muzzleVelocity]; + +while {_TOF < 6 && (_bulletPos select 1) < _targetRange} do { + _bulletSpeed = vectorMagnitude _bulletVelocity; + + _speedTotal = _speedTotal + _bulletSpeed; + _stepsTotal = _stepsTotal + 1; + _speedAverage = (_speedTotal / _stepsTotal); + + if (_transonicStabilityCoef < 1.0 && _speedAverage > 450 && _bulletSpeed < _speedOfSound) exitWith {}; + + _trueVelocity = _bulletVelocity vectorDiff [-_windSpeed, 0, 0]; + _trueSpeed = vectorMagnitude _trueVelocity; + + if (_useABConfig) then { + private _drag = parseNumber(("ace_advanced_ballistics" callExtension format["retard:%1:%2:%3:%4", _dragModel, _bc, _trueSpeed, _temperature])); + _bulletAccel = (vectorNormalized _trueVelocity) vectorMultiply (-1 * _drag); + } else { + _bulletAccel = _trueVelocity vectorMultiply (_trueSpeed * _airFriction * _airFrictionCoef); + }; + + _bulletAccel = _bulletAccel vectorAdd _gravity; + + _lastBulletPos = _bulletPos; + _bulletPos = _bulletPos vectorAdd (_bulletVelocity vectorMultiply (_deltaT * 0.5)); + _bulletVelocity = _bulletVelocity vectorAdd (_bulletAccel vectorMultiply _deltaT); + _bulletPos = _bulletPos vectorAdd (_bulletVelocity vectorMultiply (_deltaT * 0.5)); + + if (atan((_bulletPos select 2) / (abs(_bulletPos select 1) + 1)) < -2.254) exitWith {}; + + _TOF = _TOF + _deltaT; + + _range = GVAR(rangeCardStartRange) + _n * GVAR(rangeCardIncrement); + if ((_bulletPos select 1) >= _range && _range <= GVAR(rangeCardEndRange)) then { + if (_range != 0) then { + _tx = (_lastBulletPos select 0) + (_range - (_lastBulletPos select 1)) * ((_bulletPos select 0) - (_lastBulletPos select 0)) / ((_bulletPos select 1) - (_lastBulletPos select 1)); + _tz = (_lastBulletPos select 2) + (_range - (_lastBulletPos select 1)) * ((_bulletPos select 2) - (_lastBulletPos select 2)) / ((_bulletPos select 1) - (_lastBulletPos select 1)); + _elevation = - atan(_tz / _range); + _windage = - atan(_tx / _range); + _lead = (_targetSpeed * _TOF) / (Tan(MRAD_TO_DEG(1)) * _range); + }; + + private _elevationString = Str(round(-DEG_TO_MRAD(_elevation) * 10) / 10); + if (_elevationString == "0") then { + _elevationString = "-0.0"; + }; + if (_elevationString find "." == -1) then { + _elevationString = _elevationString + ".0"; + }; + private _windageString = Str(round(DEG_TO_MRAD(_windage) * 10) / 10); + if (_windageString find "." == -1) then { + _windageString = _windageString + ".0"; + }; + private _leadString = Str(round(_lead * 10) / 10); + if (_leadString find "." == -1) then { + _leadString = _leadString + ".0"; + }; + (GVAR(rangeCardDataElevation) select _rangeCardSlot) set [_n, _elevationString]; + (GVAR(rangeCardDataWindage) select _rangeCardSlot) set [_n, _windageString]; + (GVAR(rangeCardDataLead) select _rangeCardSlot) set [_n, _leadString]; + _n = _n + 1; + }; +}; diff --git a/addons/rangecard/functions/fnc_calculateSolution.sqf b/addons/rangecard/functions/fnc_calculateSolution.sqf deleted file mode 100644 index 945c2aa512..0000000000 --- a/addons/rangecard/functions/fnc_calculateSolution.sqf +++ /dev/null @@ -1,199 +0,0 @@ -/* - * Author: Ruthberg - * Calculates the range card data - * - * Arguments: - * 0: Scope base angle - * 1: Bullet mass - * 2: Bore height - * 3: air friction - * 4: muzzle velocity - * 5: temperature - * 6: barometric pressure - * 7: relative humidity - * 8: simulation steps - * 9: wind speed - * 10: wind direction - * 11: inclination angle - * 12: target speed - * 13: target range - * 14: ballistic coefficient - * 15: drag model - * 16: atmosphere model - * 17: Store range card data? - * 18: Stability factor - * 19: Twist Direction - * 20: Latitude - * 21: Direction of Fire - * 22: Range Card Slot - * 23: Use advanced ballistics config? - * - * Return Value: - * 0: Elevation (MOA) - * 1: Windage (MOA) - * 2: Lead (MOA) - * 3: Time of fligth (SECONDS) - * 4: Remaining velocity (m/s) - * 5: Remaining kinetic energy (ft·lb) - * 6: Vertical coriolis drift (MOA) - * 7: Horizontal coriolis drift (MOA) - * 8: Spin drift (MOA) - * - * Example: - * call ace_rangecard_fnc_calculateSolution - * - * Public: No - */ -#include "script_component.hpp" -params [ - "_scopeBaseAngle", "_bulletMass", "_boreHeight", "_airFriction", "_muzzleVelocity", - "_temperature", "_barometricPressure", "_relativeHumidity", "_simSteps", "_windSpeed", - "_windDirection", "_inclinationAngle", "_targetSpeed", "_targetRange", "_bc", "_dragModel", - "_atmosphereModel", "_storeRangeCardData", "_stabilityFactor", "_twistDirection", "_latitude", - "_directionOfFire", "_rangeCardSlot", "_useABConfig" -]; -_windSpeed params ["_windSpeed1", "_windSpeed2"]; - -if (_storeRangeCardData) then { - GVAR(rangeCardDataMVs) set [_rangeCardSlot, format[" %1", round(_muzzleVelocity)]]; -}; - -private ["_bulletPos", "_bulletVelocity", "_bulletAccel", "_bulletSpeed", "_gravity", "_deltaT", "_speedOfSound"]; -_bulletPos = [0, 0, 0]; -_bulletVelocity = [0, 0, 0]; -_bulletAccel = [0, 0, 0]; -_bulletSpeed = 0; -_gravity = [0, sin(_scopeBaseAngle + _inclinationAngle) * -9.80665, cos(_scopeBaseAngle + _inclinationAngle) * -9.80665]; -_deltaT = 1 / _simSteps; -_speedOfSound = 0; -if (missionNamespace getVariable [QEGVAR(advanced_ballistics,enabled), false]) then { - _speedOfSound = _temperature call EFUNC(weather,calculateSpeedOfSound); -}; - -private ["_elevation", "_windage1", "_windage2", "_lead", "_TOF", "_trueVelocity", "_trueSpeed", "_kineticEnergy", "_verticalCoriolis", "_verticalDeflection", "_horizontalCoriolis", "_horizontalDeflection", "_spinDrift", "_spinDeflection"]; -_elevation = 0; -_windage1 = 0; -_windage2 = 0; -_lead = 0; -_TOF = 0; -_trueVelocity = [0, 0, 0]; -_trueSpeed = 0; -_verticalCoriolis = 0; -_verticalDeflection = 0; -_horizontalCoriolis = 0; -_horizontalDeflection = 0; -_spinDrift = 0; -_spinDeflection = 0; - -private ["_n", "_range"]; -_n = 0; -_range = 0; - -private ["_wind1", "_wind2", "_windDrift"]; -_wind1 = [cos(270 - _windDirection * 30) * _windSpeed1, sin(270 - _windDirection * 30) * _windSpeed1, 0]; -_wind2 = [cos(270 - _windDirection * 30) * _windSpeed2, sin(270 - _windDirection * 30) * _windSpeed2, 0]; -_windDrift = 0; -if (_useABConfig) then { - _bc = [_bc, _temperature, _barometricPressure, _relativeHumidity, _atmosphereModel] call EFUNC(advanced_ballistics,calculateAtmosphericCorrection); -}; - -private ["_airFrictionCoef", "_airDensity"]; -_airFrictionCoef = 1; -if (!_useABConfig && (missionNamespace getVariable [QEGVAR(advanced_ballistics,enabled), false])) then { - _airDensity = [_temperature, _barometricPressure, _relativeHumidity] call EFUNC(weather,calculateAirDensity); - _airFrictionCoef = _airDensity / 1.22498; -}; - -private ["_speedTotal", "_stepsTotal", "_speedAverage"]; -_speedTotal = 0; -_stepsTotal = 0; -_speedAverage = 0; - -_bulletPos set [0, 0]; -_bulletPos set [1, 0]; -_bulletPos set [2, -(_boreHeight / 100)]; - -_bulletVelocity set [0, 0]; -_bulletVelocity set [1, Cos(_scopeBaseAngle) * _muzzleVelocity]; -_bulletVelocity set [2, Sin(_scopeBaseAngle) * _muzzleVelocity]; - -while {_TOF < 6 && (_bulletPos select 1) < _targetRange} do { - _bulletSpeed = vectorMagnitude _bulletVelocity; - - _speedTotal = _speedTotal + _bulletSpeed; - _stepsTotal = _stepsTotal + 1; - _speedAverage = (_speedTotal / _stepsTotal); - - if (_speedAverage > 450 && _bulletSpeed < _speedOfSound) exitWith {}; - if (atan((_bulletPos select 2) / (abs(_bulletPos select 1) + 1)) < -2.254) exitWith {}; - - _trueVelocity = _bulletVelocity vectorDiff _wind1; - _trueSpeed = vectorMagnitude _trueVelocity; - - if (_useABConfig) then { - private _drag = if (missionNamespace getVariable [QEGVAR(advanced_ballistics,extensionAvailable), false]) then { - parseNumber(("ace_advanced_ballistics" callExtension format["retard:%1:%2:%3", _dragModel, _bc, _trueSpeed])) - } else { - ([_dragModel, _bc, _trueSpeed] call EFUNC(advanced_ballistics,calculateRetardation)) - }; - _bulletAccel = (vectorNormalized _trueVelocity) vectorMultiply (-1 * _drag); - } else { - _bulletAccel = _trueVelocity vectorMultiply (_trueSpeed * _airFriction * _airFrictionCoef); - }; - - _bulletAccel = _bulletAccel vectorAdd _gravity; - - _bulletVelocity = _bulletVelocity vectorAdd (_bulletAccel vectorMultiply _deltaT); - _bulletPos = _bulletPos vectorAdd (_bulletVelocity vectorMultiply _deltaT); - - _TOF = _TOF + _deltaT; - - if (_storeRangeCardData) then { - _range = GVAR(rangeCardStartRange) + _n * GVAR(rangeCardIncrement); - if ((_bulletPos select 1) >= _range && _range <= GVAR(rangeCardEndRange)) then { - if ((_bulletPos select 1) > 0) then { - _elevation = - atan((_bulletPos select 2) / (_bulletPos select 1)); - _windage1 = - atan((_bulletPos select 0) / (_bulletPos select 1)); - }; - if (_range != 0) then { - _lead = (_targetSpeed * _TOF) / (Tan(3.38 / 60) * _range); - }; - private ["_elevationString", "_windageString", "_leadString"]; - _elevationString = Str(round(-_elevation * 60 / 3.38 * 10) / 10); - if (_elevationString == "0") then { - _elevationString = "-0.0"; - }; - if (_elevationString find "." == -1) then { - _elevationString = _elevationString + ".0"; - }; - _windageString = Str(round(_windage1 * 60 / 3.38 * 10) / 10); - if (_windageString find "." == -1) then { - _windageString = _windageString + ".0"; - }; - _leadString = Str(round(_lead * 10) / 10); - if (_leadString find "." == -1) then { - _leadString = _leadString + ".0"; - }; - (GVAR(rangeCardDataElevation) select _rangeCardSlot) set [_n, _elevationString]; - (GVAR(rangeCardDataWindage) select _rangeCardSlot) set [_n, _windageString]; - (GVAR(rangeCardDataLead) select _rangeCardSlot) set [_n, _leadString]; - _n = _n + 1; - }; - }; -}; - -if ((_bulletPos select 1) > 0) then { - _elevation = - atan((_bulletPos select 2) / (_bulletPos select 1)); - _windage1 = - atan((_bulletPos select 0) / (_bulletPos select 1)); - _windDrift = (_wind2 select 0) * (_TOF - _targetRange / _muzzleVelocity); - _windage2 = - atan(_windDrift / (_bulletPos select 1)); -}; - -if (_targetRange != 0) then { - _lead = (_targetSpeed * _TOF) / (Tan(3.38 / 60) * _targetRange); -}; - -_kineticEnergy = 0.5 * (_bulletMass / 1000 * (_bulletSpeed ^ 2)); -_kineticEnergy = _kineticEnergy * 0.737562149; - -[_elevation * 60, [_windage1 * 60, _windage2 * 60], _lead, _TOF, _bulletSpeed, _kineticEnergy, _verticalCoriolis * 60, _horizontalCoriolis * 60, _spinDrift * 60] diff --git a/addons/rangecard/functions/fnc_canCopy.sqf b/addons/rangecard/functions/fnc_canCopy.sqf index c9e0a05d0e..8984192669 100644 --- a/addons/rangecard/functions/fnc_canCopy.sqf +++ b/addons/rangecard/functions/fnc_canCopy.sqf @@ -6,10 +6,10 @@ * unit * * Return Value: - * canShow (bool) + * canShow * * Example: - * [] call ace_rangecard_fnc_canCopy + * [bob] call ace_rangecard_fnc_canCopy * * Public: No */ diff --git a/addons/rangecard/functions/fnc_canShow.sqf b/addons/rangecard/functions/fnc_canShow.sqf index 330788ee7c..d81bba9485 100644 --- a/addons/rangecard/functions/fnc_canShow.sqf +++ b/addons/rangecard/functions/fnc_canShow.sqf @@ -6,7 +6,7 @@ * Nothing * * Return Value: - * canShow (bool) + * canShow * * Example: * [] call ace_rangecard_fnc_canShow diff --git a/addons/rangecard/functions/fnc_canShowCopy.sqf b/addons/rangecard/functions/fnc_canShowCopy.sqf index e78c64cc89..b6e2d8d68d 100644 --- a/addons/rangecard/functions/fnc_canShowCopy.sqf +++ b/addons/rangecard/functions/fnc_canShowCopy.sqf @@ -6,7 +6,7 @@ * Nothing * * Return Value: - * canShow (bool) + * canShow * * Example: * [] call ace_rangecard_fnc_canShowCopy diff --git a/addons/rangecard/functions/fnc_onCloseDialog.sqf b/addons/rangecard/functions/fnc_onCloseDialog.sqf index f5d971f22f..68d12c8c84 100644 --- a/addons/rangecard/functions/fnc_onCloseDialog.sqf +++ b/addons/rangecard/functions/fnc_onCloseDialog.sqf @@ -1,3 +1,19 @@ +/* + * Author: joko // Jonas + * Add the Reserve Parachute to Units or Save Backpack if is a Parachute in Unit + * + * Arguments: + * None + * + * Return Value: + * None + * + * Example: + * None + * + * Public: No + */ + #include "script_component.hpp" uiNamespace setVariable ['RangleCard_Display', nil]; diff --git a/addons/rangecard/functions/fnc_openRangeCard.sqf b/addons/rangecard/functions/fnc_openRangeCard.sqf index ea085ed5b1..5801b594be 100644 --- a/addons/rangecard/functions/fnc_openRangeCard.sqf +++ b/addons/rangecard/functions/fnc_openRangeCard.sqf @@ -6,10 +6,10 @@ * Open copy? * * Return Value: - * Nothing + * None * * Example: - * call ace_rangecard_fnc_openRangeCard + * [true] call ace_rangecard_fnc_openRangeCard * * Public: No */ @@ -23,7 +23,7 @@ if (_this) then { createDialog "ACE_RangeCard_Dialog"; - [GVAR(ammoClassCopy), GVAR(magazineClassCopy), GVAR(weaponClassCopy)] call FUNC(updateRangeCard); + [GVAR(zeroRangeCopy), GVAR(boreHeightCopy), GVAR(ammoClassCopy), GVAR(magazineClassCopy), GVAR(weaponClassCopy)] call FUNC(updateRangeCard); }; } else { if (ACE_player call FUNC(updateClassNames)) then { @@ -31,6 +31,6 @@ if (_this) then { createDialog "ACE_RangeCard_Dialog"; - [GVAR(ammoClass), GVAR(magazineClass), GVAR(weaponClass)] call FUNC(updateRangeCard); + [GVAR(zeroRange), GVAR(boreHeight), GVAR(ammoClass), GVAR(magazineClass), GVAR(weaponClass)] call FUNC(updateRangeCard); }; }; diff --git a/addons/rangecard/functions/fnc_updateClassNames.sqf b/addons/rangecard/functions/fnc_updateClassNames.sqf index 70cf25825e..8af70eb02b 100644 --- a/addons/rangecard/functions/fnc_updateClassNames.sqf +++ b/addons/rangecard/functions/fnc_updateClassNames.sqf @@ -15,19 +15,18 @@ */ #include "script_component.hpp" -private ["_unit", "_ammoClass", "_magazineClass", "_weaponClass", "_ammo", "_ammoConfig", "_parentClasses"]; -_unit = _this; +private _unit = _this; -_ammoClass = ""; -_magazineClass = ""; -_weaponClass = primaryWeapon _unit; +private _ammoClass = ""; +private _magazineClass = ""; +private _weaponClass = primaryWeapon _unit; -if (_weaponClass == "") exitWith { (GVAR(ammoClass) != "" && GVAR(magazineClass) != "" && GVAR(weaponClass) != "") }; +if (_weaponClass == "") exitWith { (GVAR(ammoClass) != "" && GVAR(magazineClass) != "" && GVAR(weaponClass) != "") }; { - _ammo = getText (configFile >> "CfgMagazines" >> _x >> "ammo"); - _ammoConfig = (configFile >> "CfgAmmo" >> _ammo); - _parentClasses = [_ammoConfig, true] call BIS_fnc_returnParents; + private _ammo = getText (configFile >> "CfgMagazines" >> _x >> "ammo"); + private _ammoConfig = (configFile >> "CfgAmmo" >> _ammo); + private _parentClasses = [_ammoConfig, true] call BIS_fnc_returnParents; if ("BulletBase" in _parentClasses) exitWith { _ammoClass = _ammo; _magazineClass = _x; @@ -37,10 +36,14 @@ if (_weaponClass == "") exitWith { (GVAR(ammoClass) != "" && GVAR(magazineClass) if (_ammoClass == "") exitWith { (GVAR(ammoClass) != "" && GVAR(magazineClass) != "" && GVAR(weaponClass) != "") }; if (_unit == ACE_player) then { + GVAR(zeroRange) = [_unit] call EFUNC(scopes,getCurrentZeroRange); + GVAR(boreHeight) = [_unit, 0] call EFUNC(scopes,getBoreHeight); GVAR(ammoClass) = _ammoClass; GVAR(magazineClass) = _magazineClass; GVAR(weaponClass) = _weaponClass; } else { + GVAR(zeroRangeCopy) = [_unit] call EFUNC(scopes,getCurrentZeroRange); + GVAR(boreHeightCopy) = [_unit, 0] call EFUNC(scopes,getBoreHeight); GVAR(ammoClassCopy) = _ammoClass; GVAR(magazineClassCopy) = _magazineClass; GVAR(weaponClassCopy) = _weaponClass; diff --git a/addons/rangecard/functions/fnc_updateRangeCard.sqf b/addons/rangecard/functions/fnc_updateRangeCard.sqf index a7b0b996e2..064abea6b0 100644 --- a/addons/rangecard/functions/fnc_updateRangeCard.sqf +++ b/addons/rangecard/functions/fnc_updateRangeCard.sqf @@ -3,15 +3,17 @@ * Updates the range card data * * Arguments: - * 0: ammo class - * 1: magazine class - * 2: weapon class + * 0: zero range + * 1: bore height + * 2: ammo class + * 3: magazine class + * 4: weapon class * * Return Value: - * Nothing + * None * * Example: - * [mode] call ace_rangecard_fnc_openRangeCard + * [1, 2, "ammo", "magazine", "weapon"] call ace_rangecard_fnc_openRangeCard * * Public: No */ @@ -20,10 +22,8 @@ disableSerialization; #define __dsp (uiNamespace getVariable "RangleCard_Display") -private ["_airFriction", "_ammoConfig", "_atmosphereModel", "_barometricPressure", "_barrelLength", "_barrelTwist", "_bc", "_bulletMass", "_boreHeight", "_cacheEntry", "_column", "_control", "_dragModel", "_i", "_muzzleVelocity", "_mv", "_mvShift", "_offset", "_relativeHumidity", "_result", "_row", "_scopeBaseAngle", "_weaponConfig", "_zeroRange", "_initSpeed", "_initSpeedCoef", "_useABConfig"]; -_useABConfig = (missionNamespace getVariable [QEGVAR(advanced_ballistics,enabled), false]); -PARAMS_3(_ammoClass,_magazineClass,_weaponClass); +params ["_zeroRange", "_boreHeight", "_ammoClass", "_magazineClass", "_weaponClass"]; if (_ammoClass == "" || _magazineClass == "" || _weaponClass == "") exitWith {}; @@ -33,8 +33,8 @@ if (_ammoClass == "" || _magazineClass == "" || _weaponClass == "") exitWith {}; GVAR(controls) = []; for "_row" from 0 to 49 do { - _offset = if (_row < 5) then {0} else {0.003}; - _control = (__dsp ctrlCreate ["RangeCard_RscText", 790000 + _row]); + private _offset = if (_row < 5) then {0} else {0.003}; + private _control = (__dsp ctrlCreate ["RangeCard_RscText", 790000 + _row]); _control ctrlSetPosition [safeZoneX + 0.183, safeZoneY + 0.374 + 0.027 * _row + _offset, 0.062, 0.025]; if (_row in [0, 8, 18, 28, 38, 48]) then { _control ctrlSetTextColor [1, 1, 1, 1]; @@ -47,8 +47,8 @@ for "_row" from 0 to 49 do { }; for "_column" from 0 to 8 do { for "_row" from 0 to 49 do { - _offset = if (_row < 5) then {0} else {0.003}; - _control = (__dsp ctrlCreate ["RangeCard_RscText", 90000 + _column * 100 + _row]); + private _offset = if (_row < 5) then {0} else {0.003}; + private _control = (__dsp ctrlCreate ["RangeCard_RscText", 90000 + _column * 100 + _row]); _control ctrlSetPosition [safeZoneX + 0.249 + _column * 0.055, safeZoneY + 0.374 + 0.027 * _row + _offset, 0.052, 0.025]; _control ctrlCommit 0; _control ctrlSetText "-0.0"; @@ -57,8 +57,8 @@ for "_column" from 0 to 8 do { }; for "_column" from 0 to 2 do { for "_row" from 0 to 49 do { - _offset = if (_row < 5) then {0} else {0.003}; - _control = (__dsp ctrlCreate ["RangeCard_RscText", 90000 + (9 +_column) * 100 + _row]); + private _offset = if (_row < 5) then {0} else {0.003}; + private _control = (__dsp ctrlCreate ["RangeCard_RscText", 90000 + (9 +_column) * 100 + _row]); _control ctrlSetPosition [safeZoneX + 0.743 + _column * 0.049, safeZoneY + 0.374 + 0.027 * _row + _offset, 0.047, 0.025]; _control ctrlCommit 0; _control ctrlSetText "-0.0"; @@ -67,8 +67,8 @@ for "_column" from 0 to 2 do { }; for "_column" from 0 to 2 do { for "_row" from 0 to 49 do { - _offset = if (_row < 5) then {0} else {0.003}; - _control = (__dsp ctrlCreate ["RangeCard_RscText", 90000 + (12 +_column) * 100 + _row]); + private _offset = if (_row < 5) then {0} else {0.003}; + private _control = (__dsp ctrlCreate ["RangeCard_RscText", 90000 + (12 +_column) * 100 + _row]); _control ctrlSetPosition [safeZoneX + 0.892 + _column * 0.049, safeZoneY + 0.374 + 0.027 * _row + _offset, 0.047, 0.025]; _control ctrlCommit 0; _control ctrlSetText "-0.0"; @@ -92,23 +92,22 @@ GVAR(rangeCardStartRange) = 100; GVAR(rangeCardIncrement) = 50; GVAR(rangeCardEndRange) = GVAR(rangeCardStartRange) + 49 * GVAR(rangeCardIncrement); -_ammoConfig = _ammoClass call EFUNC(advanced_ballistics,readAmmoDataFromConfig); -_weaponConfig = _weaponClass call EFUNC(advanced_ballistics,readWeaponDataFromConfig); -_airFriction = _ammoConfig select 0; -_barrelTwist = _weaponConfig select 0; -_barrelLength = _weaponConfig select 2; -_muzzleVelocity = 0; +private _ammoConfig = _ammoClass call EFUNC(advanced_ballistics,readAmmoDataFromConfig); +private _weaponConfig = _weaponClass call EFUNC(advanced_ballistics,readWeaponDataFromConfig); +private _airFriction = _ammoConfig select 0; +private _barrelTwist = _weaponConfig select 0; +private _barrelLength = _weaponConfig select 2; +private _muzzleVelocity = 0; -_bc = 0; +private _bc = 0; if (count (_ammoConfig select 6) > 0) then { _bc = (_ammoConfig select 6) select 0; }; -_dragModel = _ammoConfig select 5; -_atmosphereModel = _ammoConfig select 8; -_bulletMass = 5; -_boreHeight = 3.81; -_zeroRange = 100; +private _transonicStabilityCoef = _ammoConfig select 4; +private _dragModel = _ammoConfig select 5; +private _atmosphereModel = _ammoConfig select 8; +private _useABConfig = (missionNamespace getVariable [QEGVAR(advanced_ballistics,enabled), false]); if (_bc == 0) then { _useABConfig = false; }; @@ -116,8 +115,8 @@ if (_bc == 0) then { if (_barrelLength > 0 && _useABConfig) then { _muzzleVelocity = [_barrelLength, _ammoConfig select 10, _ammoConfig select 11, 0] call EFUNC(advanced_ballistics,calculateBarrelLengthVelocityShift); } else { - _initSpeed = getNumber (configFile >> "CfgMagazines" >> _magazineClass >> "initSpeed"); - _initSpeedCoef = getNumber (configFile >> "CfgWeapons" >> _weaponClass >> "initSpeed"); + private _initSpeed = getNumber (configFile >> "CfgMagazines" >> _magazineClass >> "initSpeed"); + private _initSpeedCoef = getNumber (configFile >> "CfgWeapons" >> _weaponClass >> "initSpeed"); if (_initSpeedCoef < 0) then { _initSpeed = _initSpeed * -_initSpeedCoef; }; @@ -127,16 +126,13 @@ if (_barrelLength > 0 && _useABConfig) then { _muzzleVelocity = _initSpeed; }; -if (_useABConfig) then { - ctrlSetText [770000, format["%1'' - %2 gr (%3)", round((_ammoConfig select 1) * 39.3700787) / 1000, round((_ammoConfig select 3) * 15.4323584), _ammoClass]]; - if (_barrelLength > 0 && _barrelTwist > 0) then { +ctrlSetText [770000, format["%1'' - %2 gr (%3)", round((_ammoConfig select 1) * 39.3700787) / 1000, round((_ammoConfig select 3) * 15.4323584), _ammoClass]]; +if (_barrelLength > 0) then { + if (_useABConfig && _barrelTwist > 0) then { ctrlSetText [770002, format["Barrel: %1'' 1:%2'' twist", round(2 * _barrelLength * 0.0393700787) / 2, round(_barrelTwist * 0.0393700787)]]; } else { - ctrlSetText [770002, ""]; + ctrlSetText [770002, format["Barrel: %1''", round(2 * _barrelLength * 0.0393700787) / 2]]; }; -} else { - ctrlSetText [770000, getText (configFile >> "CfgMagazines" >> _magazineClass >> "displayNameShort")]; - ctrlSetText [770002, getText (configFile >> "CfgWeapons" >> _weaponClass >> "displayName")]; }; lnbAddRow [770100, ["4mps Wind(MRADs)", "1mps LEAD(MRADs)"]]; @@ -147,33 +143,34 @@ if (missionNamespace getVariable [QEGVAR(advanced_ballistics,enabled), false]) t lnbAddRow [770300, ["-15°C", " 10°C", " 35°C", "-15°C", " 10°C", " 35°C"]]; }; -_barometricPressure = 1013.25; -if (missionNamespace getVariable [QEGVAR(advanced_ballistics,enabled), false]) then { - _barometricPressure = 1013.25 * (1 - (0.0065 * EGVAR(common,mapAltitude)) / 288.15) ^ 5.255754495; -}; -_relativeHumidity = 0.5; +ctrlSetText [77003, format["%1m ZERO", round(_zeroRange)]]; if (missionNamespace getVariable [QEGVAR(advanced_ballistics,enabled), false]) then { - ctrlSetText [770001, format["Drop Tables for B.P.: %1mb; Corrected for MVV at Air/Ammo Temperatures -15-35 °C", round(_barometricPressure * 100) / 100]]; - ctrlSetText [77004 , format["B.P.: %1mb", round(_barometricPressure * 100) / 100]]; + ctrlSetText [770001, format["Drop Tables for B.P.: %1mb; Corrected for MVV at Air/Ammo Temperatures -15-35 °C", round(EGVAR(scopes,zeroReferenceBarometricPressure) * 100) / 100]]; + ctrlSetText [77004 , format["B.P.: %1mb", round(EGVAR(scopes,zeroReferenceBarometricPressure) * 100) / 100]]; } else { ctrlSetText [770001, ""]; ctrlSetText [77004 , ""]; }; -_cacheEntry = missionNamespace getVariable format[QGVAR(%1_%2_%3), _ammoClass, _weaponClass, missionNamespace getVariable [QEGVAR(advanced_ballistics,enabled), false]]; +private _cacheEntry = missionNamespace getVariable format[QGVAR(%1_%2_%3_%4_%5), _zeroRange, _boreHeight, _ammoClass, _weaponClass, missionNamespace getVariable [QEGVAR(advanced_ballistics,enabled), false]]; if (isNil {_cacheEntry}) then { - _result = [0, 0, _boreHeight, _airFriction, _muzzleVelocity, 15, 1013.25, 0.5, 1000, [0, 0], 0, 0, 0, _zeroRange, _bc, _dragModel, _atmosphereModel, false, 1.5, 0, 0, 0, 0, _useABConfig] call FUNC(calculateSolution); - _scopeBaseAngle = (_result select 0) / 60; - if (missionNamespace getVariable [QEGVAR(advanced_ballistics,enabled), false]) then { + private _scopeBaseAngle = if (!_useABConfig) then { + private _zeroAngle = "ace_advanced_ballistics" callExtension format ["zeroAngleVanilla:%1:%2:%3:%4", _zeroRange, _muzzleVelocity, _airFriction, _boreHeight]; + (parseNumber _zeroAngle) + } else { + private _zeroAngle = "ace_advanced_ballistics" callExtension format ["zeroAngle:%1:%2:%3:%4:%5:%6:%7:%8:%9", _zeroRange, _muzzleVelocity, _boreHeight, EGVAR(scopes,zeroReferenceTemperature), EGVAR(scopes,zeroReferenceBarometricPressure), EGVAR(scopes,zeroReferenceHumidity), _bc, _dragModel, _atmosphereModel]; + (parseNumber _zeroAngle) + }; + if (missionNamespace getVariable [QEGVAR(advanced_ballistics,enabled), false] && missionNamespace getVariable [QEGVAR(advanced_ballistics,ammoTemperatureEnabled), false]) then { { - _mvShift = [_ammoConfig select 9, _x] call EFUNC(advanced_ballistics,calculateAmmoTemperatureVelocityShift); - _mv = _muzzleVelocity + _mvShift; + private _mvShift = [_ammoConfig select 9, _x] call EFUNC(advanced_ballistics,calculateAmmoTemperatureVelocityShift); + private _mv = _muzzleVelocity + _mvShift; - [_scopeBaseAngle,_bulletMass,_boreHeight,_airFriction,_mv,_x,_barometricPressure,_relativeHumidity,1000,[4,0],3,0,1,GVAR(rangeCardEndRange),_bc,_dragModel,_atmosphereModel,true,1.5,1,46,23,_forEachIndex,_useABConfig] call FUNC(calculateSolution); + [_scopeBaseAngle,_boreHeight,_airFriction,_mv,_x,EGVAR(scopes,zeroReferenceBarometricPressure),EGVAR(scopes,zeroReferenceHumidity),100,4,1,GVAR(rangeCardEndRange),_bc,_dragModel,_atmosphereModel,_transonicStabilityCoef,_forEachIndex,_useABConfig] call FUNC(calculateRangeCard); } forEach [-15, -5, 5, 10, 15, 20, 25, 30, 35]; } else { - [_scopeBaseAngle,_bulletMass,_boreHeight,_airFriction,_muzzleVelocity,15,_barometricPressure,_relativeHumidity,1000,[4,0],3,0,1,GVAR(rangeCardEndRange),_bc,_dragModel,_atmosphereModel,true,1.5,1,46,23,3,_useABConfig] call FUNC(calculateSolution); + [_scopeBaseAngle,_boreHeight,_airFriction,_muzzleVelocity,15,EGVAR(scopes,zeroReferenceBarometricPressure),EGVAR(scopes,zeroReferenceHumidity),100,4,1,GVAR(rangeCardEndRange),_bc,_dragModel,_atmosphereModel,_transonicStabilityCoef,3,_useABConfig] call FUNC(calculateRangeCard); }; for "_i" from 0 to 9 do { @@ -191,7 +188,7 @@ if (isNil {_cacheEntry}) then { }; }; - missionNamespace setVariable [format[QGVAR(%1_%2_%3), _ammoClass, _weaponClass, missionNamespace getVariable [QEGVAR(advanced_ballistics,enabled), false]], [GVAR(rangeCardDataElevation), GVAR(rangeCardDataWindage), GVAR(rangeCardDataLead), GVAR(rangeCardDataMVs), GVAR(lastValidRow)]]; + missionNamespace setVariable [format[QGVAR(%1_%2_%3_%4_%5), _zeroRange, _boreHeight, _ammoClass, _weaponClass, missionNamespace getVariable [QEGVAR(advanced_ballistics,enabled), false]], [GVAR(rangeCardDataElevation), GVAR(rangeCardDataWindage), GVAR(rangeCardDataLead), GVAR(rangeCardDataMVs), GVAR(lastValidRow)]]; } else { GVAR(rangeCardDataElevation) = _cacheEntry select 0; GVAR(rangeCardDataWindage) = _cacheEntry select 1; @@ -204,7 +201,7 @@ lnbAddRow [770200, GVAR(rangeCardDataMVs)]; for "_column" from 0 to 8 do { for "_row" from 0 to 49 do { - _control = (__dsp displayCtrl (90000 + _column * 100 + _row)); + private _control = (__dsp displayCtrl (90000 + _column * 100 + _row)); _control ctrlSetText ((GVAR(rangeCardDataElevation) select _column) select _row); if (_row >= (GVAR(lastValidRow) select _column)) then { _control ctrlSetTextColor [0, 0, 0, 0.6]; @@ -216,7 +213,7 @@ for "_column" from 0 to 8 do { }; { for "_row" from 0 to 49 do { - _control = (__dsp displayCtrl (90000 + (9 + _forEachIndex) * 100 + _row)); + private _control = (__dsp displayCtrl (90000 + (9 + _forEachIndex) * 100 + _row)); _control ctrlSetText ((GVAR(rangeCardDataWindage) select _x) select _row); if (_row >= (GVAR(lastValidRow) select _x)) then { _control ctrlSetTextColor [0, 0, 0, 0.6]; @@ -229,7 +226,7 @@ for "_column" from 0 to 8 do { { for "_row" from 0 to 49 do { - _control = (__dsp displayCtrl (90000 + (12 + _forEachIndex) * 100 + _row)); + private _control = (__dsp displayCtrl (90000 + (12 + _forEachIndex) * 100 + _row)); _control ctrlSetText ((GVAR(rangeCardDataLead) select _x) select _row); if (_row >= (GVAR(lastValidRow) select _x)) then { _control ctrlSetTextColor [0, 0, 0, 0.6]; @@ -240,10 +237,5 @@ for "_column" from 0 to 8 do { }; } forEach [0, 3, 8]; -if (_useABConfig) then { - ctrlSetText [770020, "For best results keep ammunition at ambient air temperature. Tables calculated for the above listed barrel"]; - ctrlSetText [770021, "and load with optic mounted 1.5'' above line of bore."]; -} else { - ctrlSetText [770020, ""]; - ctrlSetText [770021, ""]; -}; +ctrlSetText [770020, "For best results keep ammunition at ambient air temperature. Tables calculated for the above listed barrel"]; +ctrlSetText [770021, format["and load with optic mounted %1'' above line of bore.", round((_boreHeight / 2.54) * 10) / 10]]; diff --git a/addons/rangecard/script_component.hpp b/addons/rangecard/script_component.hpp index a83f40931f..76106720bc 100644 --- a/addons/rangecard/script_component.hpp +++ b/addons/rangecard/script_component.hpp @@ -15,3 +15,10 @@ #endif #include "\z\ace\addons\main\script_macros.hpp" + +#define MOA_TO_MRAD(d) (d * 3.43774677) // Conversion factor: 54 / (5 * PI) +#define MRAD_TO_MOA(d) (d * 0.29088821) // Conversion factor: (5 * PI) / 54 +#define DEG_TO_MOA(d) (d * 60) // Conversion factor: 60 +#define MOA_TO_DEG(d) (d / 60) // Conversion factor: 1 / 60 +#define DEG_TO_MRAD(d) (d * 17.45329252) // Conversion factor: (50 * PI) / 9 +#define MRAD_TO_DEG(d) (d / 17.45329252) // Conversion factor: 9 / (50 * PI) diff --git a/addons/rangecard/stringtable.xml b/addons/rangecard/stringtable.xml index 59405e4705..5862981e16 100644 --- a/addons/rangecard/stringtable.xml +++ b/addons/rangecard/stringtable.xml @@ -1,4 +1,4 @@ - + @@ -13,6 +13,9 @@ Таблица поправок Tavola Balistica 射表 + 사거리표 + 弹道射表 + 彈道射表 50 METER increments -- MRAD/MRAD (reticle/turrets) @@ -26,6 +29,9 @@ Шаг 50 МЕТРОВ - MRAD/MRAD (сетка/маховички) Incrementi per 50 METRI - MRAD/MRAD (reticolo/torrette) 50 メートル増やす -- MRAD/MRAD (照準線/砲塔) + 50 미터 늘리기 -- MRAD/MRAD (조준선/포탑) + 50公尺增量 -- 毫弧度/毫弧度 (瞄镜分划线/调整纽) + 50公尺增量 -- 毫弧度/毫弧度 (瞄鏡分劃線/調整紐) Open Range Card @@ -39,6 +45,9 @@ Открыть таблицу поправок Apri Tavola Balistica 射表を開く + 사거리표 열기 + 开启弹道射表 + 開啟彈道射表 Open Range Card Copy @@ -52,6 +61,9 @@ Открыть копию таблицы поправок Apri Copia Tavola Balistica 複製された射表を開く + 복제 사거리표 열기 + 开启弹道射表副本 + 開啟彈道射表副本 Open Range Card @@ -65,6 +77,9 @@ Открыть таблицу поправок Apri Tavola Balistica 射表を開く + 사거리표 열기 + 开启弹道射表 + 開啟彈道射表 Open Range Card Copy @@ -78,6 +93,9 @@ Открыть копию таблицы поправок Apri Copia Tavola Balistica 複製された射表を開く + 복제 사거리표 열기 + 开启弹道射表副本 + 開啟彈道射表副本 Copy Range Card @@ -91,6 +109,9 @@ Скопировать таблицу поправок Copia Tavola Balistica 射表を複製する + 사거리표 복제 + 复制弹道射表 + 複製彈道射表 - \ No newline at end of file + diff --git a/addons/realisticnames/CfgMagazines.hpp b/addons/realisticnames/CfgMagazines.hpp index a6a64a4a15..6e7daa4738 100644 --- a/addons/realisticnames/CfgMagazines.hpp +++ b/addons/realisticnames/CfgMagazines.hpp @@ -417,4 +417,80 @@ class CfgMagazines { class SmokeShellYellow: SmokeShell { displayName = CSTRING(SmokeShellYellow_Name); }; + + + // 1.70 Pylon Magazines (Should Match Weapon Name) + class 2Rnd_Missile_AA_04_F; + class PylonRack_1Rnd_Missile_AA_04_F: 2Rnd_Missile_AA_04_F { + displayName = "AIM-9 Sidewinder"; // [vanilla: Falchion-22 - Missile_AA_04_Plane_CAS_01_F] + }; + class 4Rnd_AAA_missiles; + class PylonRack_1Rnd_AAA_missiles: 4Rnd_AAA_missiles { + displayName = "AIM-132 ASRAAM"; // [vanilla: ASRAAM - missiles_ASRAAM] + }; + class 4Rnd_GAA_missiles; + class PylonRack_1Rnd_GAA_missiles: 4Rnd_GAA_missiles { + displayName = "AIM-120A AMRAAM"; // [vanilla: Zephyr - missiles_Zephyr] + }; + class 6Rnd_Missile_AGM_02_F; + class PylonRack_1Rnd_Missile_AGM_02_F: 6Rnd_Missile_AGM_02_F { + displayName = "AGM-65 Maverick G"; // [vanilla: Macer - Missile_AGM_02_Plane_CAS_01_F] + }; + class PylonRack_3Rnd_Missile_AGM_02_F: PylonRack_1Rnd_Missile_AGM_02_F { + displayName = "AGM-65 Maverick G 3x"; // [vanilla: Macer 3x - Missile_AGM_02_Plane_CAS_01_F] + }; + class magazine_Missile_AGM_02_x1 : VehicleMagazine { + displayName = "AGM-65 Maverick G"; // [vanilla: Macer - Missile_AGM_02_Plane_CAS_01_F] + }; + class PylonMissile_Missile_AGM_02_x1 : magazine_Missile_AGM_02_x1 { + displayName = "AGM-65 Maverick G"; // [vanilla: Macer - Missile_AGM_02_Plane_CAS_01_F] + }; + class PylonMissile_Missile_AGM_02_x2 : magazine_Missile_AGM_02_x1 { + displayName = "AGM-65 Maverick G 2x"; // [vanilla: Macer 2x - Missile_AGM_02_Plane_CAS_01_F] + }; + class PylonRack_Missile_AGM_02_x1 : magazine_Missile_AGM_02_x1 { + displayName = "AGM-65 Maverick G"; // [vanilla: Macer - Missile_AGM_02_Plane_CAS_01_F] + }; + class PylonRack_Missile_AGM_02_x2 : magazine_Missile_AGM_02_x1 { + displayName = "AGM-65 Maverick G 2x"; // [vanilla: Macer 2x - Missile_AGM_02_Plane_CAS_01_F] + }; + class 2Rnd_LG_scalpel; + class PylonRack_1Rnd_LG_scalpel: 2Rnd_LG_scalpel { + displayName = "9K121 Vikhr"; // [vanilla: Scalpel - missiles_SCALPEL] + }; + class PylonRack_3Rnd_LG_scalpel: PylonRack_1Rnd_LG_scalpel { + displayName = "9K121 Vikhr 3x"; // [vanilla: Scalpel 3x - missiles_SCALPEL] + }; + class PylonRack_4Rnd_LG_scalpel: PylonRack_1Rnd_LG_scalpel { + displayName = "9K121 Vikhr 4x"; // [vanilla: Scalpel 4x - missiles_SCALPEL] + }; + class PylonRack_7Rnd_Rocket_04_HE_F: 7Rnd_Rocket_04_HE_F { + displayName = "Hydra 70 7x HE"; // [vanilla: Shrieker 7x HE - Rocket_04_HE_Plane_CAS_01_F] + }; + class PylonRack_7Rnd_Rocket_04_AP_F: 7Rnd_Rocket_04_AP_F { + displayName = "Hydra 70 7x AP"; // [vanilla: Shrieker 7x AP - Rocket_04_AP_Plane_CAS_01_F] + }; + class 12Rnd_missiles; + class PylonRack_12Rnd_missiles: 12Rnd_missiles { + displayName = "Hydra 70"; // [vanilla: DAR - missiles_DAR] + }; + class PylonRack_20Rnd_Rocket_03_HE_F: 20Rnd_Rocket_03_HE_F { + displayName = "S-8 20x HE"; // [vanilla: Tratnyr 20x HE - Rocket_03_HE_Plane_CAS_02_F] + }; + class PylonRack_20Rnd_Rocket_03_AP_F: 20Rnd_Rocket_03_AP_F { + displayName = "S-8 20x AP"; // [vanilla: Tratnyr 20x AP - Rocket_03_AP_Plane_CAS_02_F] + }; + class 2Rnd_Missile_AA_03_F; + class PylonRack_1Rnd_Missile_AA_03_F: 2Rnd_Missile_AA_03_F { + displayName = "Wympel R-73"; // [vanilla: Sahr-3 - Missile_AA_03_Plane_CAS_02_F] + }; + class 4Rnd_Missile_AGM_01_F; + class PylonRack_1Rnd_Missile_AGM_01_F: 4Rnd_Missile_AGM_01_F { + displayName = "Kh-25MTP"; // [vanilla: Sharur - Missile_AGM_01_Plane_CAS_02_F] + }; + class 2Rnd_Bomb_03_F; + class PylonMissile_1Rnd_Bomb_03_F: 2Rnd_Bomb_03_F { + displayName = "FAB-250M-54"; // [vanilla: LOM-250G - Bomb_03_Plane_CAS_02_F] + }; + }; diff --git a/addons/realisticnames/CfgVehicles.hpp b/addons/realisticnames/CfgVehicles.hpp index f53465b08f..3d217164e5 100644 --- a/addons/realisticnames/CfgVehicles.hpp +++ b/addons/realisticnames/CfgVehicles.hpp @@ -251,6 +251,18 @@ class CfgVehicles { class I_Truck_02_medical_F: Truck_02_medical_base_F { displayName = CSTRING(Truck_02_medical_Name); }; + class C_Truck_02_transport_F: Truck_02_transport_base_F { + displayName = CSTRING(Truck_02_transport_Name); + }; + class C_Truck_02_covered_F: Truck_02_base_F { + displayName = CSTRING(Truck_02_covered_Name); + }; + class C_Truck_02_fuel_F: Truck_02_fuel_base_F { + displayName = CSTRING(Truck_02_fuel_Name); + }; + class C_Truck_02_box_F: Truck_02_box_base_F { + displayName = CSTRING(Truck_02_box_Name); + }; class Truck_03_base_F; class O_Truck_03_transport_F: Truck_03_base_F { @@ -281,18 +293,27 @@ class CfgVehicles { displayName = CSTRING(Heli_Attack_01_Name); }; + class Heli_Attack_01_dynamicLoadout_base_F; + class B_Heli_Attack_01_dynamicLoadout_F: Heli_Attack_01_dynamicLoadout_base_F { + displayName = CSTRING(Heli_Attack_01_Name); + }; + class Heli_Light_01_unarmed_base_F; class B_Heli_Light_01_F: Heli_Light_01_unarmed_base_F { displayName = CSTRING(Heli_Light_01_Name); }; + class Heli_Light_01_civil_base_F: Heli_Light_01_unarmed_base_F { + displayName = CSTRING(Heli_Light_01_civil_Name); + }; class Heli_Light_01_armed_base_F; class B_Heli_Light_01_armed_F: Heli_Light_01_armed_base_F { displayName = CSTRING(Heli_Light_01_armed_Name); }; - class Heli_Light_01_civil_base_F: Heli_Light_01_unarmed_base_F { - displayName = CSTRING(Heli_Light_01_civil_Name); + class Heli_Light_01_dynamicLoadout_base_F; + class B_Heli_Light_01_dynamicLoadout_F: Heli_Light_01_dynamicLoadout_base_F { + displayName = CSTRING(Heli_Light_01_armed_Name); }; class Heli_Transport_03_base_F; @@ -316,6 +337,11 @@ class CfgVehicles { displayName = CSTRING(Heli_Light_02_unarmed_Name); }; + class Heli_Light_02_dynamicLoadout_base_F; + class O_Heli_Light_02_dynamicLoadout_F: Heli_Light_02_dynamicLoadout_base_F { + displayName = CSTRING(Heli_Light_02_Name); + }; + class Heli_light_03_base_F; class I_Heli_light_03_F: Heli_light_03_base_F { displayName = CSTRING(Heli_light_03_Name); @@ -326,6 +352,11 @@ class CfgVehicles { displayName = CSTRING(Heli_light_03_unarmed_Name); }; + class Heli_light_03_dynamicLoadout_base_F; + class I_Heli_light_03_dynamicLoadout_F: Heli_light_03_dynamicLoadout_base_F { + displayName = CSTRING(Heli_light_03_Name); + }; + class Heli_Transport_02_base_F; class I_Heli_Transport_02_F: Heli_Transport_02_base_F { displayName = CSTRING(Heli_Transport_02_Name); @@ -337,11 +368,21 @@ class CfgVehicles { displayName = CSTRING(Plane_CAS_01_Name); }; + class Plane_CAS_01_dynamicLoadout_base_F; + class B_Plane_CAS_01_dynamicLoadout_F: Plane_CAS_01_dynamicLoadout_base_F { + displayName = CSTRING(Plane_CAS_01_Name); + }; + class Plane_CAS_02_base_F; class O_Plane_CAS_02_F: Plane_CAS_02_base_F { displayName = CSTRING(Plane_CAS_02_Name); }; + class Plane_CAS_02_dynamicLoadout_base_F; + class O_Plane_CAS_02_dynamicLoadout_F: Plane_CAS_02_dynamicLoadout_base_F { + displayName = CSTRING(Plane_CAS_02_Name); + }; + class Plane_Fighter_03_base_F; class I_Plane_Fighter_03_CAS_F: Plane_Fighter_03_base_F { displayName = CSTRING(Plane_Fighter_03_CAS_Name); @@ -351,6 +392,11 @@ class CfgVehicles { displayName = CSTRING(Plane_Fighter_03_AA_Name); }; + class Plane_Fighter_03_dynamicLoadout_base_F; + class I_Plane_Fighter_03_dynamicLoadout_F: Plane_Fighter_03_dynamicLoadout_base_F { + displayName = CSTRING(Plane_Fighter_03_Name); + }; + // uavs class UAV_02_base_F; class B_UAV_02_F: UAV_02_base_F { @@ -363,7 +409,7 @@ class CfgVehicles { displayName = CSTRING(UAV_02_Name); }; - class UAV_02_CAS_base_F: UAV_02_base_F {}; + class UAV_02_CAS_base_F; class B_UAV_02_CAS_F: UAV_02_CAS_base_F { displayName = CSTRING(UAV_02_CAS_Name); }; @@ -374,6 +420,17 @@ class CfgVehicles { displayName = CSTRING(UAV_02_CAS_Name); }; + class UAV_02_dynamicLoadout_base_F; + class B_UAV_02_dynamicLoadout_F: UAV_02_dynamicLoadout_base_F { + displayName = CSTRING(UAV_02_Name); + }; + class O_UAV_02_dynamicLoadout_F: UAV_02_dynamicLoadout_base_F { + displayName = CSTRING(UAV_02_Name); + }; + class I_UAV_02_dynamicLoadout_F: UAV_02_dynamicLoadout_base_F { + displayName = CSTRING(UAV_02_Name); + }; + // pistols class Pistol_Base_F; class Weapon_hgun_P07_F: Pistol_Base_F { @@ -513,11 +570,11 @@ class CfgVehicles { class Weapon_SMG_02_F: Weapon_Base_F { displayName = CSTRING(SMG_02_Name); }; - + class Weapon_SMG_05_F: Weapon_Base_F { displayName = CSTRING(SMG_05); }; - + class Weapon_hgun_PDW2000_F: Weapon_Base_F { displayName = CSTRING(hgun_PDW2000_Name); }; diff --git a/addons/realisticnames/CfgWeapons.hpp b/addons/realisticnames/CfgWeapons.hpp index 2654dc0df7..5e0032f780 100644 --- a/addons/realisticnames/CfgWeapons.hpp +++ b/addons/realisticnames/CfgWeapons.hpp @@ -232,9 +232,6 @@ class CfgWeapons { displayName = CSTRING(srifle_DMR_03_woodland); //Mk-I EMR 7.62 mm (Woodland); }; - class srifle_DMR_03_spotter_F: srifle_DMR_03_F { - displayName = CSTRING(srifle_DMR_03_spotter); //NATO DMR (provisional) spotter; - }; class DMR_04_base_F: Rifle_Long_Base_F { displayName = CSTRING(DMR_04); //ASP-1 Kir 12.7 mm; }; @@ -319,7 +316,7 @@ class CfgWeapons { }; }; - class gatling_30mm: CannonCore { // This is a fictional veresion of the GSh-6-30, with 3 barrels + class gatling_30mm_base: CannonCore { // This is a fictional version of the GSh-6-30, with 3 barrels displayName = "GSh-3-30"; class LowROF: Mode_FullAuto { displayName = "GSh-3-30"; @@ -351,7 +348,7 @@ class CfgWeapons { class MissileLauncher; class Missile_AGM_02_Plane_CAS_01_F: MissileLauncher { - displayName = "AGM-65 Maverick"; + displayName = "AGM-65 Maverick G"; }; class Missile_AGM_01_Plane_CAS_02_F: Missile_AGM_02_Plane_CAS_01_F { displayName = "Kh-25MTP"; @@ -586,14 +583,33 @@ class CfgWeapons { class arifle_CTAR_blk_F: arifle_CTAR_base_F { displayName = CSTRING(arifle_CTAR_blk); }; + class arifle_CTAR_ghex_F: arifle_CTAR_base_F { + displayName = CSTRING(arifle_CTAR_ghex); + }; + class arifle_CTAR_hex_F: arifle_CTAR_base_F { + displayName = CSTRING(arifle_CTAR_hex); + }; class arifle_CTAR_GL_base_F; class arifle_CTAR_GL_blk_F: arifle_CTAR_GL_base_F { displayName = CSTRING(arifle_CTAR_GL_blk); }; + class arifle_CTAR_GL_ghex_F: arifle_CTAR_GL_base_F { + displayName = CSTRING(arifle_CTAR_GL_ghex); + }; + class arifle_CTAR_GL_hex_F: arifle_CTAR_GL_base_F { + displayName = CSTRING(arifle_CTAR_GL_hex); + }; + class arifle_CTARS_base_F; class arifle_CTARS_blk_F: arifle_CTARS_base_F { displayName = CSTRING(arifle_CTARS_blk); }; + class arifle_CTARS_ghex_F: arifle_CTARS_base_F { + displayName = CSTRING(arifle_CTARS_ghex); + }; + class arifle_CTARS_hex_F: arifle_CTARS_base_F { + displayName = CSTRING(arifle_CTARS_hex); + }; // QBU-88 class DMR_07_base_F; diff --git a/addons/realisticnames/dev_dumpPylon.sqf b/addons/realisticnames/dev_dumpPylon.sqf new file mode 100644 index 0000000000..df0d7ea4a5 --- /dev/null +++ b/addons/realisticnames/dev_dumpPylon.sqf @@ -0,0 +1,29 @@ +// [] execVM "z\ace\addons\realisticnames\dev_dumpPylon.sqf"; + +private _justLog = true; + +diag_log text format ["[Dumping Pylons] --------------------"]; +private _magazines = configProperties [configFile >> "CfgMagazines", "isClass _x", true]; +{ + private _pylonWeapon = getText (_x >> "pylonWeapon"); + if (_pylonWeapon != "") then { + private _weaponConfig = configFile >> "CfgWeapons" >> _pylonWeapon; + private _weaponName = getText (_weaponConfig >> "displayName"); + private _inherit = (configProperties [_x, "configName _x == 'displayName'", false]) isEqualTo []; + private _pylonMagName = getText (_x >> "displayName"); + if (_justLog) then { + if (!_inherit) then { + diag_log text format ["%1: [%2 vs %3]", configName _x, _pylonMagName, _weaponName]; + } else { + diag_log text format [" - %1: [%2 vs %3]", configName _x, _pylonMagName, _weaponName]; + }; + } else { + if (!_inherit) then { + diag_log text format ['class %1;', configName inheritsFrom _x]; + diag_log text format ['class %1: %2 {', configName _x, configName inheritsFrom _x]; + diag_log text format ['displayName = "%1"; [vanilla: %2 - %3]', _weaponName, _pylonMagName, _pylonWeapon]; + diag_log text format ['};', configName _x, configName inheritsFrom _x, _weaponName, _pylonMagName]; + }; + }; + }; +} forEach _magazines; diff --git a/addons/realisticnames/stringtable.xml b/addons/realisticnames/stringtable.xml index 7517e7b937..1a76b9fa8e 100644 --- a/addons/realisticnames/stringtable.xml +++ b/addons/realisticnames/stringtable.xml @@ -1,4 +1,4 @@ - + @@ -13,6 +13,9 @@ XM312 XM312A XM312 + XM312 + XM312重機槍 + XM312重机枪 XM312A @@ -26,6 +29,9 @@ XM312A XM312A XM312A + XM312A + XM312A重機槍 + XM312A重机枪 XM312 (High) @@ -39,6 +45,9 @@ XM312 (Magasított) XM312 (Alta) XM312 (高) + XM312 (높음) + XM312重機槍 (高射腳架) + XM312重机枪 (高射脚架) XM307 @@ -52,6 +61,9 @@ XM307 XM307 XM307 + XM307 + XM307榴彈機槍 + XM307榴弹机枪 XM307A @@ -65,6 +77,9 @@ XM307A XM307A XM307A + XM307A + XM307A榴彈機槍 + XM307A榴弹机枪 XM307 (High) @@ -78,6 +93,9 @@ XM307 (Magasított) XM307 (Alta) XM307 (高) + XM307 (높음) + XM307榴彈機槍 (高射腳架) + XM307榴弹机枪 (高射脚架) Mini-Spike Launcher (AT) @@ -91,6 +109,9 @@ Mini-Spike rakétarendszer (Tankelhárító) Lanciatore Mini-Spike (AC) ミニスパイク ランチャー (対戦) + Mini-Spike Launcher (대전차) + "迷你長釘"導彈發射器 (反坦克) + "迷你长钉"导弹发射器 (反坦克) Mini-Spike Launcher (AA) @@ -104,6 +125,9 @@ Mini-Spike rakétarendszer (Repülő-elhárító) Lanciatore Mini-Spike (AA) ミニスパイク ランチャー (対空) + Mini-Spike Launcher (대공) + "迷你長釘"導彈發射器 (防空) + "迷你长钉"导弹发射器 (防空) YABHON-R3 @@ -117,6 +141,9 @@ YABHON-R3 YABHON-R3 YABHON-R3 + YABHON-R3 + "亞伯罕-R3型"空中無人載具 + "亚伯罕-R3型"空中无人载具 YABHON-R3 (CAS) @@ -130,6 +157,9 @@ YABHON-R3 (CAS) YABHON-R3 (CAS) YABHON-R3 (対地) + YABHON-R3 (근접지원) + "亞伯罕-R3型"空中無人載具 (近空支援) + "亚伯罕-R3型"空中无人载具 (近空支援) M-ATV @@ -143,6 +173,9 @@ M-ATV M-ATV M-ATV + M-ATV + 防地雷反伏擊全地形車 + 防地雷反伏击全地形车 M-ATV (HMG) @@ -156,6 +189,9 @@ M-ATV (nehézgéppuska) M-ATV (HMG) M-ATV (HMG) + M-ATV (HMG) + 防地雷反伏擊全地形車 (重機槍) + 防地雷反伏击全地形车 (重机枪) M-ATV (GMG) @@ -169,6 +205,9 @@ M-ATV (gránátgéppuska) M-ATV (GMG) M-ATV (GMG) + M-ATV (GMG) + 防地雷反伏擊全地形車 (榴彈機槍) + 防地雷反伏击全地形车 (榴弹机枪) Merkava Mk IV M @@ -182,6 +221,9 @@ Merkava Mk IV M Merkava Mk IV M メルカバ Mk IV M + Merkava Mk IV M + "梅卡瓦4代"主戰坦克 + "梅卡瓦4代"主战坦克 Merkava Mk IV LIC @@ -195,6 +237,9 @@ Merkava Mk IV LIC Merkava Mk IV LIC メルカバ Mk IV LIC + Merkava Mk IV LIC + "梅卡瓦4代"主戰坦克 城市版 + "梅卡瓦4代"主战坦克 城市版 Sholef @@ -208,6 +253,9 @@ Sholef Sholef ショルフ + Sholef + "神槍"自走炮 + "神枪"自走炮 Seara @@ -221,6 +269,9 @@ Seara Seara シアラ + Seara + "希拉"多管火箭車 + "希拉"多管火箭车 Namer @@ -234,6 +285,9 @@ Namer Namer ネイマー + Namer + "花豹"裝甲運兵車 + "花豹"装甲运兵车 Bardelas @@ -247,6 +301,9 @@ Bardelas Bardelas バーラデラス + Bardelas + "布萊德斯"防空車 + "布莱德斯"防空车 Badger IFV @@ -260,6 +317,9 @@ Badger IFV Badger IFV バッジ IFV + Badger IFV + "蜜獾"步兵戰車 + "蜜獾"步兵战车 Nemmera @@ -273,6 +333,9 @@ Nemmera Nemmera ネマラ + Nemmera + "雌豹"戰鬥工程車 + "雌豹"战斗工程车 HEMTT Transport @@ -286,6 +349,9 @@ HEMTT szállítójármű HEMTT da trasporto HEMTT 輸送型 + HEMTT 수송 + 重型增程機動戰術卡車 (運輸) + 重型增程机动战术卡车 (运输) HEMTT Transport (covered) @@ -299,6 +365,9 @@ HEMTT szállítójármű (ponyvás) HEMTT da trasporto (coperto) HEMTT 輸送型 (幌) + HEMTT 수송 (덮개) + 重型增程機動戰術卡車 (運輸, 棚布) + 重型增程机动战术卡车 (运输, 棚布) HEMTT @@ -312,6 +381,9 @@ HEMTT HEMTT HEMTT + HEMTT + 重型增程機動戰術卡車 + 重型增程机动战术卡车 HEMTT Container @@ -325,6 +397,9 @@ HEMTT (konténer) HEMTT portacontainer HEMTT コンテナ型 + HEMTT 컨테이너 + 重型增程機動戰術卡車 (貨櫃) + 重型增程机动战术卡车 (货柜) HEMTT Medical @@ -338,6 +413,9 @@ HEMTT (egészségügyi) HEMTT Medico HEMTT 救急車 + HEMTT 의료 + 重型增程機動戰術卡車 (醫療) + 重型增程机动战术卡车 (医疗) HEMTT Ammo @@ -351,6 +429,9 @@ HEMTT (lőszerszállító) HEMTT di rifornimento munizioni HEMTT 弾薬給弾型 + HEMTT 탄약 + 重型增程機動戰術卡車 (彈藥) + 重型增程机动战术卡车 (弹药) HEMTT Fuel @@ -364,6 +445,9 @@ HEMTT (üzemanyag-szállító) HEMTT di rifornimento carburante HEMTT 燃料給油車 + HEMTT 연료 + 重型增程機動戰術卡車 (燃油) + 重型增程机动战术卡车 (燃油) HEMTT Repair @@ -377,6 +461,9 @@ HEMTT (szerelő-jármű) HEMTT Riparatore HEMTT 修理型 + HEMTT 수리 + 重型增程機動戰術卡車 (維修) + 重型增程机动战术卡车 (维修) Fennek @@ -390,6 +477,9 @@ Fennek Fennek フェネック + Fennek + "非洲小狐"防地雷反伏擊車 + "非洲小狐"防地雷反伏击车 Fennek (HMG) @@ -403,6 +493,9 @@ Fennek (nehézgéppuska) Fennek (HMG) フェネック (HMG) + Fennek (HMG) + "非洲小狐"防地雷反伏擊車 (重機槍) + "非洲小狐"防地雷反伏击车 (重机枪) Fennek (GMG) @@ -416,6 +509,9 @@ Fennek (gránátgéppuska) Fennek (GMG) フェネック (GMG) + Fennek (GMG) + "非洲小狐"防地雷反伏擊車 (榴彈機槍) + "非洲小狐"防地雷反伏击车 (榴弹机枪) Leopard 2SG @@ -429,6 +525,9 @@ Leopard 2SG Leopard 2SG レオパルド 2SG + Leopard 2SG + "豹2型新加坡版"主戰坦克 + "豹2型新加坡版"主战坦克 FV510 Warrior @@ -442,6 +541,9 @@ FV510 Warrior FV510 Warrior FV510 ウォーリアー + FV510 Warrior + FV510"戰士"步兵戰車 + FV510"战士"步兵战车 Pandur II @@ -455,6 +557,9 @@ Pandur II Pandur II パンデュール II + Pandur II + "潘德2型"裝甲運兵車 + "潘德2型"装甲运兵车 KamAZ Transport @@ -468,6 +573,9 @@ KamAZ szállítójármű KamAZ da trasporto KamAZ 輸送型 + KamAZ 수송 + "卡瑪斯"卡車 (運輸) + "卡玛斯"卡车 (运输) KamAZ Transport (covered) @@ -481,6 +589,9 @@ KamAZ szállítójármű (ponyvás) KamAZ da trasporto (coperto) KamAZ 輸送型 (幌) + KamAZ 수송 (덮개) + "卡瑪斯"卡車 (運輸, 棚布) + "卡玛斯"卡车 (运输, 棚布) KamAZ Ammo @@ -494,6 +605,9 @@ KamAZ (lőszerszállító) KamAZ di rifornimento munizioni KamAZ 弾薬給弾型 + KamAZ 탄약 + "卡瑪斯"卡車 (彈藥) + "卡玛斯"卡车 (弹药) KamAZ Fuel @@ -507,6 +621,9 @@ KamAZ (üzemanyag-szállító) KamAZ di rifornimento carburante KamzAZ 燃料給油車 + KamAZ 연료 + "卡瑪斯"卡車 (燃油) + "卡玛斯"卡车 (燃油) KamAZ Repair @@ -520,6 +637,9 @@ KamAZ (szerelő-jármű) KamAZ riparatore KamzAZ 修理型 + KamAZ 수리 + "卡瑪斯"卡車 (維修) + "卡玛斯"卡车 (维修) KamAZ Medical @@ -533,6 +653,9 @@ KamAZ (egészségügyi) KamAZ Medico KamAZ 救急車 + KamAZ 의료 + "卡瑪斯"卡車 (醫療) + "卡玛斯"卡车 (医疗) Punisher @@ -546,6 +669,9 @@ Punisher Punisher パニッシャー + Punisher + "懲罰者"防地雷反伏擊車 + "惩罚者"防地雷反伏击车 Punisher (HMG) @@ -559,6 +685,9 @@ Punisher (nehézgéppuska) Punisher (HMG) パニッシャー (HMG) + Punisher (HMG) + "懲罰者"防地雷反伏擊車 (重機槍) + "惩罚者"防地雷反伏击车 (重机枪) Punisher (GMG) @@ -572,6 +701,9 @@ Punisher (gránátgéppuska) Punisher (GMG) パニッシャー (GMG) + Punisher (GMG) + "懲罰者"防地雷反伏擊車 (榴彈機槍) + "惩罚者"防地雷反伏击车 (榴弹机枪) T100 Black Eagle @@ -585,6 +717,9 @@ T100 Fekete Sas T100 Black Eagle T100 ブラック イーグル + T100 Black Eagle + T100"黑鷹"主戰坦克 + T100"黑鹰"主战坦克 2S9 Sochor @@ -598,6 +733,9 @@ 2S9 Sochor 2S9 Sochor 2S9 ソーカー + 2S9 Sochor + 2S9"薩克爾"自走砲 + 2S9"萨克尔"自走炮 BM-2T Stalker @@ -611,6 +749,9 @@ BM-2T Stalker BM-2T Stalker BM-2T ストーカー + BM-2T Stalker + BM-2T"潛行者"步兵戰車 + BM-2T"潜行者"步兵战车 ZSU-35 Tigris @@ -623,7 +764,10 @@ ZSU-35 Tigris ZSU-35 Tigris ZSU-35 Tigris - ZSU-35 + ZSU-35 ティグリス + ZSU-35 Tigris + ZSU-35"虎式"防空車 + ZSU-35"虎式"防空车 Otokar ARMA @@ -636,7 +780,10 @@ Otokar ARMA Otokar ARMA Otokar ARMA - ティグリスOtokar アルマ + オトカ アルマ + Otokar ARMA + "奧托卡-阿爾默"裝甲運兵車 + "奥托卡-阿尔默"装甲运兵车 Typhoon Transport @@ -649,7 +796,10 @@ Typhoon Transporte Typhoon szállítójármű Typhoon da trasporto - Typhoon 輸送型 + タイフーン 輸送型 + Typhoon 수송 + "颱風"卡車 (運輸) + "台风"卡车 (运输) Typhoon Transport (covered) @@ -662,7 +812,10 @@ Typhoon Transporte (coberto) Typhoon szállítójármű (ponyvás) Typhoon da trasporto (coperto) - Typhoon 輸送型 (幌) + タイフーン 輸送型 (幌) + Typhoon 수송 (덮개) + "颱風"卡車 (運輸, 棚布) + "台风"卡车 (运输, 棚布) Typhoon Device @@ -675,7 +828,10 @@ Typhoon Dispositivo Typhoon (eszköz) Typhoon per dispositivo - Typhoon デバイス型 + タイフーン デバイス型 + Typhoon 장치 + "颱風"卡車 (精密設備) + "台风"卡车 (精密设备) Typhoon Ammo @@ -688,7 +844,10 @@ Typhoon Munições Typhoon (lőszerszállító) Typhoon di rifornimento munizioni - Typhoon 弾薬給弾型 + タイフーン 弾薬給弾型 + Typhoon 탄약 + "颱風"卡車 (彈藥) + "台风"卡车 (弹药) Typhoon Fuel @@ -701,7 +860,10 @@ Typhoon Combustível Typhoon (üzemanyag-szállító) Typhoon di rifornimento carburante - Typhoon 燃料給油車 + タイフーン 燃料給油車 + Typhoon 연료 + "颱風"卡車 (燃油) + "台风"卡车 (燃油) Typhoon Repair @@ -714,7 +876,10 @@ Typhoon Reparador Typhoon (szerelő-jármű) Typhoon riparatore - Typhoon 修理型 + タイフーン 修理型 + Typhoon 수리 + "颱風"卡車 (維修) + "台风"卡车 (维修) Typhoon Medical @@ -727,7 +892,10 @@ Typhoon Médico Typhoon (egészségügyi) Typhoon medico - Typhoon 救急車 + タイフーン 救急車 + Typhoon 의료 + "颱風"卡車 (醫療) + "台风"卡车 (医疗) RAH-66 Comanche @@ -741,6 +909,9 @@ RAH-66 Comanche RAH-66 Comanche RAH-66 コマンチ + RAH-66 Comanche + RAH-66"卡曼契"攻擊直升機 + RAH-66"卡曼契"攻击直升机 MH-6 Little Bird @@ -754,6 +925,9 @@ MH-6 Little Bird MH-6 Little Bird MH-6 リトル バード + MH-6 Little Bird + MH-6"小鳥"運輸直升機 + MH-6"小鸟"运输直升机 AH-6 Little Bird @@ -767,6 +941,9 @@ AH-6 Little Bird AH-6 Little Bird AH-6 リトル バード + AH-6 Little Bird + AH-6"小鳥"武裝直升機 + AH-6"小鸟"武装直升机 CH-47I Chinook @@ -780,6 +957,9 @@ CH-47I Chinook CH-47I Chinook CH-47I チヌーク + CH-47I Chinook + CH-47I"契努克"運輸直升機 + CH-47I"契努克"运输直升机 CH-47I Chinook (unarmed) @@ -793,6 +973,9 @@ CH-47I Chinook (disarmato) CH-47I Chinook (desarmado) CH-47I チヌーク (非武装) + CH-47I Chinook (비무장) + CH-47I"契努克"運輸直升機 (無武裝) + CH-47I"契努克"运输直升机 (无武装) A-10D Thunderbolt II @@ -806,6 +989,9 @@ A-10D Thunderbolt II A-10D Thunderbolt II A-10D サンダーボルト II + A-10D Thunderbolt II + A-10D"雷霆二式"攻擊機 + A-10D"雷霆二式"攻击机 AW159 Wildcat @@ -819,6 +1005,9 @@ AW159 Wildcat AW159 Wildcat AW159 ワイルドキャット + AW159 Wildcat + AW159"野貓"直升機 + AW159"野猫"直升机 AW159 Wildcat (unarmed) @@ -832,6 +1021,9 @@ AW159 Wildcat (fegyvertelen) AW159 Wildcat (disarmato) AW159 ワイルドキャット (非武装) + AW159 Wildcat (비무장) + AW159"野貓"直升機 (無武裝) + AW159"野猫"直升机 (无武装) AW101 Merlin @@ -845,6 +1037,25 @@ AW101 Merlin AW101 Merlin AW101 マーリン + AW101 Merlin + AW101"灰背隼"運輸直升機 + AW101"灰背隼"运输直升机 + + + L-159 ALCA + L-159 ALCA + L-159 ALCA + L-159 ALCA + L-159 ALCA + L-159 ALCA + L-159 Альбатрос + L-159 ALCA + L-159 ALCA + L-159 ALCA + L-159 アルカ + L-159 ALCA + L-159先進輕型戰鬥機 + L-159先进轻型战斗机 L-159 ALCA (CAS) @@ -858,6 +1069,9 @@ L-159 ALCA (Légitámogató) L-159 ALCA (CAS) L-159 アルカ (対地) + L-159 ALCA (근접지원) + L-159先進輕型戰鬥機 (近空支援) + L-159先进轻型战斗机 (近空支援) L-159 ALCA (AA) @@ -871,6 +1085,9 @@ L-159 ALCA (Repülő-elhárító) L-159 ALCA (AA) L-159 アルカ (対空) + L-159 ALCA (대공) + L-159先進輕型戰鬥機 (空對空) + L-159先进轻型战斗机 (空对空) Ka-60 Kasatka @@ -884,6 +1101,9 @@ Ka-60 Kasatka Ka-60 Kasatka Ka-60 カサートカ + Ka-60 Kasatka + Ka-60"逆戟鯨"直升機 + Ka-60"逆戟鲸"直升机 Ka-60 Kasatka (Black & White) @@ -895,7 +1115,10 @@ Ka-60 Kasatka (preto e branco) Ka-60 Касатка (белый и черный) Ka-60 Kasatka (blanco y negro) - Ka-60 カサートカ (黒&白) + Ka-60 カサートカ (黒 & 白) + Ka-60 Kasatka (검정 및 하양) + Ka-60"逆戟鯨"直升機 (黑&白) + Ka-60"逆戟鲸"直升机 (黑&白) Ka-60 Kasatka (unarmed) @@ -909,6 +1132,9 @@ Ka-60 Kasatka (fegyvertelen) Ka-60 Kasatka (disarmato) Ka-60 カサートカ (非武装) + Ka-60 Kasatka (비무장) + Ka-60"逆戟鯨"直升機 (無武裝) + Ka-60"逆戟鲸"直升机 (无武装) Yak-130 @@ -921,7 +1147,10 @@ Yak-130 Jak-130 Yak-130 - Yak-130 ミトン + Yak-130 + Yak-130 + Yak-130"手套"攻擊機 + Yak-130"手套"攻击机 MD 500 @@ -935,6 +1164,9 @@ MD 500 MD 500 MD 500 + MD 500 + MD 500"防衛者"直升機 + MD 500"防卫者"直升机 M4A1 SLAM @@ -948,6 +1180,9 @@ M4A1 SLAM M4A1 SLAM M4A1 SLAM + M4A1 SLAM + M4A1指向性反裝甲地雷 + M4A1指向性反装甲地雷 M18A1 Claymore @@ -961,6 +1196,9 @@ M18A1 Claymore akna M18A1 Claymore Mina antiuomo M18A1 クレイモア + M18A1 클레이모어 + M18A1"闊刀"地雷 + M18A1"阔刀"地雷 M183 Demolition Charge Assembly @@ -974,6 +1212,9 @@ M183 romboló töltet M183 Demolition Charge Assembly M183 梱包爆薬 + M183 폭파 장약 조립 + M183炸藥包 + M183炸药包 M112 Demolition Block @@ -986,7 +1227,10 @@ M112 Carga de Demolição M112 romboló tömb M112 Demolition Block - M113 爆薬ブロック + M112 爆薬ブロック + M112 폭파 블럭 + M112塑性炸藥 + M112塑性炸药 M67 Fragmentation Grenade @@ -1000,6 +1244,9 @@ M67 repeszgránát M67 Granata a frammentazione M67 破片手榴弾 + M67 세열 수류탄 + M67破片手榴彈 + M67破片手榴弹 M83 Smoke Grenade (White) @@ -1013,6 +1260,9 @@ M83 füstgránát (Fehér) M83 Granata fumogena (Bianco) M18 煙幕手榴弾 (白) + M83 연막탄 (하양) + M83煙霧彈 (白色) + M83烟雾弹 (白色) M18 Smoke Grenade (Blue) @@ -1026,6 +1276,9 @@ M18 füstgránát (Kék) M18 Granata fumogena (Blu) M18 煙幕手榴弾 (青) + M18 연막탄 (파랑) + M18煙霧彈 (藍色) + M18烟雾弹 (蓝色) M18 Smoke Grenade (Green) @@ -1039,6 +1292,9 @@ M18 füstgránát (Zöld) M18 Granata fumogena (Verde) M18 煙幕手榴弾 (緑) + M18 연막탄 (초록) + M18煙霧彈 (綠色) + M18烟雾弹 (绿色) M18 Smoke Grenade (Orange) @@ -1052,6 +1308,9 @@ M18 füstgránát (Narancssárga) M18 Granata fumogena (Arancione) M18 煙幕手榴弾 (橙) + M18 연막탄 (주황) + M18煙霧彈 (橘色) + M18烟雾弹 (橘色) M18 Smoke Grenade (Purple) @@ -1065,6 +1324,9 @@ M18 füstgránát (Lila) M18 Granata fumogena (Viola) M18 煙幕手榴弾 (紫) + M18 연막탄 (보라) + M18煙霧彈 (紫色) + M18烟雾弹 (紫色) M18 Smoke Grenade (Red) @@ -1078,6 +1340,9 @@ M18 füstgránát (Piros) M18 Granata fumogena (Rosso) M18 煙幕手榴弾 (赤) + M18 연막탄 (빨강) + M18煙霧彈 (紅色) + M18烟雾弹 (红色) M18 Smoke Grenade (Yellow) @@ -1091,6 +1356,9 @@ M18 füstgránát (Sárga) M18 Granata fumogena (Giallo) M18 煙幕手榴弾 (黄) + M18 연막탄 (노랑) + M18煙霧彈 (黃色) + M18烟雾弹 (黄色) M15 Anti-Tank Mine @@ -1104,6 +1372,9 @@ M15 harckocsiakna M15 Mine anticarro M15 対戦車地雷 + M15 대전차지뢰 + M15反坦克地雷 + M15反坦克地雷 VS-50 Anti-Personnel Mine @@ -1117,6 +1388,9 @@ VS-50 gyalogsági taposóakna VS-50 Mine antiuomo VS-50 対人地雷 + VS-50 대인지뢰 + VS-50反人員地雷 + VS-50反人员地雷 M26 Anti-Personnel Bounding Mine @@ -1130,6 +1404,9 @@ M26 gyalogsági ugróakna M26 Mine saltanti antiuomo M26 対人跳躍地雷 + M26 대인도약지뢰 + M26反人員彈跳雷 + M26反人员弹跳雷 PMR-3 Anti-Personnel Tripwire Mine @@ -1143,6 +1420,9 @@ PMR-3 botlódrótos gyalogsági akna PMR-3 Mine antiuomo PMR-3 仕掛け型対人地雷 + PMR-3 대인인계철선지뢰 + PMR-3反人員絆線雷 + PMR-3反人员绊线雷 P99 @@ -1156,6 +1436,9 @@ P99 P99 P99 + P99 + P99手槍 + P99手枪 MP-443 Grach @@ -1169,6 +1452,9 @@ MP-443 Grach MP-443 Grach MP-433 グラッチ + MP-443 Grach + MP-443"烏鴉"手槍 + MP-443"乌鸦"手枪 Custom Covert II @@ -1182,6 +1468,9 @@ Custom Covert II ACP-C2 カスタム コンバート II + Custom Covert II + 特裝隱蔽Ⅱ型手槍 + 特装隐蔽Ⅱ型手枪 FNX-45 Tactical @@ -1195,6 +1484,9 @@ FNX-45 Tactical FNX-45 Tactical FNX-45 タクティカル + FNX-45 Tactical + FNX-45戰術型手槍 + FNX-45战术型手枪 Chiappa Rhino 60DS @@ -1208,6 +1500,9 @@ Chiappa Rhino 60DS Chiappa Rhino 6DS チアッパ ライノ 60DS + Chiappa Rhino 60DS + 齊亞帕"犀牛"60DS左輪手槍 + 齐亚帕"犀牛"60DS左轮手枪 Taurus Judge @@ -1221,6 +1516,9 @@ Taurus Judge Taurus Judge タウルス ジャッジ + Taurus Judge + 金牛座"法官"信號槍 + 金牛座"法官"信号枪 NLAW @@ -1234,6 +1532,9 @@ NLAW NLAW NLAW + NLAW + 次世代輕型反坦克導彈發射器 + 次世代轻型反坦克导弹发射器 RPG-32 @@ -1247,6 +1548,9 @@ RPG-32 RPG-32 RPG-32 + RPG-32 + RPG-32"哈希姆"火箭發射器 + RPG-32"哈希姆"火箭发射器 Mini-Spike (AA) @@ -1260,6 +1564,9 @@ Mini-Spike (AA) Mini-Spike (AA) ミニスパイク (対空) + Mini-Spike (대공) + "迷你長釘"導彈發射器 (防空) + "迷你长钉"导弹发射器 (防空) Mini-Spike (AT) @@ -1273,6 +1580,9 @@ Mini-Spike (AT) Mini-Spike (AT) ミニスパイク (対地) + Mini-Spike (대전차) + "迷你長釘"導彈發射器 (反坦克) + "迷你长钉"导弹发射器 (反坦克) MX @@ -1286,6 +1596,9 @@ MX MX MX + MX + MX突擊步槍 + MX突击步枪 MX (Black) @@ -1299,6 +1612,9 @@ MX (Preto) MX (Nero) MX (黒) + MX (검정) + MX突擊步槍 (黑色) + MX突击步枪 (黑色) MXC @@ -1312,6 +1628,9 @@ MXC MXC MXC + MXC + MXC卡賓步槍 + MXC卡宾步枪 MXC (Black) @@ -1325,6 +1644,9 @@ MXC (Preto) MXC (Nero) MXC (黒) + MXC (검정) + MXC卡賓步槍 (黑色) + MXC卡宾步枪 (黑色) MX 3GL @@ -1338,6 +1660,9 @@ MX 3GL MX 3GL MX 3GL + MX 3GL + MX突擊步槍 (3連裝榴彈) + MX突击步枪 (3连装榴弹) MX 3GL (Black) @@ -1351,6 +1676,9 @@ MX 3GL (Preto) MX 3GL (Nero) MX 3GL (黒) + MX 3GL (검정) + MX突擊步槍 (3連裝榴彈-黑色) + MX突击步枪 (3连装榴弹-黑色) MX LSW @@ -1364,6 +1692,9 @@ MX LSW MX LSW MX LSW + MX LSW + MX輕型機槍 + MX轻型机枪 MX LSW (Black) @@ -1377,6 +1708,9 @@ MX LSW (Preto) MX LSW (Nero) MX LSW (黒) + MX LSW (검정) + MX輕型機槍 (黑色) + MX轻型机枪 (黑色) MXM @@ -1390,6 +1724,9 @@ MXM MXM MXM + MXM + MXM精準步槍 + MXM精准步枪 MXM (Black) @@ -1403,6 +1740,9 @@ MXM (Preto) MXM (Nero) MXM (黒) + MXM (검정) + MXM精準步槍 (黑色) + MXM精准步枪 (黑色) KH2002 Sama @@ -1416,6 +1756,9 @@ KT2002 Sama KT2002 Katiba KH2002 サマ + KH2002 Sama + KH2002"海白爾"突擊步槍 + KH2002"海白尔"突击步枪 KH2002C Sama @@ -1429,6 +1772,9 @@ KT2002C Sama KT2002C Katiba KH2002C サマ + KH2002C Sama + KH2002C"海白爾"卡賓步槍 + KH2002C"海白尔"卡宾步枪 KH2002 Sama KGL @@ -1442,6 +1788,9 @@ KT2002 Sama KGL KT2002 Katiba KGL KH2002 サマ KGL + KH2002 Sama KGL + KH2002"海白爾"突擊步槍 (榴彈) + KH2002"海白尔"突击步枪 (榴弹) F2000 (Camo) @@ -1455,6 +1804,9 @@ F2000 (Camo) F2000 (Camo) F2000 (迷彩) + F2000 (위장) + F2000突擊步槍 (迷彩) + F2000突击步枪 (迷彩) F2000 @@ -1468,6 +1820,9 @@ F2000 F2000 F2000 + F2000 + F2000突擊步槍 + F2000突击步枪 F2000 Tactical (Camo) @@ -1481,6 +1836,9 @@ F2000 Tactical (Camo) F2000 Tactical (Camo) F2000 タクティカル (迷彩) + F2000 Tactical (위장) + F2000戰術型突擊步槍 (迷彩) + F2000战术型突击步枪 (迷彩) F2000 Tactical @@ -1494,6 +1852,9 @@ F2000 Tactical F2000 Tactical F2000 タクティカル + F2000 Tactical + F2000戰術型突擊步槍 + F2000战术型突击步枪 F2000 EGLM (Camo) @@ -1507,6 +1868,9 @@ F2000 EGLM (Camo) F2000 EGLM (Camo) F2000 EGLM (迷彩) + F2000 EGLM (위장) + F2000突擊步槍 (榴彈-迷彩) + F2000突击步枪 (榴弹-迷彩) F2000 EGLM @@ -1520,6 +1884,9 @@ F2000 EGLM F2000 EGLM F2000 EGLM + F2000 EGLM + F2000突擊步槍 (榴彈) + F2000突击步枪 (榴弹) TAR-21 @@ -1533,6 +1900,9 @@ TAR-21 TAR-21 TAR-21 + TAR-21 + TAR-21突擊步槍 + TAR-21突击步枪 CTAR-21 @@ -1546,6 +1916,9 @@ CTAR-21 CTAR-21 CTAR-21 + CTAR-21 + CTAR-21卡賓步槍 + CTAR-21卡宾步枪 TAR-21 EGLM @@ -1559,6 +1932,9 @@ TAR-21 EGLM TAR-21 EGLM TAR-21 EGLM + TAR-21 EGLM + TAR-21突擊步槍 (榴彈) + TAR-21突击步枪 (榴弹) Vector SMG @@ -1572,6 +1948,9 @@ Vector SMG Vector SMG ベクター SMG + Vector SMG + "維克特"衝鋒槍 + "维克特"冲锋枪 Scorpion Evo 3 A1 @@ -1585,6 +1964,9 @@ Scorpion Evo 3 A1 Scorpion Evo 3 A1 スコーピオン エボ 3 A1 + Scorpion Evo 3 A1 + "蠍式"Evo 3 A1衝鋒槍 + "蝎式"Evo 3 A1冲锋枪 CPW @@ -1598,6 +1980,9 @@ CPW CPW CPW + CPW + 緊湊型個人衝鋒槍 + 紧凑型个人冲锋枪 RFB SDAR @@ -1611,6 +1996,9 @@ RFB SDAR RFB SDAR RFB SDAR + RFB SDAR + 犢牛式水陸兩用步槍 + 犊牛式水陆两用步枪 Stoner 99 LMG @@ -1624,6 +2012,9 @@ Stoner 99 LMG Stoner 99 LMG ストーナー 99 LMG + Stoner 99 LMG + 斯通納99輕機槍 + 斯通纳99轻机枪 Negev NG7 @@ -1637,6 +2028,9 @@ Negev NG7 Negev NG7 ネゲフ NG7 + Negev NG7 + 內蓋夫NG7機槍 + 内盖夫NG7机枪 Mk14 Mod 1 EBR @@ -1650,6 +2044,9 @@ Mk14 Mod 1 EBR Mk14 Mod 1 EBR Mk14 Mod 1 EBR + Mk14 Mod 1 EBR + Mk14一型增強型戰鬥步槍 + Mk14一型增强型战斗步枪 GM6 Lynx @@ -1663,6 +2060,9 @@ GM6 Lynx GM6 Lynx GM6 リンクス + GM6 Lynx + GM6"天貓"反器材狙擊步槍 + GM6"天猫"反器材狙击步枪 GM6 Lynx (Camo) @@ -1676,6 +2076,9 @@ GM6 Lynx (Camo) GM6 Lynx (Camo) GM6 リンクス (迷彩) + GM6 Lynx (위장) + GM6"天貓"反器材狙擊步槍 (迷彩) + GM6"天猫"反器材狙击步枪 (迷彩) M200 Intervention @@ -1689,6 +2092,9 @@ M200 Intervention M200 Intervention M200 インターベンション + M200 Intervention + M200干預型狙擊步槍 + M200干预型狙击步枪 M200 Intervention (Camo) @@ -1702,6 +2108,9 @@ M200 Intervention (Camo) M200 Intervention (Camo) M200 インターベンション (迷彩) + M200 Intervention (위장) + M200干預型狙擊步槍 (迷彩) + M200干预型狙击步枪 (迷彩) VS-121 @@ -1715,6 +2124,9 @@ VS-121 VS-121 VS-121 + VS-121 + VS-121狙擊步槍 + VS-121狙击步枪 Noreen "Bad News" ULR @@ -1728,6 +2140,9 @@ Noreen "Bad News"ULR Noreen "Bad News" ULR ノレーン "バッド ニュース" ULR + Noreen "Bad News" ULR + 諾琳"壞消息"極距狙擊步槍 + 诺琳"坏消息"极距狙击步枪 Noreen "Bad News" ULR (Black) @@ -1741,6 +2156,9 @@ Noreen "Bad News"ULR (Fekete) Noreen "Bad News" ULR (Preto) ノレーン "バッド ニュース" ULR (黒) + Noreen "Bad News" ULR (검정) + 諾琳"壞消息"極距狙擊步槍 (黑色) + 诺琳"坏消息"极距狙击步枪 (黑色) Noreen "Bad News" ULR (Camo) @@ -1754,6 +2172,9 @@ Noreen "Bad News"ULR (Terepmintás) Noreen "Bad News" ULR (Camuflagem) ノレーン "バッド ニュース" ULR (迷彩) + Noreen "Bad News" ULR (위장) + 諾琳"壞消息"極距狙擊步槍 (迷彩) + 诺琳"坏消息"极距狙击步枪 (迷彩) Noreen "Bad News" ULR (Sand) @@ -1767,6 +2188,9 @@ Noreen "Bad News"ULR (Homok) Noreen "Bad News" ULR (Deserto) ノレーン "バッド ニュース" ULR (砂地) + Noreen "Bad News" ULR (모래) + 諾琳"壞消息"極距狙擊步槍 (沙色) + 诺琳"坏消息"极距狙击步枪 (沙色) SIG 556 @@ -1780,6 +2204,9 @@ SIG 556 SIG 556 SIG 556 + SIG 556 + SIG 556精準步槍 + SIG 556精准步枪 SIG 556 (Black) @@ -1793,6 +2220,9 @@ SIG 556 (Fekete) SIG 556 (Preto) SIG 556 (黒) + SIG 556 (검정) + SIG 556精準步槍 (黑色) + SIG 556精准步枪 (黑色) SIG 556 (Khaki) @@ -1806,6 +2236,9 @@ SIG 556 (Khaki) SIG 556 (Caqui) SIG 556 (土埃) + SIG 556 (카키) + SIG 556精準步槍 (卡其色) + SIG 556精准步枪 (卡其色) SIG 556 (Sand) @@ -1819,6 +2252,9 @@ SIG 556 (Homok) SIG 556 (Deserto) SIG 556 (砂地) + SIG 556 (모래) + SIG 556精準步槍 (沙色) + SIG 556精准步枪 (沙色) SIG 556 (Camo) @@ -1832,6 +2268,9 @@ SIG 556 (Terepmintás) SIG 556 (Camuflagem) SIG 556 (迷彩) + SIG 556 (위장) + SIG 556精準步槍 (迷彩) + SIG 556精准步枪 (迷彩) SIG 556 (Woodland) @@ -1845,19 +2284,9 @@ SIG 556 (Erdőmintás) SIG 556 (Floresta) SIG 556 (森林) - - - SIG 556 (provisional) spotter - SIG 556 (provizorní) spotter - SIG 556 (provisoire) Observateur - SIG 556 (provisional) observador - SIG 556 (provisional) корректировщик - SIG 556 (prowizoryczny) obserwator - SIG 556 (provisorisch) Beobachter - SIG 556 (provisional) spotter - SIG 556 (Ellátmányi) Megfigyelő - SIG 556 (provisional) observador - SIG 556 (仮) スポッター + SIG 556 (우드랜드) + SIG 556精準步槍 (森林迷彩) + SIG 556精准步枪 (森林迷彩) ASP-1 Kir @@ -1871,6 +2300,9 @@ ASP-1 Kir ASP-1 Kir ASP-1 Kir + ASP-1 キール + ASP-1"基爾"消音狙擊步槍 + ASP-1"基尔"消音狙击步枪 ASP-1 Kir (Black) @@ -1883,7 +2315,10 @@ ASP-1 Kir (Nero) ASP-1 Kir (Fekete) ASP-1 Kir (Preto) - ASP-1 Kir (黒) + ASP-1 キール (黒) + ASP-1 Kir (검정) + ASP-1"基爾"消音狙擊步槍 (黑色) + ASP-1"基尔"消音狙击步枪 (黑色) ASP-1 Kir (Tan) @@ -1896,7 +2331,10 @@ ASP-1 Kir (Tan) ASP-1 Kir (Cserszín) ASP-1 Kir (Deserto) - ASP-1 Kir (黄褐) + ASP-1 キール (黄褐) + ASP-1 Kir (황갈) + ASP-1"基爾"消音狙擊步槍 (黃褐色) + ASP-1"基尔"消音狙击步枪 (黄褐色) Cyrus @@ -1910,6 +2348,9 @@ Cyrus Cyrus サイラス + Cyrus + "居鲁士"狙擊步槍 + "居鲁士"狙击步枪 Cyrus (Black) @@ -1923,6 +2364,9 @@ Cyrus (Fekete) Cyrus (Preto) サイラス (黒) + Cyrus (검정) + "居鲁士"狙擊步槍 (黑色) + "居鲁士"狙击步枪 (黑色) Cyrus (Hex) @@ -1936,6 +2380,9 @@ Cyrus (Hex) Cyrus (Hex) サイラス (蜂巣) + Cyrus (육각) + "居鲁士"狙擊步槍 (數位蜂巢迷彩) + "居鲁士"狙击步枪 (数位蜂巢迷彩) Cyrus (Tan) @@ -1949,6 +2396,9 @@ Cyrus (Cserszín) Cyrus (Deserto) サイラス (黄褐) + Cyrus (황갈) + "居鲁士"狙擊步槍 (黃褐色) + "居鲁士"狙击步枪 (黄褐色) M14 @@ -1962,6 +2412,9 @@ M14 M14 M14 + M14 + M14精準步槍 + M14精准步枪 M14 (Camo) @@ -1975,6 +2428,9 @@ M14 (Terepmintás) M14 (Camuflagem) M14 (迷彩) + M14 (위장) + M14精準步槍 (迷彩) + M14精准步枪 (迷彩) M14 (Olive) @@ -1988,6 +2444,9 @@ M14 (Olíva) M14 (Oliva) M14 (オリーブド ラブ) + M14 (올리브) + M14精準步槍 (橄欖色) + M14精准步枪 (橄榄色) HK121 @@ -2001,6 +2460,9 @@ HK121 HK121 HK 121 + HK121 + HK121中型機槍 + HK121中型机枪 HK121 (Hex) @@ -2014,6 +2476,9 @@ HK121 (Hex) HK121 (Hex) HK 121 (蜂巣) + HK121 (육각) + HK121中型機槍 (數位蜂巢迷彩) + HK121中型机枪 (数位蜂巢迷彩) HK121 (Tan) @@ -2027,6 +2492,9 @@ HK121 (Cserszín) HK121 (Deserto) HK 121 (黄褐) + HK121 (황갈) + HK121機槍 (黃褐色) + HK121机枪 (黄褐色) LWMMG @@ -2040,6 +2508,9 @@ LWMMG LWMMG LWMMG + LWMMG + 輕量化中型機槍 + 轻量化中型机枪 LWMMG (MTP) @@ -2053,6 +2524,9 @@ LWMMG (MTP) LWMMG (MTP) LWMMG (マルチカモ) + LWMMG (MTP) + 輕量化中型機槍 (多地形迷彩) + 轻量化中型机枪 (多地形迷彩) LWMMG (Black) @@ -2066,6 +2540,9 @@ LWMMG (Fekete) LWMMG (Preto) LWMMG (黒) + LWMMG (검정) + 輕量化中型機槍 (黑色) + 轻量化中型机枪 (黑色) LWMMG (Sand) @@ -2079,6 +2556,9 @@ LWMMG (Homok) LWMMG (Deserto) LWMMG (砂地) + LWMMG (모래) + 輕量化中型機槍 (沙色) + 轻量化中型机枪 (沙色) Jeep Wrangler @@ -2092,6 +2572,9 @@ Jeep Wrangler Jeep Wrangler ジープ ラングラー + Jeep Wrangler + "牧馬人"吉普車 + "牧马人"吉普车 Jeep Wrangler (Black) @@ -2105,6 +2588,9 @@ Jeep Wrangler (Fekete) Jeep Wrangler (Preto) ジープ ラングラー (黒) + Jeep Wrangler (검정) + "牧馬人"吉普車 (黑色) + "牧马人"吉普车 (黑色) Jeep Wrangler (Blue) @@ -2118,6 +2604,9 @@ Jeep Wrangler (Kék) Jeep Wrangler (Blu) ジープ ラングラー (青) + Jeep Wrangler (파랑) + "牧馬人"吉普車 (藍色) + "牧马人"吉普车 (蓝色) Jeep Wrangler (Green) @@ -2131,6 +2620,9 @@ Jeep Wrangler (Zöld) Jeep Wrangler (Verde) ジープ ラングラー (緑) + Jeep Wrangler (초록) + "牧馬人"吉普車 (綠色) + "牧马人"吉普车 (绿色) Jeep Wrangler (Orange) @@ -2144,6 +2636,9 @@ Jeep Wrangler (Narancssárga) Jeep Wrangler (Arancione) ジープ ラングラー (橙) + Jeep Wrangler (주황) + "牧馬人"吉普車 (橘色) + "牧马人"吉普车 (橘色) Jeep Wrangler (Red) @@ -2157,6 +2652,9 @@ Jeep Wrangler (Piros) Jeep Wrangler (Rosso) ジープ ラングラー (赤) + Jeep Wrangler (빨강) + "牧馬人"吉普車 (紅色) + "牧马人"吉普车 (红色) Jeep Wrangler (White) @@ -2170,6 +2668,9 @@ Jeep Wrangler (Fehér) Jeep Wrangler (Bianco) ジープ ラングラー (白) + Jeep Wrangler (하양) + "牧馬人"吉普車 (白色) + "牧马人"吉普车 (白色) Cessna TTx @@ -2183,6 +2684,9 @@ Cessna TTx Cessna TTx セスナ TTx + Cessna TTx + "賽斯納"TTx單引擎飛機 + "赛斯纳"TTx单引擎飞机 Cessna TTx (Racing) @@ -2196,6 +2700,9 @@ Cessna TTx (Racing) Cessna TTx (Racing) セスナ TTx (レース仕様) + Cessna TTx (경주용) + "賽斯納"TTx單引擎飛機 (競速) + "赛斯纳"TTx单引擎飞机 (竞速) Burraq UCAV @@ -2209,6 +2716,9 @@ Burraq UCAV Burraq UCAV ブラーク UCAV + Burraq UCAV + "柏拉格"空中無人戰鬥載具 + "柏拉格"空中无人战斗载具 QBZ-95-1 (Black) @@ -2222,6 +2732,41 @@ QBZ-95-1 (Fekete) QBZ-95-1 (Preto) QBZ-95-1 (黒) + QBZ-95-1 (검정) + QBZ-95-1式自動步槍 (黑色) + QBZ-95-1式自动步枪 (黑色) + + + QBZ-95-1 (Green Hex) + QBZ-95-1 (Hex Grün) + QBZ-95-1 (Hex Verde) + QBZ-95-1 (zielony hex) + QBZ-95-1 (Zelený Hex) + QBZ-95-1 (Hex Verte) + QBZ-95-1 (Зелёный Hex) + QBZ-95-1 (Verde Hex) + QBZ-95-1 (Zöld Hex) + QBZ-95-1 (Hex Verde) + QBZ-95-1 (緑蜂巣) + QBZ-95-1 (초록육각) + QBZ-95-1式自動步槍 (綠色數位蜂巢迷彩) + QBZ-95-1式自动步枪 (绿色数位蜂巢迷彩) + + + QBZ-95-1 (Hex) + QBZ-95-1 (Hex) + QBZ-95-1 (Hex) + QBZ-95-1 (hex) + QBZ-95-1 (Hex) + QBZ-95-1 (Hex) + QBZ-95-1 (Hex) + QBZ-95-1 (Hex) + QBZ-95-1 (Hex) + QBZ-95-1 (Hex) + QBZ-95-1 (蜂巣) + QBZ-95-1 (육각) + QBZ-95-1式自動步槍 (數位蜂巢迷彩) + QBZ-95-1式自动步枪 (数位蜂巢迷彩) QBZ-95-1 GL (Black) @@ -2235,6 +2780,41 @@ QBZ-95-1 GL (Fekete) QBZ-95-1 GL (Preto) QBZ-95-1 GL (黒) + QBZ-95-1 GL (검정) + QBZ-95-1式自動步槍 (榴彈-黑色) + QBZ-95-1式自动步枪 (榴弹-黑色) + + + QBZ-95-1 GL (Green Hex) + QBZ-95-1 GL (Hex Grün) + QBZ-95-1 GL (Hex Verde) + QBZ-95-1 GL (zielony hex) + QBZ-95-1 GL (Zelený Hex) + QBZ-95-1 GL (Hex Verte) + QBZ-95-1 GL (Зелёный Hex) + QBZ-95-1 GL (Verde Hex) + QBZ-95-1 GL (Zöld Hex) + QBZ-95-1 GL (Hex Verde) + QBZ-95-1 GL (緑蜂巣) + QBZ-95-1 GL (초록육각) + QBZ-95-1式自動步槍 (榴彈-綠色數位蜂巢迷彩) + QBZ-95-1式自动步枪 (榴弹-绿色数位蜂巢迷彩) + + + QBZ-95-1 GL (Hex) + QBZ-95-1 GL (Hex) + QBZ-95-1 GL (Hex) + QBZ-95-1 GL (hex) + QBZ-95-1 GL (Hex) + QBZ-95-1 GL (Hex) + QBZ-95-1 GL (Hex) + QBZ-95-1 GL (Hex) + QBZ-95-1 GL (Hex) + QBZ-95-1 GL (Hex) + QBZ-95-1 GL (蜂巣) + QBZ-95-1 GL (육각) + QBZ-95-1式自動步槍 (榴彈-數位蜂巢迷彩) + QBZ-95-1式自动步枪 (榴弹-数位蜂巢迷彩) QBZ-95-1 LSW (Black) @@ -2248,6 +2828,41 @@ QBZ-95-1 LSW (Fekete) QBZ-95-1 LSW (Preto) QBZ-95-1 LSW (黒) + QBZ-95-1 LSW (검정) + QBZ-95-1式輕機槍 (黑色) + QBZ-95-1式轻机枪 (黑色) + + + QBZ-95-1 LSW (Green Hex) + QBZ-95-1 LSW (Hex Grün) + QBZ-95-1 LSW (Hex Verde) + QBZ-95-1 LSW (zielony hex) + QBZ-95-1 LSW (Zelený Hex) + QBZ-95-1 LSW (Hex Verte) + QBZ-95-1 LSW (Зелёный Hex) + QBZ-95-1 LSW (Verde Hex) + QBZ-95-1 LSW (Zöld Hex) + QBZ-95-1 LSW (Hex Verde) + QBZ-95-1 LSW (緑蜂巣) + QBZ-95-1 LSW (초록육각) + QBZ-95-1式輕機槍 (綠色數位蜂巢迷彩) + QBZ-95-1式轻机枪 (绿色数位蜂巢迷彩) + + + QBZ-95-1 LSW (Hex) + QBZ-95-1 LSW (Hex) + QBZ-95-1 LSW (Hex) + QBZ-95-1 LSW (hex) + QBZ-95-1 LSW (Hex) + QBZ-95-1 LSW (Hex) + QBZ-95-1 LSW (Hex) + QBZ-95-1 LSW (Hex) + QBZ-95-1 LSW (Hex) + QBZ-95-1 LSW (Hex) + QBZ-95-1 LSW (蜂巣) + QBZ-95-1 LSW (육각) + QBZ-95-1式輕機槍 (數位蜂巢迷彩) + QBZ-95-1式轻机枪 (数位蜂巢迷彩) QBU-88 (Black) @@ -2261,6 +2876,9 @@ QBU-88 (Fekete) QBU-88 (Preto) QBU-88 (黒) + QBU-88 (검정) + QBU-88式狙擊步槍 (黑色) + QBU-88式狙击步枪 (黑色) QBU-88 (Green Hex) @@ -2274,6 +2892,9 @@ QBU-88 (Zöld Hex) QBU-88 (Hex Verde) QBU-88 (緑蜂巣) + QBU-88 (초록육각) + QBU-88式狙擊步槍 (綠色數位蜂巢迷彩) + QBU-88式狙击步枪 (绿色数位蜂巢迷彩) QBU-88 (Hex) @@ -2287,6 +2908,9 @@ QBU-88 (Hex) QBU-88 (Hex) QBU-88 (蜂巣) + QBU-88 (육각) + QBU-88式狙擊步槍 (數位蜂巢迷彩) + QBU-88式狙击步枪 (数位蜂巢迷彩) GM6 Lynx (Green Hex) @@ -2300,6 +2924,9 @@ GM6 Lynx (Zöld Hex) GM6 Lynx (Hex Verde) GM6 リンクス (緑蜂巣) + GM6 Lynx (초록육각) + GM6"天貓"反器材狙擊步槍 (綠色數位蜂巢迷彩) + GM6"天猫"反器材狙击步枪 (绿色数位蜂巢迷彩) M249 SPW @@ -2313,6 +2940,9 @@ M249 SPW M249 SPW M249 SPW + M249 SPW + M249班用自動機槍 + M249班用自动机枪 M200 Intervention (Tropic) @@ -2326,6 +2956,9 @@ M200 Intervention (Trópico) M200 Intervention (Tropico) M200 インターベンション (熱帯) + M200 Intervention (열대) + M200干預型狙擊步槍 (熱帶迷彩) + M200干预型狙击步枪 (热带迷彩) MP5K @@ -2339,84 +2972,105 @@ MP5K MP5K MP5K + MP5K + MP5K衝鋒槍 + MP5K冲锋枪 - HK416A5 10" (Black) - HK416A5 10" (Černá) - HK416A5 10" (Noir) - HK416A5 10" (Negro) - HK416A5 10" (Чёрный) - HK416A5 10" (czarny) - HK416A5 10" (Schwarz) - HK416A5 10" (Nero) - HK416A5 10" (Fekete) - HK416A5 10" (Preto) - HK416A5 10" (黒) + HK416A5 11" (Black) + HK416A5 11" (Černá) + HK416A5 11" (Noir) + HK416A5 11" (Negro) + HK416A5 11" (Чёрный) + HK416A5 11" (czarny) + HK416A5 11" (Schwarz) + HK416A5 11" (Nero) + HK416A5 11" (Fekete) + HK416A5 11" (Preto) + HK416A5 11" (黒) + HK416A5 11" (검정) + HK416A5 11"突擊步槍 (黑色) + HK416A5 11"突击步枪 (黑色) - HK416A5 10" (Khaki) - HK416A5 10" (Khaki) - HK416A5 10" (Kaki) - HK416A5 10" (Caqui) - HK416A5 10" (Хаки) - HK416A5 10" (khaki) - HK416A5 10" (Khaki) - HK416A5 10" (Khaki) - HK416A5 10" (Khaki) - HK416A5 10" (Caqui) - HK416A5 10" (土埃) + HK416A5 11" (Khaki) + HK416A5 11" (Khaki) + HK416A5 11" (Kaki) + HK416A5 11" (Caqui) + HK416A5 11" (Хаки) + HK416A5 11" (khaki) + HK416A5 11" (Khaki) + HK416A5 11" (Khaki) + HK416A5 11" (Khaki) + HK416A5 11" (Caqui) + HK416A5 11" (土埃) + HK416A5 11" (카키) + HK416A5 11"突擊步槍 (卡其色) + HK416A5 11"突击步枪 (卡其色) - HK416A5 10" (Sand) - HK416A5 10" (Písková) - HK416A5 10" (Beige) - HK416A5 10" (Arena) - HK416A5 10" (Песочный) - HK416A5 10" (Sand) - HK416A5 10" (piaskowy) - HK416A5 10" (Sabbia) - HK416A5 10" (Homok) - HK416A5 10" (Deserto) - HK416A5 10" (砂地) + HK416A5 11" (Sand) + HK416A5 11" (Písková) + HK416A5 11" (Beige) + HK416A5 11" (Arena) + HK416A5 11" (Песочный) + HK416A5 11" (Sand) + HK416A5 11" (piaskowy) + HK416A5 11" (Sabbia) + HK416A5 11" (Homok) + HK416A5 11" (Deserto) + HK416A5 11" (砂地) + HK416A5 11" (모래) + HK416A5 11"突擊步槍 (沙色) + HK416A5 11"突击步枪 (沙色) - HK416A5 10" GL (Black) - HK416A5 10" GL (Černá) - HK416A5 10" GL (Noir) - HK416A5 10" GL (Negro) - HK416A5 10" GL (Чёрный) - HK416A5 10" GL (czarny) - HK416A5 10" GL (Schwarz) - HK416A5 10" GL (Nero) - HK416A5 10" GL (Fekete) - HK416A5 10" GL (Preto) - HK416A5 10" GL (黒) + HK416A5 11" GL (Black) + HK416A5 11" GL (Černá) + HK416A5 11" GL (Noir) + HK416A5 11" GL (Negro) + HK416A5 11" GL (Чёрный) + HK416A5 11" GL (czarny) + HK416A5 11" GL (Schwarz) + HK416A5 11" GL (Nero) + HK416A5 11" GL (Fekete) + HK416A5 11" GL (Preto) + HK416A5 11" GL (黒) + HK416A5 11" GL (검정) + HK416A5 11"突擊步槍 (榴彈-黑色) + HK416A5 11"突击步枪 (榴弹-黑色) - HK416A5 10" GL (Khaki) - HK416A5 10" GL (Khaki) - HK416A5 10" GL (Kaki) - HK416A5 10" GL (Caqui) - HK416A5 10" GL (Хаки) - HK416A5 10" GL (khaki) - HK416A5 10" GL (Khaki) - HK416A5 10" GL (Khaki) - HK416A5 10" GL (Khaki) - HK416A5 10" GL (Caqui) - HK416A5 10" GL (土埃) + HK416A5 11" GL (Khaki) + HK416A5 11" GL (Khaki) + HK416A5 11" GL (Kaki) + HK416A5 11" GL (Caqui) + HK416A5 11" GL (Хаки) + HK416A5 11" GL (khaki) + HK416A5 11" GL (Khaki) + HK416A5 11" GL (Khaki) + HK416A5 11" GL (Khaki) + HK416A5 11" GL (Caqui) + HK416A5 11" GL (土埃) + HK416A5 11" GL (카키) + HK416A5 11"突擊步槍 (榴彈-卡其色) + HK416A5 11"突击步枪 (榴弹-卡其色) - HK416A5 10" GL (Sand) - HK416A5 10" GL (Písková) - HK416A5 10" GL (Beige) - HK416A5 10" GL (Arena) - HK416A5 10" GL (Песочный) - HK416A5 10" GL (Sand) - HK416A5 10" GL (piaskowy) - HK416A5 10" GL (Sabbia) - HK416A5 10" GL (Homok) - HK416A5 10" GL (Deserto) - HK416A5 10" GL (砂地) + HK416A5 11" GL (Sand) + HK416A5 11" GL (Písková) + HK416A5 11" GL (Beige) + HK416A5 11" GL (Arena) + HK416A5 11" GL (Песочный) + HK416A5 11" GL (Sand) + HK416A5 11" GL (piaskowy) + HK416A5 11" GL (Sabbia) + HK416A5 11" GL (Homok) + HK416A5 11" GL (Deserto) + HK416A5 11" GL (砂地) + HK416A5 11" GL (모래) + HK416A5 11"突擊步槍 (榴彈-沙色) + HK416A5 11"突击步枪 (榴弹-沙色) HK416A5 14.5" (Black) @@ -2430,6 +3084,9 @@ HK416A5 14.5" (Fekete) HK416A5 14.5" (Preto) HK416A5 14.5" (黒) + HK416A5 14.5" (검정) + HK416A5 14.5"突擊步槍 (黑色) + HK416A5 14.5"突击步枪 (黑色) HK416A5 14.5" (Khaki) @@ -2443,6 +3100,9 @@ HK416A5 14.5" (Khaki) HK416A5 14.5" (Caqui) HK416A5 14.5" (土埃) + HK416A5 14.5" (카키) + HK416A5 14.5"突擊步槍 (卡其色) + HK416A5 14.5"突击步枪 (卡其色) HK416A5 14.5" (Sand) @@ -2456,6 +3116,9 @@ HK416A5 14.5" (Homok) HK416A5 14.5" (Deserto) HK416A5 14.5" (砂地) + HK416A5 14.5" (모래) + HK416A5 14.5"突擊步槍 (沙色) + HK416A5 14.5"突击步枪 (沙色) HK417A2 20" (Black) @@ -2469,6 +3132,9 @@ HK417A2 20" (Fekete) HK417A2 20" (Preto) HK417A2 20" (黒) + HK417A2 20" (검정) + HK417A2 20"突擊步槍 (黑色) + HK417A2 20"突击步枪 (黑色) HK417A2 20" (Khaki) @@ -2482,6 +3148,9 @@ HK417A2 20" (Khaki) HK417A2 20" (Caqui) HK417A2 20" (土埃) + HK417A2 20" (카키) + HK417A2 20"突擊步槍 (卡其色) + HK417A2 20"突击步枪 (卡其色) HK417A2 20" (Sand) @@ -2494,7 +3163,10 @@ HK417A2 20" (Sabbia) HK417A2 20" (Homok) HK417A2 20" (Deserto) - HK417A2 20'' (砂地) + HK417A2 20" (砂地) + HK417A2 20" (모래) + HK417A2 20"突擊步槍 (沙色) + HK417A2 20"突击步枪 (沙色) RPG-32 (Green Hex) @@ -2508,6 +3180,9 @@ RPG-32 (Zöld Hex) RPG-32 (Hex Verde) RPG-32 (緑蜂巣) + RPG-32 (초록육각) + RPG-32火箭發射器 (綠色數位蜂巢迷彩) + RPG-32火箭发射器 (绿色数位蜂巢迷彩) P99 (Khaki) @@ -2520,7 +3195,10 @@ P99 (Khaki) P99 (Khaki) P99 (Caqui) - P99 (カーキ) + P99 (土埃) + P99 (카키) + P99半自動手槍 (卡其色) + P99半自动手枪 (卡其色) Makarov PM @@ -2534,6 +3212,9 @@ Makarov PM Makarov PM マカロフ PM + Makarov PM + "馬卡洛夫"手槍 + "马卡洛夫"手枪 - \ No newline at end of file + diff --git a/addons/realisticweights/CfgWeapons.hpp b/addons/realisticweights/CfgWeapons.hpp index d84b13ab72..25b83815b4 100644 --- a/addons/realisticweights/CfgWeapons.hpp +++ b/addons/realisticweights/CfgWeapons.hpp @@ -199,7 +199,7 @@ class CfgWeapons { }; // - CZ Scorpion ---------------------------------------------------------- - class SMG_02_base_F: Rifle_Base_F { + class SMG_02_base_F: Rifle_Short_Base_F { class WeaponSlotsInfo; }; class SMG_02_F: SMG_02_base_F { @@ -289,6 +289,16 @@ class CfgWeapons { }; }; + // - Cyrus ------------------------------------------------------ + class DMR_05_base_F: Rifle_Long_Base_F { + class WeaponSlotsInfo; + }; + class srifle_DMR_05_blk_F: DMR_05_base_F { + class WeaponSlotsInfo: WeaponSlotsInfo { + mass = 140; + }; + }; + // - SIG 556 -------------------------------------------------------------- class DMR_03_base_F: Rifle_Long_Base_F { class WeaponSlotsInfo; diff --git a/addons/rearm/ACE_Settings.hpp b/addons/rearm/ACE_Settings.hpp index 798bbd7650..2e0fae277f 100644 --- a/addons/rearm/ACE_Settings.hpp +++ b/addons/rearm/ACE_Settings.hpp @@ -7,4 +7,11 @@ class ACE_Settings { typeName = "SCALAR"; values[] = {CSTRING(RearmSettings_vehicle), CSTRING(RearmSettings_magazine), CSTRING(RearmSettings_caliber)}; }; + class GVAR(supply) { + displayName = CSTRING(RearmSettings_supply_DisplayName); + description = CSTRING(RearmSettings_supply_Description); + value = 0; + typeName = "SCALAR"; + values[] = {CSTRING(RearmSettings_unlimited), CSTRING(RearmSettings_limited), CSTRING(RearmSettings_magazineSupply)}; + }; }; diff --git a/addons/rearm/CfgVehicles.hpp b/addons/rearm/CfgVehicles.hpp index 44b7fe38af..56bf0ec7ba 100644 --- a/addons/rearm/CfgVehicles.hpp +++ b/addons/rearm/CfgVehicles.hpp @@ -1,41 +1,16 @@ - #define MACRO_REARM_ACTIONS \ - class ACE_Actions { \ - class ACE_MainActions { \ - class GVAR(Rearm) { \ - displayName = CSTRING(Rearm); \ - distance = REARM_ACTION_DISTANCE; \ - condition = QUOTE(_this call FUNC(canRearm)); \ - statement = QUOTE(_player call FUNC(rearm)); \ - exceptions[] = {"isNotInside"}; \ - icon = QPATHTOF(ui\icon_rearm_interact.paa); \ - }; \ + class ACE_Actions { \ + class ACE_MainActions { \ + class GVAR(Rearm) { \ + displayName = CSTRING(Rearm); \ + distance = REARM_ACTION_DISTANCE; \ + condition = QUOTE(_this call FUNC(canRearm)); \ + statement = QUOTE(_this call FUNC(rearm)); \ + exceptions[] = {"isNotInside"}; \ + icon = QPATHTOF(ui\icon_rearm_interact.paa); \ }; \ - }; - -#define MACRO_REARM_TRUCK_ACTIONS \ - class ACE_Actions: ACE_Actions { \ - class ACE_MainActions: ACE_MainActions { \ - class GVAR(TakeAmmo) { \ - displayName = CSTRING(TakeAmmo); \ - distance = REARM_ACTION_DISTANCE; \ - condition = QUOTE(_this call FUNC(canTakeAmmo)); \ - insertChildren = QUOTE(_target call FUNC(addRearmActions)); \ - exceptions[] = {"isNotInside"}; \ - showDisabled = 0; \ - priority = 2; \ - icon = QPATHTOF(ui\icon_rearm_interact.paa); \ - }; \ - class GVAR(StoreAmmo) { \ - displayName = CSTRING(StoreAmmo); \ - distance = REARM_ACTION_DISTANCE; \ - condition = QUOTE(_this call FUNC(canStoreAmmo)); \ - statement = QUOTE(_this call FUNC(storeAmmo)); \ - exceptions[] = {"isNotInside"}; \ - icon = QPATHTOF(ui\icon_rearm_interact.paa); \ - }; \ - }; \ - }; + }; \ + }; class CBA_Extended_EventHandlers; @@ -72,6 +47,26 @@ class CfgVehicles { }; }; }; + class supply { + displayName = CSTRING(RearmSettings_supply_DisplayName); + description = CSTRING(RearmSettings_supply_Description); + typeName = "NUMBER"; + class values { + class unlimited { + name = CSTRING(RearmSettings_unlimited); + value = 0; + default = 1; + }; + class magazine { + name = CSTRING(RearmSettings_limited); + value = 1; + }; + class caliber { + name = CSTRING(RearmSettings_magazineSupply); + value = 2; + }; + }; + }; }; class ModuleDescription { description = CSTRING(RearmSettings_Module_Description); @@ -105,66 +100,67 @@ class CfgVehicles { MACRO_REARM_ACTIONS }; - - // Ammo Vehicles (with full inheritance for granted ACE_Actions) - class Car_F: Car {}; - class Truck_F: Car_F {}; - - class Truck_03_base_F: Truck_F {}; + class Truck_03_base_F; class O_Truck_03_ammo_F: Truck_03_base_F { transportAmmo = 0; - MACRO_REARM_TRUCK_ACTIONS + GVAR(defaultSupply) = 1200; }; - class Truck_02_base_F: Truck_F {}; - class Truck_02_Ammo_base_F: Truck_02_base_F {}; - class I_Truck_02_ammo_F: Truck_02_Ammo_base_F { + class Truck_02_base_F; + class Truck_02_Ammo_base_F: Truck_02_base_F { transportAmmo = 0; - MACRO_REARM_TRUCK_ACTIONS - }; - class O_Truck_02_Ammo_F: Truck_02_Ammo_base_F { - transportAmmo = 0; - MACRO_REARM_TRUCK_ACTIONS + GVAR(defaultSupply) = 1200; }; - class Truck_01_base_F: Truck_F {}; - class B_Truck_01_transport_F: Truck_01_base_F {}; - class B_Truck_01_mover_F: B_Truck_01_transport_F {}; + class B_Truck_01_mover_F; class B_Truck_01_ammo_F: B_Truck_01_mover_F { transportAmmo = 0; - MACRO_REARM_TRUCK_ACTIONS + GVAR(defaultSupply) = 1200; }; - class Helicopter_Base_F: Helicopter {}; - class Helicopter_Base_H: Helicopter_Base_F {}; - class Heli_Transport_04_base_F: Helicopter_Base_H {}; + class B_APC_Tracked_01_base_F; + class B_APC_Tracked_01_CRV_F: B_APC_Tracked_01_base_F { + transportAmmo = 0; + GVAR(defaultSupply) = 1200; + }; + + class Heli_Transport_04_base_F; class O_Heli_Transport_04_ammo_F: Heli_Transport_04_base_F { transportAmmo = 0; - MACRO_REARM_TRUCK_ACTIONS + GVAR(defaultSupply) = 1200; }; - class ThingX; - class ReammoBox_F: ThingX { - class ACE_Actions { - class ACE_MainActions {}; - }; - }; - class Slingload_base_F: ReammoBox_F {}; - class Slingload_01_Base_F: Slingload_base_F {}; - - class Pod_Heli_Transport_04_base_F: Slingload_base_F {}; + class Pod_Heli_Transport_04_base_F; class Land_Pod_Heli_Transport_04_ammo_F: Pod_Heli_Transport_04_base_F { transportAmmo = 0; - MACRO_REARM_TRUCK_ACTIONS + GVAR(defaultSupply) = 1200; }; + class Slingload_01_Base_F; class B_Slingload_01_Ammo_F: Slingload_01_Base_F { transportAmmo = 0; - MACRO_REARM_TRUCK_ACTIONS + GVAR(defaultSupply) = 1200; }; + class ReammoBox_F; + class NATO_Box_Base: ReammoBox_F{}; + class Box_NATO_AmmoVeh_F: NATO_Box_Base { + transportAmmo = 0; + GVAR(defaultSupply) = 1200; + }; + class EAST_Box_Base: ReammoBox_F{}; + class Box_East_AmmoVeh_F: EAST_Box_Base { + transportAmmo = 0; + GVAR(defaultSupply) = 1200; + }; + class IND_Box_Base: ReammoBox_F{}; + class Box_IND_AmmoVeh_F: IND_Box_Base { + transportAmmo = 0; + GVAR(defaultSupply) = 1200; + }; // Dummy Vehicles + class ThingX; class GVAR(defaultCarriedObject): ThingX { class EventHandlers { class CBA_Extended_EventHandlers: CBA_Extended_EventHandlers {}; diff --git a/addons/rearm/XEH_PREP.hpp b/addons/rearm/XEH_PREP.hpp index 8e3c10cd2c..05377af37a 100644 --- a/addons/rearm/XEH_PREP.hpp +++ b/addons/rearm/XEH_PREP.hpp @@ -1,26 +1,40 @@ +PREP(addMagazineToSupply); PREP(addRearmActions); +PREP(addVehicleMagazinesToSupply); +PREP(canReadSupplyCounter); PREP(canRearm); PREP(canStoreAmmo); PREP(canTakeAmmo); PREP(createDummy); PREP(disable); PREP(dropAmmo); -PREP(getConfigMagazines); +PREP(getAllRearmTurrets); +PREP(getCaliber); +PREP(getHardpointMagazines); PREP(getMaxMagazines); PREP(getNeedRearmMagazines); +PREP(getSupplyCount); +PREP(getTurretConfigMagazines); +PREP(getTurretMagazineAmmo); PREP(grabAmmo); PREP(handleKilled); PREP(handleUnconscious); +PREP(hasEnoughSupply); +PREP(initSupplyVehicle); PREP(makeDummy); PREP(moduleRearmSettings); PREP(pickUpAmmo); +PREP(readSupplyCounter); PREP(rearm); PREP(rearmEntireVehicle); PREP(rearmEntireVehicleSuccess); PREP(rearmEntireVehicleSuccessLocal); PREP(rearmSuccess); PREP(rearmSuccessLocal); +PREP(removeMagazineFromSupply); +PREP(setSupplyCount); +PREP(setTurretMagazineAmmo); PREP(storeAmmo); PREP(takeAmmo); PREP(takeSuccess); diff --git a/addons/rearm/XEH_postInit.sqf b/addons/rearm/XEH_postInit.sqf index cfbbdf9d4d..1fd9462df8 100644 --- a/addons/rearm/XEH_postInit.sqf +++ b/addons/rearm/XEH_postInit.sqf @@ -1,6 +1,14 @@ #include "script_component.hpp" -["ace_unconscious", {_this call FUNC(handleUnconscious)}] call CBA_fnc_addEventHandler; +GVAR(hardpointGroupsCache) = [] call CBA_fnc_createNamespace; +GVAR(configTypesAdded) = []; +["ace_settingsInitialized", { + TRACE_2("settingsInit",GVAR(level),GVAR(supply)); + ["LandVehicle", "Init", {_this call FUNC(initSupplyVehicle)}, true, ["StaticWeapon"], true] call CBA_fnc_addClassEventHandler; + ["ReammoBox_F", "Init", {_this call FUNC(initSupplyVehicle)}, true, [], true] call CBA_fnc_addClassEventHandler; +}] call CBA_fnc_addEventHandler; + +["ace_unconscious", LINKFUNC(handleUnconscious)] call CBA_fnc_addEventHandler; ["vehicle", { params ["_unit"]; [_unit] call FUNC(dropAmmo); @@ -10,6 +18,9 @@ if (isServer) then { addMissionEventHandler ["HandleDisconnect", {params ["_unit"]; [_unit] call FUNC(dropAmmo)}]; }; -[QGVAR(makeDummyEH), FUNC(makeDummy)] call CBA_fnc_addEventHandler; -[QGVAR(rearmEntireVehicleSuccessLocalEH), FUNC(rearmEntireVehicleSuccessLocal)] call CBA_fnc_addEventHandler; -[QGVAR(rearmSuccessLocalEH), FUNC(rearmSuccessLocal)] call CBA_fnc_addEventHandler; +[QGVAR(makeDummyEH), LINKFUNC(makeDummy)] call CBA_fnc_addEventHandler; +[QGVAR(rearmEntireVehicleSuccessEH), LINKFUNC(rearmEntireVehicleSuccess)] call CBA_fnc_addEventHandler; +[QGVAR(rearmEntireVehicleSuccessLocalEH), LINKFUNC(rearmEntireVehicleSuccessLocal)] call CBA_fnc_addEventHandler; +[QGVAR(rearmSuccessEH), LINKFUNC(rearmSuccess)] call CBA_fnc_addEventHandler; +[QGVAR(rearmSuccessLocalEH), LINKFUNC(rearmSuccessLocal)] call CBA_fnc_addEventHandler; + diff --git a/addons/rearm/XEH_preInit.sqf b/addons/rearm/XEH_preInit.sqf index a7feade1c3..b47cf6628d 100644 --- a/addons/rearm/XEH_preInit.sqf +++ b/addons/rearm/XEH_preInit.sqf @@ -2,6 +2,8 @@ ADDON = false; +PREP_RECOMPILE_START; #include "XEH_PREP.hpp" +PREP_RECOMPILE_END; ADDON = true; diff --git a/addons/rearm/XEH_respawn.sqf b/addons/rearm/XEH_respawn.sqf index 33ac042e7c..5148894f98 100644 --- a/addons/rearm/XEH_respawn.sqf +++ b/addons/rearm/XEH_respawn.sqf @@ -10,4 +10,4 @@ if !(isNull _dummy) then { detach _dummy; deleteVehicle _dummy; }; -_unit setVariable [QGVAR(dummy), nil]; \ No newline at end of file +_unit setVariable [QGVAR(dummy), nil]; diff --git a/addons/rearm/config.cpp b/addons/rearm/config.cpp index a4c130c974..348ca8751b 100644 --- a/addons/rearm/config.cpp +++ b/addons/rearm/config.cpp @@ -20,3 +20,7 @@ class CfgPatches { #include "CfgAmmo.hpp" #include "CfgMagazines.hpp" #include "CfgVehicles.hpp" + +class ACE_Tests { + vehicleTransportAmmo = QPATHTOF(dev\test_debugConfigs.sqf); +}; diff --git a/addons/rearm/dev/test_debugConfigs.sqf b/addons/rearm/dev/test_debugConfigs.sqf new file mode 100644 index 0000000000..8b61bf195f --- /dev/null +++ b/addons/rearm/dev/test_debugConfigs.sqf @@ -0,0 +1,14 @@ +// ["vehicleTransportAmmo"] call ace_common_fnc_runTests; +// execVM "z\ace\addons\rearm\dev\test_debugConfigs.sqf"; + +#include "\z\ace\addons\rearm\script_component.hpp" + +private _testPass = true; + +INFO("Showing CfgVehicles with vanilla transportAmmo"); +{ + WARNING_2("Type [%1] needs config [transportAmmo: %2]", configName _x, getNumber (_x >> 'transportAmmo')); + _testPass = false; +} forEach (configProperties [configFile >> "CfgVehicles", "(isClass _x) && {(getNumber (_x >> 'transportAmmo')) > 0}", true]); + +_testPass diff --git a/addons/rearm/functions/fnc_addMagazineToSupply.sqf b/addons/rearm/functions/fnc_addMagazineToSupply.sqf new file mode 100644 index 0000000000..0a3be574f8 --- /dev/null +++ b/addons/rearm/functions/fnc_addMagazineToSupply.sqf @@ -0,0 +1,72 @@ +/* + * Author: GitHawk + * Adds magazines to the supply. [Global Effects] + * + * Arguments: + * 0: Ammo Truck + * 1: Magazine Classname + * 2: Only partial (default: false) + * + * Return Value: + * None + * + * Example: + * [ammo_truck, "32Rnd_155mm_Mo_shells"] call ace_rearm_fnc_addMagazineToSupply + * + * Public: Yes + */ +#include "script_component.hpp" + +if !(EGVAR(common,settingsInitFinished)) exitWith { // only run this after the settings are initialized + EGVAR(common,runAtSettingsInitialized) pushBack [FUNC(addMagazineToSupply), _this]; +}; + +params [["_truck", objNull, [objNull]], ["_magazineClass", "", [""]], ["_partial", false, [false]]]; +TRACE_3("addMagazineToSupply",_truck,_magazineClass,_partial); + +if (GVAR(supply) == 0) exitWith {WARNING("supply setting is set to unlimited");}; + +if (isNull _truck || {_magazineClass isEqualTo ""}) exitWith {}; + +([_magazineClass] call FUNC(getCaliber)) params ["_cal", "_idx"]; + +// With limited supply, we add the caliber to the supply count +if (GVAR(supply) == 1) then { + private _supply = [_truck] call FUNC(getSupplyCount); + private _amountToAdd = if (!_partial || {GVAR(level) == 1}) then { + _cal + } else { + private _magazinePart = ((REARM_COUNT select _idx) / (getNumber (configFile >> "CfgMagazines" >> _magazineClass >> "count"))) min 1; + _cal * _magazinePart + }; + TRACE_1("Adding",_amountToAdd); + [_truck, (_supply + _amountToAdd)] call FUNC(setSupplyCount); +}; + +// With magazine specific supply, we add or update the magazineSupply array +if (GVAR(supply) == 2) then { + private _magazineSupply = _truck getVariable [QGVAR(magazineSupply), []]; + private _magazineIdx = -1; + { + _x params ["_magazine", "_rounds"]; + if ((_magazine isEqualTo _magazineClass)) exitWith { + _magazineIdx = _forEachIndex; + }; + } forEach _magazineSupply; + + private _roundsPerTransaction = getNumber (configFile >> "CfgMagazines" >> _magazineClass >> "count"); + if (_partial) then { + _roundsPerTransaction = _roundsPerTransaction min (REARM_COUNT select _idx); + }; + if (_magazineIdx == -1) then { + if (_magazineSupply isEqualTo []) then { + _magazineSupply = [[_magazineClass, _roundsPerTransaction]]; + } else { + _magazineSupply append [[_magazineClass, _roundsPerTransaction]]; + } + } else { + (_magazineSupply select _magazineIdx) params ["", "_rounds"]; + _magazineSupply set [_magazineIdx, [_magazineClass, (_rounds + _roundsPerTransaction)]]; + }; + _truck setVariable [QGVAR(magazineSupply), _magazineSupply, true]; +}; diff --git a/addons/rearm/functions/fnc_addRearmActions.sqf b/addons/rearm/functions/fnc_addRearmActions.sqf index db92df470d..b164449575 100644 --- a/addons/rearm/functions/fnc_addRearmActions.sqf +++ b/addons/rearm/functions/fnc_addRearmActions.sqf @@ -3,7 +3,7 @@ * Show the resupplyable ammunition of all surrounding vehicles. * * Arguments: - * 0: Target + * 0: Ammo Truck * * Return Value: * ChildActions @@ -15,77 +15,69 @@ */ #include "script_component.hpp" -private ["_vehicleActions", "_actions", "_action", "_vehicles", "_vehicle", "_needToAdd", "_magazineHelper", "_turretPath", "_magazines", "_magazine", "_icon", "_cnt"]; -params [["_target", objNull, [objNull]]]; +params ["_truck"]; -_vehicles = nearestObjects [_target, ["AllVehicles"], 20]; -if (count _vehicles < 2) exitWith {false}; // Rearming needs at least 2 vehicles +private _vehicles = nearestObjects [_truck, ["AllVehicles"], 20]; +_vehicles = _vehicles select {(_x != _truck) && {!(_x isKindOf "CAManBase")} && {!(_x getVariable [QGVAR(disabled), false])}}; -_vehicleActions = []; +private _vehicleActions = []; { - _actions = []; - _vehicle = _x; - _needToAdd = false; - _action = []; - if !((_vehicle == _target) || (_vehicle isKindOf "CAManBase")) then { - _magazineHelper = []; - { - _turretPath = _x; - _magazines = [_vehicle, _turretPath] call FUNC(getConfigMagazines); - { - _magazine = _x; - _currentMagazines = { _x == _magazine } count (_vehicle magazinesTurret _turretPath); - if ((_currentMagazines < ([_vehicle, _turretPath, _magazine] call FUNC(getMaxMagazines))) && !(_magazine in _magazineHelper)) then { - _action = [_magazine, - getText(configFile >> "CfgMagazines" >> _magazine >> "displayName"), - getText(configFile >> "CfgMagazines" >> _magazine >> "picture"), - {_this call FUNC(takeAmmo)}, - {true}, - {}, - [_magazine, _vehicle]] call EFUNC(interact_menu,createAction); - _actions pushBack [_action, [], _target]; - _magazineHelper pushBack _magazine; - _needToAdd = true; - } else { - if (((_vehicle magazineTurretAmmo [_magazine, _turretPath]) < getNumber (configFile >> "CfgMagazines" >> _magazine >> "count")) && !(_magazine in _magazineHelper)) then { - _action = [_magazine, - getText(configFile >> "CfgMagazines" >> _magazine >> "displayName"), - getText(configFile >> "CfgMagazines" >> _magazine >> "picture"), - {_this call FUNC(takeAmmo)}, - {true}, - {}, - [_magazine, _vehicle]] call EFUNC(interact_menu,createAction); - _actions pushBack [_action, [], _target]; - _magazineHelper pushBack _magazine; - _needToAdd = true; - }; - }; - } forEach _magazines; - } forEach REARM_TURRET_PATHS; - }; - if (_needToAdd && !(_vehicle getVariable [QGVAR(disabled), false])) then { - _icon = getText(configFile >> "CfgVehicles" >> (typeOf _vehicle) >> "Icon"); + private _vehicle = _x; + + // Array of magazines that can be rearmed in the vehicle + private _needRearmMags = ([_vehicle] call FUNC(getNeedRearmMagazines)) apply {_x select 0}; + + // _needRearmMags without duplicates + private _magazineHelper = _needRearmMags arrayIntersect _needRearmMags; + + _magazineHelper = _magazineHelper select {[_truck, _x] call FUNC(hasEnoughSupply)}; + TRACE_2("can add",_x,_magazineHelper); + + if (!(_magazineHelper isEqualTo [])) then { + private _icon = getText(configFile >> "CfgVehicles" >> (typeOf _vehicle) >> "Icon"); if !((_icon select [0, 1]) == "\") then { _icon = ""; }; if (GVAR(level) == 0) then { - _action = [_vehicle, + // [Level 0] adds a single action to rearm the entire vic + private _action = [ + _vehicle, getText(configFile >> "CfgVehicles" >> (typeOf _vehicle) >> "displayName"), _icon, {_this call FUNC(rearmEntireVehicle)}, {true}, {}, - _vehicle] call EFUNC(interact_menu,createAction); - _vehicleActions pushBack [_action, [], _target]; + _vehicle + ] call EFUNC(interact_menu,createAction); + _vehicleActions pushBack [_action, [], _truck]; } else { - _action = [_vehicle, + // [Level 1,2] - Add actions for each magazine + private _actions = []; + { + private _action = [ + _x, + getText(configFile >> "CfgMagazines" >> _x >> "displayName"), + getText(configFile >> "CfgMagazines" >> _x >> "picture"), + {_this call FUNC(takeAmmo)}, + {true}, + {}, + [_x, _vehicle] + ] call EFUNC(interact_menu,createAction); + + _actions pushBack [_action, [], _truck]; + } forEach _magazineHelper; + + private _action = [ + _vehicle, getText(configFile >> "CfgVehicles" >> (typeOf _vehicle) >> "displayName"), _icon, {}, {true}, {}, - []] call EFUNC(interact_menu,createAction); - _vehicleActions pushBack [_action, _actions, _target]; + [] + ] call EFUNC(interact_menu,createAction); + + _vehicleActions pushBack [_action, _actions, _truck]; }; }; } forEach _vehicles; diff --git a/addons/rearm/functions/fnc_addVehicleMagazinesToSupply.sqf b/addons/rearm/functions/fnc_addVehicleMagazinesToSupply.sqf new file mode 100644 index 0000000000..2a8f9fed14 --- /dev/null +++ b/addons/rearm/functions/fnc_addVehicleMagazinesToSupply.sqf @@ -0,0 +1,50 @@ +/* + * Author: GitHawk + * Adds all magazines of a vehicle to the supply. + * + * Arguments: + * 0: Ammo Truck + * 1: Vehicle object or Vehicle class + * + * Return Value: + * None + * + * Example: + * [ammo_truck, tank] call ace_rearm_fnc_addVehicleMagazinesToSupply + * [ammo_truck, "B_MBT_01_arty_F"] call ace_rearm_fnc_addVehicleMagazinesToSupply + * + * Public: Yes + */ +#include "script_component.hpp" + +if !(EGVAR(common,settingsInitFinished)) exitWith { // only run this after the settings are initialized + EGVAR(common,runAtSettingsInitialized) pushBack [FUNC(addVehicleMagazinesToSupply), _this]; +}; + +params [["_truck", objNull, [objNull]], ["_vehicle", objNull, [objNull, ""]]]; +TRACE_2("addVehicleMagazinesToSupply",_truck,_vehicle); + +if (isNull _truck) exitWith {}; +if (_vehicle isEqualType objNull) then {_vehicle = typeOf _vehicle}; +if (_vehicle == "") exitWith { + ERROR_1("VehicleType [%1] is empty in ace_rearm_fnc_addVehicleMagazinesToSupply",_string); +}; +private _turrets = [_vehicle] call FUNC(getAllRearmTurrets); +{ + private _turretPath = _x; + private _magazines = [_vehicle, _turretPath] call FUNC(getTurretConfigMagazines); + TRACE_2("",_turretPath,_magazines); + { + [_truck, _x] call FUNC(addMagazineToSupply); + false + } count _magazines; + false +} count _turrets; + +// 1.70 pylons +private _pylonConfigs = configProperties [configFile >> "CfgVehicles" >> _vehicle >> "Components" >> "TransportPylonsComponent" >> "Pylons", "isClass _x"]; +{ + private _defaultMag = getText (_x >> "attachment"); + TRACE_3("",_defaultMag,configName _x,_forEachIndex); + [_truck, _defaultMag] call FUNC(addMagazineToSupply); +} forEach _pylonConfigs; diff --git a/addons/rearm/functions/fnc_canReadSupplyCounter.sqf b/addons/rearm/functions/fnc_canReadSupplyCounter.sqf new file mode 100644 index 0000000000..60ca21b3f5 --- /dev/null +++ b/addons/rearm/functions/fnc_canReadSupplyCounter.sqf @@ -0,0 +1,28 @@ +/* + * Author: GitHawk + * Checks if unit can read supply counter. [Only for GVAR(supply) > 0] + * + * Arguments: + * 0: Ammo Truck + * 1: Unit + * + * Return Value: + * Can read supply counter + * + * Example: + * [ammo_truck, player] call ace_rearm_fnc_canReadSupplyCounter + * + * Public: No + */ +#include "script_component.hpp" + +params ["_truck", "_unit"]; + +(alive _unit) +&& {_unit isKindOf "CAManBase"} +&& {local _unit} +&& {alive _truck} +&& {(_truck distance _unit) < REARM_ACTION_DISTANCE} +&& {GVAR(supply) > 0} +&& {[_unit, _truck, ["IsNotInside"]] call EFUNC(common,canInteractWith)} // manually added actions need this + diff --git a/addons/rearm/functions/fnc_canRearm.sqf b/addons/rearm/functions/fnc_canRearm.sqf index 202524dd10..236f23e233 100644 --- a/addons/rearm/functions/fnc_canRearm.sqf +++ b/addons/rearm/functions/fnc_canRearm.sqf @@ -3,27 +3,32 @@ * Check if a unit can rearm. * * Arguments: - * 0: Target + * 0: Vehicle * 1: Unit * * Return Value: * Can Rearm * * Example: - * [player, tank] call ace_rearm_fnc_canRearm + * [tank, player] call ace_rearm_fnc_canRearm * * Public: No */ #include "script_component.hpp" -private ["_dummy","_magazineClass"]; -params [["_target", objNull, [objNull]], ["_unit", objNull, [objNull]]]; +params ["_vehicle", "_unit"]; -if (GVAR(level) == 0 || {isNull _unit} || {!(_unit isKindOf "CAManBase")} || {!local _unit} || {_target distance _unit > REARM_ACTION_DISTANCE} || {_target getVariable [QGVAR(disabled), false]}) exitWith {false}; +if (!alive _vehicle) exitWith {false}; +if (GVAR(level) == 0 || {isNull _unit} || {!(_unit isKindOf "CAManBase")} || {!local _unit} || {_vehicle distance _unit > REARM_ACTION_DISTANCE} || {_vehicle getVariable [QGVAR(disabled), false]}) exitWith {false}; -_dummy = _unit getVariable [QGVAR(dummy), objNull]; +private _dummy = _unit getVariable [QGVAR(dummy), objNull]; if (isNull _dummy) exitwith {false}; -_magazineClass = _dummy getVariable QGVAR(magazineClass); +private _magazineClass = _dummy getVariable QGVAR(magazineClass); if (isNil "_magazineClass") exitWith {false}; -([_target, _magazineClass] call FUNC(getNeedRearmMagazines)) select 0 +private _needRearmMags = [_vehicle] call FUNC(getNeedRearmMagazines); + +// Testing if vehicle needs rearm on any magazines of class _magazineClass +private _needsRearm = ({(_x select 0) isEqualTo _magazineClass} count _needRearmMags) > 0; + +_needsRearm diff --git a/addons/rearm/functions/fnc_canStoreAmmo.sqf b/addons/rearm/functions/fnc_canStoreAmmo.sqf index a3139d6f11..4c4989b1d7 100644 --- a/addons/rearm/functions/fnc_canStoreAmmo.sqf +++ b/addons/rearm/functions/fnc_canStoreAmmo.sqf @@ -10,16 +10,18 @@ * Can Store Ammo * * Example: - * [player, tank] call ace_rearm_fnc_canStoreAmmo + * [ammo_truck, player] call ace_rearm_fnc_canStoreAmmo * * Public: No */ #include "script_component.hpp" -params [["_target", objNull, [objNull]], ["_unit", objNull, [objNull]]]; - -!(isNull _unit || - {!(_unit isKindOf "CAManBase")} || - {!local _unit} || - {(_target distance _unit) > REARM_ACTION_DISTANCE} || - {isNull (_unit getVariable [QGVAR(dummy), objNull])}) +params ["_truck", "_unit"]; + +(alive _unit) +&& {_unit isKindOf "CAManBase"} +&& {local _unit} +&& {!isNull (_unit getVariable [QGVAR(dummy), objNull])} +&& {alive _truck} +&& {(_truck distance _unit) < REARM_ACTION_DISTANCE} +&& {[_unit, _truck, ["IsNotInside"]] call EFUNC(common,canInteractWith)} // manually added actions need this diff --git a/addons/rearm/functions/fnc_canTakeAmmo.sqf b/addons/rearm/functions/fnc_canTakeAmmo.sqf index 496e7a12a4..c508df378d 100644 --- a/addons/rearm/functions/fnc_canTakeAmmo.sqf +++ b/addons/rearm/functions/fnc_canTakeAmmo.sqf @@ -10,16 +10,18 @@ * Can Pick Up Ammo * * Example: - * [player, tank] call ace_rearm_fnc_canTakeAmmo + * [ammo_truck, player] call ace_rearm_fnc_canTakeAmmo * * Public: No */ #include "script_component.hpp" -params [["_target", objNull, [objNull]], ["_unit", objNull, [objNull]]]; +params ["_truck", "_unit"]; -!(isNull _unit || - {!(_unit isKindOf "CAManBase")} || - {!local _unit} || - {(_target distance _unit) > REARM_ACTION_DISTANCE} || - {!isNull (_unit getVariable [QGVAR(dummy), objNull])}) +(alive _unit) +&& {_unit isKindOf "CAManBase"} +&& {local _unit} +&& {alive _truck} +&& {(_truck distance _unit) < REARM_ACTION_DISTANCE} +&& {isNull (_unit getVariable [QGVAR(dummy), objNull])} +&& {[_unit, _truck, ["IsNotInside"]] call EFUNC(common,canInteractWith)} // manually added actions need this diff --git a/addons/rearm/functions/fnc_createDummy.sqf b/addons/rearm/functions/fnc_createDummy.sqf index 38955fb806..afca11935f 100644 --- a/addons/rearm/functions/fnc_createDummy.sqf +++ b/addons/rearm/functions/fnc_createDummy.sqf @@ -10,18 +10,17 @@ * Created Dummy * * Example: - * ["500Rnd_127x99_mag_Tracer_Red"] call ace_rearm_fnc_createDummy + * [player, "500Rnd_127x99_mag_Tracer_Red"] call ace_rearm_fnc_createDummy * * Public: No */ #include "script_component.hpp" -private ["_ammo", "_dummyName", "_dummy"]; -params [["_unit", objNull, [objNull]], ["_magazineClass", "", [""]]]; +params ["_unit", "_magazineClass"]; -_ammo = getText (configFile >> "CfgMagazines" >> _magazineClass >> "ammo"); -_dummyName = getText (configFile >> "CfgAmmo" >> _ammo >> QGVAR(dummy)); -_dummy = objNull; +private _ammo = getText (configFile >> "CfgMagazines" >> _magazineClass >> "ammo"); +private _dummyName = getText (configFile >> "CfgAmmo" >> _ammo >> QGVAR(dummy)); +private _dummy = objNull; if !(_dummyName == "") then { _dummy = _dummyName createVehicle (position _unit); } else { @@ -30,4 +29,6 @@ if !(_dummyName == "") then { _dummy allowDamage false; _dummy setVariable [QGVAR(magazineClass), _magazineClass, true]; +TRACE_4("createdDummy",_unit,_magazineClass,_dummyName,_dummy); + _dummy diff --git a/addons/rearm/functions/fnc_disable.sqf b/addons/rearm/functions/fnc_disable.sqf index b5e8b77d04..0bfe9f2b3d 100644 --- a/addons/rearm/functions/fnc_disable.sqf +++ b/addons/rearm/functions/fnc_disable.sqf @@ -1,10 +1,10 @@ /* * Author: GitHawk - * Disables rearm for a vehicle. + * Disables being able to rearm a vehicle's turrets. [Global Effects] * * Arguments: - * 0: Target - * 1: Disable + * 0: Vehicle + * 1: Disable (optional) * * Return Value: * None @@ -17,5 +17,9 @@ */ #include "script_component.hpp" -params [["_target", objNull, [objNull]], ["_disable", true, [true]]]; -_target setVariable [QGVAR(disabled), _disable, true]; +params [ + ["_vehicle", objNull, [objNull]], + ["_disable", true, [true]] +]; + +_vehicle setVariable [QGVAR(disabled), _disable, true]; diff --git a/addons/rearm/functions/fnc_dropAmmo.sqf b/addons/rearm/functions/fnc_dropAmmo.sqf index eafc8bee50..61e744fcf5 100644 --- a/addons/rearm/functions/fnc_dropAmmo.sqf +++ b/addons/rearm/functions/fnc_dropAmmo.sqf @@ -4,8 +4,8 @@ * * Arguments: * 0: Unit - * 1: Delete dummy object (optional) - * 2: Unholster Weapon (optional) + * 1: Delete dummy object (optional) + * 2: Unholster Weapon (optional) * * Return Value: * None @@ -17,12 +17,13 @@ */ #include "script_component.hpp" -private ["_dummy", "_actionID"]; -params [["_unit", objNull, [objNull]], ["_delete", false, [false]], ["_unholster", true, [true]]]; +params [ + "_unit", + ["_delete", false], + ["_unholster", true] +]; -if (isNull _unit) exitWith {}; - -_dummy = _unit getVariable [QGVAR(dummy), objNull]; +private _dummy = _unit getVariable [QGVAR(dummy), objNull]; if !(isNull _dummy) then { detach _dummy; if (_delete) then { @@ -31,9 +32,8 @@ if !(isNull _dummy) then { _dummy setVelocity [0,0,-0.1]; }; _unit setVariable [QGVAR(dummy), objNull]; - //_unit setVariable [QEGVAR(dragging,isCarrying), false, true]; // breaks things, since it hides interact menu on _target }; -_actionID = _unit getVariable [QGVAR(ReleaseActionID), -1]; +private _actionID = _unit getVariable [QGVAR(ReleaseActionID), -1]; if (_actionID != -1) then { _unit removeAction _actionID; _unit setVariable [QGVAR(ReleaseActionID), nil]; diff --git a/addons/rearm/functions/fnc_getAllRearmTurrets.sqf b/addons/rearm/functions/fnc_getAllRearmTurrets.sqf new file mode 100644 index 0000000000..890fe5cc6f --- /dev/null +++ b/addons/rearm/functions/fnc_getAllRearmTurrets.sqf @@ -0,0 +1,28 @@ +/* + * Author: Tuupertunut + * Returns all turrets in a vehicle. + * + * BIS command "allTurrets" does not return the driver turret at the time of writing (2017-07-16). + * This function just adds driver turret to the array returned by "allTurrets". + * + * Arguments: + * 0: Vehicle + * + * Return Value: + * Turret paths + * + * Example: + * [vehicle] call ace_rearm_fnc_getAllRearmTurrets + * + * Public: No + */ +#include "script_component.hpp" + +params ["_vehicle"]; + +private _turrets = allTurrets _vehicle; + +// Adding the driver turret "[-1]". +_turrets pushBack [-1]; + +_turrets diff --git a/addons/rearm/functions/fnc_getCaliber.sqf b/addons/rearm/functions/fnc_getCaliber.sqf new file mode 100644 index 0000000000..87f7b6cd88 --- /dev/null +++ b/addons/rearm/functions/fnc_getCaliber.sqf @@ -0,0 +1,50 @@ +/* + * Author: GitHawk + * Get the caliber of the ammo in a magazine and return its parameters. + * + * Arguments: + * 0: Magazine Classname + * + * Return Value: + * 0: Caliber information + * 0: Rounded caliber + * 1: Caliber index + * + * Example: + * ["500Rnd_127x99_mag_Tracer_Red"] call ace_rearm_fnc_getCaliber + * + * Public: No + */ +#include "script_component.hpp" + +params [ + ["_magazineClass", ""] +]; + +if (_magazineClass isEqualTo "") exitWith {[8, 2]}; + +private _ammo = getText (configFile >> "CfgMagazines" >> _magazineClass >> "ammo"); +private _tmpCal = getNumber (configFile >> "CfgAmmo" >> _ammo >> "ace_caliber"); +private _cal = 8; +if (_tmpCal > 0) then { + _cal = _tmpCal; +} else { + _tmpCal = getNumber (configFile >> "CfgAmmo" >> _ammo >> QGVAR(caliber)); + if (_tmpCal > 0) then { + _cal = _tmpCal; + } else { + diag_log format ["[ACE] ERROR: Undefined Ammo [%1 : %2]", _ammo, inheritsFrom (configFile >> "CfgAmmo" >> _ammo)]; + if (_ammo isKindOf "BulletBase") then { + _cal = 8; + } else { + _cal = 100; + }; + }; +}; +_cal = round _cal; +private _idx = REARM_CALIBERS find _cal; +if (_idx == -1 ) then { + _idx = 2; +}; + +[_cal, _idx] diff --git a/addons/rearm/functions/fnc_getConfigMagazines.sqf b/addons/rearm/functions/fnc_getConfigMagazines.sqf deleted file mode 100644 index dce6c5da64..0000000000 --- a/addons/rearm/functions/fnc_getConfigMagazines.sqf +++ /dev/null @@ -1,53 +0,0 @@ -/* - * Author: GitHawk, Jonpas - * Returns all magazines a turret can hold according to config. - * - * Arguments: - * 0: Target - * 1: Turret Path - * - * Return Value: - * Magazine classes in TurretPath - * - * Example: - * [vehicle, [0]] call ace_rearm_fnc_getConfigMagazines - * - * Public: No - */ -#include "script_component.hpp" - -params [["_target", objNull, [objNull]], ["_turretPath", [], [[]]]]; - -if (isNull _target) exitWith {[]}; - -_cfg = configFile >> "CfgVehicles" >> (typeOf _target) >> "Turrets"; - -if (count _turretPath == 1) then { - _turretPath params ["_subPath"]; - - if (_subPath == -1) exitWith { - _cfg = configFile >> "CfgVehicles" >> (typeOf _target); - }; - - if (count _cfg > _subPath) then { - _cfg = _cfg select _subPath; - } else { - _cfg = nil; - }; -} else { - _turretPath params ["", "_subPath"]; - if (count _cfg > 0) then { - _cfg = (_cfg select 0) >> "Turrets"; - if (count _cfg > _subPath) then { - _cfg = _cfg select _subPath; - } else { - _cfg = nil; - }; - } else { - _cfg = nil; - }; -}; - -if !(isClass _cfg) exitWith {[]}; - -getArray (_cfg >> "magazines") diff --git a/addons/rearm/functions/fnc_getHardpointMagazines.sqf b/addons/rearm/functions/fnc_getHardpointMagazines.sqf new file mode 100644 index 0000000000..61a9591cd7 --- /dev/null +++ b/addons/rearm/functions/fnc_getHardpointMagazines.sqf @@ -0,0 +1,41 @@ +/* + * Author: PabstMirror + * Gets possible magazines that can be added to a pylon. + * + * Arguments: + * 0: Pylon config + * + * Return Value: + * Magazines + * + * Example: + * [config] call ace_rearm_fnc_getHardpointMagazines + * + * Public: No + */ +#include "script_component.hpp" + +ACE_DEPRECATED(QFUNC(getHardpointMagazines),"3.12.0","getCompatiblePylonMagazines"); + +params ["_pylonConfig"]; + +private _return = GVAR(hardpointGroupsCache) getVariable (str _pylonConfig); +if (isNil "_return") then { + _return = []; + private _hardpoints = (getArray (_pylonConfig >> "hardpoints")) apply {toLower _x}; + private _maxWeight = if (isNumber (_pylonConfig >> "maxWeight")) then {getNumber (_pylonConfig >> "maxWeight")} else {1e5}; + private _mags = configProperties [configFile >> "CfgMagazines", "(isClass _x) && {isArray (_x >> 'hardpoints')}"]; + { + if ((getNumber (_x >> "mass")) < _maxWeight) then { + private _magHardpoints = (getArray (_x >> "hardpoints")) apply {toLower _x}; + if (!((_hardpoints arrayIntersect _magHardpoints) isEqualTo [])) then { + _return pushBack configName _x; + }; + }; + } forEach _mags; + if ((str _pylonConfig) != "") then { + GVAR(hardpointGroupsCache) setVariable [(str _pylonConfig), _return]; + }; +}; + +_return; diff --git a/addons/rearm/functions/fnc_getMaxMagazines.sqf b/addons/rearm/functions/fnc_getMaxMagazines.sqf index 4b92431ed9..6eba4e0ecc 100644 --- a/addons/rearm/functions/fnc_getMaxMagazines.sqf +++ b/addons/rearm/functions/fnc_getMaxMagazines.sqf @@ -3,7 +3,7 @@ * Calculates the maximum number of magazines a turret can hold according to config. * * Arguments: - * 0: Target + * 0: Vehicle * 1: Turret Path * 2: Magazine Classname * @@ -17,9 +17,7 @@ */ #include "script_component.hpp" -params [["_target", objNull, [objNull]], ["_turretPath", [], [[]]], ["_magazineClass", "", [""]]]; +params ["_vehicle", "_turretPath", "_magazineClass"]; -if (isNull _target) exitWith {0}; - -private _count = {_x == _magazineClass} count ([_target, _turretPath] call FUNC(getConfigMagazines)); +private _count = {_x == _magazineClass} count ([_vehicle, _turretPath] call FUNC(getTurretConfigMagazines)); _count diff --git a/addons/rearm/functions/fnc_getNeedRearmMagazines.sqf b/addons/rearm/functions/fnc_getNeedRearmMagazines.sqf index f56b437708..b4195bb966 100644 --- a/addons/rearm/functions/fnc_getNeedRearmMagazines.sqf +++ b/addons/rearm/functions/fnc_getNeedRearmMagazines.sqf @@ -1,44 +1,87 @@ /* - * Author: GitHawk, Jonpas - * Get rearm return value. + * Author: Tuupertunut + * Returns information about every magazine that can be rearmed in the vehicle. Multiple mags of + * same class in the same turret are grouped together for practical reasons. * * Arguments: - * 0: Target - * 1: Magazine Classname + * 0: Vehicle * * Return Value: - * Return Value - * 0: Can Rearm - * 1: TurretPath - * 2: Number of current magazines in turret path + * Magazine info + * Child arrays: + * 0: Magazine class + * 1: Turret path + * 2: Is pylon magazine + * 3: Pylon index (-1 if not pylon) + * 4: Max magazines + * 5: Current magazines + * 6: Max rounds per magazine + * 7: Current rounds in magazines * * Example: - * [tank, "mag"] call ace_rearm_fnc_getNeedRearmMagazines + * [tank] call ace_rearm_fnc_getNeedRearmMagazines * * Public: No */ #include "script_component.hpp" -private ["_return", "_magazines", "_currentMagazines"]; -params ["_target", "_magazineClass"]; +params ["_vehicle"]; -_return = [false, [], 0]; +private _magazineInfo = []; + +// 1.70 pylons +private _pylonConfigs = configProperties [configFile >> "CfgVehicles" >> (typeOf _vehicle) >> "Components" >> "TransportPylonsComponent" >> "Pylons", "isClass _x"]; { - _magazines = [_target, _x] call FUNC(getConfigMagazines); + private _pylonConfig = _x; + + // Strangely, a 1-based index. + private _pylonIndex = _forEachIndex + 1; + + // Retrieving pylon magazine by index. If the pylon is empty, it is marked with "". + private _pylonMagazine = (getPylonMagazines _vehicle) select (_pylonIndex - 1); + + // Only care about pylons that have a magazine. + if (!(_pylonMagazine isEqualTo "")) then { + + private _maxRounds = getNumber (configFile >> "CfgMagazines" >> _pylonMagazine >> "count"); + private _currentRounds = _vehicle ammoOnPylon _pylonIndex; + + if (_currentRounds < _maxRounds) then { + // getPylonTurret expects 0 based index, and returns driver turret as [-1] + private _pylonTurret = [_vehicle, (_pylonIndex - 1)] call EFUNC(common,getPylonTurret); - if (_magazineClass in _magazines) then { - _currentMagazines = {_x == _magazineClass} count (_target magazinesTurret _x); - - if ((_target magazineTurretAmmo [_magazineClass, _x]) < getNumber (configFile >> "CfgMagazines" >> _magazineClass >> "count")) exitWith { - _return = [true, _x, _currentMagazines]; - }; - - if (_currentMagazines < ([_target, _x, _magazineClass] call FUNC(getMaxMagazines))) exitWith { - _return = [true, _x, _currentMagazines]; + _magazineInfo pushBack [_pylonMagazine, _pylonTurret, true, _pylonIndex, 1, 1, _maxRounds, [_currentRounds]]; }; }; +} forEach _pylonConfigs; - if (_return select 0) exitWith {}; -} forEach REARM_TURRET_PATHS; +private _turrets = [_vehicle] call FUNC(getAllRearmTurrets); +{ + private _turretPath = _x; + private _magazines = [_vehicle, _turretPath] call FUNC(getTurretConfigMagazines); -_return + // _magazines without duplicates + private _magazineClasses = _magazines arrayIntersect _magazines; + + { + private _magazineClass = _x; + + private _maxMagazines = [_vehicle, _turretPath, _magazineClass] call FUNC(getMaxMagazines); + private _maxRoundsPerMag = getNumber (configFile >> "CfgMagazines" >> _magazineClass >> "count"); + + /* Array of ammo counts in every magazine. Example: [200, 200, 152] means 2 mags with 200 + * rounds and 1 mag with 152 rounds. */ + private _currentRounds = [_vehicle, _turretPath, _magazineClass] call FUNC(getTurretMagazineAmmo); + private _currentMagazines = count _currentRounds; + + /* If there is space for new magazines or if some magazines are not full, add the magazine + * type to _magazineInfo. */ + if ((_currentMagazines < _maxMagazines) || {({_x < _maxRoundsPerMag} count _currentRounds) > 0}) then { + _magazineInfo pushBack [_magazineClass, _turretPath, false, -1, _maxMagazines, _currentMagazines, _maxRoundsPerMag, _currentRounds]; + }; + + } forEach _magazineClasses; +} forEach _turrets; + +TRACE_2("getNeedRearmMagazines",_vehicle,_magazineInfo); +_magazineInfo diff --git a/addons/rearm/functions/fnc_getSupplyCount.sqf b/addons/rearm/functions/fnc_getSupplyCount.sqf new file mode 100644 index 0000000000..082ad7ab5c --- /dev/null +++ b/addons/rearm/functions/fnc_getSupplyCount.sqf @@ -0,0 +1,38 @@ +/* + * Author: GitHawk + * Get the supply count. + * + * Arguments: + * 0: Ammo Truck + * + * Return Value: + * Supply count + * + * Example: + * [ammo_truck] call ace_rearm_fnc_getSupplyCount + * + * Public: Yes + */ +#include "script_component.hpp" + +params [["_truck", objNull, [objNull]]]; + +if (GVAR(supply) != 1) exitWith { + WARNING("supply setting is not set to limited"); // func shouldn't have been called + -1 +}; + +private _supply = _truck getVariable QGVAR(currentSupply); + +if (isNil "_supply") then { + if (isNumber (configFile >> "CfgVehicles" >> typeOf _truck >> QGVAR(defaultSupply))) then { + _supply = getNumber (configFile >> "CfgVehicles" >> typeOf _truck >> QGVAR(defaultSupply)); + } else { + _supply = 1200; + }; + if (_supply > 0) then { + _truck setVariable [QGVAR(currentSupply), _supply, true]; + }; +}; + +_supply diff --git a/addons/rearm/functions/fnc_getTurretConfigMagazines.sqf b/addons/rearm/functions/fnc_getTurretConfigMagazines.sqf new file mode 100644 index 0000000000..0421e1ed1a --- /dev/null +++ b/addons/rearm/functions/fnc_getTurretConfigMagazines.sqf @@ -0,0 +1,19 @@ +/* + * Author: GitHawk, Jonpas + * Returns all magazines a turret of a vehicle object can hold according to config. + * + * Arguments: + * 0: Vehicle object or typeOf + * 1: Turret Path + * + * Return Value: + * Magazine classes in TurretPath + * + * Example: + * [vehicle, [0]] call ace_rearm_fnc_getTurretConfigMagazines + * + * Public: No + */ +#include "script_component.hpp" + +getArray ((_this call CBA_fnc_getTurret) >> "magazines") diff --git a/addons/rearm/functions/fnc_getTurretMagazineAmmo.sqf b/addons/rearm/functions/fnc_getTurretMagazineAmmo.sqf new file mode 100644 index 0000000000..53107dd7b0 --- /dev/null +++ b/addons/rearm/functions/fnc_getTurretMagazineAmmo.sqf @@ -0,0 +1,27 @@ +/* + * Author: Tuupertunut + * Returns the current ammo counts in all magazines of given class in turret. + * + * BIS command "magazineTurretAmmo" is broken at the time of writing (2017-06-24) + * (https://feedback.bistudio.com/T79689). This function is intended as a workaround for it, + * extracting the data from the array returned by "magazinesAllTurrets". + * + * Arguments: + * 0: Vehicle + * 1: Turret Path + * 2: Magazine Classname + * + * Return Value: + * Current ammo counts in magazines. + * + * Example: + * [vehicle, [0], "200Rnd_127x99_mag_Tracer_Red"] call ace_rearm_fnc_getTurretMagazineAmmo + * + * Public: No + */ +#include "script_component.hpp" + +params ["_vehicle", "_turretPath", "_magazineClass"]; + +private _ammo = magazinesAllTurrets _vehicle select {(_x select 0) isEqualTo _magazineClass && {(_x select 1) isEqualTo _turretPath}} apply {_x select 2}; +_ammo diff --git a/addons/rearm/functions/fnc_grabAmmo.sqf b/addons/rearm/functions/fnc_grabAmmo.sqf index 9573ac85a5..105141feda 100644 --- a/addons/rearm/functions/fnc_grabAmmo.sqf +++ b/addons/rearm/functions/fnc_grabAmmo.sqf @@ -16,13 +16,13 @@ */ #include "script_component.hpp" -params [["_dummy", objNull, [objNull]], ["_unit", objNull, [objNull]]]; +params ["_dummy", "_unit"]; -REARM_HOLSTER_WEAPON +REARM_HOLSTER_WEAPON; [_unit, "forceWalk", QGVAR(vehRearm), true] call EFUNC(common,statusEffect_set); [ - 5, + TIME_PROGRESSBAR(5), [_dummy, _unit], { params ["_args"]; diff --git a/addons/rearm/functions/fnc_handleKilled.sqf b/addons/rearm/functions/fnc_handleKilled.sqf index 5f80246f52..b0cdabaed5 100644 --- a/addons/rearm/functions/fnc_handleKilled.sqf +++ b/addons/rearm/functions/fnc_handleKilled.sqf @@ -15,7 +15,7 @@ */ #include "script_component.hpp" -params [["_unit", objNull, [objNull]]]; +params ["_unit"]; if (!local _unit) exitWith {}; diff --git a/addons/rearm/functions/fnc_handleUnconscious.sqf b/addons/rearm/functions/fnc_handleUnconscious.sqf index eab25fcf64..f9d703f4ec 100644 --- a/addons/rearm/functions/fnc_handleUnconscious.sqf +++ b/addons/rearm/functions/fnc_handleUnconscious.sqf @@ -16,7 +16,7 @@ */ #include "script_component.hpp" -params [["_unit", objNull, [objNull]], ["_isUnconscious", false, [false]]]; +params ["_unit", "_isUnconscious"]; if (!local _unit || {!_isUnconscious}) exitWith {}; diff --git a/addons/rearm/functions/fnc_hasEnoughSupply.sqf b/addons/rearm/functions/fnc_hasEnoughSupply.sqf new file mode 100644 index 0000000000..93f1f9ea3a --- /dev/null +++ b/addons/rearm/functions/fnc_hasEnoughSupply.sqf @@ -0,0 +1,50 @@ +/* +* Author: GitHawk +* Check whether enough supply is left to take the magazine. +* +* Arguments: +* 0: Ammo Truck +* 1: Magazine Classname +* +* Return Value: +* Enough supply +* +* Example: +* [ammo_truck, "500Rnd_127x99_mag_Tracer_Red"] call ace_rearm_fnc_hasEnoughSupply +* +* Public: No +*/ +#include "script_component.hpp" + +params ["_truck", "_magazineClass"]; + +// With infinite supply, there is always enough +if (GVAR(supply) == 0) exitWith {true}; + + +// With limited supply, we need to check supply +if (GVAR(supply) == 1) exitWith { + private _supply = [_truck] call FUNC(getSupplyCount); + ([_magazineClass] call FUNC(getCaliber)) params ["_cal", "_idx"]; + + // With caliber based rearming, we only need partial supply + if (GVAR(level) == 2) exitWith { + // If REARM_COUNT is bigger than the magazine size, we might get a bigger number than 1 + private _magazinePart = ((REARM_COUNT select _idx) / (getNumber (configFile >> "CfgMagazines" >> _magazineClass >> "count"))) min 1; + (_cal * _magazinePart <= _supply) + }; + (_cal <= _supply) +}; + + +// With magazine specific supply, we need to check stored magazines +if (GVAR(supply) == 2) exitWith { + private _magazineSupply = _truck getVariable [QGVAR(magazineSupply), []]; + private _magazinePresent = false; + { + _x params ["_magazine", "_rounds"]; + if ((_magazine isEqualTo _magazineClass) && (_rounds > 0)) exitWith {_magazinePresent = true; }; + false + } count _magazineSupply; + _magazinePresent +}; diff --git a/addons/rearm/functions/fnc_initSupplyVehicle.sqf b/addons/rearm/functions/fnc_initSupplyVehicle.sqf new file mode 100644 index 0000000000..ad1b914328 --- /dev/null +++ b/addons/rearm/functions/fnc_initSupplyVehicle.sqf @@ -0,0 +1,76 @@ +/* + * Author: Githawk, PabstMirror + * Adds rearm supply actions to a vehicle or ammo container. + * + * Arguments: + * 0: Object + * + * Return Value: + * None + * + * Example: + * [ammoTruck] call ace_rearm_fnc_initSupplyVehicle; + * + * Public: No + */ +#include "script_component.hpp" + +if (!hasInterface) exitWith {}; // For now we just add actions, so no need non-clients + +params ["_vehicle"]; +private _typeOf = typeOf _vehicle; +TRACE_2("initSupplyVehicle",_vehicle,_typeOf); + +if (!alive _vehicle) exitWith {}; + +private _configSupply = getNumber (configFile >> "CfgVehicles" >> _typeOf >> QGVAR(defaultSupply)); +private _isSupplyVehicle = _vehicle getVariable [QGVAR(isSupplyVehicle), false]; +private _oldRearmConfig = isClass (configFile >> "CfgVehicles" >> _typeOf >> "ACE_Actions" >> "ACE_MainActions" >> QGVAR(takeAmmo)); +TRACE_3("",_configSupply,_isSupplyVehicle,_oldRearmConfig); + +if ((_configSupply <= 0) && {!_isSupplyVehicle} && {!_oldRearmConfig}) exitWith {}; // Ignore if not enabled +if ((_oldRearmConfig || {_configSupply > 0}) && {_typeOf in GVAR(configTypesAdded)}) exitWith {}; // Only add class actions once +if (_oldRearmConfig || {_configSupply > 0}) then {GVAR(configTypesAdded) pushBack _typeOf}; + + +private _actionReadSupplyCounter = [ // GVAR(supply) > 0 + QGVAR(ReadSupplyCounter), + localize LSTRING(ReadSupplyCounter), // Check remaining ammunition + QPATHTOF(ui\icon_rearm_interact.paa), + {_this call FUNC(readSupplyCounter)}, + {_this call FUNC(canReadSupplyCounter)} +] call EFUNC(interact_menu,createAction); + +private _actionTakeAmmo = [ + QGVAR(takeAmmo), + localize ([LSTRING(Rearm), LSTRING(TakeAmmo)] select (GVAR(level) > 0)), + QPATHTOF(ui\icon_rearm_interact.paa), + {}, + {_this call FUNC(canTakeAmmo)}, + {_this call FUNC(addRearmActions)} +] call EFUNC(interact_menu,createAction); + +private _actionStoreAmmo = [ + QGVAR(StoreAmmo), + localize LSTRING(StoreAmmo), // "Store ammo" + QPATHTOF(ui\icon_rearm_interact.paa), + {_this call FUNC(storeAmmo)}, + {_this call FUNC(canStoreAmmo)} +] call EFUNC(interact_menu,createAction); + +if (_oldRearmConfig || {_configSupply > 0}) then { + TRACE_1("Adding Class Actions",_typeOf); + [_typeOf, 0, ["ACE_MainActions"], _actionReadSupplyCounter] call EFUNC(interact_menu,addActionToClass); + if (!_oldRearmConfig) then { + [_typeOf, 0, ["ACE_MainActions"], _actionTakeAmmo] call EFUNC(interact_menu,addActionToClass); + [_typeOf, 0, ["ACE_MainActions"], _actionStoreAmmo] call EFUNC(interact_menu,addActionToClass); + } else { + WARNING_1("Actions already present on [%1]. Old Compat PBO?",_typeOf); + }; +} else { + TRACE_1("Adding Object Actions",_typeOf); + [_vehicle, 0, ["ACE_MainActions"], _actionReadSupplyCounter] call EFUNC(interact_menu,addActionToObject); + [_vehicle, 0, ["ACE_MainActions"], _actionTakeAmmo] call EFUNC(interact_menu,addActionToObject); + [_vehicle, 0, ["ACE_MainActions"], _actionStoreAmmo] call EFUNC(interact_menu,addActionToObject); +}; + diff --git a/addons/rearm/functions/fnc_makeDummy.sqf b/addons/rearm/functions/fnc_makeDummy.sqf index 5c19f8f12d..574944a974 100644 --- a/addons/rearm/functions/fnc_makeDummy.sqf +++ b/addons/rearm/functions/fnc_makeDummy.sqf @@ -16,7 +16,7 @@ */ #include "script_component.hpp" -params [["_obj", objNull, [objNull]], ["_dirAndUp", [[1,0,0],[0,0,1]], [[]]]]; +params ["_obj", "_dirAndUp"]; _obj setVectorDirAndUp _dirAndUp; _obj allowDamage false; diff --git a/addons/rearm/functions/fnc_moduleRearmSettings.sqf b/addons/rearm/functions/fnc_moduleRearmSettings.sqf index af627862da..61b6016c9d 100644 --- a/addons/rearm/functions/fnc_moduleRearmSettings.sqf +++ b/addons/rearm/functions/fnc_moduleRearmSettings.sqf @@ -1,6 +1,6 @@ /* * Author: GitHawk - * Module for adjusting the refuel settings. + * Module for adjusting the rearm settings. * * Arguments: * 0: The module logic @@ -10,17 +10,22 @@ * Return Value: * None * - * Example; + * Example: * function = "ace_rearm_fnc_moduleRearmSettings" * * Public: No */ #include "script_component.hpp" -params ["_logic", "", ["_activated", false, [false]]]; +params [ + "_logic", + "", + ["_activated", false, [false]] +]; if (!_activated) exitWith {}; [_logic, QGVAR(level), "level"] call EFUNC(common,readSettingFromModule); +[_logic, QGVAR(supply), "supply"] call EFUNC(common,readSettingFromModule); -diag_log text format ["[ACE]: Rearm Module Initialized on level: %1", GVAR(level)]; +INFO_2("Module Initialized [level: %1][supply: %2]",GVAR(level),GVAR(supply)); diff --git a/addons/rearm/functions/fnc_pickUpAmmo.sqf b/addons/rearm/functions/fnc_pickUpAmmo.sqf index 653c131586..0f47325a13 100644 --- a/addons/rearm/functions/fnc_pickUpAmmo.sqf +++ b/addons/rearm/functions/fnc_pickUpAmmo.sqf @@ -16,15 +16,15 @@ */ #include "script_component.hpp" -params [["_target", objNull, [objNull]], ["_unit", objNull, [objNull]]]; +params ["_dummy", "_unit"]; -_dummy = _unit getVariable [QGVAR(dummy), objNull]; -if !(isNull _dummy) exitWith {}; +private _attachedDummy = _unit getVariable [QGVAR(dummy), objNull]; +if !(isNull _attachedDummy) exitWith {}; -//_target attachTo [_unit, [0,0.7,0], "pelvis"]; -_target attachTo [_unit, [0,1,0], "pelvis"]; -{ - [QGVAR(makeDummyEH), [_dummy, [[-1,0,0],[0,0,1]]], _x] call CBA_fnc_targetEvent; -} count (position _unit nearObjects ["CAManBase", 100]); -_unit setVariable [QGVAR(dummy), _target]; -//_unit setVariable [QEGVAR(dragging,isCarrying), true, true]; // breaks things, since it hides interact menu on _target +_dummy attachTo [_unit, [0,1,0], "pelvis"]; + +private _nearUnits = _unit nearObjects ["CAManBase", 100]; +// disableCollisionWith damage with the nearby units: +[QGVAR(makeDummyEH), [_dummy, [[-1,0,0],[0,0,1]]], _nearUnits] call CBA_fnc_targetEvent; + +_unit setVariable [QGVAR(dummy), _dummy]; diff --git a/addons/rearm/functions/fnc_readSupplyCounter.sqf b/addons/rearm/functions/fnc_readSupplyCounter.sqf new file mode 100644 index 0000000000..a1b46862b9 --- /dev/null +++ b/addons/rearm/functions/fnc_readSupplyCounter.sqf @@ -0,0 +1,76 @@ +/* + * Author: GitHawk + * Get the remaining ammunition amount. + * + * Arguments: + * 0: Ammo Truck + * 1: Unit + * + * Return Value: + * None + * + * Example: + * [ammo_truck, player] call ace_rearm_fnc_readSupplyCounter + * + * Public: No + */ +#include "script_component.hpp" + +params ["_truck", "_unit"]; +TRACE_2("readSupplyCounter",_truck,_unit); + +if (GVAR(supply) == 0) exitWith {WARNING("Supply is unlimited");}; + +if (GVAR(supply) == 1) then { + [ + TIME_PROGRESSBAR(5), + [_unit, _truck, [_truck] call FUNC(getSupplyCount)], + { + params ["_args"]; + _args params [["_unit", objNull, [objNull]], ["_truck", objNull, [objNull]], ["_supplyCount", 0, [0]]]; + if (_supplyCount > 0 ) then { + [[LSTRING(Hint_RemainingSupplyPoints), _supplyCount], 2, _unit] call EFUNC(common,displayTextStructured); + } else { + [LSTRING(Hint_Empty), 2, _unit] call EFUNC(common,displayTextStructured); + }; + true + }, + {true}, + localize LSTRING(ReadSupplyCounterAction), + {true}, + ["isnotinside"] + ] call EFUNC(common,progressBar); +} else { + [ + TIME_PROGRESSBAR(5), + [_unit, _truck], + { + params ["_args"]; + _args params [["_unit", objNull, [objNull]], ["_truck", objNull, [objNull]]]; + private _supply = 1.5; + private _numChars = count (localize LSTRING(Hint_RemainingAmmo)); + private _text = ""; + private _magazines = _truck getVariable QGVAR(magazineSupply); + if !(isNil "_magazines") then { + { + _x params ["_magazineClass", "_rounds"]; + private _line = format ["%1: %2", getText(configFile >> "CfgMagazines" >> _magazineClass >> "displayName"), _rounds]; + _numChars = _numChars max (count _line); + _text = format ["%1
%2", _text, _line]; + _supply = _supply + 0.5; + false + } count _magazines; + }; + if (_supply > 1.5) then { + [[LSTRING(Hint_RemainingAmmo), _text], _supply, _unit, (_numChars/2.9)] call EFUNC(common,displayTextStructured); + } else { + [LSTRING(Hint_Empty), 2, _unit] call EFUNC(common,displayTextStructured); + }; + true + }, + {true}, + localize LSTRING(ReadSupplyCounterAction), + {true}, + ["isnotinside"] + ] call EFUNC(common,progressBar); +}; diff --git a/addons/rearm/functions/fnc_rearm.sqf b/addons/rearm/functions/fnc_rearm.sqf index 61009b085d..e9d65c43b4 100644 --- a/addons/rearm/functions/fnc_rearm.sqf +++ b/addons/rearm/functions/fnc_rearm.sqf @@ -3,73 +3,54 @@ * Starts progress bar for rearming a vehicle. * * Arguments: - * 0: Unit + * 0: Target Vehicle + * 1: Unit * * Return Value: * None * * Example: - * [player] call ace_rearm_fnc_rearm + * [tank, player] call ace_rearm_fnc_rearm * * Public: No */ #include "script_component.hpp" -private ["_magazineClass", "_ammo", "_tmpCal", "_cal", "_idx", "_needRearmMags", "_magazineDisplayName"]; -params [["_unit", objNull, [objNull]]]; +params ["_target", "_unit"]; +TRACE_2("rearm",_target,_unit); -_dummy = _unit getVariable [QGVAR(dummy), objNull]; -if (isNull _dummy) exitwith {false}; -_magazineClass = _dummy getVariable QGVAR(magazineClass); -if (isNil "_magazineClass") exitWith {false}; +private _attachedDummy = _unit getVariable [QGVAR(dummy), objNull]; +if (isNull _attachedDummy) exitwith {ERROR_1("attachedDummy null",_attachedDummy);}; +private _magazineClass = _attachedDummy getVariable QGVAR(magazineClass); +if (isNil "_magazineClass") exitWith {ERROR_1("magazineClass nil",_attachedDummy);}; -_ammo = getText (configFile >> "CfgMagazines" >> _magazineClass >> "ammo"); -_tmpCal = getNumber (configFile >> "CfgAmmo" >> _ammo >> "ace_caliber"); -_cal = 8; -if (_tmpCal > 0) then { - _cal = _tmpCal; -} else { - _tmpCal = getNumber (configFile >> "CfgAmmo" >> _ammo >> QGVAR(caliber)); - if (_tmpCal > 0) then { - _cal = _tmpCal; - } else { - diag_log format ["[ACE] ERROR: Undefined Ammo [%1 : %2]", _ammo, inheritsFrom (configFile >> "CfgAmmo" >> _ammo)]; - if (_ammo isKindOf "BulletBase") then { - _cal = 8; - } else { - _cal = 100; - }; - }; -}; -_cal = round _cal; -_idx = REARM_CALIBERS find _cal; -if (_idx == -1) then { - _idx = 2; -}; +([_magazineClass] call FUNC(getCaliber)) params ["_cal", "_idx"]; // Get magazines that can be rearmed -_needRearmMags = [_target, _magazineClass] call FUNC(getNeedRearmMagazines); -_needRearmMags params ["_needRearm", "_turretPath", "_cnt"]; +private _needRearmMags = [_target] call FUNC(getNeedRearmMagazines); +private _needRearmMagsOfClass = _needRearmMags select {(_x select 0) isEqualTo _magazineClass}; // Exit if no magazines need rearming -if (!_needRearm) exitWith { - diag_log format ["[ACE] ERROR: Could not find turret for %1 in %2", _magazineClass, typeOf _target]; -}; +if ((count _needRearmMagsOfClass) == 0) exitWith {ERROR_2("Could not find turret for %1 in %2",_magazineClass,typeOf _target);}; -//hint format ["Magazine: %1\nAmmo: %2\nCaliber: %3\nIndex: %4\nTurretPath: %5\nREARM_DURATION_REARM: %6\nCount: %7", _magazine, _ammo, _cal, _idx, _turretPath, (REARM_DURATION_REARM select _idx), (REARM_COUNT select _idx)]; +private _currentRearmableMag = _needRearmMagsOfClass select 0; +_currentRearmableMag params ["", "_turretPath", "", "_pylon", "", "_magazineCount"]; -_magazineDisplayName = getText(configFile >> "CfgMagazines" >> _magazineClass >> "displayName"); +private _magazineDisplayName = getText(configFile >> "CfgMagazines" >> _magazineClass >> "displayName"); if (_magazineDisplayName == "") then { _magazineDisplayName = _magazineClass; - diag_log format ["[ACE] ERROR: Magazine is missing display name [%1]", _magazineClass]; + ERROR_1("Magazine is missing display name [%1]",_magazineClass); }; [ - (REARM_DURATION_REARM select _idx), - [_target, _unit, _turretPath, _cnt, _magazineClass, (REARM_COUNT select _idx)], - FUNC(rearmSuccess), + TIME_PROGRESSBAR(REARM_DURATION_REARM select _idx), + [_target, _unit, _turretPath, _magazineCount, _magazineClass, (REARM_COUNT select _idx), _pylon], + {(_this select 0) call FUNC(rearmSuccess)}, "", format [localize LSTRING(RearmAction), getText(configFile >> "CfgVehicles" >> (typeOf _target) >> "displayName"), _magazineDisplayName], - {true}, + { + param [0] params ["_target", "_unit"]; + (_unit distanceSqr _target) <= REARM_ACTION_DISTANCE_SQR + }, ["isnotinside"] ] call EFUNC(common,progressBar); diff --git a/addons/rearm/functions/fnc_rearmEntireVehicle.sqf b/addons/rearm/functions/fnc_rearmEntireVehicle.sqf index 27fd20c528..47dde150e6 100644 --- a/addons/rearm/functions/fnc_rearmEntireVehicle.sqf +++ b/addons/rearm/functions/fnc_rearmEntireVehicle.sqf @@ -16,14 +16,18 @@ * Public: No */ #include "script_component.hpp" -params [["_target", objNull, [objNull]], ["_unit", objNull, [objNull]], ["_vehicle", objNull, [objNull]]]; // _target is for future possible finite ammo, _unit placeholder + +params ["_truck", "_player", "_vehicle"]; [ - 10, - _vehicle, + TIME_PROGRESSBAR(10), + [_truck, _player, _vehicle], FUNC(rearmEntireVehicleSuccess), "", format [localize LSTRING(BasicRearmAction), getText(configFile >> "CfgVehicles" >> (typeOf _vehicle) >> "displayName")], - {true}, + { + param [0] params ["", "_player", "_vehicle"]; + (_player distanceSqr _vehicle) <= REARM_ACTION_DISTANCE_SQR + }, ["isnotinside"] ] call EFUNC(common,progressBar); diff --git a/addons/rearm/functions/fnc_rearmEntireVehicleSuccess.sqf b/addons/rearm/functions/fnc_rearmEntireVehicleSuccess.sqf index 2eb0b408f9..2ad70f9626 100644 --- a/addons/rearm/functions/fnc_rearmEntireVehicleSuccess.sqf +++ b/addons/rearm/functions/fnc_rearmEntireVehicleSuccess.sqf @@ -3,41 +3,35 @@ * Rearm an entire vehicle. * * Arguments: - * 0: Vehicle + * 0: Rearm information + * 0: Ammo Truck + * 1: Vehicle * * Return Value: * None * * Example: - * [tank] call ace_rearm_fnc_rearmEntireVehicleSuccess + * [[ammo_truck, tank]] call ace_rearm_fnc_rearmEntireVehicleSuccess * * Public: No */ #include "script_component.hpp" -private ["_turretPath", "_magazines", "_magazine", "_currentMagazines", "_maxMagazines", "_maxRounds", "_currentRounds"]; -params [["_vehicle", objNull, [objNull]]]; -TRACE_1("params",_vehicle); +params ["_args"]; +_args params ["_truck", "_vehicle"]; +TRACE_2("rearmEntireVehicleSuccess",_truck,_vehicle); - -//ToDo: Cleanup with CBA_fnc_ownerEvent in CBA 2.4.2 -{ - [QGVAR(rearmEntireVehicleSuccessLocalEH), [_vehicle, _x]] call CBA_fnc_globalEvent; -} forEach REARM_TURRET_PATHS; - - -/* if (isServer) then { + private _turrets = [_vehicle] call FUNC(getAllRearmTurrets); { - _turretOwnerID = _vehicle turretOwner _x; + private _turretOwnerID = _vehicle turretOwner _x; if (_turretOwnerID == 0) then { - //wtf is _truck from??? - [QGVAR(rearmEntireVehicleSuccessLocalEH), [_truck, _vehicle, _x], _truck] call CBA_fnc_targetEvent; + [QGVAR(rearmEntireVehicleSuccessLocalEH), [_truck, _vehicle, _x], [_vehicle]] call CBA_fnc_targetEvent; } else { - [QGVAR(rearmEntireVehicleSuccessLocalEH), [_truck, _vehicle, _x], _turretOwnerID] call CBA_fnc_targetEvent; + [QGVAR(rearmEntireVehicleSuccessLocalEH), [_truck, _vehicle, _x], _turretOwnerID] call CBA_fnc_ownerEvent; }; - } count REARM_TURRET_PATHS; + false + } count _turrets; } else { - [QGVAR(rearmEntireVehicleSuccessLocalEH), _this] call CBA_fnc_serverEvent; + [QGVAR(rearmEntireVehicleSuccessEH), _this] call CBA_fnc_serverEvent; }; -*/ diff --git a/addons/rearm/functions/fnc_rearmEntireVehicleSuccessLocal.sqf b/addons/rearm/functions/fnc_rearmEntireVehicleSuccessLocal.sqf index 7d81aa6345..031c1d1f4d 100644 --- a/addons/rearm/functions/fnc_rearmEntireVehicleSuccessLocal.sqf +++ b/addons/rearm/functions/fnc_rearmEntireVehicleSuccessLocal.sqf @@ -1,48 +1,58 @@ /* - * Author: GitHawk + * Author: Tuupertunut * Rearm an entire turret locally. * * Arguments: - * 0: Vehicle - * 1: TurretPath + * 0: Ammo Truck + * 1: Vehicle + * 2: TurretPath * * Return Value: * None * * Example: - * [tank, [0]] call ace_rearm_fnc_rearmEntireVehicleSuccessLocal + * [ammo_truck, tank, [0]] call ace_rearm_fnc_rearmEntireVehicleSuccessLocal * * Public: No */ #include "script_component.hpp" -private ["_magazines", "_magazine", "_currentMagazines", "_maxMagazines", "_maxRounds", "_currentRounds"]; -params [["_vehicle", objNull, [objNull]], ["_turretPath", [], [[]]]]; -TRACE_2("params",_vehicle,_turretPath); +params ["_truck", "_vehicle", "_turretPath"]; +TRACE_3("rearmEntireVehicleSuccessLocal",_truck,_vehicle,_turretPath); -//ToDo: Cleanup with CBA_fnc_ownerEvent in CBA 2.4.2 -if (!(_vehicle turretLocal _turretPath)) exitWith {TRACE_1("not local turret",_turretPath);}; - -_magazines = [_vehicle, _turretPath] call FUNC(getConfigMagazines); +// Fetching all rearmable magazines in this turret +private _magazines = ([_vehicle] call FUNC(getNeedRearmMagazines)) select {(_x select 1) isEqualTo _turretPath}; { - _magazine = _x; - _currentMagazines = { _x == _magazine } count (_vehicle magazinesTurret _turretPath); - _maxMagazines = [_vehicle, _turretPath, _magazine] call FUNC(getMaxMagazines); - _maxRounds = getNumber (configFile >> "CfgMagazines" >> _magazine >> "count"); - _currentRounds = _vehicle magazineTurretAmmo [_magazine, _turretPath]; - - TRACE_7("Rearmed Turret",_vehicle,_turretPath,_currentMagazines,_maxMagazines,_currentRounds,_maxRounds,_magazine); - - if (_turretPath isEqualTo [-1] && _currentMagazines == 0) then { - // On driver, the empty magazine is still there, but is not returned by magazinesTurret - _currentMagazines = _currentMagazines + 1; - }; - if (_currentMagazines < _maxMagazines) then { - _vehicle setMagazineTurretAmmo [_magazine, _maxRounds, _turretPath]; - for "_idx" from 1 to (_maxMagazines - _currentMagazines) do { - _vehicle addMagazineTurret [_magazine, _turretPath]; + _x params ["_magazineClass", "_magTurretPath", "_isPylonMag", "_pylonIndex", "_maxMagazines", "_currentMagazines", "_maxRoundsPerMag", "_currentRounds"]; + + // Array of planned ammo counts in every magazine after the rearm is complete + private _plannedRounds = +_currentRounds; + + // Trying to fill all existing magazines. + { + if (_x < _maxRoundsPerMag) then { + if ((GVAR(supply) == 0) || {[_truck, _magazineClass, (_maxRoundsPerMag - _x)] call FUNC(removeMagazineFromSupply)}) then { + _plannedRounds set [_forEachIndex, _maxRoundsPerMag]; + }; + }; + } forEach _currentRounds; + + // Trying to add new full magazines, if there is space left. + if (_currentMagazines < _maxMagazines) then { + for "_idx" from 1 to (_maxMagazines - _currentMagazines) do { + if ((GVAR(supply) == 0) || {[_truck, _magazineClass, _maxRoundsPerMag] call FUNC(removeMagazineFromSupply)}) then { + _plannedRounds pushBack _maxRoundsPerMag; + }; }; - } else { - _vehicle setMagazineTurretAmmo [_magazine, _maxRounds, _turretPath]; }; -} foreach _magazines; + + TRACE_2("rearming",_x,_plannedRounds); + + // Updating new ammo counts to vehicle. + if (_isPylonMag) then { + _vehicle setAmmoOnPylon [_pylonIndex, (_plannedRounds select 0)]; + } else { + [_vehicle, _magTurretPath, _magazineClass, _plannedRounds] call FUNC(setTurretMagazineAmmo); + }; +} forEach _magazines; + diff --git a/addons/rearm/functions/fnc_rearmSuccess.sqf b/addons/rearm/functions/fnc_rearmSuccess.sqf index 4a8e4972ed..0fc8219180 100644 --- a/addons/rearm/functions/fnc_rearmSuccess.sqf +++ b/addons/rearm/functions/fnc_rearmSuccess.sqf @@ -1,49 +1,42 @@ /* * Author: GitHawk - * Rearms a vehicle. + * Rearms a vehicle, after progress bar finishes, pass args to machine where turret is local. * * Arguments: - * 0: Params - * 0: Target - * 1: Unit - * 2: Turret Path - * 3: Number of magazines - * 4: Magazine Classname - * 5: Number of rounds + * 0: Vehicle + * 1: Unit + * 2: Turret Path + * 3: Number of magazines + * 4: Magazine Classname + * 5: Number of rounds + * 6: Pylon Index * * Return Value: * None * * Example: - * [[vehicle, player, [-1], 2, "5000Rnd_762x51_Belt", 500]] call ace_rearm_fnc_rearmSuccess + * [vehicle, player, [-1], 2, "5000Rnd_762x51_Belt", 500, -1] call ace_rearm_fnc_rearmSuccess * * Public: No */ #include "script_component.hpp" -private ["_dummy", "_weaponSelect", "_turretOwnerID"]; -params [["_args", [objNull, objNull, [], 0, "", 0], [[]], [6]]]; -_args params ["_target", "_unit", "_turretPath", "_numMagazines", "_magazineClass", "_numRounds"]; -TRACE_6("params",_target,_unit,_turretPath,_numMagazines,_magazineClass,_numRounds); - -//hint format ["Target: %1\nTurretPath: %2\nNumMagazines: %3\nMagazine: %4\nNumRounds: %5", _target, _turretPath, _numMagazines, _magazineClass, _numRounds]; +params ["_vehicle", "_unit", "_turretPath", "_numMagazines", "_magazineClass", "_numRounds", "_pylon"]; +TRACE_7("rearmSuccess",_vehicle,_unit,_turretPath,_numMagazines,_magazineClass,_numRounds,_pylon); if (local _unit) then { [_unit, true, true] call FUNC(dropAmmo); }; -//ToDo: Cleanup with CBA_fnc_ownerEvent in CBA 2.4.2 -[QGVAR(rearmSuccessLocalEH), _this] call CBA_fnc_globalEvent; +if (!alive _vehicle) exitWith {WARNING("vehicle dead/null");}; -/* if (isServer) then { - _turretOwnerID = _target turretOwner _turretPath; + private _turretOwnerID = _vehicle turretOwner _turretPath; if (_turretOwnerID == 0) then { - [QGVAR(rearmSuccessLocalEH), _this, _vehicle] call CBA_fnc_targetEvent; + [QGVAR(rearmSuccessLocalEH), _this, [_vehicle]] call CBA_fnc_targetEvent; } else { - [QGVAR(rearmSuccessLocalEH), _this, _turretOwnerID] call CBA_fnc_targetEvent; + [QGVAR(rearmSuccessLocalEH), _this, _turretOwnerID] call CBA_fnc_ownerEvent; }; } else { - [QGVAR(rearmSuccessLocalEH), _this] call CBA_fnc_serverEvent; + [QGVAR(rearmSuccessEH), _this] call CBA_fnc_serverEvent; }; - */ \ No newline at end of file diff --git a/addons/rearm/functions/fnc_rearmSuccessLocal.sqf b/addons/rearm/functions/fnc_rearmSuccessLocal.sqf index dc4afbc886..5ba5492ad4 100644 --- a/addons/rearm/functions/fnc_rearmSuccessLocal.sqf +++ b/addons/rearm/functions/fnc_rearmSuccessLocal.sqf @@ -3,108 +3,96 @@ * Rearms a vehicle on the turret owner. * * Arguments: - * 0: Params - * 0: Target - * 1: Unit - * 2: Turret Path - * 3: Number of magazines - * 4: Magazine Classname - * 5: Number of rounds + * 0: Vehicle + * 1: Unit + * 2: Turret Path + * 3: Number of magazines + * 4: Magazine Classname + * 5: Number of rounds + * 6: Pylon Index * * Return Value: * None * * Example: - * [[vehicle, player, [-1], 2, "5000Rnd_762x51_Belt", 500]] call ace_rearm_fnc_rearmSuccess + * [vehicle, player, [-1], 2, "5000Rnd_762x51_Belt", 500, ""] call ace_rearm_fnc_rearmSuccessLocal * * Public: No */ #include "script_component.hpp" -private ["_rounds", "_currentRounds", "_maxMagazines", "_currentMagazines", "_dummy", "_weaponSelect"]; -params [["_args", [objNull, objNull, [], 0, "", 0], [[]], [6]]]; -_args params ["_target", "_unit", "_turretPath", "_numMagazines", "_magazineClass", "_numRounds"]; -TRACE_6("params",_target,_unit,_turretPath,_numMagazines,_magazineClass,_numRounds); +params ["_vehicle", "_unit", "_turretPath", "_numMagazines", "_magazineClass", "_numRounds", "_pylon"]; +TRACE_7("rearmSuccessLocal",_vehicle,_unit,_turretPath,_numMagazines,_magazineClass,_numRounds,_pylon); -//ToDo: Cleanup with CBA_fnc_ownerEvent in CBA 2.4.2 -if (!(_target turretLocal _turretPath)) exitWith {TRACE_1("not local turret",_turretPath);}; +private _rounds = getNumber (configFile >> "CfgMagazines" >> _magazineClass >> "count"); -//hint format ["Target: %1\nTurretPath: %2\nNumMagazines: %3\nMagazine: %4\nNumRounds: %5\nUnit: %6", _target, _turretPath, _numMagazines, _magazineClass, _numRounds, _unit]; +if (_pylon > 0) exitWith { + if (_turretPath isEqualTo [-1]) then {_turretPath = [];}; // Convert back to pylon turret format + private _currentCount = _vehicle ammoOnPylon _pylon; + private _newCount = ((_currentCount max 0) + _numRounds) min _rounds; + TRACE_2("",_pylon,_magazineClass,_newCount); + _vehicle setPylonLoadOut [_pylon, _magazineClass, false, _turretPath]; + _vehicle setAmmoOnPylon [_pylon, _newCount]; +}; -_rounds = getNumber (configFile >> "CfgMagazines" >> _magazineClass >> "count"); -_currentRounds = 0; +private _currentRounds = 0; +private _maxMagazines = [_vehicle, _turretPath, _magazineClass] call FUNC(getMaxMagazines); -_maxMagazines = [_target, _turretPath, _magazineClass] call FUNC(getMaxMagazines); if (_maxMagazines == 1) then { - _currentMagazines = { _x == _magazineClass } count (_target magazinesTurret _turretPath); + private _currentMagazines = { _x == _magazineClass } count (_vehicle magazinesTurret _turretPath); if (_currentMagazines == 0 && {!(_turretPath isEqualTo [-1])}) then { // Driver gun will always retain it's magazines - _target addMagazineTurret [_magazineClass, _turretPath]; + _vehicle addMagazineTurret [_magazineClass, _turretPath]; + _vehicle setMagazineTurretAmmo [_magazineClass, 0, _turretPath]; }; if (GVAR(level) == 1) then { // Fill magazine completely - _target setMagazineTurretAmmo [_magazineClass, _rounds, _turretPath]; - [QEGVAR(common,displayTextStructured), - [ - [LSTRING(Hint_RearmedTriple), _rounds, + _vehicle setMagazineTurretAmmo [_magazineClass, _rounds, _turretPath]; + [QEGVAR(common,displayTextStructured), [[LSTRING(Hint_RearmedTriple), _rounds, getText(configFile >> "CfgMagazines" >> _magazineClass >> "displayName"), - getText(configFile >> "CfgVehicles" >> (typeOf _target) >> "displayName")], 3, _unit - ], - [_unit]] call CBA_fnc_targetEvent; + getText(configFile >> "CfgVehicles" >> (typeOf _vehicle) >> "displayName")], 3, _unit], [_unit]] call CBA_fnc_targetEvent; } else { // Fill only at most _numRounds - _target setMagazineTurretAmmo [_magazineClass, ((_target magazineTurretAmmo [_magazineClass, _turretPath]) + _numRounds) min _rounds, _turretPath]; - [QEGVAR(common,displayTextStructured), - [ - [LSTRING(Hint_RearmedTriple), _numRounds, + _vehicle setMagazineTurretAmmo [_magazineClass, ((_vehicle magazineTurretAmmo [_magazineClass, _turretPath]) + _numRounds) min _rounds, _turretPath]; + [QEGVAR(common,displayTextStructured), [[LSTRING(Hint_RearmedTriple), _numRounds, getText(configFile >> "CfgMagazines" >> _magazineClass >> "displayName"), - getText(configFile >> "CfgVehicles" >> (typeOf _target) >> "displayName")], 3, _unit - ], - [_unit]] call CBA_fnc_targetEvent; + getText(configFile >> "CfgVehicles" >> (typeOf _vehicle) >> "displayName")], 3, _unit], [_unit]] call CBA_fnc_targetEvent; }; } else { for "_idx" from 1 to (_maxMagazines+1) do { - _currentRounds = _target magazineTurretAmmo [_magazineClass, _turretPath]; + _currentRounds = _vehicle magazineTurretAmmo [_magazineClass, _turretPath]; if (_currentRounds > 0 || {_idx == (_maxMagazines+1)}) exitWith { if (_idx == (_maxMagazines+1) && {!(_turretPath isEqualTo [-1])}) then { - _target addMagazineTurret [_magazineClass, _turretPath]; + _vehicle addMagazineTurret [_magazineClass, _turretPath]; }; if (GVAR(level) == 2) then { - //hint format ["Target: %1\nTurretPath: %2\nNumMagazines: %3\nMaxMagazines %4\nMagazine: %5\nNumRounds: %6\nMagazine: %7", _target, _turretPath, _numMagazines, _maxMagazines, _currentRounds, _numRounds, _magazineClass]; + //hint format ["Target: %1\nTurretPath: %2\nNumMagazines: %3\nMaxMagazines %4\nMagazine: %5\nNumRounds: %6\nMagazine: %7", _vehicle, _turretPath, _numMagazines, _maxMagazines, _currentRounds, _numRounds, _magazineClass]; // Fill only at most _numRounds if ((_currentRounds + _numRounds) > _rounds) then { - _target setMagazineTurretAmmo [_magazineClass, _rounds, _turretPath]; + _vehicle setMagazineTurretAmmo [_magazineClass, _rounds, _turretPath]; if (_numMagazines < _maxMagazines) then { - _target addMagazineTurret [_magazineClass, _turretPath]; - _target setMagazineTurretAmmo [_magazineClass, _currentRounds + _numRounds - _rounds, _turretPath]; + _vehicle addMagazineTurret [_magazineClass, _turretPath]; + _vehicle setMagazineTurretAmmo [_magazineClass, _currentRounds + _numRounds - _rounds, _turretPath]; }; } else { - _target setMagazineTurretAmmo [_magazineClass, _currentRounds + _numRounds, _turretPath]; + _vehicle setMagazineTurretAmmo [_magazineClass, _currentRounds + _numRounds, _turretPath]; }; - [QEGVAR(common,displayTextStructured), - [ - [LSTRING(Hint_RearmedTriple), _numRounds, + [QEGVAR(common,displayTextStructured), [[LSTRING(Hint_RearmedTriple), _numRounds, getText(configFile >> "CfgMagazines" >> _magazineClass >> "displayName"), - getText(configFile >> "CfgVehicles" >> (typeOf _target) >> "displayName")], 3, _unit - ], - [_unit]] call CBA_fnc_targetEvent; + getText(configFile >> "CfgVehicles" >> (typeOf _vehicle) >> "displayName")], 3, _unit], [_unit]] call CBA_fnc_targetEvent; } else { // Fill current magazine completely and fill next magazine partially - _target setMagazineTurretAmmo [_magazineClass, _rounds, _turretPath]; + _vehicle setMagazineTurretAmmo [_magazineClass, _rounds, _turretPath]; if (_numMagazines < _maxMagazines) then { - _target addMagazineTurret [_magazineClass, _turretPath]; - _target setMagazineTurretAmmo [_magazineClass, _currentRounds, _turretPath]; + _vehicle addMagazineTurret [_magazineClass, _turretPath]; + _vehicle setMagazineTurretAmmo [_magazineClass, _currentRounds, _turretPath]; }; - [QEGVAR(common,displayTextStructured), - [ - [LSTRING(Hint_RearmedTriple), _rounds, + [QEGVAR(common,displayTextStructured), [[LSTRING(Hint_RearmedTriple), _rounds, getText(configFile >> "CfgMagazines" >> _magazineClass >> "displayName"), - getText(configFile >> "CfgVehicles" >> (typeOf _target) >> "displayName")], 3, _unit - ], - [_unit]] call CBA_fnc_targetEvent; + getText(configFile >> "CfgVehicles" >> (typeOf _vehicle) >> "displayName")], 3, _unit], [_unit]] call CBA_fnc_targetEvent; }; }; - _target removeMagazineTurret [_magazineClass, _turretPath]; + _vehicle removeMagazineTurret [_magazineClass, _turretPath]; _numMagazines = _numMagazines - 1; }; }; diff --git a/addons/rearm/functions/fnc_removeMagazineFromSupply.sqf b/addons/rearm/functions/fnc_removeMagazineFromSupply.sqf new file mode 100644 index 0000000000..056ed26f48 --- /dev/null +++ b/addons/rearm/functions/fnc_removeMagazineFromSupply.sqf @@ -0,0 +1,92 @@ +/* + * Author: GitHawk + * Removes a magazine from the supply. + * + * Arguments: + * 0: Ammo Truck + * 1: Magazine Classname + * 2: Number of Rounds to withdraw (default: -1) + * + * Return Value: + * Magazine was removed + * + * Example: + * [ammo_truck, "500Rnd_127x99_mag_Tracer_Red"] call ace_rearm_fnc_removeMagazineFromSupply + * + * Public: Yes + */ +#include "script_component.hpp" + +params [["_truck", objNull, [objNull]], ["_magazineClass", "", [""]], ["_numRounds", -1, [0]]]; +TRACE_3("removeMagazineFromSupply",_truck,_magazineClass,_numRounds); + +if (isNull _truck || {_magazineClass isEqualTo ""}) exitWith {false}; + +private _return = false; +([_magazineClass] call FUNC(getCaliber)) params ["_cal", "_idx"]; + +if (GVAR(supply) == 0) then { + WARNING("supply setting is set to unlimited"); // func shouldn't have been called + _return = true; +}; + +if (GVAR(supply) == 1) then { + private _supply = [_truck] call FUNC(getSupplyCount); + if (GVAR(level) == 2) then { + // Remove partial magazine supply count + private _rearmAmount = (REARM_COUNT select _idx); + if (_numRounds > 0) then { + _rearmAmount = _numRounds; + }; + private _magazinePart = (_rearmAmount / (getNumber (configFile >> "CfgMagazines" >> _magazineClass >> "count"))) min 1; + if (_supply >= (_cal * _magazinePart)) then { + [_truck, (_supply - (_cal * _magazinePart))] call FUNC(setSupplyCount); + _return = true; + }; + } else { + // Remove entire magazine supply count + if (_supply >= _cal) then { + [_truck, (_supply - _cal)] call FUNC(setSupplyCount); + _return = true; + }; + }; +}; + +if (GVAR(supply) == 2) then { + private _magazineSupply = _truck getVariable [QGVAR(magazineSupply), []]; + private _magazineIdx = -1; + { + _x params ["_magazine"]; + if ((_magazine isEqualTo _magazineClass)) exitWith { + _magazineIdx = _forEachIndex; + }; + } forEach _magazineSupply; + if (_magazineIdx == -1) exitWith {false}; + + (_magazineSupply select _magazineIdx) params ["", "_rounds"]; + + private _configRounds = getNumber (configFile >> "CfgMagazines" >> _magazineClass >> "count"); + if (GVAR(level) == 2) then { + // With caliber based rearming, we need to remove the correct amount + private _rearmAmount = (REARM_COUNT select _idx); + if (_numRounds > 0) then { + if (_numRounds > _rearmAmount) then { + _rearmAmount = ceil (_numRounds / _rearmAmount); + }; + }; + private _roundsPerTransaction = _rearmAmount min _configRounds; + if (_rounds >= _roundsPerTransaction) then { + _magazineSupply set [_magazineIdx, [_magazineClass, (_rounds - _roundsPerTransaction)]]; + _truck setVariable [QGVAR(magazineSupply), _magazineSupply, true]; + _return = true; + }; + } else { + // Remove entire magazine + if (_rounds >= _configRounds) then { + _magazineSupply set [_magazineIdx, [_magazineClass, (_rounds - _configRounds)]]; + _truck setVariable [QGVAR(magazineSupply), _magazineSupply, true]; + _return = true; + }; + }; +}; +_return diff --git a/addons/rearm/functions/fnc_setSupplyCount.sqf b/addons/rearm/functions/fnc_setSupplyCount.sqf new file mode 100644 index 0000000000..ef99a78416 --- /dev/null +++ b/addons/rearm/functions/fnc_setSupplyCount.sqf @@ -0,0 +1,28 @@ +/* + * Author: GitHawk + * Sets the supply count. [Global Effects] + * + * Arguments: + * 0: Ammo Truck + * 1: Supply Count + * + * Return Value: + * None + * + * Example: + * [ammo_truck, 1000] call ace_rearm_fnc_setSupplyCount + * + * Public: Yes + */ +#include "script_component.hpp" + +if !(EGVAR(common,settingsInitFinished)) exitWith { // only run this after the settings are initialized + EGVAR(common,runAtSettingsInitialized) pushBack [FUNC(setSupplyCount), _this]; +}; + +params [["_truck", objNull, [objNull]], ["_supply", 0, [0]]]; + +if (GVAR(supply) != 1) exitWith {WARNING("supply setting is not set to limited");}; +if (isNull _truck) exitWith {WARNING_1("Truck is null [%1]",_truck);}; + +_truck setVariable [QGVAR(currentSupply), (_supply max 0), true]; diff --git a/addons/rearm/functions/fnc_setTurretMagazineAmmo.sqf b/addons/rearm/functions/fnc_setTurretMagazineAmmo.sqf new file mode 100644 index 0000000000..2cc5e156d5 --- /dev/null +++ b/addons/rearm/functions/fnc_setTurretMagazineAmmo.sqf @@ -0,0 +1,89 @@ +/* + * Author: Tuupertunut + * Sets the ammo counts of all magazines of given class in turret. + * + * BIS command "setMagazineTurretAmmo" is broken at the time of writing (2017-06-24) + * (https://feedback.bistudio.com/T79689). This function is intended as a workaround for it. All + * magazines are removed and then added again with updated ammo counts. + * Note: As an unintended side effect, the turret reloads after running this function. + * + * Arguments: + * 0: Vehicle + * 1: Turret Path + * 2: Magazine Classname + * 3: Ammo Counts in Magazines + * + * Return Value: + * None + * + * Example: + * [vehicle, [0], "200Rnd_127x99_mag_Tracer_Red", [200, 152]] call ace_rearm_fnc_setTurretMagazineAmmo + * + * Public: No + */ +#include "script_component.hpp" + +params ["_vehicle", "_turretPath", "_magazineClass", "_ammoCounts"]; + +// Checking if a magazine of given class is currently loaded in any weapon. +private _magLoadedInWeapon = false; +private _loadedWeapon = ""; +{ + private _currentlyLoadedMag = (weaponState [_vehicle, _turretPath, _x]) select 3; + + if (_currentlyLoadedMag isEqualTo _magazineClass) exitWith { + _magLoadedInWeapon = true; + _loadedWeapon = _x; + }; +} forEach (_vehicle weaponsTurret _turretPath); + + +if (!_magLoadedInWeapon) then { + /* The easy case: + * The magazine class was not loaded, so we can just remove those magazines and + * add them back with updated ammo counts. */ + + _vehicle removeMagazinesTurret [_magazineClass, _turretPath]; + { + _vehicle addMagazineTurret [_magazineClass, _turretPath, _x]; + } forEach _ammoCounts; + +} else { + /* Special hack case: + * The magazine class was loaded into a weapon. If the weapon has more than one type of + * magazine (e.g. AP and HEAT in a cannon), then removing all magazines would trigger the + * weapon to load a different magazine type. For example, removing the HEAT shells while HEAT + * is loaded makes the cannon switch to AP. + * + * To prevent that, we must remove all magazines that would fit into the weapon and then add + * them back with the magazine-to-be-loaded being the first. */ + + private _allowedMagClassesInWeapon = getArray (configFile >> "CfgWeapons" >> _loadedWeapon >> "magazines"); + + /* Current ammo counts of all allowed magazine classes in weapon. + * Example: [["8Rnd_82mm_Mo_shells", [8, 8, 2]], ["8Rnd_82mm_Mo_Flare_white", [7]]] */ + private _ammoCountsByMagClass = _allowedMagClassesInWeapon apply {[_x, ([_vehicle, _turretPath, _x] call FUNC(getTurretMagazineAmmo))]}; + + // Removing all magazines that fit into the weapon. + { + _vehicle removeMagazinesTurret [_x, _turretPath]; + } forEach _allowedMagClassesInWeapon; + + // Adding the mags of the given class first with updated ammo counts. + { + _vehicle addMagazineTurret [_magazineClass, _turretPath, _x]; + } forEach _ammoCounts; + + // Adding back all other magazines with their original ammo counts. + { + _x params ["_loopMagClass", "_loopAmmoCounts"]; + + if (!(_loopMagClass isEqualTo _magazineClass)) then { + { + _vehicle addMagazineTurret [_loopMagClass, _turretPath, _x]; + } forEach _loopAmmoCounts; + }; + } forEach _ammoCountsByMagClass; +}; + +TRACE_5("setTurretMagazineAmmo",_vehicle,_turretPath,_magazineClass,_ammoCounts,_loadedWeapon); diff --git a/addons/rearm/functions/fnc_storeAmmo.sqf b/addons/rearm/functions/fnc_storeAmmo.sqf index b94616652e..0da99c081a 100644 --- a/addons/rearm/functions/fnc_storeAmmo.sqf +++ b/addons/rearm/functions/fnc_storeAmmo.sqf @@ -3,30 +3,35 @@ * Stores ammo in an ammo truck. * * Arguments: - * 0: Target + * 0: Ammo Truck * 1: Unit * * Return Value: * None * * Example: - * [player, dummy] call ace_rearm_fnc_storeAmmo + * [ammo_truck, player] call ace_rearm_fnc_storeAmmo * * Public: No */ #include "script_component.hpp" -params [["_target", objNull, [objNull]], ["_unit", objNull, [objNull]]]; +params ["_truck", "_unit"]; -private _dummy = _unit getVariable [QGVAR(dummy), objNull]; -if (isNull _dummy) exitwith {}; +private _attachedDummy = _unit getVariable [QGVAR(dummy), objNull]; +if (isNull _attachedDummy) exitwith {}; [ - 5, - _unit, - {params ["_unit"]; [_unit, true, true] call FUNC(dropAmmo)}, + TIME_PROGRESSBAR(5), + [_unit, _truck, _attachedDummy], + { + params ["_args"]; + _args params ["_unit", "_truck", "_attachedDummy"]; + [_truck, (_attachedDummy getVariable [QGVAR(magazineClass), ""]), true] call FUNC(addMagazineToSupply); + [_unit, true, true] call FUNC(dropAmmo); + }, "", - format [localize LSTRING(StoreAmmoAction), getText(configFile >> "CfgMagazines" >> (_dummy getVariable QGVAR(magazineClass)) >> "displayName"), getText(configFile >> "CfgVehicles" >> (typeOf _target) >> "displayName")], + format [localize LSTRING(StoreAmmoAction), getText(configFile >> "CfgMagazines" >> (_attachedDummy getVariable QGVAR(magazineClass)) >> "displayName"), getText(configFile >> "CfgVehicles" >> (typeOf _truck) >> "displayName")], {true}, ["isnotinside"] ] call EFUNC(common,progressBar); diff --git a/addons/rearm/functions/fnc_takeAmmo.sqf b/addons/rearm/functions/fnc_takeAmmo.sqf index d2de1e1b59..69db94729d 100644 --- a/addons/rearm/functions/fnc_takeAmmo.sqf +++ b/addons/rearm/functions/fnc_takeAmmo.sqf @@ -19,40 +19,17 @@ */ #include "script_component.hpp" -private ["_ammo", "_tmpCal", "_cal", "_idx"]; - -params [["_target", objNull, [objNull]], ["_unit", objNull, [objNull]], ["_args", ["", objNull], [[]]]]; +params ["_truck", "_unit", "_args"]; _args params ["_magazineClass", "_vehicle"]; +TRACE_5("takeAmmo",_truck,_unit,_args,_magazineClass,_vehicle); -_ammo = getText (configFile >> "CfgMagazines" >> _magazineClass >> "ammo"); -_tmpCal = getNumber (configFile >> "CfgAmmo" >> _ammo >> "ace_caliber"); -_cal = 8; -if (_tmpCal > 0) then { - _cal = _tmpCal; -} else { - _tmpCal = getNumber (configFile >> "CfgAmmo" >> _ammo >> QGVAR(caliber)); - if (_tmpCal > 0) then { - _cal = _tmpCal; - } else { - diag_log format ["[ACE] ERROR: Undefined Ammo [%1 : %2]", _ammo, inheritsFrom (configFile >> "CfgAmmo" >> _ammo)]; - if (_ammo isKindOf "BulletBase") then { - _cal = 8; - } else { - _cal = 100; - }; - }; -}; -_cal = round _cal; -_idx = REARM_CALIBERS find _cal; -if (_idx == -1 ) then { - _idx = 2; -}; +([_magazineClass] call FUNC(getCaliber)) params ["_cal", "_idx"]; -REARM_HOLSTER_WEAPON +REARM_HOLSTER_WEAPON; [ - (REARM_DURATION_TAKE select _idx), - [_unit, _magazineClass, _target], + TIME_PROGRESSBAR(REARM_DURATION_TAKE select _idx), + [_unit, _magazineClass, _truck], FUNC(takeSuccess), "", format [localize LSTRING(TakeAction), getText(configFile >> "CfgMagazines" >> _magazineClass >> "displayName"), getText(configFile >> "CfgVehicles" >> (typeOf _vehicle) >> "displayName")], diff --git a/addons/rearm/functions/fnc_takeSuccess.sqf b/addons/rearm/functions/fnc_takeSuccess.sqf index 6d5966c9f9..e9d8b1daaa 100644 --- a/addons/rearm/functions/fnc_takeSuccess.sqf +++ b/addons/rearm/functions/fnc_takeSuccess.sqf @@ -18,15 +18,21 @@ */ #include "script_component.hpp" -private ["_ammo", "_dummyName", "_dummy", "_actionID"]; -params [["_args", [objNull, "", objNull], [[]]]]; -_args params ["_unit", "_magazineClass", "_target"]; // _target is for future possible finite ammo +params ["_args"]; +_args params ["_unit", "_magazineClass", "_truck"]; +TRACE_3("takeSuccess",_unit,_magazineClass,_truck); + +private _success = true; +if (GVAR(supply) > 0) then { + _success = [_truck, _magazineClass] call FUNC(removeMagazineFromSupply); +}; +if !(_success) exitWith {WARNING_2("takeSuccess failed to take [%1] from [%2]",_magazineClass,_truck);}; [_unit, "forceWalk", QGVAR(vehRearm), true] call EFUNC(common,statusEffect_set); -_dummy = [_unit, _magazineClass] call FUNC(createDummy); +private _dummy = [_unit, _magazineClass] call FUNC(createDummy); [_dummy, _unit] call FUNC(pickUpAmmo); -_actionID = _unit addAction [ +private _actionID = _unit addAction [ format ["%1", localize ELSTRING(dragging,Drop)], '(_this select 0) call FUNC(dropAmmo)', nil, diff --git a/addons/rearm/script_component.hpp b/addons/rearm/script_component.hpp index f04abacc49..a80dab55b2 100644 --- a/addons/rearm/script_component.hpp +++ b/addons/rearm/script_component.hpp @@ -5,6 +5,7 @@ // #define DEBUG_MODE_FULL // #define DISABLE_COMPILE_CACHE // #define ENABLE_PERFORMANCE_COUNTERS +// #define FAST_PROGRESSBARS #ifdef DEBUG_ENABLED_REARM #define DEBUG_MODE_FULL @@ -18,7 +19,7 @@ #define REARM_ACTION_DISTANCE 7 -#define REARM_TURRET_PATHS [[-1], [0], [0,0], [0,1], [1], [2], [0,2]] +#define REARM_ACTION_DISTANCE_SQR 49 #define REARM_CALIBERS [ 6, 7, 8, 13, 19, 20, 25, 30, 35, 39, 40, 60, 70, 80, 82, 100, 105, 120, 122, 125, 155, 230, 250] #define REARM_DURATION_TAKE [ 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 3, 3, 3, 3, 3, 4, 5, 5, 5, 5, 13, 10] @@ -28,12 +29,19 @@ #define REARM_HOLSTER_WEAPON \ _unit setVariable [QGVAR(selectedWeaponOnRearm), currentWeapon _unit]; \ - _unit action ["SwitchWeapon", _unit, _unit, 99]; + TRACE_2("REARM_HOLSTER_WEAPON",_unit,currentWeapon _unit); \ + _unit action ["SwitchWeapon", _unit, _unit, 299]; #define REARM_UNHOLSTER_WEAPON \ _weaponSelect = _unit getVariable QGVAR(selectedWeaponOnRearm); \ - TRACE_2("REARM_UNHOLSTER_WEAPON",_unit,_weaponSelect); \ if (!isNil "_weaponSelect") then { \ + TRACE_2("REARM_UNHOLSTER_WEAPON",_unit,_weaponSelect); \ _unit selectWeapon _weaponSelect; \ _unit setVariable [QGVAR(selectedWeaponOnRearm), nil]; \ }; + +#ifdef FAST_PROGRESSBARS + #define TIME_PROGRESSBAR(X) ((X) * 0.075) +#else + #define TIME_PROGRESSBAR(X) (X) +#endif diff --git a/addons/rearm/stringtable.xml b/addons/rearm/stringtable.xml index 5fb0a270e7..7d7de5b811 100644 --- a/addons/rearm/stringtable.xml +++ b/addons/rearm/stringtable.xml @@ -1,4 +1,4 @@ - + @@ -12,6 +12,9 @@ Parámetros de rearme Options de réarmement 再武装設定 + 재보급 설정 + 整装设定 + 整裝設定 This module allows you to tweak rearm system settings. @@ -24,6 +27,9 @@ Este módulo permite cambiar los parámetros de rearme. Ce module autorise l'amélioration du système de réarmement. 再武装システムの設定を微調整します。 + 이 모듈은 재보급시의 설정을 바꿀수 있게해줍니다. + 此模块允许你调整整装系统设定 + 此模塊允許你調整整裝系統設定 Rearm Amount @@ -35,7 +41,10 @@ Ammontare Riarmo Velocidad de rearme Quantité à réarmer - 再武装の度合い + 再武装できる量 + 재보급 양 + 整装所需时间 + 整裝所需時間 How fast should a vehicle be rearmed? @@ -48,6 +57,9 @@ Cuán rápido es el proceso de rearme? A quelle vitesse devrait être réarmé un véhicule ? 車両を再武装する速さを設定しますか? + 차량을 얼마나 빨리 재보급 시킵니까? + 载具多快会整装完毕? + 載具多快會整裝完畢? Entire Vehicle @@ -60,6 +72,9 @@ Vehículo completo Véhicule entier 対象の車両 + 모든 차량 + 整个载具 + 整個載具 Entire Magazine @@ -72,6 +87,9 @@ Cargador completo Chargeur entier 対象の弾薬 + 모든 탄창 + 整个弹匣 + 整個彈匣 Amount based on caliber @@ -83,7 +101,100 @@ Ammontare basato sul calibro Cantidad basada en el calibre Quantité basée sur le calibre - 口径に基づいた度合い + 口径に基づいた量 + 구경에 따라 수량 설정 + 基于口径决定所耗时间 + 基於口徑決定所耗時間 + + + Ammunition supply + Munitionsvorat + Scorta munizioni + 弾薬の供給 + 弹药补给 + 彈藥補給 + Zapas amunicji + + + How much ammunition does an ammo truck carry? + Wie viel Munition transportiert ein Munitionslaster? + Quante munizioni può trasportare un camion? + 弾薬トラックがどの位の弾薬を供給できるようにしますか? + 弹药卡车会携带多少的弹药? + 彈藥卡車會攜帶多少的彈藥? + Ile amunicji przewozi ciężarówka? + + + Unlimited ammo supply + Unbegrenzter Munitionsvorat + Scorta munizioni infinita + 無制限供給 + 无限弹药 + 無限彈藥 + Nielimitowany zapas amunicji + + + Limited ammo supply based on caliber + Begrenzter, kaliberabhängiger Munitionsvorat + Scorta munizioni limitata in base al calibro + 口径に基づいた限定的供給 + 基于口径限制弹药数量 + 基於口徑限制彈藥數量 + Zapas amunicji zależny od kalibru + + + Only specific Magazines + Nur bestimmte Magazine + Solo specifici caricatori + 特定の弾薬のみ + 只有指定的弹药 + 只有指定的彈藥 + Tylko konkretne magazynki + + + Check remaining ammunition + Verbleibende Munition prüfen + Controlla munizioni rimanenti + 残弾薬を確認 + 检查剩余的弹药 + 檢查剩餘的彈藥 + Sprawdź ilość amunicji + + + Checking remaining ammunition... + Überprüfe verbleibende Munition... + Controllando le munizioni rimanenti + 残弾薬を確認しています・・・ + 正在检查剩余的弹药中... + 正在檢查剩餘的彈藥中... + Sprawdzanie ilości amunicji... + + + There is ammunition worth %1 points left. + Es ist noch Munition für %1 Punkte übrig. + E' presente una penalità delle munizioni %1 punti rimanenti. + この弾薬は%1残っている + 还剩下%1多的弹药. + 還剩下%1多的彈藥. + Pozostało %1 punktów amunicji. + + + The following ammunition is left:%1 + Folgende Munition ist übrig:%1 + Mancano le seguenti:%1 + この弾薬の残りは:%1 + 以下剩余的弹药:%1 + 以下剩餘的彈藥:%1 + Pozostała amunicja: %1 + + + There is no ammunition left. + Es ist keine Munition übrig. + Non ci sono munizioni rimanenti. + 弾薬は残っていません。 + 已经没有剩余的弹药了. + 已經沒有剩餘的彈藥了. + Brak amunicji w zapasie. Rearm @@ -96,6 +207,9 @@ Rearmar Réarmer 再武装 + 재보급 + 整装 + 整裝 Rearming %1 with %2... @@ -104,10 +218,13 @@ Перевооружается %1 снарядами %2... Rearmando %1 com %2... Přezbrojuji %1 za pomoci %2... - Sto Riarmando %1 con %2... + Riarmando %1 con %2... Rearmando %1 con %2... Réarmement de %1 avec %2... - %2により%1を再武装する。 + %1を%2により再武装する。 + %2을 %1에 재보급중... + %2正整装到%1中... + %2正整裝到%1中... Rearming %1... @@ -120,6 +237,9 @@ Rearmando %1... Réarmement de %1... %1を再武装中・・・ + %1 재보급중... + 整装%1中... + 整裝%1中... Taking %1 for %2... @@ -131,7 +251,10 @@ Sto prendendo %1 per %2... Tomando %1 para %2... Prend %1 pour %2... - %2のために%1を取得しています・・・ + %1を%2のために取得しています・・・ + %2를 위해 %1 가져오는중... + 拿取%1给%2中... + 拿取%1給%2中... Take ammo @@ -144,6 +267,9 @@ Tomar munición Prendre la munition 弾薬をとる + 탄약 가지기 + 取得弹药 + 取得彈藥 Pick up ammo @@ -156,6 +282,9 @@ Levantar munición Ramasser la munition 弾薬を拾う + 탄약 줍기 + 捡起弹药 + 撿起彈藥 Store ammo @@ -168,6 +297,9 @@ Guardar munición Stocker la munition 弾薬を戻す + 탄약 보관하기 + 储存弹药 + 儲存彈藥 Storing %1 in %2... @@ -179,7 +311,10 @@ Sto riponendo %1 in %2... Guardando %1 en %2... Stocke %1 dans %2... - %2へ%1を戻しています・・・ + %1を%2へ戻しています・・・ + %2에 %1 보관중... + 储存%1到%2中... + 儲存%1到%2中... Picking up ammo... @@ -191,6 +326,9 @@ Levantando munición... Ramassage des munitions... 弾薬を拾っている・・・ + 탄약 줍는중... + 捡起弹药中... + 撿起彈藥中... Rearmed %1 rounds of %2 on %3 @@ -202,7 +340,10 @@ Riarmati %1 colpi di %2 su %3 Rearmadas %1 rondas de %2 en %3 %1 balles réarmées de %2 dans %3 - %3にある%2の%1弾頭を再武装した + %1発の%2を%3から装填した + %3에 2%의 %1 탄약 재보급 + 整装了%1发%2到%3上 + 整裝了%1發%2到%3上 Smoke Screen @@ -215,6 +356,9 @@ Дым. завеса Pantalla de humo 煙幕弾 + 연막 차장 + 烟幕弹 + 煙幕彈 Flares @@ -227,6 +371,9 @@ ЛТЦ Bengalas フレア + 기만체 + 热焰弹 + 熱焰彈 30mm HEI @@ -239,6 +386,9 @@ 30mm HEI 30mm HEI 30mm 焼夷りゅう弾 + 30mm 고폭소이탄 + 30mm 高爆燃烧弹 + 30mm 高爆燃燒彈 30mm HEI-T @@ -251,6 +401,9 @@ 30mm HEI-T 30mm HEI-T 30mm 焼夷曳光りゅう弾 + 30mm 고폭소이예광탄 + 30mm 高爆燃烧曳光弹 + 30mm 高爆燃燒曳光彈 AIM-9 Sidewinder @@ -263,6 +416,9 @@ AIM-9 Sidewinder AIM-9 Sidewinder AIM-9 サイドワインダー + AIM-9 Sidewinder + AIM-9 响尾蛇 + AIM-9 響尾蛇 Wympel R-73 @@ -275,6 +431,9 @@ Wympel R-73 Wympel R-73 ヴィンペル R-73 + Vympel R-73 + Wympel R-73 + Wympel R-73 AGM-65 Maverick @@ -287,6 +446,9 @@ AGM-65 Maverick AGM-65 Maverick AGM-65 マーベリック + AGM-65 Maverick + AGM-65 小牛 + AGM-65 小牛 Kh-25MTP @@ -299,6 +461,9 @@ Kh-25MTP Kh-25MTP Kh-25MTP + Kh-25MTP + Kh-25MTP + Kh-25MTP Hydra 70 HE @@ -311,6 +476,9 @@ Hydra 70 HE Hydra 70 HE ハイドラ 70 りゅう弾 + Hydra 70 고폭탄 + 九头蛇 70 高爆弹 + 九頭蛇 70 高爆彈 S-8 HE @@ -323,6 +491,9 @@ S-8 HE S-8 HE S-8 りゅう弾 + S-8 고폭탄 + S-8 高爆弹 + S-8 高爆彈 Hydra 70 AP @@ -335,6 +506,9 @@ Hydra 70 AP Hydra 70 AP ハイドラ 70 徹甲弾 + Hydra 70 철갑탄 + 九头蛇 70 反人员弹 + 九頭蛇 70 反人員彈 S-8 AP @@ -347,6 +521,9 @@ S-8 AP S-8 AP S-8 徹甲弾 + S-8 철갑탄 + S-8 反人员弹 + S-8 反人員彈 GBU-12 @@ -359,6 +536,9 @@ GBU-12 GBU-12 GBU-12 + GBU-12 + GBU-12 + GBU-12 FAB-250M-54 @@ -371,6 +551,9 @@ FAB-250M-54 FAB-250M-54 FAB-250M-54 + FAB-250M-54 + FAB-250M-54 + FAB-250M-54 - \ No newline at end of file + diff --git a/addons/recoil/XEH_preInit.sqf b/addons/recoil/XEH_preInit.sqf index c503c2edbc..ffd1bfc414 100644 --- a/addons/recoil/XEH_preInit.sqf +++ b/addons/recoil/XEH_preInit.sqf @@ -3,6 +3,8 @@ ADDON = false; +PREP_RECOMPILE_START; #include "XEH_PREP.hpp" +PREP_RECOMPILE_END; ADDON = true; diff --git a/addons/recoil/functions/fnc_camshake.sqf b/addons/recoil/functions/fnc_camshake.sqf index deb454df71..8b600f41ae 100644 --- a/addons/recoil/functions/fnc_camshake.sqf +++ b/addons/recoil/functions/fnc_camshake.sqf @@ -7,7 +7,7 @@ * None. Parameters inherited from EFUNC(common,firedEH) * * Return Value: - * Nothing + * None * * Example: * [player, (currentWeapon player), (currentMuzzle player)] call ace_recoil_fnc_camShake; diff --git a/addons/refuel/ACE_Settings.hpp b/addons/refuel/ACE_Settings.hpp index b38a880641..a25c36a2ba 100644 --- a/addons/refuel/ACE_Settings.hpp +++ b/addons/refuel/ACE_Settings.hpp @@ -6,4 +6,10 @@ class ACE_Settings { value = 1; typeName = "SCALAR"; }; + class GVAR(hoseLength) { + category = ECSTRING(OptionsMenu,CategoryLogistics); + displayName = CSTRING(RefuelSettings_hoseLength_DisplayName); + value = 12; + typeName = "SCALAR"; + }; }; diff --git a/addons/refuel/Cfg3DEN.hpp b/addons/refuel/Cfg3DEN.hpp new file mode 100644 index 0000000000..3dbc91c2cf --- /dev/null +++ b/addons/refuel/Cfg3DEN.hpp @@ -0,0 +1,36 @@ +#define GET_NUMBER(config,default) (if (isNumber (config)) then {getNumber (config)} else {default}) +#define GET_1ST_ARRAY(config) (if (isArray (config)) then {getArray (config) select 0} else {[ARR_3(0,0,0)]}) + +#define DEFAULT_FUELCARGO GET_NUMBER(configFile >> 'CfgVehicles' >> typeOf _this >> QQGVAR(fuelCargo),REFUEL_DISABLED_FUEL) +#define DEFAULT_HOOKS GET_1ST_ARRAY(configFile >> 'CfgVehicles' >> typeOf _this >> QQGVAR(hooks)) + +class Cfg3DEN { + class Object { + class AttributeCategories { + class ace_attributes { + class Attributes { + class GVAR(fuelCargo) { + displayName = CSTRING(fuelCargo_edenName); + tooltip = CSTRING(fuelCargo_edenDesc); + property = QGVAR(fuelCargo); + control = "EditShort"; + expression = QUOTE(if (_value != DEFAULT_FUELCARGO) then {[ARR_2(_this,_value)] call DFUNC(makeSource)}); + defaultValue = QUOTE(DEFAULT_FUELCARGO); + validate = "number"; + condition = "(1-objectBrain)*(1-objectAgent)"; + typeName = "NUMBER"; + }; + class GVAR(hooks) { + displayName = CSTRING(hooks_edenName); + tooltip = CSTRING(hooks_edenDesc); + property = QGVAR(hooks); + control = "EditXYZ"; + expression = QUOTE(if !(_value isEqualTo DEFAULT_HOOKS) then {_this setVariable [ARR_3('%s',[_value],true)]}); + defaultValue = QUOTE(DEFAULT_HOOKS); + condition = "(1-objectBrain)*(1-objectAgent)"; + }; + }; + }; + }; + }; +}; diff --git a/addons/refuel/CfgEventHandlers.hpp b/addons/refuel/CfgEventHandlers.hpp index c6f26efe1a..c8d6e21596 100644 --- a/addons/refuel/CfgEventHandlers.hpp +++ b/addons/refuel/CfgEventHandlers.hpp @@ -1,4 +1,3 @@ - class Extended_PreStart_EventHandlers { class ADDON { init = QUOTE(call COMPILE_FILE(XEH_preStart)); @@ -20,15 +19,15 @@ class Extended_PostInit_EventHandlers { class Extended_Respawn_EventHandlers { class CAManBase { class ADDON { - respawn = QUOTE(call COMPILE_FILE(XEH_respawn)); + respawn = QUOTE(call DFUNC(handleRespawn)); }; }; }; -class Extended_Killed_EventHandlers { - class CAManBase { +class Extended_InitPost_EventHandlers { + class Land_CanisterFuel_F { class ADDON { - killed = QUOTE(_this call FUNC(handleKilled)); + init = QUOTE(call DFUNC(makeJerryCan)); }; }; -}; \ No newline at end of file +}; diff --git a/addons/refuel/CfgVehicles.hpp b/addons/refuel/CfgVehicles.hpp index 7162ab454a..e7d77e4510 100644 --- a/addons/refuel/CfgVehicles.hpp +++ b/addons/refuel/CfgVehicles.hpp @@ -1,61 +1,3 @@ - -#define MACRO_REFUEL_ACTIONS \ - class ACE_Actions: ACE_Actions { \ - class ACE_MainActions: ACE_MainActions { \ - class GVAR(Refuel) { \ - displayName = CSTRING(Refuel); \ - distance = REFUEL_ACTION_DISTANCE; \ - condition = "true"; \ - statement = ""; \ - showDisabled = 0; \ - priority = 2; \ - icon = QPATHTOF(ui\icon_refuel_interact.paa); \ - class GVAR(TakeNozzle) { \ - displayName = CSTRING(TakeNozzle); \ - condition = QUOTE([ARR_2(_player,_target)] call FUNC(canTakeNozzle)); \ - statement = QUOTE([ARR_3(_player,_target,objNull)] call FUNC(TakeNozzle)); \ - exceptions[] = {"isNotInside"}; \ - icon = QPATHTOF(ui\icon_refuel_interact.paa); \ - }; \ - class GVAR(CheckFuelCounter) { \ - displayName = CSTRING(CheckFuelCounter); \ - condition = "true"; \ - statement = QUOTE([ARR_2(_player,_target)] call FUNC(readFuelCounter)); \ - exceptions[] = {"isNotInside"}; \ - icon = QPATHTOF(ui\icon_refuel_interact.paa); \ - }; \ - class GVAR(CheckFuel) { \ - displayName = CSTRING(CheckFuel); \ - condition = QUOTE([ARR_2(_player,_target)] call FUNC(canCheckFuel)); \ - statement = QUOTE([ARR_2(_player,_target)] call FUNC(checkFuel)); \ - exceptions[] = {"isNotInside"}; \ - icon = QPATHTOF(ui\icon_refuel_interact.paa); \ - }; \ - class GVAR(Return) { \ - displayName = CSTRING(Return); \ - condition = QUOTE([ARR_2(_player,_target)] call FUNC(canReturnNozzle)); \ - statement = QUOTE([ARR_2(_player,_target)] call DFUNC(returnNozzle)); \ - exceptions[] = {"isNotInside"}; \ - icon = QPATHTOF(ui\icon_refuel_interact.paa); \ - }; \ - }; \ - }; \ - }; - -#define MACRO_CONNECT_ACTIONS \ - class ACE_Actions { \ - class ACE_MainActions { \ - class GVAR(Connect) { \ - displayName = CSTRING(Connect); \ - distance = REFUEL_ACTION_DISTANCE; \ - condition = QUOTE([ARR_2(_player,_target)] call FUNC(canConnectNozzle)); \ - statement = QUOTE([ARR_2(_player,_target)] call DFUNC(connectNozzle)); \ - icon = QPATHTOF(ui\icon_refuel_interact.paa); \ - exceptions[] = {"isNotInside"}; \ - }; \ - }; \ - }; - #define MACRO_NOZZLE_ACTIONS \ class ACE_Actions { \ class ACE_MainActions { \ @@ -64,35 +6,36 @@ position = "[0,-0.025,0.125]"; \ condition = "true"; \ statement = ""; \ + exceptions[] = {INTERACT_EXCEPTIONS}; \ showDisabled = 0; \ priority = 2; \ icon = QPATHTOF(ui\icon_refuel_interact.paa); \ class GVAR(PickUpNozzle) { \ displayName = CSTRING(TakeNozzle); \ condition = QUOTE([ARR_2(_player,_target)] call FUNC(canTakeNozzle)); \ - statement = QUOTE([ARR_3(_player,objNull,_target)] call FUNC(takeNozzle)); \ - exceptions[] = {"isNotInside"}; \ + statement = QUOTE([ARR_2(_player,_target)] call FUNC(takeNozzle)); \ + exceptions[] = {INTERACT_EXCEPTIONS_REFUELING}; \ icon = QPATHTOF(ui\icon_refuel_interact.paa); \ }; \ class GVAR(TurnOn) { \ displayName = CSTRING(TurnOn); \ condition = QUOTE([ARR_2(_player,_target)] call FUNC(canTurnOn)); \ statement = QUOTE([ARR_2(_player,_target)] call DFUNC(turnOn)); \ - exceptions[] = {"isNotInside"}; \ + exceptions[] = {INTERACT_EXCEPTIONS}; \ icon = QPATHTOF(ui\icon_refuel_interact.paa); \ }; \ class GVAR(TurnOff) { \ displayName = CSTRING(TurnOff); \ condition = QUOTE([ARR_2(_player,_target)] call FUNC(canTurnOff)); \ statement = QUOTE([ARR_2(_player,_target)] call DFUNC(turnOff)); \ - exceptions[] = {"isNotInside"}; \ + exceptions[] = {INTERACT_EXCEPTIONS}; \ icon = QPATHTOF(ui\icon_refuel_interact.paa); \ }; \ class GVAR(Disconnect) { \ displayName = CSTRING(Disconnect); \ condition = QUOTE([ARR_2(_player,_target)] call FUNC(canDisconnect)); \ statement = QUOTE([ARR_2(_player,_target)] call DFUNC(disconnect)); \ - exceptions[] = {"isNotInside"}; \ + exceptions[] = {INTERACT_EXCEPTIONS_REFUELING}; \ icon = QPATHTOF(ui\icon_refuel_interact.paa); \ }; \ }; \ @@ -119,6 +62,11 @@ class CfgVehicles { typeName = "NUMBER"; defaultValue = 10; }; + class hoseLength { + displayName = CSTRING(RefuelSettings_hoseLength_DisplayName); + typeName = "NUMBER"; + defaultValue = 12; + }; }; }; @@ -141,20 +89,17 @@ class CfgVehicles { class NonStrategic: Building {}; class HouseBase: NonStrategic {}; class House: HouseBase {}; - class House_F: House {}; - - class House_Small_F: House_F { - class EventHandlers; - + class House_F: House { class ACE_Actions { class ACE_MainActions { displayName = ECSTRING(interaction,MainAction); selection = ""; - distance = 10; + distance = 5; condition = "true"; }; }; }; + class House_Small_F: House_F {}; class AllVehicles: All { GVAR(flowRate) = 1; @@ -162,36 +107,27 @@ class CfgVehicles { class Land: AllVehicles {}; class LandVehicle: Land {}; class Car: LandVehicle { - MACRO_CONNECT_ACTIONS + GVAR(canReceive) = 1; }; class Tank: LandVehicle { - MACRO_CONNECT_ACTIONS + GVAR(canReceive) = 1; GVAR(flowRate) = 4; }; - class StaticWeapon: LandVehicle { - MACRO_CONNECT_ACTIONS - }; - class Air: AllVehicles { GVAR(flowRate) = 8; }; class Helicopter: Air { - MACRO_CONNECT_ACTIONS - GVAR(fuelCapacity) = 1500; + GVAR(canReceive) = 1; }; class Helicopter_Base_F: Helicopter {}; - - class Helicopter_Base_H: Helicopter_Base_F { - GVAR(fuelCapacity) = 3000; - }; + class Helicopter_Base_H: Helicopter_Base_F {}; class Plane: Air { - MACRO_CONNECT_ACTIONS - GVAR(fuelCapacity) = 2000; + GVAR(canReceive) = 1; GVAR(flowRate) = 16; }; @@ -200,8 +136,7 @@ class CfgVehicles { class Ship: AllVehicles {}; class Ship_F: Ship { - MACRO_CONNECT_ACTIONS - GVAR(fuelCapacity) = 2000; + GVAR(canReceive) = 1; GVAR(flowRate) = 4; }; @@ -219,11 +154,14 @@ class CfgVehicles { class Rubber_duck_base_F: Boat_F { GVAR(fuelCapacity) = 30; }; - class SDV_01_base_F: Boat_F { +/* class SDV_01_base_F: Boat_F { // SDV is using electrical propulsion - GVAR(fuelCapacity) = 0; + // but we can't recharge it ATM another way + // TODO make recharging, maybe with this objects: + // Land_PowerGenerator_F Land_Portable_generator_F + GVAR(canReceive) = 0; }; - +*/ class Car_F: Car { // Assuming large vehicle tank GVAR(fuelCapacity) = 60; @@ -305,7 +243,6 @@ class CfgVehicles { }; class Van_01_fuel_base_F: Van_01_base_F { - MACRO_REFUEL_ACTIONS GVAR(hooks)[] = {{0.38,-3.17,-.7},{-0.41,-3.17,-.7}}; GVAR(fuelCargo) = 2000; }; @@ -330,7 +267,6 @@ class CfgVehicles { class B_APC_Tracked_01_CRV_F: B_APC_Tracked_01_base_F { transportFuel = 0; //3k - MACRO_REFUEL_ACTIONS GVAR(hooks)[] = {{-1.08,-4.81,-.8}}; GVAR(fuelCargo) = 1000; }; @@ -373,19 +309,6 @@ class CfgVehicles { GVAR(fuelCapacity) = 830; }; - class Heli_Attack_01_base_F: Helicopter_Base_F { - // Commanche - }; - - class Heli_Attack_02_base_F: Helicopter_Base_F { - // Mi-48 Kajman - }; - - class Heli_Light_01_base_F: Helicopter_Base_H { - // MH-6 - GVAR(fuelCapacity) = 242; - }; - class Heli_Light_02_base_F: Helicopter_Base_H { // Ka-60 Kasatka GVAR(fuelCapacity) = 1450; @@ -429,7 +352,11 @@ class CfgVehicles { class UAV_01_base_F: Helicopter_Base_F { // Darter is electrical - GVAR(fuelCapacity) = 0; + GVAR(canReceive) = 0; + }; + class UAV_06_base_F: Helicopter_Base_F { + // Orange UAV is electrical + GVAR(canReceive) = 0; }; class UAV: Plane {}; @@ -439,11 +366,6 @@ class CfgVehicles { GVAR(fuelCapacity) = 270; }; - class UGV_01_base_F: Car_F { - // Stomper - GVAR(fuelCapacity) = 100; - }; - class Plane_Fighter_03_base_F: Plane_Base_F { // L-159 ALCA GVAR(fuelCapacity) = 1914; @@ -452,21 +374,18 @@ class CfgVehicles { // Vanilla fuel vehicles class Truck_02_fuel_base_F: Truck_02_base_F { transportFuel = 0; //3k - MACRO_REFUEL_ACTIONS GVAR(hooks)[] = {{0.99,-3.47,-0.67},{-1.04,-3.47,-0.67}}; GVAR(fuelCargo) = 10000; }; class B_Truck_01_fuel_F: B_Truck_01_mover_F { transportFuel = 0; //3k - MACRO_REFUEL_ACTIONS GVAR(hooks)[] = {{.28,-4.99,-.3},{-.25,-4.99,-.3}}; GVAR(fuelCargo) = 10000; }; class O_Truck_03_fuel_F: Truck_03_base_F { transportFuel = 0; //3k - MACRO_REFUEL_ACTIONS GVAR(hooks)[] = {{1.3,-1.59,-.62},{-1.16,-1.59,-.62}}; GVAR(fuelCargo) = 10000; }; @@ -481,7 +400,6 @@ class CfgVehicles { class Pod_Heli_Transport_04_base_F: Slingload_base_F {}; class Land_Pod_Heli_Transport_04_fuel_F: Pod_Heli_Transport_04_base_F { transportFuel = 0; //3k - MACRO_REFUEL_ACTIONS GVAR(hooks)[] = {{-1.49,1.41,-.3}}; GVAR(fuelCargo) = 10000; }; @@ -489,19 +407,17 @@ class CfgVehicles { class Slingload_01_Base_F: Slingload_base_F {}; class B_Slingload_01_Fuel_F: Slingload_01_Base_F { transportFuel = 0; //3k - MACRO_REFUEL_ACTIONS GVAR(hooks)[] = {{0.55,3.02,-0.5},{-0.52,3.02,-0.5}}; GVAR(fuelCargo) = 10000; }; class O_Heli_Transport_04_fuel_F: Heli_Transport_04_base_F { transportFuel = 0; //3k - MACRO_REFUEL_ACTIONS GVAR(hooks)[] = {{-1.52,1.14,-1.18}}; GVAR(fuelCargo) = 10000; }; - + // Vanilla fuel objects class StorageBladder_base_F: NonStrategic { class ACE_Actions { class ACE_MainActions { @@ -517,35 +433,67 @@ class CfgVehicles { class CBA_Extended_EventHandlers: CBA_Extended_EventHandlers {}; }; - MACRO_REFUEL_ACTIONS transportFuel = 0; //60k GVAR(hooks)[] = {{-3.35,2.45,0.17}}; GVAR(fuelCargo) = 60000; }; + class FlexibleTank_base_F: ThingX { + class ACE_Actions { + class ACE_MainActions { + displayName = ECSTRING(interaction,MainAction); + position = "[0, 0, 0.5]"; + distance = 4; + condition = "true"; + }; + }; + }; + class Land_FlexibleTank_01_F: FlexibleTank_base_F { + transportFuel = 0; //300 + GVAR(hooks)[] = {{0, 0, 0.5}}; + GVAR(fuelCargo) = 300; + }; + // Vanilla buildings class Land_Fuelstation_Feed_F: House_Small_F { - class EventHandlers { - class CBA_Extended_EventHandlers: CBA_Extended_EventHandlers {}; - }; - transportFuel = 0; //50k - MACRO_REFUEL_ACTIONS GVAR(hooks)[] = {{0,0,-0.5}}; GVAR(fuelCargo) = REFUEL_INFINITE_FUEL; }; class Land_fs_feed_F: House_Small_F { - class EventHandlers { - class CBA_Extended_EventHandlers: CBA_Extended_EventHandlers {}; - }; - transportFuel = 0; //50k - MACRO_REFUEL_ACTIONS GVAR(hooks)[] = {{-0.4,0.022,-.23}}; GVAR(fuelCargo) = REFUEL_INFINITE_FUEL; }; + class Land_FuelStation_01_pump_F: House_F { + transportFuel = 0; //50k + GVAR(hooks)[] = {{0, 0.4, -0.5}, {0, -0.4, -0.5}}; + GVAR(fuelCargo) = REFUEL_INFINITE_FUEL; + }; + class Land_FuelStation_01_pump_malevil_F: House_F { + transportFuel = 0; //50k + GVAR(hooks)[] = {{0, 0.4, -0.5}, {0, -0.4, -0.5}}; + GVAR(fuelCargo) = REFUEL_INFINITE_FUEL; + }; + + // Helper object for non-AllVehicles objects + class GVAR(helper): Helicopter_Base_F { + scope = 1; + displayName = "Refuel Helper"; + model = "\A3\Weapons_f\empty"; + class ACE_Actions {}; + class ACE_SelfActions {}; + EGVAR(cargo,hasCargo) = 0; + EGVAR(cargo,space) = 0; + damageEffect = ""; + destrType = ""; + class HitPoints {}; + class Turrets {}; + class TransportItems {}; + }; + /* // Barrels found in config \ BarrelHelper: Misc_thing 100 BarrelBase: BarrelHelper 100 diff --git a/addons/refuel/XEH_PREP.hpp b/addons/refuel/XEH_PREP.hpp index dac451da17..e4c5298036 100644 --- a/addons/refuel/XEH_PREP.hpp +++ b/addons/refuel/XEH_PREP.hpp @@ -1,28 +1,26 @@ - PREP(canCheckFuel); -PREP(canConnectNozzle); PREP(canDisconnect); PREP(canReturnNozzle); PREP(canTakeNozzle); PREP(canTurnOff); PREP(canTurnOn); PREP(checkFuel); -PREP(connectNozzle); PREP(connectNozzleAction); PREP(disconnect); PREP(dropNozzle); PREP(getFuel); PREP(handleDisconnect); -PREP(handleKilled); -PREP(handleUnconscious); +PREP(handleRespawn); +PREP(initSource); PREP(makeJerryCan); +PREP(makeSource); PREP(moduleRefuelSettings); +PREP(onMouseButtonDown); PREP(readFuelCounter); PREP(refuel); -PREP(reset); -PREP(resetLocal); PREP(returnNozzle); PREP(setFuel); +PREP(startNozzleInHandsPFH); PREP(takeNozzle); PREP(turnOff); PREP(turnOn); diff --git a/addons/refuel/XEH_postInit.sqf b/addons/refuel/XEH_postInit.sqf index 89a1f3dc45..b2d55e1f7f 100644 --- a/addons/refuel/XEH_postInit.sqf +++ b/addons/refuel/XEH_postInit.sqf @@ -1,24 +1,110 @@ #include "script_component.hpp" -["ace_unconscious", {_this call FUNC(handleUnconscious)}] call CBA_fnc_addEventHandler; - if (isServer) then { - addMissionEventHandler ["HandleDisconnect", {_this call FUNC(handleDisconnect)}]; + addMissionEventHandler ["HandleDisconnect", LINKFUNC(handleDisconnect)]; }; -[QGVAR(resetLocal), { - _this call FUNC(resetLocal); -}] call CBA_fnc_addEventHandler; +[QGVAR(initSource), LINKFUNC(initSource)] call CBA_fnc_addEventHandler; +if (!hasInterface) exitWith {}; -#ifdef DEBUG_MODE_FULL -diag_log text format ["[ACE-refuel] Showing CfgVehicles with vanilla transportFuel"]; -private _fuelTrucks = configProperties [configFile >> "CfgVehicles", "(isClass _x) && {(getNumber (_x >> 'transportFuel')) > 0}", true]; +["isNotRefueling", {!((_this select 0) getVariable [QGVAR(isRefueling), false])}] call EFUNC(common,addCanInteractWithCondition); + +["MouseButtonDown", LINKFUNC(onMouseButtonDown)] call CBA_fnc_addDisplayHandler; + +GVAR(mainAction) = [ + QGVAR(Refuel), + localize LSTRING(Refuel), + QPATHTOF(ui\icon_refuel_interact.paa), + {}, + { + alive _target + && {[_player, _target, [INTERACT_EXCEPTIONS]] call EFUNC(common,canInteractWith)} + && {REFUEL_DISABLED_FUEL != [_target] call FUNC(getFuel)} + }, + {}, [], [0,0,0], + REFUEL_ACTION_DISTANCE +] call EFUNC(interact_menu,createAction); + +GVAR(actions) = [ + [QGVAR(TakeNozzle), + localize LSTRING(TakeNozzle), + QPATHTOF(ui\icon_refuel_interact.paa), + {[_player, _target] call FUNC(TakeNozzle)}, + {[_player, _target] call FUNC(canTakeNozzle)}, + {}, [], [0,0,0], + REFUEL_ACTION_DISTANCE + ] call EFUNC(interact_menu,createAction), + [QGVAR(CheckFuelCounter), + localize LSTRING(CheckFuelCounter), + QPATHTOF(ui\icon_refuel_interact.paa), + {[_player, _target] call FUNC(readFuelCounter)}, + {true}, + {}, [], [0,0,0], + REFUEL_ACTION_DISTANCE + ] call EFUNC(interact_menu,createAction), + [QGVAR(CheckFuel), + localize LSTRING(CheckFuel), + QPATHTOF(ui\icon_refuel_interact.paa), + {[_player, _target] call FUNC(checkFuel)}, + {[_player, _target] call FUNC(canCheckFuel)}, + {}, [], [0,0,0], + REFUEL_ACTION_DISTANCE + ] call EFUNC(interact_menu,createAction), + [QGVAR(Return), + localize LSTRING(Return), + QPATHTOF(ui\icon_refuel_interact.paa), + {[_player, _target] call FUNC(returnNozzle)}, + {[_player, _target] call FUNC(canReturnNozzle)}, + {}, [], [0,0,0], + REFUEL_ACTION_DISTANCE + ] call EFUNC(interact_menu,createAction) +]; + +// init menu for config refuel vehicles +private _sourceClasses = []; { - if ((configName _x) isKindOf "Car") then { - diag_log text format ["Car [%1] needs config [fuel: %2]", configName _x, getNumber (_x >> 'transportFuel')]; - } else { - diag_log text format ["Non-car? [%1] needs config [fuel: %2]", configName _x, getNumber (_x >> 'transportFuel')]; + private _fuelCargo = getNumber (_x >> QGVAR(fuelCargo)); + if (_fuelCargo > 0 || {_fuelCargo == REFUEL_INFINITE_FUEL}) then { + private _sourceClass = configName _x; + if (isClass (_x >> "ACE_Actions" >> "ACE_MainActions" >> QGVAR(Refuel))) exitWith { + if (!isClass (inheritsFrom _x >> "ACE_Actions" >> "ACE_MainActions" >> QGVAR(Refuel))) then { + ACE_DEPRECATED(FORMAT_1(QUOTE(GVAR(Refuel) interaction menu in %1),_sourceClass),"3.13.0",QUOTE(GVAR(fuelCargo) config value)); + }; + }; + // check if we can use actions with inheritance + if ( + !isText (_x >> "EventHandlers" >> "CBA_Extended_EventHandlers" >> "init") // addActionToClass relies on XEH init + || {configName _x isKindOf "Static"} // CBA_fnc_addClassEventHandler doesn't support "Static" class + ) then { + if (2 == getNumber (_x >> "scope")) then { + [_sourceClass, 0, ["ACE_MainActions"], GVAR(mainAction)] call EFUNC(interact_menu,addActionToClass); + { + [_sourceClass, 0, ["ACE_MainActions", QGVAR(Refuel)], _x] call EFUNC(interact_menu,addActionToClass); + } forEach GVAR(actions); + TRACE_1("add menu to static",_sourceClass); + }; + } else { + if (0 == {_sourceClass isKindOf _x} count _sourceClasses) then { + _sourceClasses pushBack _sourceClass; + [_sourceClass, 0, ["ACE_MainActions"], GVAR(mainAction), true] call EFUNC(interact_menu,addActionToClass); + { + [_sourceClass, 0, ["ACE_MainActions", QGVAR(Refuel)], _x, true] call EFUNC(interact_menu,addActionToClass); + } forEach GVAR(actions); + TRACE_1("add menu to dynamic",_sourceClass); + }; + }; }; -} forEach _fuelTrucks; +} forEach ('true' configClasses (configFile >> "CfgVehicles")); + + +#ifdef DRAW_HOOKS_POS +addMissionEventHandler ["Draw3D", { + private _source = cursorObject; + private _cfgPos = getArray (configFile >> "CfgVehicles" >> typeOf _source >> QGVAR(hooks)); + private _dynPos = _source getVariable [QGVAR(hooks), []]; + { + drawIcon3D ["\a3\ui_f\data\gui\cfg\hints\icon_text\group_1_ca.paa", [1,1,1,1], _source modelToWorldVisual _x, 1, 1, 0, format ["Hook %1", _forEachIndex]]; + } forEach ([_dynPos, _cfgPos] select (_dynPos isEqualTo [])); +}]; #endif diff --git a/addons/refuel/XEH_preInit.sqf b/addons/refuel/XEH_preInit.sqf index a7feade1c3..b47cf6628d 100644 --- a/addons/refuel/XEH_preInit.sqf +++ b/addons/refuel/XEH_preInit.sqf @@ -2,6 +2,8 @@ ADDON = false; +PREP_RECOMPILE_START; #include "XEH_PREP.hpp" +PREP_RECOMPILE_END; ADDON = true; diff --git a/addons/refuel/XEH_respawn.sqf b/addons/refuel/XEH_respawn.sqf deleted file mode 100644 index 085361e7dc..0000000000 --- a/addons/refuel/XEH_respawn.sqf +++ /dev/null @@ -1,9 +0,0 @@ -#include "script_component.hpp" - -params ["_unit"]; - -if !(local _unit) exitWith {}; - -[_unit, "forceWalk", "ACE_refuel", false] call EFUNC(common,statusEffect_set); -_unit setVariable [QGVAR(selectedWeaponOnRefuel), nil]; -_unit setVariable [QGVAR(isRefueling), false]; diff --git a/addons/refuel/config.cpp b/addons/refuel/config.cpp index 40e28d9222..39765e323c 100644 --- a/addons/refuel/config.cpp +++ b/addons/refuel/config.cpp @@ -15,5 +15,10 @@ class CfgPatches { }; #include "ACE_Settings.hpp" +#include "Cfg3DEN.hpp" #include "CfgEventHandlers.hpp" #include "CfgVehicles.hpp" + +class ACE_Tests { + vehicleTransportFuel = QPATHTOF(dev\test_debugConfigs.sqf); +}; diff --git a/addons/refuel/dev/test_debugConfigs.sqf b/addons/refuel/dev/test_debugConfigs.sqf new file mode 100644 index 0000000000..834d3626bf --- /dev/null +++ b/addons/refuel/dev/test_debugConfigs.sqf @@ -0,0 +1,18 @@ +// ["vehicleTransportFuel"] call ace_common_fnc_runTests; +// execVM "z\ace\addons\refuel\dev\test_debugConfigs.sqf"; + +#include "\z\ace\addons\refuel\script_component.hpp" + +private _testPass = true; + +diag_log text format ["[ACE-refuel] Showing CfgVehicles with vanilla transportFuel"]; +private _fuelTrucks = configProperties [configFile >> "CfgVehicles", "(isClass _x) && {(getNumber (_x >> 'transportFuel')) > 0}", true]; +{ + if ((configName _x) isKindOf "Car") then { + diag_log text format ["Car [%1] needs config [transportFuel: %2]", configName _x, getNumber (_x >> 'transportFuel')]; + } else { + diag_log text format ["Non-car? [%1] needs config [transportFuel: %2]", configName _x, getNumber (_x >> 'transportFuel')]; + }; +} forEach _fuelTrucks; + +_testPass diff --git a/addons/refuel/functions/fnc_canCheckFuel.sqf b/addons/refuel/functions/fnc_canCheckFuel.sqf index e0046dea3d..6e86092652 100644 --- a/addons/refuel/functions/fnc_canCheckFuel.sqf +++ b/addons/refuel/functions/fnc_canCheckFuel.sqf @@ -4,7 +4,7 @@ * * Arguments: * 0: Unit - * 1: Fuel Truck/Station + * 1: Fuel Source * * Return Value: * Can Check Fuel @@ -16,11 +16,11 @@ */ #include "script_component.hpp" -params [["_unit", objNull, [objNull]], ["_target", objNull, [objNull]]]; +params [["_unit", objNull, [objNull]], ["_source", objNull, [objNull]]]; !(isNull _unit || {!(_unit isKindOf "CAManBase")} || {!local _unit} || - {!alive _target} || - {(_target distance _unit) > REFUEL_ACTION_DISTANCE} || - {(_target call FUNC(getFuel) == REFUEL_INFINITE_FUEL)}) + {!alive _source} || + {([_unit, _source] call EFUNC(interaction,getInteractionDistance)) > REFUEL_ACTION_DISTANCE} || + {(_source call FUNC(getFuel) == REFUEL_INFINITE_FUEL)}) diff --git a/addons/refuel/functions/fnc_canConnectNozzle.sqf b/addons/refuel/functions/fnc_canConnectNozzle.sqf deleted file mode 100644 index adb4935bb2..0000000000 --- a/addons/refuel/functions/fnc_canConnectNozzle.sqf +++ /dev/null @@ -1,31 +0,0 @@ -/* - * Author: GitHawk - * Check if a unit can connect a fuel nozzle - * - * Arguments: - * 0: Unit - * 1: Target - * - * Return Value: - * Can Connect Nozzle - * - * Example: - * [player, tank] call ace_refuel_fnc_canConnectNozzle - * - * Public: No - */ -#include "script_component.hpp" - -params [["_unit", objNull, [objNull]], ["_target", objNull, [objNull]]]; - -private _nozzle = _unit getVariable [QGVAR(nozzle), objNull]; -private _engine = false; - -if (_target isKindOf "AllVehicles") then { - _engine = isEngineOn _target; -}; - -!(isNull _nozzle || - {_engine} || - {(_target distance _unit) > REFUEL_ACTION_DISTANCE} || - {!isNull (_target getVariable [QGVAR(nozzle), objNull])}) diff --git a/addons/refuel/functions/fnc_canReturnNozzle.sqf b/addons/refuel/functions/fnc_canReturnNozzle.sqf index a0dbf64587..226576be0d 100644 --- a/addons/refuel/functions/fnc_canReturnNozzle.sqf +++ b/addons/refuel/functions/fnc_canReturnNozzle.sqf @@ -4,7 +4,7 @@ * * Arguments: * 0: Unit - * 1: Fuel truck + * 1: Fuel Source * * Return Value: * Can Return Nozzle @@ -16,10 +16,10 @@ */ #include "script_component.hpp" -params [["_unit", objNull, [objNull]], ["_target", objNull, [objNull]]]; +params [["_unit", objNull, [objNull]], ["_source", objNull, [objNull]]]; private _nozzle = _unit getVariable [QGVAR(nozzle), objNull]; (!isNull _nozzle) && -{_target distance _unit < REFUEL_ACTION_DISTANCE} && -{_target == (_nozzle getVariable [QGVAR(source), objNull])} +{([_unit, _source] call EFUNC(interaction,getInteractionDistance)) < REFUEL_ACTION_DISTANCE} && +{_source == (_nozzle getVariable [QGVAR(source), objNull])} diff --git a/addons/refuel/functions/fnc_canTakeNozzle.sqf b/addons/refuel/functions/fnc_canTakeNozzle.sqf index 65016323b2..8847675058 100644 --- a/addons/refuel/functions/fnc_canTakeNozzle.sqf +++ b/addons/refuel/functions/fnc_canTakeNozzle.sqf @@ -4,7 +4,7 @@ * * Arguments: * 0: Unit - * 1: Fuel Station or Nozzle + * 1: Fuel Source or Nozzle * * Return Value: * Can connect @@ -16,13 +16,14 @@ */ #include "script_component.hpp" -params [["_unit", objNull, [objNull]], ["_target", objNull, [objNull]]]; +params [["_unit", objNull, [objNull]], ["_object", objNull, [objNull]]]; if (isNull _unit || {!(_unit isKindOf "CAManBase")} || {!local _unit} || - {!alive _target} || + {!alive _object} || {!isNull (_unit getVariable [QGVAR(nozzle), objNull])} || - {(_target distance _unit) > REFUEL_ACTION_DISTANCE}) exitWith {false}; + {typeOf _object == QGVAR(fuelNozzle) && {!isNull (attachedTo _object)}} || // Not carried by someone else + {([_unit, _object] call EFUNC(interaction,getInteractionDistance)) > REFUEL_ACTION_DISTANCE}) exitWith {false}; -!(_target getVariable [QGVAR(isConnected), false]) && {!(_unit getVariable [QGVAR(isRefueling), false])} +!(_object getVariable [QGVAR(isConnected), false]) && {!(_unit getVariable [QGVAR(isRefueling), false])} diff --git a/addons/refuel/functions/fnc_canTurnOn.sqf b/addons/refuel/functions/fnc_canTurnOn.sqf index e9de5c205c..98173e0fa4 100644 --- a/addons/refuel/functions/fnc_canTurnOn.sqf +++ b/addons/refuel/functions/fnc_canTurnOn.sqf @@ -27,5 +27,4 @@ if (isNull _unit || !(_nozzle getVariable [QGVAR(isRefueling), false]) && {[_nozzle getVariable QGVAR(source)] call FUNC(getFuel) != 0} && {!isNull (_nozzle getVariable [QGVAR(sink), objNull])} && - {(fuel (_nozzle getVariable QGVAR(sink))) < 1} && - {!(isEngineOn (_nozzle getVariable QGVAR(sink)))} + {(fuel (_nozzle getVariable QGVAR(sink))) < 1} diff --git a/addons/refuel/functions/fnc_checkFuel.sqf b/addons/refuel/functions/fnc_checkFuel.sqf index 49d62b1e44..fdb4a525d2 100644 --- a/addons/refuel/functions/fnc_checkFuel.sqf +++ b/addons/refuel/functions/fnc_checkFuel.sqf @@ -4,7 +4,7 @@ * * Arguments: * 0: Unit - * 1: Fuel Truck + * 1: Fuel Source * * Return Value: * None @@ -16,16 +16,16 @@ */ #include "script_component.hpp" -params [["_unit", objNull, [objNull]], ["_target", objNull, [objNull]]]; +params [["_unit", objNull, [objNull]], ["_source", objNull, [objNull]]]; -private _fuel = [_target] call FUNC(getFuel); +private _fuel = [_source] call FUNC(getFuel); [ - 5, - [_unit, _target, _fuel], + TIME_PROGRESSBAR(REFUEL_PROGRESS_DURATION * 2), + [_unit, _source, _fuel], { params ["_args"]; - _args params [["_unit", objNull, [objNull]], ["_target", objNull, [objNull]], ["_fuel", 0, [0]]]; + _args params [["_unit", objNull, [objNull]], ["_source", objNull, [objNull]], ["_fuel", 0, [0]]]; if (_fuel > 0 ) then { [QEGVAR(common,displayTextStructured), [[LSTRING(Hint_RemainingFuel), _fuel], 2, _unit], _unit] call CBA_fnc_targetEvent; } else { @@ -36,5 +36,5 @@ private _fuel = [_target] call FUNC(getFuel); {true}, localize LSTRING(CheckFuelAction), {true}, - ["isnotinside"] + [INTERACT_EXCEPTIONS] ] call EFUNC(common,progressBar); diff --git a/addons/refuel/functions/fnc_connectNozzle.sqf b/addons/refuel/functions/fnc_connectNozzle.sqf deleted file mode 100644 index a124a331d5..0000000000 --- a/addons/refuel/functions/fnc_connectNozzle.sqf +++ /dev/null @@ -1,63 +0,0 @@ -/* - * Author: GitHawk et.al. - * Connect a fuel nozzle. - * With code from ace_attach - * - * Arguments: - * 0: Unit - * 1: Target - * - * Return Value: - * None - * - * Example: - * [player, tank] call ace_refuel_fnc_connectNozzle - * - * Public: No - */ -#include "script_component.hpp" - -#define PLACE_WAITING -1 -#define PLACE_CANCEL 0 -#define PLACE_APPROVE 1 - -params [["_unit", objNull, [objNull]], ["_target", objNull, [objNull]]]; - -private _nozzle = _unit getVariable [QGVAR(nozzle), objNull]; -if (isNull _nozzle) exitWith {}; - -GVAR(placeAction) = PLACE_WAITING; - -[{[localize LSTRING(Connect_Action), ""] call EFUNC(interaction,showMouseHint)}, []] call CBA_fnc_execNextFrame; -_unit setVariable [QGVAR(placeActionEH), [_unit, "DefaultAction", {true}, {GVAR(placeAction) = PLACE_APPROVE;}] call EFUNC(common,AddActionEventHandler)]; - -private _actionID = _unit addAction [format ["%1", localize LSTRING(Cancel)], {GVAR(placeAction) = PLACE_CANCEL;}]; - -[{ - params ["_args","_pfID"]; - _args params [["_unit", objNull, [objNull]], ["_target", objNull, [objNull]], ["_nozzle", objNull, [objNull]], ["_actionID", -1, [0]]]; - - private _virtualPosASL = (eyePos _unit) vectorAdd (positionCameraToWorld [0,0,0.6]) vectorDiff (positionCameraToWorld [0,0,0]); - if (cameraView == "EXTERNAL") then { - _virtualPosASL = _virtualPosASL vectorAdd ((positionCameraToWorld [0.3,0,0]) vectorDiff (positionCameraToWorld [0,0,0])); - }; - private _virtualPos = _virtualPosASL call EFUNC(common,ASLToPosition); - private _lineInterection = lineIntersects [eyePos ace_player, _virtualPosASL, ace_player]; - - //Don't allow placing in a bad position: - if (_lineInterection && {GVAR(placeAction) == PLACE_APPROVE}) then {GVAR(placeAction) = PLACE_WAITING;}; - - if ((GVAR(placeAction) != PLACE_WAITING) || - {_unit != ace_player} || - {!([_unit, _target, []] call EFUNC(common,canInteractWith))}) then { - - [_pfID] call CBA_fnc_removePerFrameHandler; - [] call EFUNC(interaction,hideMouseHint); - [_unit, "DefaultAction", (_unit getVariable [QGVAR(placeActionEH), -1])] call EFUNC(common,removeActionEventHandler); - _unit removeAction _actionID; - - if (GVAR(placeAction) == PLACE_APPROVE) then { - [_unit, _target, _virtualPos, _nozzle] call FUNC(ConnectNozzleAction); - }; - }; // TODO add model like in attach/functions/fnc_attach -}, 0, [_unit, _target, _nozzle, _actionID] ] call cba_fnc_addPerFrameHandler; diff --git a/addons/refuel/functions/fnc_connectNozzleAction.sqf b/addons/refuel/functions/fnc_connectNozzleAction.sqf index 250da51e21..eece4b0caa 100644 --- a/addons/refuel/functions/fnc_connectNozzleAction.sqf +++ b/addons/refuel/functions/fnc_connectNozzleAction.sqf @@ -5,8 +5,8 @@ * * Arguments: * 0: Unit - * 1: Target - * 2: Visual Position + * 1: Vehicle + * 2: Visual Position ASL * 3: Nozzle * * Return Value: @@ -18,79 +18,65 @@ * Public: No */ #include "script_component.hpp" -private ["_closeInDistance", "_endPosTestOffset"]; -params [["_unit", objNull, [objNull]], ["_target", objNull, [objNull]], ["_startingPosition", [0,0,0], [[]], 3], ["_nozzle", objNull, [objNull]]]; -private _startingOffset = _target worldToModel _startingPosition; +params [["_unit", objNull, [objNull]], ["_sink", objNull, [objNull]], ["_startingPosASL", [0,0,0], [[]], 3], ["_nozzle", objNull, [objNull]]]; -private _startDistanceFromCenter = vectorMagnitude _startingOffset; -private _closeInUnitVector = vectorNormalized (_startingOffset vectorFromTo [0,0,0]); -private _closeInMax = _startDistanceFromCenter; -private _closeInMin = 0; +private _bestPosASL = []; +private _bestPosDistance = 1e99; +private _viewPos = _startingPosASL vectorAdd (((positionCameraToWorld [0,0,0]) vectorFromTo (positionCameraToWorld [0,0,1])) vectorMultiply 3); +private _modelVector = _startingPosASL vectorFromTo (AGLtoASL (_sink modelToWorld [0,0,0])); +private _modelVectorLow = _startingPosASL vectorFromTo (AGLtoASL (_sink modelToWorld [0,0,-1])); -while {(_closeInMax - _closeInMin) > 0.01} do { - _closeInDistance = (_closeInMax + _closeInMin) / 2; - _endPosTestOffset = _startingOffset vectorAdd (_closeInUnitVector vectorMultiply _closeInDistance); - _endPosTestOffset set [2, (_startingOffset select 2)]; - private _endPosTest = _target modelToWorldVisual _endPosTestOffset; - - private _doesIntersect = false; +{ + private _endPosASL = _x; + // [_startingPosASL, _endPosASL, [1,0,0,1]] call EFUNC(common,addLineToDebugDraw); // Debug scan lines + private _intersections = lineIntersectsSurfaces [_startingPosASL, _endPosASL, _unit]; { - if (_doesIntersect) exitWith {}; - private _startingPosShifted = _startingPosition vectorAdd _x; - _startASL = if (surfaceIsWater _startingPosShifted) then {_startingPosShifted} else {ATLtoASL _startingPosShifted}; - { - _endPosShifted = _endPosTest vectorAdd _x; - private _endASL = if (surfaceIsWater _startingPosShifted) then {_endPosShifted} else {ATLtoASL _endPosShifted}; - - //Uncomment to see the lazor show, and see how the scanning works: - // drawLine3D [_startingPosShifted, _endPosShifted, [1,0,0,1]]; - if (_target in lineIntersectsWith [_startASL, _endASL, _unit]) exitWith {_doesIntersect = true}; - } forEach [[0,0,0.045], [0,0,-0.045], [0,0.045,0], [0,-0.045,0], [0.045,0,0], [-0.045,0,0]]; - } forEach [[0,0,0], [0,0,0.05], [0,0,-0.05]]; - - if (_doesIntersect) then { - _closeInMax = _closeInDistance; - } else { - _closeInMin = _closeInDistance; - }; -}; - -_closeInDistance = (_closeInMax + _closeInMin) / 2; + _x params ["_intersectPosASL", "", "_intersectObject"]; + if (_intersectObject == _sink) then { + private _distance = _startingPosASL distance _intersectPosASL; + if (_distance < _bestPosDistance) then { + _bestPosDistance = _distance; + _bestPosASL = _intersectPosASL; + }; + }; + } forEach _intersections; +} forEach [ + // Shoot rays towards player's view angle and see which spot is closest + _startingPosASL vectorAdd (((positionCameraToWorld [0,0,0]) vectorFromTo (positionCameraToWorld [0,0,1])) vectorMultiply 3), + _startingPosASL vectorAdd (((positionCameraToWorld [0,0,0]) vectorFromTo (positionCameraToWorld [-0.25,0,1])) vectorMultiply 3), + _startingPosASL vectorAdd (((positionCameraToWorld [0,0,0]) vectorFromTo (positionCameraToWorld [0.25,0,1])) vectorMultiply 3), + _startingPosASL vectorAdd (((positionCameraToWorld [0,0,0]) vectorFromTo (positionCameraToWorld [0,-0.25,1])) vectorMultiply 3), + _startingPosASL vectorAdd (((positionCameraToWorld [0,0,0]) vectorFromTo (positionCameraToWorld [-0.25,-0.25,1])) vectorMultiply 3), + _startingPosASL vectorAdd (((positionCameraToWorld [0,0,0]) vectorFromTo (positionCameraToWorld [0.25,-0.25,1])) vectorMultiply 3), + AGLtoASL (_sink modelToWorld [0,0,0]), // Try old method of just using model center + AGLtoASL (_sink modelToWorld [0,0,-0.5]) +]; //Checks (too close to center or can't attach) -if ((_startDistanceFromCenter - _closeInDistance) < 0.1) exitWith { - TRACE_2("no valid spot found",_closeInDistance,_startDistanceFromCenter); +if (_bestPosASL isEqualTo []) exitWith { [localize LSTRING(Failed)] call EFUNC(common,displayTextStructured); }; //Move it out slightly, for visibility sake (better to look a little funny than be embedded//sunk in the hull and be useless) -_closeInDistance = (_closeInDistance - 0.05); +_bestPosASL = _bestPosASL vectorAdd ((_bestPosASL vectorFromTo _startingPosASL) vectorMultiply 0.05); -_endPosTestOffset = _startingOffset vectorAdd (_closeInUnitVector vectorMultiply _closeInDistance); -_endPosTestOffset set [2, (_startingOffset select 2)]; +private _attachPosModel = _sink worldToModel (ASLtoAGL _bestPosASL); [ - 2, - [_unit, _nozzle, _target, _endPosTestOffset], + TIME_PROGRESSBAR(REFUEL_PROGRESS_DURATION), + [_unit, _nozzle, _sink, _attachPosModel], { params ["_args"]; - _args params [["_unit", objNull, [objNull]], ["_nozzle", objNull, [objNull]], ["_target", objNull, [objNull]], ["_endPosTestOffset", [0,0,0], [[]], 3]]; + _args params [["_unit", objNull, [objNull]], ["_nozzle", objNull, [objNull]], ["_sink", objNull, [objNull]], ["_endPosTestOffset", [0,0,0], [[]], 3]]; _unit setVariable [QGVAR(nozzle), nil, true]; _unit setVariable [QGVAR(isRefueling), false]; - [_unit, "forceWalk", "ACE_refuel", false] call EFUNC(common,statusEffect_set); - REFUEL_UNHOLSTER_WEAPON - private _actionID = _unit getVariable [QGVAR(ReleaseActionID), -1]; - if (_actionID != -1) then { - _unit removeAction _actionID; - _unit setVariable [QGVAR(ReleaseActionID), nil]; - }; detach _nozzle; - _nozzle attachTo [_target, _endPosTestOffset]; + _nozzle attachTo [_sink, _endPosTestOffset]; _endPosTestOffset params ["_x", "_y"]; - private _bb = boundingBoxReal _target; + private _bb = boundingBoxReal _sink; _bb params ["_ll", "_rr"]; _ll set [2, 0]; _rr set [2, 0]; @@ -120,9 +106,10 @@ _endPosTestOffset set [2, (_startingOffset select 2)]; }; }; [QEGVAR(common,setVectorDirAndUp), [_nozzle, _dirAndUp], _nozzle] call CBA_fnc_targetEvent; - _nozzle setVariable [QGVAR(sink), _target, true]; + if (_nozzle isKindOf "Land_CanisterFuel_F") then { _nozzle setVariable [QEGVAR(cargo,canLoad), false, true]; }; + _nozzle setVariable [QGVAR(sink), _sink, true]; _nozzle setVariable [QGVAR(isConnected), true, true]; - _target setVariable [QGVAR(nozzle), _nozzle, true]; + _sink setVariable [QGVAR(nozzle), _nozzle, true]; _source = _nozzle getVariable QGVAR(source); private _fuel = [_source] call FUNC(getFuel); @@ -132,10 +119,17 @@ _endPosTestOffset set [2, (_startingOffset select 2)]; _source setVariable [QGVAR(fuelCounter), _fuel, true]; }; - [_unit, _target, _nozzle, _endPosTestOffset] call FUNC(refuel); + [_unit, _sink, _nozzle, _endPosTestOffset] call FUNC(refuel); + + if ([_unit, _nozzle] call FUNC(canTurnOn)) then { + _unit setVariable [QGVAR(tempFuel), nil]; + [_unit, _nozzle] call FUNC(turnOn); + } else { + [LSTRING(CouldNotTurnOn)] call EFUNC(common,displayText); + }; }, "", localize LSTRING(ConnectAction), {true}, - ["isnotinside"] + [INTERACT_EXCEPTIONS] ] call EFUNC(common,progressBar); diff --git a/addons/refuel/functions/fnc_disconnect.sqf b/addons/refuel/functions/fnc_disconnect.sqf index 41fde6d365..793eefbb93 100644 --- a/addons/refuel/functions/fnc_disconnect.sqf +++ b/addons/refuel/functions/fnc_disconnect.sqf @@ -21,9 +21,10 @@ params [["_unit", objNull, [objNull]], ["_nozzle", objNull, [objNull]]]; private _sink = _nozzle getVariable [QGVAR(sink), objNull]; if (isNull _sink) exitWith {}; -_sink setVariable [QGVAR(nozzle), objNull, true]; -_nozzle setVariable [QGVAR(sink), objNull, true]; +_sink setVariable [QGVAR(nozzle), nil, true]; +if (_nozzle isKindOf "Land_CanisterFuel_F") then { _nozzle setVariable [QEGVAR(cargo,canLoad), true, true]; }; +_nozzle setVariable [QGVAR(sink), nil, true]; _nozzle setVariable [QGVAR(isConnected), false, true]; [objNull, _nozzle, true] call FUNC(dropNozzle); -[_unit, objNull, _nozzle] call FUNC(takeNozzle); +[_unit, _nozzle] call FUNC(takeNozzle); diff --git a/addons/refuel/functions/fnc_dropNozzle.sqf b/addons/refuel/functions/fnc_dropNozzle.sqf index 575d318068..fac88d6591 100644 --- a/addons/refuel/functions/fnc_dropNozzle.sqf +++ b/addons/refuel/functions/fnc_dropNozzle.sqf @@ -19,14 +19,27 @@ #include "script_component.hpp" params [["_unit", objNull, [objNull]], ["_nozzle", objNull, [objNull]], ["_disconnectOnly", false, [false]]]; +TRACE_3("dropNozzle",_unit,_nozzle,_disconnectOnly); detach _nozzle; _nozzle setVariable [QGVAR(isRefueling), false, true]; if (_disconnectOnly) exitWith {}; _nozzle setVelocity [0, 0, 0]; -_nozzle setPosATL [(getPosATL _nozzle) select 0, (getPosATL _nozzle) select 1, 0.05]; + +private _groundPosition = getPosASL _nozzle; +private _posA = (getPosASL _nozzle) vectorAdd [0,0,0.05]; +private _posB = (getPosASL _nozzle) vectorAdd [0,0,-1000]; +private _intersections = lineIntersectsSurfaces [_posA, _posB, _unit, _nozzle, true, 1, "GEOM"]; +TRACE_1("",_intersections); +if (_intersections isEqualTo []) then { + _groundPosition set [2, (getTerrainHeightASL _groundPosition) + 0.005]; +} else { + _groundPosition = ((_intersections select 0) select 0) vectorAdd [0,0,0.005]; +}; +_nozzle setPosASL _groundPosition; +TRACE_1("finalPos",getPosATL _nozzle); if (isNull _unit) exitWith {}; -_unit setVariable [QGVAR(isRefueling), false, true]; +_unit setVariable [QGVAR(isRefueling), false]; _unit setVariable [QGVAR(nozzle), objNull, true]; diff --git a/addons/refuel/functions/fnc_getFuel.sqf b/addons/refuel/functions/fnc_getFuel.sqf index 863c017102..1ec128cb68 100644 --- a/addons/refuel/functions/fnc_getFuel.sqf +++ b/addons/refuel/functions/fnc_getFuel.sqf @@ -3,7 +3,7 @@ * Get the remaining fuel amount. * * Arguments: - * 0: Target + * 0: Fuel Source * * Return Value: * Fuel left (in liters) @@ -15,15 +15,15 @@ */ #include "script_component.hpp" -params [["_target", objNull, [objNull]]]; +params [["_source", objNull, [objNull]]]; -if (isNull _target) exitWith {0}; +if (isNull _source) exitWith {0}; -private _fuel = _target getVariable QGVAR(currentFuelCargo); +private _fuel = _source getVariable QGVAR(currentFuelCargo); if (isNil "_fuel") then { - _fuel = getNumber (configFile >> "CfgVehicles" >> typeOf _target >> QGVAR(fuelCargo)); - _target setVariable [QGVAR(currentFuelCargo), _fuel, true]; + _fuel = getNumber (configFile >> "CfgVehicles" >> typeOf _source >> QGVAR(fuelCargo)); + _source setVariable [QGVAR(currentFuelCargo), _fuel, true]; }; _fuel diff --git a/addons/refuel/functions/fnc_handleDisconnect.sqf b/addons/refuel/functions/fnc_handleDisconnect.sqf index edc3393cb4..a7e46e23fe 100644 --- a/addons/refuel/functions/fnc_handleDisconnect.sqf +++ b/addons/refuel/functions/fnc_handleDisconnect.sqf @@ -1,6 +1,6 @@ /* * Author: GitHawk - * Cleans up refuel + * Cleans up refuel on client disconnect. * * Arguments: * 0: Player @@ -15,12 +15,13 @@ */ #include "script_component.hpp" -params [["_disconnectedPlayer", objNull, [objNull]]]; +params [["_unit", objNull, [objNull]]]; +TRACE_1("disconnect",_unit); -if (isNull _disconnectedPlayer) exitWith {}; - -private _nozzle = _disconnectedPlayer getVariable [QGVAR(nozzle), objNull]; +if (isNull _unit) exitWith {}; +private _nozzle = _unit getVariable [QGVAR(nozzle), objNull]; if (isNull _nozzle) exitWith {}; -[_disconnectedPlayer, _nozzle] call FUNC(dropNozzle); +[_unit, _nozzle] call FUNC(dropNozzle); +[_unit, "forceWalk", "ACE_refuel", false] call EFUNC(common,statusEffect_set); diff --git a/addons/refuel/functions/fnc_handleKilled.sqf b/addons/refuel/functions/fnc_handleKilled.sqf deleted file mode 100644 index 045bf47028..0000000000 --- a/addons/refuel/functions/fnc_handleKilled.sqf +++ /dev/null @@ -1,26 +0,0 @@ -/* - * Author: GitHawk, Jonpas - * Handles medical on set dead event. - * - * Arguments: - * 0: Unit - * - * Return Value: - * None - * - * Example: - * [player] call ace_refuel_fnc_handleKilled - * - * Public: No - */ -#include "script_component.hpp" - -params [["_unit", objNull, [objNull]]]; - -if (!local _unit) exitWith {}; - -_unit setVariable [QGVAR(selectedWeaponOnRefuel), nil]; -private _nozzle = _unit getVariable [QGVAR(nozzle), objNull]; -if !(isNull _nozzle) then { - [_unit, _nozzle] call FUNC(dropNozzle); -}; diff --git a/addons/refuel/functions/fnc_handleRespawn.sqf b/addons/refuel/functions/fnc_handleRespawn.sqf new file mode 100644 index 0000000000..145cd16e60 --- /dev/null +++ b/addons/refuel/functions/fnc_handleRespawn.sqf @@ -0,0 +1,26 @@ +/* + * Author: Dystopian + * Clean variables on unit respawn. + * + * Arguments: + * 0: Unit + * + * Return Value: + * None + * + * Example: + * [player] call ace_refuel_fnc_handleRespawn + * + * Public: No + */ +#include "script_component.hpp" + +params ["_unit"]; +TRACE_1("respawn",_unit); + +if (isNull (_unit getVariable [QGVAR(nozzle), objNull])) exitWith {}; + +_unit setVariable [QGVAR(selectedWeaponOnRefuel), nil]; +_unit setVariable [QGVAR(isRefueling), false]; +_unit setVariable [QGVAR(nozzle), nil, true]; +_unit setVariable [QGVAR(hint), nil]; diff --git a/addons/refuel/functions/fnc_handleUnconscious.sqf b/addons/refuel/functions/fnc_handleUnconscious.sqf deleted file mode 100644 index bfcdcb3776..0000000000 --- a/addons/refuel/functions/fnc_handleUnconscious.sqf +++ /dev/null @@ -1,27 +0,0 @@ -/* - * Author: GitHawk, Jonpas - * Handles medical on unconscious event. - * - * Arguments: - * 0: Unit - * 1: Is Unconscious - * - * Return Value: - * None - * - * Example: - * [player, true] call ace_refuel_fnc_handleUnconscious - * - * Public: No - */ -#include "script_component.hpp" - -params [["_unit", objNull, [objNull]], ["_isUnconscious", false, [false]]]; - -if (!local _unit || {!_isUnconscious}) exitWith {}; - -[_unit, "forceWalk", "ACE_refuel", false] call EFUNC(common,statusEffect_set); -private _nozzle = _unit getVariable [QGVAR(nozzle), objNull]; -if !(isNull _nozzle) then { - [_unit, _nozzle] call FUNC(dropNozzle); -}; diff --git a/addons/refuel/functions/fnc_initSource.sqf b/addons/refuel/functions/fnc_initSource.sqf new file mode 100644 index 0000000000..51daa5f03e --- /dev/null +++ b/addons/refuel/functions/fnc_initSource.sqf @@ -0,0 +1,26 @@ +/* + * Author: Dystopian + * Adds refuel menu to object. + * + * Arguments: + * 0: Source + * + * Return Value: + * None + * + * Example: + * [cursorObject] call ace_refuel_fnc_initSource + * + * Public: No + */ +#include "script_component.hpp" + +if (!hasInterface) exitWith {}; + +params ["_source"]; +TRACE_2("init",_source,typeOf _source); + +[_source, 0, ["ACE_MainActions"], GVAR(mainAction)] call EFUNC(interact_menu,addActionToObject); +{ + [_source, 0, ["ACE_MainActions", QGVAR(Refuel)], _x] call EFUNC(interact_menu,addActionToObject); +} forEach GVAR(actions); diff --git a/addons/refuel/functions/fnc_makeJerryCan.sqf b/addons/refuel/functions/fnc_makeJerryCan.sqf index c826948fa2..96fc30adce 100644 --- a/addons/refuel/functions/fnc_makeJerryCan.sqf +++ b/addons/refuel/functions/fnc_makeJerryCan.sqf @@ -22,9 +22,11 @@ if (isNull _target || {_target isKindOf "AllVehicles"} || {_target getVariable [QGVAR(jerryCan), false]}) exitWith {}; -[_target, _fuelAmount] call FUNC(setFuel); -_target setVariable [QGVAR(jerryCan), true, true]; -_target setVariable [QGVAR(source), _target, true]; +if (isServer) then { + [_target, _fuelAmount] call FUNC(setFuel); // has global effects +}; +_target setVariable [QGVAR(jerryCan), true]; +_target setVariable [QGVAR(source), _target]; // Main Action private _action = [QGVAR(Refuel), @@ -36,19 +38,19 @@ private _action = [QGVAR(Refuel), [], [0, 0, 0], REFUEL_ACTION_DISTANCE] call EFUNC(interact_menu,createAction); -[_target, 0, [], _action] call EFUNC(interact_menu,addActionToObject); +[_target, 0, ["ACE_MainActions"], _action] call EFUNC(interact_menu,addActionToObject); // Add pickup _action = [QGVAR(PickUpNozzle), localize LSTRING(TakeNozzle), QPATHTOF(ui\icon_refuel_interact.paa), - {[_player, objNull, _target] call FUNC(TakeNozzle)}, + {[_player, _target] call FUNC(takeNozzle)}, {[_player, _target] call FUNC(canTakeNozzle)}, {}, [], [0, 0, 0], REFUEL_ACTION_DISTANCE] call EFUNC(interact_menu,createAction); -[_target, 0, [QGVAR(Refuel)], _action] call EFUNC(interact_menu,addActionToObject); +[_target, 0, ["ACE_MainActions", QGVAR(Refuel)], _action] call EFUNC(interact_menu,addActionToObject); // Add turnOn _action = [QGVAR(TurnOn), @@ -60,7 +62,7 @@ _action = [QGVAR(TurnOn), [], [0, 0, 0], REFUEL_ACTION_DISTANCE] call EFUNC(interact_menu,createAction); -[_target, 0, [QGVAR(Refuel)], _action] call EFUNC(interact_menu,addActionToObject); +[_target, 0, ["ACE_MainActions", QGVAR(Refuel)], _action] call EFUNC(interact_menu,addActionToObject); // Add turnOff _action = [QGVAR(TurnOff), @@ -72,7 +74,7 @@ _action = [QGVAR(TurnOff), [], [0, 0, 0], REFUEL_ACTION_DISTANCE] call EFUNC(interact_menu,createAction); -[_target, 0, [QGVAR(Refuel)], _action] call EFUNC(interact_menu,addActionToObject); +[_target, 0, ["ACE_MainActions", QGVAR(Refuel)], _action] call EFUNC(interact_menu,addActionToObject); // Add disconnect _action = [QGVAR(Disconnect), @@ -84,4 +86,4 @@ _action = [QGVAR(Disconnect), [], [0, 0, 0], REFUEL_ACTION_DISTANCE] call EFUNC(interact_menu,createAction); -[_target, 0, [QGVAR(Refuel)], _action] call EFUNC(interact_menu,addActionToObject); +[_target, 0, ["ACE_MainActions", QGVAR(Refuel)], _action] call EFUNC(interact_menu,addActionToObject); diff --git a/addons/refuel/functions/fnc_makeSource.sqf b/addons/refuel/functions/fnc_makeSource.sqf new file mode 100644 index 0000000000..05707e5301 --- /dev/null +++ b/addons/refuel/functions/fnc_makeSource.sqf @@ -0,0 +1,60 @@ +/* + * Author: Dystopian + * Makes an object into a refuel source. + * Run on server only. + * + * Arguments: + * 0: Fuel Source + * 1: Fuel amount (in liters) (default: 0) + * 2: Hooks positions (default: [[0,0,0]]) + * + * Return Value: + * None + * + * Example: + * [cursorObject, 100] call ace_refuel_fnc_makeSource + * + * Public: Yes + */ +#include "script_component.hpp" + +if (!isServer) exitWith {}; + +// Only run this after the settings are initialized +if !(EGVAR(common,settingsInitFinished)) exitWith { + EGVAR(common,runAtSettingsInitialized) pushBack [FUNC(makeSource), _this]; +}; + +params [ + ["_source", objNull, [objNull]], + ["_fuelCargo", 0, [0]], + ["_hooks", nil, [[]]] +]; +TRACE_3("makeSource",_source,_fuelCargo,_hooks); + +private _fuelCargoConfig = getNumber (configFile >> "CfgVehicles" >> typeOf _source >> QGVAR(fuelCargo)); + +if ( + isNull _source + || {_fuelCargo < 0 && {!(_fuelCargo in [REFUEL_INFINITE_FUEL, REFUEL_DISABLED_FUEL])}} + || {_fuelCargo != 0 && {_fuelCargo == _fuelCargoConfig}} +) exitWith {}; + +[_source, _fuelCargo] call FUNC(setFuel); + +if (_fuelCargo == REFUEL_DISABLED_FUEL) exitWith {}; + +if ( + !isNil "_hooks" + && {_hooks isEqualTypeAll []} + && {0 == {!(_x isEqualTypeParams [0,0,0]) || {3 < count _x}} count _hooks} +) then { + _source setVariable [QGVAR(hooks), _hooks, true]; +}; + +// check if menu already exists +if (_fuelCargoConfig != 0 || {!isNil {_source getVariable QGVAR(initSource_jipID)}}) exitWith {}; + +private _jipID = [QGVAR(initSource), [_source]] call CBA_fnc_globalEventJIP; +[_jipID, _source] call CBA_fnc_removeGlobalEventJIP; +_source setVariable [QGVAR(initSource_jipID), _jipID]; diff --git a/addons/refuel/functions/fnc_moduleRefuelSettings.sqf b/addons/refuel/functions/fnc_moduleRefuelSettings.sqf index 4d8f89425e..9e3e953160 100644 --- a/addons/refuel/functions/fnc_moduleRefuelSettings.sqf +++ b/addons/refuel/functions/fnc_moduleRefuelSettings.sqf @@ -10,6 +10,9 @@ * Return Value: * None * + * Example: + * [LOGIC, [bob, kevin], true] call ace_refuel_fnc_moduleRefuelSettings + * * Public: No */ @@ -20,5 +23,6 @@ params ["_logic", "", ["_activated", false, [false]]]; if !(_activated) exitWith {}; [_logic, QGVAR(rate), "rate"] call EFUNC(common,readSettingFromModule); +[_logic, QGVAR(hoseLength), "hoseLength"] call EFUNC(common,readSettingFromModule); -diag_log text format ["[ACE]: Refuel Module Initialized with flow rate: %1", GVAR(rate)]; +INFO_2("Refuel Module Initialized with flow rate: %1 - hoseLength: %2",GVAR(rate), GVAR(hoseLength)) diff --git a/addons/refuel/functions/fnc_onMouseButtonDown.sqf b/addons/refuel/functions/fnc_onMouseButtonDown.sqf new file mode 100644 index 0000000000..5c1951b280 --- /dev/null +++ b/addons/refuel/functions/fnc_onMouseButtonDown.sqf @@ -0,0 +1,53 @@ +/* + * Author: Dystopian + * Mouse button down event. + * + * Arguments: + * None + * + * Return Value: + * None + * + * Example: + * [] call ace_refuel_fnc_onMouseButtonDown + * + * Public: No + */ +#include "script_component.hpp" + +private _button = _this select 1; +private _unit = ACE_player; +private _nozzle = _unit getVariable [QGVAR(nozzle), objNull]; + +if (_button > 1 || {isNull _nozzle}) exitWith {}; + +getCursorObjectParams params ["_cursorObject", "", "_distance"]; + +// RMB +if (_button == 1) exitWith { + if ( + !isNull _cursorObject + && {_distance < REFUEL_NOZZLE_ACTION_DISTANCE} + && {[_unit, _cursorObject] call FUNC(canReturnNozzle)} + ) then { + [_unit, _cursorObject] call FUNC(returnNozzle); + } else { + [_unit, _nozzle] call FUNC(dropNozzle); + }; +}; + +// LMB +// code from attach, don't know what it is +private _virtualPosASL = (eyePos _unit) vectorAdd (positionCameraToWorld [0,0,0.6]) vectorDiff (positionCameraToWorld [0,0,0]); +if (cameraView == "EXTERNAL") then { + _virtualPosASL = _virtualPosASL vectorAdd ((positionCameraToWorld [0.3,0,0]) vectorDiff (positionCameraToWorld [0,0,0])); +}; +if ( + !isNull _cursorObject + && {_distance < REFUEL_NOZZLE_ACTION_DISTANCE} + && {1 == getNumber (configFile >> "CfgVehicles" >> (typeOf _cursorObject) >> QGVAR(canReceive))} + && {isNull (_cursorObject getVariable [QGVAR(nozzle), objNull])} + && {!lineIntersects [eyePos _unit, _virtualPosASL, _unit]} +) then { + [_unit, _cursorObject, _virtualPosASL, _nozzle] call FUNC(connectNozzleAction); +}; diff --git a/addons/refuel/functions/fnc_readFuelCounter.sqf b/addons/refuel/functions/fnc_readFuelCounter.sqf index 519b07897d..70c6a2799b 100644 --- a/addons/refuel/functions/fnc_readFuelCounter.sqf +++ b/addons/refuel/functions/fnc_readFuelCounter.sqf @@ -4,7 +4,7 @@ * * Arguments: * 0: Unit - * 1: Fuel Truck + * 1: Fuel Source * * Return Value: * None @@ -16,26 +16,14 @@ */ #include "script_component.hpp" -params [["_unit", objNull, [objNull]], ["_target", objNull, [objNull]]]; +params [["_unit", objNull, [objNull]], ["_source", objNull, [objNull]]]; -[ - 2, - [_unit, _target], - { - params ["_args"]; - _args params [["_unit", objNull, [objNull]], ["_target", objNull, [objNull]]]; +private _currentFuel = [_source] call FUNC(getFuel); +private _fuelCounter = if (_currentFuel == REFUEL_INFINITE_FUEL) then { + _source getVariable [QGVAR(fuelCounter), 0] +} else { + (_source getVariable [QGVAR(fuelCounter), _currentFuel]) - _currentFuel +}; - private _currentFuel = [_target] call FUNC(getFuel); - if (_currentFuel == REFUEL_INFINITE_FUEL) then { - private _fuelCounter = 0.01 * round (100 * (_target getVariable [QGVAR(fuelCounter), 0])); - [[LSTRING(Hint_FuelCounter), _fuelCounter], 1.5, _unit] call EFUNC(common,displayTextStructured); - } else { - private _fuelCounter = 0.01 * round (100 * ((_target getVariable [QGVAR(fuelCounter), _currentFuel]) - _currentFuel)); - [[LSTRING(Hint_FuelCounter), _fuelCounter], 1.5, _unit] call EFUNC(common,displayTextStructured); - }; - }, - "", - localize LSTRING(CheckFuelCounterAction), - {true}, - ["isnotinside"] -] call EFUNC(common,progressBar); +private _fuelCounter = 0.01 * round (100 * _fuelCounter); +[[LSTRING(Hint_FuelCounter), _fuelCounter], 1.5, _unit] call EFUNC(common,displayTextStructured); diff --git a/addons/refuel/functions/fnc_refuel.sqf b/addons/refuel/functions/fnc_refuel.sqf index ae17ce8d02..f23e0aae5b 100644 --- a/addons/refuel/functions/fnc_refuel.sqf +++ b/addons/refuel/functions/fnc_refuel.sqf @@ -4,22 +4,33 @@ * * Arguments: * 0: Unit - * 1: Target + * 1: Vehicle * 2: Nozzle * 3: Connection Point * * Return Value: * None * + * Example: + * [bob, kevin, nozzle, [2, 1, 5]] call ace_refuel_fnc_refuel + * * Public: No */ #include "script_component.hpp" -params [["_unit", objNull, [objNull]], ["_target", objNull, [objNull]], ["_nozzle", objNull, [objNull]], ["_connectToPoint", [0,0,0], [[]], 3]]; +params [["_unit", objNull, [objNull]], ["_sink", objNull, [objNull]], ["_nozzle", objNull, [objNull]], ["_connectToPoint", [0,0,0], [[]], 3]]; -private _rate = getNumber (configFile >> "CfgVehicles" >> (typeOf _target) >> QGVAR(flowRate)) * GVAR(rate); -private _maxFuel = getNumber (configFile >> "CfgVehicles" >> (typeOf _target) >> QGVAR(fuelCapacity)); +private _config = configFile >> "CfgVehicles" >> typeOf _sink; + +private _rate = getNumber (_config >> QGVAR(flowRate)) * GVAR(rate); +private _maxFuel = getNumber (_config >> QGVAR(fuelCapacity)); + +// Fall back to vanilla fuelCapacity value (only air and sea vehicles don't have this defined by default by us) +// Air and sea vehicles have that value properly defined in liters, unlike ground vehicles which is is formula of (range * tested factor) - different fuel consumption system than ground vehicles +if (_maxFuel == 0) then { + _maxFuel = getNumber (_config >> "fuelCapacity"); +}; [{ params ["_args", "_pfID"]; @@ -32,28 +43,27 @@ private _maxFuel = getNumber (configFile >> "CfgVehicles" >> (typeOf _target) >> if (!alive _source || {!alive _sink}) exitWith { [objNull, _nozzle] call FUNC(dropNozzle); _nozzle setVariable [QGVAR(isConnected), false, true]; - _nozzle setVariable [QGVAR(sink), objNull, true]; - _sink setVariable [QGVAR(nozzle), objNull, true]; + if (_nozzle isKindOf "Land_CanisterFuel_F") then { _nozzle setVariable [QEGVAR(cargo,canLoad), true, true]; }; + _nozzle setVariable [QGVAR(sink), nil, true]; + _sink setVariable [QGVAR(nozzle), nil, true]; [_pfID] call CBA_fnc_removePerFrameHandler; }; - private _tooFar = ((_sink modelToWorld _connectToPoint) distance (_source modelToWorld _connectFromPoint)) > (REFUEL_HOSE_LENGTH - 2); + private _hoseLength = _source getVariable [QGVAR(hoseLength), GVAR(hoseLength)]; + private _tooFar = ((_sink modelToWorld _connectToPoint) distance (_source modelToWorld _connectFromPoint)) > (_hoseLength - 2); if (_tooFar && {!(_nozzle getVariable [QGVAR(jerryCan), false])}) exitWith { [LSTRING(Hint_TooFar), 2, _unit] call EFUNC(common,displayTextStructured); [objNull, _nozzle] call FUNC(dropNozzle); _nozzle setVariable [QGVAR(isConnected), false, true]; - _nozzle setVariable [QGVAR(sink), objNull, true]; - _sink setVariable [QGVAR(nozzle), objNull, true]; + if (_nozzle isKindOf "Land_CanisterFuel_F") then { _nozzle setVariable [QEGVAR(cargo,canLoad), true, true]; }; + _nozzle setVariable [QGVAR(sink), nil, true]; + _sink setVariable [QGVAR(nozzle), nil, true]; [_pfID] call CBA_fnc_removePerFrameHandler; }; private _finished = false; private _fueling = _nozzle getVariable [QGVAR(isRefueling), false]; if (_fueling) then { - if (isEngineOn _sink) exitWith { - _nozzle setVariable [QGVAR(lastTickMissionTime), nil]; - _nozzle setVariable [QGVAR(isRefueling), false, true]; - }; private _fuelInSource = [_source] call FUNC(getFuel); if (_fuelInSource == 0) exitWith { [LSTRING(Hint_SourceEmpty), 2, _unit] call EFUNC(common,displayTextStructured); @@ -96,11 +106,11 @@ private _maxFuel = getNumber (configFile >> "CfgVehicles" >> (typeOf _target) >> }; }, 1, [ _nozzle getVariable QGVAR(source), - _target, + _sink, _unit, _nozzle, _rate, - fuel _target, + fuel _sink, _maxFuel, _nozzle getVariable [QGVAR(attachPos), [0,0,0]], _connectToPoint diff --git a/addons/refuel/functions/fnc_reset.sqf b/addons/refuel/functions/fnc_reset.sqf deleted file mode 100644 index d58f0a48ad..0000000000 --- a/addons/refuel/functions/fnc_reset.sqf +++ /dev/null @@ -1,40 +0,0 @@ -/* - * Author: GitHawk - * Resets a fuel vehicle in case is got bugged - * - * Arguments: - * 0: Fuel truck - * - * Return Value: - * None - * - * Example: - * [truck] call ace_refuel_fnc_reset - * - * Public: Yes - */ -#include "script_component.hpp" - -params [["_target", objNull, [objNull]]]; - -[_target, "blockEngine", "ACE_Refuel", false] call EFUNC(common,statusEffect_set); -_target setVariable [QGVAR(isConnected), false, true]; - -private _nozzle = _target getVariable [QGVAR(ownedNozzle), nil]; -if !(isNil "_nozzle") then { - private _nozzleTarget = _nozzle getVariable [QGVAR(sink), nil]; - if !(isNil "_nozzleTarget") then { - _nozzleTarget setVariable [QGVAR(nozzle), nil, true]; - }; - - private _rope = _nozzle getVariable [QGVAR(rope), objNull]; - if !(isNull _rope) then { - ropeDestroy _rope; - }; - - { - [QGVAR(resetLocal), [_x, _nozzle], _x] call CBA_fnc_targetEvent; - } count allPlayers; - deleteVehicle _nozzle; -}; -_target setVariable [QGVAR(ownedNozzle), nil, true]; diff --git a/addons/refuel/functions/fnc_resetLocal.sqf b/addons/refuel/functions/fnc_resetLocal.sqf deleted file mode 100644 index 2e80ab98d7..0000000000 --- a/addons/refuel/functions/fnc_resetLocal.sqf +++ /dev/null @@ -1,36 +0,0 @@ -/* - * Author: GitHawk - * Resets a player - * - * Arguments: - * 0: Fuel nozzle - * - * Return Value: - * None - * - * Example: - * [nozzle] call ace_refuel_fnc_resetLocal - * - * Public: No - */ -#include "script_component.hpp" - -params [["_unit", objNull, [objNull]], ["_nozzle", objNull, [objNull]]]; - -if (isNull _unit || - {isNull _nozzle} || - {!(_unit isKindOf "CAManBase")} || - {!local _unit}) exitWith {}; - -private _attachedNozzle = _unit getVariable [QGVAR(nozzle), nil]; -if (isNil "_attachedNozzle") exitWith {}; - -if (_nozzle != _attachedNozzle) exitWith {}; - -private _actionID = _unit getVariable [QGVAR(ReleaseActionID), -1]; -if (_actionID != -1) then { - _unit removeAction _actionID; - _unit setVariable [QGVAR(isRefueling), false, true]; - _unit setVariable [QGVAR(ReleaseActionID), nil]; - _unit setVariable [QGVAR(nozzle), nil, true]; -}; diff --git a/addons/refuel/functions/fnc_returnNozzle.sqf b/addons/refuel/functions/fnc_returnNozzle.sqf index 1bd364eafb..5da5935fd2 100644 --- a/addons/refuel/functions/fnc_returnNozzle.sqf +++ b/addons/refuel/functions/fnc_returnNozzle.sqf @@ -4,10 +4,10 @@ * * Arguments: * 0: Unit - * 1: Fuel Truck + * 1: Fuel Source * * Return Value: - * Returned Nozzle + * None * * Example: * [player, fuelTruck] call ace_refuel_fnc_returnNozzle @@ -16,44 +16,38 @@ */ #include "script_component.hpp" -params [["_unit", objNull, [objNull]], ["_target", objNull, [objNull]]]; +params [["_unit", objNull, [objNull]], ["_source", objNull, [objNull]]]; private _nozzle = _unit getVariable [QGVAR(nozzle), objNull]; -private _source = _nozzle getVariable QGVAR(source); -if (isNull _nozzle || {_source != _target}) exitWith {false}; +if (isNull _nozzle || {_source != _nozzle getVariable QGVAR(source)}) exitWith {}; [ - 2, - [_unit, _nozzle, _target], + TIME_PROGRESSBAR(REFUEL_PROGRESS_DURATION), + [_unit, _nozzle, _source], { params ["_args"]; - _args params [["_unit", objNull, [objNull]], ["_nozzle", objNull, [objNull]], ["_target", objNull, [objNull]]]; + _args params [["_unit", objNull, [objNull]], ["_nozzle", objNull, [objNull]], ["_source", objNull, [objNull]]]; _unit setVariable [QGVAR(nozzle), nil, true]; detach _nozzle; - [_unit, "forceWalk", "ACE_refuel", false] call EFUNC(common,statusEffect_set); - REFUEL_UNHOLSTER_WEAPON _unit setVariable [QGVAR(isRefueling), false]; - private _actionID = _unit getVariable [QGVAR(ReleaseActionID), -1]; - if (_actionID != -1) then { - _unit removeAction _actionID; - _unit setVariable [QGVAR(ReleaseActionID), nil]; - }; - _target setVariable [QGVAR(isConnected), false, true]; - _target setVariable [QGVAR(ownedNozzle), nil, true]; + _source setVariable [QGVAR(isConnected), false, true]; + _source setVariable [QGVAR(ownedNozzle), nil, true]; private _rope = _nozzle getVariable [QGVAR(rope), objNull]; if !(isNull _rope) then { ropeDestroy _rope; }; + private _helper = _nozzle getVariable [QGVAR(helper), objNull]; + if !(isNull _helper) then { + deleteVehicle _helper; + }; deleteVehicle _nozzle; - [_target, "blockEngine", "ACE_Refuel", false] call EFUNC(common,statusEffect_set); + [_source, "blockEngine", "ACE_Refuel", false] call EFUNC(common,statusEffect_set); }, "", localize LSTRING(ReturnAction), {true}, - ["isnotinside"] + [INTERACT_EXCEPTIONS] ] call EFUNC(common,progressBar); - -true diff --git a/addons/refuel/functions/fnc_setFuel.sqf b/addons/refuel/functions/fnc_setFuel.sqf index 6033660a48..0732160f4c 100644 --- a/addons/refuel/functions/fnc_setFuel.sqf +++ b/addons/refuel/functions/fnc_setFuel.sqf @@ -3,7 +3,7 @@ * Set the remaining fuel amount. * * Arguments: - * 0: Fuel Truck + * 0: Fuel Source * 1: Amount (in liters) * * Return Value: @@ -16,9 +16,9 @@ */ #include "script_component.hpp" -params [["_target", objNull, [objNull]], ["_fuel", nil, [0]]]; +params [["_source", objNull, [objNull]], ["_fuel", nil, [0]]]; -if (isNull _target || +if (isNull _source || {isNil "_fuel"}) exitWith {}; -_target setVariable [QGVAR(currentFuelCargo), _fuel, true]; +_source setVariable [QGVAR(currentFuelCargo), _fuel, true]; diff --git a/addons/refuel/functions/fnc_startNozzleInHandsPFH.sqf b/addons/refuel/functions/fnc_startNozzleInHandsPFH.sqf new file mode 100644 index 0000000000..fca638fc25 --- /dev/null +++ b/addons/refuel/functions/fnc_startNozzleInHandsPFH.sqf @@ -0,0 +1,113 @@ +/* + * Author: Dystopian + * PFH while nozzle is in hands. + * + * Arguments: + * 0: Unit + * 1: Nozzle + * + * Return Value: + * None + * + * Example: + * [player, nozzle] call ace_refuel_fnc_startNozzleInHandsPFH + * + * Public: No + */ +#include "script_component.hpp" + +#define DROP_NOZZLE [_unit, _nozzle] call FUNC(dropNozzle); +#define UNHOLSTER_WEAPON \ + _unit selectWeapon (_unit getVariable QGVAR(selectedWeaponOnRefuel)); \ + _unit setVariable [QGVAR(selectedWeaponOnRefuel), nil]; +#define END_PFH \ + _unit setVariable [QGVAR(hint), nil]; \ + call EFUNC(interaction,hideMouseHint); \ + [_unit, "forceWalk", "ACE_refuel", false] call EFUNC(common,statusEffect_set); \ + [_idPFH] call CBA_fnc_removePerFrameHandler; + +params ["_unit", "_nozzle"]; +TRACE_2("start",_unit,_nozzle); + +[{ + params ["_args", "_idPFH"]; + _args params ["_unit", "_nozzle"]; + + if !( + alive _unit + && {"" isEqualTo currentWeapon _unit || {_unit call EFUNC(common,isSwimming)}} + && {[_unit, objNull, [INTERACT_EXCEPTIONS, "notOnMap"]] call EFUNC(common,canInteractWith)} + && {!("unconscious" isEqualTo toLower animationState _unit)} + && {!(_unit getVariable ["ACE_isUnconscious", false])} + ) exitWith { + TRACE_3("stop dead/weapon/interact/uncon",_unit,alive _unit,currentWeapon _unit); + DROP_NOZZLE + _unit setVariable [QGVAR(selectedWeaponOnRefuel), nil]; + END_PFH + }; + + // check drop from external events + if (isNull (_unit getVariable [QGVAR(nozzle), objNull])) exitWith { + TRACE_2("stop drop",_unit,_nozzle); + UNHOLSTER_WEAPON + END_PFH + }; + + private _source = _nozzle getVariable [QGVAR(source), objNull]; + if !(alive _source) exitWith { + TRACE_3("stop source",_unit,_nozzle,_source); + DROP_NOZZLE + private _rope = _nozzle getVariable [QGVAR(rope), objNull]; + if !(isNull _rope) then { + ropeDestroy _rope; + }; + private _helper = _nozzle getVariable [QGVAR(helper), objNull]; + if !(isNull _helper) then { + deleteVehicle _helper; + }; + deleteVehicle _nozzle; + UNHOLSTER_WEAPON + END_PFH + }; + + if !(_unit == vehicle _unit && {_unit isEqualTo ACE_player}) exitWith { + TRACE_1("stop vehicle/player",_unit,vehicle _unit); + DROP_NOZZLE + UNHOLSTER_WEAPON + END_PFH + }; + + // check hoseLength < distance + if ( + !(_nozzle getVariable [QGVAR(jerryCan), false]) + && {((_source getVariable [QGVAR(hoseLength), GVAR(hoseLength)]) - 2) < _unit distance (_source modelToWorld (_nozzle getVariable QGVAR(attachPos)))} + ) exitWith { + TRACE_1("stop length",_unit); + DROP_NOZZLE + UNHOLSTER_WEAPON + END_PFH + [LSTRING(Hint_TooFar), 2, _unit] call EFUNC(common,displayTextStructured); + }; + + private _hintLMB = ""; + private _hintRMB = localize ELSTRING(dragging,Drop); + + getCursorObjectParams params ["_cursorObject", "", "_distance"]; + if (!isNull _cursorObject && {_distance < REFUEL_NOZZLE_ACTION_DISTANCE}) then { + if ( + 1 == getNumber (configFile >> "CfgVehicles" >> (typeOf _cursorObject) >> QGVAR(canReceive)) + && {isNull (_cursorObject getVariable [QGVAR(nozzle), objNull])} + ) then { + _hintLMB = localize LSTRING(Connect); + }; + if ([_unit, _cursorObject] call FUNC(canReturnNozzle)) then { + _hintRMB = localize LSTRING(Return); + }; + }; + + private _hint = [_hintLMB, _hintRMB]; + if !(_hint isEqualTo (_unit getVariable [QGVAR(hint), []])) then { + _unit setVariable [QGVAR(hint), _hint]; + _hint call EFUNC(interaction,showMouseHint); + }; +}, 0, [_unit, _nozzle]] call cba_fnc_addPerFrameHandler; diff --git a/addons/refuel/functions/fnc_takeNozzle.sqf b/addons/refuel/functions/fnc_takeNozzle.sqf index 9548b2ed2f..1c2382c21c 100644 --- a/addons/refuel/functions/fnc_takeNozzle.sqf +++ b/addons/refuel/functions/fnc_takeNozzle.sqf @@ -4,15 +4,13 @@ * * Arguments: * 0: Unit - * 1: Fuel Truck - * 2: Nozzle (optional) + * 1: Fuel Source or Nozzle * * Return Value: * None * * Example: - * [player, fuelTruck] call ace_refuel_fnc_takeNozzle - * [player, objNull, nozzle] call ace_refuel_fnc_takeNozzle + * [player, cursorObject] call ace_refuel_fnc_takeNozzle * * Public: No */ @@ -20,146 +18,81 @@ params [ ["_unit", objNull, [objNull]], - ["_target", objNull, [objNull]], - ["_nozzle", objNull, [objNull]] + ["_object", objNull, [objNull]] ]; -REFUEL_HOLSTER_WEAPON +[ + TIME_PROGRESSBAR(REFUEL_PROGRESS_DURATION), + [_unit, _object], + { + params ["_args"]; + _args params ["_unit", "_object"]; -private _endPosOffset = [0, 0, 0]; -if (isNull _nozzle) then { // func is called on fuel truck - _endPosOffset = getArray (configFile >> "CfgVehicles" >> typeOf _target >> QGVAR(hooks)); - if (count _endPosOffset == 2) then { - if (_unit distance (_target modelToWorld (_endPosOffset select 0)) < _unit distance (_target modelToWorld (_endPosOffset select 1))) then { - _endPosOffset = _endPosOffset select 0; - } else { - _endPosOffset = _endPosOffset select 1; - }; - } else { - _endPosOffset = _endPosOffset select 0; - }; - [ - 2, - [_unit, _target, _endPosOffset], - { - params ["_args"]; - _args params [ - ["_unit", objNull, [objNull]], - ["_target", objNull, [objNull]], - ["_endPosOffset", [0, 0, 0], [[]], 3] - ]; - - private _newNozzle = QGVAR(fuelNozzle) createVehicle position _unit; - _newNozzle attachTo [_unit, [-0.02,0.05,-0.12], "righthandmiddle1"]; - _unit setVariable [QGVAR(nozzle), _newNozzle, true]; - - if (_target isKindOf "AllVehicles") then { - // Currently ropeCreate requires its first parameter to be a real vehicle - private _rope = ropeCreate [_target, _endPosOffset, _newNozzle, [0, -0.20, 0.12], REFUEL_HOSE_LENGTH]; - _newNozzle setVariable [QGVAR(rope), _rope, true]; - }; - _newNozzle setVariable [QGVAR(attachPos), _endPosOffset, true]; - _newNozzle setVariable [QGVAR(source), _target, true]; - - [_target, "blockEngine", "ACE_Refuel", true] call EFUNC(common,statusEffect_set); - _target setVariable [QGVAR(isConnected), true, true]; - _target setVariable [QGVAR(ownedNozzle), _newNozzle, true]; - - [_unit, "forceWalk", "ACE_refuel", true] call EFUNC(common,statusEffect_set); - _unit setVariable [QGVAR(isRefueling), true]; - private _actionID = _unit getVariable [QGVAR(ReleaseActionID), -1]; - if (_actionID != -1) then { - _unit removeAction _actionID; - }; - _actionID = _unit addAction [ - format ["%1", localize ELSTRING(dragging,Drop)], - '_unit = _this select 0; _nozzle = _unit getVariable QGVAR(nozzle); [_unit, _nozzle] call FUNC(dropNozzle); [_unit, "forceWalk", "ACE_refuel", false] call EFUNC(common,statusEffect_set); REFUEL_UNHOLSTER_WEAPON', - nil, - 20, - false, - true, - "", - '!isNull (_target getVariable [QGVAR(nozzle), objNull])' - ]; - _unit setVariable [QGVAR(ReleaseActionID), _actionID]; - }, - "", - localize LSTRING(TakeNozzleAction), - {true}, - ["isnotinside"] - ] call EFUNC(common,progressBar); -} else { // func is called on muzzle either connected or on ground - [ - 2, - [_unit, _nozzle], - { - params ["_args"]; - _args params [ - ["_unit", objNull, [objNull]], - ["_nozzle", objNull, [objNull]] - ]; + if !([_unit, _object] call FUNC(canTakeNozzle)) exitWith {}; + private _source = _object; + private _nozzle = _object; + if (typeOf _object isEqualTo QGVAR(fuelNozzle) || {_object getVariable [QGVAR(jerryCan), false]}) then { // func is called on muzzle either connected or on ground + _source = _nozzle getVariable QGVAR(source); if (_nozzle getVariable [QGVAR(jerryCan), false]) then { _nozzle attachTo [_unit, [0,1,0], "pelvis"]; } else { _nozzle attachTo [_unit, [-0.02,0.05,-0.12], "righthandmiddle1"]; }; - _unit setVariable [QGVAR(nozzle), _nozzle, true]; + } else { // func is called on fuel truck + _nozzle = QGVAR(fuelNozzle) createVehicle [0,0,0]; + _nozzle attachTo [_unit, [-0.02,0.05,-0.12], "righthandmiddle1"]; - [_unit, "forceWalk", "ACE_refuel", true] call EFUNC(common,statusEffect_set); - _unit setVariable [QGVAR(isRefueling), true]; - private _actionID = _unit getVariable [QGVAR(ReleaseActionID), -1]; - if (_actionID != -1) then { - _unit removeAction _actionID; - }; - _actionID = _unit addAction [ - format ["%1", localize ELSTRING(dragging,Drop)], - '_unit = _this select 0; _nozzle = _unit getVariable QGVAR(nozzle); [_unit, _nozzle] call FUNC(dropNozzle); [_unit, "forceWalk", "ACE_refuel", false] call EFUNC(common,statusEffect_set); REFUEL_UNHOLSTER_WEAPON', - nil, - 20, - false, - true, - "", - '!isNull (_target getVariable [QGVAR(nozzle), objNull])' - ]; - _unit setVariable [QGVAR(ReleaseActionID), _actionID]; - }, - "", - localize LSTRING(TakeNozzleAction), - {true}, - ["isnotinside"] - ] call EFUNC(common,progressBar); - - _target = _nozzle getVariable QGVAR(source); - _endPosOffset = _nozzle getVariable QGVAR(attachPos); -}; -if !(_nozzle getVariable [QGVAR(jerryCan), false]) then { - [{ - params ["_args", "_pfID"]; - _args params [ - ["_unit", player, [objNull]], - ["_source", objNull, [objNull]], - ["_endPosOffset", [0, 0, 0], [[]], 3], - ["_nozzle", _unit getVariable [QGVAR(nozzle), objNull], [objNull]] - ]; - - if (isNull _source || {_unit distance (_source modelToWorld _endPosOffset) > (REFUEL_HOSE_LENGTH - 2)} || {!alive _source}) exitWith { - if !(isNull _nozzle) then { - [_unit, _nozzle] call FUNC(dropNozzle); - REFUEL_UNHOLSTER_WEAPON - - [_unit, "forceWalk", "ACE_refuel", false] call EFUNC(common,statusEffect_set); - if (isNull _source || {!alive _source}) then { - private _rope = _nozzle getVariable [QGVAR(rope), objNull]; - if !(isNull _rope) then { - ropeDestroy _rope; - }; - deleteVehicle _nozzle; + private _ropeTarget = _source; + if !(_source isKindOf "AllVehicles") then { + private _helper = QGVAR(helper) createVehicle [0,0,0]; + [QEGVAR(common,hideObjectGlobal), [_helper, true]] call CBA_fnc_serverEvent; + if ((getText (configFile >> "CfgVehicles" >> typeOf _source >> "simulation")) isEqualTo "thingX") then { + _helper attachTo [_source, [0,0,0]]; } else { - [LSTRING(Hint_TooFar), 2, _unit] call EFUNC(common,displayTextStructured); + _helper setPosWorld (getPosWorld _source); + _helper setDir (getDir _source); + _helper setVectorUp (vectorUp _source); }; + _nozzle setVariable [QGVAR(helper), _helper, true]; + _ropeTarget = _helper; }; - [_pfID] call cba_fnc_removePerFrameHandler; + private _attachPos = _source getVariable [QGVAR(hooks), getArray (configFile >> "CfgVehicles" >> typeOf _source >> QGVAR(hooks))]; + if (_attachPos isEqualTo []) then { + _attachPos = [[0,0,0]]; + }; + if (count _attachPos == 1) then { + _attachPos = _attachPos select 0; + } else { + // select closest hook + private _hookDistances = _attachPos apply {_unit distance (_source modelToWorld _x)}; + _attachPos = _attachPos select (_hookDistances find selectMin _hookDistances); + }; + private _hoseLength = _source getVariable [QGVAR(hoseLength), GVAR(hoseLength)]; + private _rope = ropeCreate [_ropeTarget, _attachPos, _nozzle, [0, -0.20, 0.12], _hoseLength]; + _nozzle setVariable [QGVAR(rope), _rope, true]; + _nozzle setVariable [QGVAR(attachPos), _attachPos, true]; + _nozzle setVariable [QGVAR(source), _source, true]; + + [_source, "blockEngine", "ACE_Refuel", true] call EFUNC(common,statusEffect_set); + _source setVariable [QGVAR(isConnected), true, true]; + _source setVariable [QGVAR(ownedNozzle), _nozzle, true]; }; - }, 0, [_unit, _target, _endPosOffset]] call cba_fnc_addPerFrameHandler; -}; + + _unit setVariable [QGVAR(nozzle), _nozzle, true]; + _unit setVariable [QGVAR(isRefueling), true]; + + // holster weapon + _unit setVariable [QGVAR(selectedWeaponOnRefuel), currentWeapon _unit]; + _unit call EFUNC(common,fixLoweredRifleAnimation); + _unit action ["SwitchWeapon", _unit, _unit, 299]; + + [_unit, "forceWalk", "ACE_refuel", true] call EFUNC(common,statusEffect_set); + + [_unit, _nozzle] call FUNC(startNozzleInHandsPFH); + }, + {}, + localize LSTRING(TakeNozzleAction), + {true}, + [INTERACT_EXCEPTIONS_REFUELING] +] call EFUNC(common,progressBar); diff --git a/addons/refuel/functions/fnc_turnOff.sqf b/addons/refuel/functions/fnc_turnOff.sqf index 7ce3d9c874..067d59c51e 100644 --- a/addons/refuel/functions/fnc_turnOff.sqf +++ b/addons/refuel/functions/fnc_turnOff.sqf @@ -18,18 +18,6 @@ params [["_unit", objNull, [objNull]], ["_nozzle", objNull, [objNull]]]; -[ - 2, - [_unit, _nozzle], - { - params ["_args"]; - _args params [["_unit", objNull, [objNull]], ["_nozzle", objNull, [objNull]]]; - _nozzle setVariable [QGVAR(lastTickMissionTime), nil]; - _nozzle setVariable [QGVAR(isRefueling), false, true]; - [LSTRING(Hint_Stopped), 1.5, _unit] call EFUNC(common,displayTextStructured); - }, - "", - localize LSTRING(TurnOffAction), - {true}, - ["isnotinside"] -] call EFUNC(common,progressBar); +_nozzle setVariable [QGVAR(lastTickMissionTime), nil]; +_nozzle setVariable [QGVAR(isRefueling), false, true]; +[LSTRING(Hint_Stopped), 1.5, _unit] call EFUNC(common,displayTextStructured); diff --git a/addons/refuel/functions/fnc_turnOn.sqf b/addons/refuel/functions/fnc_turnOn.sqf index 7a69de9b6f..e57cd3725a 100644 --- a/addons/refuel/functions/fnc_turnOn.sqf +++ b/addons/refuel/functions/fnc_turnOn.sqf @@ -18,18 +18,6 @@ params [["_unit", objNull, [objNull]], ["_nozzle", objNull, [objNull]]]; -[ - 2, - [_unit, _nozzle], - { - params ["_args"]; - _args params [["_unit", objNull, [objNull]], ["_nozzle", objNull, [objNull]]]; - _nozzle setVariable [QGVAR(lastTickMissionTime), CBA_missionTime]; - _nozzle setVariable [QGVAR(isRefueling), true, true]; - [LSTRING(Hint_Started), 1.5, _unit] call EFUNC(common,displayTextStructured); - }, - "", - localize LSTRING(TurnOnAction), - {true}, - ["isnotinside"] -] call EFUNC(common,progressBar); +_nozzle setVariable [QGVAR(lastTickMissionTime), CBA_missionTime]; +_nozzle setVariable [QGVAR(isRefueling), true, true]; +[LSTRING(Hint_Started), 1.5, _unit] call EFUNC(common,displayTextStructured); diff --git a/addons/refuel/script_component.hpp b/addons/refuel/script_component.hpp index 37b9502510..be346e0cca 100644 --- a/addons/refuel/script_component.hpp +++ b/addons/refuel/script_component.hpp @@ -2,6 +2,8 @@ #define COMPONENT_BEAUTIFIED Refuel #include "\z\ace\addons\main\script_mod.hpp" +// #define FAST_PROGRESSBARS +// #define DRAW_HOOKS_POS // #define DEBUG_MODE_FULL // #define DISABLE_COMPILE_CACHE // #define ENABLE_PERFORMANCE_COUNTERS @@ -17,15 +19,16 @@ #include "\z\ace\addons\main\script_macros.hpp" #define REFUEL_INFINITE_FUEL -10 +#define REFUEL_DISABLED_FUEL -1 #define REFUEL_ACTION_DISTANCE 7 -#define REFUEL_HOSE_LENGTH 12 +#define REFUEL_NOZZLE_ACTION_DISTANCE 2 +#define REFUEL_PROGRESS_DURATION 2 -#define REFUEL_HOLSTER_WEAPON \ - _unit setVariable [QGVAR(selectedWeaponOnRefuel), currentWeapon _unit]; \ - _unit call EFUNC(common,fixLoweredRifleAnimation); \ - _unit action ["SwitchWeapon", _unit, _unit, 99]; +#ifdef FAST_PROGRESSBARS + #define TIME_PROGRESSBAR(X) ((X) * 0.075) +#else + #define TIME_PROGRESSBAR(X) (X) +#endif -#define REFUEL_UNHOLSTER_WEAPON \ - _weaponSelect = _unit getVariable QGVAR(selectedWeaponOnRefuel); \ - _unit selectWeapon _weaponSelect; \ - _unit setVariable [QGVAR(selectedWeaponOnRefuel), nil]; +#define INTERACT_EXCEPTIONS_REFUELING "isNotInside", "isNotOnLadder", "isNotSwimming" +#define INTERACT_EXCEPTIONS INTERACT_EXCEPTIONS_REFUELING, "isNotRefueling" diff --git a/addons/refuel/stringtable.xml b/addons/refuel/stringtable.xml index 9bc9bf01fb..32aace7924 100644 --- a/addons/refuel/stringtable.xml +++ b/addons/refuel/stringtable.xml @@ -12,6 +12,9 @@ Parámetros de reabastecimiento Réglages de ravitaillement 給油設定 + 재급유 설정 + 加油设定 + 加油設定 Flow Rate @@ -20,10 +23,13 @@ Скорость заправки Velocidade da vazão Rychlost tankování - Rateo Flusso + Portata Flusso Caudal de llenado Vitesse du ravitaillement 流量 + 주유량 + 油料流量 + 油料流量 How fast should a vehicle be refueled? @@ -36,6 +42,9 @@ Cuán rápido se reabastecen los vehículos? A quelle vitesse devrait être ravitaillé un véhicule ? どのくらいの速さで車両へ給油しますか? + 차량이 얼마나 빨리 재급유될 수 있습니까? + 载具多快会加油完毕? + 載具多快會加油完畢? Refuel @@ -48,6 +57,9 @@ Reabastecer Ravitaillement 給油 + 재급유 + 加油 + 加油 Take fuel nozzle @@ -56,10 +68,13 @@ Взять топливный шланг Pegar o bocal de combustível Vzít výdejní pistoli - Prenti manica benzina + Prendi manica benzina Tomar surtidor Prendre la pompe 給油ノズルを取る + 주유기 획득 + 拿取燃料喷嘴 + 拿取燃料噴嘴 Taking fuel nozzle... @@ -68,10 +83,13 @@ Берем топливный шланг... Pegando o bocal de combustível... Beru výdejní pistoli... - Sto prendendo manica benzina... + Prendendo manicotto benzina... Tomando surtidor... Prise de la pompe... 給油ノズルを取っている・・・ + 주유기 획득중... + 拿取燃料喷嘴中... + 拿取燃料噴嘴中... Connect fuel nozzle @@ -84,6 +102,9 @@ Conectar surtidor Connecter la pompe 給油ノズルを接続する + 주유기 꼽기 + 连接燃料喷嘴 + 連接燃料噴嘴 Connecting fuel nozzle... @@ -92,10 +113,13 @@ Присоединяем топливный шланг... Conectando o bocal de combustível... Připojuji výdejní pistoli... - Sto collegando la manica benzina... + Collegando manicotto benzina... Conectando surtidor... Connection de la pompe... 給油ノズルを接続している・・・ + 주유기 꼽는중... + 连结燃料喷嘴中... + 連結燃料噴嘴中... Disconnect fuel nozzle @@ -104,10 +128,13 @@ Отсоединить топливный шланг Desconectar o bocal de combustível Odpojit výdejní pistoli - Scollega manica benzina + Scollega manicotto benzina Desconectar surtidor Déconnecter la pompe 給油ノズルを外した + 주유기 뽑기 + 断开燃料喷嘴 + 斷開燃料噴嘴 Connect @@ -120,6 +147,9 @@ Conectar Connecter 接続 + 꼽기 + 连结 + 連結 Check remaining fuel @@ -132,6 +162,9 @@ Verificar combustible remanente Vérifier le carburant restant 残燃料を見る + 남은 연료 확인 + 检查剩余燃料 + 檢查剩餘燃料 Checking remaining fuel... @@ -140,10 +173,13 @@ Проверяем остаток топлива... Verificando combustível restante... Kontroluji zůstatek paliva... - Sto controllando la benzina rimanente... + Controllando la benzina rimanente... Verificando combustible remanente,,, Vérifie le carburant restant... 残燃料を見ている・・・ + 남은 연료 확인중... + 检查剩余燃料中... + 檢查剩餘燃料中... There are %1 liters left. @@ -156,6 +192,9 @@ Quedan %1 litros. Il reste %1 litres. 後 %1 リットル残っている。 + %1 리터 남음 + 剩下%1公升的燃料。 + 剩下%1公升的燃料。 There is no fuel left. @@ -168,6 +207,9 @@ No queda combustible. Il n'y a plus de carburant. もう燃料は残っていない。 + 연료 없음. + 没有剩余的燃料 + 沒有剩餘的燃料 Cancel @@ -180,6 +222,9 @@ Cancelar Annuler 中止 + 취소 + 取消 + 取消 Failed @@ -192,6 +237,9 @@ Falló Echoué 失敗 + 실패 + 失败 + 失敗 Stop fueling @@ -204,18 +252,9 @@ Detener reabastecimiento Arrêter le ravitaillement 給油をやめる - - - Stopping fueling... - Stoppe Betankung... - Zatrzymywanie tankowania... - Останавливаем заправку... - Parando reabastecimento... - Zastavuji tankování... - Sto fermando il rifornimento... - Deteniendo reabastecimiento... - Arrête le ravitaillement... - 給油をやめている・・・ + 그만 재급유하기 + 停止加油 + 停止加油 Start fueling @@ -228,18 +267,17 @@ Comenzar reabastecimiento Débute le ravitaillement 給油を始める + 재급유 시작 + 开始加油 + 開始加油 - - Starting fueling... - Beginne Betankung... - Rozpoczynanie tankowania... - Начинаем заправку... - Começando reabastecimento... - Spouštím tankování... - Sto iniziando il rifornimento... - Comenzando reabastecimiento... - Début du ravitaillement... - 給油を始めている・・・ + + Couldn't turn on fuel nozzle + Kann Zapfpistole nicht anschalten + Impossibile iniziare il rifornimento + 給油を始められなかった + 無法開啟燃料噴嘴 + 无法开启燃料喷嘴 %1 Liters fueled @@ -252,6 +290,9 @@ %1 lt reabastecido %1 litres ravitaillés %1 リッターを給油した + %1 리터 재급유됨 + 已加入%1公升的燃料 + 已加入%1公升的燃料 The fuel source is empty. @@ -260,10 +301,13 @@ Источник топлива пустой. A fonte de combustível está vazia. Zdroj paliva je prázdný. - La fonte di benzina èvuota. + La fonte di benzina è vuota. La fuente de combustible está vacía. La source de carburant est vide. 給油元は空です。 + 燃料来源已空. + 燃料來源已空. + 연료공급처가 비었음. Maximum fuel hose length reached. @@ -272,10 +316,13 @@ Достигнута максимальная длина шланга. Distância máxima da mangueira de combustível alcançada. Dosažena maximální délka hadice - Distanza massima della manica raggiunta. + Distanza massima della pompa raggiunta. Máxima longitud de manguera alcanzada. Tuyau tendu au maximum 給油ホースはもうこれ以上届かない。 + 주유기 호스 최대 거리에 도달함. + 已加满至最大油量。 + 已加滿至最大油量。 Fueling completed @@ -288,6 +335,9 @@ Reabastecimiento completado Ravitaillement terminé 給油完了 + 재급유 완료함 + 加油完毕 + 加油完畢 Fueling stopped @@ -300,6 +350,9 @@ Reabastecimiento detenido Ravitaillement stoppé 給油を止めた + 재급유 멈춤 + 已停止加油 + 已停止加油 Fueling started @@ -312,6 +365,9 @@ Comenzó el reabastecimiento Ravitaillement débuté 給油を始めた + 재급유 시작함 + 已开始加油 + 已開始加油 Return fuel nozzle @@ -320,10 +376,13 @@ Вернуть топливный шланг Retornar bocal de combustível Vrátit výdejní pistoli - Riponi manica benzina + Riponi manicotto benzina Devolver surtidor Retourner la pompe 給油ノズルを戻す + 주유기 반환 + 放回燃料喷嘴 + 放回燃料噴嘴 Returning fuel nozzle... @@ -332,10 +391,13 @@ Возвращаем топливный шланг... Retornando bocal de combustível... Vracím výdejní pistoli... - Sto riponendo la manica della benzina... + Riponendo la manica della benzina... Devolviendo el surtidor... Retourne la pompe 給油ノズルを戻している・・・ + 주유기 반환중 + 放回燃料喷嘴中... + 放回燃料噴嘴中... Check fuel counter @@ -348,18 +410,9 @@ Verificar el contador de combustible Vérifier le compteur 燃料計を見る - - - Checking fuel counter... - Betrachte Tankuhr... - Sprawdzanie wskaźnika paliwa... - Проверяем счетчик топлива... - Verificando contador de combustível... - Konroluji palivoměr... - Sto controllando l'indicatore del livello benzina... - Verificando el contador de combustible - Vérification du compteur... - 燃料計を見ている・・・ + 연로카운터 확인 + 检查燃料表 + 檢查燃料表 %1 liters have been fueled. @@ -371,7 +424,57 @@ %1 litri sono stati riforniti. Se reabastecieron %1 lt %1 litres ont été écoulés. - %1 リッターがある + %1 リッターが給油された + %1 리터가 재급유되었습니다. + 已加入%1公升 + 已加入%1公升 + + + Refuel hose length + Betankung Schlauchlänge + Reabastecer longitud de manguera + Rifiuta lungezza tubo + 給油ホースの長さ + 加油软管长度 + 加油軟管長度 + Długość węża paliwowego + + + Fuel Cargo Volume + Tankvolumen + Объем топлива для заправки + 貯油量 + Capacità Carburante Cargo + 儲油量 + 储油量 + + + + The fuel volume available for refueling (-1 disable, -10 if infinite) + Das Tankvolumen, welches zum Nachtanken verfügbar ist (-1 deaktiviert, -10 unendlich) + Объем топлива, доступный для заправки других машин (-1 отключить, -10 если неограничен) + 給油用の貯油量を設定 (-1で無効、-10で無限) + La capacità del carburante disponibile per il rifornimento (-1 disabilita, -10 se infinito) + 設定有多少油料可供載具進行加油(-1時關閉,-10為無限油量) + 设定有多少油料可供载具进行加油(-1时关闭,-10为无限油量) + + + Refuel Hose attach coordinates + Befestigungskoordinaten der Zapfpistole + Координаты крепления шланга + 給油ノズルの取り付け座標 + Coordinate del tubo di rifornimento + 加油軟管安裝位置 + 加油软管安装位置 + + + Model coordinates used to attach refuel hose + Modelkoordinaten zum Anheften der Zapfpistole + Координаты модели, куда крепится заправочный шланг + 給油ノズルの取り付けにモデル座標を使用 + Coordinate del modello utilizzate per il fissaggio del tubo + 設定加油軟管會安裝到模型的哪個位置上 + 设定加油软管会安装到模型的哪个位置上 - \ No newline at end of file + diff --git a/addons/reload/ACE_UI.hpp b/addons/reload/ACE_UI.hpp index 8164d04b17..cfc2a26f9c 100644 --- a/addons/reload/ACE_UI.hpp +++ b/addons/reload/ACE_UI.hpp @@ -1,7 +1,7 @@ class ACE_UI { class ammoCount { class conditions { - ADDON = "(false)"; + ADDON = "cameraOn == (getConnectedUAV ACE_player)"; }; }; }; diff --git a/addons/reload/CfgVehicles.hpp b/addons/reload/CfgVehicles.hpp index a9fa4deadd..7a1d483bd9 100644 --- a/addons/reload/CfgVehicles.hpp +++ b/addons/reload/CfgVehicles.hpp @@ -6,14 +6,16 @@ class CfgVehicles { class GVAR(LinkBelt) { displayName = CSTRING(LinkBelt); distance = 2.0; - condition = QUOTE([ARR_2(_player, _target)] call FUNC(canLinkBelt)); + condition = QUOTE(([ARR_2(_player, _target)] call FUNC(getAmmoToLinkBelt)) > 0); statement = QUOTE([ARR_2(_player, _target)] call FUNC(startLinkingBelt)); + exceptions[] = {"isNotInside"}; }; class GVAR(CheckAmmo) { displayName = CSTRING(checkAmmo); distance = 2.0; condition = QUOTE([ARR_2(_player, _target)] call FUNC(canCheckAmmo)); statement = QUOTE([ARR_2(_player, _target)] call FUNC(checkAmmo)); + exceptions[] = {"isNotInside", "isNotSwimming", "isNotSitting"}; }; }; }; @@ -28,6 +30,7 @@ class CfgVehicles { distance = 2.0; condition = QUOTE([ARR_2(_player, _target)] call FUNC(canCheckAmmo)); statement = QUOTE([ARR_2(_player, _target)] call FUNC(checkAmmo)); + exceptions[] = {"isNotInside", "isNotSwimming", "isNotSitting"}; }; }; }; diff --git a/addons/reload/XEH_PREP.hpp b/addons/reload/XEH_PREP.hpp index bfd89b098e..f2b386ac37 100644 --- a/addons/reload/XEH_PREP.hpp +++ b/addons/reload/XEH_PREP.hpp @@ -1,6 +1,6 @@ PREP(canCheckAmmo); -PREP(canLinkBelt); +PREP(getAmmoToLinkBelt); PREP(checkAmmo); PREP(displayAmmo); PREP(startLinkingBelt); diff --git a/addons/reload/XEH_postInit.sqf b/addons/reload/XEH_postInit.sqf index 7a5e17464c..070edfa225 100644 --- a/addons/reload/XEH_postInit.sqf +++ b/addons/reload/XEH_postInit.sqf @@ -6,7 +6,7 @@ if (!hasInterface) exitWith {}; // Add keybinds ["ACE3 Weapons", QGVAR(checkAmmo), localize LSTRING(checkAmmo), { // Conditions: canInteract - if !([ACE_player, vehicle ACE_player, ["isNotInside", "isNotSitting"]] call EFUNC(common,canInteractWith)) exitWith {false}; + if !([ACE_player, vehicle ACE_player, ["isNotInside", "isNotSwimming", "isNotSitting"]] call EFUNC(common,canInteractWith)) exitWith {false}; // Conditions: specific if !(ACE_player call CBA_fnc_canUseWeapon || {(vehicle ACE_player) isKindOf "StaticWeapon"}) exitWith {false}; diff --git a/addons/reload/XEH_preInit.sqf b/addons/reload/XEH_preInit.sqf index a7feade1c3..b47cf6628d 100644 --- a/addons/reload/XEH_preInit.sqf +++ b/addons/reload/XEH_preInit.sqf @@ -2,6 +2,8 @@ ADDON = false; +PREP_RECOMPILE_START; #include "XEH_PREP.hpp" +PREP_RECOMPILE_END; ADDON = true; diff --git a/addons/reload/functions/fnc_checkAmmo.sqf b/addons/reload/functions/fnc_checkAmmo.sqf index baa0754f80..90500b867f 100644 --- a/addons/reload/functions/fnc_checkAmmo.sqf +++ b/addons/reload/functions/fnc_checkAmmo.sqf @@ -7,7 +7,12 @@ * 1: Target. Optional, if not suplied the player counts his personal or static weapon ammo * * Return Value: - * Nothing + * None + * + * Example: + * [bob, kevin] call ace_reload_fnc_checkAmmo + * + * Public: No */ #include "script_component.hpp" diff --git a/addons/reload/functions/fnc_displayAmmo.sqf b/addons/reload/functions/fnc_displayAmmo.sqf index 6aa8f013d9..f48bbb1e0a 100644 --- a/addons/reload/functions/fnc_displayAmmo.sqf +++ b/addons/reload/functions/fnc_displayAmmo.sqf @@ -6,8 +6,14 @@ * 0: Target * * Return Value: - * Nothing + * None + * + * Example: + * [bob] call ace_reload_fnc_displayAmmo + * + * Public: No */ + #include "script_component.hpp" #define COUNT_BARS 12 diff --git a/addons/reload/functions/fnc_canLinkBelt.sqf b/addons/reload/functions/fnc_getAmmoToLinkBelt.sqf similarity index 73% rename from addons/reload/functions/fnc_canLinkBelt.sqf rename to addons/reload/functions/fnc_getAmmoToLinkBelt.sqf index d29dc6efd6..decb922d80 100644 --- a/addons/reload/functions/fnc_canLinkBelt.sqf +++ b/addons/reload/functions/fnc_getAmmoToLinkBelt.sqf @@ -1,5 +1,5 @@ /* - * Author: esteldunedain + * Author: esteldunedain, phyma * Check if the target has an MG equiped with belt system that the player can link * * Arguments: @@ -7,10 +7,10 @@ * 1: Target * * Return Value: - * Can link belt + * Maximum ammo of magazine (-1 on error) * * Example: - * [player, cursorObject] call ace_reload_fnc_canLinkBelt; + * [player, cursorObject] call ace_reload_fnc_getAmmoToLinkBelt; * * Public: No */ @@ -18,18 +18,18 @@ params ["_player", "_target"]; -if (vehicle _target != _target) exitWith {false}; +if (vehicle _target != _target) exitWith {-1}; private _magazineType = currentMagazine _target; private _magazineCfg = configFile >> "CfgMagazines" >> _magazineType; -if (getNumber (_magazineCfg >> "ACE_isBelt") == 0) exitWith {false}; +if (getNumber (_magazineCfg >> "ACE_isBelt") == 0) exitWith {-1}; // Check if the ammo is not empty or full private _ammoCount = _target ammo currentWeapon _target; // Exit if the belt is full or empty -if (_ammoCount == 0 || getNumber (_magazineCfg >> "count") - _ammoCount == 0) exitWith {false}; +if (_ammoCount == 0 || getNumber (_magazineCfg >> "count") - _ammoCount == 0) exitWith {-1}; // Check if the player has any of the same magazines // Calculate max ammo @@ -39,4 +39,4 @@ private _maxAmmo = 0; _maxAmmo = _maxAmmo max (_x select 1); } forEach (magazinesAmmo _player select {_x select 0 == _magazineType}); -_maxAmmo > 0 +_maxAmmo diff --git a/addons/reload/functions/fnc_startLinkingBelt.sqf b/addons/reload/functions/fnc_startLinkingBelt.sqf index a1cc73635d..aac6ed4561 100644 --- a/addons/reload/functions/fnc_startLinkingBelt.sqf +++ b/addons/reload/functions/fnc_startLinkingBelt.sqf @@ -8,7 +8,13 @@ * * Return Value: * None + * + * Example: + * [bob, kevin] call ace_reload_fnc_startLinkingBelt + * + * Public: No */ + #include "script_component.hpp" params ["_player", "_target"]; @@ -16,25 +22,12 @@ params ["_player", "_target"]; if (vehicle _target != _target) exitWith {false}; private _magazineType = currentMagazine _target; -private _magazineCfg = configFile >> "CfgMagazines" >> _magazineType; -if (getNumber (_magazineCfg >> "ACE_isBelt") == 0) exitWith {false}; -// Check if the ammo is not empty or full -private _ammoCount = _target ammo currentWeapon _target; +private _maxAmmo = [_player, _target] call FUNC(getAmmoToLinkBelt); -// Exit if the belt is full or empty -if ((_ammoCount == 0) || (getNumber (_magazineCfg >> "count") - _ammoCount) == 0) exitWith {false}; - -// Check if the player has any of the same same magazines -// Calculate max ammo it can link -private _maxAmmo = 0; - -{ - _maxAmmo = _maxAmmo max (_x select 1); -} forEach (magazinesAmmo _player select {_x select 0 == _magazineType}); - -if (_maxAmmo == 0) exitWith {}; +//if _maxAmmo is below 0 we quit +if (_maxAmmo <= 0) exitWith {}; // Condition to call each frame private _condition = { @@ -50,7 +43,7 @@ private _onFinish = { }; private _onFailure = { - EXPLODE_3_PVT((_this select 0),_player,_target,_magazine); + (_this select 0) params ["_player", "_target", "_magazine"]; [_player, "AmovPknlMstpSrasWrflDnon", 1] call EFUNC(common,doAnimation); // Add back the magazine with the former ammo count @@ -63,4 +56,4 @@ private _onFailure = { [_player, _magazineType, _maxAmmo] call EFUNC(common,removeSpecificMagazine); // Call progress bar -[4, [_player, _target, [_magazineType, _maxAmmo]], _onFinish, _onFailure, (localize LSTRING(LinkingBelt)), _condition] call EFUNC(common,progressBar); +[4, [_player, _target, [_magazineType, _maxAmmo]], _onFinish, _onFailure, (localize LSTRING(LinkingBelt)), _condition, ["isNotInside"]] call EFUNC(common,progressBar); diff --git a/addons/reload/stringtable.xml b/addons/reload/stringtable.xml index b84e534cb5..d1f7e0318c 100644 --- a/addons/reload/stringtable.xml +++ b/addons/reload/stringtable.xml @@ -1,4 +1,4 @@ - + @@ -10,9 +10,12 @@ Sprawdź stan amunicji przy przeładowaniu broni Vérification des munitions au rechargement Lőszer ellenőrzése a fegyver újratöltésekor - Controlla le munizioni ricaricando + Controlla le munizioni durante il ricaricamento Conferir munição ao recarregar a arma 再装填された武器の弾薬を確認 + 재장전시 장탄수 확인 + 在重新装填时检查弹药 + 在重新裝填時檢查彈藥 Check the ammo in your new magazine on magazine reload. @@ -26,6 +29,9 @@ Controlla le munizioni rimanenti nel caricatore in fase di cambio caricatore. Confere a munição no seu novo carregador ao recarregar a arma あたらしく装填された弾倉の弾薬を確認します。 + 재장전시 새탄창에 있는 탄약을 확인합니다. + 在重新装填时检查新弹匣上的弹药. + 在重新裝填時檢查新彈匣上的彈藥. Check Ammo @@ -39,6 +45,9 @@ Conferir munições Проверить боеприпасы 弾薬を確認 + 장탄수 확인 + 检查弹药 + 檢查彈藥 Ammo @@ -52,6 +61,9 @@ Munições Боеприпасы 弾薬 + 장탄수 + 弹药 + 彈藥 Link belt @@ -64,7 +76,10 @@ Töltényheveder összekötése Attacca la tracolla Ligar cintos de munição - ベルト リンク + ベルトをつなげる + 벨트 연결 + 连接弹链 + 連接彈鏈 Linking belt... @@ -75,9 +90,12 @@ Podłączanie taśmy... Gurt anhängen... Töltényheveder összekötése folyamatban... - Attacco la tracolla... + Attaccando la tracolla... Ligando cintos... ベルトをつなげている・・・ + 벨트 연결중... + 连接弹链中... + 連接彈鏈中... - \ No newline at end of file + diff --git a/addons/reloadlaunchers/CfgVehicles.hpp b/addons/reloadlaunchers/CfgVehicles.hpp index 3d7a5c9353..eccd30d1f7 100644 --- a/addons/reloadlaunchers/CfgVehicles.hpp +++ b/addons/reloadlaunchers/CfgVehicles.hpp @@ -8,6 +8,7 @@ class CfgVehicles { selection = "launcher"; distance = 4; condition = ""; + exceptions[] = {"isNotInside", "isNotSwimming"}; insertChildren = QUOTE(_this call FUNC(addMissileReloadActions)); }; }; diff --git a/addons/reloadlaunchers/XEH_preInit.sqf b/addons/reloadlaunchers/XEH_preInit.sqf index a7feade1c3..b47cf6628d 100644 --- a/addons/reloadlaunchers/XEH_preInit.sqf +++ b/addons/reloadlaunchers/XEH_preInit.sqf @@ -2,6 +2,8 @@ ADDON = false; +PREP_RECOMPILE_START; #include "XEH_PREP.hpp" +PREP_RECOMPILE_END; ADDON = true; diff --git a/addons/reloadlaunchers/functions/fnc_addMissileReloadActions.sqf b/addons/reloadlaunchers/functions/fnc_addMissileReloadActions.sqf index 6a9d779d02..a3caa76152 100644 --- a/addons/reloadlaunchers/functions/fnc_addMissileReloadActions.sqf +++ b/addons/reloadlaunchers/functions/fnc_addMissileReloadActions.sqf @@ -3,11 +3,14 @@ * Create one action per reloadable missile * * Arguments: - * 1: Target (Object) - * 0: Player (Object) + * 1: Target + * 0: Player * * Return Value: - * Children actions (Array) + * Children actions + * + * Example: + * [bob, kevin] call ace_reloadlaunchers_fnc_addMissileReloadActions * * Public: No * @@ -30,20 +33,18 @@ private _loadableMissiles = [_unit, _weapon] call FUNC(getLoadableMissiles); TRACE_2("",_weapon,_loadableMissiles); { - private ["_name", "_displayName", "_statement", "_condition", "_action"]; + private _name = format [QGVAR(Missile_%1), _x]; + private _displayName = format [localize LSTRING(LoadMagazine), getText (configFile >> "CfgMagazines" >> _x >> "displayName")]; - _name = format [QGVAR(Missile_%1), _x]; - _displayName = format [localize LSTRING(LoadMagazine), getText (configFile >> "CfgMagazines" >> _x >> "displayName")]; - - _statement = { + private _statement = { (_this select 2) call DFUNC(load); }; - _condition = { + private _condition = { (_this select 2) call DFUNC(canLoad) }; - _action = [_name, _displayName, "", _statement, _condition, {}, [_unit, _target, _weapon, _x], "", 4] call EFUNC(interact_menu,createAction); + private _action = [_name, _displayName, "", _statement, _condition, {}, [_unit, _target, _weapon, _x], "", 4] call EFUNC(interact_menu,createAction); _actions pushBack [_action, [], _unit]; } forEach _loadableMissiles; diff --git a/addons/reloadlaunchers/functions/fnc_canLoad.sqf b/addons/reloadlaunchers/functions/fnc_canLoad.sqf index 5072d44a48..2e578b1be7 100644 --- a/addons/reloadlaunchers/functions/fnc_canLoad.sqf +++ b/addons/reloadlaunchers/functions/fnc_canLoad.sqf @@ -3,13 +3,16 @@ * Check of the unit can reload the launcher of target unit. * * Arguments: - * 0: Unit to do the reloading (Object) - * 1: Unit eqipped with launcher (Object) - * 2: weapon name (String) - * 3: missile name (String) + * 0: Unit to do the reloading + * 1: Unit eqipped with launcher + * 2: weapon name + * 3: missile name * * Return Value: - * NONE + * None + * + * Example: + * [bob, kevin, "weapon", "missile"] call ace_reloadlaunchers_fnc_canLoad * * Public: No */ @@ -20,7 +23,7 @@ TRACE_4("params",_unit,_target,_weapon,_magazine); if (!alive _target) exitWith {false}; if (vehicle _target != _target) exitWith {false}; -if !([_unit, _target, []] call EFUNC(common,canInteractWith)) exitWith {false}; +if !([_unit, _target, ["isNotInside", "isNotSwimming"]] call EFUNC(common,canInteractWith)) exitWith {false}; // target is awake if (_target getVariable ["ACE_isUnconscious", false]) exitWith {false}; diff --git a/addons/reloadlaunchers/functions/fnc_getLoadableMissiles.sqf b/addons/reloadlaunchers/functions/fnc_getLoadableMissiles.sqf index 40766a5905..2dc8cf5925 100644 --- a/addons/reloadlaunchers/functions/fnc_getLoadableMissiles.sqf +++ b/addons/reloadlaunchers/functions/fnc_getLoadableMissiles.sqf @@ -3,11 +3,14 @@ * Return all magazine types from reloaders inventory that are compatible with given weapon. * * Arguments: - * 0: Unit to to the reload (Object) - * 1: A launcher (String) + * 0: Unit to to the reload + * 1: A launcher * * Return Value: - * Reloable magazines (Array) + * Reloable magazines + * + * Example: + * [bob, launcher] call ace_reloadlaunchers_fnc_getLoadableMissiles * * Public: No */ diff --git a/addons/reloadlaunchers/functions/fnc_load.sqf b/addons/reloadlaunchers/functions/fnc_load.sqf index 2f822bb6d7..2017ecf94e 100644 --- a/addons/reloadlaunchers/functions/fnc_load.sqf +++ b/addons/reloadlaunchers/functions/fnc_load.sqf @@ -3,13 +3,16 @@ * Reload a launcher * * Arguments: - * 0: Unit with magazine (Object) - * 1: Unit with launcher (Object) - * 2: weapon name (String) - * 3: missile name (String) + * 0: Unit with magazine + * 1: Unit with launcher + * 2: weapon name + * 3: missile name * * Return Value: - * NONE + * None + * + * Example: + * [bob, kevin, "weapon", "missile"] call ace_reloadlaunchers_fnc_load * * Public: No */ @@ -28,21 +31,20 @@ private _reloadTime = if (isNumber (configFile >> "CfgWeapons" >> _weapon >> QGV [_unit] call EFUNC(common,goKneeling); // show progress bar -private ["_onSuccess", "_onFailure", "_condition"]; -_onSuccess = { +private _onSuccess = { (_this select 0 select 0) removeMagazine (_this select 0 select 3); [QGVAR(reloadLauncher), _this select 0, _this select 0 select 1] call CBA_fnc_targetEvent; [localize LSTRING(LauncherLoaded)] call DEFUNC(common,displayTextStructured); }; -_onFailure = { +private _onFailure = { [localize ELSTRING(common,ActionAborted)] call DEFUNC(common,displayTextStructured); }; -_condition = { +private _condition = { (_this select 0) call DFUNC(canLoad) && {(_this select 0 select 0) distance (_this select 0 select 1) < 4} }; -[_reloadTime, [_unit, _target, _weapon, _magazine], _onSuccess, _onFailure, localize LSTRING(LoadingLauncher), _condition] call EFUNC(common,progressBar); +[_reloadTime, [_unit, _target, _weapon, _magazine], _onSuccess, _onFailure, localize LSTRING(LoadingLauncher), _condition, ["isNotInside", "isNotSwimming"]] call EFUNC(common,progressBar); diff --git a/addons/reloadlaunchers/functions/fnc_reloadLauncher.sqf b/addons/reloadlaunchers/functions/fnc_reloadLauncher.sqf index 96db7cdca5..cd2295d7d0 100644 --- a/addons/reloadlaunchers/functions/fnc_reloadLauncher.sqf +++ b/addons/reloadlaunchers/functions/fnc_reloadLauncher.sqf @@ -3,13 +3,16 @@ * Reload a launcher * * Arguments: - * 0: Unit to do the reloading (Object) - * 1: Target to rload (Object) - * 2: weapon name (String) - * 3: missile name (String) + * 0: Unit to do the reloading + * 1: Target to rload + * 2: weapon name + * 3: missile name * * Return Value: - * NONE + * None + * + * Example: + * [bob, kevin, "weapon", "missile"] call ace_reloadlaunchers_fnc_realoadLauncher * * Public: No */ @@ -24,4 +27,4 @@ if (currentWeapon _target != _weapon) exitWith {}; if (currentMagazine _target != "") exitWith {}; // command is wip, reload time for launchers is not intended. -_target addWeaponItem [_weapon, _magazine]; +_target addWeaponItem [_weapon, _magazine]; diff --git a/addons/reloadlaunchers/stringtable.xml b/addons/reloadlaunchers/stringtable.xml index 6d94d6c7f3..ccbca809f0 100644 --- a/addons/reloadlaunchers/stringtable.xml +++ b/addons/reloadlaunchers/stringtable.xml @@ -1,4 +1,4 @@ - + @@ -13,6 +13,9 @@ Carica lanciamissili Recarregar lançador ランチャーを装填 + 무기 재장전 + 装载发射器 + 裝載發射器 Loading launcher... @@ -23,9 +26,12 @@ Nabíjím odpalovač... Ładowanie wyrzutni... Kilövő betöltés alatt... - Carico il lanciamissili... + Caricando il lanciamissili... Recarregando lançador... ランチャーを装填している・・・ + 무기 재장전중... + 装载发射器中... + 裝載發射器中... Launcher loaded @@ -39,6 +45,9 @@ Lanciamissili caricato Lançador Carregado ランチャーの装填完了 + 무기 재장전됨 + 发射器装载完毕 + 發射器裝載完畢 Load %1 @@ -52,6 +61,9 @@ Caricato %1 Recarregar %1 %1 へ装填 + %1 장전 + 装载%1 + 裝載%1 - \ No newline at end of file + diff --git a/addons/repair/ACE_Repair.hpp b/addons/repair/ACE_Repair.hpp index 6e5eac4fa8..3cea9ed7ca 100644 --- a/addons/repair/ACE_Repair.hpp +++ b/addons/repair/ACE_Repair.hpp @@ -72,7 +72,7 @@ class ACE_Repair { requiredEngineer = QGVAR(engineerSetting_fullRepair); repairLocations[] = {QGVAR(fullRepairLocation)}; repairingTime = 30; - condition = "damage _target > 0"; + condition = "0 < ({_x>0} count (getAllHitPointsDamage _target param [2,[]]))"; callbackSuccess = QUOTE(call FUNC(doFullRepair)); itemConsumed = QGVAR(consumeItem_ToolKit); }; diff --git a/addons/repair/ACE_Settings.hpp b/addons/repair/ACE_Settings.hpp index 46228e2e44..5abb46f610 100644 --- a/addons/repair/ACE_Settings.hpp +++ b/addons/repair/ACE_Settings.hpp @@ -8,19 +8,19 @@ class ACE_Settings { category = ECSTRING(OptionsMenu,CategoryLogistics); }; class GVAR(engineerSetting_repair) { - displayName = CSTRING(enginerSetting_Repair_name); - description = CSTRING(enginerSetting_Repair_description); + displayName = CSTRING(engineerSetting_Repair_name); + description = CSTRING(engineerSetting_Repair_description); typeName = "SCALAR"; value = 1; - values[] = {CSTRING(engineerSetting_anyone), CSTRING(engineerSetting_EngineerOnly), CSTRING(engineerSetting_RepairSpecialistOnly)}; + values[] = {CSTRING(engineerSetting_anyone), CSTRING(engineerSetting_EngineerOnly), CSTRING(engineerSetting_AdvancedOnly)}; category = ECSTRING(OptionsMenu,CategoryLogistics); }; class GVAR(engineerSetting_wheel) { - displayName = CSTRING(enginerSetting_Wheel_name); - description = CSTRING(enginerSetting_Wheel_description); + displayName = CSTRING(engineerSetting_Wheel_name); + description = CSTRING(engineerSetting_Wheel_description); typeName = "SCALAR"; value = 0; - values[] = {CSTRING(engineerSetting_anyone), CSTRING(engineerSetting_EngineerOnly), CSTRING(engineerSetting_RepairSpecialistOnly)}; + values[] = {CSTRING(engineerSetting_anyone), CSTRING(engineerSetting_EngineerOnly), CSTRING(engineerSetting_AdvancedOnly)}; category = ECSTRING(OptionsMenu,CategoryLogistics); }; class GVAR(repairDamageThreshold) { @@ -58,7 +58,7 @@ class ACE_Settings { description = CSTRING(engineerSetting_fullRepair_description); typeName = "SCALAR"; value = 2; - values[] = {CSTRING(engineerSetting_anyone), CSTRING(engineerSetting_EngineerOnly), CSTRING(engineerSetting_RepairSpecialistOnly)}; + values[] = {CSTRING(engineerSetting_anyone), CSTRING(engineerSetting_EngineerOnly), CSTRING(engineerSetting_AdvancedOnly)}; category = ECSTRING(OptionsMenu,CategoryLogistics); }; class GVAR(addSpareParts) { diff --git a/addons/repair/CfgEden.hpp b/addons/repair/CfgEden.hpp index eb7933fee4..1c1263755b 100644 --- a/addons/repair/CfgEden.hpp +++ b/addons/repair/CfgEden.hpp @@ -9,8 +9,8 @@ class Cfg3DEN { }; }; class GVAR(isEngineerControl): Title { - attributeLoad = "(_this controlsGroupCtrl 100) lbsetcursel (((_value + 1) min 3) max 0);"; - attributeSave = "(missionnamespace getvariable ['ace_isEng_temp',0]) - 1;"; + attributeLoad = "(_this controlsGroupCtrl 100) lbSetCurSel (((_value + 1) min 3) max 0);"; + attributeSave = "(lbCurSel (_this controlsGroupCtrl 100)) - 1"; class Controls: Controls { class Title: Title{}; class Value: ctrlToolbox { @@ -21,8 +21,7 @@ class Cfg3DEN { h = "5 * (pixelH * pixelGrid * 0.50)"; rows = 1; columns = 4; - strings[] = {"$STR_3DEN_Attributes_Lock_Default_text", CSTRING(AssignEngineerRole_role_none), CSTRING(AssignEngineerRole_role_engineer), CSTRING(AssignEngineerRole_role_specialist)}; - onToolboxSelChanged = "missionnamespace setvariable ['ace_isEng_temp',_this select 1];"; + strings[] = {"$STR_3DEN_Attributes_Lock_Default_text", CSTRING(AssignEngineerRole_role_none), CSTRING(AssignEngineerRole_role_engineer), CSTRING(AssignEngineerRole_role_advanced)}; }; }; }; diff --git a/addons/repair/CfgEventHandlers.hpp b/addons/repair/CfgEventHandlers.hpp index 559d2d4d7e..3e47f9f96f 100644 --- a/addons/repair/CfgEventHandlers.hpp +++ b/addons/repair/CfgEventHandlers.hpp @@ -37,7 +37,7 @@ class Extended_InitPost_EventHandlers { class Helicopter { class ADDON { init = QUOTE(_this call DFUNC(addRepairActions)); - exclude[] = {QEGVAR(fastroping,helper), "ACE_friesBase"}; + exclude[] = {QEGVAR(fastroping,helper), "ACE_friesBase", QEGVAR(refuel,helper)}; }; }; class Plane { diff --git a/addons/repair/CfgVehicles.hpp b/addons/repair/CfgVehicles.hpp index 56f9ccea73..29dca0209a 100644 --- a/addons/repair/CfgVehicles.hpp +++ b/addons/repair/CfgVehicles.hpp @@ -10,7 +10,7 @@ priority = 2; \ icon = "\A3\ui_f\data\igui\cfg\actions\repair_ca.paa"; \ distance = 4; \ - exceptions[] = {"isNotOnLadder"}; \ + exceptions[] = {"isNotSwimming", "isNotOnLadder"}; \ }; \ }; \ }; @@ -32,23 +32,23 @@ class CfgVehicles { author = ECSTRING(Common,ACETeam); class Arguments { class engineerSetting_Repair { - displayName = CSTRING(enginerSetting_Repair_name); - description = CSTRING(enginerSetting_Repair_description); + displayName = CSTRING(engineerSetting_Repair_name); + description = CSTRING(engineerSetting_Repair_description); typeName = "NUMBER"; class values { class anyone { name = CSTRING(engineerSetting_anyone); value = 0; }; class Engineer { name = CSTRING(engineerSetting_EngineerOnly); value = 1; default = 1; }; - class Special { name = CSTRING(engineerSetting_RepairSpecialistOnly); value = 2; }; + class Advanced { name = CSTRING(engineerSetting_AdvancedOnly); value = 2; }; }; }; class engineerSetting_Wheel { - displayName = CSTRING(enginerSetting_Wheel_name); - description = CSTRING(enginerSetting_Wheel_description); + displayName = CSTRING(engineerSetting_Wheel_name); + description = CSTRING(engineerSetting_Wheel_description); typeName = "NUMBER"; class values { class anyone { name = CSTRING(engineerSetting_anyone); value = 0; default = 1; }; class Engineer { name = CSTRING(engineerSetting_EngineerOnly); value = 1; }; - class Special { name = CSTRING(engineerSetting_RepairSpecialistOnly); value = 2; }; + class Advanced { name = CSTRING(engineerSetting_AdvancedOnly); value = 2; }; }; }; class repairDamageThreshold { @@ -91,7 +91,7 @@ class CfgVehicles { class values { class anyone { name = CSTRING(engineerSetting_anyone); value = 0; }; class Engineer { name = CSTRING(engineerSetting_EngineerOnly); value = 1; }; - class Special { name = CSTRING(engineerSetting_RepairSpecialistOnly); value = 2; default = 1;}; + class Advanced { name = CSTRING(engineerSetting_AdvancedOnly); value = 2; default = 1;}; }; }; class addSpareParts { @@ -150,7 +150,7 @@ class CfgVehicles { default = 1; }; class doctor { - name = CSTRING(AssignEngineerRole_role_specialist); + name = CSTRING(AssignEngineerRole_role_advanced); value = 2; }; }; @@ -471,7 +471,7 @@ class CfgVehicles { transportRepair = 0; }; - class Truck_02_engineeral_base_F: Truck_02_box_base_F { + class Truck_02_medical_base_F: Truck_02_box_base_F { GVAR(canRepair) = 0; }; diff --git a/addons/repair/XEH_PREP.hpp b/addons/repair/XEH_PREP.hpp index 692bee6112..7c2e5a1f15 100644 --- a/addons/repair/XEH_PREP.hpp +++ b/addons/repair/XEH_PREP.hpp @@ -24,6 +24,7 @@ PREP(isInRepairFacility); PREP(isNearRepairVehicle); PREP(isRepairVehicle); PREP(modifyInteraction); +PREP(modifySelectionInteraction); PREP(moduleAddSpareParts); PREP(moduleAssignEngineer); PREP(moduleAssignRepairVehicle); diff --git a/addons/repair/XEH_preInit.sqf b/addons/repair/XEH_preInit.sqf index 7d9578b8ec..8e6a606f0f 100644 --- a/addons/repair/XEH_preInit.sqf +++ b/addons/repair/XEH_preInit.sqf @@ -2,7 +2,9 @@ ADDON = false; +PREP_RECOMPILE_START; #include "XEH_PREP.hpp" +PREP_RECOMPILE_END; ["ACE_RepairItem_Base", "killed", { params ["_object"]; diff --git a/addons/repair/data/ace_track.p3d b/addons/repair/data/ace_track.p3d index 12189878a6..53ac8971a7 100644 Binary files a/addons/repair/data/ace_track.p3d and b/addons/repair/data/ace_track.p3d differ diff --git a/addons/repair/dev/draw_showRepairInfo.sqf b/addons/repair/dev/draw_showRepairInfo.sqf new file mode 100644 index 0000000000..5701c172ea --- /dev/null +++ b/addons/repair/dev/draw_showRepairInfo.sqf @@ -0,0 +1,69 @@ +// PabstMirror +// [] execVM "\z\ace\addons\repair\dev\draw_showRepairInfo.sqf"; + +#include "\z\ace\addons\repair\script_component.hpp" + +addMissionEventHandler ["Draw3D", { + if !((cursorObject isKindOf "Car") || (cursorObject isKindOf "Tank") || (cursorObject isKindOf "Air")) exitWith {}; + private _config = configFile >> "CfgVehicles" >> (typeOf cursorObject); + + private _hitpointPositions = getArray (_config >> QGVAR(hitpointPositions)); + private _hitpointGroups = getArray (_config >> QGVAR(hitpointGroups)); + + (getAllHitPointsDamage cursorObject) params [["_hitPoints", []], ["_hitSelections", []]]; + ([cursorObject] call FUNC(getWheelHitPointsWithSelections)) params ["_wheelHitPoints", "_wheelHitSelections"]; + + private _output = []; + + { + private _selection = _x; + private _hitpoint = _hitPoints select _forEachIndex; + + if ((_selection != "") && {_hitPoint != ""}) then { + if (((toLower _hitPoint) find "glass") != -1) exitWith {}; + + private _info = ""; + private _color = [1,0,0,1]; + if (_selection in _wheelHitSelections) then { + _info = _info + "[Wheel]"; + _color = [0,1,0,1]; + }; + if (!((getText (_config>> "HitPoints" >> _hitpoint >> "depends")) in ["", "0"])) then { + _info = _info + format ["[depends: %1]", getText (_config>> "HitPoints" >> _hitpoint >> "depends")]; + _color = [0,0,1,1] + }; + + private _position = cursorObject selectionPosition [_selection, "HitPoints"]; + { + _x params ["_hit", "_pos"]; + if (_hitpoint == _hit) exitWith { + _info = _info + format ["[hitPos: %1]", _pos]; + if (_pos isEqualType []) exitWith { + _position = _pos; + }; + if (_pos isEqualType "") exitWith { + _position = cursorObject selectionPosition [_pos, "HitPoints"]; + }; + }; + } forEach _hitpointPositions; + + private _parentHitpoint = ""; + { + private _xParent = _x select 0; + { + if (_hitpoint == _x) exitWith { + _info = _info + format ["[Parent: %1]", _xParent]; + _parentHitpoint = _xParent; + }; + } forEach (_x select 1); + } forEach _hitpointGroups; + + if (_parentHitpoint == "") then { + drawIcon3D ["", _color, (cursorObject modelToWorld _position), 0.5, 0.5, 0, format ["%1 [%2]", _hitpoint, _selection], 0.5, 0.025, "TahomaB"]; + }; + _output pushBack format ["%1: %2[%3] = %4", _forEachIndex, _hitPoint, _selection, cursorObject getHitIndex _forEachIndex]; + _output pushBack format ["- %1 -",_info]; + }; + } forEach _hitPoints; + hintSilent (_output joinString "\n"); +}]; diff --git a/addons/repair/functions/fnc_addRepairActions.sqf b/addons/repair/functions/fnc_addRepairActions.sqf index 1dfc518d39..8a1e068379 100644 --- a/addons/repair/functions/fnc_addRepairActions.sqf +++ b/addons/repair/functions/fnc_addRepairActions.sqf @@ -20,11 +20,9 @@ if (!hasInterface) exitWith {}; params ["_vehicle"]; TRACE_2("params", _vehicle,typeOf _vehicle); -private ["_action", "_childHitPoint", "_condition", "_groupsConfig", "_hitPoint", "_hitPointsAddedAmount", "_hitPointsAddedNames", "_hitPointsAddedStrings", "_icon", "_initializedClasses", "_name", "_position", "_positionsConfig", "_processedHitPoints", "_selection", "_statement", "_target", "_type"]; +private _type = typeOf _vehicle; -_type = typeOf _vehicle; - -_initializedClasses = GETMVAR(GVAR(initializedClasses),[]); +private _initializedClasses = GETMVAR(GVAR(initializedClasses),[]); // do nothing if the class is already initialized if (_type in _initializedClasses) exitWith {}; @@ -35,31 +33,30 @@ if (_type in _initializedClasses) exitWith {}; // get hitpoints of wheels with their selections ([_vehicle] call FUNC(getWheelHitPointsWithSelections)) params ["_wheelHitPoints", "_wheelHitSelections"]; -_hitPointsAddedNames = []; -_hitPointsAddedStrings = []; -_hitPointsAddedAmount = []; -_processedHitpoints = []; +private _hitPointsAddedNames = []; +private _hitPointsAddedStrings = []; +private _hitPointsAddedAmount = []; +private _processedHitpoints = []; +private _icon = QPATHTOF(ui\repair_0_ca.paa); { - _selection = _x; - _hitpoint = _hitPoints select _forEachIndex; + private _selection = _x; + private _hitpoint = _hitPoints select _forEachIndex; if (_selection in _wheelHitSelections) then { // Wheels should always be unique if (_hitpoint in _processedHitpoints) exitWith {TRACE_3("Duplicate Wheel",_hitpoint,_forEachIndex,_selection);}; - _icon = "A3\ui_f\data\igui\cfg\actions\repair_ca.paa"; - - _position = compile format ["_target selectionPosition ['%1', 'HitPoints'];", _selection]; + private _position = compile format ["_target selectionPosition ['%1', 'HitPoints'];", _selection]; TRACE_3("Adding Wheel Actions",_hitpoint,_forEachIndex,_selection); // An action to remove the wheel is required - _name = format ["Remove_%1_%2", _forEachIndex, _hitpoint]; - _text = localize LSTRING(RemoveWheel); - _condition = {[_this select 1, _this select 0, _this select 2 select 0, "RemoveWheel"] call DFUNC(canRepair)}; - _statement = {[_this select 1, _this select 0, _this select 2 select 0, "RemoveWheel"] call DFUNC(repair)}; - _action = [_name, _text, _icon, _statement, _condition, {}, [_hitpoint], _position, 2] call EFUNC(interact_menu,createAction); + private _name = format ["Remove_%1_%2", _forEachIndex, _hitpoint]; + private _text = localize LSTRING(RemoveWheel); + private _condition = {[_this select 1, _this select 0, _this select 2 select 0, "RemoveWheel"] call DFUNC(canRepair)}; + private _statement = {[_this select 1, _this select 0, _this select 2 select 0, "RemoveWheel"] call DFUNC(repair)}; + private _action = [_name, _text, _icon, _statement, _condition, {}, [_hitpoint], _position, 2, nil, FUNC(modifySelectionInteraction)] call EFUNC(interact_menu,createAction); [_type, 0, [], _action] call EFUNC(interact_menu,addActionToClass); // An action to replace the wheel is required @@ -79,13 +76,14 @@ _processedHitpoints = []; if (_selection isEqualTo "") exitWith { TRACE_3("Selection Empty",_hitpoint,_forEachIndex,_selection); }; if (_hitpoint isEqualTo "") exitWith { TRACE_3("Hitpoint Empty",_hitpoint,_forEachIndex,_selection); }; //Depends hitpoints shouldn't be modified directly (will be normalized) - if (isText (configFile >> "CfgVehicles" >> _type >> "HitPoints" >> _hitpoint >> "depends")) exitWith { + // Biki: Clearing 'depends' in case of inheritance cannot be an empty string (rpt warnings), but rather a "0" value. + if (!((getText (configFile >> "CfgVehicles" >> _type >> "HitPoints" >> _hitpoint >> "depends")) in ["", "0"])) exitWith { TRACE_3("Skip Depends",_hitpoint,_forEachIndex,_selection); }; // Associated hitpoints can be grouped via config to produce a single repair action - _groupsConfig = configFile >> "CfgVehicles" >> _type >> QGVAR(hitpointGroups); - _childHitPoint = false; + private _groupsConfig = configFile >> "CfgVehicles" >> _type >> QGVAR(hitpointGroups); + private _childHitPoint = false; if (isArray _groupsConfig) then { { { @@ -99,10 +97,10 @@ _processedHitpoints = []; if (_childHitPoint) exitWith { TRACE_3("childHitpoint",_hitpoint,_forEachIndex,_selection); }; // Find the action position - _position = compile format ["_target selectionPosition ['%1', 'HitPoints'];", _selection]; + private _position = compile format ["_target selectionPosition ['%1', 'HitPoints'];", _selection]; // Custom position can be defined via config for associated hitpoint - _positionsConfig = configFile >> "CfgVehicles" >> _type >> QGVAR(hitpointPositions); + private _positionsConfig = configFile >> "CfgVehicles" >> _type >> QGVAR(hitpointPositions); if (isArray _positionsConfig) then { { _x params ["_hit", "_pos"]; @@ -119,8 +117,7 @@ _processedHitpoints = []; }; // Prepair the repair action - _name = format ["Repair_%1_%2", _forEachIndex, _selection]; - _icon = "A3\ui_f\data\igui\cfg\actions\repair_ca.paa"; + private _name = format ["Repair_%1_%2", _forEachIndex, _selection]; // Find localized string and track those added for numerization ([_hitpoint, "%1", _hitpoint, [_hitPointsAddedNames, _hitPointsAddedStrings, _hitPointsAddedAmount]] call FUNC(getHitPointString)) params ["_text", "_trackArray"]; @@ -137,15 +134,15 @@ _processedHitpoints = []; _position = compile format ["private _return = _target selectionPosition ['%1', 'HitPoints']; _return set [1, 0]; _return", _selection]; }; TRACE_4("Adding RepairTrack",_hitpoint,_forEachIndex,_selection,_text); - _condition = {[_this select 1, _this select 0, _this select 2 select 0, "RepairTrack"] call DFUNC(canRepair)}; - _statement = {[_this select 1, _this select 0, _this select 2 select 0, "RepairTrack"] call DFUNC(repair)}; - _action = [_name, _text, _icon, _statement, _condition, {}, [_hitpoint], _position, 4] call EFUNC(interact_menu,createAction); + private _condition = {[_this select 1, _this select 0, _this select 2 select 0, "RepairTrack"] call DFUNC(canRepair)}; + private _statement = {[_this select 1, _this select 0, _this select 2 select 0, "RepairTrack"] call DFUNC(repair)}; + private _action = [_name, _text, _icon, _statement, _condition, {}, [_hitpoint], _position, 4] call EFUNC(interact_menu,createAction); [_type, 0, [], _action] call EFUNC(interact_menu,addActionToClass); } else { TRACE_4("Adding MiscRepair",_hitpoint,_forEachIndex,_selection,_text); - _condition = {[_this select 1, _this select 0, _this select 2 select 0, "MiscRepair"] call DFUNC(canRepair)}; - _statement = {[_this select 1, _this select 0, _this select 2 select 0, "MiscRepair"] call DFUNC(repair)}; - _action = [_name, _text, _icon, _statement, _condition, {}, [_forEachIndex], _position, 5] call EFUNC(interact_menu,createAction); + private _condition = {[_this select 1, _this select 0, _this select 2 select 0, "MiscRepair"] call DFUNC(canRepair)}; + private _statement = {[_this select 1, _this select 0, _this select 2 select 0, "MiscRepair"] call DFUNC(repair)}; + private _action = [_name, _text, _icon, _statement, _condition, {}, [_forEachIndex], _position, 5] call EFUNC(interact_menu,createAction); // Put inside main actions if no other position was found above if (_position isEqualTo [0,0,0]) then { [_type, 0, ["ACE_MainActions", QGVAR(Repair)], _action] call EFUNC(interact_menu,addActionToClass); @@ -158,9 +155,9 @@ _processedHitpoints = []; }; } forEach _hitSelections; -_condition = {[_this select 1, _this select 0, "", "fullRepair"] call DFUNC(canRepair)}; -_statement = {[_this select 1, _this select 0, "", "fullRepair"] call DFUNC(repair)}; -_action = [QGVAR(fullRepair), localize LSTRING(fullRepair), "A3\ui_f\data\igui\cfg\actions\repair_ca.paa", _statement, _condition, {}, [], "", 4] call EFUNC(interact_menu,createAction); +private _condition = {[_this select 1, _this select 0, "", "fullRepair"] call DFUNC(canRepair)}; +private _statement = {[_this select 1, _this select 0, "", "fullRepair"] call DFUNC(repair)}; +private _action = [QGVAR(fullRepair), localize LSTRING(fullRepair), _icon, _statement, _condition, {}, [], "", 4] call EFUNC(interact_menu,createAction); [_type, 0, ["ACE_MainActions", QGVAR(Repair)], _action] call EFUNC(interact_menu,addActionToClass); // set class as initialized diff --git a/addons/repair/functions/fnc_canMiscRepair.sqf b/addons/repair/functions/fnc_canMiscRepair.sqf index 7ebfb5c5a8..9d9fc29478 100644 --- a/addons/repair/functions/fnc_canMiscRepair.sqf +++ b/addons/repair/functions/fnc_canMiscRepair.sqf @@ -18,18 +18,17 @@ #include "script_component.hpp" -private ["_hitpointGroupConfig", "_hitpointGroup", "_postRepairDamage", "_return", "_hitPointClassname", "_subHitIndex"]; params ["_caller", "_target", "_hitPointIndex"]; (getAllHitPointsDamage _target) params ["_allHitPoints", "", "_allHitPointDamages"]; -if !([_caller, _target, ["isNotDragging", "isNotCarrying", "isNotOnLadder"]] call EFUNC(common,canInteractWith)) exitWith {false}; +if !([_caller, _target, ["isNotDragging", "isNotCarrying", "isNotSwimming", "isNotOnLadder"]] call EFUNC(common,canInteractWith)) exitWith {false}; // Get hitpoint groups if available -_hitpointGroupConfig = configFile >> "CfgVehicles" >> typeOf _target >> QGVAR(hitpointGroups); -_hitpointGroup = []; +private _hitpointGroupConfig = configFile >> "CfgVehicles" >> typeOf _target >> QGVAR(hitpointGroups); +private _hitpointGroup = []; if (isArray _hitpointGroupConfig) then { - _hitPointClassname = _allHitPoints select _hitPointIndex; + private _hitPointClassname = _allHitPoints select _hitPointIndex; // Retrieve hitpoint subgroup if current hitpoint is main hitpoint of a group { @@ -37,7 +36,7 @@ if (isArray _hitpointGroupConfig) then { // Exit using found hitpoint group if this hitpoint is leader of any if (_masterHitpoint == _hitPointClassname) exitWith { { - _subHitIndex = _allHitPoints find _x; + private _subHitIndex = _allHitPoints find _x; if (_subHitIndex == -1) then { ERROR("Hitpoint Not Found"); } else { @@ -52,10 +51,10 @@ if (isArray _hitpointGroupConfig) then { _hitpointGroup pushBack _hitPointIndex; // Get post repair damage -_postRepairDamage = [_caller] call FUNC(getPostRepairDamage); +private _postRepairDamage = [_caller] call FUNC(getPostRepairDamage); // Return true if damage can be repaired on any hitpoint in the group, else false -_return = false; +private _return = false; { if ((_allHitPointDamages select _x) > _postRepairDamage) exitWith { _return = true; diff --git a/addons/repair/functions/fnc_canRepair.sqf b/addons/repair/functions/fnc_canRepair.sqf index 6027a34fd5..a54e2d3ce4 100644 --- a/addons/repair/functions/fnc_canRepair.sqf +++ b/addons/repair/functions/fnc_canRepair.sqf @@ -21,14 +21,12 @@ params ["_caller", "_target", "_hitPoint", "_className"]; TRACE_4("params",_caller,_target,_hitPoint,_className); -private ["_config", "_engineerRequired", "_items", "_return", "_condition", "_vehicleStateCondition", "_settingName", "_settingItemsArray"]; - -_config = (ConfigFile >> "ACE_Repair" >> "Actions" >> _className); +private _config = (ConfigFile >> "ACE_Repair" >> "Actions" >> _className); if !(isClass _config) exitWith {false}; // or go for a default? // if(isEngineOn _target) exitWith {false}; // Ignore here so action shows, then exit and show warning when selected #3348 -_engineerRequired = if (isNumber (_config >> "requiredEngineer")) then { +private _engineerRequired = if (isNumber (_config >> "requiredEngineer")) then { getNumber (_config >> "requiredEngineer"); } else { // Check for required class @@ -40,11 +38,11 @@ _engineerRequired = if (isNumber (_config >> "requiredEngineer")) then { if !([_caller, _engineerRequired] call FUNC(isEngineer)) exitWith {false}; //Items can be an array of required items or a string to a ACE_Setting array -_items = if (isArray (_config >> "items")) then { +private _items = if (isArray (_config >> "items")) then { getArray (_config >> "items"); } else { - _settingName = getText (_config >> "items"); - _settingItemsArray = getArray (configFile >> "ACE_Settings" >> _settingName >> "_values"); + private _settingName = getText (_config >> "items"); + private _settingItemsArray = getArray (configFile >> "ACE_Settings" >> _settingName >> "_values"); if ((isNil _settingName) || {(missionNamespace getVariable _settingName) >= (count _settingItemsArray)}) exitWith { ERROR("bad setting"); ["BAD"] }; @@ -52,9 +50,9 @@ _items = if (isArray (_config >> "items")) then { }; if (count _items > 0 && {!([_caller, _items] call FUNC(hasItems))}) exitWith {false}; -_return = true; +private _return = true; if (getText (_config >> "condition") != "") then { - _condition = getText (_config >> "condition"); + private _condition = getText (_config >> "condition"); if (isNil _condition) then { _condition = compile _condition; } else { @@ -69,7 +67,7 @@ if (getText (_config >> "condition") != "") then { if (!_return) exitWith {false}; -// _vehicleStateCondition = if (isText(_config >> "vehicleStateCondition")) then { +// private _vehicleStateCondition = if (isText(_config >> "vehicleStateCondition")) then { // missionNamespace getVariable [getText(_config >> "vehicleStateCondition"), 0] // } else { // getNumber(_config >> "vehicleStateCondition") diff --git a/addons/repair/functions/fnc_doFullRepair.sqf b/addons/repair/functions/fnc_doFullRepair.sqf index ed67a69e99..492ceb01a0 100644 --- a/addons/repair/functions/fnc_doFullRepair.sqf +++ b/addons/repair/functions/fnc_doFullRepair.sqf @@ -1,6 +1,6 @@ /* * Author: Glowbal - * Fully repairs vehicle + * Fully repairs vehicle. * * Arguments: * 0: Unit that does the repairing (not used) diff --git a/addons/repair/functions/fnc_getClaimObjects.sqf b/addons/repair/functions/fnc_getClaimObjects.sqf index c2311a467f..18b2e9f7ef 100644 --- a/addons/repair/functions/fnc_getClaimObjects.sqf +++ b/addons/repair/functions/fnc_getClaimObjects.sqf @@ -1,6 +1,6 @@ /* * Author: PabstMirror - * Returns array of required nearby repair objects (wheels/tracks) + * Returns array of required nearby repair objects (wheels/tracks). * * Arguments: * 0: Unit that does the repairing diff --git a/addons/repair/functions/fnc_getHitPointString.sqf b/addons/repair/functions/fnc_getHitPointString.sqf index 0119fd17e1..da039c34ff 100644 --- a/addons/repair/functions/fnc_getHitPointString.sqf +++ b/addons/repair/functions/fnc_getHitPointString.sqf @@ -9,8 +9,8 @@ * 3: Track Added Hitpoints (default: false) * * Return Value: - * 0: Text - * 1: Added Hitpoint (default: []) + * 0: Text + * 1: Added Hitpoint (default: []) * * Example: * ["HitFuel", "Repairing %1 ...", "Repairing HitFuel"] call ace_repair_fnc_getHitPointString @@ -21,12 +21,10 @@ params ["_hitPoint", "_textLocalized", "_textDefault", ["_trackArray", []]]; -private ["_track", "_trackNames", "_trackStrings", "_trackAmount", "_text", "_toFind", "_trackIndex", "_combinedString"]; - -_track = if (count _trackArray > 0) then {true} else {false}; -_trackNames = []; -_trackStrings = []; -_trackAmount = []; +private _track = (count _trackArray > 0); +private _trackNames = []; +private _trackStrings = []; +private _trackAmount = []; if (_track) then { _trackNames = _trackArray select 0; @@ -35,10 +33,10 @@ if (_track) then { }; // Prepare first part of the string from stringtable -_text = LSTRING(Hit); +private _text = LSTRING(Hit); // Remove "Hit" from hitpoint name if one exists -_toFind = if ((toLower _hitPoint) find "hit" == 0) then { +private _toFind = if ((toLower _hitPoint) find "hit" == 0) then { [_hitPoint, 3] call CBA_fnc_substr } else { _hitPoint @@ -48,7 +46,7 @@ _toFind = if ((toLower _hitPoint) find "hit" == 0) then { for "_i" from 0 to (count _hitPoint) do { if (_track) then { // Loop through already added hitpoints and save index - _trackIndex = -1; + private _trackIndex = -1; { if (_x == _toFind) exitWith { _trackIndex = _forEachIndex; @@ -65,7 +63,7 @@ for "_i" from 0 to (count _hitPoint) do { // Localize if localization found - _combinedString = _text + _toFind; + private _combinedString = _text + _toFind; if (isLocalized _combinedString) exitWith { _text = format [_textLocalized, localize _combinedString]; TRACE_1("Hitpoint localized",_toFind); @@ -84,7 +82,7 @@ for "_i" from 0 to (count _hitPoint) do { // Don't display part name if no string is found in stringtable if (_text == LSTRING(Hit)) then { - if (_hitPoint != "") then { WARNING_1("Hitpoint [%1] - could not be localized", _hitPoint); }; + if (_hitPoint != "") then { LOG_1("Hitpoint [%1] - could not be localized", _hitPoint); }; _text = _textDefault; }; diff --git a/addons/repair/functions/fnc_getPostRepairDamage.sqf b/addons/repair/functions/fnc_getPostRepairDamage.sqf index 9388f4474d..22eaf7a5f9 100644 --- a/addons/repair/functions/fnc_getPostRepairDamage.sqf +++ b/addons/repair/functions/fnc_getPostRepairDamage.sqf @@ -22,7 +22,7 @@ TRACE_1("params",_unit); if (([_unit] call FUNC(isInRepairFacility) || {[_unit] call FUNC(isNearRepairVehicle)})) exitWith {0}; private _class = _unit getVariable ["ACE_IsEngineer", getNumber (configFile >> "CfgVehicles" >> typeOf _unit >> "engineer")]; -//If specialist or more qualified than min, then use engineer threshold: +//If advanced or more qualified than min, then use engineer threshold: if ((_class isEqualTo 2) || {[_unit, GVAR(engineerSetting_Repair) + 1] call FUNC(isEngineer)}) exitWith { (GVAR(repairDamageThreshold_Engineer) min GVAR(repairDamageThreshold)) }; diff --git a/addons/repair/functions/fnc_getWheelHitPointsWithSelections.sqf b/addons/repair/functions/fnc_getWheelHitPointsWithSelections.sqf index 93f4883063..5b40710c19 100644 --- a/addons/repair/functions/fnc_getWheelHitPointsWithSelections.sqf +++ b/addons/repair/functions/fnc_getWheelHitPointsWithSelections.sqf @@ -19,8 +19,6 @@ params ["_vehicle"]; TRACE_1("params",_vehicle); -private ["_bestDist", "_bestIndex", "_wheelBone", "_wheelBoneNameResized", "_wheelCenter", "_wheelCenterPos", "_wheelHitPoint", "_wheelHitPointSelection", "_wheelHitPointSelections", "_wheelHitPoints", "_wheelName", "_xDist", "_xPos"]; - // get the vehicles wheel config private _wheels = configFile >> "CfgVehicles" >> typeOf _vehicle >> "Wheels"; @@ -33,19 +31,19 @@ if !(isClass _wheels) exitWith {TRACE_1("No Wheels",_wheels); [[],[]]}; // get all wheels and read selections from config _wheels = "true" configClasses _wheels; -_wheelHitPoints = []; -_wheelHitPointSelections = []; +private _wheelHitPoints = []; +private _wheelHitPointSelections = []; { - _wheelName = configName _x; - _wheelCenter = getText (_x >> "center"); - _wheelBone = getText (_x >> "boneName"); - _wheelBoneNameResized = _wheelBone select [0, 9]; //ount "wheel_X_Y"; // this is a requirement for physx. Should work for all addon vehicles. + private _wheelName = configName _x; + private _wheelCenter = getText (_x >> "center"); + private _wheelBone = getText (_x >> "boneName"); + private _wheelBoneNameResized = _wheelBone select [0, 9]; //ount "wheel_X_Y"; // this is a requirement for physx. Should work for all addon vehicles. TRACE_4("",_wheelName,_wheelCenter,_wheelBone,_wheelBoneNameResized); - _wheelHitPoint = ""; - _wheelHitPointSelection = ""; + private _wheelHitPoint = ""; + private _wheelHitPointSelection = ""; //Commy's orginal method { @@ -61,19 +59,19 @@ _wheelHitPointSelections = []; //Backup method, search for the closest hitpoint to the wheel's center selection pos. //Ref #2742 - RHS's HMMWV if (_wheelHitPoint == "") then { - _wheelCenterPos = _vehicle selectionPosition _wheelCenter; + private _wheelCenterPos = _vehicle selectionPosition _wheelCenter; if (_wheelCenterPos isEqualTo [0,0,0]) exitWith {TRACE_1("no center?",_wheelCenter);}; - _bestDist = 99; - _bestIndex = -1; + private _bestDist = 99; + private _bestIndex = -1; { if (_x != "") then { //Filter out things that definitly aren't wheeels (#3759) if ((toLower (_hitPoints select _forEachIndex)) in ["hitengine", "hitfuel", "hitbody"]) exitWith {TRACE_1("filter",_x)}; - _xPos = _vehicle selectionPosition _x; + private _xPos = _vehicle selectionPosition _x; if (_xPos isEqualTo [0,0,0]) exitWith {}; - _xDist = _wheelCenterPos distance _xPos; + private _xDist = _wheelCenterPos distance _xPos; if (_xDist < _bestDist) then { _bestIndex = _forEachIndex; _bestDist = _xDist; diff --git a/addons/repair/functions/fnc_hasItems.sqf b/addons/repair/functions/fnc_hasItems.sqf index 3af9316256..0b06be8d49 100644 --- a/addons/repair/functions/fnc_hasItems.sqf +++ b/addons/repair/functions/fnc_hasItems.sqf @@ -19,9 +19,7 @@ params ["_unit", "_items"]; TRACE_2("params",_unit,_items); -private ["_return"]; - -_return = true; +private _return = true; { if ((_x isEqualType []) && {({[_unit, _x] call EFUNC(common,hasItem)} count _x == 0)}) exitWith { _return = false; diff --git a/addons/repair/functions/fnc_isEngineer.sqf b/addons/repair/functions/fnc_isEngineer.sqf index d07c12af64..92ce1091b0 100644 --- a/addons/repair/functions/fnc_isEngineer.sqf +++ b/addons/repair/functions/fnc_isEngineer.sqf @@ -19,8 +19,7 @@ params ["_unit", ["_engineerN", 1]]; TRACE_2("params",_unit,_engineerN); -private ["_class"]; -_class = _unit getVariable ["ACE_IsEngineer", getNumber (configFile >> "CfgVehicles" >> typeOf _unit >> "engineer")]; +private _class = _unit getVariable ["ACE_IsEngineer", _unit getUnitTrait "engineer"]; // This if statement is here for copmatability with the common variant of isEngineer, which requires a bool. // We cannot move this function to common because we require the GVAR(engineerSetting_Repair), which only makes sense to include in the repair module. diff --git a/addons/repair/functions/fnc_isInRepairFacility.sqf b/addons/repair/functions/fnc_isInRepairFacility.sqf index b72d8a5985..c9aed130ba 100644 --- a/addons/repair/functions/fnc_isInRepairFacility.sqf +++ b/addons/repair/functions/fnc_isInRepairFacility.sqf @@ -18,13 +18,11 @@ params ["_object"]; TRACE_1("params",_object); -private ["_position","_objects","_isInBuilding","_repairFacility"]; +private _position = getPosASL _object; +private _isInBuilding = false; +private _repairFacility = []; -_position = getPosASL _object; -_isInBuilding = false; -_repairFacility = []; - -_objects = (lineIntersectsWith [_object modelToWorldVisual [0, 0, (_position select 2)], _object modelToWorldVisual [0, 0, (_position select 2) +10], _object]); +private _objects = (lineIntersectsWith [_object modelToWorldVisual [0, 0, (_position select 2)], _object modelToWorldVisual [0, 0, (_position select 2) +10], _object]); { if (((typeOf _x) in _repairFacility) || (_x getVariable ["ACE_isRepairFacility",0]) > 0) exitWith { _isInBuilding = true; diff --git a/addons/repair/functions/fnc_isNearRepairVehicle.sqf b/addons/repair/functions/fnc_isNearRepairVehicle.sqf index 463e281faa..b0bd4b3cd1 100644 --- a/addons/repair/functions/fnc_isNearRepairVehicle.sqf +++ b/addons/repair/functions/fnc_isNearRepairVehicle.sqf @@ -18,11 +18,9 @@ params ["_unit"]; TRACE_1("params",_unit); -private ["_nearObjects", "_return"]; +private _nearObjects = nearestObjects [_unit, ["Air", "LandVehicle", "Slingload_base_F"], 20]; -_nearObjects = nearestObjects [_unit, ["Air","LandVehicle"], 20]; - -_return = false; +private _return = false; { if ([_x] call FUNC(isRepairVehicle)) exitWith {_return = true;}; } forEach _nearObjects; diff --git a/addons/repair/functions/fnc_isRepairVehicle.sqf b/addons/repair/functions/fnc_isRepairVehicle.sqf index 2c0b5a1e21..f18ff0cd3e 100644 --- a/addons/repair/functions/fnc_isRepairVehicle.sqf +++ b/addons/repair/functions/fnc_isRepairVehicle.sqf @@ -5,7 +5,7 @@ * Arguments: * 0: Vehicle * - * ReturnValue: + * Return Value: * Is engineering vehicle * * Example: diff --git a/addons/repair/functions/fnc_modifyInteraction.sqf b/addons/repair/functions/fnc_modifyInteraction.sqf index cff0fbe6e8..5288d10211 100644 --- a/addons/repair/functions/fnc_modifyInteraction.sqf +++ b/addons/repair/functions/fnc_modifyInteraction.sqf @@ -1,6 +1,6 @@ /* * Author: PabstMirror - * Modifies the base interaction point for repair items to show it's current damage + * Modifies the base interaction point for repair items to show it's current damage. * * Arguments: * 0: Target @@ -9,10 +9,10 @@ * 3: Action Data * * Return Value: - * Nothing + * None * * Example: - * [cursorObject, player, [], []] call ace_repair_fnc_modifyInteraction; + * [cursorObject, ace_player, [], []] call ace_repair_fnc_modifyInteraction; * * Public: No */ @@ -21,7 +21,7 @@ params ["_target", "_player", "_args", "_actionData"]; TRACE_4("params",_target,_player,_args,_actionData); -// Interaction dots numbered 0..8, white to red. +// Interaction dots numbered 0..8, white to red. // Convert damage to number (rounding up), so that even slight damage can bee seen private _fileName = format [QPATHTOF(ui\damage_%1_ca.paa), ceil (linearConversion [0, 1, damage _target, 0, 8, true])]; diff --git a/addons/repair/functions/fnc_modifySelectionInteraction.sqf b/addons/repair/functions/fnc_modifySelectionInteraction.sqf new file mode 100644 index 0000000000..cf776a1831 --- /dev/null +++ b/addons/repair/functions/fnc_modifySelectionInteraction.sqf @@ -0,0 +1,32 @@ +/* + * Author: 654wak654 + * Modifies interaction color of vehicle selection to show it's current damage. + * + * Arguments: + * 0: Target + * 1: Player + * 2: Args + * 3: Action Data + * + * Return Value: + * None + * + * Example: + * [cursorObject, ace_player, [], []] call ace_repair_fnc_modifySelectionInteraction; + * + * Public: No + */ +#include "script_component.hpp" + +params ["_target", "_player", "_args", "_actionData"]; +TRACE_4("params",_target,_player,_args,_actionData); + +// Interaction wrenches numbered 0..8, white to red. +// Convert damage to number (rounding up), so that even slight damage can bee seen + +private _fileName = format [ + QPATHTOF(ui\repair_%1_ca.paa), + ceil (linearConversion [0, 1, _target getHitPointDamage (_args select 0), 0, 8, true]) +]; + +_actionData set [2, _fileName]; diff --git a/addons/repair/functions/fnc_moduleAddSpareParts.sqf b/addons/repair/functions/fnc_moduleAddSpareParts.sqf index bc2502c0f4..5d24de86f0 100644 --- a/addons/repair/functions/fnc_moduleAddSpareParts.sqf +++ b/addons/repair/functions/fnc_moduleAddSpareParts.sqf @@ -20,10 +20,9 @@ params ["_logic"]; if (!isNull _logic) then { - private ["_list", "_part", "_amount"]; - _list = _logic getVariable ["List", ""]; - _part = _logic getVariable ["Part", 0]; - _amount = _logic getVariable ["Amount", 1]; + private _list = _logic getVariable ["List", ""]; + private _part = _logic getVariable ["Part", 0]; + private _amount = _logic getVariable ["Amount", 1]; // Parse list _list = [_list, true, true] call EFUNC(common,parseList); diff --git a/addons/repair/functions/fnc_moduleAssignEngineer.sqf b/addons/repair/functions/fnc_moduleAssignEngineer.sqf index d64573130c..fcdb08d4f1 100644 --- a/addons/repair/functions/fnc_moduleAssignEngineer.sqf +++ b/addons/repair/functions/fnc_moduleAssignEngineer.sqf @@ -20,9 +20,8 @@ params ["_logic"]; if (!isNull _logic) then { - private ["_list", "_setting"]; - _list = _logic getVariable ["EnableList", ""]; - _setting = _logic getVariable ["role", 0]; + private _list = _logic getVariable ["EnableList", ""]; + private _setting = _logic getVariable ["role", 0]; [_list, "ACE_IsEngineer", _setting, true] call EFUNC(common,assignObjectsInList); [synchronizedObjects _logic, "ACE_IsEngineer", _setting, true] call EFUNC(common,assignObjectsInList); diff --git a/addons/repair/functions/fnc_moduleAssignRepairFacility.sqf b/addons/repair/functions/fnc_moduleAssignRepairFacility.sqf index 9f01a06afc..9f0b514f1d 100644 --- a/addons/repair/functions/fnc_moduleAssignRepairFacility.sqf +++ b/addons/repair/functions/fnc_moduleAssignRepairFacility.sqf @@ -20,9 +20,8 @@ params ["_logic"]; if (!isNull _logic) then { - private ["_list", "_setting"]; - _list = _logic getVariable ["EnableList", ""]; - _setting = _logic getVariable ["role", 0]; + private _list = _logic getVariable ["EnableList", ""]; + private _setting = _logic getVariable ["role", 0]; [_list, "ACE_isRepairFacility", _setting, true] call EFUNC(common,assignObjectsInList); [synchronizedObjects _logic, "ACE_isRepairFacility", _setting, true] call EFUNC(common,assignObjectsInList); diff --git a/addons/repair/functions/fnc_moduleAssignRepairVehicle.sqf b/addons/repair/functions/fnc_moduleAssignRepairVehicle.sqf index f5df8d58e2..63b5e3756f 100644 --- a/addons/repair/functions/fnc_moduleAssignRepairVehicle.sqf +++ b/addons/repair/functions/fnc_moduleAssignRepairVehicle.sqf @@ -20,9 +20,8 @@ params ["_logic"]; if (!isNull _logic) then { - private ["_list", "_setting"]; - _list = _logic getVariable ["EnableList", ""]; - _setting = _logic getVariable ["role", 0]; + private _list = _logic getVariable ["EnableList", ""]; + private _setting = _logic getVariable ["role", 0]; [_list, "ACE_isRepairVehicle", _setting, true] call EFUNC(common,assignObjectsInList); [synchronizedObjects _logic, "ACE_isRepairVehicle", _setting, true] call EFUNC(common,assignObjectsInList); diff --git a/addons/repair/functions/fnc_normalizeHitPoints.sqf b/addons/repair/functions/fnc_normalizeHitPoints.sqf index 1f6004aa15..cb06eeaeae 100644 --- a/addons/repair/functions/fnc_normalizeHitPoints.sqf +++ b/addons/repair/functions/fnc_normalizeHitPoints.sqf @@ -33,7 +33,7 @@ private _dependentHitPointScripts = []; { if ((_x != "") && {isClass (_config >> _x)} && {!(_x in _realHitPoints)}) then { _realHitPoints pushBack _x; - if (isText (_config >> _x >> "depends")) then { + if (!((getText (_config >> _x >> "depends")) in ["", "0"])) then { _dependentHitPoints pushBack _x; _dependentHitPointScripts pushBack compile getText (_config >> _x >> "depends"); }; diff --git a/addons/repair/functions/fnc_repair.sqf b/addons/repair/functions/fnc_repair.sqf index d4f5412e6f..0f39ca14db 100644 --- a/addons/repair/functions/fnc_repair.sqf +++ b/addons/repair/functions/fnc_repair.sqf @@ -19,14 +19,12 @@ #include "script_component.hpp" params ["_caller", "_target", "_hitPoint", "_className"]; -TRACE_4("params",_calller,_target,_hitPoint,_className); +TRACE_4("params",_caller,_target,_hitPoint,_className); -private ["_callbackProgress", "_callerAnim", "_calller", "_condition", "_config", "_consumeItems", "_displayText", "_engineerRequired", "_iconDisplayed", "_items", "_repairTime", "_repairTimeConfig", "_return", "_usersOfItems", "_vehicleStateCondition", "_wpn", "_settingName", "_settingItemsArray", "_hitPointClassname"]; - -_config = (ConfigFile >> "ACE_Repair" >> "Actions" >> _className); +private _config = (ConfigFile >> "ACE_Repair" >> "Actions" >> _className); if !(isClass _config) exitWith {false}; // or go for a default? -_engineerRequired = if (isNumber (_config >> "requiredEngineer")) then { +private _engineerRequired = if (isNumber (_config >> "requiredEngineer")) then { getNumber (_config >> "requiredEngineer"); } else { // Check for required class @@ -46,11 +44,11 @@ if ((isEngineOn _target) && {!GVAR(autoShutOffEngineWhenStartingRepair)}) exitWi }; //Items can be an array of required items or a string to a ACE_Setting array -_items = if (isArray (_config >> "items")) then { +private _items = if (isArray (_config >> "items")) then { getArray (_config >> "items"); } else { - _settingName = getText (_config >> "items"); - _settingItemsArray = getArray (configFile >> "ACE_Settings" >> _settingName >> "_values"); + private _settingName = getText (_config >> "items"); + private _settingItemsArray = getArray (configFile >> "ACE_Settings" >> _settingName >> "_values"); if ((isNil _settingName) || {(missionNamespace getVariable _settingName) >= (count _settingItemsArray)}) exitWith { ERROR("bad setting"); ["BAD"] }; @@ -58,9 +56,9 @@ _items = if (isArray (_config >> "items")) then { }; if (count _items > 0 && {!([_caller, _items] call FUNC(hasItems))}) exitWith {false}; -_return = true; +private _return = true; if (getText (_config >> "condition") != "") then { - _condition = getText (_config >> "condition"); + private _condition = getText (_config >> "condition"); if (isNil _condition) then { _condition = compile _condition; } else { @@ -74,7 +72,7 @@ if (getText (_config >> "condition") != "") then { }; if (!_return) exitWith {false}; -// _vehicleStateCondition = if (isText(_config >> "vehicleStateCondition")) then { +// private _vehicleStateCondition = if (isText(_config >> "vehicleStateCondition")) then { // missionNamespace getVariable [getText(_config >> "vehicleStateCondition"), 0] // } else { // getNumber(_config >> "vehicleStateCondition") @@ -123,7 +121,7 @@ if !(_return && alive _target) exitWith {false}; [_caller, _x, false] call EFUNC(common,claim); } forEach _claimObjectsAvailable; -_consumeItems = if (isNumber (_config >> "itemConsumed")) then { +private _consumeItems = if (isNumber (_config >> "itemConsumed")) then { getNumber (_config >> "itemConsumed"); } else { // Check for required class @@ -133,13 +131,13 @@ _consumeItems = if (isNumber (_config >> "itemConsumed")) then { 0; }; -_usersOfItems = []; +private _usersOfItems = []; if (_consumeItems > 0) then { _usersOfItems = ([_caller, _items] call FUNC(useItems)) select 1; }; // Parse the config for the progress callback -_callbackProgress = getText (_config >> "callbackProgress"); +private _callbackProgress = getText (_config >> "callbackProgress"); if (_callbackProgress == "") then { _callbackProgress = "true"; }; @@ -151,7 +149,7 @@ if (isNil _callbackProgress) then { // Player Animation -_callerAnim = [getText (_config >> "animationCaller"), getText (_config >> "animationCallerProne")] select (stance _caller == "PRONE"); +private _callerAnim = [getText (_config >> "animationCaller"), getText (_config >> "animationCallerProne")] select (stance _caller == "PRONE"); _caller setVariable [QGVAR(selectedWeaponOnrepair), currentWeapon _caller]; // Cannot use secondairy weapon for animation @@ -159,7 +157,7 @@ if (currentWeapon _caller == secondaryWeapon _caller) then { _caller selectWeapon (primaryWeapon _caller); }; -_wpn = ["non", "rfl", "pst"] select (1 + ([primaryWeapon _caller, handgunWeapon _caller] find (currentWeapon _caller))); +private _wpn = ["non", "rfl", "pst"] select (1 + ([primaryWeapon _caller, handgunWeapon _caller] find (currentWeapon _caller))); _callerAnim = [_callerAnim, "[wpn]", _wpn] call CBA_fnc_replace; if (vehicle _caller == _caller && {_callerAnim != ""}) then { if (primaryWeapon _caller == "") then { @@ -169,35 +167,45 @@ if (vehicle _caller == _caller && {_callerAnim != ""}) then { _caller selectWeapon (primaryWeapon _caller); // unit always has a primary weapon here }; - if (stance _caller == "STAND") then { - _caller setVariable [QGVAR(repairPrevAnimCaller), "amovpknlmstpsraswrfldnon"]; - } else { - _caller setVariable [QGVAR(repairPrevAnimCaller), animationState _caller]; + if !(_caller call EFUNC(common,isSwimming)) then { + if (stance _caller == "STAND") then { + _caller setVariable [QGVAR(repairPrevAnimCaller), "amovpknlmstpsraswrfldnon"]; + } else { + _caller setVariable [QGVAR(repairPrevAnimCaller), animationState _caller]; + }; + [_caller, _callerAnim] call EFUNC(common,doAnimation); }; - [_caller, _callerAnim] call EFUNC(common,doAnimation); }; -//Get repair time -_repairTime = if (isNumber (_config >> "repairingTime")) then { - getNumber (_config >> "repairingTime"); -} else { - if (isText (_config >> "repairingTime")) exitWith { - _repairTimeConfig = getText(_config >> "repairingTime"); - if (isNil _repairTimeConfig) then { - _repairTimeConfig = compile _repairTimeConfig; - } else { - _repairTimeConfig = missionNamespace getVariable _repairTimeConfig; +// Get repair time +private _repairTime = [ + configFile >> "CfgVehicles" >> typeOf _target >> QGVAR(repairTimes) >> configName _config, + "number", + -1 +] call CBA_fnc_getConfigEntry; + +if (_repairTime < 0) then { + _repairTime = if (isNumber (_config >> "repairingTime")) then { + getNumber (_config >> "repairingTime"); + } else { + if (isText (_config >> "repairingTime")) exitWith { + private _repairTimeConfig = getText (_config >> "repairingTime"); + if (isNil _repairTimeConfig) then { + _repairTimeConfig = compile _repairTimeConfig; + } else { + _repairTimeConfig = missionNamespace getVariable _repairTimeConfig; + }; + if (_repairTimeConfig isEqualType 0) exitWith { + _repairTimeConfig; + }; + [_caller, _target, _hitPoint, _className] call _repairTimeConfig; }; - if (_repairTimeConfig isEqualType 0) exitWith { - _repairTimeConfig; - }; - [_caller, _target, _hitPoint, _className] call _repairTimeConfig; + 0; }; - 0; }; // Find localized string -_hitPointClassname = if (_hitPoint isEqualType "") then { +private _hitPointClassname = if (_hitPoint isEqualType "") then { _hitPoint } else { ((getAllHitPointsDamage _target) select 0) select _hitPoint @@ -216,17 +224,17 @@ TRACE_4("display",_hitPoint,_hitPointClassname,_processText,_text); DFUNC(repair_failure), _text, _callbackProgress, - ["isNotOnLadder"] + ["isNotSwimming", "isNotOnLadder"] ] call EFUNC(common,progressBar); // Display Icon -_iconDisplayed = getText (_config >> "actionIconPath"); +private _iconDisplayed = getText (_config >> "actionIconPath"); if (_iconDisplayed != "") then { [QGVAR(repairActionIcon), true, _iconDisplayed, [1,1,1,1], getNumber(_config >> "actionIconDisplayTime")] call EFUNC(common,displayIcon); }; // handle display of text/hints -_displayText = ""; +private _displayText = ""; if (_target != _caller) then { _displayText = getText(_config >> "displayTextOther"); } else { diff --git a/addons/repair/functions/fnc_repair_failure.sqf b/addons/repair/functions/fnc_repair_failure.sqf index 8616dd4808..c433b29f92 100644 --- a/addons/repair/functions/fnc_repair_failure.sqf +++ b/addons/repair/functions/fnc_repair_failure.sqf @@ -26,21 +26,19 @@ params ["_args"]; _args params ["_caller", "_target","_selectionName","_className","","_usersOfItems", "_claimedObjects"]; TRACE_5("params",_caller,_target,_selectionName,_className,_usersOfItems); -private ["_config","_callback", "_usersOfItems", "_weaponSelect"]; - if (primaryWeapon _caller == "ACE_FakePrimaryWeapon") then { _caller removeWeapon "ACE_FakePrimaryWeapon"; }; -if (vehicle _caller == _caller) then { +if (vehicle _caller == _caller && {!(_caller call EFUNC(common,isSwimming))}) then { [_caller, _caller getVariable [QGVAR(repairPrevAnimCaller), ""], 2] call EFUNC(common,doAnimation); }; _caller setVariable [QGVAR(repairPrevAnimCaller), nil]; -_weaponSelect = (_caller getVariable [QGVAR(selectedWeaponOnrepair), ""]); +private _weaponSelect = (_caller getVariable [QGVAR(selectedWeaponOnrepair), ""]); if (_weaponSelect != "") then { _caller selectWeapon _weaponSelect; } else { - _caller action ["SwitchWeapon", _caller, _caller, 99]; + _caller action ["SwitchWeapon", _caller, _caller, 299]; }; { @@ -55,9 +53,9 @@ if (_weaponSelect != "") then { // Record specific callback -_config = (ConfigFile >> "ACE_Repair" >> "Actions" >> _className); +private _config = (ConfigFile >> "ACE_Repair" >> "Actions" >> _className); -_callback = getText (_config >> "callbackFailure"); +private _callback = getText (_config >> "callbackFailure"); if (isNil _callback) then { _callback = compile _callback; } else { diff --git a/addons/repair/functions/fnc_repair_success.sqf b/addons/repair/functions/fnc_repair_success.sqf index c18116f862..c2fa40bfbb 100644 --- a/addons/repair/functions/fnc_repair_success.sqf +++ b/addons/repair/functions/fnc_repair_success.sqf @@ -26,21 +26,19 @@ params ["_args"]; _args params ["_caller", "_target","_selectionName","_className","","","_claimedObjects"]; TRACE_4("params",_caller,_target,_selectionName,_className); -private ["_config","_callback", "_weaponSelect"]; - if (primaryWeapon _caller == "ACE_FakePrimaryWeapon") then { _caller removeWeapon "ACE_FakePrimaryWeapon"; }; -if (vehicle _caller == _caller) then { +if (vehicle _caller == _caller && {!(_caller call EFUNC(common,isSwimming))}) then { [_caller, _caller getVariable [QGVAR(repairPrevAnimCaller), ""], 2] call EFUNC(common,doAnimation); }; _caller setVariable [QGVAR(repairPrevAnimCaller), nil]; -_weaponSelect = (_caller getVariable [QGVAR(selectedWeaponOnrepair), ""]); +private _weaponSelect = (_caller getVariable [QGVAR(selectedWeaponOnrepair), ""]); if (_weaponSelect != "") then { _caller selectWeapon _weaponSelect; } else { - _caller action ["SwitchWeapon", _caller, _caller, 99]; + _caller action ["SwitchWeapon", _caller, _caller, 299]; }; //Unclaim repair objects: @@ -50,9 +48,9 @@ if (_weaponSelect != "") then { } forEach _claimedObjects; // Record specific callback -_config = (ConfigFile >> "ACE_Repair" >> "Actions" >> _className); +private _config = (ConfigFile >> "ACE_Repair" >> "Actions" >> _className); -_callback = getText (_config >> "callbackSuccess"); +private _callback = getText (_config >> "callbackSuccess"); if (isNil _callback) then { _callback = compile _callback; } else { diff --git a/addons/repair/functions/fnc_setHitPointDamage.sqf b/addons/repair/functions/fnc_setHitPointDamage.sqf index 6423df6938..771a1c9dce 100644 --- a/addons/repair/functions/fnc_setHitPointDamage.sqf +++ b/addons/repair/functions/fnc_setHitPointDamage.sqf @@ -1,12 +1,13 @@ /* * Author: commy2 * Set the hitpoint damage and change the structural damage acordingly, requires local vehicle. - * Handles the ace_repair_setVehicleHitPointDamage event + * Handles the ace_repair_setVehicleHitPointDamage event. * * Arguments: * 0: Local Vehicle to Damage * 1: Selected hitpoint INDEX * 2: Total Damage + * 3: Skip destruction effects * * Return Value: * None @@ -18,11 +19,9 @@ */ #include "script_component.hpp" -params ["_vehicle", "_hitPointIndex", "_hitPointDamage"]; +params ["_vehicle", "_hitPointIndex", "_hitPointDamage", ["_useEffects", true]]; TRACE_4("params",_vehicle,typeOf _vehicle,_hitPointIndex,_hitPointDamage); -private ["_damageNew", "_damageOld", "_hitPointDamageRepaired", "_hitPointDamageSumOld", "_realHitpointCount", "_selectionName"]; - // can't execute all commands if the vehicle isn't local. exit here. if !(local _vehicle) exitWith {ERROR_1("Vehicle Not Local %1", _vehicle);}; @@ -34,18 +33,18 @@ if ((_hitPointIndex < 0) || {_hitPointIndex >= (count _allHitPoints)}) exitWith // save structural damage and sum of hitpoint damages -_damageOld = damage _vehicle; +private _damageOld = damage _vehicle; -_realHitpointCount = 0; -_hitPointDamageSumOld = 0; -_hitPointDamageRepaired = 0; //positive for repairs : newSum = (oldSum - repaired) +private _realHitpointCount = 0; +private _hitPointDamageSumOld = 0; +private _hitPointDamageRepaired = 0; //positive for repairs : newSum = (oldSum - repaired) { - _selectionName = _allHitPointsSelections select _forEachIndex; + private _selectionName = _allHitPointsSelections select _forEachIndex; //Filter out all the bad hitpoints (HitPoint="" or no selection) if ((!isNil {_vehicle getHit _selectionName}) && {_x != ""}) then { _realHitpointCount = _realHitpointCount + 1; - if ((((toLower _x) find "glass") == -1) && {!isText (configFile >> "CfgVehicles" >> typeOf _vehicle >> "HitPoints" >> _x >> "depends")}) then { + if ((((toLower _x) find "glass") == -1) && {(getText (configFile >> "CfgVehicles" >> typeOf _vehicle >> "HitPoints" >> _x >> "depends")) in ["", "0"]}) then { _hitPointDamageSumOld = _hitPointDamageSumOld + (_allHitPointDamages select _forEachIndex); if (_forEachIndex == _hitPointIndex) then { _hitPointDamageRepaired = (_allHitPointDamages select _forEachIndex) - _hitPointDamage; @@ -55,7 +54,7 @@ _hitPointDamageRepaired = 0; //positive for repairs : newSum = (oldSum - repaire } forEach _allHitPoints; // calculate new structural damage -_damageNew = (_hitPointDamageSumOld - _hitPointDamageRepaired) / _realHitpointCount; +private _damageNew = (_hitPointDamageSumOld - _hitPointDamageRepaired) / _realHitpointCount; if (_hitPointDamageSumOld > 0) then { _damageNew = _damageOld * ((_hitPointDamageSumOld - _hitPointDamageRepaired) / _hitPointDamageSumOld); @@ -63,14 +62,14 @@ if (_hitPointDamageSumOld > 0) then { TRACE_5("structuralDamage",_damageOld,_damageNew,_hitPointDamageRepaired,_hitPointDamageSumOld,_realHitpointCount); // set new structural damage value -_vehicle setDamage _damageNew; +_vehicle setDamage [_damageNew, _useEffects]; //Repair the hitpoint in the damages array: _allHitPointDamages set [_hitPointIndex, _hitPointDamage]; //Set the new damage for all hitpoints { - _vehicle setHitIndex [_forEachIndex, _x]; + _vehicle setHitIndex [_forEachIndex, _x, _useEffects]; } forEach _allHitPointDamages; // normalize hitpoints diff --git a/addons/repair/functions/fnc_useItem.sqf b/addons/repair/functions/fnc_useItem.sqf index 02daeed33e..de3950fa22 100644 --- a/addons/repair/functions/fnc_useItem.sqf +++ b/addons/repair/functions/fnc_useItem.sqf @@ -6,7 +6,7 @@ * 0: Unit * 1: Item classname * - * ReturnValue: + * Return Value: * [Had Item to Use , Unit ] * * Example: diff --git a/addons/repair/functions/fnc_useItems.sqf b/addons/repair/functions/fnc_useItems.sqf index 14dcb6223c..86b4400272 100644 --- a/addons/repair/functions/fnc_useItems.sqf +++ b/addons/repair/functions/fnc_useItems.sqf @@ -6,7 +6,7 @@ * 0: Unit * 1: Item classnames * - * ReturnValue: + * Return Value: * [Had Item to Use , Array of units that used the items ] * * Example: @@ -19,21 +19,19 @@ params ["_unit", "_items"]; TRACE_2("params",_unit,_items); -private ["_itemUsedInfo", "_itemsUsedBy"]; - -_itemsUsedBy = []; +private _itemsUsedBy = []; { // handle a one of type use item if (_x isEqualType []) then { { - _itemUsedInfo = [_unit, _x] call FUNC(useItem); + private _itemUsedInfo = [_unit, _x] call FUNC(useItem); if (_itemUsedInfo select 0) exitWith { _itemsUsedBy pushback [(_itemUsedInfo select 1), _x]}; } forEach _x; }; // handle required item if (_x isEqualType "") then { - _itemUsedInfo = [_unit, _x] call FUNC(useItem); + private _itemUsedInfo = [_unit, _x] call FUNC(useItem); if (_itemUsedInfo select 0) exitWith { _itemsUsedBy pushback [(_itemUsedInfo select 1), _x]}; }; } forEach _items; diff --git a/addons/repair/stringtable.xml b/addons/repair/stringtable.xml index caff823745..98fca94d12 100644 --- a/addons/repair/stringtable.xml +++ b/addons/repair/stringtable.xml @@ -13,6 +13,9 @@ Pót lánctalp Запасная гусеница 予備履帯 + 예비 궤도 + 备用履带 + 備用履帶 Spare Wheel @@ -26,6 +29,9 @@ Pótkerék Запасное колесо 予備タイヤ + 예비 바퀴 + 备用轮胎 + 備用輪胎 Change Wheel @@ -39,6 +45,9 @@ Поменять колесо Vyměnit kolo タイヤを変える + 바퀴 교체 + 更换轮胎 + 更換輪胎 Replacing Wheel... @@ -48,9 +57,12 @@ Замена колеса... Měním kolo... Cambiando rueda... - Sto sostituendo la ruota... + Sostituendo la ruota... Remplacement de la roue... タイヤを交換中・・・ + 바퀴 교체중... + 更换轮胎中... + 更換輪胎中... Wheel replaced @@ -63,6 +75,9 @@ Ruota sostituita Roue remplacée タイヤを履き替え + 바퀴 교체됨 + 轮胎更换完毕 + 輪胎更換完畢 Remove Wheel @@ -76,6 +91,9 @@ Kerék leszerelése Снять колесо タイヤを外す + 바퀴 제거 + 卸下轮胎 + 卸下輪胎 Removing Wheel... @@ -85,9 +103,12 @@ Снятие колеса... Odstraňuji kolo... Quitando rueda... - Sto rimuovendo la ruota... + Rimuovendo la ruota... Démontage de la roue... タイヤを外している・・ + 바퀴 제거중... + 卸下轮胎中... + 卸下輪胎中... Wheel removed @@ -100,6 +121,9 @@ Ruota rimossa Roue démontée タイヤを外した + 바퀴 제거됨 + 轮胎卸下完毕 + 輪胎卸下完畢 Change Track @@ -112,6 +136,9 @@ Cambia cingolo Changer la chenille 履帯を変える + 궤도 교체 + 更换履带 + 更換履帶 Replacing Track... @@ -121,9 +148,12 @@ Замена гусеницы... Měním pás... Cambiando oruga... - Sto sostituendo il cingolo... + Sostituendo il cingolo... Remplacement de la chenille... 履帯を交換中・・・ + 궤도 교체중... + 更换履带中... + 更換履帶中... Track replaced @@ -136,6 +166,9 @@ Cingolo sostituito Chenille remplacée 履帯を交換した + 궤도 교체됨 + 履带更换完毕 + 履帶更換完畢 Remove Track @@ -148,6 +181,9 @@ Rimuovi cingolo Enlever la chenille 履帯を外す + 궤도 제거 + 卸下履带 + 卸下履帶 Removing Track... @@ -157,9 +193,12 @@ Снятие гусеницы... Odstraňuji pás... Quitando oruga... - Sto rimuovendo il cingolo... + Rimuovendo il cingolo... Enlèvement de la chenille... 履帯を外している・・・ + 궤도 제거중... + 卸下履带中... + 卸下履帶中... Track removed @@ -172,6 +211,9 @@ Cingolo rimosso Chenille enlevée 履帯を外した + 궤도 제거됨 + 履带卸下完毕 + 履帶卸下完畢 Full Repair @@ -184,6 +226,9 @@ Riparazione completa Réparations complètes 完全に修理 + 완전수리 + 完整维修 + 完整維修 Repairing Vehicle... @@ -193,9 +238,12 @@ Ремонт транспорта... Opravuji vozidlo... Reparando vehículo... - Sto riparando il veicolo... + Riparando il veicolo... Réparation du véhicule... 車両を修理中・・・ + 차량 수리중... + 维修载具中... + 維修載具中... Full Repair Locations @@ -208,6 +256,9 @@ Luoghi Riparazione Completa Lieu de réparation complète 完全修理をできる場所 + 완전수리 구역 + 完整维修地点 + 完整維修地點 At what locations can a vehicle be fully repaired? @@ -220,6 +271,9 @@ In quali luoghi è possibile riparare completamente un veicolo? Où peuvent être réparés complètement les véhicules ? どのような場所で車両の完全な修理を出来るようにしますか? + 어느 구역에서 차량을 완전히 수리할 수 있게 합니까? + 什么位置可以完整维修载具? + 什麼位置可以完整維修載具? Allow Full Repair @@ -232,6 +286,9 @@ Consenti Riparazione Completa Autoriser les réparations complètes. 完全な修理をさせる + 완전 수리 활성화 + 允许完整维修 + 允許完整維修 Who can perform a full repair on a vehicle? @@ -244,6 +301,9 @@ Chi può eseguire una riparazione completa su un veicolo? Qui peut faire une réparation complète ? 誰が車両の完全な修理を出来るようにしますか? + 누가 완전 수리를 할 수 있습니까? + 谁可以完整维修载具? + 誰可以完整維修載具? Add Spare Parts @@ -256,6 +316,9 @@ Aggiungi Parti di Ricambio Ajouter des pièces de rechange 予備部品を追加 + 예비 부품 더하기 + 添加备件 + 添加備件 Add spare parts to vehicles (requires Cargo component)? @@ -268,6 +331,9 @@ Aggiungi parti di ricambio ai veicoli (richiede componente Cargo)? Ajouter des pièces de rechage aux véhicules ? (à besoin du système de cargaison) 車両へ予備部品を追加しますか(カーゴ コンポーネントが必要)? + 차량에 예비 부품을 더합니까?(짐칸 요소 필요) + 添加载具备件 (需相关货物组件)? + 添加載具備件 (需相關貨物組件)? Repair @@ -281,6 +347,9 @@ Szerelés Ремонт 修理 + 수리 + 维修 + 維修 Display text on repair @@ -293,6 +362,9 @@ Mostra testo mentre ripari Afficher du texte pendant la réparation 修理時に文章で通知する + 수리시 화면에 글자 표시 + 显示维修文本 + 顯示維修文本 Display a notification whenever you repair a vehicle @@ -305,6 +377,9 @@ Mostra una notifica quando stai riparando un veicolo Afficher une notification lorsque l'on répare un véhicule あなたが車両の修理を始めると、画面に通知を出します + 수리시 화면에 글자로 알림이 뜹니다 + 每当维修载具时显示通知 + 每當維修載具時顯示通知 Repairing... @@ -314,10 +389,13 @@ Naprawianie... Opravuji... Reparando... - Sto riparando... + Riparando... javítása... Ремонтируем... 修理中・・・ + 수리중... + 维修中... + 維修中... Repairing %1... @@ -327,10 +405,13 @@ Naprawianie %1... Opravuji %1... Reparando %1... - Sto riparando %1... + Riparando %1... %1 javítása... Ремонтируем %1... %1 を修理中・・・ + %1 수리중... + 维修%1中... + 維修%1中... Repaired %1 @@ -344,6 +425,9 @@ %1 megjavítva %1 отремонтирован %1 を修理した + %1 수리됨 + 已维修%1 + 已維修%1 Fully repaired part @@ -355,7 +439,10 @@ Parte totalmente reparado Parte riparata completamente Pièce entièrement réparée - 部分的な完全な修理 + 完全に修理された部品 + 부분 완벽히 수리됨 + 完整维修部分 + 完整維修部分 Partially repaired %1 @@ -368,6 +455,9 @@ %1 parzialmente riparato %1 pratiquement réparée %1 を部分的に修理した + %1 부분적으로 수리됨 + %1已完成部分维修 + %1已完成部分維修 Fully repaired %1 @@ -380,6 +470,9 @@ %1 completamente riparato %1 entièrement réparée %1 を完全に修理した + %1 완전히 수리됨 + %1已完整维修 + %1已完整維修 Partially repaired %1 @@ -392,6 +485,9 @@ %1 parzialmente riparato %1 pratiquement réparée %1 を部分的に修理した + %1 부분적으로 수리됨 + %1已完成部分维修 + %1已完成部分維修 Body @@ -405,6 +501,9 @@ Test Кузов 車体 + 몸체 + 车身 + 車身 Hull @@ -418,6 +517,9 @@ Test Корпус 機体 + 선체 + 车壳 + 車殼 Engine @@ -431,6 +533,9 @@ Motor Двигатель エンジン + 엔진 + 引擎 + 引擎 Left Horizontal Stabilizer @@ -443,6 +548,9 @@ Stabilisateur horizontal gauche Linkes Höhenleitwerk 左側の水平安定機 + 왼쪽 수평안정판 + 左侧悬挂稳定 + 左側懸掛穩定 Right Horizontal Stabilizer @@ -455,6 +563,9 @@ Stabilisateur horizontal droit Rechtes Höhenleitwerk 右側の水平安定機 + 오른쪽 수평안정판 + 右侧悬挂稳定 + 右側懸掛穩定 Vertical Stabilizer @@ -466,7 +577,10 @@ Stabilizzatore Verticale Stabilisateur vertical Seitenleitwerk - 車両安定器 + 車両スタビライザ + 수직 안정판 + 垂直稳定 + 垂直穩定 Fuel Tank @@ -480,6 +594,9 @@ Üzemanyagtank Топливный бак 燃料タンク + 연료 탱크 + 油箱 + 油箱 Transmission @@ -492,6 +609,9 @@ Trasmissione Instruments 変速機 + 변속기 + 变速箱 + 變速箱 Gear @@ -504,6 +624,9 @@ Motore Trains d'attérissage ギア + 기어 + 齿轮 + 齒輪 Starter @@ -516,6 +639,9 @@ Motore d'avviamento Démarreur スターター + 점화기 + 发动机 + 發動機 Tail @@ -528,6 +654,9 @@ Coda Queue 尾翼 + 꼬리 + 尾翼 + 尾翼 Pitot Tube @@ -540,6 +669,9 @@ Tubo di Pitot Sonde pitot ピトー管 + 동압관 + 空速管 + 空速管 Static Port @@ -552,6 +684,9 @@ Porta Statica Port statique スタティック ポート + 정압공 + 静态端口 + 靜態端口 Ammo @@ -564,6 +699,9 @@ Munizioni Munitions 弾薬 + 탄약 + 弹药 + 彈藥 Turret @@ -577,6 +715,9 @@ Lövegtorony Башню 砲塔 + 포탑 + 炮塔 + 砲塔 Gun @@ -590,6 +731,9 @@ Ágyú Пушку + + + Missiles @@ -602,6 +746,9 @@ Missili Missiles ミサイル + 미사일 + 导弹 + 導彈 Left Track @@ -615,6 +762,9 @@ Bal lánctalp Левую гусеницу 左の履帯 + 왼쪽 궤도 + 左履带 + 左履帶 Right Track @@ -628,6 +778,9 @@ Jobb lánctalp Правую гусеницу 右の履帯 + 오른쪽 궤도 + 右履带 + 右履帶 Left Front Wheel @@ -641,6 +794,9 @@ Bal első kerék Левое переднее колесо 左の前輪 + 왼쪽 앞바퀴 + 左前轮 + 左前輪 Right Front Wheel @@ -654,6 +810,9 @@ Jobb első kerék Правое переднее колесо 右の前輪 + 오른쪽 앞바퀴 + 右前轮 + 右前輪 Second Left Front Wheel @@ -667,6 +826,9 @@ Második bal első kerék Второе переднее левое колесо 左の 2 つめの前輪 + 왼쪽 두번째 바퀴 + 第二左前轮 + 第二左前輪 Second Right Front Wheel @@ -680,6 +842,9 @@ Második jobb hátsó kerék Второе правое переднее колесо 右の 2 つめの前輪 + 오른쪽 두번째 바퀴 + 第二右前轮 + 第二右前輪 Left Middle Wheel @@ -693,6 +858,9 @@ Bal középső kerék Левое среднее колесо 左の中央の前輪 + 왼쪽 가운데 바퀴 + 左中轮 + 左中輪 Right Middle Wheel @@ -706,6 +874,9 @@ Jobb középső kerék Правое среднее колесо 右の中央の前輪 + 오른족 가운데 바퀴 + 右中轮 + 右中輪 Left Rear Wheel @@ -719,6 +890,9 @@ Bal hátsó kerék Левое заднее колесо 左の後輪 + 왼쪽 뒤쪽 바퀴 + 左后轮 + 左後輪 Right Rear Wheel @@ -731,7 +905,10 @@ Ruota posteriore destra Jobb hátsó kerék Правое заднее колесо - 右の後 + 右の後輪 + 오른쪽 뒤쪽 바퀴 + 右后轮 + 右後輪 Avionics @@ -745,6 +922,9 @@ Avionika Авионику アビオニクス + 항공 전자 + 航电系统 + 航電系統 Main Rotor @@ -758,6 +938,9 @@ Főrotor Несущий винт 主翼 + 주 로터 + 主旋翼 + 主旋翼 Tail Rotor @@ -771,6 +954,9 @@ Farokrotor Рулевой винт 尾翼ローター + 꼬리 로터 + 尾桨 + 尾槳 Winch @@ -783,6 +969,9 @@ Gancio Treuil ウィンチ + 윈치 + 绞盘 + 絞盤 Glass (right) @@ -796,6 +985,9 @@ Jobb szélvédő Стекло (справа) ガラス (右) + 유리 (오른쪽) + 玻璃 (右) + 玻璃 (右) Glass (left) @@ -809,6 +1001,9 @@ Bal szélvédő Стекло (слава) ガラス (左) + 유리 (왼쪽) + 玻璃 (左) + 玻璃 (左) Glass @@ -822,6 +1017,9 @@ Üveg Стекло ガラス + 유리 + 玻璃 + 玻璃 ERA @@ -833,7 +1031,10 @@ ERA ERA ДЗ - 爆発反応装甲 + ERA + 폭발반응장갑 + 爆炸式反应装甲 + 爆炸式反應裝甲 Repair Settings @@ -845,7 +1046,10 @@ Nastavení oprav Impostazioni Riparazioni Réglages de réparation - 車両の全種類に修理システムを適用しますか? + 修理設定 + 수리 설정 + 修复设定 + 修復設定 Provides a repair system for all types of vehicles. @@ -858,6 +1062,9 @@ Fornisce un sistema di riparazione per tutti i tipi di veicoli. Fournit un système de réparation pour tous les types de véhicules. 車両の全種類に修理システムを適用しますか? + 모든 차량에 대해 수리 시스템을 제공합니다. + 提供修复系统给所有载具 + 提供修復系統給所有載具 Anyone @@ -870,6 +1077,9 @@ Chiunque Tout le monde だれでも + 모두 + 任何人 + 任何人 Engineer only @@ -882,20 +1092,20 @@ Solo Geniere Ingénieurs seulement 工兵のみ + 오직 정비공만 + 只有工兵 + 只有工兵 - - Repair Specialist only - Nur Reparaturspezialist - Tylko inżynierowie - Somente especialista em reparos - Только ремонтные специалисты - Pouze specialista na opravování - Solo especialista en reparación - Solo Specialista Riparazioni - Spécialistes de réparation seulement - 専門兵のみ + + Advanced Engineer only + Erweiterter Pionier + Solo Geniere avanzato + 上級工兵のみ + 只有维修专精兵 + 只有維修專精兵 + Tylko zaawansowani mechanicy - + Allow Wheel Erlaube Radwechsel Wymiana kół @@ -906,8 +1116,11 @@ Consenti Ruota Autoriser les roues タイヤを許可 + 바퀴 허가 + 允许轮胎 + 允許輪胎 - + Who can remove and replace wheels? Wer kann Radwechsel durchführern? Kto może zdejmować i zmieniać koła? @@ -918,8 +1131,11 @@ Chi può rimuovere e sostituire le ruote? Qui peut enlever et remplacer les roues ? 誰がタイヤの除去と交換を出来るようにしますか? + 누가 바퀴를 제거 및 교체할 수 있습니까? + 谁可维修轮胎? + 誰可維修輪胎? - + Allow Repair Erlaube Reperatur Możliwość naprawy @@ -930,8 +1146,11 @@ Consenti Riparazioni Autoriser les réparations 修理を許可 + 수리 허가 + 允许维修 + 允許維修 - + Who can perform repair actions? Wer kann eine Reperatur durchführen? Kto może wykonywać czynności związane z naprawą pojazdów? @@ -941,11 +1160,14 @@ ¿Quién puede realizar reparaciones? Chi può eseguire riparazioni? Qui peut réparer ? - 誰が修理をおこなえるようにしますか? + 誰が修理を出来るようににしますか? + 누가 수리를 할 수 있습니까? + 谁可以进行维修操作? + 誰可以進行維修操作? Repair Threshold - Repariere Schweller + Reparaturlimit Próg naprawy Limite de reparo Лимит ремкомплекта @@ -954,10 +1176,13 @@ Limite Riparazioni Seuil de réparation 修理のしきい値 + 정비 한계치 + 维修门槛 + 維修門檻 What is the maximum damage that can be repaired with a toolkit? - Wie hoch ist der Schaden, der von einem Reperatursatz behoben werden kann? + Der maximale Schaden, der von einem Reperatursatz behoben werden kann? Jaki jest maksymalny poziom uszkodzeń jaki może zostać naprawiony przy pomocy narzędzi? Qual é o dano máximo que pode ser reparado com um kit de ferramentas? Какой максимальный урон можно починить с помощью ремкомплекта? @@ -966,10 +1191,13 @@ Qual'è il danno massimo che può essere riparato con il Toolkit? Quel est le maximum de dommages réparable par une trousse à outils ? ツールキットで修理できる、最大の損傷許容範囲を設定しますか? + 어느정도의 피해까지 툴킷으로 수리가 가능합니까? + 工具包可以修复的最大损坏值? + 工具包可以修復的最大損壞值? Repair Threshold (Engineer) - Repariere Schweller (Pionier) + Reparaturlimit (Pionier) Próg naprawy (mechanik) Limite de reparo (Engenheiro) Лимит инженера @@ -978,10 +1206,13 @@ Limite Riparazioni (Geniere) Seuil de réparatoin (ingénieur) 修理のしきい値 (工兵) + 정비 한계치 (정비공) + 维修门槛 (工兵) + 維修門檻 (工兵) What is the maximum damage that can be repaired by an engineer? - Wie hoch ist der Schaden, der von einem Pionier behoben werden kann? + Der maximale Schaden, der von einem Pionier behoben werden kann? Jaki jest maksymalny poziom uszkodzeń jaki może zostać naprawiony przez mechanika? Qual é o dano máximo que pode ser reparado com um engenheiro? Какой максимальный урон может починить инженер? @@ -990,6 +1221,9 @@ Qual'è il danno massimo che può essere riparato da un Geniere? Quel est le maximum de dommages qui peuvent être réparés par un ingénieur ? 工兵が修理できる、最大の損傷許容範囲を設定しますか? + 정비공은 어느정도의 피해까지 수리할 수 있습니까? + 工兵可以修复的最大损坏值? + 工兵可以修復的最大損壞值? Remove toolkit on use @@ -1002,6 +1236,9 @@ Rimuovi Toolkit dopo l'uso Enlever la trousse à outils après usage ツールキットを使うと削除 + 툴킷 사용후 제거 + 使用后删除工具包 + 使用後刪除工具包 Should the toolkit be removed on usage? @@ -1014,6 +1251,9 @@ Il Toolkit dev'essere rimosso dopo l'uso? La trousse à outils devrait-elle être enlevée après usage ? ツールキットを使うと削除しますか? + 툴킷을 사용하면 제거를 합니까? + 要在使用后删除工具包吗? + 要在使用後刪除工具包嗎? Anywhere @@ -1026,6 +1266,9 @@ Ovunque N'importe où だれでも + 어디서나 + 任何地点 + 任何地點 Repair Vehicle only @@ -1038,6 +1281,9 @@ Solo Veicoli Riparazioni Véhicule de réparation seulement 修理車両のみ + 오직 수리 차량만 + 维修载具旁 + 維修載具旁 Repair Facility only @@ -1050,6 +1296,9 @@ Solo Strutture Riparazioni Installation de réparation seulement 修理施設のみ + 오직 수리 시설만 + 维修设施旁 + 維修設施旁 Repair Facility or Vehicle @@ -1062,6 +1311,9 @@ Strutture Riparazioni o Veicoli Installations ou véhicule de réparation 修理施設または車両のみ + 수리 시설혹은 차량 + 维修设施或载具旁 + 維修設施或載具旁 Assign Engineer @@ -1074,6 +1326,9 @@ Assegna Geniere Assigner le rôle d'ingénieur 工兵にする + 정비공 등록 + 指派工兵 + 指派工兵 List @@ -1086,6 +1341,9 @@ Lista Liste 一覧 + 목록 + 名单 + 名單 List of unit names that will be classified as engineer, separated by commas. @@ -1098,6 +1356,9 @@ Lista di unità che verranno classificate come genieri, separate da virgole. Liste des noms d'unités qui seront considérées ingénieurs. Séparé par des virgules 一覧に記載されたユニット名を、工兵として指定します。コンマで複数を指定できます。 + 목록내 보직이름은 정비공으로 분류됩니다. 쉼표로 구분합니다. + 工兵名单,把单位名称输入在这边即可定义其为工兵。每个单位使用逗号以做区隔。 + 工兵名單,把單位名稱輸入在這邊即可定義其為工兵。每個單位使用逗號以做區隔。 Is Engineer @@ -1110,6 +1371,9 @@ E' Geniere Est ingénieur 工兵とする + 은 정비공이다 + 是工兵 + 是工兵 Select the engineering skill level of the unit @@ -1122,6 +1386,9 @@ Seleziona il livello di abilità geniere dell'unità Sélectionner le niveau d'habilité en réparation de l'unité ユニットへの工兵スキルを選択 + 선택한 인원의 정비 실력을 고르십시요 + 选择工兵的技术水平 + 選擇工兵的技術水平 None @@ -1133,7 +1400,10 @@ Ningún Nessuna Aucun - 工兵 + なし + 없음 + + Engineer @@ -1145,19 +1415,20 @@ Ingeniero Geniere Ingénieur - 専門兵 + 工兵 + 정비공 + 工兵 + 工兵 - - Specialist - Reparaturspezialist - Inżynier - Especialista - Специалист - Specialista - Especialista - Specialista Riparazioni - Spécialiste - 工兵として単体、複数ユニットを割り当てます。 + + + Adv. Engineer + Erw. Pionier + Adv. Geniere + 上級工兵 + 专精 + 專精 + Zaaw. mechanik Assign one or multiple units as an engineer @@ -1170,6 +1441,9 @@ Assegna una o più unità come genieri Assigner un ou plusieurs unités comme ingénieur 修理車両として指定 + 하나 혹은 여러 인원을 정비공으로 등록합니다 + 指定一个或多个单位为工兵 + 指定一個或多個單位為工兵 Assign Repair Vehicle @@ -1182,6 +1456,9 @@ Assegna Veicolo Riparazioni Assigner en tant que véhicule de réparation 修理車両として指定 + 정비 차량 등록 + 指定维修载具 + 指定維修載具 List @@ -1194,6 +1471,9 @@ Lista Liste 一覧 + 목록 + 名单 + 名單 List of vehicles that will be classified as repair vehicle, separated by commas. @@ -1206,6 +1486,9 @@ Lista di Veicoli che verranno considerati veicoli riparazioni, separati da virgole. Liste de véhicules qui seront considérés comme véhicules de réparation. Séparé par des virgules. 一覧に記載されたユニット名を、修理車両として指定します。コンマで複数を指定できます。 + 목록내 차량은 정비 차량으로 분류됩니다. 쉼표로 구분합니다. + 载具名单,把载具名称输入在这边即可定义其为维修载具。每个载具使用逗号以做区隔。 + 載具名單,把載具名稱輸入在這邊即可定義其為維修載具。每個載具使用逗號以做區隔。 Is Repair Vehicle @@ -1218,6 +1501,9 @@ E' Veicolo Riparazioni Est un véhicule de réparation 修理車両とする + 은 정비 차량이다 + 是维修载具 + 是維修載具 Is the vehicle classified as a repair vehicle? @@ -1230,6 +1516,9 @@ Il veicolo è classificato dome veicolo riparazioni? Le véhicule est-il considéré comme un véhicule de réparation ? 車両を修理車両と指定しますか? + 이 차량을 정비 차량으로 분류합니까? + 此载具是维修载具吗? + 此載具是維修載具嗎? Assign one or multiple vehicles as a repair vehicle @@ -1242,6 +1531,9 @@ Assegna uno o più veicoli come veicoli riparazioni Assigner un ou plusieurs véhicules en tant que véhicule de réparation 単体、または複数の車両を修理車両とします + 하나 혹은 여러 차량을 정비 차량으로 등록합니다 + 指定一个或多个载具作为维修载具 + 指定一個或多個載具作為維修載具 Assign Repair Facility @@ -1254,6 +1546,9 @@ Assegna Struttura Riparazioni Assigner en tant qu'installation de réparation 修理施設とする + 정비 시설 등록 + 指定维修设施 + 指定維修設施 List @@ -1266,6 +1561,9 @@ Lista Liste 一覧 + 목록 + 名单 + 名單 List of objects that will be classified as repair Facility, separated by commas. @@ -1278,6 +1576,9 @@ Lista di oggetti che verranno classificati come strutture riparazioni, separate da virgole. Liste des objets considérés comme installations de réparation. Séparé par des virgules 一覧に記載されたユニット名を、修理施設として指定します。コンマで複数を指定できます。 + 목록내 시설은 정비 시설으로 분류됩니다. 쉼표로 구분합니다. + 设施名单,把设施名称输入在这边即可定义其为维修设施。每个设施使用逗号以做区隔。 + 設施名單,把設施名稱輸入在這邊即可定義其為維修設施。每個設施使用逗號以做區隔。 Is Repair Facility @@ -1290,6 +1591,9 @@ E' Struttura Riparazioni Est une installation de réparation 修理施設とする + 은 정비 시설이다 + 是维修设施 + 是維修設施 Is the object classified as a repair Facility? @@ -1302,6 +1606,9 @@ L'oggetto è classificato come struttura riparazioni? L'objet est-il considéré comme une installation de réparation ? オブジェクトを修理施設として指定しますか? + 이 시설을 정비 시설로 분류합니까? + 此设施是维修设施吗? + 此設施是維修設施嗎? Assign one or multiple objects as a repair Facility @@ -1314,6 +1621,9 @@ Assegna uno o più oggetti come strutture riparazioni Assigner un ou plusieurs objets en tant que véhicule de réparation ひとつ、または複数オブジェクトに予備部品を追加 + 하나 혹은 여러 시설을 정비 시설로 등록합니다 + 指定一个或多个对象作为维修设施 + 指定一個或多個對象作為維修設施 Add Spare Parts @@ -1326,6 +1636,9 @@ Aggiungi Parti di Ricambio Ajouter des pièces de rechange 予備部品を追加 + 예비 부품 더하기 + 添加备件 + 添加備件 Add spare parts to one or multiple objects @@ -1338,6 +1651,9 @@ Aggiungi parti di ricambio ad uno o più oggetti Ajouter des pièces de rechange à un ou plusieurs objets 一覧に追加されたオブジェクトへ予備部品を与えます。コンマで複数を指定できます。 + 하나 혹은 여러 물체가 예비 부품을 더합니다 + 添加备件到一个或多个对象上 + 添加備件到一個或多個對象上 List @@ -1350,6 +1666,9 @@ Lista Liste 一覧 + 목록 + 名单 + 名單 List of objects that will get spare parts added, separated by commas. @@ -1362,6 +1681,9 @@ Lista di oggetti a cui verranno aggiunte parti di ricambio, separate da virgole. Liste des objets qui recevront des pièces de réparation en plus. Séparé par des virgules 一覧に追加されたオブジェクトへ予備部品を与えます。コンマで複数を指定できます。 + 목록내 물체는 예비 부품을 받습니다, 쉼표로 구분합니다. + 添加备件到名单的载具上。每个载具使用逗号以做区隔。 + 添加備件到名單的載具上。每個載具使用逗號以做區隔。 Part @@ -1374,6 +1696,9 @@ Parte Pièce 部品 + 부품 + 零件 + 零件 Spare part. @@ -1386,6 +1711,9 @@ Parte di ricambio. Pièce de rechange 予備部品 + 예비 부품 + 备用零件 + 備用零件 Amount @@ -1398,6 +1726,9 @@ Quantità Quantité + 수량 + 数量 + 數量 Number of selected spare parts. @@ -1410,6 +1741,9 @@ Numero di parti di ricambio selezionate. Nombre de pièces de rechange séléctionnées 選択された予備部品の数を選択します。 + 선택한 부품의 수 + 选择的备件数量 + 選擇的備件數量 Wheel repair requirements @@ -1422,6 +1756,9 @@ Requisiti riparazione ruote Exigences de réparation de roue タイヤの修理を必要 + 바퀴 교체 요구사항 + 维修轮胎限制 + 維修輪胎限制 Items required to remove/replace wheels @@ -1434,6 +1771,9 @@ Oggetti richiesti per riparare/rimuovere ruote Items exigés pour enlever/remplacer les roues タイヤの除去と交換にアイテムを必要としますか? + 바퀴를 제거/교체하는데 필요한 물건 + 需要特定物品来移除/更换车轮 + 需要特定物品來移除/更換車輪 Engine must be off to repair @@ -1445,6 +1785,10 @@ Двигатель должен быть выключен для ремонта 修理のためにエンジンを停止させる必要があります。 Silnik musi być wyłączony w celu naprawy + 수리를 위해서는 엔진을 꺼야만 합니다 + Il motore deve essere spento per poter riparare + 引擎必须先关闭才能开始进行维修 + 引擎必須先關閉才能開始進行維修 diff --git a/addons/repair/ui/repair_0_ca.paa b/addons/repair/ui/repair_0_ca.paa new file mode 100644 index 0000000000..edb6c3681d Binary files /dev/null and b/addons/repair/ui/repair_0_ca.paa differ diff --git a/addons/repair/ui/repair_1_ca.paa b/addons/repair/ui/repair_1_ca.paa new file mode 100644 index 0000000000..bb6d85eca9 Binary files /dev/null and b/addons/repair/ui/repair_1_ca.paa differ diff --git a/addons/repair/ui/repair_2_ca.paa b/addons/repair/ui/repair_2_ca.paa new file mode 100644 index 0000000000..e5ed37905a Binary files /dev/null and b/addons/repair/ui/repair_2_ca.paa differ diff --git a/addons/repair/ui/repair_3_ca.paa b/addons/repair/ui/repair_3_ca.paa new file mode 100644 index 0000000000..24940192f4 Binary files /dev/null and b/addons/repair/ui/repair_3_ca.paa differ diff --git a/addons/repair/ui/repair_4_ca.paa b/addons/repair/ui/repair_4_ca.paa new file mode 100644 index 0000000000..bdf36fd572 Binary files /dev/null and b/addons/repair/ui/repair_4_ca.paa differ diff --git a/addons/repair/ui/repair_5_ca.paa b/addons/repair/ui/repair_5_ca.paa new file mode 100644 index 0000000000..cdabf0f8bf Binary files /dev/null and b/addons/repair/ui/repair_5_ca.paa differ diff --git a/addons/repair/ui/repair_6_ca.paa b/addons/repair/ui/repair_6_ca.paa new file mode 100644 index 0000000000..c1716ba16d Binary files /dev/null and b/addons/repair/ui/repair_6_ca.paa differ diff --git a/addons/repair/ui/repair_7_ca.paa b/addons/repair/ui/repair_7_ca.paa new file mode 100644 index 0000000000..4cf28c97e4 Binary files /dev/null and b/addons/repair/ui/repair_7_ca.paa differ diff --git a/addons/repair/ui/repair_8_ca.paa b/addons/repair/ui/repair_8_ca.paa new file mode 100644 index 0000000000..1db3809543 Binary files /dev/null and b/addons/repair/ui/repair_8_ca.paa differ diff --git a/addons/respawn/CfgVehicles.hpp b/addons/respawn/CfgVehicles.hpp index 103fab0537..4bf84590ae 100644 --- a/addons/respawn/CfgVehicles.hpp +++ b/addons/respawn/CfgVehicles.hpp @@ -1,4 +1,3 @@ - class CBA_Extended_EventHandlers; class CfgVehicles { @@ -71,6 +70,7 @@ class CfgVehicles { displayName = CSTRING(Rallypoint_MoveRallypoint); condition = QUOTE([ARR_2(_player, side group _player)] call FUNC(canMoveRallypoint)); statement = QUOTE([ARR_2(_player, side group _player)] call FUNC(moveRallypoint)); + exceptions[] = {"isNotSwimming"}; showDisabled = 0; priority = -0.5; }; @@ -110,6 +110,7 @@ class CfgVehicles { distance = 4; condition = QUOTE(side group _player == west); statement = QUOTE([ARR_3(_player,side group _player,'ACE_Rallypoint_West')] call FUNC(teleportToRallypoint)); + exceptions[] = {"isNotSwimming"}; position = "[-0.05,-0.35,-2.6]"; showDisabled = 1; priority = 1; @@ -132,6 +133,7 @@ class CfgVehicles { distance = 4; condition = QUOTE(side group _player == east); statement = QUOTE([ARR_3(_player,side group _player,'ACE_Rallypoint_East')] call FUNC(teleportToRallypoint)); + exceptions[] = {"isNotSwimming"}; position = "[-0.05,-0.35,-2.6]"; showDisabled = 1; priority = 1; @@ -154,6 +156,7 @@ class CfgVehicles { distance = 4; condition = QUOTE(side group _player == independent); statement = QUOTE([ARR_3(_player,side group _player,'ACE_Rallypoint_Independent')] call FUNC(teleportToRallypoint)); + exceptions[] = {"isNotSwimming"}; position = "[-0.05,-0.35,-2.6]"; showDisabled = 1; priority = 1; @@ -177,6 +180,7 @@ class CfgVehicles { distance = 4; condition = QUOTE(side group _player == west); statement = QUOTE([ARR_3(_player,side group _player,'ACE_Rallypoint_West_Base')] call FUNC(teleportToRallypoint)); + exceptions[] = {"isNotSwimming"}; position = "[-0.05,-0.35,-2.6]"; showDisabled = 1; priority = 1; @@ -199,6 +203,7 @@ class CfgVehicles { distance = 4; condition = QUOTE(side group _player == east); statement = QUOTE([ARR_3(_player,side group _player,'ACE_Rallypoint_East_Base')] call FUNC(teleportToRallypoint)); + exceptions[] = {"isNotSwimming"}; position = "[-0.05,-0.35,-2.6]"; showDisabled = 1; priority = 1; @@ -221,6 +226,7 @@ class CfgVehicles { distance = 4; condition = QUOTE(side group _player == independent); statement = QUOTE([ARR_3(_player,side group _player,'ACE_Rallypoint_Independent_Base')] call FUNC(teleportToRallypoint)); + exceptions[] = {"isNotSwimming"}; position = "[-0.05,-0.35,-2.6]"; showDisabled = 1; priority = 1; diff --git a/addons/respawn/XEH_preInit.sqf b/addons/respawn/XEH_preInit.sqf index a7feade1c3..b47cf6628d 100644 --- a/addons/respawn/XEH_preInit.sqf +++ b/addons/respawn/XEH_preInit.sqf @@ -2,6 +2,8 @@ ADDON = false; +PREP_RECOMPILE_START; #include "XEH_PREP.hpp" +PREP_RECOMPILE_END; ADDON = true; diff --git a/addons/respawn/functions/fnc_handleInitPostServer.sqf b/addons/respawn/functions/fnc_handleInitPostServer.sqf index e8f4f1d110..9f43ed0445 100644 --- a/addons/respawn/functions/fnc_handleInitPostServer.sqf +++ b/addons/respawn/functions/fnc_handleInitPostServer.sqf @@ -18,11 +18,9 @@ params ["_unit"]; -private ["_groupUnit", "_rallypoint", "_leaderVarName"]; +private _groupUnit = group _unit; // _group is a reserved veriable and shouldn't be used -_groupUnit = group _unit; // _group is a reserved veriable and shouldn't be used - -_rallypoint = [ +private _rallypoint = [ objNull, missionNamespace getVariable ["ACE_Rallypoint_West", objNull], missionNamespace getVariable ["ACE_Rallypoint_East", objNull], @@ -33,13 +31,15 @@ _rallypoint = [ if (isNull _rallypoint) exitWith {}; // find leader -_leaderVarName = _groupUnit getVariable [QGVAR(leaderVarName), ""]; +private _leaderVarName = _groupUnit getVariable [QGVAR(leaderVarName), ""]; // exit if group already has a playable slot assigned as rallypoint leader if (_leaderVarName != "") exitWith { // assign JIP unit as rallypoint leader if (str _unit == _leaderVarName) then { - _unit setVariable ["ACE_canMoveRallypoint", true, true]; + if (isNil {_unit getVariable "ACE_canMoveRallypoint"}) then { + _unit setVariable ["ACE_canMoveRallypoint", true, true]; + }; }; }; @@ -61,4 +61,6 @@ if (_leaderVarName == "") then { // prevent group from getting multiple leaders; use this to assign rallypoint moving ability on JIP _groupUnit setVariable [QGVAR(leaderVarName), _leaderVarName]; -_unit setVariable ["ACE_canMoveRallypoint", true, true]; +if (isNil {_unit getVariable "ACE_canMoveRallypoint"}) then { + _unit setVariable ["ACE_canMoveRallypoint", true, true]; +}; diff --git a/addons/respawn/functions/fnc_moveRallypoint.sqf b/addons/respawn/functions/fnc_moveRallypoint.sqf index 353d90e56a..3ee1f7fbdb 100644 --- a/addons/respawn/functions/fnc_moveRallypoint.sqf +++ b/addons/respawn/functions/fnc_moveRallypoint.sqf @@ -18,9 +18,7 @@ params ["_unit", "_side"]; -private ["_rallypoint", "_position"]; - -_rallypoint = [ +private _rallypoint = [ objNull, missionNamespace getVariable ["ACE_Rallypoint_West", objNull], missionNamespace getVariable ["ACE_Rallypoint_East", objNull], @@ -31,7 +29,7 @@ TRACE_3("moving rally",_unit,_rallypoint,typeOf _rallypoint); if (isNull _rallypoint) exitWith {}; -_position = getPosATL _unit; +private _position = getPosATL _unit; _position = _position findEmptyPosition [0, 2, typeOf _rallypoint]; if (_position isEqualTo []) then {_position = getPosATL _unit}; diff --git a/addons/respawn/functions/fnc_restoreGear.sqf b/addons/respawn/functions/fnc_restoreGear.sqf index a035bdd52d..64b7437d15 100644 --- a/addons/respawn/functions/fnc_restoreGear.sqf +++ b/addons/respawn/functions/fnc_restoreGear.sqf @@ -17,9 +17,16 @@ #include "script_component.hpp" params ["_unit", "_allGear", "_activeWeaponAndMuzzle"]; +TRACE_3("restoreGear",_unit, count _allGear, _activeWeaponAndMuzzle); // restore all gear if (!isNil "_allGear") then { + _allGear params ["_primaryWeaponArray"]; + if ((_primaryWeaponArray param [0, ""]) == "ACE_FakePrimaryWeapon") then { + TRACE_1("Ignoring fake gun",_primaryWeaponArray); + _allGear set [0, []]; + _activeWeaponAndMuzzle = nil; + }; _unit setUnitLoadout _allGear; }; @@ -44,7 +51,7 @@ if (!isNil "_activeWeaponAndMuzzle") then { private _index = 0; while { - _index < 100 && {currentWeaponMode _unit != _activeWeaponMode} + _index < 299 && {currentWeaponMode _unit != _activeWeaponMode} } do { _unit action ["SwitchWeapon", _unit, _unit, _index]; _index = _index + 1; diff --git a/addons/respawn/functions/fnc_updateRallypoint.sqf b/addons/respawn/functions/fnc_updateRallypoint.sqf index 8b34f87019..4a71f4284e 100644 --- a/addons/respawn/functions/fnc_updateRallypoint.sqf +++ b/addons/respawn/functions/fnc_updateRallypoint.sqf @@ -21,10 +21,8 @@ params ["_rallypoint", "_side", "_position"]; if (!hasInterface) exitWith {}; -private ["_marker", "_markerDate"]; - -_marker = _rallypoint getVariable [QGVAR(marker), ""]; -_markerDate = _rallypoint getVariable [QGVAR(markerDate), ""]; +private _marker = _rallypoint getVariable [QGVAR(marker), ""]; +private _markerDate = _rallypoint getVariable [QGVAR(markerDate), ""]; _marker setMarkerPosLocal _position; _marker setMarkerTextLocal _markerDate; diff --git a/addons/respawn/stringtable.xml b/addons/respawn/stringtable.xml index 12da5a8e25..703cd7e450 100644 --- a/addons/respawn/stringtable.xml +++ b/addons/respawn/stringtable.xml @@ -13,6 +13,9 @@ Dispiegamento in 5 secondi... Será posicionado em 5 segundos... 設置まであと 5 秒・・・ + 5초 후 재배치... + 5秒后完成布署... + 5秒後完成佈署... Rallypoint deployed @@ -26,6 +29,9 @@ Rallypoint dispiegato Rallypoints posicionado ラリーポイントを設置した + 집결지 배치됨 + 集合点布署完成 + 集合點佈署完成 Teleport to Base @@ -39,6 +45,9 @@ Bázisra teleportálás Teleporta alla base ベースへ移動 + 기지로 순간이동 + 传送至基地 + 傳送至基地 Teleport to Rallypoint @@ -52,6 +61,9 @@ Gyülekezőpontra teleportálás Teleporta al rallypoint ラリーポイントへ移動 + 집결지로 순간이동 + 传送至集合点 + 傳送至集合點 Teleported to Base @@ -65,6 +77,9 @@ Teleportato alla base Teletransportado para a Base ベースへ移動した + 기지로 순간이동함 + 已传送至基地 + 已傳送至基地 Teleported to Rallypoint @@ -78,6 +93,9 @@ Teleportato al rallypoint Teletransportado para o Rallypoints ラリーポイントへ移動した + 집결지로 순간이동함 + 已传送至集合点 + 已傳送至集合點 Rallypoint West (Base) @@ -90,7 +108,10 @@ Gyülekezőpont, Nyugat (Bázis) Rallypoint Západ (Základna) Ponto de encontro Oeste (Base) - ラリーポイント ウエスト (ベース) + ラリーポイント 同盟軍 (ベース) + 蓝方集合点 (基地) + 藍方集合點 (基地) + 청군 집결지 (기지) Rallypoint East (Base) @@ -103,7 +124,10 @@ Gyülekezőpont, Kelet (Bázis) Ralllypoint Východ (Základna) Ponto de encontro Lest (Base) - ラリーポイント イースト (ベース) + ラリーポイント OPFOR軍 (ベース) + 红方集合点 (基地) + 紅方集合點 (基地) + 대항군 집결지 (기지) Rallypoint Independent (Base) @@ -116,7 +140,10 @@ Gyülekezőpont, Független (Bázis) Rallypoint Nezávislý (Základna) Ponto de encontro Independente (Base) - ラリーポイント インデペンデント (ベース) + ラリーポイント 独立軍 (ベース) + 独立方集合点 (基地) + 獨立方集合點 (基地) + 독립군 집결지 (기지) Rallypoint West @@ -129,7 +156,10 @@ Gyülekezőpont, Nyugat Rallypoint Západ Ponto de encontro Oeste - ラリーポイント ウエスト + ラリーポイント 同盟軍 + 蓝方集合点 + 藍方集合點 + 청군 집결지 Rallypoint East @@ -142,7 +172,10 @@ Gyülekezőpont, Kelet Rallypoint Východ Ponto de encontro Leste - ラリーポイント イースト + ラリーポイント OPFOR軍 + 红方集合点 + 紅方集合點 + 대항군 집결지 Rallypoint Independent @@ -155,7 +188,10 @@ Gyülekezőpont, Független Rallypoint Nezávislý Ponto de encontro Independente - ラリーポイント インデペンデント + ラリーポイント 独立軍 + 独立方集合点 + 獨立方集合點 + 독립군 집결지 Respawn System @@ -169,6 +205,9 @@ Возрождение Sistema Respawn リスポン システム + 재배치 시스템 + 重生系统 + 重生系統 Save Gear? @@ -182,6 +221,9 @@ Сохранять снаряжение? Salva Equipaggiamento? 装備を保存? + 장비를 저장합니까? + 储存装备? + 儲存裝備? Respawn with the gear a soldier had just before his death? @@ -195,6 +237,9 @@ Возрождать солдата с тем же снаряжением, которое было на нем при смерти? Respawna con l'equipaggiamento che il soldato aveva appena prima di morire? ユニットが死ぬ前に持っていた装備でリスポンしますか? + 죽기 전에 가지고 있던 장비로 재배치합니까? + 是否在重生时载入死亡前的装备? + 是否在重生時載入死亡前的裝備? Remove bodies? @@ -208,6 +253,9 @@ Удалять трупы? Rimuovi corpi? 死体を削除? + 시체를 제거합니까? + 删除尸体? + 刪除屍體? Remove player bodies after disconnect? @@ -221,6 +269,9 @@ Удалять трупы игроков после дисконнекта? Rimuovi i corpi dei giocatori quando si disconnettono? 切断後はプレイヤーの死体を削除しますか? + 접속이 끊긴 플레이어의 시체를 제거합니까? + 要删除已离线的玩家尸体吗? + 要刪除已離線的玩家屍體嗎? This module enables you to configure ACE functionality specific to respawns. @@ -233,6 +284,9 @@ Questo modulo ti permette di configurare le funzionalità ACE specifiche dei respawn. Este módulo permite configurar parámetros relacionados con la reaparición あなたが設定した ACE 機能をリスポンへ設定できます。 + 이 모듈은 ACE 재배치의 자세한 설정을 변결할 수 있게 해줍니다. + 该模块使您可以设定ACE的重生功能 + 該模塊使您可以設定ACE的重生功能 Friendly Fire Messages @@ -246,6 +300,9 @@ Сообщения об огне по своим Messaggi Fuoco Amico 友軍誤射の表示 + 아군사격 메세지 + 友军误击讯息 + 友軍誤擊訊息 Using this module in your mission will make it so any friendly fire kills will be displayed in form of a message in chat. @@ -258,6 +315,9 @@ Usando questo modulo nella tua missione farà in modo che ogni uccisione per fuoco amico venga mostrata in forma di messaggio in chat. El usar este módulo, todas las muertes por fuego amigo serán indicadas en el chat. もし友軍誤射による死者が出た場合は、チャットにてその旨を表示します。 + 이 모듈은 미션 중 아군사격으로 인한 사망자 발생시 채팅창에 메세지를 표시해줍니다. + 摆放此模块后,当有发生友军误击致死的事件,会显示提示讯息在聊天视窗中。 + 擺放此模塊後,當有發生友軍誤擊致死的事件,會顯示提示訊息在聊天視窗中。 Rallypoint System @@ -271,6 +331,9 @@ Система точек сбора Sistema Punto di Raccolta ラリーポイント システム + 집결지 시스템 + 集合点系统 + 集合點系統 This module allows you to use rally points in missions, to which you can quickly teleport from base flag. Requires placing special objects on map - base and flag. Both available in category Empty -> ACE Respawn. @@ -283,6 +346,9 @@ Este módulo permite usar puntos de reunión en la misión, a los que pueden teletransportarse las unidades desde la bandera de base. Requiere colocar objetos especiales en el mapa: las banderas de base y de reunión, ambas disponibles en la categoría Vacio-> Reaparición ACE Ce module vous permet d'utiliser les "rally points" auxquels vous pouvez vous téléporter rapidement depuis un drapeau à la base. Il nécessite le placement d'objets spéciaux sur la carte - base et drapeau, disponibles dans la catégorie Vide -> ACE Respawn. ミッションでベースから素早く移動できるラリーポイントを使えるようにします。ゲーム内に専用オブジェクトとなるベースとフラッグを設置している必要があります。両オブジェクトは Empty 下の ACE リスポンから設置できます。 + 이 모듈은 미션 중에 기지 깃발에서 집결지로 빠르게 텔레포트 시켜주는 역활을 합니다. 지도 상에 기지 및 깃발이 필요합니다. 두 가지 모두 Empty->ACE Respawn 카테고리에서 찾을 수 있습니다. + 摆放此模块后,你将能在任务中布署集合点,使你可以快速往返基地与前线。要使用本功能,请记得放上空物件->ACE 重生里面的基地与旗帜。 + 擺放此模塊後,你將能在任務中佈署集合點,使你可以快速往返基地與前線。要使用本功能,請記得放上空物件->ACE 重生裡面的基地與旗幟。 Move Rallypoint @@ -296,6 +362,9 @@ Двигать точку сбора Sposta Punto di Raccolta ラリーポイントを移動 + 집결지 이동 + 移动集合点 + 移動集合點 ACE Respawn @@ -307,8 +376,11 @@ ACE Respawn ACE Respawn ACE Возрождение - Respawn ACE + Rigenerazione ACE ACE リスポン + ACE 재배치 + ACE 重生 + ACE 重生 - \ No newline at end of file + diff --git a/addons/safemode/XEH_postInit.sqf b/addons/safemode/XEH_postInit.sqf index 42f9dc3dd5..81c1521c92 100644 --- a/addons/safemode/XEH_postInit.sqf +++ b/addons/safemode/XEH_postInit.sqf @@ -11,7 +11,7 @@ if (!hasInterface) exitWith {}; ["ACE3 Weapons", QGVAR(safeMode), localize LSTRING(SafeMode), { // Conditions: canInteract - if !([ACE_player, objNull, ["isNotEscorting", "isNotInside"]] call EFUNC(common,canInteractWith)) exitWith {false}; + if !([ACE_player, objNull, ["isNotEscorting", "isNotInside", "isNotSwimming"]] call EFUNC(common,canInteractWith)) exitWith {false}; // Conditions: specific if !([ACE_player] call CBA_fnc_canUseWeapon && {currentWeapon ACE_player != binocular ACE_player} && {currentWeapon ACE_player != ""}) exitWith {false}; diff --git a/addons/safemode/XEH_preInit.sqf b/addons/safemode/XEH_preInit.sqf index a7feade1c3..b47cf6628d 100644 --- a/addons/safemode/XEH_preInit.sqf +++ b/addons/safemode/XEH_preInit.sqf @@ -2,6 +2,8 @@ ADDON = false; +PREP_RECOMPILE_START; #include "XEH_PREP.hpp" +PREP_RECOMPILE_END; ADDON = true; diff --git a/addons/safemode/functions/fnc_lockSafety.sqf b/addons/safemode/functions/fnc_lockSafety.sqf index 2675068e94..927b5c5d96 100644 --- a/addons/safemode/functions/fnc_lockSafety.sqf +++ b/addons/safemode/functions/fnc_lockSafety.sqf @@ -22,9 +22,7 @@ if (inputAction "nextWeapon" > 0) exitWith {}; params ["_unit", "_weapon", "_muzzle"]; -private ["_safedWeapons", "_picture"]; - -_safedWeapons = _unit getVariable [QGVAR(safedWeapons), []]; +private _safedWeapons = _unit getVariable [QGVAR(safedWeapons), []]; if (_weapon in _safedWeapons) exitWith { _this call FUNC(unlockSafety); @@ -69,5 +67,5 @@ if (_muzzle isEqualType "") then { [_unit, _weapon, _muzzle] call FUNC(playChangeFiremodeSound); // show info box -_picture = getText (configFile >> "CfgWeapons" >> _weapon >> "picture"); +private _picture = getText (configFile >> "CfgWeapons" >> _weapon >> "picture"); [localize LSTRING(PutOnSafety), _picture] call EFUNC(common,displayTextPicture); diff --git a/addons/safemode/functions/fnc_playChangeFiremodeSound.sqf b/addons/safemode/functions/fnc_playChangeFiremodeSound.sqf index 5da4aeb672..50998d93fb 100644 --- a/addons/safemode/functions/fnc_playChangeFiremodeSound.sqf +++ b/addons/safemode/functions/fnc_playChangeFiremodeSound.sqf @@ -18,16 +18,14 @@ params ["_unit", "_weapon"]; -private ["_sound", "_position"]; - -_sound = getArray (configFile >> "CfgWeapons" >> _weapon >> "changeFiremodeSound"); +private _sound = getArray (configFile >> "CfgWeapons" >> _weapon >> "changeFiremodeSound"); if (_sound isEqualTo []) exitWith { playSound "ACE_Sound_Click"; }; // get position where to play the sound (position of the weapon) -_position = AGLToASL (_unit modelToWorldVisual (_unit selectionPosition "RightHand")); +private _position = AGLToASL (_unit modelToWorldVisual (_unit selectionPosition "RightHand")); _sound params ["_filename", ["_volume", 1], ["_soundPitch", 1], ["_distance", 0]]; diff --git a/addons/safemode/functions/fnc_unlockSafety.sqf b/addons/safemode/functions/fnc_unlockSafety.sqf index b1c2fda540..58ecba5189 100644 --- a/addons/safemode/functions/fnc_unlockSafety.sqf +++ b/addons/safemode/functions/fnc_unlockSafety.sqf @@ -19,9 +19,7 @@ params ["_unit", "_weapon", "_muzzle"]; -private ["_safedWeapons", "_picture"]; - -_safedWeapons = _unit getVariable [QGVAR(safedWeapons), []]; +private _safedWeapons = _unit getVariable [QGVAR(safedWeapons), []]; _safedWeapons deleteAt (_safedWeapons find _weapon); _unit setVariable [QGVAR(safedWeapons), _safedWeapons]; @@ -36,10 +34,8 @@ _unit selectWeapon _muzzle; if (inputAction "nextWeapon" > 0) then { // switch to the last mode to roll over to first after the default nextWeapon action - private ["_modes", "_mode", "_index"]; - // get weapon modes - _modes = []; + private _modes = []; { if (getNumber (configFile >> "CfgWeapons" >> _weapon >> _x >> "showToPlayer") == 1) then { _modes pushBack _x; @@ -51,12 +47,12 @@ if (inputAction "nextWeapon" > 0) then { } count getArray (configFile >> "CfgWeapons" >> _weapon >> "modes"); // select last mode - _mode = _modes select (count _modes - 1); + private _mode = _modes select (count _modes - 1); // switch to last mode - _index = 0; + private _index = 0; while { - _index < 100 && {currentMuzzle _unit != _weapon || {currentWeaponMode _unit != _mode}} + _index < 299 && {currentMuzzle _unit != _weapon || {currentWeaponMode _unit != _mode}} } do { _unit action ["SwitchWeapon", _unit, _unit, _index]; _index = _index + 1; @@ -70,5 +66,5 @@ if (inputAction "nextWeapon" > 0) then { [true] call FUNC(setSafeModeVisual); // show info box -_picture = getText (configFile >> "CfgWeapons" >> _weapon >> "picture"); +private _picture = getText (configFile >> "CfgWeapons" >> _weapon >> "picture"); [localize LSTRING(TookOffSafety), _picture] call EFUNC(common,displayTextPicture); diff --git a/addons/safemode/stringtable.xml b/addons/safemode/stringtable.xml index 8cc646dc2d..fa9b951908 100644 --- a/addons/safemode/stringtable.xml +++ b/addons/safemode/stringtable.xml @@ -1,4 +1,4 @@ - + @@ -10,9 +10,12 @@ Biztonságos mód Предохранитель Sécurité - Sicura inserita + Modalità Sicura Modo de segurança 安全装置 + 안전 모드 + 保险模式 + 保險模式 Take off Safety @@ -26,6 +29,9 @@ Togli la sicura Tirar segurança 安全装置を外す + 안전장치 해제 + 开保险 + 開保險 Put on Safety @@ -39,6 +45,9 @@ Sicura inserita Colocar Segurança 安全装置を掛けた + 안전장치 적용 + 关保险 + 關保險 Took off Safety @@ -52,6 +61,9 @@ Sicura tolta Tirou Segurança 安全装置を外した + 안전장치 해제됨 + 已开保险 + 已開保險 - \ No newline at end of file + diff --git a/addons/sandbag/CfgWeapons.hpp b/addons/sandbag/CfgWeapons.hpp index 6a5fe29b79..72336e8bbf 100644 --- a/addons/sandbag/CfgWeapons.hpp +++ b/addons/sandbag/CfgWeapons.hpp @@ -1,7 +1,7 @@ class CfgWeapons { class ACE_ItemCore; - class InventoryItem_Base_F; + class CBA_MiscItem_ItemInfo; class ACE_Sandbag_empty: ACE_ItemCore { author = ECSTRING(common,ACETeam); @@ -10,7 +10,7 @@ class CfgWeapons { model = QPATHTOF(data\ace_sandbag_m.p3d); picture = QPATHTOF(data\m_sandbag_ca.paa); - class ItemInfo: InventoryItem_Base_F { + class ItemInfo: CBA_MiscItem_ItemInfo { mass = 8; }; }; @@ -22,7 +22,7 @@ class CfgWeapons { model = QPATHTOF(data\ace_sandbag_build.p3d); picture = QPATHTOF(data\m_sandbag_ca.paa); - class ItemInfo: InventoryItem_Base_F { + class ItemInfo: CBA_MiscItem_ItemInfo { mass = 160; }; }; diff --git a/addons/sandbag/XEH_preInit.sqf b/addons/sandbag/XEH_preInit.sqf index a7feade1c3..b47cf6628d 100644 --- a/addons/sandbag/XEH_preInit.sqf +++ b/addons/sandbag/XEH_preInit.sqf @@ -2,6 +2,8 @@ ADDON = false; +PREP_RECOMPILE_START; #include "XEH_PREP.hpp" +PREP_RECOMPILE_END; ADDON = true; diff --git a/addons/sandbag/functions/fnc_canDeploy.sqf b/addons/sandbag/functions/fnc_canDeploy.sqf index b9bd025dff..426dde56f2 100644 --- a/addons/sandbag/functions/fnc_canDeploy.sqf +++ b/addons/sandbag/functions/fnc_canDeploy.sqf @@ -1,9 +1,9 @@ /* * Author: Ruthberg, commy2 - * Checks if the player can deploy a sandbag + * Checks if the player can deploy a sandbag. * * Arguments: - * None + * 0: Unit * * Return Value: * Can deploy @@ -15,15 +15,8 @@ */ #include "script_component.hpp" -#define SURFACE_BLACKLIST ["water", "concrete", "tarmac", "wood", "metal", "roof_tin", "roof_tiles", "wood_int", "concrete_int", "tiles_int", "metal_int", "stony", "rock", "int_concrete", "int_tiles", "int_wood", "tiling", "wavymetal", "int_metal"] - params ["_unit"]; if !("ACE_Sandbag_empty" in items _unit) exitWith {false}; -private ["_surfaceClass", "_surfaceType"]; - -_surfaceClass = (surfaceType getPosASL _unit) select [1]; -_surfaceType = getText (configFile >> "CfgSurfaces" >> _surfaceClass >> "soundEnviron"); - -!(_surfaceType in SURFACE_BLACKLIST) +_unit call EFUNC(common,canDig) diff --git a/addons/sandbag/functions/fnc_deployConfirm.sqf b/addons/sandbag/functions/fnc_deployConfirm.sqf index 47b74533a1..68328cca67 100644 --- a/addons/sandbag/functions/fnc_deployConfirm.sqf +++ b/addons/sandbag/functions/fnc_deployConfirm.sqf @@ -29,14 +29,12 @@ _unit removeItem "ACE_Sandbag_empty"; params ["_unit"]; - private ["_position", "_direction", "_sandBag"]; - - _position = getPosASL GVAR(sandBag); - _direction = getDir GVAR(sandBag); + private _position = getPosASL GVAR(sandBag); + private _direction = getDir GVAR(sandBag); deleteVehicle GVAR(sandBag); - _sandBag = createVehicle ["ACE_SandbagObject", [0, 0, 0], [], 0, "NONE"]; + private _sandBag = createVehicle ["ACE_SandbagObject", [0, 0, 0], [], 0, "NONE"]; _sandBag setPosASL _position; _sandBag setDir _direction; diff --git a/addons/sandbag/functions/fnc_handleInteractMenuOpened.sqf b/addons/sandbag/functions/fnc_handleInteractMenuOpened.sqf index f4ea5891c7..4aef8f7ec8 100644 --- a/addons/sandbag/functions/fnc_handleInteractMenuOpened.sqf +++ b/addons/sandbag/functions/fnc_handleInteractMenuOpened.sqf @@ -8,6 +8,9 @@ * Return Value: * None * + * Example: + * [bob] call ace_sandbag_fnc_handleInteractMenuOpened + * * Public: No */ #include "script_component.hpp" diff --git a/addons/sandbag/functions/fnc_handleKilled.sqf b/addons/sandbag/functions/fnc_handleKilled.sqf index 63babd3f52..b991af1e4b 100644 --- a/addons/sandbag/functions/fnc_handleKilled.sqf +++ b/addons/sandbag/functions/fnc_handleKilled.sqf @@ -8,6 +8,9 @@ * Return Value: * None * + * Example: + * [bob] call ace_sandbag_fnc_handleKilled + * * Public: No */ #include "script_component.hpp" diff --git a/addons/sandbag/functions/fnc_handlePlayerChanged.sqf b/addons/sandbag/functions/fnc_handlePlayerChanged.sqf index f27a295903..2828979bc1 100644 --- a/addons/sandbag/functions/fnc_handlePlayerChanged.sqf +++ b/addons/sandbag/functions/fnc_handlePlayerChanged.sqf @@ -9,6 +9,9 @@ * Return Value: * None * + * Example: + * [bob, kevin] call ace_sandbag_fnc_handlePlayerChanged + * * Public: No */ #include "script_component.hpp" diff --git a/addons/sandbag/functions/fnc_handlePlayerInventoryChanged.sqf b/addons/sandbag/functions/fnc_handlePlayerInventoryChanged.sqf index 9f5920edd1..50d2fdede0 100644 --- a/addons/sandbag/functions/fnc_handlePlayerInventoryChanged.sqf +++ b/addons/sandbag/functions/fnc_handlePlayerInventoryChanged.sqf @@ -9,6 +9,9 @@ * Return Value: * None * + * Example: + * [bob, "weapon"] call ace_sandbag_fnc_handlePlayerInventoryChanged + * * Public: No */ #include "script_component.hpp" diff --git a/addons/sandbag/functions/fnc_handleUnconscious.sqf b/addons/sandbag/functions/fnc_handleUnconscious.sqf index 7e0e257158..e225dac7c3 100644 --- a/addons/sandbag/functions/fnc_handleUnconscious.sqf +++ b/addons/sandbag/functions/fnc_handleUnconscious.sqf @@ -8,12 +8,17 @@ * Return Value: * None * + * Example: + * [bob] call ace_sandbag_fnc_handleUnconscious + * * Public: No */ #include "script_component.hpp" params ["_unit"]; +if (!local _unit) exitWith {}; + if (_unit getVariable [QGVAR(isDeploying), false]) then { [_unit] call FUNC(deployCancel); }; diff --git a/addons/sandbag/stringtable.xml b/addons/sandbag/stringtable.xml index 5fd7708634..555dcab416 100644 --- a/addons/sandbag/stringtable.xml +++ b/addons/sandbag/stringtable.xml @@ -1,4 +1,4 @@ - + @@ -13,6 +13,9 @@ Homokzsák Saco de Areia 土のう + 모래주머니 + 沙包 + 沙包 Sandbag (empty) @@ -26,6 +29,9 @@ Homokzsák (üres) Saco de Areia (vazio) 土のう (空) + 모래주머니(비어있음) + 沙包 (空) + 沙包 (空) Cannot build here @@ -39,6 +45,9 @@ Nem teheted ide Não pode contruir aqui ここでは作れない + 여기에 지을 수 없습니다 + 无法放置在此 + 無法放置在此 Pick up Sandbag @@ -52,6 +61,9 @@ Homokzsák felvétele Pegar saco de areia 土のうを拾う + 모래주머니 줍기 + 捡起沙包 + 撿起沙包 Carry Sandbag @@ -65,6 +77,9 @@ Homokzsák cipelése Carregar saco de areia 土のうを運ぶ + 모래주머니 옮기기 + 搬运沙包 + 搬運沙包 End Carrying @@ -78,6 +93,9 @@ Cipelés abbahagyása Parar de carregar 下ろす + 그만 옮기기 + 停止搬运 + 停止搬運 Drop Sandbag @@ -91,6 +109,9 @@ Homokzsák eldobása Derrubar saco de areia 土のうを落とす + 여기에 놓기 + 放下沙包 + 放下沙包 Confirm Deployment @@ -104,6 +125,9 @@ Lerak Confirmar implantação ここで作る + 설치 확인 + 确认布署 + 確認佈署 Cancel Deployment @@ -117,6 +141,9 @@ Visszavonás Cancelar implantação 作るのをやめる + 설치 취소 + 取消布署 + 取消佈署 Deploy Sandbag @@ -130,6 +157,9 @@ Homokzsák lerakása Implantar saco de areia 土のうを設置 + 모래주머니 설치 + 布署沙包 + 佈署沙包 Sandbag Box @@ -143,6 +173,9 @@ Homokzsákos láda Caixa de saco de areia 土のう入れ + 모래주머니 상자 + 沙包箱 + 沙包箱 Here is no sand @@ -156,6 +189,9 @@ Itt nincs homok Aqui não tem areia ここに土は無い + 흙이 없습니다 + 这里没有沙 + 這裡沒有沙 Rotate @@ -169,6 +205,9 @@ Rotaciona Bращать 回転 + 돌리기 + 旋转 + 旋轉 - \ No newline at end of file + diff --git a/addons/scopes/ACE_Settings.hpp b/addons/scopes/ACE_Settings.hpp new file mode 100644 index 0000000000..4bef108cbf --- /dev/null +++ b/addons/scopes/ACE_Settings.hpp @@ -0,0 +1,63 @@ +class ACE_Settings { + class GVAR(enabled) { + typeName = "BOOL"; + value = 1; + displayName = CSTRING(enabled_displayName); + description = CSTRING(enabled_description); + }; + // ACE_ScopeAdjust_Vertical and ACE_ScopeAdjust_Horizontal will be populated with default values instead of [0,0] + class GVAR(forceUseOfAdjustmentTurrets) { + typeName = "BOOL"; + value = 0; + displayName = CSTRING(forceUseOfAdjustmentTurrets_displayName); + description = CSTRING(forceUseOfAdjustmentTurrets_description); + }; + + // Auto corrects the zeroing in both vanilla- and advanced ballistics + class GVAR(correctZeroing) { + typeName = "BOOL"; + value = 1; + displayName = CSTRING(correctZeroing_displayName); + description = CSTRING(correctZeroing_description); + }; + // Enables the use of the 'defaultZeroRange' setting to overwrite the discreteDistance[] config + class GVAR(overwriteZeroRange) { + typeName = "BOOL"; + value = 0; + displayName = CSTRING(overwriteZeroRange_displayName); + description = CSTRING(overwriteZeroRange_description); + }; + // Only affects scopes with elevation adjustment turrets (ACE_ScopeAdjust_Vertical != [0,0]) + class GVAR(defaultZeroRange) { + typeName = "SCALAR"; + value = 100; + displayName = CSTRING(defaultZeroRange_displayName); + description = CSTRING(defaultZeroRange_description); + }; + + // Only relevant when advanced ballistics is enabled + class GVAR(zeroReferenceTemperature) { + typeName = "SCALAR"; + value = 15; + displayName = CSTRING(zeroReferenceTemperature_displayName); + description = CSTRING(zeroReferenceTemperature_description); + }; + class GVAR(zeroReferenceBarometricPressure) { + typeName = "SCALAR"; + value = 1013.25; + displayName = CSTRING(zeroReferenceBarometricPressure_displayName); + description = CSTRING(zeroReferenceBarometricPressure_description); + }; + class GVAR(zeroReferenceHumidity) { + typeName = "SCALAR"; + value = 0.0; + displayName = CSTRING(zeroReferenceHumidity_displayName); + description = CSTRING(zeroReferenceHumidity_description); + }; + class GVAR(deduceBarometricPressureFromTerrainAltitude) { + typeName = "BOOL"; + value = 0; + displayName = CSTRING(deduceBarometricPressureFromTerrainAltitude_displayName); + description = CSTRING(deduceBarometricPressureFromTerrainAltitude_description); + }; +}; diff --git a/addons/scopes/CfgVehicles.hpp b/addons/scopes/CfgVehicles.hpp index 8a17384933..8a7e2f6189 100644 --- a/addons/scopes/CfgVehicles.hpp +++ b/addons/scopes/CfgVehicles.hpp @@ -11,9 +11,80 @@ class CfgVehicles { showDisabled = 0; priority = 0.2; //icon = QPATHTOF(UI\...); // TODO - exceptions[] = {"notOnMap", "isNotInside", "isNotSitting"}; + exceptions[] = {"notOnMap", "isNotInside", "isNotSwimming", "isNotSitting"}; }; }; }; }; + class ACE_Module; + class GVAR(ModuleSettings): ACE_Module { + scope = 2; + displayName = CSTRING(DisplayName); + //icon = ""; // needs an icon + category = "ACE"; + function = QUOTE(DFUNC(initModuleSettings)); + functionPriority = 1; + isGlobal = 1; + isTriggerActivated = 0; + author = ECSTRING(common,ACETeam); + class Arguments { + class enabled { + displayName = CSTRING(enabled_DisplayName); + description = CSTRING(enabled_Description); + typeName = "BOOL"; + defaultValue = 1; + }; + class forceUseOfAdjustmentTurrets { + displayName = CSTRING(forceUseOfAdjustmentTurrets_DisplayName); + description = CSTRING(forceUseOfAdjustmentTurrets_Description); + typeName = "BOOL"; + defaultValue = 0; + }; + class correctZeroing { + displayName = CSTRING(correctZeroing_DisplayName); + description = CSTRING(correctZeroing_Description); + typeName = "BOOL"; + defaultValue = 1; + }; + class overwriteZeroRange { + displayName = CSTRING(overwriteZeroRange_DisplayName); + description = CSTRING(overwriteZeroRange_Description); + typeName = "BOOL"; + defaultValue = 0; + }; + class defaultZeroRange { + displayName = CSTRING(defaultZeroRange_DisplayName); + description = CSTRING(defaultZeroRange_Description); + typeName = "NUMBER"; + defaultValue = 100; + }; + class zeroReferenceTemperature { + displayName = CSTRING(zeroReferenceTemperature_DisplayName); + description = CSTRING(zeroReferenceTemperature_Description); + typeName = "NUMBER"; + defaultValue = 15; + }; + class zeroReferenceBarometricPressure { + displayName = CSTRING(zeroReferenceBarometricPressure_DisplayName); + description = CSTRING(zeroReferenceBarometricPressure_Description); + typeName = "NUMBER"; + defaultValue = 1013.25; + }; + class zeroReferenceHumidity { + displayName = CSTRING(zeroReferenceHumidity_DisplayName); + description = CSTRING(zeroReferenceHumidity_Description); + typeName = "NUMBER"; + defaultValue = 0.0; + }; + class deduceBarometricPressureFromTerrainAltitude { + displayName = CSTRING(deduceBarometricPressureFromTerrainAltitude_DisplayName); + description = CSTRING(deduceBarometricPressureFromTerrainAltitude_Description); + typeName = "BOOL"; + defaultValue = 0; + }; + }; + class ModuleDescription { + description = CSTRING(Description); + }; + }; }; diff --git a/addons/scopes/CfgWeapons.hpp b/addons/scopes/CfgWeapons.hpp index cd87167f22..5b36c59e9f 100644 --- a/addons/scopes/CfgWeapons.hpp +++ b/addons/scopes/CfgWeapons.hpp @@ -1,8 +1,109 @@ +class Mode_SemiAuto; +class Mode_Burst; +class Mode_FullAuto; + class CfgWeapons { class ItemCore; class InventoryOpticsItem_Base_F; - + + class optic_Yorris : ItemCore { + ACE_ScopeHeightAboveRail = 2.77224; + }; + + class optic_MRD : ItemCore { + ACE_ScopeHeightAboveRail = 2.8; + }; + + class optic_Aco : ItemCore { + ACE_ScopeHeightAboveRail = 3.69248; + }; + + class optic_ACO_grn : ItemCore { + ACE_ScopeHeightAboveRail = 3.69248; + }; + + class optic_ACO_grn_smg : ItemCore { + ACE_ScopeHeightAboveRail = 3.69248; + }; + + class optic_ACO_smg : ItemCore { + ACE_ScopeHeightAboveRail = 3.69248; + }; + + class optic_Holosight : ItemCore { + ACE_ScopeHeightAboveRail = 4.66933; + }; + + class optic_Holosight_smg : ItemCore { + ACE_ScopeHeightAboveRail = 4.66933; + }; + + class optic_Arco : ItemCore { + ACE_ScopeHeightAboveRail = 4.89287; + }; + + class optic_ERCO_blk_F : optic_Arco { + ACE_ScopeHeightAboveRail = 3.48836; + }; + + class optic_Hamr : ItemCore { + ACE_ScopeHeightAboveRail = 4.48584; + }; + + class optic_MRCO : ItemCore { + ACE_ScopeHeightAboveRail = 3.88405; + }; + + class optic_Nightstalker : ItemCore { + ACE_ScopeHeightAboveRail = 5.54325; + ACE_ScopeAdjust_Vertical[] = {-4, 30}; + ACE_ScopeAdjust_Horizontal[] = {-6, 6}; + ACE_ScopeAdjust_VerticalIncrement = 0.1; + ACE_ScopeAdjust_HorizontalIncrement = 0.1; + class ItemInfo : InventoryOpticsItem_Base_F { + class OpticsModes { + class NCTALKEP { + discreteDistance[] = {200}; + discreteDistanceInitIndex = 0; + }; + }; + }; + }; + + class optic_NVS : ItemCore { + ACE_ScopeHeightAboveRail = 5.54325; + ACE_ScopeAdjust_Vertical[] = {-4, 30}; + ACE_ScopeAdjust_Horizontal[] = {-6, 6}; + ACE_ScopeAdjust_VerticalIncrement = 0.1; + ACE_ScopeAdjust_HorizontalIncrement = 0.1; + class ItemInfo : InventoryOpticsItem_Base_F { + class OpticsModes { + class NVS { + discreteDistance[] = {300}; + discreteDistanceInitIndex = 0; + }; + }; + }; + }; + + class optic_TWS : ItemCore { + ACE_ScopeHeightAboveRail = 5.52874; + ACE_ScopeAdjust_Vertical[] = {-4, 30}; + ACE_ScopeAdjust_Horizontal[] = {-6, 6}; + ACE_ScopeAdjust_VerticalIncrement = 0.1; + ACE_ScopeAdjust_HorizontalIncrement = 0.1; + class ItemInfo : InventoryOpticsItem_Base_F { + class OpticsModes { + class TWS { + discreteDistance[] = {300}; + discreteDistanceInitIndex = 0; + }; + }; + }; + }; + class optic_LRPS : ItemCore { + ACE_ScopeHeightAboveRail = 4.2098; ACE_ScopeAdjust_Vertical[] = {-4, 30}; ACE_ScopeAdjust_Horizontal[] = {-6, 6}; ACE_ScopeAdjust_VerticalIncrement = 0.1; @@ -22,6 +123,7 @@ class CfgWeapons { }; class optic_SOS : ItemCore { + ACE_ScopeHeightAboveRail = 4.41328; ACE_ScopeAdjust_Vertical[] = {-4, 30}; ACE_ScopeAdjust_Horizontal[] = {-6, 6}; ACE_ScopeAdjust_VerticalIncrement = 0.1; @@ -37,6 +139,7 @@ class CfgWeapons { }; class optic_DMS : ItemCore { + ACE_ScopeHeightAboveRail = 3.86253; ACE_ScopeAdjust_Vertical[] = {-4, 20}; ACE_ScopeAdjust_Horizontal[] = {-6, 6}; ACE_ScopeAdjust_VerticalIncrement = 0.1; @@ -52,6 +155,7 @@ class CfgWeapons { }; class optic_AMS_base : ItemCore { + ACE_ScopeHeightAboveRail = 3.8933; ACE_ScopeAdjust_Vertical[] = {-4, 30}; ACE_ScopeAdjust_Horizontal[] = {-6, 6}; ACE_ScopeAdjust_VerticalIncrement = 0.1; @@ -71,6 +175,7 @@ class CfgWeapons { }; class optic_KHS_base : ItemCore { + ACE_ScopeHeightAboveRail = 4.30723; ACE_ScopeAdjust_Vertical[] = {-4, 30}; ACE_ScopeAdjust_Horizontal[] = {-6, 6}; ACE_ScopeAdjust_VerticalIncrement = 0.1; @@ -90,6 +195,7 @@ class CfgWeapons { }; class optic_KHS_old : ItemCore { + ACE_ScopeHeightAboveRail = 4.30723; ACE_ScopeAdjust_Vertical[] = {-4, 30}; ACE_ScopeAdjust_Horizontal[] = {-6, 6}; ACE_ScopeAdjust_VerticalIncrement = 0.1; @@ -107,4 +213,177 @@ class CfgWeapons { }; }; }; + + class Rifle_Base_F; + class Rifle_Short_Base_F: Rifle_Base_F {}; + class Rifle_Long_Base_F: Rifle_Base_F {}; + + class DMR_07_base_F: Rifle_Long_Base_F { + ACE_RailHeightAboveBore = 5.07109; + }; + + class arifle_MX_Base_F: Rifle_Base_F { + class Single: Mode_SemiAuto {}; + class FullAuto: Mode_FullAuto {}; + }; + class arifle_MX_SW_F: arifle_MX_Base_F { + ACE_RailHeightAboveBore = 2.40874; + }; + class arifle_MXM_F: arifle_MX_Base_F { + ACE_RailHeightAboveBore = 2.40323; + }; + + class arifle_SPAR_01_base_F: Rifle_Base_F { + ACE_RailHeightAboveBore = 3.20768; + }; + class arifle_SPAR_02_base_F: Rifle_Base_F { + ACE_RailHeightAboveBore = 3.22175; + }; + class arifle_SPAR_03_base_F: Rifle_Base_F { + ACE_RailHeightAboveBore = 3.71491; + }; + + class LMG_Mk200_F: Rifle_Long_Base_F { + ACE_RailHeightAboveBore = 2.68925; + }; + class LMG_Zafir_F: Rifle_Long_Base_F { + ACE_RailHeightAboveBore = 0.996651; + }; + class LMG_03_base_F: Rifle_Long_Base_F { + ACE_RailHeightAboveBore = 4.24282; + }; + + class pdw2000_base_F: Rifle_Short_Base_F { + ACE_RailHeightAboveBore = 3.08883; + }; + + class arifle_AKS_base_F: Rifle_Base_F { + ACE_RailHeightAboveBore = 0; + }; + class arifle_AKM_base_F: Rifle_Base_F { + ACE_RailHeightAboveBore = 0; + }; + class arifle_AK12_base_F: Rifle_Base_F { + ACE_RailHeightAboveBore = 3.82508; + }; + class arifle_CTAR_base_F: Rifle_Base_F { + ACE_RailHeightAboveBore = 6.07588; + }; + class arifle_CTARS_base_F: Rifle_Base_F { + ACE_RailHeightAboveBore = 6.0787; + }; + class arifle_ARX_base_F: Rifle_Base_F { + ACE_RailHeightAboveBore = 2.81635; + }; + + class arifle_katiba_Base_F: Rifle_Base_F {}; + + class arifle_Katiba_F: arifle_katiba_Base_F { + ACE_RailHeightAboveBore = 5.75468; + }; + class arifle_Katiba_C_F: arifle_katiba_Base_F { + ACE_RailHeightAboveBore = 5.75468; + }; + class arifle_Katiba_GL_F: arifle_katiba_Base_F { + ACE_RailHeightAboveBore = 5.75468; + }; + + class arifle_MX_F: arifle_MX_Base_F { + ACE_RailHeightAboveBore = 2.80201; + }; + class arifle_MX_GL_F: arifle_MX_Base_F { + ACE_RailHeightAboveBore = 2.80201; + }; + + class arifle_MXC_F: arifle_MX_Base_F { + ACE_RailHeightAboveBore = 2.40874; + }; + + class SDAR_base_F: Rifle_Base_F {}; + + class arifle_SDAR_F: SDAR_base_F { + ACE_RailHeightAboveBore = 0; + }; + + class SMG_01_Base: Rifle_Short_Base_F { + ACE_RailHeightAboveBore = 8.85355; + }; + class SMG_02_base_F: Rifle_Short_Base_F { + ACE_RailHeightAboveBore = 4.41831; + }; + class SMG_05_base_F: Rifle_Short_Base_F { + ACE_RailHeightAboveBore = 4.05169; + }; + + class Tavor_base_F: Rifle_Base_F {}; + + class arifle_TRG20_F: Tavor_base_F { + ACE_RailHeightAboveBore = 4.30954; + }; + class arifle_TRG21_F: Tavor_base_F { + ACE_RailHeightAboveBore = 4.30954; + }; + class arifle_TRG21_GL_F: arifle_TRG21_F { + ACE_RailHeightAboveBore = 4.30954; + }; + + class mk20_base_F: Rifle_Base_F {}; + + class arifle_Mk20_F: mk20_base_F { + ACE_RailHeightAboveBore = 4.57255; + }; + class arifle_Mk20C_F: mk20_base_F { + ACE_RailHeightAboveBore = 4.41539; + }; + class arifle_Mk20_GL_F: mk20_base_F { + ACE_RailHeightAboveBore = 4.41539; + }; + + class EBR_base_F: Rifle_Long_Base_F {}; + class LRR_base_F: Rifle_Long_Base_F {}; + class GM6_base_F: Rifle_Long_Base_F {}; + class DMR_01_base_F: Rifle_Long_Base_F {}; + class DMR_02_base_F: Rifle_Long_Base_F {}; + class DMR_03_base_F: Rifle_Long_Base_F {}; + class DMR_04_base_F: Rifle_Long_Base_F {}; + class DMR_05_base_F: Rifle_Long_Base_F {}; + class DMR_06_base_F: Rifle_Long_Base_F {}; + + class srifle_EBR_F: EBR_base_F { + ACE_RailHeightAboveBore = 1.98812; + }; + class srifle_LRR_F: LRR_base_F { + ACE_RailHeightAboveBore = 3.20864; + }; + class srifle_GM6_F: GM6_base_F { + ACE_RailHeightAboveBore = 4.75572; + }; + class srifle_DMR_01_F: DMR_01_base_F { + ACE_RailHeightAboveBore = 2.83284; + }; + class srifle_DMR_02_F: DMR_02_base_F { + ACE_RailHeightAboveBore = 4.43913; + }; + class srifle_DMR_03_F: DMR_03_base_F { + ACE_RailHeightAboveBore = 4.0795; + }; + class srifle_DMR_04_F: DMR_04_base_F { + ACE_RailHeightAboveBore = 5.38022; + }; + class srifle_DMR_05_blk_F: DMR_05_base_F { + ACE_RailHeightAboveBore = 3.91334; + }; + class srifle_DMR_06_camo_F: DMR_06_base_F { + ACE_RailHeightAboveBore = 3.27488; + }; + + class MMG_01_base_F; + class MMG_02_base_F; + + class MMG_01_hex_F: MMG_01_base_F { + ACE_RailHeightAboveBore = 4.73961; + }; + class MMG_02_camo_F: MMG_02_base_F { + ACE_RailHeightAboveBore = 5.01913; + }; }; diff --git a/addons/scopes/XEH_PREP.hpp b/addons/scopes/XEH_PREP.hpp index 908d8064f0..a8489fe585 100644 --- a/addons/scopes/XEH_PREP.hpp +++ b/addons/scopes/XEH_PREP.hpp @@ -2,8 +2,12 @@ PREP(adjustScope); PREP(adjustZero); PREP(applyScopeAdjustment); +PREP(calculateZeroAngleCorrection); PREP(canAdjustZero); PREP(firedEH); +PREP(getBoreHeight); +PREP(getCurrentZeroRange); PREP(getOptics); +PREP(initModuleSettings); PREP(inventoryCheck); PREP(showZeroing); diff --git a/addons/scopes/XEH_postInit.sqf b/addons/scopes/XEH_postInit.sqf index bef16a0bc1..83fad08077 100644 --- a/addons/scopes/XEH_postInit.sqf +++ b/addons/scopes/XEH_postInit.sqf @@ -9,122 +9,139 @@ if (!hasInterface) exitWith {}; -// Check inventory when it changes -["loadout", FUNC(inventoryCheck)] call CBA_fnc_addPlayerEventHandler; +GVAR(Optics) = ["", "", ""]; +GVAR(Guns) = ["", "", ""]; +GVAR(canAdjustElevation) = [false, false, false]; +GVAR(canAdjustWindage) = [false, false, false]; +GVAR(boreHeight) = [0, 0, 0]; +GVAR(scopeAdjust) = [[[0,0],0,[0,0],0], [[0,0],0,[0,0],0], [[0,0],0,[0,0],0]]; -// Instantly hide knobs when scoping in -["cameraView", { - params ["_player", "_newCameraView"]; +["ace_settingsInitialized", { - if (_newCameraView == "GUNNER") then { - private _layer = [QGVAR(Zeroing)] call BIS_fnc_rscLayer; - _layer cutText ["", "PLAIN", 0]; + if (!GVAR(enabled)) exitWith {}; - if !(isNil QGVAR(fadePFH)) then { - [GVAR(fadePFH)] call CBA_fnc_removePerFrameHandler; - GVAR(fadePFH) = nil; - }; + if (GVAR(deduceBarometricPressureFromTerrainAltitude)) then { + GVAR(zeroReferenceBarometricPressure) = 1013.25 * (1 - (0.0065 * EGVAR(common,mapAltitude)) / 288.15) ^ 5.255754495; }; -}] call CBA_fnc_addPlayerEventHandler; -// Add keybinds -["ACE3 Scope Adjustment", QGVAR(AdjustUpMinor), localize LSTRING(AdjustUpMinor), { - // Conditions: canInteract - if !([ACE_player, objNull, ["isNotInside"]] call EFUNC(common,canInteractWith)) exitWith {false}; - // Conditions: specific - if (!([ACE_player] call CBA_fnc_canUseWeapon)) exitWith {false}; + // Check inventory when it changes + ["loadout", FUNC(inventoryCheck), true] call CBA_fnc_addPlayerEventHandler; - [ACE_player] call FUNC(inventoryCheck); + // Instantly hide knobs when scoping in + ["cameraView", { + params ["_player", "_newCameraView"]; - // Statement - [ACE_player, ELEVATION_UP, MINOR_INCREMENT] call FUNC(adjustScope); -}, {false}, [201, [false, false, false]], true] call CBA_fnc_addKeybind; + if (_newCameraView == "GUNNER") then { + private _layer = [QGVAR(Zeroing)] call BIS_fnc_rscLayer; + _layer cutText ["", "PLAIN", 0]; -["ACE3 Scope Adjustment", QGVAR(AdjustDownMinor), localize LSTRING(AdjustDownMinor), { - // Conditions: canInteract - if !([ACE_player, objNull, ["isNotInside"]] call EFUNC(common,canInteractWith)) exitWith {false}; - // Conditions: specific - if (!([ACE_player] call CBA_fnc_canUseWeapon)) exitWith {false}; + if !(isNil QGVAR(fadePFH)) then { + [GVAR(fadePFH)] call CBA_fnc_removePerFrameHandler; + GVAR(fadePFH) = nil; + }; + }; + }] call CBA_fnc_addPlayerEventHandler; - [ACE_player] call FUNC(inventoryCheck); + // Add keybinds + ["ACE3 Scope Adjustment", QGVAR(AdjustUpMinor), localize LSTRING(AdjustUpMinor), { + // Conditions: canInteract + if !([ACE_player, objNull, ["isNotInside", "isNotSwimming"]] call EFUNC(common,canInteractWith)) exitWith {false}; + // Conditions: specific + if (!([ACE_player] call CBA_fnc_canUseWeapon)) exitWith {false}; - // Statement - [ACE_player, ELEVATION_DOWN, MINOR_INCREMENT] call FUNC(adjustScope); -}, {false}, [209, [false, false, false]], true] call CBA_fnc_addKeybind; + [ACE_player] call FUNC(inventoryCheck); -["ACE3 Scope Adjustment", QGVAR(AdjustLeftMinor), localize LSTRING(AdjustLeftMinor), { - // Conditions: canInteract - if !([ACE_player, objNull, ["isNotInside"]] call EFUNC(common,canInteractWith)) exitWith {false}; - // Conditions: specific - if (!([ACE_player] call CBA_fnc_canUseWeapon)) exitWith {false}; + // Statement + [ACE_player, ELEVATION_UP, MINOR_INCREMENT] call FUNC(adjustScope); + }, {false}, [201, [false, false, false]], true] call CBA_fnc_addKeybind; - [ACE_player] call FUNC(inventoryCheck); + ["ACE3 Scope Adjustment", QGVAR(AdjustDownMinor), localize LSTRING(AdjustDownMinor), { + // Conditions: canInteract + if !([ACE_player, objNull, ["isNotInside", "isNotSwimming"]] call EFUNC(common,canInteractWith)) exitWith {false}; + // Conditions: specific + if (!([ACE_player] call CBA_fnc_canUseWeapon)) exitWith {false}; - // Statement - [ACE_player, WINDAGE_LEFT, MINOR_INCREMENT] call FUNC(adjustScope); -}, {false}, [209, [false, true, false]], true] call CBA_fnc_addKeybind; + [ACE_player] call FUNC(inventoryCheck); -["ACE3 Scope Adjustment", QGVAR(AdjustRightMinor), localize LSTRING(AdjustRightMinor), { - // Conditions: canInteract - if !([ACE_player, objNull, ["isNotInside"]] call EFUNC(common,canInteractWith)) exitWith {false}; - // Conditions: specific - if (!([ACE_player] call CBA_fnc_canUseWeapon)) exitWith {false}; + // Statement + [ACE_player, ELEVATION_DOWN, MINOR_INCREMENT] call FUNC(adjustScope); + }, {false}, [209, [false, false, false]], true] call CBA_fnc_addKeybind; - [ACE_player] call FUNC(inventoryCheck); + ["ACE3 Scope Adjustment", QGVAR(AdjustLeftMinor), localize LSTRING(AdjustLeftMinor), { + // Conditions: canInteract + if !([ACE_player, objNull, ["isNotInside", "isNotSwimming"]] call EFUNC(common,canInteractWith)) exitWith {false}; + // Conditions: specific + if (!([ACE_player] call CBA_fnc_canUseWeapon)) exitWith {false}; - // Statement - [ACE_player, WINDAGE_RIGHT, MINOR_INCREMENT] call FUNC(adjustScope); -}, {false}, [201, [false, true, false]], true] call CBA_fnc_addKeybind; + [ACE_player] call FUNC(inventoryCheck); -["ACE3 Scope Adjustment", QGVAR(AdjustUpMajor), localize LSTRING(AdjustUpMajor), { - // Conditions: canInteract - if !([ACE_player, objNull, ["isNotInside"]] call EFUNC(common,canInteractWith)) exitWith {false}; - // Conditions: specific - if (!([ACE_player] call CBA_fnc_canUseWeapon)) exitWith {false}; + // Statement + [ACE_player, WINDAGE_LEFT, MINOR_INCREMENT] call FUNC(adjustScope); + }, {false}, [209, [false, true, false]], true] call CBA_fnc_addKeybind; - [ACE_player] call FUNC(inventoryCheck); + ["ACE3 Scope Adjustment", QGVAR(AdjustRightMinor), localize LSTRING(AdjustRightMinor), { + // Conditions: canInteract + if !([ACE_player, objNull, ["isNotInside", "isNotSwimming"]] call EFUNC(common,canInteractWith)) exitWith {false}; + // Conditions: specific + if (!([ACE_player] call CBA_fnc_canUseWeapon)) exitWith {false}; - // Statement - [ACE_player, ELEVATION_UP, MAJOR_INCREMENT] call FUNC(adjustScope); -}, {false}, [201, [true, false, false]], true] call CBA_fnc_addKeybind; + [ACE_player] call FUNC(inventoryCheck); -["ACE3 Scope Adjustment", QGVAR(AdjustDownMajor), localize LSTRING(AdjustDownMajor), { - // Conditions: canInteract - if !([ACE_player, objNull, ["isNotInside"]] call EFUNC(common,canInteractWith)) exitWith {false}; - // Conditions: specific - if (!([ACE_player] call CBA_fnc_canUseWeapon)) exitWith {false}; + // Statement + [ACE_player, WINDAGE_RIGHT, MINOR_INCREMENT] call FUNC(adjustScope); + }, {false}, [201, [false, true, false]], true] call CBA_fnc_addKeybind; - [ACE_player] call FUNC(inventoryCheck); + ["ACE3 Scope Adjustment", QGVAR(AdjustUpMajor), localize LSTRING(AdjustUpMajor), { + // Conditions: canInteract + if !([ACE_player, objNull, ["isNotInside", "isNotSwimming"]] call EFUNC(common,canInteractWith)) exitWith {false}; + // Conditions: specific + if (!([ACE_player] call CBA_fnc_canUseWeapon)) exitWith {false}; - // Statement - [ACE_player, ELEVATION_DOWN, MAJOR_INCREMENT] call FUNC(adjustScope); -}, {false}, [209, [true, false, false]], true] call CBA_fnc_addKeybind; + [ACE_player] call FUNC(inventoryCheck); -["ACE3 Scope Adjustment", QGVAR(AdjustLeftMajor), localize LSTRING(AdjustLeftMajor), { - // Conditions: canInteract - if !([ACE_player, objNull, ["isNotInside"]] call EFUNC(common,canInteractWith)) exitWith {false}; - // Conditions: specific - if (!([ACE_player] call CBA_fnc_canUseWeapon)) exitWith {false}; + // Statement + [ACE_player, ELEVATION_UP, MAJOR_INCREMENT] call FUNC(adjustScope); + }, {false}, [201, [true, false, false]], true] call CBA_fnc_addKeybind; - [ACE_player] call FUNC(inventoryCheck); + ["ACE3 Scope Adjustment", QGVAR(AdjustDownMajor), localize LSTRING(AdjustDownMajor), { + // Conditions: canInteract + if !([ACE_player, objNull, ["isNotInside", "isNotSwimming"]] call EFUNC(common,canInteractWith)) exitWith {false}; + // Conditions: specific + if (!([ACE_player] call CBA_fnc_canUseWeapon)) exitWith {false}; - // Statement - [ACE_player, WINDAGE_LEFT, MAJOR_INCREMENT] call FUNC(adjustScope); -}, {false}, [209, [true, true, false]], true] call CBA_fnc_addKeybind; + [ACE_player] call FUNC(inventoryCheck); -["ACE3 Scope Adjustment", QGVAR(AdjustRightMajor), localize LSTRING(AdjustRightMajor), { - // Conditions: canInteract - if !([ACE_player, objNull, ["isNotInside"]] call EFUNC(common,canInteractWith)) exitWith {false}; - // Conditions: specific - if (!([ACE_player] call CBA_fnc_canUseWeapon)) exitWith {false}; + // Statement + [ACE_player, ELEVATION_DOWN, MAJOR_INCREMENT] call FUNC(adjustScope); + }, {false}, [209, [true, false, false]], true] call CBA_fnc_addKeybind; - [ACE_player] call FUNC(inventoryCheck); + ["ACE3 Scope Adjustment", QGVAR(AdjustLeftMajor), localize LSTRING(AdjustLeftMajor), { + // Conditions: canInteract + if !([ACE_player, objNull, ["isNotInside", "isNotSwimming"]] call EFUNC(common,canInteractWith)) exitWith {false}; + // Conditions: specific + if (!([ACE_player] call CBA_fnc_canUseWeapon)) exitWith {false}; - // Statement - [ACE_player, WINDAGE_RIGHT, MAJOR_INCREMENT] call FUNC(adjustScope); -}, {false}, [201, [true, true, false]], true] call CBA_fnc_addKeybind; + [ACE_player] call FUNC(inventoryCheck); + + // Statement + [ACE_player, WINDAGE_LEFT, MAJOR_INCREMENT] call FUNC(adjustScope); + }, {false}, [209, [true, true, false]], true] call CBA_fnc_addKeybind; + + ["ACE3 Scope Adjustment", QGVAR(AdjustRightMajor), localize LSTRING(AdjustRightMajor), { + // Conditions: canInteract + if !([ACE_player, objNull, ["isNotInside", "isNotSwimming"]] call EFUNC(common,canInteractWith)) exitWith {false}; + // Conditions: specific + if (!([ACE_player] call CBA_fnc_canUseWeapon)) exitWith {false}; + + [ACE_player] call FUNC(inventoryCheck); + + // Statement + [ACE_player, WINDAGE_RIGHT, MAJOR_INCREMENT] call FUNC(adjustScope); + }, {false}, [201, [true, true, false]], true] call CBA_fnc_addKeybind; -// Register fire event handler -["ace_firedPlayer", DFUNC(firedEH)] call CBA_fnc_addEventHandler; -["ace_firedPlayerNonLocal", DFUNC(firedEH)] call CBA_fnc_addEventHandler; + // Register fire event handler + ["ace_firedPlayer", DFUNC(firedEH)] call CBA_fnc_addEventHandler; + ["ace_firedPlayerNonLocal", DFUNC(firedEH)] call CBA_fnc_addEventHandler; + +}] call CBA_fnc_addEventHandler; diff --git a/addons/scopes/XEH_preInit.sqf b/addons/scopes/XEH_preInit.sqf index a7feade1c3..b47cf6628d 100644 --- a/addons/scopes/XEH_preInit.sqf +++ b/addons/scopes/XEH_preInit.sqf @@ -2,6 +2,8 @@ ADDON = false; +PREP_RECOMPILE_START; #include "XEH_PREP.hpp" +PREP_RECOMPILE_END; ADDON = true; diff --git a/addons/scopes/config.cpp b/addons/scopes/config.cpp index 8388b2d04b..85c870b97c 100644 --- a/addons/scopes/config.cpp +++ b/addons/scopes/config.cpp @@ -8,7 +8,7 @@ class CfgPatches { requiredVersion = REQUIRED_VERSION; requiredAddons[] = { "ace_common" }; author = ECSTRING(common,ACETeam); - authors[] = {"KoffeinFlummi", "esteldunedain"}; + authors[] = {"KoffeinFlummi", "esteldunedain", "Ruthberg"}; url = ECSTRING(main,URL); VERSION_CONFIG; }; @@ -19,3 +19,4 @@ class CfgPatches { #include "CfgVehicles.hpp" #include "CfgWeapons.hpp" #include "RscTitles.hpp" +#include "ACE_Settings.hpp" diff --git a/addons/scopes/functions/fnc_adjustScope.sqf b/addons/scopes/functions/fnc_adjustScope.sqf index 9a38ef40cb..75ba045bcc 100644 --- a/addons/scopes/functions/fnc_adjustScope.sqf +++ b/addons/scopes/functions/fnc_adjustScope.sqf @@ -17,39 +17,25 @@ */ #include "script_component.hpp" -private ["_weaponIndex", "_zeroing", "_optic", "_opticConfig", "_verticalIncrement", "_horizontalIncrement", "_maxVertical", "_maxHorizontal", "_adjustment"]; - params ["_unit", "_turretAndDirection", "_majorStep"]; if (!(_unit isKindOf "Man")) exitWith {false}; if (currentMuzzle _unit != currentWeapon _unit) exitWith {false}; +if (!GVAR(enabled)) exitWith {false}; -_weaponIndex = [_unit, currentWeapon _unit] call EFUNC(common,getWeaponIndex); +private _weaponIndex = [_unit, currentWeapon _unit] call EFUNC(common,getWeaponIndex); if (_weaponIndex < 0) exitWith {false}; -_adjustment = _unit getVariable QGVAR(Adjustment); -if (isNil "_adjustment") then { - _adjustment = [[0, 0, 0], [0, 0, 0], [0, 0, 0]]; // [Windage, Elevation, Zero] -}; +private _adjustment = _unit getVariable [QGVAR(Adjustment), [[0, 0, 0], [0, 0, 0], [0, 0, 0]]]; -if (isNil QGVAR(Optics)) then { - GVAR(Optics) = ["", "", ""]; -}; +if (!(GVAR(canAdjustElevation) select _weaponIndex) && (_turretAndDirection in [ELEVATION_UP, ELEVATION_DOWN])) exitWith {false}; +if (!(GVAR(canAdjustWindage) select _weaponIndex) && (_turretAndDirection in [WINDAGE_UP, WINDAGE_DOWN])) exitWith {false}; -_optic = GVAR(Optics) select _weaponIndex; -_opticConfig = configFile >> "CfgWeapons" >> _optic; -_verticalIncrement = getNumber (_opticConfig >> "ACE_ScopeAdjust_VerticalIncrement"); -_horizontalIncrement = getNumber (_opticConfig >> "ACE_ScopeAdjust_HorizontalIncrement"); -_maxVertical = getArray (_opticConfig >> "ACE_ScopeAdjust_Vertical"); -_maxHorizontal = getArray (_opticConfig >> "ACE_ScopeAdjust_Horizontal"); - -if ((count _maxHorizontal < 2) || (count _maxVertical < 2)) exitWith {false}; -if ((_verticalIncrement == 0) && (_turretAndDirection in [ELEVATION_UP, ELEVATION_DOWN])) exitWith {false}; -if ((_horizontalIncrement == 0) && (_turretAndDirection in [WINDAGE_UP, WINDAGE_DOWN])) exitWith {false}; - -_zeroing = _adjustment select _weaponIndex; +private _zeroing = _adjustment select _weaponIndex; _zeroing params ["_elevation", "_windage", "_zero"]; +(GVAR(scopeAdjust) select _weaponIndex) params ["_maxVertical", "_verticalIncrement", "_maxHorizontal", "_horizontalIncrement"]; + switch (_turretAndDirection) do { case ELEVATION_UP: { _elevation = _elevation + _verticalIncrement }; case ELEVATION_DOWN: { _elevation = _elevation - _verticalIncrement }; diff --git a/addons/scopes/functions/fnc_adjustZero.sqf b/addons/scopes/functions/fnc_adjustZero.sqf index 9e953d0523..bc04c45236 100644 --- a/addons/scopes/functions/fnc_adjustZero.sqf +++ b/addons/scopes/functions/fnc_adjustZero.sqf @@ -15,22 +15,15 @@ */ #include "script_component.hpp" -private ["_weaponIndex", "_adjustment", "_zeroing"]; - params ["_unit"]; if (vehicle _unit != _unit) exitWith {false}; -_weaponIndex = [_unit, currentWeapon _unit] call EFUNC(common,getWeaponIndex); +private _weaponIndex = [_unit, currentWeapon _unit] call EFUNC(common,getWeaponIndex); if (_weaponIndex < 0) exitWith {false}; -_adjustment = _unit getVariable QGVAR(Adjustment); -if (isNil "_adjustment") then { - // [Windage, Elevation, Zero] - _adjustment = [[0, 0, 0], [0, 0, 0], [0, 0, 0]]; -}; - -_zeroing = _adjustment select _weaponIndex; +private _adjustment = _unit getVariable [QGVAR(Adjustment), [[0, 0, 0], [0, 0, 0], [0, 0, 0]]]; +private _zeroing = _adjustment select _weaponIndex; _zeroing params ["_elevation", "_windage", "_zero"]; _zero = round((_zero + _elevation) * 10) / 10; diff --git a/addons/scopes/functions/fnc_applyScopeAdjustment.sqf b/addons/scopes/functions/fnc_applyScopeAdjustment.sqf index 7067b0442c..37f83384a6 100644 --- a/addons/scopes/functions/fnc_applyScopeAdjustment.sqf +++ b/addons/scopes/functions/fnc_applyScopeAdjustment.sqf @@ -18,20 +18,12 @@ */ #include "script_component.hpp" -private ["_adjustmentDifference", "_pitchBankYaw", "_adjustment", "_weaponIndex"]; - params ["_unit", "_elevation", "_windage", "_zero"]; -_weaponIndex = [_unit, currentWeapon _unit] call EFUNC(common,getWeaponIndex); +private _weaponIndex = [_unit, currentWeapon _unit] call EFUNC(common,getWeaponIndex); -_adjustment = _unit getVariable QGVAR(Adjustment); -if (isNil "_adjustment") then { - // [Windage, Elevation, Zero] - _adjustment = [[0, 0, 0], [0, 0, 0], [0, 0, 0]]; - _unit setVariable [QGVAR(Adjustment), _adjustment]; -}; - -_adjustmentDifference = (_adjustment select _weaponIndex) vectorDiff [_elevation, _windage, _zero]; +private _adjustment = _unit getVariable [QGVAR(Adjustment), [[0, 0, 0], [0, 0, 0], [0, 0, 0]]]; +private _adjustmentDifference = (_adjustment select _weaponIndex) vectorDiff [_elevation, _windage, _zero]; if (_adjustmentDifference isEqualTo [0,0,0]) exitWith {false}; // Don't coninue if no adjustment is made _adjustment set [_weaponIndex, [_elevation, _windage, _zero]]; @@ -42,9 +34,9 @@ playSound selectRandom ["ACE_Scopes_Click_1", "ACE_Scopes_Click_2", "ACE_Scopes_ // slightly rotate the player if looking through optic if (cameraView == "GUNNER") then { // Convert adjustmentDifference from mils to degrees - _adjustmentDifference = _adjustmentDifference apply {_x * 0.05625}; + _adjustmentDifference = _adjustmentDifference apply {MRAD_TO_DEG(_x)}; _adjustmentDifference params ["_elevationDifference", "_windageDifference"]; - _pitchBankYaw = [_unit] call EFUNC(common,getPitchBankYaw); + private _pitchBankYaw = [_unit] call EFUNC(common,getPitchBankYaw); _pitchBankYaw params ["_pitch", "_bank", "_yaw"]; _pitch = _pitch + _elevationDifference; _yaw = _yaw + _windageDifference; diff --git a/addons/scopes/functions/fnc_calculateZeroAngleCorrection.sqf b/addons/scopes/functions/fnc_calculateZeroAngleCorrection.sqf new file mode 100644 index 0000000000..5197a94e70 --- /dev/null +++ b/addons/scopes/functions/fnc_calculateZeroAngleCorrection.sqf @@ -0,0 +1,68 @@ +/* + * Author: Ruthberg + * Calculates the zero angle correction for the new zero range based on current zero range and bore height (distance between bore- and sight axis) + * + * Arguments: + * 0: Zero range + * 1: Bore height + * 2: Weapon + * 3: Ammo + * 4: Magazine + * 5: Advanced Ballistics enabled? + * + * Return Value: + * zeroAngleCorrection + * + * Example: + * [5, 6, gun, ammo, magazine, true] call ace_scopes_fnc_calculateZeroAngleCorrection + * + * Public: No + */ +#include "script_component.hpp" + +params ["_oldZeroRange", "_newZeroRange", "_boreHeight"/*in cm*/, "_weapon", "_ammo", "_magazine", "_advancedBallistics"]; + +private _airFriction = getNumber (configFile >> "CfgAmmo" >> _ammo >> "airFriction"); +private _initSpeed = getNumber(configFile >> "CfgMagazines" >> _magazine >> "initSpeed"); +private _initSpeedCoef = getNumber(configFile >> "CfgWeapons" >> _weapon >> "initSpeed"); +if (_initSpeedCoef > 0) then { + _initSpeed = _initSpeedCoef; +}; +if (_initSpeedCoef < 0) then { + _initSpeed = _initSpeed * (-1 * _initSpeedCoef); +}; + +private _zeroAngle = "ace_advanced_ballistics" callExtension format ["zeroAngleVanilla:%1:%2:%3:%4", _oldZeroRange, _initSpeed, _airFriction, 0]; +private _vanillaZero = parseNumber _zeroAngle; + +private _trueZero = if (!_advancedBallistics) then { + _zeroAngle = "ace_advanced_ballistics" callExtension format ["zeroAngleVanilla:%1:%2:%3:%4", _newZeroRange, _initSpeed, _airFriction, _boreHeight]; + (parseNumber _zeroAngle) +} else { + // Get Weapon and Ammo Configurations + private _AmmoCacheEntry = uiNamespace getVariable format[QEGVAR(advanced_ballistics,%1), _ammo]; + if (isNil "_AmmoCacheEntry") then { + _AmmoCacheEntry = _ammo call EFUNC(advanced_ballistics,readAmmoDataFromConfig); + }; + private _WeaponCacheEntry = uiNamespace getVariable format[QEGVAR(advanced_ballistics,%1), _weapon]; + if (isNil "_WeaponCacheEntry") then { + _WeaponCacheEntry = _weapon call EFUNC(advanced_ballistics,readWeaponDataFromConfig); + }; + + _AmmoCacheEntry params ["_airFriction", "_caliber", "_bulletLength", "_bulletMass", "_transonicStabilityCoef", "_dragModel", "_ballisticCoefficients", "_velocityBoundaries", "_atmosphereModel", "_ammoTempMuzzleVelocityShifts", "_muzzleVelocityTable", "_barrelLengthTable"]; + _WeaponCacheEntry params ["_barrelTwist", "_twistDirection", "_barrelLength"]; + + if (missionNamespace getVariable [QEGVAR(advanced_ballistics,barrelLengthInfluenceEnabled), false]) then { + private _barrelVelocityShift = [_barrelLength, _muzzleVelocityTable, _barrelLengthTable, _initSpeed] call EFUNC(advanced_ballistics,calculateBarrelLengthVelocityShift); + _initSpeed = _initSpeed + _barrelVelocityShift; + }; + + _zeroAngle = "ace_advanced_ballistics" callExtension format ["zeroAngle:%1:%2:%3:%4:%5:%6:%7:%8:%9", _newZeroRange, _initSpeed, _boreHeight, GVAR(zeroReferenceTemperature), GVAR(zeroReferenceBarometricPressure), GVAR(zeroReferenceHumidity), _ballisticCoefficients select 0, _dragModel, _atmosphereModel]; + (parseNumber _zeroAngle) +}; + +private _zeroAngleCorrection = _trueZero - _vanillaZero; + +missionNamespace setVariable [format[QGVAR(%1_%2_%3_%4_%5_%6_%7), _oldZeroRange, _newZeroRange, _boreHeight, _weapon, _ammo, _magazine, _advancedBallistics], _zeroAngleCorrection]; + +_zeroAngleCorrection diff --git a/addons/scopes/functions/fnc_canAdjustZero.sqf b/addons/scopes/functions/fnc_canAdjustZero.sqf index 477dc12635..037fedd1b5 100644 --- a/addons/scopes/functions/fnc_canAdjustZero.sqf +++ b/addons/scopes/functions/fnc_canAdjustZero.sqf @@ -15,24 +15,17 @@ */ #include "script_component.hpp" -private ["_weaponIndex", "_adjustment", "_elevation"]; - params ["_unit"]; if (cameraView == "GUNNER") exitWith {false}; if (vehicle _unit != _unit) exitWith {false}; if (!(missionNamespace getVariable [QEGVAR(advanced_ballistics,enabled), false])) exitWith {false}; -_weaponIndex = [_unit, currentWeapon _unit] call EFUNC(common,getWeaponIndex); +private _weaponIndex = [_unit, currentWeapon _unit] call EFUNC(common,getWeaponIndex); if (_weaponIndex < 0) exitWith {false}; -_adjustment = _unit getVariable QGVAR(Adjustment); -if (isNil "_adjustment") then { - // [Windage, Elevation, Zero] - _adjustment = [[0, 0, 0], [0, 0, 0], [0, 0, 0]]; -}; - -_elevation = (_adjustment select _weaponIndex) select 0; +private _adjustment = _unit getVariable [QGVAR(Adjustment), [[0, 0, 0], [0, 0, 0], [0, 0, 0]]]; +private _elevation = (_adjustment select _weaponIndex) select 0; // You can only adjust your zero reference, if your relative elevation setting is not 0 _elevation != 0 diff --git a/addons/scopes/functions/fnc_firedEH.sqf b/addons/scopes/functions/fnc_firedEH.sqf index 5d3b975dbf..670db51fe0 100644 --- a/addons/scopes/functions/fnc_firedEH.sqf +++ b/addons/scopes/functions/fnc_firedEH.sqf @@ -1,5 +1,5 @@ /* - * Author: KoffeinFlummi, esteldunedain + * Author: KoffeinFlummi, esteldunedain, Ruthberg * Adjusts the flight path of the bullet according to the zeroing. Called from the unified fired EH only for local and non-local players on foot. * * Arguments: @@ -8,6 +8,9 @@ * Return Value: * None * + * Example: + * call ace_scopes_fnc_firedEH + * * Public: No */ #include "script_component.hpp" @@ -15,19 +18,32 @@ //IGNORE_PRIVATE_WARNING ["_unit", "_weapon", "_muzzle", "_mode", "_ammo", "_magazine", "_projectile", "_vehicle", "_gunner", "_turret"]; TRACE_10("firedEH:",_unit, _weapon, _muzzle, _mode, _ammo, _magazine, _projectile, _vehicle, _gunner, _turret); -private _adjustment = _unit getVariable [QGVAR(Adjustment), []]; -if (_adjustment isEqualTo []) exitWith {}; +if (!(_ammo isKindOf "BulletBase")) exitWith {}; private _weaponIndex = [_unit, currentWeapon _unit] call EFUNC(common,getWeaponIndex); if (_weaponIndex < 0) exitWith {}; -private _zeroing = _adjustment select _weaponIndex; +private _adjustment = ACE_player getVariable [QGVAR(Adjustment), [[0, 0, 0], [0, 0, 0], [0, 0, 0]]]; +private _zeroing = +(_adjustment select _weaponIndex); TRACE_1("Adjusting With",_zeroing); +// Convert zeroing from mils to degrees +_zeroing = _zeroing vectorMultiply MRAD_TO_DEG(1); + +if (GVAR(correctZeroing)) then { + private _advancedBallistics = missionNamespace getVariable [QEGVAR(advanced_ballistics,enabled), false]; + private _boreHeight = GVAR(boreHeight) select _weaponIndex; + private _oldZeroRange = currentZeroing _unit; + private _newZeroRange = [_unit] call FUNC(getCurrentZeroRange); + private _zeroCorrection = missionNamespace getVariable format[QGVAR(%1_%2_%3_%4_%5_%6_%7), _oldZeroRange, _newZeroRange, _boreHeight, _weapon, _ammo, _magazine, _advancedBallistics]; + if (isNil "_zeroCorrection") then { + _zeroCorrection = [_oldZeroRange, _newZeroRange, _boreHeight, _weapon, _ammo, _magazine, _advancedBallistics] call FUNC(calculateZeroAngleCorrection); + }; + _zeroing = _zeroing vectorAdd [0, 0, _zeroCorrection]; +}; + if (_zeroing isEqualTo [0, 0, 0]) exitWith {}; -// Convert zeroing from mils to degrees -_zeroing = _zeroing vectorMultiply 0.05625; _zeroing params ["_elevation", "_windage", "_zero"]; [_projectile, _windage, _elevation + _zero, 0] call EFUNC(common,changeProjectileDirection); diff --git a/addons/scopes/functions/fnc_getBoreHeight.sqf b/addons/scopes/functions/fnc_getBoreHeight.sqf new file mode 100644 index 0000000000..98fb75f78a --- /dev/null +++ b/addons/scopes/functions/fnc_getBoreHeight.sqf @@ -0,0 +1,57 @@ +/* + * Author: Ruthberg + * Gets the bore height of the weapon & optic combination with the given weapon index + * + * Arguments: + * 0: Unit + * 1: Weapon index + * + * Return Value: + * bore height + * + * Example: + * [player] call ace_scopes_fnc_getBoreHeight + * + * Public: Yes + */ +#include "script_component.hpp" + +params ["_player", "_weaponIndex"]; + +if (_weaponIndex < 0 || {_weaponIndex > 2}) exitWith { 0 }; + +private _weaponClass = [primaryWeapon _player, secondaryWeapon _player, handgunWeapon _player] select _weaponIndex; +private _opticsClass = ([_player] call FUNC(getOptics)) select _weaponIndex; + +if (_opticsClass == "") then { _opticsClass = _weaponClass; }; + +// Determine rail height above bore +private _railHeightAboveBore = 0; +private _weaponConfig = configFile >> "CfgWeapons" >> _weaponClass; +if (isNumber (_weaponConfig >> "ACE_RailHeightAboveBore")) then { + _railHeightAboveBore = getNumber(_weaponConfig >> "ACE_RailHeightAboveBore"); +} else { + switch (_weaponIndex) do { + case 0: { _railHeightAboveBore = 3.0; }; // Rifle + case 2: { _railHeightAboveBore = 0.7; }; // Pistol + }; +}; +// Determine scope height above rail +private _scopeHeightAboveRail = 0; +private _opticConfig = configFile >> "CfgWeapons" >> _opticsClass; +if (isNumber (_opticConfig >> "ACE_ScopeHeightAboveRail")) then { + _scopeHeightAboveRail = getNumber(_opticConfig >> "ACE_ScopeHeightAboveRail"); +} else { + switch (getNumber(_opticConfig >> "ItemInfo" >> "opticType")) do { + case 1: { _scopeHeightAboveRail = 4.5; }; // RCO or similar + case 2: { _scopeHeightAboveRail = 4.0; }; // High power scope + default { + switch (_weaponIndex) do { + case 0: { _scopeHeightAboveRail = 0.5; }; // Rifle iron sights + case 2: { _scopeHeightAboveRail = 0.3; }; // Pistol iron sights + }; + }; + }; +}; + +(_railHeightAboveBore + _scopeHeightAboveRail) diff --git a/addons/scopes/functions/fnc_getCurrentZeroRange.sqf b/addons/scopes/functions/fnc_getCurrentZeroRange.sqf new file mode 100644 index 0000000000..7af8d2e3e9 --- /dev/null +++ b/addons/scopes/functions/fnc_getCurrentZeroRange.sqf @@ -0,0 +1,40 @@ +/* + * Author: Ruthberg + * Gets the zero range of the currently used optic + * + * Arguments: + * 0: Unit + * + * Return Value: + * current zero range + * + * Example: + * [player] call ace_scopes_fnc_getCurrentZeroRange + * + * Public: No + */ +#include "script_component.hpp" + +params ["_unit"]; + +if (!GVAR(enabled)) exitWith { currentZeroing _unit }; + +private _weaponIndex = [_unit, currentWeapon _unit] call EFUNC(common,getWeaponIndex); +if (_weaponIndex < 0) exitWith { currentZeroing _unit }; + +private _optic = GVAR(Optics) select _weaponIndex; +private _opticConfig = if (_optic != "") then { + (configFile >> "CfgWeapons" >> _optic) +} else { + (configFile >> "CfgWeapons" >> (GVAR(Guns) select _weaponIndex)) +}; + +private _zeroRange = currentZeroing _unit; +if (GVAR(overwriteZeroRange) && {GVAR(canAdjustElevation) select _weaponIndex}) then { + _zeroRange = GVAR(defaultZeroRange); +}; +if (isNumber (_opticConfig >> "ACE_ScopeZeroRange")) then { + _zeroRange = getNumber(_opticConfig >> "ACE_ScopeZeroRange"); +}; + +_zeroRange diff --git a/addons/scopes/functions/fnc_initModuleSettings.sqf b/addons/scopes/functions/fnc_initModuleSettings.sqf new file mode 100644 index 0000000000..92742afd14 --- /dev/null +++ b/addons/scopes/functions/fnc_initModuleSettings.sqf @@ -0,0 +1,37 @@ +/* + * Author: Glowbal, Ruthberg + * Module for adjusting the scopes settings + * + * Arguments: + * 0: The module logic + * 1: units + * 2: activated + * + * Return Value: + * None + * + * Example: + * [LOGIC, [bob, kevin], true] call ace_scopes_fnc_initModuleSettings + * + * Public: No + */ +#include "script_component.hpp" + +params ["_logic","_units", "_activated"]; + +if !(_activated) exitWith {}; + +[_logic, QGVAR(enabled), "enabled"] call EFUNC(common,readSettingFromModule); +[_logic, QGVAR(forceUseOfAdjustmentTurrets), "forceUseOfAdjustmentTurrets"] call EFUNC(common,readSettingFromModule); +[_logic, QGVAR(correctZeroing), "correctZeroing"] call EFUNC(common,readSettingFromModule); +[_logic, QGVAR(overwriteZeroRange), "overwriteZeroRange"] call EFUNC(common,readSettingFromModule); +[_logic, QGVAR(defaultZeroRange), "defaultZeroRange"] call EFUNC(common,readSettingFromModule); +[_logic, QGVAR(zeroReferenceTemperature), "zeroReferenceTemperature"] call EFUNC(common,readSettingFromModule); +[_logic, QGVAR(zeroReferenceBarometricPressure), "zeroReferenceBarometricPressure"] call EFUNC(common,readSettingFromModule); +[_logic, QGVAR(zeroReferenceHumidity), "zeroReferenceHumidity"] call EFUNC(common,readSettingFromModule); +[_logic, QGVAR(deduceBarometricPressureFromTerrainAltitude), "deduceBarometricPressureFromTerrainAltitude"] call EFUNC(common,readSettingFromModule); + +GVAR(defaultZeroRange) = 0 max GVAR(defaultZeroRange) min 1000; +GVAR(zeroReferenceTemperature) = -55 max GVAR(zeroReferenceTemperature) max 55; +GVAR(zeroReferenceBarometricPressure) = 0 max GVAR(zeroReferenceBarometricPressure) min 1013.25; +GVAR(zeroReferenceHumidity) = 0 max GVAR(zeroReferenceHumidity) min 1.0; diff --git a/addons/scopes/functions/fnc_inventoryCheck.sqf b/addons/scopes/functions/fnc_inventoryCheck.sqf index 1a79ef0418..817d301221 100644 --- a/addons/scopes/functions/fnc_inventoryCheck.sqf +++ b/addons/scopes/functions/fnc_inventoryCheck.sqf @@ -1,5 +1,5 @@ /* - * Author: KoffeinFlummi, Commy2 + * Author: KoffeinFlummi, Commy2, Ruthberg * Check if weapon optics changed and reset zeroing if needed * * Arguments: @@ -17,28 +17,94 @@ params ["_player"]; -private _adjustment = ACE_player getVariable QGVAR(Adjustment); -if (isNil "_adjustment") then { - // [Windage, Elevation, Zero] - _adjustment = [[0, 0, 0], [0, 0, 0], [0, 0, 0]]; - ACE_player setVariable [QGVAR(Adjustment), _adjustment]; - [ACE_player, QGVAR(Adjustment), _adjustment, 0.5] call EFUNC(common,setVariablePublic); -}; +private _adjustment = ACE_player getVariable [QGVAR(Adjustment), [[0, 0, 0], [0, 0, 0], [0, 0, 0]]]; +private _updateAdjustment = false; -if (isNil QGVAR(Optics)) then { - GVAR(Optics) = ["", "", ""]; -}; private _newOptics = [_player] call FUNC(getOptics); - { if (_newOptics select _forEachIndex != _x) then { - // The optic for this weapon changed, set adjustment to zero - if (!((_adjustment select _forEachIndex) isEqualTo [0, 0, 0])) then { - _adjustment set [_forEachIndex, [0, 0, 0]]; - [ACE_player, QGVAR(Adjustment), _adjustment, 0.5] call EFUNC(common,setVariablePublic); + private _opticConfig = configFile >> "CfgWeapons" >> (_newOptics select _forEachIndex); + private _opticType = getNumber(_opticConfig >> "ItemInfo" >> "opticType"); + private _verticalIncrement = -1; + if (isNumber (_opticConfig >> "ACE_ScopeAdjust_VerticalIncrement")) then { + _verticalIncrement = getNumber (_opticConfig >> "ACE_ScopeAdjust_VerticalIncrement"); }; + private _horizontalIncrement = -1; + if (isNumber (_opticConfig >> "ACE_ScopeAdjust_HorizontalIncrement")) then { + _horizontalIncrement = getNumber (_opticConfig >> "ACE_ScopeAdjust_HorizontalIncrement"); + }; + private _maxVertical = []; + if (isArray (_opticConfig >> "ACE_ScopeAdjust_Vertical")) then { + _maxVertical = getArray (_opticConfig >> "ACE_ScopeAdjust_Vertical"); + }; + private _maxHorizontal = []; + if (isArray (_opticConfig >> "ACE_ScopeAdjust_Horizontal")) then { + _maxHorizontal = getArray (_opticConfig >> "ACE_ScopeAdjust_Horizontal"); + }; + if (GVAR(forceUseOfAdjustmentTurrets) && _opticType == 2) then { + if (_maxVertical isEqualTo []) then { _maxVertical = [-4, 30]; }; + if (_maxHorizontal isEqualTo []) then { _maxHorizontal = [-6, 6]; }; + if (_verticalIncrement == -1) then { _verticalIncrement = 0.1; }; + if (_horizontalIncrement == -1) then { _horizontalIncrement = 0.1; }; + } else { + if (_maxVertical isEqualTo []) then { _maxVertical = [0, 0]; }; + if (_maxHorizontal isEqualTo []) then { _maxHorizontal = [0, 0]; }; + if (_verticalIncrement == -1) then { _verticalIncrement = 0; }; + if (_horizontalIncrement == -1) then { _horizontalIncrement = 0; }; + }; + (GVAR(scopeAdjust) select _forEachIndex) set [0, _maxVertical]; + (GVAR(scopeAdjust) select _forEachIndex) set [1, _verticalIncrement]; + (GVAR(scopeAdjust) select _forEachIndex) set [2, _maxHorizontal]; + (GVAR(scopeAdjust) select _forEachIndex) set [3, _horizontalIncrement]; + GVAR(canAdjustElevation) set [_forEachIndex, (_verticalIncrement > 0) && !(_maxVertical isEqualTo [0, 0])]; + GVAR(canAdjustWindage) set [_forEachIndex, (_horizontalIncrement > 0) && !(_maxHorizontal isEqualTo [0, 0])]; }; } forEach GVAR(Optics); -_adjustment = ACE_player getVariable QGVAR(Adjustment); +private _newGuns = [primaryWeapon _player, secondaryWeapon _player, handgunWeapon _player]; +{ + if ((_newOptics select _x) != (GVAR(Optics) select _x) || (_newGuns select _x != GVAR(Guns) select _x)) then { + // The optic or the weapon changed, set adjustment to zero + if (!((_adjustment select _forEachIndex) isEqualTo [0, 0, 0])) then { + _adjustment set [_forEachIndex, [0, 0, 0]]; + _updateAdjustment = true; + }; + + GVAR(boreHeight) set [_x, [_player, _x] call FUNC(getBoreHeight)]; + + if ((_newOptics select _x) == "") then { + // Check if the weapon comes with an integrated optic + private _weaponConfig = configFile >> "CfgWeapons" >> (_newGuns select _x); + private _verticalIncrement = 0; + if (isNumber (_weaponConfig >> "ACE_ScopeAdjust_VerticalIncrement")) then { + _verticalIncrement = getNumber (_weaponConfig >> "ACE_ScopeAdjust_VerticalIncrement"); + }; + private _horizontalIncrement = 0; + if (isNumber (_weaponConfig >> "ACE_ScopeAdjust_HorizontalIncrement")) then { + _horizontalIncrement = getNumber (_weaponConfig >> "ACE_ScopeAdjust_HorizontalIncrement"); + }; + private _maxVertical = [0, 0]; + if (isArray (_weaponConfig >> "ACE_ScopeAdjust_Vertical")) then { + _maxVertical = getArray (_weaponConfig >> "ACE_ScopeAdjust_Vertical"); + }; + private _maxHorizontal = [0, 0]; + if (isArray (_weaponConfig >> "ACE_ScopeAdjust_Horizontal")) then { + _maxHorizontal = getArray (_weaponConfig >> "ACE_ScopeAdjust_Horizontal"); + }; + TRACE_5("",_newGuns select _x,_verticalIncrement,_horizontalIncrement,_maxVertical,_maxHorizontal); + (GVAR(scopeAdjust) select _x) set [0, _maxVertical]; + (GVAR(scopeAdjust) select _x) set [1, _verticalIncrement]; + (GVAR(scopeAdjust) select _x) set [2, _maxHorizontal]; + (GVAR(scopeAdjust) select _x) set [3, _horizontalIncrement]; + GVAR(canAdjustElevation) set [_x, (_verticalIncrement > 0) && !(_maxVertical isEqualTo [0, 0])]; + GVAR(canAdjustWindage) set [_x, (_horizontalIncrement > 0) && !(_maxHorizontal isEqualTo [0, 0])]; + }; + } +} forEach [0, 1, 2]; + +if (_updateAdjustment) then { + [ACE_player, QGVAR(Adjustment), _adjustment, 0.5] call EFUNC(common,setVariablePublic); +}; + GVAR(Optics) = _newOptics; +GVAR(Guns) = _newGuns; diff --git a/addons/scopes/functions/fnc_showZeroing.sqf b/addons/scopes/functions/fnc_showZeroing.sqf index 530f5cb1d2..cf74e38842 100644 --- a/addons/scopes/functions/fnc_showZeroing.sqf +++ b/addons/scopes/functions/fnc_showZeroing.sqf @@ -20,11 +20,7 @@ disableSerialization; private _weaponIndex = [ACE_player, currentWeapon ACE_player] call EFUNC(common,getWeaponIndex); if (_weaponIndex < 0) exitWith {}; -private _adjustment = ACE_player getVariable QGVAR(Adjustment); -if (isNil "_adjustment") then { - // [Windage, Elevation, Zero] - _adjustment = [[0, 0, 0], [0, 0, 0], [0, 0, 0]]; -}; +private _adjustment = ACE_player getVariable [QGVAR(Adjustment), [[0, 0, 0], [0, 0, 0], [0, 0, 0]]]; // Display the adjustment knobs private _layer = [QGVAR(Zeroing)] call BIS_fnc_rscLayer; diff --git a/addons/scopes/script_component.hpp b/addons/scopes/script_component.hpp index a797b36191..cc6acebc98 100644 --- a/addons/scopes/script_component.hpp +++ b/addons/scopes/script_component.hpp @@ -22,4 +22,6 @@ #define DEBUG_SETTINGS DEBUG_SETTINGS_SCOPES #endif +#define MRAD_TO_DEG(d) (d / 17.45329252) // Conversion factor: 9 / (50 * PI) + #include "\z\ace\addons\main\script_macros.hpp" diff --git a/addons/scopes/stringtable.xml b/addons/scopes/stringtable.xml index 33a9e8beef..939e23feb6 100644 --- a/addons/scopes/stringtable.xml +++ b/addons/scopes/stringtable.xml @@ -1,122 +1,369 @@  + + Scopes + Zielfernrohre + スコープ + 조준경 + Celowniki optyczne + Scopes + Mirini + 瞄准镜 + 瞄準鏡 + + + Enable ACE Scope adjustment + Aktiviere das Nullen von Zielfernrohren + ACE スコープ調節を有効化 + ACE 조준경 영점조작 활성화 + Włącz ustawienia celowników optycznych ACE + Active ACE Scope adjustment + Abilita Regolazione mirino ACE + 开启ACE瞄准镜归零调节 + 開啟ACE瞄準鏡歸零調節 + + + Enable adjustment turrets on high powered scopes + Aktiviere Absehenverstellungen für Waffen mit Zielfernrohren + 高倍率スコープでACE スコープ調節を有効化 + 고성능 조준경 조절 나사 활성화 + Włącz pokrętła regulacyjne + Permet de régler la hausse et la dérive sur les optiques de visée à fort grossissement + Abilita la regolazione delle torrette nei mirini a lunga gittata + 开启高倍率瞄准镜归零调节 + 開啟高倍率瞄準鏡歸零調節 + + + Force adjustment turrets + Erzwinge Absehenverstellungen + ACE スコープ調節を有効化 + 조절 나사 강제 + Wymuś użycie pokręteł regulacyjnych + Impose le réglage de la hausse/dérive + Forza la regolazione delle torrette + 强制使用归零调节 + 強制使用歸零調節 + + + Force usage of adjustmet turrets on high powered scopes + Erzwinge Absehenverstellungen für Waffen mit Zielfernrohren + 高倍率スコープで調整の使用を強制させます + 고성능 조준경의 조절 나사 사용을 강제합니다 + Wymuś użycie pokręteł regulacyjnych dla celowników o dużym powiększeniu + Impose le réglage de la hausse/dérive sur les optiques de visée à fort grossissement + Forza l'uso della regolazione nei mirini a lunga gittata + 强制为高倍率瞄准镜开启归零调节 + 強制為高倍率瞄準鏡開啟歸零調節 + + + Correct zeroing + Nullungsanpassung + ゼロイン調節 + 영점 고치기 + Poprawka zerowania + Corrige le zérotage + Correggi azzeramento + 修正归零 + 修正歸零 + + + Corrects the zeroing of all small arms sights + Korrigiert alle Nullungen von Handfeuerwaffen + 全ての小口径用照準器のゼロインを調節します + 모든 소화기의 영점을 고칩니다 + Poprawia zerowanie wszystkich celowników broni ręcznej + Corrige le zérotage des optiques de visée des petites armes + Corregge l'azzeramento di tutti i mirini di bassa portata + 为所有小口径武器修正归零 + 為所有小口徑武器修正歸零 + + + Overwrite zero distance + Überschreibe Nullung + ゼロイン距離を上書き + 영점거리 덮어쓰기 + Nadpisuje ustawienie dla zerowego dystansu + Remplace la distance de zérotage + Sovrascrivi la distanza zero + 覆写归零距离 + 覆寫歸零距離 + + + Uses the 'defaultZeroRange' setting to overwrite the zero range of high power scopes + Nutzt die Einstellung 'defaultZeroRange' um Zielfernrohre anzupassen + 'defaultZeroRange'設定を使う高倍率スコープのゼロイン距離を上書きします + 기존 고성능 조준경의 영점거리에 '기본설정 영점거리' 를 덮어씌웁니다 + Używa 'defaultZeroRange' zamiast ustawionej odległości zerowania dla celowników o duzym przybliżeniu + Utilise le paramètre 'defaultZeroRange' pour remplacer la distance de zérotage sur les optiques de visée à fort grossissement + Usa le impostazioni di "defaultZeroRange" (Portata Zero Predefinita) per sovrascrivere la portata zero dei mirini a lunga gittata + 使用'defaultZeroRange'来为高倍率瞄准镜覆写预设归零距离 + 使用'defaultZeroRange'來為高倍率瞄準鏡覆寫預設歸零距離 + + + Default zero distance + Standard Nullung + 標準のゼロイン距離 + 기본설정 영점거리 + Domyślne zerowanie + Distance de zérotage par défaut + Distanza zero predefinita + 预设归零距离 + 預設歸零距離 + + + High powered scopes will be zeroed at this distance + Zielfernrohre werden auf diese Entfernung genullt + 高倍率スコープのゼロイン距離はこの設定になります + 고성능 조준경이 정해진 수만큼 영점거리를 맞추게 됩니다. + Celowniki o dużym powiększeniu będą zerowane dla tej odległości + Distance de zérotage par défaut des optiques de visée à fort grossissement + I mirini a lunga gittata verranno azzerrati a questa distanza + 高倍率瞄准镜将归零在这个距离上 + 高倍率瞄準鏡將歸零在這個距離上 + + + Reference temperature + Bezugstemperatur + 温度の参照 + 온도 기준 + Referencyjna temperatura + Température de référence + Temperatura di riferimento + 参考温度 + 參考溫度 + + + Temperature at which the scope was zeroed + Temperatur bei der das Zielfernrohr genullt wurde + スコープがゼロインされる温度 + 조준경 영점조준시 온도 + Temperatura, przy której celownik został wyzerowany + Température de référence pour le zérotage des optiques + Temperatura a cui è stato azzerato il mirino + 武器参考多少温度来进行归零. + 武器參考多少溫度來進行歸零. + + + Reference barometric pressure + Bezugsluftdruck + 気圧の参照 + 기압 기준 + Referencyjne ciśnienie barometryczne + Pression barométrique de référence + Pressione barometrica di riferimento + 参考大气压力 + 參考大氣壓力 + + + Barometric pressure at which the scope was zeroed + Luftdruck bei dem das Zielfernrohr genullt wurde + 気圧の参照 + 조준경 영점조준시 기압 + Ciśnienie barometryczne, przy którym celownik został wyzerowany + Pression barométrique de référence pour le zérotage des optiques + Pressione barometrica a cui è stato azzerato il mirino + 武器参考多少大气压力来进行归零。 + 武器參考多少大氣壓力來進行歸零。 + + + Reference humidity + Bezugsluftfeuchtigkeit + 湿度の参照 + 습도 기준 + Referencyjna wilgotność + Humidité de référence + Umidità di riferimento + 参考湿度 + 參考濕度 + + + Humidity at which the scope was zeroed + Luftfeuchtigkeit bei der das Zielfernrohr genullt wurde + スコープがゼロインされる湿度 + 조준경 영점조준시 습도 + Wilgotność powietrza, przy której celownik został wyzerowany + Taux d'humidité de référence pour le zérotage des optiques + Umidità a cui è stato azzerato il mirino + 武器参考多少湿度来进行归零。 + 武器參考多少濕度來進行歸零。 + + + Deduce pressure from altitude + Abgeleiteter Luftdruck von der Höhe + 高度により圧が減少 + 고도에 맞춰 기압 설정 + Ciśnienie określone na podstawie wysokości + Pression selon l'altitude + Ricava la pressione dall'altitudine + 高度影响大气压力 + 高度影響大氣壓力 + + + Deduce the barometric pressure from the terrain altitude + Abgeleiteter Luftdruck der Geländeumgebung + 標高により気圧が減少されます + 주변 고도에 맞춰 기압을 설정합니다 + Określ ciśnienie barometryczne na podstawie wysokości terenu + Détermine la pression barométrique selon l'altitude du terrain + Ricava la pressione barometrica dall'altitudine del terreno + 在不同高度上会有不同的大气压力 + 在不同高度上會有不同的大氣壓力 + Minor adjustment up + Kleine Korrektur hoch Zerowanie powoli w górę Малая корректировка ВВЕРХ Ajuste menor arriba Regola leggermente alzata in alto Hausse + - Kleine Korrektur nach oben Enyhe állítás fel Pequeno ajuste para cima Korekce nahoru (mírně) 僅かに上へ調節 + 위로 조절 + 向上微调 + 向上微調 Minor adjustment down + Kleine Korrektur runter Zerowanie powoli w dół Малая корректировка ВНИЗ Ajuste menor abajo Regola leggermente alzata in basso Hausse - - Kleine Korrektur nach unten Enyhe állítás le Pequeno ajuste para baixo Korekce dolů (mírně) 僅かに下へ調節 + 아래로 조절 + 向下微调 + 向下微調 Minor adjustment right + Kleine Korrektur rechts Zerowanie powoli w prawo Малая корректировка ВПРАВО Ajuste menor derecha Regola leggermente il tiro a destra Dérive + - Kleine Korrektur nach rechts Enyhe állítás jobbra Pequeno ajuste para direita Korekce doprava (mírně) 僅かに右へ調節 + 오론쪽으로 조절 + 向右微调 + 向右微調 Minor adjustment left + Kleine Korrektur links Zerowanie powoli w lewo Малая корректировка ВЛЕВО Ajuste menor izquierda Regola leggermete il tiro a sinistra Dérive - - Kleine Korrektur nach links Enyhe állítás balra Pequeno ajuste para esquerda Korekce doleva (mírně) 僅かに左へ調節 + 왼쪽으로 조절 + 向左微调 + 向左微調 Major adjustment up + Große Korrektur hoch Zerowanie w górę Большая корректировка ВВЕРХ Ajuste mayor arriba Regola l'alzata in alto Hausse +++ - Große Korrektur nach oben Nagy állítás fel Ajuste grande para cima Korekce nahoru 大きく上へ調節 + 크게 위로 조절 + 向上调整 + 向上調整 Major adjustment down + Große Korrektur runter Zerowanie w dół Большая корректировка ВНИЗ Ajuste mayor abajo Regola l'alzata in basso Hausse - - - - Große Korrektur nach unten Nagy állítás le Ajuste grande para baixo Korekce dolů 大きく下へ調節 + 크게 아래로 조절 + 向下调整 + 向下調整 Major adjustment right + Große Korrektur rechts Zerowanie w prawo Большая корректировка ВПРАВО Ajuste mayor derecha Regola il tiro a destra Dérive +++ - Große Korrektur nach rechts Nagy állítás jobbra Ajuste grande para direita Korekce doprava 大きく右へ調節 + 크게 오른쪽으로 조절 + 向右调整 + 向右調整 Major adjustment left + Große Korrektur links Zerowanie w lewo Большая корректировка ВЛЕВО Ajuste mayor izquierda Regola il tiro a sinistra Dérive - - - - Große Korrektur nach links Nagy állítás balra Ajuste grande para esquerda Korekce doleva 大きく左へ調節 + 크게 왼쪽으로 조절 + 向左调整 + 向左調整 Set zero adjustment + Nullung durchführen Zresetuj wyzerowanie Сбросить корректировку Establecer ajuste a cero Resetta i valori del tiro RAZ corrections - Auf 0 justieren Állítások nullázása Zerar ajuste Vynulovat korekci ゼロインを調節 + 영점 초기화 + 设定归零 + 設定歸零 + + + This module adds windage and elevation adjustment turrets on high power rifle scopes. + Dieses Modul fügt Absehenverstellung (horizontal und vertikal) zu Zielfernrohren hinzu. + モジュールは高倍率ライフル スコープにおいて横風と仰角の調節ができます。 + 이 모듈은 고성능 조준경에 조준 나사를 이용한 편차 및 고도 조절 기능을 더해줍니다. + Ten moduł włącza pokrętła kalibracyjne poprawki na wiatr oraz poprawki wysokości dla celowników o dużym powiększeniu. + Ce module ajoute les tambours de correction de la hausse et de dérive sur les optiques de visée à fort grossissement. + Questo modulo aggiunge lo spostamento dell'aria e la regolazione dell'elevazione delle torrette in mirini a lunga gittata + 此模块可为高倍率瞄准镜新增归零风偏,距离用的调整纽。 + 此模塊可為高倍率瞄準鏡新增歸零風偏,距離用的調整紐。 - \ No newline at end of file + diff --git a/addons/slideshow/CfgVehicles.hpp b/addons/slideshow/CfgVehicles.hpp index af3108eb59..6c11ba866c 100644 --- a/addons/slideshow/CfgVehicles.hpp +++ b/addons/slideshow/CfgVehicles.hpp @@ -35,6 +35,12 @@ class CfgVehicles { typeName = "STRING"; defaultValue = ""; }; + class SetName { + displayName = CSTRING(SetName_DisplayName); + description = CSTRING(SetName_Description); + typeName = "STRING"; + defaultValue = ""; + }; class Duration { displayName = CSTRING(Duration_DisplayName); description = CSTRING(Duration_Description); diff --git a/addons/slideshow/XEH_preInit.sqf b/addons/slideshow/XEH_preInit.sqf index 8943a367f8..fdd70d447b 100644 --- a/addons/slideshow/XEH_preInit.sqf +++ b/addons/slideshow/XEH_preInit.sqf @@ -2,7 +2,9 @@ ADDON = false; +PREP_RECOMPILE_START; #include "XEH_PREP.hpp" +PREP_RECOMPILE_END; GVAR(slideshows) = 0; diff --git a/addons/slideshow/functions/fnc_createSlideshow.sqf b/addons/slideshow/functions/fnc_createSlideshow.sqf index 883ce2fa7d..5eefbd39bc 100644 --- a/addons/slideshow/functions/fnc_createSlideshow.sqf +++ b/addons/slideshow/functions/fnc_createSlideshow.sqf @@ -8,24 +8,25 @@ * 2: Image Paths * 3: Action Names * 4: Slide Duration (0 disables automatic transitions) + * 5: Set Name (default: localized "Slides") * * Return Value: * None * * Example: - * [[object1, object2, object3], [controller1], ["images\image1.paa", "images\image2.paa"], ["Action1", "Action2"], 5] call ace_slideshow_fnc_createSlideshow + * [[object1, object2, object3], [controller1], ["images\image1.paa", "images\image2.paa"], ["Action1", "Action2"], 5, "My Slides"] call ace_slideshow_fnc_createSlideshow * * Public: Yes */ #include "script_component.hpp" -private ["_currentSlideshow", "_slidesAction", "_varString"]; params [ ["_objects", [], [[]] ], ["_controllers", [], [[]] ], ["_images", [], [[]] ], ["_names", [], [[]] ], - ["_duration", 0, [0]] + ["_duration", 0, [0]], + ["_setName", localize LSTRING(Interaction), [""]] ]; // Verify data @@ -41,7 +42,7 @@ if (_controllers isEqualTo []) then { _controllers = _objects; }; -TRACE_4("Information",_objects,_controllers,_images,_names); +TRACE_5("Information",_objects,_controllers,_images,_names,_setName); if (isServer) then { // Default images on whiteboards (first image) @@ -53,7 +54,7 @@ if (isServer) then { GVAR(slideshows) = GVAR(slideshows) + 1; }; -_currentSlideshow = GVAR(slideshows); // Local variable in case GVAR gets changed during execution of below code +private _currentSlideshow = GVAR(slideshows); // Local variable in case GVAR gets changed during execution of below code // If interaction menu module is not present, set default duration value if !(["ace_interact_menu"] call EFUNC(common,isModLoaded)) then { @@ -64,8 +65,22 @@ if !(["ace_interact_menu"] call EFUNC(common,isModLoaded)) then { // Add interactions if automatic transitions are disabled, else setup automatic transitions if (_duration == 0) then { { + if (_setName == "") then { + _setName = localize LSTRING(Interaction); + }; + // Add Slides sub-action and populate with images - _slidesAction = [QGVAR(Slides), localize LSTRING(Interaction), "", {}, {true}, {(_this select 2) call FUNC(addSlideActions)}, [_objects, _images, _names, _x, _currentSlideshow], [0, 0, 0], 2] call EFUNC(interact_menu,createAction); + private _slidesAction = [ + format [QGVAR(slideshow%1), _currentSlideshow], + _setName, + "", + {}, + {true}, + {(_this select 2) call FUNC(addSlideActions)}, + [_objects, _images, _names, _x, _currentSlideshow], + [0, 0, 0], + 2 + ] call EFUNC(interact_menu,createAction); [_x, 0, ["ACE_MainActions"], _slidesAction] call EFUNC(interact_menu,addActionToObject); nil } count _controllers; @@ -73,7 +88,7 @@ if (_duration == 0) then { if !(isServer) exitWith {}; // Formatted GVAR string (multiple modules support) - _varString = format [QGVAR(slideshow%1), _currentSlideshow]; + private _varString = format [QGVAR(slideshow%1), _currentSlideshow]; TRACE_1("Current Slide",_varString); // Set formatted GVAR to first slide diff --git a/addons/slideshow/functions/fnc_moduleInit.sqf b/addons/slideshow/functions/fnc_moduleInit.sqf index bf27bae56b..caef4cb2d8 100644 --- a/addons/slideshow/functions/fnc_moduleInit.sqf +++ b/addons/slideshow/functions/fnc_moduleInit.sqf @@ -10,6 +10,9 @@ * Return Value: * None * + * Example: + * [LOGIC, [bob, kevin], true] call ace_slideshow_fnc_moduleInit + * * Public: No */ #include "script_component.hpp" @@ -17,18 +20,18 @@ // Exit on Headless Client if (!hasInterface && !isDedicated) exitWith {}; -private ["_objects", "_controllers", "_images", "_names", "_duration"]; params [["_logic", objNull, [objNull]], "_units", "_activated"]; if !(_activated) exitWith {}; if (isNull _logic) exitWith {}; // Extract variables from logic -_objects = [_logic getVariable ["Objects", ""], true, true] call EFUNC(common,parseList); -_controllers = [_logic getVariable ["Controllers", ""], true, true] call EFUNC(common,parseList); -_images = [_logic getVariable ["Images", ""], false, false] call EFUNC(common,parseList); -_names = [_logic getVariable ["Names", ""], false, false] call EFUNC(common,parseList); -_duration = _logic getVariable ["Duration", 0]; +private _objects = [_logic getVariable ["Objects", ""], true, true] call EFUNC(common,parseList); +private _controllers = [_logic getVariable ["Controllers", ""], true, true] call EFUNC(common,parseList); +private _images = [_logic getVariable ["Images", ""], false, false] call EFUNC(common,parseList); +private _names = [_logic getVariable ["Names", ""], false, false] call EFUNC(common,parseList); +private _setName = _logic getVariable ["SetName", ""]; +private _duration = _logic getVariable ["Duration", 0]; // Objects synced to the module { @@ -37,6 +40,6 @@ _duration = _logic getVariable ["Duration", 0]; } count (synchronizedObjects _logic); // Prepare with actions -[_objects, _controllers, _images, _names, _duration] call FUNC(createSlideshow); +[_objects, _controllers, _images, _names, _duration, _setName] call FUNC(createSlideshow); INFO_1("Slideshow Module Initialized on %1 Objects", count _objects); diff --git a/addons/slideshow/stringtable.xml b/addons/slideshow/stringtable.xml index a1f9724199..42a049b9bb 100644 --- a/addons/slideshow/stringtable.xml +++ b/addons/slideshow/stringtable.xml @@ -13,6 +13,9 @@ Presentación de diapositivas Mostra Diapositive スライドショー + 슬라이드 쇼 + 幻燈片 + 幻灯片 This module allows you to set up slide-shows on different objects. One module per image list. Only objects with hiddenSelection 0 are supported. @@ -26,6 +29,9 @@ Tento modul umožňuje nastavit prezentaci na různé objekty. Jeden modul na seznam s obrázky. Podporované jsou pouze objekty s hiddenSelection 0. Questo modulo ti permette di creare una presentazione con diapositive su vari oggetti. Un modulo per lista immagini. Solo oggetti con hiddenSelection 0 sono supportati. さまざまなオブジェクトへスライドショーを設定することができます。1つのモジュールは各画像リストになっています。オブジェクトが hiddenSelection 0へ対応している必要があります。 + 이 모듈은 다른 물체에 대해 슬라이드 쇼를 놓을 수 있게 해줍니다. 한 모듈당 한 이미지목록만 가능합니다. 또한 물체가 hiddenSelection 0 를 지원해야만합니다. + 此模塊可讓圖片以幻燈片的形式顯示在物件上,每個模塊都能設定一串幻燈片清單,被設定的物件不能有隱藏部位(hiddenSelection) + 此模块可让图片以幻灯片的形式显示在物件上,每个模块都能设定一串幻灯片清单,被设定的物件不能有隐藏部位(hiddenSelection) Objects @@ -39,24 +45,30 @@ Objetos Oggetti オブジェクト + 물체 + 物件 + 物件 - Object names (can also be synchronized objects) slide-show will be displayed on, separated by commas if multiple. Reference INFO for object support. - Objektnamen (können auch synchronisierte Objekte sein) auf denen die Diavorführung abgepielt wird. Werden ggf. durch Kommata getrennt. Weiteres in der INFO für unterstützte Objekte. + Object names (can also be synchronized objects) slide-show will be displayed on, separated by commas if multiple. + Objektnamen (können auch synchronisierte Objekte sein) auf denen die Diavorführung abgepielt wird. Werden ggf. durch Kommata getrennt. Nom d'objets (peuvent aussi être des objets synchronisés) sur lesquels les diaporamas vont être affichées, séparation par virgule si plusieurs. - Nazwy obiektów (mogą to też być zsynchronizowane obiekty) na których pokaz slajdów zostanie pokazany, oddzielony przecinkiem jeżeli jest ich więcej niż 1. Sprawdź opis modułu aby dowiedzieć się jakie obiekty są wspierane przez moduł. - Objektum nevek (szinkronizált is lehet) amik a vetítésen megjelennek, több darab esetén vesszővel elválasztva. Objektumtámogatásért az INFO-t tekintsd meg. - Nomes dos objetos (também podem ser objetos sincronizados) em que a apresentação de slides será mostrada, separado por vírgulas se for mais de um. Referência INFO para suporte do objeto. - Имена объектов (так же могут использоваться синхронизированные объекты), на которых будет отображаться слайд-шоу, разделенные запятыми. Посмотрите описание, чтобы понять, какие объекты поддерживаются. - Los nombres de objetos (también pueden ser objetos sincronizados) de diapositivas se mostrarán en, separados por comas. Referencia INFO para el soporte del objeto. - Jména objektů (lze také použít synchronizované objekty) které se budou zobrazovat v prezentaci, oddělit čárkou pokud jich je více. Zkontrolujte POPIS abyste zjistili, zda je objekt podporován modulem. - Nomi di oggetti (possono anche essere oggetti sincronizzati) che verranno usati per la presentazione di diapositive, separato da virgole se più di uno. Fai riferimento ad INFO per gli oggetti supportati. + Nazwy obiektów (mogą to też być zsynchronizowane obiekty) na których pokaz slajdów zostanie pokazany, oddzielony przecinkiem jeżeli jest ich więcej niż 1. + Objektum nevek (szinkronizált is lehet) amik a vetítésen megjelennek, több darab esetén vesszővel elválasztva. + Nomes dos objetos (também podem ser objetos sincronizados) em que a apresentação de slides será mostrada, separado por vírgulas se for mais de um. + Имена объектов (так же могут использоваться синхронизированные объекты), на которых будет отображаться слайд-шоу, разделенные запятыми. + Los nombres de objetos (también pueden ser objetos sincronizados) de diapositivas se mostrarán en, separados por comas. + Jména objektů (lze také použít synchronizované objekty) které se budou zobrazovat v prezentaci, oddělit čárkou pokud jich je více. + Nomi di oggetti (possono anche essere oggetti sincronizzati) che verranno usati per la presentazione di diapositive, separato da virgole se più di uno. スライドショーを表示するオブジェクト名 (オブジェクトとの同期も可)。複数ある場合はコンマで区切れます + 슬라이드 쇼가 보여질 물체(동기화 되는 물체도 가능합니다) 명칭, 다수의 경우 쉼표로 구분합니다. + 物件名稱 (也可使用同步線來設定),幻燈片將會顯示在該物件上,如有多個物件,請以逗號作區隔 + 物件名称 (也可使用同步线来设定),幻灯片将会显示在该物件上,如有多个物件,请以逗号作区隔 Controllers Steuereinheit - Controleurs + Contrôleurs Kontroler Vezérlők Controles @@ -65,11 +77,14 @@ Kontrolor Controllori コントローラ + 조종 장치 + 控制器 + 控制器 Controller object names, separated by commas if multiple. Objekte die als Steuereinheit fungieren. Werden ggf. durch Kommata getrennt. - Noms de controleur d'objets, séparation par virgule si plusieurs + Noms de contrôleur d'objets, séparation par virgule si plusieurs Nazwa obiektu - kontrolera, oddzielona przecinkami jeżeli jest ich więcej niż 1. Vezérlő objektum nevek, vesszővel elválasztva több darab esetén. Nome dos objetos de controle, separado por vírgula se mais de um. @@ -77,6 +92,9 @@ Nombres de objeto de controlador, separados por comas. Nomi di oggetti controllori, separati da virgole se multipli. コントローラに指定するオブジェクト名を記入し、複数ある場合はコンマで区切れます。 + 조종 장치 물체 명칭, 다수의 경우 쉼표로 구분됩니다. + 指定是控制器的物件名稱,如有多個物件,請以逗號作區隔 + 指定是控制器的物件名称,如有多个物件,请以逗号作区隔 Images @@ -90,6 +108,9 @@ Imágenes Immagini 画像 + 사진 + 圖片 + 图片 List of images that will be used for the slide-show, separated by commas, with full path correctly formatted (eg. images\image.paa). @@ -103,6 +124,9 @@ Seznam obrázků které budou použity v prezentaci, oddělené čárkami, s kompletní cestou ve správném formátu (např. image\image.paa). Lista di immagini che verranno usate durante la presentazione, separati da virgole, con il formato completo del percorso (es. images\image.paa) 完全なパスでスライドショーに使う画像一覧を入力してください。コンマで区別できます。(例: images\image.paa) + 슬라이드 쇼에 쓰일 사진목록입니다, 쉼표로 구분됩니다, 경로설정을 정확히 하십시요. (예: 사진\사진.ppa) + 要做為幻燈片的圖片清單,每個圖片請已逗號區隔,並輸入完整路徑位址 (例如:images\image.paa) + 要做为幻灯片的图片清单,每个图片请已逗号区隔,并输入完整路径位址 (例如:images\image.paa) Interaction Names @@ -116,6 +140,9 @@ Nomi Interazioni Interaktionsnamen インタラクション名 + 상호작용 명칭 + 互動鍵名稱 + 互动键名称 List of names that will be used for interaction entries, separated by commas, in order of images. @@ -128,10 +155,33 @@ Lista di nomi che verranno usati per per le interazioni, separati da virgole, in ordine per immagini. Liste aller Namen, die für Interaktionseinträge genutzt werden. Mit Kommata getrennt, in Reihenfolge der Bilder. 画像を操作できるインタラクション エントリ名の一覧を入力してください。コンマで区切り複数を指定できます。 + 상호작용 메세지에 쓰일 명칭입니다, 쉼표로 구분합니다, 이미지의 순서입니다. + 設定互動鍵切換圖片時的按鈕名稱,多個按鈕請以逗號做區隔,有多少圖片就輸入多少個按鈕,以利切換圖片 + 设定互动键切换图片时的按钮名称,多个按钮请以逗号做区隔,有多少图片就输入多少个按钮,以利切换图片 + + + Set Name + Setze Namen + Ustaw nazwę + 名前設定 + Définir le nom + Imposta Nome + 設定名稱 + 设定名称 + + + Name that will be used for main interaction entry (to distinguish multiple slideshows). Default: "Slides" + Name der für den Hauptinteraktionseintrag benutzt wird (um mehrere Diavorführungen voneinander zu trennen). + Nazwa, która będzie użyta w głównym menu interakcji (w celu rozróżnienia różnych slajdów). Domyślnie: "Slides" + メイン インタラクション エントリで使われる名前を設定します。(複数のスライドショーを区別するため)。標準: "Slides" + Un nom qui sera utilisé pour interagir avec plusieurs diaporamas. Par défaut : "Slides" + Nome che sarà utilizzato per le principali interazioni (per distinguere le multiple diapositive). Predefinito: "Slides" + 設定該幻燈片的標題名稱 (用來區分多個不同標題的幻燈片) 預設名稱: "幻燈片" + 设定该幻灯片的标题名称 (用来区分多个不同标题的幻灯片) 预设名称: "幻灯片" Slide Duration - Durée d'une diapositive + Durée d'un diaporama Czas trwania slajdów Dia időtartam Duração do Slide @@ -141,10 +191,13 @@ Durata Diapositiva Länge der Diavorführung pro Bild スライドの持続時間 + 슬라이드 지속시간 + 幻燈片顯示時間 + 幻灯片显示时间 Duration of each slide. Default: 0 (Automatic Transitions Disabled) - Durée de chaque diapositive. Dafaut: 0 (transition automatique désactivée) + Durée de chaque diaporama. Défaut: 0 (transition automatique désactivée) Czas trwania poszczególnych slajdów. Domyślnie: 0 (Automatyczne przejścia wyłączone) A diák időtartama. Alapértelmezett: 0 (Automatikus váltás letiltva) Duração de cada slide. Padrão: 0 (Transição automática desabilitada) @@ -154,10 +207,13 @@ Durata di ogni diapositiva. Default: 0 (Transizioni Automatiche Disabilitate) Länge der Diavorführung pro Bild. Standard: 0 (Automatischer Wechsel deaktiviert) 各スライドの持続時間。標準:0 (自動的な切り替えは無効) + 매 슬라이드의 지속시간. 기본설정: 0 (자동 전환 비활성화) + 每張幻燈片顯示的時間。 預設:0 (自動換圖已禁用) + 每张幻灯片显示的时间。 预设:0 (自动换图已禁用) Slides - Diapositives + Diapo Slajdy Diák Slides @@ -167,6 +223,9 @@ Diapositive Dias スライド + 슬라이드 + 幻燈片 + 幻灯片 - \ No newline at end of file + diff --git a/addons/smallarms/CfgWeapons.hpp b/addons/smallarms/CfgWeapons.hpp index d998ceb1da..cc7e3cbf2e 100644 --- a/addons/smallarms/CfgWeapons.hpp +++ b/addons/smallarms/CfgWeapons.hpp @@ -111,7 +111,7 @@ class CfgWeapons { // SMG Scorpion //////////////////////////////////////////////////// - class SMG_02_base_F: Rifle_Base_F { + class SMG_02_base_F: Rifle_Short_Base_F { //http://www.czub.cz/zbrojovka/cz-manual/Instruction-Manual-Scorpion-EVO-3-A1_en.pdf // 1150 rpm diff --git a/addons/spectator/ACE_Settings.hpp b/addons/spectator/ACE_Settings.hpp index 31e4ea3fd0..6030414908 100644 --- a/addons/spectator/ACE_Settings.hpp +++ b/addons/spectator/ACE_Settings.hpp @@ -1,24 +1,16 @@ class ACE_Settings { - class GVAR(filterUnits) { - displayName = CSTRING(units_DisplayName); - description = CSTRING(units_Description); - typeName = "SCALAR"; - value = 2; - values[] = {CSTRING(units_none), CSTRING(units_players), CSTRING(units_playable), CSTRING(units_all)}; - }; - class GVAR(filterSides) { - displayName = CSTRING(sides_DisplayName); - description = CSTRING(sides_Description); - typeName = "SCALAR"; + class GVAR(enableAI) { + displayName = CSTRING(ai_DisplayName); + description = CSTRING(ai_Description); + typeName = "BOOL"; value = 0; - values[] = {CSTRING(sides_player), CSTRING(sides_friendly), CSTRING(sides_hostile), CSTRING(sides_all)}; }; class GVAR(restrictModes) { displayName = CSTRING(modes_DisplayName); description = CSTRING(modes_Description); typeName = "SCALAR"; value = 0; - values[] = {CSTRING(modes_all), CSTRING(modes_unit), CSTRING(modes_free), CSTRING(modes_internal), CSTRING(modes_external)}; + values[] = {CSTRING(modes_all), CSTRING(modes_unit), "$STR_A3_Spectator_free_camera_tooltip", "$STR_A3_Spectator_1pp_camera_tooltip", "$STR_A3_Spectator_3pp_camera_tooltip"}; }; class GVAR(restrictVisions) { displayName = CSTRING(visions_DisplayName); diff --git a/addons/spectator/CfgEventHandlers.hpp b/addons/spectator/CfgEventHandlers.hpp index becf395052..7abe7ca4e3 100644 --- a/addons/spectator/CfgEventHandlers.hpp +++ b/addons/spectator/CfgEventHandlers.hpp @@ -16,3 +16,15 @@ class Extended_PostInit_EventHandlers { init = QUOTE(call COMPILE_FILE(XEH_postInit)); }; }; + +class Extended_DisplayLoad_EventHandlers { + class RscRespawnCounter { + ADDON = QUOTE(_this call FUNC(compat_counter)); + }; + class RscDisplayEGSpectator { + ADDON = QUOTE(_this call FUNC(compat_spectatorBI)); + }; + class RscDisplayCurator { + ADDON = QUOTE(_this call FUNC(compat_zeus)); + }; +}; diff --git a/addons/spectator/CfgVehicles.hpp b/addons/spectator/CfgVehicles.hpp index 268aabbef5..861a619833 100644 --- a/addons/spectator/CfgVehicles.hpp +++ b/addons/spectator/CfgVehicles.hpp @@ -3,59 +3,17 @@ class CfgVehicles { class GVAR(moduleSettings): ACE_Module { scope = 2; displayName = CSTRING(Settings_DisplayName); - icon = QPATHTOF(UI\Icon_Module_Spectator_ca.paa); + icon = QPATHTOF(data\Icon_Module_Spectator_ca.paa); category = "ACE"; function = QFUNC(moduleSpectatorSettings); isGlobal = 1; author = ECSTRING(common,ACETeam); class Arguments { - class unitsFilter { - displayName = CSTRING(units_DisplayName); - description = CSTRING(units_Description); - typeName = "NUMBER"; - class values { - class none { - name = CSTRING(units_none); - value = 0; - }; - class players { - name = CSTRING(units_players); - value = 1; - }; - class playable { - name = CSTRING(units_playable); - value = 2; - default = 1; - }; - class all { - name = CSTRING(units_all); - value = 3; - }; - }; - }; - class sidesFilter { - displayName = CSTRING(sides_DisplayName); - description = CSTRING(sides_Description); - typeName = "NUMBER"; - class values { - class player { - name = CSTRING(sides_player); - value = 0; - default = 1; - }; - class friendly { - name = CSTRING(sides_friendly); - value = 1; - }; - class hostile { - name = CSTRING(sides_hostile); - value = 2; - }; - class all { - name = CSTRING(sides_all); - value = 3; - }; - }; + class enableAI { + displayName = CSTRING(ai_DisplayName); + description = CSTRING(ai_Description); + typeName = "BOOL"; + defaultValue = 0; }; class cameraModes { displayName = CSTRING(modes_DisplayName); @@ -72,15 +30,15 @@ class CfgVehicles { value = 1; }; class free { - name = CSTRING(modes_free); + name = "$STR_A3_Spectator_free_camera_tooltip"; value = 2; }; class internal { - name = CSTRING(modes_internal); + name = "$STR_A3_Spectator_1pp_camera_tooltip"; value = 3; }; class external { - name = CSTRING(modes_external); + name = "$STR_A3_Spectator_3pp_camera_tooltip"; value = 4; }; }; @@ -114,4 +72,17 @@ class CfgVehicles { description = CSTRING(Settings_Description); }; }; + class VirtualMan_F; + class GVAR(virtual): VirtualMan_F { + author = ECSTRING(common,ACETeam); + displayName = CSTRING(DisplayName); + scope = 2; + scopeArsenal = 0; + scopeCurator = 0; + + weapons[] = {}; + + delete ACE_Actions; + delete ACE_SelfActions; + }; }; diff --git a/addons/spectator/UI/interface.hpp b/addons/spectator/UI/interface.hpp deleted file mode 100644 index 392cd9a43d..0000000000 --- a/addons/spectator/UI/interface.hpp +++ /dev/null @@ -1,255 +0,0 @@ -// Temporary fix until BI take care of it -class RscFrame { - x = 0; - y = 0; - w = 0; - h = 0; -}; - - -class RscButtonMenu; -class RscControlsGroupNoScrollbars; -//class RscFrame; -class RscListBox; -class RscMapControl; -class RscPicture; -class RscText; -class RscTree; - -class GVAR(interface) { - idd = 12249; - enableSimulation = 1; - movingEnable = 0; - onLoad = QUOTE([ARR_2('onLoad',_this)] call FUNC(handleInterface)); - onUnload = QUOTE([ARR_2('onUnload',_this)] call FUNC(handleInterface)); - onKeyDown = QUOTE([ARR_2('onKeyDown',_this)] call FUNC(handleInterface)); - onKeyUp = QUOTE([ARR_2('onKeyUp',_this)] call FUNC(handleInterface)); - class controlsBackground { - class mouseHandler: RscControlsGroupNoScrollbars { - x = safeZoneXAbs; - y = safeZoneY; - w = safeZoneWAbs; - h = safeZoneH; - onMouseButtonDown = QUOTE([ARR_2('onMouseButtonDown',_this)] call FUNC(handleInterface)); - onMouseButtonUp = QUOTE([ARR_2('onMouseButtonUp',_this)] call FUNC(handleInterface)); - onMouseZChanged = QUOTE([ARR_2('onMouseZChanged',_this)] call FUNC(handleInterface)); - onMouseMoving = QUOTE([ARR_2('onMouseMoving',_this)] call FUNC(handleInterface)); - onMouseHolding = QUOTE([ARR_2('onMouseMoving',_this)] call FUNC(handleInterface)); - }; - }; - class controls { - class compass: RscControlsGroupNoScrollbars { - idc = IDC_COMP; - x = COMPASS_X; - y = safeZoneY; - w = COMPASS_W; - h = TOOL_H; - class controls { - class compassBack: RscText { - x = 0; - y = 0; - w = COMPASS_W; - h = TOOL_H; - colorBackground[] = {COL_BACK}; - }; - class compass0_90: RscPicture { - idc = IDC_COMP_0; - x = COMPASS_W * 0.5; - y = 0; - w = COMPASS_W * 0.5; - h = TOOL_H; - text = "A3\UI_F_Curator\Data\CfgIngameUI\compass\texture180_ca.paa"; - }; - class compass90_180: compass0_90 { - idc = IDC_COMP_90; - x = COMPASS_W; - text = "A3\UI_F_Curator\Data\CfgIngameUI\compass\texture270_ca.paa"; - }; - class compass180_270: compass0_90 { - idc = IDC_COMP_180; - x = 0; - text = "A3\UI_F_Curator\Data\CfgIngameUI\compass\texture0_ca.paa"; - }; - class compass270_0: compass0_90 { - idc = IDC_COMP_270; - x = COMPASS_W * -0.5; - text = "A3\UI_F_Curator\Data\CfgIngameUI\compass\texture90_ca.paa"; - }; - class compassCaret: RscFrame { - x = COMPASS_W * 0.5; - y = 0; - w = 0; - h = TOOL_H; - colorText[] = {COL_FORE}; - }; - class compassFrame: compassBack { - style = 64; - shadow=2; - colorText[] = {COL_FORE}; - }; - }; - }; - class toolbar: RscControlsGroupNoScrollbars { - idc = IDC_TOOL; - x = safeZoneX; - y = safeZoneY + safeZoneH - TOOL_H; - w = safeZoneW; - h = TOOL_H; - class controls { - class nameTool: RscText { - idc = IDC_TOOL_NAME; - style = 2; - x = 0; - y = 0; - w = TOOL_W * 2; - h = TOOL_H; - shadow = 2; - colorText[]={COL_FORE}; - colorBackground[] = {COL_BACK}; - sizeEx = H_PART(1); - }; - class nameFrame: nameTool { - idc = -1; - style = 64; - }; - class viewTool: nameTool { - idc = IDC_TOOL_VIEW; - x = TOOL_W * 2 + MARGIN; - w = TOOL_W; - }; - class viewFrame: viewTool { - idc = -1; - style = 64; - }; - class visionTool: viewTool { - idc = IDC_TOOL_VISION; - x = TOOL_W * 3 + MARGIN * 2; - }; - class visionFrame: visionTool { - idc = -1; - style = 64; - }; - class clockTool: viewTool { - idc = IDC_TOOL_CLOCK; - x = safeZoneW - TOOL_W * 3 - MARGIN * 2; - }; - class clockFrame: clockTool { - idc = -1; - style = 64; - }; - class zoomTool: viewTool { - idc = IDC_TOOL_FOV; - x = safeZoneW - TOOL_W * 2 - MARGIN; - }; - class zoomFrame: zoomTool { - idc = -1; - style = 64; - }; - class speedTool: viewTool { - idc = IDC_TOOL_SPEED; - x = safeZoneW - TOOL_W; - }; - class speedFrame: speedTool { - idc = -1; - style = 64; - }; - }; - }; - class unitWindow: RscControlsGroupNoScrollbars { - idc = IDC_UNIT; - x = safeZoneX; - y = safeZoneY + TOOL_H * 6; - w = TOOL_W * 2; - h = safeZoneH - TOOL_H * 13; - class controls { - class unitTitle: RscText { - x = 0; - y = 0; - w = TOOL_W * 2; - h = H_PART(1); - style = 2; - colorText[] = {COL_FORE}; - colorBackground[] = {COL_FORE_D}; - sizeEx = H_PART(1); - text = CSTRING(UnitTitle); - }; - class unitTree: RscTree { - idc = IDC_UNIT_TREE; - x = 0; - y = H_PART(1); - w = TOOL_W * 2; - h = safeZoneH - TOOL_H * 14; - sizeEx = H_PART(0.8); - colorText[] = {COL_FORE}; - colorBorder[] = {0,0,0,0}; - colorBackground[] = {COL_BACK}; - colorSelect[] = { - "profilenamespace getVariable ['GUI_BCG_RGB_R',0.77]", - "profilenamespace getVariable ['GUI_BCG_RGB_G',0.51]", - "profilenamespace getVariable ['GUI_BCG_RGB_B',0.08]", - 1 - }; - multiselectEnabled = 0; - maxHistoryDelay = 10e10; - onTreeDblClick = QUOTE([ARR_2('onTreeDblClick',_this)] call FUNC(handleInterface)); - }; - class unitFrame: RscFrame { - x = 0; - y = 0; - w = TOOL_W * 2; - h = safeZoneH - TOOL_H * 13; - shadow = 2; - colorText[] = {COL_FORE}; - }; - }; - }; - class helpWindow: RscControlsGroupNoScrollbars { - idc = IDC_HELP; - x = safeZoneX + safeZoneW - TOOL_W * 2; - y = safeZoneY + TOOL_H * 6; - w = TOOL_W * 2; - h = safeZoneH - TOOL_H * 13; - class controls { - class helpTitle: RscText { - x = 0; - y = 0; - w = TOOL_W * 2; - h = H_PART(1); - style = 2; - colorText[] = {COL_FORE}; - colorBackground[] = {COL_FORE_D}; - sizeEx = H_PART(1); - text = CSTRING(HelpTitle); - }; - class helpContent: RscListBox { - idc = IDC_HELP_LIST; - x = 0; - y = H_PART(1); - w = TOOL_W * 2; - h = safeZoneH - TOOL_H * 14; - colorBackground[] = {COL_BACK}; - sizeEx = H_PART(0.8); - default = 1; - }; - class helpFrame: RscFrame { - x = 0; - y = 0; - w = TOOL_W * 2; - h = safeZoneH - TOOL_H * 13; - shadow = 2; - colorText[] = {COL_FORE}; - }; - }; - }; - class mapOverlay: RscMapControl { - idc = IDC_MAP; - type = 100; - x = safeZoneX; - y = safeZoneY; - w = safeZoneW; - h = safeZoneH; - onMouseButtonDown = QUOTE([ARR_2('onMapClick',_this)] call FUNC(handleInterface)); - onDraw = QUOTE(_this call FUNC(handleMap)); - }; - }; -}; diff --git a/addons/spectator/XEH_PREP.hpp b/addons/spectator/XEH_PREP.hpp index cc29fde611..fdcb6a22cb 100644 --- a/addons/spectator/XEH_PREP.hpp +++ b/addons/spectator/XEH_PREP.hpp @@ -1,23 +1,63 @@ +// Camera functions +PREP(cam); +PREP(cam_prepareTarget); +PREP(cam_resetTarget); +PREP(cam_setCameraMode); +PREP(cam_setTarget); +PREP(cam_setVisionMode); +PREP(cam_tick); +PREP(cam_toggleSlow); -PREP(cacheUnitInfo); -PREP(cycleCamera); -PREP(handleCamera); -PREP(handleCompass); -PREP(handleIcons); -PREP(handleInterface); -PREP(handleMap); -PREP(handleMouse); -PREP(handleToolbar); -PREP(handleUnits); -PREP(interrupt); +// UI functions +PREP(ui); +PREP(ui_draw3D); +PREP(ui_fadeList); +PREP(ui_getTreeDataIndex); +PREP(ui_handleChildDestroyed); +PREP(ui_handleKeyDown); +PREP(ui_handleKeyUp); +PREP(ui_handleListClick); +PREP(ui_handleMapClick); +PREP(ui_handleMapDraw); +PREP(ui_handleMouseButtonDblClick); +PREP(ui_handleMouseButtonDown); +PREP(ui_handleMouseMoving); +PREP(ui_handleMouseZChanged); +PREP(ui_toggleMap); +PREP(ui_toggleUI); +PREP(ui_updateCamButtons); +PREP(ui_updateHelp); +PREP(ui_updateIconsToDraw); +PREP(ui_updateListEntities); +PREP(ui_updateListFocus); +PREP(ui_updateWidget); + +// Utility functions +PREP(compat_counter); +PREP(compat_spectatorBI); +PREP(compat_zeus); +PREP(getGroupIcon); +PREP(getTargetEntities); +PREP(handleFired); PREP(moduleSpectatorSettings); PREP(respawnTemplate); +PREP(setFocus); +PREP(stageSpectator); +PREP(switchFocus); + +// Public functions +PREP(getCameraAttributes); +PREP(players); PREP(setCameraAttributes); PREP(setSpectator); -PREP(stageSpectator); -PREP(transitionCamera); -PREP(toggleInterface); PREP(updateCameraModes); -PREP(updateSpectatableSides); +PREP(updateSides); PREP(updateUnits); PREP(updateVisionModes); + +// Deprecated (temp) +PREP(interrupt); +DFUNC(updateSpectatableSides) = { + ACE_DEPRECATED(QFUNC(updateSpectatableSides),"3.12.0",QFUNC(updateSides)); + _this call FUNC(updateSides); +}; diff --git a/addons/spectator/XEH_postInit.sqf b/addons/spectator/XEH_postInit.sqf index 72c53a2af0..462d036328 100644 --- a/addons/spectator/XEH_postInit.sqf +++ b/addons/spectator/XEH_postInit.sqf @@ -1,31 +1,38 @@ #include "script_component.hpp" -//#include "initKeybinds.sqf"; - -// Add interaction menu exception -["isNotSpectating", {!(GETVAR((_this select 0),GVAR(isStaged),false))}] call EFUNC(common,addCanInteractWithCondition); ["ace_settingsInitialized", { 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 CBA_fnc_addEventHandler; -// Create a radio channel for any spectators to text chat in if (isServer) then { + // Create a radio channel for any spectators to text chat in GVAR(channel) = radioChannelCreate [[0.729,0.149,0.098,1],"Spectator","Spectator (%UNIT_NAME)",[]]; publicVariable QGVAR(channel); -}; -// Should prevent unending spectator on mission end -if (isServer) then { - addMissionEventHandler ["Ended", { - [QGVAR(endMission), []] call CBA_fnc_globalEvent; - }]; -}; + // Used by the template to transfer zeus to virtual unit + // Commands must be ran on server + [QGVAR(transferZeus),{ + unassignCurator (_this select 1); -[QGVAR(endMission), { - if (GVAR(isSet)) then { - [false] call FUNC(setSpectator); - }; -}] call CBA_fnc_addEventHandler; + // Can only re-assign when ready + [ + {isNull getAssignedCuratorUnit (_this select 0)}, + {(_this select 0) assignCurator (_this select 1)}, + _this + ] call CBA_fnc_waitUntilAndExecute; + }] call CBA_fnc_addEventHandler; +}; [QGVAR(stageSpectator), FUNC(stageSpectator)] call CBA_fnc_addEventHandler; + +// A virtual spectator cannot exist without an interface +if (hasInterface) then { + // Local player (not ACE_Player) must be initalized to check + [ + { !isNull player }, + { + if (player isKindOf QGVAR(virtual)) then { [true] call FUNC(setSpectator); }; + } + ] call CBA_fnc_waitUntilAndExecute; +}; diff --git a/addons/spectator/XEH_preInit.sqf b/addons/spectator/XEH_preInit.sqf index bdf0c72bd4..8220b21520 100644 --- a/addons/spectator/XEH_preInit.sqf +++ b/addons/spectator/XEH_preInit.sqf @@ -2,41 +2,19 @@ ADDON = false; +PREP_RECOMPILE_START; #include "XEH_PREP.hpp" +PREP_RECOMPILE_END; -// Reset the stored display -SETUVAR(GVAR(interface),displayNull); - -// Permanent variables -GVAR(availableModes) = [0,1,2]; +// Used by public functions +GVAR(availableModes) = [MODE_FREE, MODE_FPS, MODE_FOLLOW]; GVAR(availableSides) = [west,east,resistance,civilian]; -GVAR(availableVisions) = [-2,-1,0,1]; - -GVAR(camAgent) = objNull; -GVAR(camDistance) = 10; -GVAR(camMode) = 0; -GVAR(camPan) = 0; -GVAR(camPos) = ATLtoASL [worldSize * 0.5, worldSize * 0.5, 20]; -GVAR(camSpeed) = 1.5; -GVAR(camTilt) = -10; -GVAR(camUnit) = objNull; -GVAR(camVision) = -2; -GVAR(camZoom) = 1.25; - +GVAR(availableVisions) = [VISION_NORM,VISION_NVG,0,1]; GVAR(interrupts) = []; -GVAR(isSet) = false; - -GVAR(showComp) = true; -GVAR(showHelp) = true; -GVAR(showIcons) = true; -GVAR(showInterface) = true; -GVAR(showMap) = false; -GVAR(showTool) = true; -GVAR(showUnit) = true; - -GVAR(unitList) = []; GVAR(unitBlacklist) = []; GVAR(unitWhitelist) = []; -GVAR(groupList) = []; + +// Tracks whether spectator is active +GVAR(isSet) = false; ADDON = true; diff --git a/addons/spectator/config.cpp b/addons/spectator/config.cpp index 92736edb48..3ff6000fdc 100644 --- a/addons/spectator/config.cpp +++ b/addons/spectator/config.cpp @@ -17,11 +17,13 @@ class CfgPatches { #include "ACE_Settings.hpp" #include "CfgEventHandlers.hpp" #include "CfgVehicles.hpp" -#include "ui\interface.hpp" +#include "ui.hpp" class CfgRespawnTemplates { class ADDON { + displayName = CSTRING(DisplayName); onPlayerKilled = QFUNC(respawnTemplate); onPlayerRespawn = QFUNC(respawnTemplate); + respawnTypes[] = {1,2,3,4,5}; }; }; diff --git a/addons/spectator/UI/Icon_Module_Spectator_ca.paa b/addons/spectator/data/Icon_Module_Spectator_ca.paa similarity index 100% rename from addons/spectator/UI/Icon_Module_Spectator_ca.paa rename to addons/spectator/data/Icon_Module_Spectator_ca.paa diff --git a/addons/spectator/data/b_air.paa b/addons/spectator/data/b_air.paa new file mode 100644 index 0000000000..eeb69e354a Binary files /dev/null and b/addons/spectator/data/b_air.paa differ diff --git a/addons/spectator/data/b_armor.paa b/addons/spectator/data/b_armor.paa new file mode 100644 index 0000000000..8e3922f0b1 Binary files /dev/null and b/addons/spectator/data/b_armor.paa differ diff --git a/addons/spectator/data/b_art.paa b/addons/spectator/data/b_art.paa new file mode 100644 index 0000000000..0aac8b828e Binary files /dev/null and b/addons/spectator/data/b_art.paa differ diff --git a/addons/spectator/data/b_inf.paa b/addons/spectator/data/b_inf.paa new file mode 100644 index 0000000000..235c2080c3 Binary files /dev/null and b/addons/spectator/data/b_inf.paa differ diff --git a/addons/spectator/data/b_installation.paa b/addons/spectator/data/b_installation.paa new file mode 100644 index 0000000000..3ce55f2d36 Binary files /dev/null and b/addons/spectator/data/b_installation.paa differ diff --git a/addons/spectator/data/b_maint.paa b/addons/spectator/data/b_maint.paa new file mode 100644 index 0000000000..53b969a731 Binary files /dev/null and b/addons/spectator/data/b_maint.paa differ diff --git a/addons/spectator/data/b_mech_inf.paa b/addons/spectator/data/b_mech_inf.paa new file mode 100644 index 0000000000..967cbe7ee1 Binary files /dev/null and b/addons/spectator/data/b_mech_inf.paa differ diff --git a/addons/spectator/data/b_med.paa b/addons/spectator/data/b_med.paa new file mode 100644 index 0000000000..82bccdef5e Binary files /dev/null and b/addons/spectator/data/b_med.paa differ diff --git a/addons/spectator/data/b_mortar.paa b/addons/spectator/data/b_mortar.paa new file mode 100644 index 0000000000..331bdcbcb0 Binary files /dev/null and b/addons/spectator/data/b_mortar.paa differ diff --git a/addons/spectator/data/b_motor_inf.paa b/addons/spectator/data/b_motor_inf.paa new file mode 100644 index 0000000000..d78ddfc9d6 Binary files /dev/null and b/addons/spectator/data/b_motor_inf.paa differ diff --git a/addons/spectator/data/b_naval.paa b/addons/spectator/data/b_naval.paa new file mode 100644 index 0000000000..812355fbc2 Binary files /dev/null and b/addons/spectator/data/b_naval.paa differ diff --git a/addons/spectator/data/b_plane.paa b/addons/spectator/data/b_plane.paa new file mode 100644 index 0000000000..d7be073299 Binary files /dev/null and b/addons/spectator/data/b_plane.paa differ diff --git a/addons/spectator/data/b_recon.paa b/addons/spectator/data/b_recon.paa new file mode 100644 index 0000000000..5c5dc8bb3d Binary files /dev/null and b/addons/spectator/data/b_recon.paa differ diff --git a/addons/spectator/data/b_service.paa b/addons/spectator/data/b_service.paa new file mode 100644 index 0000000000..3c74ca018c Binary files /dev/null and b/addons/spectator/data/b_service.paa differ diff --git a/addons/spectator/data/b_support.paa b/addons/spectator/data/b_support.paa new file mode 100644 index 0000000000..56d3773b93 Binary files /dev/null and b/addons/spectator/data/b_support.paa differ diff --git a/addons/spectator/data/b_uav.paa b/addons/spectator/data/b_uav.paa new file mode 100644 index 0000000000..e900cc2509 Binary files /dev/null and b/addons/spectator/data/b_uav.paa differ diff --git a/addons/spectator/data/b_unknown.paa b/addons/spectator/data/b_unknown.paa new file mode 100644 index 0000000000..f92ffbe9cb Binary files /dev/null and b/addons/spectator/data/b_unknown.paa differ diff --git a/addons/spectator/data/c_air.paa b/addons/spectator/data/c_air.paa new file mode 100644 index 0000000000..4170013fe2 Binary files /dev/null and b/addons/spectator/data/c_air.paa differ diff --git a/addons/spectator/data/c_car.paa b/addons/spectator/data/c_car.paa new file mode 100644 index 0000000000..832e17cbd6 Binary files /dev/null and b/addons/spectator/data/c_car.paa differ diff --git a/addons/spectator/data/c_plane.paa b/addons/spectator/data/c_plane.paa new file mode 100644 index 0000000000..d12fa68fbe Binary files /dev/null and b/addons/spectator/data/c_plane.paa differ diff --git a/addons/spectator/data/c_ship.paa b/addons/spectator/data/c_ship.paa new file mode 100644 index 0000000000..f53701175a Binary files /dev/null and b/addons/spectator/data/c_ship.paa differ diff --git a/addons/spectator/data/c_unknown.paa b/addons/spectator/data/c_unknown.paa new file mode 100644 index 0000000000..f67a3b5444 Binary files /dev/null and b/addons/spectator/data/c_unknown.paa differ diff --git a/addons/spectator/functions/fnc_cacheUnitInfo.sqf b/addons/spectator/functions/fnc_cacheUnitInfo.sqf deleted file mode 100644 index 9f40651748..0000000000 --- a/addons/spectator/functions/fnc_cacheUnitInfo.sqf +++ /dev/null @@ -1,38 +0,0 @@ -/* - * Author: SilentSpike - * Caches the units information for quick retrevial in spectator interface PFHs - * - * Arguments: - * 0: Unit to have info cached for - * - * Return Value: - * None - * - * Example: - * [vehicle player] call ace_spectator_fnc_cacheUnitInfo - * - * Public: No - */ - -#include "script_component.hpp" - -params ["_unit"]; -private ["_color","_icon","_name"]; - -// Group info only needs to be cached once (groups can't change) -if (isNil { GETVAR((group _unit),GVAR(gColor),nil) }) then { - _color = [side group _unit] call BIS_fnc_sideColor; - SETVAR((group _unit),GVAR(gColor),_color); -}; - -// Unit info should be updated each time -_icon = getText (configFile >> "CfgVehicles" >> typeOf _unit >> "Icon"); -_name = [_unit,false] call EFUNC(common,getName); - -// Handle CfgVehicleIcons -if (isText (configFile >> "CfgVehicleIcons" >> _icon)) then { - _icon = getText (configFile >> "CfgVehicleIcons" >> _icon); -}; - -SETVAR(_unit,GVAR(uIcon),_icon); -SETVAR(_unit,GVAR(uName),_name); diff --git a/addons/spectator/functions/fnc_cam.sqf b/addons/spectator/functions/fnc_cam.sqf new file mode 100644 index 0000000000..74b7d23d73 --- /dev/null +++ b/addons/spectator/functions/fnc_cam.sqf @@ -0,0 +1,141 @@ +/* + * Author: Nelson Duarte, SilentSpike + * Handles camera initialisation and destruction + * + * Arguments: + * 0: Init/Terminate + * + * Return Value: + * None + * + * Example: + * [true] call ace_spectator_fnc_cam + * + * Public: No + */ + +#include "script_component.hpp" + +params ["_init"]; + +// No change +if (_init isEqualTo !isNil QGVAR(camera)) exitWith {}; + +// Note that init and destroy intentionally happen in reverse order +// Init: Vars > Camera > Camera Stuff +// Destroy: Camera Stuff > Camera > Vars +if (_init) then { + // Start tracking camera attributes if not pre-set by public function + ISNILS(GVAR(camMode),MODE_FREE); + ISNILS(GVAR(camVision),VISION_NORM); + ISNILS(GVAR(camFocus),objNull); + + // Ticking related + GVAR(camDeltaTime) = 0; + GVAR(camLastTickTime) = 0; + GVAR(camHasTarget) = false; + GVAR(camTargetInVehicle) = false; + + // Follow camera related + GVAR(camDistance) = 0; + GVAR(camDistanceTemp) = 0; + GVAR(camYaw) = 0; + GVAR(camPitch) = 0; + + // Toggles + GVAR(camSlow) = false; + GVAR(camLights) = []; + GVAR(camLight) = false; + + // Handle pre-set pos and dir (delete GVARs when done) + private _pos = if (isNil QGVAR(camPos)) then {eyePos player} else {GVAR(camPos)}; + private _dir = if (isNil QGVAR(camDir)) then {getDirVisual player} else {GVAR(camDir)}; + GVAR(camPos) = nil; + GVAR(camDir) = nil; + + // Create the camera (CamCurator required for engine driven controls) + private _camera = "CamCurator" camCreate _pos; + + if (isNull _camera) exitWith { ERROR("Camera wasn't created successfully"); }; + + // Switch to the camera and set its attributes + _camera cameraEffect ["internal", "back"]; + _camera setPosASL _pos; + _camera setDir _dir; + _camera camCommand "maxPitch 89"; + _camera camCommand "minPitch -89"; + _camera camCommand format ["speedDefault %1", SPEED_DEFAULT]; + _camera camCommand format ["speedMax %1", SPEED_FAST]; + _camera camCommand "ceilingHeight 5000"; + cameraEffectEnableHUD true; + + // If camera followed terrain it would be annoying to track units, etc. + _camera camCommand "atl off"; + + // Camera speed should be consistent irrespective of height (painfully slow otherwise) + _camera camCommand "surfaceSpeed off"; + + // Store camera + GVAR(camera) = _camera; + + // Create dummy target used for follow camera + GVAR(camDummy) = "Logic" createVehicleLocal getPosASLVisual GVAR(camFocus); + + // Handle initial camera mode limitation + if !(GVAR(camMode) in GVAR(availableModes)) then { + GVAR(camMode) = GVAR(availableModes) select 0; + }; + + // If inital camera mode is not free cam and no focus, find initial focus + if (GVAR(camMode) != MODE_FREE && isNull GVAR(camFocus)) then { + [true] call FUNC(setFocus); + }; + + // Set the initial camera mode (could be pre-set or limited) + [GVAR(camMode)] call FUNC(cam_setCameraMode); + + // Handle initial vision mode limitation + if !(GVAR(camVision) in GVAR(availableVisions)) then { + GVAR(camVision) = GVAR(availableVisions) select 0; + }; + + // Set the initial vision mode (could be pre-set or limited) + [GVAR(camVision)] call FUNC(cam_setVisionMode); + + // Start ticking (follow camera requires EachFrame to avoid jitter) + GVAR(camTick) = addMissionEventHandler ["EachFrame", {call FUNC(cam_tick)}]; +} else { + // Stop ticking + removeMissionEventHandler ["EachFrame", GVAR(camTick)]; + GVAR(camTick) = nil; + + // Return to player view + if !(isNull GVAR(camera)) then { + GVAR(camera) cameraEffect ["terminate", "back"]; + deleteVehicle GVAR(camera); + }; + player switchCamera "internal"; + + // Remove camera variable + GVAR(camera) = nil; + + // Destroy dummy target + deleteVehicle (GVAR(camDummy)); + GVAR(camDummy) = nil; + + // Stop tracking everything + GVAR(camMode) = nil; + GVAR(camVision) = nil; + GVAR(camFocus) = nil; + GVAR(camDeltaTime) = nil; + GVAR(camLastTickTime) = nil; + GVAR(camHasTarget) = nil; + GVAR(camTargetInVehicle) = nil; + GVAR(camDistance) = nil; + GVAR(camDistanceTemp) = nil; + GVAR(camYaw) = nil; + GVAR(camPitch) = nil; + GVAR(camSlow) = nil; + GVAR(camLights) = nil; + GVAR(camLight) = nil; +}; diff --git a/addons/spectator/functions/fnc_cam_prepareTarget.sqf b/addons/spectator/functions/fnc_cam_prepareTarget.sqf new file mode 100644 index 0000000000..abdce831b4 --- /dev/null +++ b/addons/spectator/functions/fnc_cam_prepareTarget.sqf @@ -0,0 +1,51 @@ +/* + * Author: Nelson Duarte, SilentSpike + * Moves the spectator camera to a position relative to the camera focus. + * Used for 3PP camera and teleporting, etc. + * + * Arguments: + * 0: New Target + * + * Return Value: + * None + * + * Example: + * [player] call ace_spectator_fnc_cam_prepareTarget + * + * Public: No + */ + +#include "script_component.hpp" + +private _focus = vehicle (param [0, objNull, [objNull]]); + +if !(isNull _focus) then { + // Interpolate zoom + private _zoom = [0, GVAR(camDistance)] select (GVAR(camMode) == MODE_FOLLOW); + private _zoomTemp = GVAR(camDistanceTemp); + + if (_zoomTemp != _zoom) then { + _zoomTemp = [_zoomTemp, _zoom, 10, GVAR(camDeltaTime)] call BIS_fnc_lerp; + GVAR(camDistanceTemp) = _zoomTemp; + }; + + // The distance at which to place camera from the focus pivot + private _bbd = [_focus] call BIS_fnc_getObjectBBD; + private _distance = (_bbd select 1) + _zoomTemp; + + // The pivot on the target vehicle + private _isMan = _focus isKindOf "Man"; + private _height = if !(_isMan) then { (_bbd select 2) / 3 } else { switch (stance _focus) do { case "STAND": {1.4}; case "CROUCH": {0.8}; default {0.4}; }; }; + + private _center = if (_isMan) then { AGLToASL (_focus modelToWorldVisual (_focus selectionPosition "Spine3")) } else { AGLToASL (_focus modelToWorldVisual [0,0,_height]) }; + + // Set dummy location and rotation + private _dummy = GVAR(camDummy); + + _dummy setPosASL _center; + [_dummy, [GVAR(camYaw), GVAR(camPitch), 0]] call BIS_fnc_setObjectRotation; + + // Apply location and rotation to camera + GVAR(camera) setPosASL (AGLToASL (_dummy modelToWorldVisual [0, -_distance, 0])); + GVAR(camera) setVectorDirAndUp [vectorDirVisual _dummy, vectorUpVisual _dummy]; +}; diff --git a/addons/spectator/functions/fnc_cam_resetTarget.sqf b/addons/spectator/functions/fnc_cam_resetTarget.sqf new file mode 100644 index 0000000000..94f934d6d6 --- /dev/null +++ b/addons/spectator/functions/fnc_cam_resetTarget.sqf @@ -0,0 +1,29 @@ +/* + * Author: Nelson Duarte, SilentSpike + * Removes the current camera interest and detaches dummy target. + * + * Arguments: + * None + * + * Return Value: + * None + * + * Example: + * [] call ace_spectator_fnc_cam_resetTarget + * + * Public: No + */ + +#include "script_component.hpp" + +private _camera = GVAR(camera); +private _dummy = GVAR(camDummy); + +if !(isNull _camera || isNull _dummy) then { + _camera camPrepareTarget objNull; + _camera camCommitPrepared 0; + + detach _dummy; + + GVAR(camHasTarget) = false; +}; diff --git a/addons/spectator/functions/fnc_cam_setCameraMode.sqf b/addons/spectator/functions/fnc_cam_setCameraMode.sqf new file mode 100644 index 0000000000..8d1c53d71c --- /dev/null +++ b/addons/spectator/functions/fnc_cam_setCameraMode.sqf @@ -0,0 +1,89 @@ +/* + * Author: Nelson Duarte, AACO, SilentSpike + * Function used to select the camera mode + * + * Intended to run even if new mode == old mode, as it handles focus + * + * Arguments: + * 0: New camera mode + * + * Return Value: + * None + * + * Example: + * [1] call ace_spectator_fnc_cam_setCameraMode + * + * Public: No + */ + +#include "script_component.hpp" + +params ["_newMode"]; + +private _oldMode = GVAR(camMode); +private _modes = GVAR(availableModes); +private _focus = GVAR(camFocus); + +// If new mode isn't available then keep current (unless current also isn't) +if !(_newMode in _modes) then { + _newMode = _modes select ((_modes find _oldMode) max 0); +}; + +// Can't switch camera from free mode with no focus selected +if (!isNull _focus || _newMode == MODE_FREE) then { + private _camera = GVAR(camera); + private _showHUD = [true,true,true,true,true,true,true,true]; + + if (_newMode == MODE_FPS) then { + _camera cameraEffect ["Terminate", "BACK"]; + _focus switchCamera "INTERNAL"; + + // Reset vision mode + [VISION_NORM] call FUNC(cam_setVisionMode); + + [] call FUNC(cam_resetTarget); + + // Disable camera input + _camera camCommand "manual off"; + + // Hide all unit/group information in first person view + _showHUD = [true,false,false,false,false,false,false,true]; + }; + + if (_newMode == MODE_FOLLOW) then { + _camera cameraEffect ["Internal", "BACK"]; + _focus switchCamera "EXTERNAL"; + + [] call FUNC(cam_resetTarget); + + // Disable camera input + _camera camCommand "manual off"; + }; + + if (_newMode == MODE_FREE) then { + _camera cameraEffect ["Internal", "BACK"]; + player switchCamera "INTERNAL"; + _camera setDir getDirVisual _camera; + + if (!isNull _focus) then { + if (_oldMode == MODE_FPS) then { + [_focus] call FUNC(cam_prepareTarget); + }; + [_focus] call FUNC(cam_setTarget); + }; + + // Enable camera input + _camera camCommand "manual on"; + }; + + // Update the HUD + cameraEffectEnableHUD true; + showHUD _showHUD; + GVAR(camMode) = _newMode; + + // Only update display if it exists, this function is independent of it + if !(isNull SPEC_DISPLAY) then { + [] call FUNC(ui_updateCamButtons); + [] call FUNC(ui_updateHelp); + }; +}; diff --git a/addons/spectator/functions/fnc_cam_setTarget.sqf b/addons/spectator/functions/fnc_cam_setTarget.sqf new file mode 100644 index 0000000000..51cd80215a --- /dev/null +++ b/addons/spectator/functions/fnc_cam_setTarget.sqf @@ -0,0 +1,32 @@ +/* + * Author: Nelson Duarte, SilentSpike + * Sets the current camera interest using dummy target. + * + * Arguments: + * None + * + * Return Value: + * None + * + * Example: + * [player] call ace_spectator_fnc_cam_setTarget + * + * Public: No + */ + +#include "script_component.hpp" +#define CAMERA_TARGET_CHANGE_TIME 0.5 + +params ["_object"]; + +private _camera = GVAR(camera); +private _dummy = GVAR(camDummy); +private _location = _object worldToModel (_object modelToWorldVisual (_object selectionPosition "Head")); + +if (!isNull _camera && !isNull _dummy) then { + _dummy attachTo [vehicle _object, _location]; + _camera camPrepareTarget _dummy; + _camera camCommitPrepared CAMERA_TARGET_CHANGE_TIME; + + GVAR(camhasTarget) = true; +}; diff --git a/addons/spectator/functions/fnc_cam_setVisionMode.sqf b/addons/spectator/functions/fnc_cam_setVisionMode.sqf new file mode 100644 index 0000000000..c9eed499fe --- /dev/null +++ b/addons/spectator/functions/fnc_cam_setVisionMode.sqf @@ -0,0 +1,45 @@ +/* + * Author: SilentSpike + * Function used to select the camera vision mode + * + * Arguments: + * 0: New vision mode + * + * Return Value: + * None + * + * Example: + * [-1] call ace_spectator_fnc_cam_setVisionMode + * + * Public: No + */ + +#include "script_component.hpp" + +params ["_newVision"]; + +private _oldVision = GVAR(camVision); +private _visions = GVAR(availableVisions); + +// If new vision isn't available then keep current (unless current also isn't) +if !(_newVision in _visions) then { + _newVision = _visions select ((_visions find _oldVision) max 0); +}; + +// Vision mode does not apply to fps view +if (GVAR(camMode) != MODE_FPS) then { + // 0+ are all thermal vision types + if (_newVision < 0) then { + false setCamUseTi 0; + camUseNVG (_newVision >= VISION_NVG); + } else { + true setCamUseTi _newVision; + }; + + // Give user feedback that vision mode changed + if (_newVision != _oldVision) then { + playSound "RscDisplayCurator_visionMode"; + + GVAR(camVision) = _newVision; + }; +}; diff --git a/addons/spectator/functions/fnc_cam_tick.sqf b/addons/spectator/functions/fnc_cam_tick.sqf new file mode 100644 index 0000000000..1ba9ee2797 --- /dev/null +++ b/addons/spectator/functions/fnc_cam_tick.sqf @@ -0,0 +1,84 @@ +/* + * Author: Nelson Duarte, AACO, SilentSpike + * Function used to perform camera ticks + * + * Updates camera position in follow mode + * Updates camera focus if current focus becomes null (in unit modes) + * Updates camera when focus enters/exits a vehicle + * Updates camera lights position + * + * Arguments: + * None + * + * Return Value: + * None + * + * Example: + * addMissionEventHandler ["EachFrame", {call ace_spectator_fnc_cam_tick}] + * + * Public: No + */ + +#include "script_component.hpp" + +BEGIN_COUNTER(camTick); +private _cameraMode = GVAR(camMode); +private _camTarget = GVAR(camFocus); + +// UI mouse handler makes use of delta time between camera ticks +private _currentTime = diag_tickTime; +GVAR(camDeltaTime) = _currentTime - GVAR(camLastTickTime); +GVAR(camLastTickTime) = _currentTime; + + +// If no focus in unit camera modes try to find a new one +if (_cameraMode != MODE_FREE) then { + private _focus = if (isNull _camTarget) then { + private _testFocus = ([] call FUNC(getTargetEntities)) select 0; + if (isNil "_testFocus") then { + objNull + } else { + _testFocus + } + } else { + _camTarget + }; + + // If new focus was found then switch to it + if (!isNull _focus && {_focus != _camTarget}) then { + [_focus] call FUNC(setFocus); + }; + + // Update the follow camera position + if (!isNull _focus && {_cameraMode == MODE_FOLLOW}) then { + [_focus] call FUNC(cam_prepareTarget); + }; +}; + +// Refresh the local variable +_camTarget = GVAR(camFocus); + +// Focus get in / out of vehicle state +if !(isNull _camTarget) then { + private _targetInVeh = GVAR(camTargetInVehicle); + + if (GVAR(camHasTarget)) then { + if (!_targetInVeh && { vehicle _camTarget != _camTarget }) then { + [_camTarget] call FUNC(cam_setTarget); + GVAR(camTargetInVehicle) = true; + }; + + if (_targetInVeh && { vehicle _camTarget == _camTarget }) then { + [_camTarget] call FUNC(cam_setTarget); + GVAR(camTargetInVehicle) = false; + }; + }; +} else { + GVAR(camTargetInVehicle) = false; +}; + +// Camera lights +if (count GVAR(camLights) > 1) then { + (GVAR(camLights) select 1) setPosASL (AGLToASL (screenToWorld getMousePosition)); +}; +END_COUNTER(camTick); diff --git a/addons/spectator/functions/fnc_cam_toggleSlow.sqf b/addons/spectator/functions/fnc_cam_toggleSlow.sqf new file mode 100644 index 0000000000..e689351ce8 --- /dev/null +++ b/addons/spectator/functions/fnc_cam_toggleSlow.sqf @@ -0,0 +1,36 @@ +/* + * Author: Nelson Duarte, SilentSpike + * Function used to set camera slow speed mode + * + * Arguments: + * 0: Enable slow speed + * + * Return Value: + * None + * + * Example: + * [true] call ace_spectator_fnc_cam_toggleSlow + * + * Public: No + */ + +#include "script_component.hpp" + +params ["_slowSpeed"]; + +if !(GVAR(camSlow) isEqualTo _slowSpeed) then { + private _camera = GVAR(camera); + + if (GVAR(camMode) == MODE_FREE) then { + GVAR(camSlow) = _slowSpeed; + + if (_slowSpeed) then { + _camera camCommand format ["speedDefault %1", SPEED_SLOW]; + } else { + _camera camCommand format ["speedDefault %1", SPEED_DEFAULT]; + }; + } else { + _camera camCommand format ["speedDefault %1", SPEED_DEFAULT]; + GVAR(camSlow) = false; + }; +}; diff --git a/addons/spectator/functions/fnc_compat_counter.sqf b/addons/spectator/functions/fnc_compat_counter.sqf new file mode 100644 index 0000000000..8a54d6dbdf --- /dev/null +++ b/addons/spectator/functions/fnc_compat_counter.sqf @@ -0,0 +1,36 @@ +/* + * Author: SilentSpike + * Handles integrating the counter respawn template into the spectator UI + * + * Should be called from both RscRespawnCounter XEH and spectator init to account for arbitrary order + * + * Arguments: + * 0: RscRespawnCounter + * + * Return Value: + * None + * + * Example: + * [GETUVAR(RscRespawnCounter,displayNull)] call ace_spectator_fnc_compat_counter + * + * Public: No + */ + +#include "script_component.hpp" +#define IDC_COUNTER_TITLE 1001 +#define IDC_COUNTER_BACK 1002 +#define IDC_COUNTER_TEXT 1003 + +params ["_display"]; + +if (isNull _display) exitWith {}; + +{ + private _ctrl = _display displayCtrl _x; + + (ctrlPosition _ctrl) params ["_xOld","","_w","_h"]; + + // Center controls at top middle of screen + _ctrl ctrlSetPosition [_xOld, safeZoneY, _w, _h]; + _ctrl ctrlCommit 0; +} forEach [IDC_COUNTER_TITLE, IDC_COUNTER_BACK, IDC_COUNTER_TEXT]; diff --git a/addons/spectator/functions/fnc_compat_spectatorBI.sqf b/addons/spectator/functions/fnc_compat_spectatorBI.sqf new file mode 100644 index 0000000000..3c90585aa5 --- /dev/null +++ b/addons/spectator/functions/fnc_compat_spectatorBI.sqf @@ -0,0 +1,53 @@ +/* + * Author: SilentSpike + * Handles "compatibility" (i.e. override) for BI spectator respawn types 1, 4 & 5 + * + * Called from the RscDisplayEGSpectator XEH + * + * Arguments: + * 0: RscDisplayEGSpectator + * + * Return Value: + * None + * + * Example: + * _this call ace_spectator_fnc_compat_spectatorBI + * + * Public: No + */ + +#include "script_component.hpp" + +private _respawn = getMissionConfigValue ["respawn",0]; +if (_respawn isEqualType "") then { _respawn = ["","bird","","","group","side"] find (toLower _respawn); }; +if !(_respawn in [1,4,5]) exitWith {}; + +// Remember to check for side specific templates +private _templates = getMissionConfigValue [["respawnTemplates",side group player] joinString "",getMissionConfigValue ["respawnTemplates",[]]]; +if !(QUOTE(ADDON) in _templates) exitWith {}; + +// Kill BI spectator +["Terminate"] call BIS_fnc_EGSpectator; + +// Start our spectator +[true] call FUNC(setSpectator); + +// Delete the seagull that spawns (not actually the player, a CfgNonAIVehicles object) +// Respawn type 1 is handled in the template where seagull is passed as paremeter +if (_respawn in [4,5]) then { + // This could delete seagulls created by a wildlife module (a necessary evil) + // TODO: Try to find seagull position and delete more accurately with reduced radius + { if (_x isKindOf "seagull") then {deleteVehicle _x;}; } forEach (nearestObjects [player, [], 250]); +}; + +// Switch to a virtual unit so draw3D continues to work +private _grp = createGroup [sideLogic, true]; +private _virtual = _grp createUnit [QGVAR(virtual),[0,0,0],[],0,""]; + +// Transfer assigned zeus if applicable +private _zeus = getAssignedCuratorLogic player; +if !(isNull _zeus) then { + [QGVAR(transferZeus), [_virtual,_zeus]] call CBA_fnc_serverEvent; +}; + +selectPlayer _virtual; diff --git a/addons/spectator/functions/fnc_compat_zeus.sqf b/addons/spectator/functions/fnc_compat_zeus.sqf new file mode 100644 index 0000000000..f379e549ce --- /dev/null +++ b/addons/spectator/functions/fnc_compat_zeus.sqf @@ -0,0 +1,34 @@ +/* + * Author: SilentSpike + * Handles compatibility with curator interface (i.e. re-opens spectator if applicable) + * + * Called from the RscDisplayCurator XEH + * + * Arguments: + * 0: RscDisplayCurator + * + * Return Value: + * None + * + * Example: + * _this call ace_spectator_fnc_compat_zeus + * + * Public: No + */ + +#include "script_component.hpp" + +params ["_display"]; + +_display displayAddEventHandler ["Unload",{ + // Only re-open if still a spectator (and not remote-controlling) + if (GVAR(isSet) && {isNull (GETMVAR(bis_fnc_moduleRemoteControl_unit,objNull))}) then { + // Display must be opened next frame to prevent game crash + [{ + // Reset the camera and vision modes + [GVAR(camMode)] call FUNC(cam_setCameraMode); + [GVAR(camVision)] call FUNC(cam_setVisionMode); + [true] call FUNC(ui); + }] call CBA_fnc_execNextFrame; + }; +}]; diff --git a/addons/spectator/functions/fnc_cycleCamera.sqf b/addons/spectator/functions/fnc_cycleCamera.sqf deleted file mode 100644 index 474d25cd0c..0000000000 --- a/addons/spectator/functions/fnc_cycleCamera.sqf +++ /dev/null @@ -1,58 +0,0 @@ -/* - * Author: SilentSpike - * Cycle through the spectator camera vision/view/units in steps - * - * Arguments: - * 0: Camera mode steps - * 1: Camera unit steps - * 2: Vision mode steps - * - * Return Value: - * None - * - * Example: - * [0, -1] call ace_spectator_fnc_cycleCamera - * - * Public: No - */ - -#include "script_component.hpp" - -params [["_stepMode",0], ["_stepUnit",0], ["_stepVision",0]]; -private ["_modes","_visions","_iMode","_iVision","_countModes","_countVisions","_newMode","_newVision","_newUnit"]; - -_modes = GVAR(availableModes); -_units = GVAR(unitList); -_visions = GVAR(availableVisions); - -// Get current index -_iMode = (_modes find GVAR(camMode)) max 0; -_iUnit = (_units find GVAR(camUnit)) max 0; -_iVision = (_visions find GVAR(camVision)) max 0; - -_countModes = count _modes; -_countUnits = count _units; -_countVisions = count _visions; - -// Step index by step number (loop at ends) -if (_countModes != 0) then { - _iMode = (_iMode + _stepMode) % _countModes; - if (_iMode < 0) then { _iMode = _countModes + _iMode; }; -}; - -if (_countUnits != 0) then { - _iUnit = (_iUnit + _stepUnit) % _countUnits; - if (_iUnit < 0) then { _iUnit = _countUnits + _iUnit; }; -}; - -if (_countVisions != 0) then { - _iVision = (_iVision + _stepVision) % _countVisions; - if (_iVision < 0) then { _iVision = _countVisions + _iVision; }; -}; - -// Get value at new index -_newMode = _modes select _iMode; -_newUnit = _units select _iUnit; -_newVision = _visions select _iVision; - -[_newMode, _newUnit, _newVision] call FUNC(transitionCamera); diff --git a/addons/spectator/functions/fnc_getCameraAttributes.sqf b/addons/spectator/functions/fnc_getCameraAttributes.sqf new file mode 100644 index 0000000000..3f43a9003a --- /dev/null +++ b/addons/spectator/functions/fnc_getCameraAttributes.sqf @@ -0,0 +1,30 @@ +/* + * Author: SilentSpike + * Returns the current spectator camera attributes (see setCameraAttributes for details). + * + * Arguments: + * None + * + * Return Value: + * [Mode, Focus, Vision, Position, Direction] + * + * Example: + * [] call ace_spectator_fnc_getCameraAttributes + * + * Public: Yes + */ + +#include "script_component.hpp" + +if !(isNil QGVAR(camera)) then { + [GVAR(camMode), GVAR(camFocus), GVAR(camVision), getPosATL GVAR(camera), getDirVisual GVAR(camera)] +} else { + // These values could be pre-set by function + [ + GETMVAR(GVAR(camMode),0), + GETMVAR(GVAR(camFocus),objNull), + GETMVAR(GVAR(camVision),-2), + GETMVAR(GVAR(camPos),[ARR_3(0,0,0)]), + GETMVAR(GVAR(camDir),0) + ] +}; diff --git a/addons/spectator/functions/fnc_getGroupIcon.sqf b/addons/spectator/functions/fnc_getGroupIcon.sqf new file mode 100644 index 0000000000..fdc2772edc --- /dev/null +++ b/addons/spectator/functions/fnc_getGroupIcon.sqf @@ -0,0 +1,162 @@ +/* + * Author: SilentSpike + * Function used to get an appropriate icon for provided group. Approximate. + * + * Arguments: + * 0: Group to get the icon of + * 1: Return icons for draw3D use (Default: false) + * + * Return Value: + * Icon of group + * + * Examples: + * [group player] call ace_spectator_fnc_getGroupIcon + * + * Public: No + */ + +#include "script_component.hpp" +#define ICON_PATH(var1) QUOTE(a3\ui_f\data\Map\Markers\NATO\var1) + +// Military icons +#define ICON_UNKNOWN [ICON_PATH(b_unknown.paa), QPATHTOF(data\b_unknown.paa)] select _forDraw +#define ICON_UAV [ICON_PATH(b_uav.paa), QPATHTOF(data\b_uav.paa)] select _forDraw +#define ICON_SUPPORT [ICON_PATH(b_support.paa), QPATHTOF(data\b_support.paa)] select _forDraw +#define ICON_SERVICE [ICON_PATH(b_service.paa), QPATHTOF(data\b_service.paa)] select _forDraw +#define ICON_RECON [ICON_PATH(b_recon.paa), QPATHTOF(data\b_recon.paa)] select _forDraw +#define ICON_PLANE [ICON_PATH(b_plane.paa), QPATHTOF(data\b_plane.paa)] select _forDraw +#define ICON_NAVAL [ICON_PATH(b_naval.paa), QPATHTOF(data\b_naval.paa)] select _forDraw +#define ICON_MOTOR_INF [ICON_PATH(b_motor_inf.paa), QPATHTOF(data\b_motor_inf.paa)] select _forDraw +#define ICON_MORTAR [ICON_PATH(b_mortar.paa), QPATHTOF(data\b_mortar.paa)] select _forDraw +#define ICON_MED [ICON_PATH(b_med.paa), QPATHTOF(data\b_med.paa)] select _forDraw +#define ICON_MECH_INF [ICON_PATH(b_mech_inf.paa), QPATHTOF(data\b_mech_inf.paa)] select _forDraw +#define ICON_MAINT [ICON_PATH(b_maint.paa), QPATHTOF(data\b_maint.paa)] select _forDraw +#define ICON_INSTALLATION [ICON_PATH(b_installation.paa), QPATHTOF(data\b_installation.paa)] select _forDraw +#define ICON_INF [ICON_PATH(b_inf.paa), QPATHTOF(data\b_inf.paa)] select _forDraw +#define ICON_ART [ICON_PATH(b_art.paa), QPATHTOF(data\b_art.paa)] select _forDraw +#define ICON_ARMOR [ICON_PATH(b_armor.paa), QPATHTOF(data\b_armor.paa)] select _forDraw +#define ICON_AIR [ICON_PATH(b_air.paa), QPATHTOF(data\b_air.paa)] select _forDraw + +// Civilian icons +#define CIV_ICON_UNKNOWN [ICON_PATH(c_unknown.paa), QPATHTOF(data\c_unknown.paa)] select _forDraw +#define CIV_ICON_AIR [ICON_PATH(c_air.paa), QPATHTOF(data\c_air.paa)] select _forDraw +#define CIV_ICON_CAR [ICON_PATH(c_car.paa), QPATHTOF(data\c_car.paa)] select _forDraw +#define CIV_ICON_PLANE [ICON_PATH(c_plane.paa), QPATHTOF(data\c_plane.paa)] select _forDraw +#define CIV_ICON_SHIP [ICON_PATH(c_ship.paa), QPATHTOF(data\c_ship.paa)] select _forDraw + +params [["_group", grpNull, [grpNull]], ["_forDraw", false, [true]]]; + +// Handle empty or null group +private _leader = leader _group; +if (isNull _leader) exitWith { [ICON_UNKNOWN, CIV_ICON_UNKNOWN] select (side _group == civilian) }; + +// Civilians are easy, just check leader's vehicle (unlikely group is large) +if (side _group == civilian) exitWith { + if (_leader != vehicle _leader) then { + // More common cases should be checked first + (vehicle _leader) call { + if (_this isKindOf "Car") exitWith { + CIV_ICON_CAR + }; + + // Plane inherits Air, check first + if (_this isKindOf "Plane") exitWith { + CIV_ICON_PLANE + }; + + if (_this isKindOf "Air") exitWith { + CIV_ICON_AIR + }; + + if (_this isKindOf "Ship") exitWith { + CIV_ICON_SHIP + }; + + CIV_ICON_UNKNOWN + }; + } else { + CIV_ICON_UNKNOWN + }; +}; + +// Handle military groups +private _units = units _group; +private _vehicles = (_units apply { vehicle _x }) - _units; + +// If more than 33% of the group is mounted, use most common vehicle +if (count _vehicles >= 0.33 * count _units) exitWith { + // Check the most likely cases first + _vehicles call { + private _threshold = 0.5 * count _this; + + if ("Car" countType _this >= _threshold) exitWith { + ICON_MOTOR_INF + }; + + // APC inherits Tank, check first + if ("APC" countType _this >= _threshold) exitWith { + ICON_MECH_INF + }; + + // MBT_01_arty_base_F inherits Tank, check first + // Unfortunately no common arty class to check + if ("MBT_01_arty_base_F" countType _this >= _threshold) exitWith { + ICON_ART + }; + if ("MBT_02_arty_base_F" countType _this >= _threshold) exitWith { + ICON_ART + }; + + if ("Tank" countType _this >= _threshold) exitWith { + ICON_ARMOR + }; + + // UAV inherits Plane, check first + if ("UAV" countType _this >= _threshold) exitWith { + ICON_UAV + }; + + // Plane inherits Air, check first + if ("Plane" countType _this >= _threshold) exitWith { + ICON_PLANE + }; + + if ("Air" countType _this >= _threshold) exitWith { + ICON_AIR + }; + + if ("Ship" countType _this >= _threshold) exitWith { + ICON_NAVAL + }; + + // StaticMortar inherits StaticWeapon, check first + if ("StaticMortar" countType _this >= _threshold) exitWith { + ICON_MORTAR + }; + + if ("StaticWeapon" countType _this >= _threshold) exitWith { + ICON_INSTALLATION + }; + + // If it reaches here then it's a mixed group of vehicles + ICON_UNKNOWN + }; +}; + +// Check leader for medic/engineer/etc, otherwise just default to infantry +private _medic = [_leader] call EFUNC(common,isMedic); +private _engineer = [_leader] call EFUNC(common,isEngineer); + +if (_medic && _engineer) exitWith { + ICON_SUPPORT +}; + +if (_medic) exitWith { + ICON_MED +}; + +if (_engineer) exitWith { + ICON_MAINT +}; + +ICON_INF diff --git a/addons/spectator/functions/fnc_getTargetEntities.sqf b/addons/spectator/functions/fnc_getTargetEntities.sqf new file mode 100644 index 0000000000..80ee72fe03 --- /dev/null +++ b/addons/spectator/functions/fnc_getTargetEntities.sqf @@ -0,0 +1,45 @@ +/* + * Author: SilentSpike + * Gets the possible entities to spectate based on settings. + * Optionally includes dead units for the list and switching. + * + * Arguments: + * 0: Include dead + * + * Return Value: + * Valid entities + * + * Example: + * [true] call ace_spectator_fnc_getTargetEntities + * + * Public: No + */ + +#include "script_component.hpp" + +// Include dead units if specified (used by entity list) +private _entities = allUnits; +if (param [0,false]) then { _entities append allDeadMen; }; + +// Quicker to use local vars that are accessed often in iteration +private _sides = GVAR(availableSides); + +// Apply entity filtering +_entities = _entities select { + (GVAR(enableAI) || {isPlayer _x}) && // AI setting + {(side group _x) in _sides} && // Available sides + {simulationEnabled _x && {simulationEnabled vehicle _x}} && // Hide disabled things + { !isObjectHidden _x && {!isObjectHidden vehicle _x} } // Hide hidden things +}; + +// Respect the blacklist +_entities = _entities - GVAR(unitBlacklist); + +// Whitelist overrides filtering +_entities append GVAR(unitWhitelist); + +// Never include the local player +_entities deleteAt (_entities find player); + +// Return no duplicates +_entities arrayIntersect _entities diff --git a/addons/spectator/functions/fnc_handleCamera.sqf b/addons/spectator/functions/fnc_handleCamera.sqf deleted file mode 100644 index ce384c496c..0000000000 --- a/addons/spectator/functions/fnc_handleCamera.sqf +++ /dev/null @@ -1,75 +0,0 @@ -/* - * Author: F3 Project, Head, SilentSpike - * Handles free camera manipulation according to input - * - * Arguments: - * 0: Parameters - * 1: PFH handle - * - * Return Value: - * None - * - * Example: - * [ace_spectator_fnc_handleCamera, 0] call CBA_fnc_addPerFrameHandler; - * - * Public: No - */ - -#include "script_component.hpp" - -// Kill PFH when not in free cam (or display is closed) -if (isNil QGVAR(camHandler)) exitWith { [_this select 1] call CBA_fnc_removePerFrameHandler; }; - -private ["_camera","_pan","_tilt"]; - -_pan = (GVAR(camPan) + 360) % 360; -_tilt = GVAR(camTilt); - -if (GVAR(camMode) == 0) then { - private ["_oldPos","_altMod","_zoomMod","_mX","_mY","_mZ","_x","_y","_z"]; - _camera = GVAR(freeCamera); - _oldPos = GVAR(camPos); - - // Dolly/Boom amount should be influnced by zoom level (it should really be exponential) - // Dollying should also slow as the camera gets close to the ground - _zoomMod = (GVAR(camZoom) * 0.8) max 1; - _altMod = ((((getPos _camera) select 2) * 0.05) max 0.1) min 1; - - _mX = (GVAR(camDolly) select 0) * _altMod / _zoomMod; - _mY = (GVAR(camDolly) select 1) * _altMod / _zoomMod; - _mZ = GVAR(camBoom) / _zoomMod; - - _x = (_oldPos select 0) + (_mX * cos(_pan)) + (_mY * sin(_pan)); - _y = (_oldPos select 1) - (_mX * sin(_pan)) + (_mY * cos(_pan)); - _z = (_oldPos select 2) + _mZ; - - // Prevent camera going under terrain - GVAR(camPos) = [_x,_y,_z max (getTerrainHeightASL [_x,_y])]; - - // Update camera position and rotation - _camera setPosASL GVAR(camPos); - _camera setDir _pan; - [_camera, _tilt, 0] call BIS_fnc_setPitchBank; -} else { - private ["_unit","_target","_distance","_vector"]; - _camera = GVAR(unitCamera); - - _unit = GVAR(camUnit); - _target = GVAR(targetCamera); - _distance = GVAR(camDistance); - - // Generate a position vector relative to the unit - _vector = [0,-_distance*cos(_tilt),0]; - _vector = [_vector,[-_pan] call CBA_fnc_simplifyAngle180] call BIS_fnc_rotateVector2D; - _vector = _vector vectorAdd [0,0,_distance*sin(-_tilt)]; - - // Update the position of the target camera (used for smooth unit tracking) - _target camSetPos ((_unit modelToWorldVisual [0,0,0]) vectorAdd [0,0,1.5]); - _target camCommit 0; - - // Update the relative position of the unit camera - _camera camSetRelPos _vector; - _camera camCommit 0; - - GVAR(camPos) = getPosASL _camera; -}; diff --git a/addons/spectator/functions/fnc_handleCompass.sqf b/addons/spectator/functions/fnc_handleCompass.sqf deleted file mode 100644 index a65cc9ddce..0000000000 --- a/addons/spectator/functions/fnc_handleCompass.sqf +++ /dev/null @@ -1,67 +0,0 @@ -/* - * Author: SilentSpike, voiper - * Handles the spectator UI compass - * - * Arguments: - * 0: Parameters - * 1: PFH handle - * - * Return Value: - * None - * - * Example: - * [ace_spectator_fnc_handleCompass, 0, _display] call CBA_fnc_addPerFrameHandler; - * - * Public: No - */ - -#include "script_component.hpp" - -params ["_display"]; - -// Kill PFH when compass hidden (or display is closed) -if (isNil QGVAR(compHandler)) exitWith { [_this select 1] call CBA_fnc_removePerFrameHandler; }; - -private ["_compass","_NE","_ES","_SW","_WN","_compassW","_degree","_heading","_offset","_positions","_sequence"]; - -_compass = _display displayCtrl IDC_COMP; - -_NE = _compass controlsGroupCtrl IDC_COMP_0; -_ES = _compass controlsGroupCtrl IDC_COMP_90; -_SW = _compass controlsGroupCtrl IDC_COMP_180; -_WN = _compass controlsGroupCtrl IDC_COMP_270; - -_compassW = (ctrlPosition _compass) select 2; -_degree = _compassW / 180; - -// Get direction of screen rather than object (accounts for unit freelook) -_heading = (positionCameraToWorld [0,0,1]) vectorDiff (positionCameraToWorld [0,0,0]); -_heading = (((_heading select 0) atan2 (_heading select 1)) + 360) % 360; -_offset = -(_heading % 90) * _degree; - -_positions = [ - [_compassW * -0.5 + _offset, 0], - [_offset, 0], - [_compassW * 0.5 + _offset, 0], - [_compassW + _offset, 0] -]; - -_sequence = if (_heading < 90) then { - [_SW, _WN, _NE, _ES] -} else { - if (_heading < 180) then { - [_WN, _NE, _ES, _SW] - } else { - if (_heading < 270) then { - [_NE, _ES, _SW, _WN] - } else { - [_ES, _SW, _WN, _NE] - }; - }; -}; - - -{ - _x ctrlSetPosition (_positions select _forEachIndex); - _x ctrlCommit 0; -} forEach _sequence; diff --git a/addons/spectator/functions/fnc_handleFired.sqf b/addons/spectator/functions/fnc_handleFired.sqf new file mode 100644 index 0000000000..b9258cbd02 --- /dev/null +++ b/addons/spectator/functions/fnc_handleFired.sqf @@ -0,0 +1,48 @@ +/* + * Author: Nelson Duarte, AACO, SilentSpike + * Function used to add projectiles to be drawn when a unit fires + * + * Arguments: + * Fired EH arguments + * + * Return Value: + * None + * + * Example: + * _unit addEventHandler ["Fired",{_this call ace_spectator_fnc_handleFired}] + * + * Public: No + */ + +#include "script_component.hpp" + +params [ + "_unit", + ["_weapon", "", [""]], + "", // Muzzle + "", // Mode + "", // Ammo + "", // Magazine + ["_projectile", objNull, [objNull]] +]; + +// Remove the EH when spectator is no longer active or unit is removed +if (isNil QGVAR(entitiesToDraw) || {!(_unit in GVAR(entitiesToDraw))}) exitWith { + //USES_VARIABLES ["_thisEventHandler"] + _unit removeEventHandler ["Fired", _thisEventHandler]; + SETVAR(_unit,GVAR(firedEH),nil); +}; + +// Fire time used for unit icon highlighting +_unit setVariable [QGVAR(highlightTime), time + FIRE_HIGHLIGHT_TIME]; + +// Store projectiles / grenades for drawing +if (GVAR(drawProjectiles) && {!isNull _projectile}) then { + if (_weapon == "Throw") then { + if (count GVAR(grenadesToDraw) > MAX_GRENADES) then { GVAR(grenadesToDraw) deleteAt 0; }; + GVAR(grenadesToDraw) pushBack _projectile; + } else { + if (count GVAR(projectilesToDraw) > MAX_PROJECTILES) then { GVAR(projectilesToDraw) deleteAt 0; }; + GVAR(projectilesToDraw) pushBack [_projectile, [[getPosVisual _projectile, [1,0,0,0]]]]; + }; +}; diff --git a/addons/spectator/functions/fnc_handleIcons.sqf b/addons/spectator/functions/fnc_handleIcons.sqf deleted file mode 100644 index d1f83690ff..0000000000 --- a/addons/spectator/functions/fnc_handleIcons.sqf +++ /dev/null @@ -1,46 +0,0 @@ -/* - * Author: Head, SilentSpike - * Handles rendering the spectator 3D unit icons - * - * Arguments: - * 0: Parameters - * 1: PFH handle - * - * Return Value: - * None - * - * Example: - * [ace_spectator_fnc_handleIcons, 0] call CBA_fnc_addPerFrameHandler; - * - * Public: No - */ - -#include "script_component.hpp" - -if !(GVAR(showIcons)) exitWith {}; -private ["_refPoint","_drawVehicles","_leader","_color","_txt","_unit"]; - -// Draw groups unless leader is within distance -_refPoint = [GVAR(freeCamera),GVAR(camUnit)] select (GVAR(camMode) > 0); -_drawVehicles = []; -{ - _leader = leader _x; - if ((_leader distanceSqr _refPoint) > 40000) then { - _color = GETVAR(_x,GVAR(gColor),[ARR_4(0,0,0,0)]); - _txt = groupID _x; - - drawIcon3D ["\A3\ui_f\data\map\markers\nato\b_inf.paa", _color, _leader modelToWorldVisual [0,0,30], 1, 1, 0, _txt, 2, 0.02]; - } else { - _drawVehicles append (units _x); - }; - false -} count GVAR(groupList); - -// Draw units for groups within distance -{ - _color = GETVAR((group _x),GVAR(gColor),[ARR_4(0,0,0,0)]); - _txt = ["", GETVAR(_x,GVAR(uName),"")] select (isPlayer _x); - - drawIcon3D ["\A3\ui_f\data\map\markers\military\dot_CA.paa", _color, _x modelToWorldVisual [0,0,3], 0.7, 0.7, 0, _txt, 1, 0.02]; - false -} count (_drawVehicles arrayIntersect GVAR(unitList)); diff --git a/addons/spectator/functions/fnc_handleInterface.sqf b/addons/spectator/functions/fnc_handleInterface.sqf deleted file mode 100644 index e5bb7498e0..0000000000 --- a/addons/spectator/functions/fnc_handleInterface.sqf +++ /dev/null @@ -1,494 +0,0 @@ -/* - * Author: SilentSpike - * Handles spectator interface events - * - * Arguments: - * 0: Event name - * 1: Event arguments - * - * Return Value: - * None - * - * Example: - * ["onLoad",_this] call ace_spectator_fnc_handleInterface - * - * Public: No - */ - -#include "script_component.hpp" - -params ["_mode",["_args",[]]]; - -switch (toLower _mode) do { - case "onload": { - _args params ["_display"]; - SETUVAR(GVAR(interface),_display); - - // Always show interface and hide map upon opening - [_display,nil,nil,!GVAR(showInterface),GVAR(showMap)] call FUNC(toggleInterface); - - // Initalize the unit tree - ["onUnitsUpdate",[(_display displayCtrl IDC_UNIT) controlsGroupCtrl IDC_UNIT_TREE]] call FUNC(handleInterface); - - // Keep unit list and tree up to date - [FUNC(handleUnits), 9, _display] call CBA_fnc_addPerFrameHandler; - - // Handle 3D unit icons - GVAR(iconHandler) = addMissionEventHandler ["Draw3D",FUNC(handleIcons)]; - - // Populate the help window - private _help = (_display displayCtrl IDC_HELP) controlsGroupCtrl IDC_HELP_LIST; - { - _i = _help lbAdd (_x select 0); - if ((_x select 1) == "") then { - _help lbSetPicture [_i,"\A3\ui_f\data\map\markers\military\dot_CA.paa"]; - _help lbSetPictureColor [_i,[COL_FORE]]; - } else { - _help lbSetTooltip [_i,_x select 1]; - }; - } forEach [ - [localize LSTRING(uiControls),""], - [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),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(attributeControls),""], - [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),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 - [{ - if !(isNull (GETUVAR(RscRespawnCounter,displayNull))) then { - disableSerialization; - private ["_counter","_title","_back","_timer","_frame","_x","_y"]; - _counter = GETUVAR(RscRespawnCounter,displayNull); - _title = _counter displayCtrl 1001; - _back = _counter displayCtrl 1002; - _timer = _counter displayCtrl 1003; - _frame = _counter ctrlCreate ["RscFrame",1008]; - - _x = safeZoneX + safeZoneW - TOOL_W * 4 - MARGIN * 3; - _y = safeZoneY + safeZoneH - TOOL_H; - - // Timer - _title ctrlSetPosition [_x,_y,TOOL_W,TOOL_H]; - _back ctrlSetPosition [_x,_y,TOOL_W,TOOL_H]; - _timer ctrlSetPosition [_x,_y,TOOL_W,TOOL_H]; - _frame ctrlSetPosition [_x,_y,TOOL_W,TOOL_H]; - - _title ctrlSetBackgroundColor [0,0,0,0]; - _back ctrlSetBackgroundColor [COL_BACK]; - _timer ctrlSetFontHeight TOOL_H; - _frame ctrlSetTextColor [COL_FORE]; - - _title ctrlCommit 0; - _back ctrlCommit 0; - _timer ctrlCommit 0; - _frame ctrlCommit 0; - }; - },[],0.5] call CBA_fnc_waitAndExecute; - }; - case "onunload": { - // Kill GUI PFHs - removeMissionEventHandler ["Draw3D",GVAR(iconHandler)]; - GVAR(camHandler) = nil; - GVAR(compHandler) = nil; - GVAR(iconHandler) = nil; - GVAR(toolHandler) = nil; - - // Reset variables - GVAR(camBoom) = 0; - GVAR(camDolly) = [0,0]; - GVAR(ctrlKey) = false; - GVAR(heldKeys) = []; - GVAR(heldKeys) resize 255; - GVAR(mouse) = [false,false]; - GVAR(mousePos) = [0.5,0.5]; - }; - // Mouse events - case "onmousebuttondown": { - _args params ["_ctrl","_button"]; - GVAR(mouse) set [_button,true]; - - // Detect right click - if ((_button == 1) && (GVAR(camMode) == 1)) then { - // In first person toggle sights mode - GVAR(camGun) = !GVAR(camGun); - [] call FUNC(transitionCamera); - }; - }; - case "onmousebuttonup": { - _args params ["_ctrl","_button"]; - - GVAR(mouse) set [_button,false]; - if (_button == 0) then { GVAR(camDolly) = [0,0]; }; - }; - case "onmousezchanged": { - _args params ["_ctrl","_zChange"]; - - // Scroll to modify distance value in third person - if (GVAR(camMode) == 0) then { - // Scroll to change speed, modifier for zoom - if (GVAR(ctrlKey)) then { - [nil,nil,nil,nil,nil,nil,nil, GVAR(camSpeed) + _zChange * 0.2] call FUNC(setCameraAttributes); - } else { - [nil,nil,nil,nil,nil,nil, GVAR(camZoom) + _zChange * 0.1] call FUNC(setCameraAttributes); - }; - } else { - GVAR(camDistance) = ((GVAR(camDistance) - _zChange * 2) max 5) min 50; - }; - }; - case "onmousemoving": { - _args params ["_ctrl","_x","_y"]; - - [_x,_y] call FUNC(handleMouse); - }; - // Keyboard events - case "onkeydown": { - _args params ["_display","_dik","_shift","_ctrl","_alt"]; - - if ((alive player) && {_dik in (actionKeys "curatorInterface")} && {!isNull (getAssignedCuratorLogic player)}) exitWith { - [QGVAR(zeus)] call FUNC(interrupt); - ["zeus"] call FUNC(handleInterface); - }; - if (_dik in (actionKeys "Chat")) exitWith { - false - }; - if (_dik in (actionKeys "PrevChannel" + actionKeys "NextChannel")) exitWith { - !(isServer || serverCommandAvailable "#kick") - }; - - // Handle held keys (prevent repeat calling) - if (GVAR(heldKeys) param [_dik,false]) exitWith {}; - // Exclude movement/adjustment keys so that speed can be adjusted on fly - if !(_dik in [16,17,30,31,32,44,74,78]) then { - GVAR(heldKeys) set [_dik,true]; - }; - - switch (_dik) do { - case 1: { // Esc - [QGVAR(escape)] call FUNC(interrupt); - ["escape"] call FUNC(handleInterface); - }; - case 2: { // 1 - [_display,nil,nil,nil,nil,nil,true] call FUNC(toggleInterface); - }; - case 3: { // 2 - [_display,nil,true] call FUNC(toggleInterface); - }; - case 4: { // 3 - [_display,nil,nil,nil,nil,true] call FUNC(toggleInterface); - }; - case 5: { // 4 - [_display,true] call FUNC(toggleInterface); - }; - case 6: { // 5 - GVAR(showIcons) = !GVAR(showIcons); - }; - case 14: { // Backspace - [_display,nil,nil,true] call FUNC(toggleInterface); - }; - case 16: { // Q - GVAR(camBoom) = 0.5 * GVAR(camSpeed) * ([1, 2] select _shift); - }; - case 17: { // W - GVAR(camDolly) set [1, GVAR(camSpeed) * ([1, 2] select _shift)]; - }; - case 29: { // Ctrl - GVAR(ctrlKey) = true; - }; - case 30: { // A - GVAR(camDolly) set [0, -GVAR(camSpeed) * ([1, 2] select _shift)]; - }; - case 31: { // S - GVAR(camDolly) set [1, -GVAR(camSpeed) * ([1, 2] select _shift)]; - }; - case 32: { // D - GVAR(camDolly) set [0, GVAR(camSpeed) * ([1, 2] select _shift)]; - }; - case 44: { // Z - GVAR(camBoom) = -0.5 * GVAR(camSpeed) * ([1, 2] select _shift); - }; - case 49: { // N - if (GVAR(camMode) != 1) then { - if (_ctrl) then { - [nil,nil,-1] call FUNC(cycleCamera); - } else { - [nil,nil,1] call FUNC(cycleCamera); - }; - }; - }; - case 50: { // M - [_display,nil,nil,nil,true] call FUNC(toggleInterface); - }; - case 57: { // Spacebar - // Switch between unit and freecam here - }; - case 74: { // Num - - if (_alt) exitWith { [nil,nil,nil,nil,nil,nil, 1.25] call FUNC(setCameraAttributes); }; - if (_ctrl) then { - [nil,nil,nil,nil,nil,nil,nil, GVAR(camSpeed) - 0.05] call FUNC(setCameraAttributes); - } else { - [nil,nil,nil,nil,nil,nil, GVAR(camZoom) - 0.01] call FUNC(setCameraAttributes); - }; - }; - case 78: { // Num + - 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 { - [nil,nil,nil,nil,nil,nil, GVAR(camZoom) + 0.01] call FUNC(setCameraAttributes); - }; - }; - case 200: { // Up arrow - [-1] call FUNC(cycleCamera); - }; - case 203: { // Left arrow - [nil,1] call FUNC(cycleCamera); - }; - case 205: { // Right arrow - [nil,-1] call FUNC(cycleCamera); - }; - case 208: { // Down arrow - [1] call FUNC(cycleCamera); - }; - }; - - true - }; - case "onkeyup": { - _args params ["_display","_dik","_shift","_ctrl","_alt"]; - - // No longer being held - GVAR(heldKeys) set [_dik,nil]; - - switch (_dik) do { - case 16: { // Q - GVAR(camBoom) = 0; - }; - case 17: { // W - GVAR(camDolly) set [1, 0]; - }; - case 29: { // Ctrl - GVAR(ctrlKey) = false; - }; - case 30: { // A - GVAR(camDolly) set [0, 0]; - }; - case 31: { // S - GVAR(camDolly) set [1, 0]; - }; - case 32: { // D - GVAR(camDolly) set [0, 0]; - }; - case 44: { // Z - GVAR(camBoom) = 0; - }; - }; - - true - }; - // Tree events - case "ontreedblclick": { - // Update camera view when listbox unit is double clicked on - _args params ["_tree","_sel"]; - - // Ensure a unit was selected - if (count _sel == 3) then { - private ["_netID","_newUnit","_newMode"]; - _netID = (_args select 0) tvData _sel; - _newUnit = objectFromNetId _netID; - - // When unit is reselected, toggle camera mode - if (_newUnit == GVAR(camUnit) || GVAR(camMode) == 0) then { - _newMode = [2,2,1] select GVAR(camMode); - }; - - [_newMode,_newUnit] call FUNC(transitionCamera); - }; - }; - case "onunitsupdate": { - _args params ["_tree"]; - private ["_cachedUnits","_cachedGrps","_cachedSides","_sT","_gT","_uT","_s","_g","_u","_grp","_unit","_side"]; - - // Cache existing group and side nodes and cull removed data - _cachedUnits = []; - _cachedGrps = []; - _cachedSides = []; - // Track deleted nodes to account for decrease in index - _sT = _tree tvCount []; - for [{_s = 0;}, {_s < _sT}, {_s = _s + 1}] do { - _gT = _tree tvCount [_s]; - - for [{_g = 0;}, {_g < _gT}, {_g = _g + 1}] do { - _grp = groupFromNetID (_tree tvData [_s,_g]); - - if (_grp in GVAR(groupList)) then { - _cachedGrps pushBack _grp; - _cachedGrps pushBack _g; - - _uT = _tree tvCount [_s,_g]; - for [{_u = 0;}, {_u < _uT}, {_u = _u + 1}] do { - _unit = objectFromNetId (_tree tvData [_s,_g,_u]); - - if (_unit in GVAR(unitList)) then { - _cachedUnits pushBack _unit; - } else { - _tree tvDelete [_s,_g,_u]; - _u = _u - 1; - _uT = _uT - 1; - }; - }; - } else { - _tree tvDelete [_s,_g]; - _g = _g - 1; - _gT = _gT - 1; - }; - }; - - if ((_tree tvCount [_s]) > 0) then { - _cachedSides pushBack (_tree tvText [_s]); - _cachedSides pushBack _s; - } else { - _tree tvDelete [_s]; - _s = _s - 1; - _sT = _sT - 1; - }; - }; - - // Update the tree from the unit list - { - _grp = group _x; - _side = [side _grp] call BIS_fnc_sideName; - - // Use correct side node - if !(_side in _cachedSides) then { - // Add side node - _s = _tree tvAdd [[], _side]; - _tree tvExpand [_s]; - - _cachedSides pushBack _side; - _cachedSides pushBack _s; - } else { - // If side already processed, use existing node - _s = _cachedSides select ((_cachedSides find _side) + 1); - }; - - // Use correct group node - if !(_grp in _cachedGrps) then { - // Add group node - _g = _tree tvAdd [[_s], groupID _grp]; - _tree tvSetData [[_s,_g], netID _grp]; - - _cachedGrps pushBack _grp; - _cachedGrps pushBack _g; - } else { - // If group already processed, use existing node - _g = _cachedGrps select ((_cachedGrps find _grp) + 1); - }; - - _u = _tree tvAdd [[_s,_g], GETVAR(_x,GVAR(uName),"")]; - _tree tvSetData [[_s,_g,_u], netID _x]; - _tree tvSetPicture [[_s,_g,_u], GETVAR(_x,GVAR(uIcon),"")]; - _tree tvSetPictureColor [[_s,_g,_u], GETVAR(_grp,GVAR(gColor),[ARR_4(1,1,1,1)])]; - - _tree tvSort [[_s,_g],false]; - } forEach (GVAR(unitList) - _cachedUnits); - - _tree tvSort [[],false]; - - if ((_tree tvCount []) <= 0) then { - _tree tvAdd [[], localize LSTRING(units_none)]; - }; - }; - // Map events - case "onmapclick": { - _args params ["_map","_button","_x","_y","_shift","_ctrl","_alt"]; - private ["_newPos","_oldZ"]; - - if ((GVAR(camMode) == 0) && (_button == 0)) then { - _newPos = _map ctrlMapScreenToWorld [_x,_y]; - _oldZ = (ASLtoATL GVAR(camPos)) select 2; - _newPos set [2, _oldZ]; - [nil,nil,nil, _newPos] call FUNC(setCameraAttributes); - }; - }; - // Interrupt events - case "escape": { - createDialog (["RscDisplayInterrupt", "RscDisplayMPInterrupt"] select isMultiplayer); - - disableSerialization; - private _dlg = finddisplay 49; - _dlg displayAddEventHandler ["KeyDown", { - _key = _this select 1; - !(_key == 1) - }]; - - // Disable save, respawn, options & manual buttons - (_dlg displayCtrl 103) ctrlEnable false; - if !(alive player) then { - (_dlg displayCtrl 1010) ctrlEnable false; - }; - (_dlg displayCtrl 101) ctrlEnable false; - (_dlg displayCtrl 122) ctrlEnable false; - - // Initalize abort button (the "spawn" is a necessary evil) - (_dlg displayCtrl 104) ctrlAddEventHandler ["ButtonClick",{_this spawn { - disableSerialization; - _display = ctrlparent (_this select 0); - _abort = [localize "str_msg_confirm_return_lobby",nil,localize "str_disp_xbox_hint_yes",localize "str_disp_xbox_hint_no",_display,nil,true] call BIS_fnc_guiMessage; - if (_abort) then {_display closeDisplay 2; failMission "loser"}; - }}]; - - // PFH to re-open display when menu closes - [{ - if !(isNull (_this select 0)) exitWith {}; - - // If still a spectator then re-enter the interface - [QGVAR(escape),false] call FUNC(interrupt); - - [_this select 1] call CBA_fnc_removePerFrameHandler; - },0,_dlg] call CBA_fnc_addPerFrameHandler; - }; - case "zeus": { - openCuratorInterface; - - [{ - // PFH to re-open display when menu closes - [{ - if !((isNull curatorCamera) && {isNull (GETMVAR(bis_fnc_moduleRemoteControl_unit,objNull))}) exitWith {}; - - // If still a spectator then re-enter the interface - [QGVAR(zeus),false] call FUNC(interrupt); - - [_this select 1] call CBA_fnc_removePerFrameHandler; - },0] call CBA_fnc_addPerFrameHandler; - },[],5] call CBA_fnc_waitAndExecute; - - true - }; -}; diff --git a/addons/spectator/functions/fnc_handleMap.sqf b/addons/spectator/functions/fnc_handleMap.sqf deleted file mode 100644 index b83ccdcd7d..0000000000 --- a/addons/spectator/functions/fnc_handleMap.sqf +++ /dev/null @@ -1,67 +0,0 @@ -/* - * Author: Head, SilentSpike - * Handles rendering the spectator map icons - * - * Arguments: - * 0: Parameters - * 1: PFH handle - * - * Return Value: - * None - * - * Example: - * [ace_spectator_fnc_handleIcons, 0] call CBA_fnc_addPerFrameHandler; - * - * Public: No - */ - -#include "script_component.hpp" - -params ["_map"]; -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; - - if !(_unit in _cachedVehicles) then { - _cachedVehicles pushBack _unit; - - // Use previously cached info where possible - if (GETVAR(_unit,GVAR(uIcon),"") == "") then { - [_unit] call FUNC(cacheUnitInfo); - }; - - // Function has caching built in - _color = [side effectiveCommander _unit] call BIS_fnc_sideColor; - _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.04]; - }; - nil -} count (_drawVehicles arrayIntersect GVAR(unitList)); diff --git a/addons/spectator/functions/fnc_handleMouse.sqf b/addons/spectator/functions/fnc_handleMouse.sqf deleted file mode 100644 index 1c2b62798c..0000000000 --- a/addons/spectator/functions/fnc_handleMouse.sqf +++ /dev/null @@ -1,46 +0,0 @@ -/* - * Author: F3 Project, Head, SilentSpike - * Processes the change in mouse position for the spectator camera - * - * Arguments: - * 0: Mouse x coord - * 1: Mouse y coord - * - * Return Value: - * None - * - * Example: - * [0.5, 0.5] call ace_spectator_fnc_handleMouse; - * - * Public: No - */ - -#include "script_component.hpp" - -params ["_x","_y"]; -private ["_leftButton","_rightButton","_oldX","_oldY","_deltaX","_deltaY","_zoomMod"]; - -_leftButton = GVAR(mouse) select 0; -_rightButton = GVAR(mouse) select 1; - -_oldX = GVAR(mousePos) select 0; -_oldY = GVAR(mousePos) select 1; - -// Get change in pos -_deltaX = _oldX - _x; -_deltaY = _oldY - _y; - -if (_leftButton) then { - GVAR(camDolly) set [0, _deltaX * -100 * GVAR(camSpeed)]; - GVAR(camDolly) set [1, _deltaY * 100 * GVAR(camSpeed)]; -} else { - if (_rightButton) then { - // Pan/Tilt amount should be influnced by zoom level (it should really be exponential) - _zoomMod = (GVAR(camZoom) * 0.8) max 1; - - GVAR(camPan) = GVAR(camPan) - ((_deltaX * 360) / _zoomMod); - GVAR(camTilt) = ((GVAR(camTilt) + ((_deltaY * 180) / _zoomMod)) min 89) max -89; - }; -}; - -GVAR(mousePos) = [_x,_y]; diff --git a/addons/spectator/functions/fnc_handleToolbar.sqf b/addons/spectator/functions/fnc_handleToolbar.sqf deleted file mode 100644 index 4e79c172bd..0000000000 --- a/addons/spectator/functions/fnc_handleToolbar.sqf +++ /dev/null @@ -1,59 +0,0 @@ -/* - * Author: Karel Moricky, SilentSpike - * Handles the spectator UI toolbar values - * - * Arguments: - * 0: Parameters - * 1: PFH handle - * - * Return Value: - * None - * - * Example: - * [ace_spectator_fnc_handleToolbar, 0, _display] call CBA_fnc_addPerFrameHandler; - * - * Public: No - */ - -#include "script_component.hpp" - -params ["_display"]; - -// Kill PFH when toolbar hidden (or display is closed) -if (isNil QGVAR(toolHandler)) exitWith { [_this select 1] call CBA_fnc_removePerFrameHandler; }; - -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 { - _fov = format ["%1x", floor(GVAR(camZoom) * 100) * 0.01]; - _speed = format ["%1 m/s", floor(GVAR(camSpeed) * 100) * 0.01]; -} else { - _vision = [side group GVAR(camUnit)] call BIS_fnc_sideName; - _fov = format ["%1 m", floor(getPosASL GVAR(camUnit) select 2)]; - _speed = format ["%1 km/h", floor(speed GVAR(camUnit)) max 0]; -}; - -if (alive GVAR(camUnit)) then { - _name = GETVAR(GVAR(camUnit),GVAR(uName),""); -} else { - _name = localize "STR_Special_None"; -}; - -_mode = [localize LSTRING(ViewFree),localize LSTRING(ViewInternal),localize LSTRING(ViewExternal)] select GVAR(camMode); -_time = [daytime,"HH:MM"] call BIS_fnc_timeToString; - -// Update the UI tools -(_toolbar controlsGroupCtrl IDC_TOOL_CLOCK) ctrlSetText _time; -(_toolbar controlsGroupCtrl IDC_TOOL_VISION) ctrlSetText _vision; -(_toolbar controlsGroupCtrl IDC_TOOL_FOV) ctrlSetText _fov; -(_toolbar controlsGroupCtrl IDC_TOOL_NAME) ctrlSetText _name; -(_toolbar controlsGroupCtrl IDC_TOOL_SPEED) ctrlSetText _speed; -(_toolbar controlsGroupCtrl IDC_TOOL_VIEW) ctrlSetText _mode; diff --git a/addons/spectator/functions/fnc_handleUnits.sqf b/addons/spectator/functions/fnc_handleUnits.sqf deleted file mode 100644 index f51c922b8e..0000000000 --- a/addons/spectator/functions/fnc_handleUnits.sqf +++ /dev/null @@ -1,40 +0,0 @@ -/* - * Author: SilentSpike - * Maintains the spectatable unit list and updates the unit tree accordingly - * Also updates current camera unit when status changes - * - * Arguments: - * 0: Parameters - * 1: PFH handle - * - * Return Value: - * None - * - * Example: - * [ace_spectator_fnc_handleUnits, 10, _display] call CBA_fnc_addPerFrameHandler; - * - * Public: No - */ - -#include "script_component.hpp" - -params ["_display"]; - -// Kill PFH when display is closed -if (isNull _display) exitWith { [_this select 1] call CBA_fnc_removePerFrameHandler; }; - -// Remove all dead and null units from the list -[] call FUNC(updateUnits); - -// Camera shouldn't stay on unit that isn't in the list (unless dead) -if !(GVAR(camUnit) in GVAR(unitList)) then { - if (alive GVAR(camUnit) || isNull GVAR(camUnit)) then { - [nil,1] call FUNC(cycleCamera); - }; -}; - -// Reduce overhead when unit tree is hidden -if (ctrlShown (_display displayCtrl IDC_UNIT)) then { - // Reduce overhead by spreading across frames - [FUNC(handleInterface),["onUnitsUpdate",[(_display displayCtrl IDC_UNIT) controlsGroupCtrl IDC_UNIT_TREE]],1] call CBA_fnc_waitAndExecute; -}; diff --git a/addons/spectator/functions/fnc_interrupt.sqf b/addons/spectator/functions/fnc_interrupt.sqf index 0826949b30..60c733db38 100644 --- a/addons/spectator/functions/fnc_interrupt.sqf +++ b/addons/spectator/functions/fnc_interrupt.sqf @@ -1,27 +1,17 @@ /* * Author: SilentSpike - * Interrupts the spectator interface for external systems - * - * Arguments: - * 0: Reason - * 1: Interrupting (default: true) - * - * Return Value: - * None - * - * Example: - * ["mySystem"] call ace_spectator_fnc_interrupt - * - * Public: Yes + * Deprecated. Technically never publically documented, but just in case. */ #include "script_component.hpp" params [["_reason", "", [""]], ["_interrupt", true, [true]]]; +ACE_DEPRECATED(QFUNC(interrupt),"3.12.0","just close and reopen spectator"); + // Nothing to do when spectator is closed if !(GVAR(isSet)) exitWith {}; -if (_reason == "") exitWith { ERROR("Invalid Reason"); }; +if (_reason == "") exitWith { WARNING("Invalid Reason"); }; if (_interrupt) then { GVAR(interrupts) pushBack _reason; } else { @@ -29,16 +19,11 @@ if (_interrupt) then { }; if (GVAR(interrupts) isEqualTo []) then { - if (isNull (GETUVAR(GVAR(interface),displayNull))) then { - (findDisplay 46) createDisplay QGVAR(interface); - [] call FUNC(transitionCamera); + if (isNull SPEC_DISPLAY) then { + [true] call FUNC(ui); }; } else { - if !(isNull (GETUVAR(GVAR(interface),displayNull))) then { - while {dialog} do { - closeDialog 0; - }; - - (GETUVAR(GVAR(interface),displayNull)) closeDisplay 0; + if !(isNull SPEC_DISPLAY) then { + [false] call FUNC(ui); }; }; diff --git a/addons/spectator/functions/fnc_moduleSpectatorSettings.sqf b/addons/spectator/functions/fnc_moduleSpectatorSettings.sqf index 52b6e5d8fa..4a7c891497 100644 --- a/addons/spectator/functions/fnc_moduleSpectatorSettings.sqf +++ b/addons/spectator/functions/fnc_moduleSpectatorSettings.sqf @@ -8,7 +8,10 @@ * 2: activated * * Return Value: - * None + * None + * + * Example: + * [LOGIC, [bob, kevin], true] call ace_spectator_fnc_moduleSpectatorSettings * * Public: No */ @@ -19,7 +22,6 @@ params ["_logic", "_units", "_activated"]; if !(_activated) exitWith {}; -[_logic, QGVAR(filterUnits), "unitsFilter"] call EFUNC(common,readSettingFromModule); -[_logic, QGVAR(filterSides), "sidesFilter"] call EFUNC(common,readSettingFromModule); +[_logic, QGVAR(enableAI), "enableAI"] call EFUNC(common,readSettingFromModule); [_logic, QGVAR(restrictModes), "cameraModes"] call EFUNC(common,readSettingFromModule); [_logic, QGVAR(restrictVisions), "visionModes"] call EFUNC(common,readSettingFromModule); diff --git a/addons/spectator/functions/fnc_players.sqf b/addons/spectator/functions/fnc_players.sqf new file mode 100644 index 0000000000..3525b835d5 --- /dev/null +++ b/addons/spectator/functions/fnc_players.sqf @@ -0,0 +1,19 @@ +/* + * Author: SilentSpike + * Return all of the player entities who are currently in ace spectator + * + * Arguments: + * None + * + * Return Value: + * Spectator Players + * + * Example: + * [] call ace_spectator_fnc_players + * + * Public: Yes + */ + +#include "script_component.hpp" + +allPlayers select { GETVAR(_x,GVAR(isSet),false) } diff --git a/addons/spectator/functions/fnc_respawnTemplate.sqf b/addons/spectator/functions/fnc_respawnTemplate.sqf index 1a36170202..24a0e358f4 100644 --- a/addons/spectator/functions/fnc_respawnTemplate.sqf +++ b/addons/spectator/functions/fnc_respawnTemplate.sqf @@ -1,7 +1,8 @@ /* * Author: SilentSpike - * The ace_spectator respawn template, handles killed + respawn - * Can be used via BI's respawn framework, see: + * The ace_spectator respawn template, compatible with types 1,2,3,4 & 5 + * + * Handles killed and respawned events as per BI's respawn framework: * https://community.bistudio.com/wiki/Arma_3_Respawn * * Arguments: @@ -13,31 +14,29 @@ * Return Value: * None * + * Example: + * [bob, kevin, 3, 6] call ace_spectator_fnc_respawnTemplate + * * Public: No */ #include "script_component.hpp" -params [["_unit",objNull,[objNull]], ["_killer",objNull,[objNull]], ["_respawn",0,[0]], ["_respawnDelay",0,[0]]]; +params [["_newCorpse",objNull,[objNull]], ["_oldKiller",objNull,[objNull]], ["_respawn",0,[0]], ["_respawnDelay",0,[0]]]; -// Some environment information can be used for the initial camera attributes -if (isNull _killer) then {_killer = _unit}; -private _vision = [-2,-1] select (sunOrMoon < 1); -private _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] call FUNC(stageSpectator); - [2,_killer,_vision,_pos,getDir _unit] call FUNC(setCameraAttributes); - [true] call FUNC(setSpectator); - } else { - [false] call FUNC(setSpectator); - }; -} else { - // Negligible respawn delay can result in entering spectator after respawn - if (playerRespawnTime <= 1) exitWith {}; - - [2,_killer,_vision,_pos,getDir _unit] call FUNC(setCameraAttributes); - [true] call FUNC(setSpectator); +// Compatibility handled via spectator display XEH +if (_respawn in [0,1,4,5]) exitWith { + // This only applies to respawn type 1 (BIRD/SPECTATOR) + // Remove the seagull (not actually the player, a CfgNonAIVehicles object) + if (typeOf _newCorpse == "seagull") then { deleteVehicle _newCorpse; }; +}; + +// Virtual spectators should be ignored by the template (otherwise they break) +if (_newCorpse isKindOf QGVAR(virtual)) exitWith {}; + +// If player died while already in spectator, ignore +if (!GVAR(isSet) || {alive _newCorpse}) then { + // Negligible respawn delay can result in entering spectator after respawn + // So we just use this value rather than living state of the unit + [playerRespawnTime > 1] call FUNC(setSpectator); }; diff --git a/addons/spectator/functions/fnc_setCameraAttributes.sqf b/addons/spectator/functions/fnc_setCameraAttributes.sqf index fac9c94059..734503e25e 100644 --- a/addons/spectator/functions/fnc_setCameraAttributes.sqf +++ b/addons/spectator/functions/fnc_setCameraAttributes.sqf @@ -1,27 +1,30 @@ /* * Author: SilentSpike - * Sets the spectator camera attributes as desired - * All values are optional and default to whatever the current value is + * Sets the spectator camera attributes as desired. Local effect. + * All values are optional and default to no change. * * Arguments: * 0: Camera mode * - 0: Free - * - 1: Internal - * - 2: External - * 1: Camera unit (objNull for random) + * - 1: First Person + * - 2: Follow + * 1: Camera focus * 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) + * 4: Camera direction (0 - 360) + * + * Notes: + * - If camera mode is not free and camera has no focus, random will be used + * - To remove any current camera focus in free cam, use objNull + * - To select a random camera focus, use a boolean * * Return Value: - * None + * None * * Example: * [1, objNull] call ace_spectator_fnc_setCameraAttributes @@ -32,37 +35,68 @@ #include "script_component.hpp" params [ - ["_mode",GVAR(camMode),[0]], - ["_unit",GVAR(camUnit),[objNull]], - ["_vision",GVAR(camVision),[0]], - ["_position",ASLtoATL GVAR(camPos),[[]],3], - ["_heading",GVAR(camPan),[0]], - ["_tilt",GVAR(camTilt),[0]], - ["_zoom",GVAR(camZoom),[0]], - ["_speed",GVAR(camSpeed),[0]] + ["_mode",nil,[0]], + ["_focus",nil,[objNull,true]], + ["_vision",nil,[0]], + ["_position",nil,[[]],3], + ["_direction",nil,[0]] ]; -// Normalize input -if !(_mode in GVAR(availableModes)) then { - _mode = GVAR(availableModes) select ((GVAR(availableModes) find GVAR(camMode)) max 0); +if (count _this > 5) then { + ACE_DEPRECATED("Use of ""tilt"", ""zoom"" and ""speed"" camera attributes","3.12.0","N/A") }; -if !(_vision in GVAR(availableVisions)) then { - _vision = GVAR(availableVisions) select ((GVAR(availableVisions) find GVAR(camVision)) max 0); -}; - -GVAR(camPan) = _heading % 360; -GVAR(camSpeed) = (_speed max 0.05) min 10; -GVAR(camTilt) = (_tilt max -89) min 89; -GVAR(camUnit) = _unit; -GVAR(camVision) = _vision; -GVAR(camZoom) = (_zoom min 2) max 0.01; - // Apply if camera exists -if (GVAR(isSet)) then { - GVAR(camPos) = (ATLtoASL _position); // Camera position will be updated in FUNC(handleCamera) - [_mode,_unit,_vision] call FUNC(transitionCamera); +if !(isNil QGVAR(camera)) then { + // These functions are smart and handle unavailable inputs + if !(isNil "_focus") then { + [_focus] call FUNC(setFocus); + }; + + if !(isNil "_mode") then { + // If mode not free and no focus, find focus + if ((_mode != MODE_FREE) && {isNull GVAR(camFocus)}) then { + [true] call FUNC(setFocus); + }; + + [_mode] call FUNC(cam_setCameraMode); + }; + + if !(isNil "_vision") then { + [_vision] call FUNC(cam_setVisionMode); + }; + + if !(isNil "_position") then { + GVAR(camera) setPosATL _position; + }; + + if !(isNil "_direction") then { + GVAR(camera) setDir _direction; + }; } else { - GVAR(camMode) = _mode; - GVAR(camPos) = (ATLtoASL _position); + if !(isNil "_focus") then { + // If there are no entities this becomes nil, handled on camera startup + if (_focus isEqualType true) then { + _focus = ([] call FUNC(getTargetEntities)) select 0; + }; + + GVAR(camFocus) = _focus; + }; + + if !(isNil "_mode") then { + GVAR(camMode) = _mode; + }; + + if !(isNil "_vision") then { + GVAR(camVision) = _vision; + }; + + // GVARs exits purely for pre-setting of these attributes + if !(isNil "_position") then { + GVAR(camPos) = ATLtoASL _position; + }; + + if !(isNil "_direction") then { + GVAR(camDir) = _direction; + }; }; diff --git a/addons/spectator/functions/fnc_setFocus.sqf b/addons/spectator/functions/fnc_setFocus.sqf new file mode 100644 index 0000000000..e2054ecfe6 --- /dev/null +++ b/addons/spectator/functions/fnc_setFocus.sqf @@ -0,0 +1,59 @@ +/* + * Author: AACO, SilentSpike + * Function used to set the camera focus + * + * Arguments: + * 0: New focus + * + * Return Value: + * None + * + * Example: + * [player] call ace_spectator_fnc_setFocus + * + * Public: No + */ + +#include "script_component.hpp" + +params [["_newFocus", objNull, [objNull,true]]]; + +// If boolean provided then first find a focus +if (_newFocus isEqualType true) then { + private _testFocus = ([] call FUNC(getTargetEntities)) select 0; + + if (isNil "_testFocus") then { + if (MODE_FREE in GVAR(availableModes)) then { + WARNING("No available entities to focus on. Switching to free cam."); + [MODE_FREE] call FUNC(cam_setCameraMode); + _newFocus = objNull; + } else { + // Default to player if necessary + WARNING("No available entities to focus on. Using player."); + _newFocus = player; + }; + } else { + _newFocus = _testFocus; + }; +}; + +if (_newFocus != GVAR(camFocus) && { !(isNull _newFocus && { isNull GVAR(camFocus) }) }) then { + GVAR(camFocus) = _newFocus; + + if (isNull _newFocus) then { + if (GVAR(camMode) == MODE_FREE) then { + [] call FUNC(cam_resetTarget); + } else { + [MODE_FREE] call FUNC(cam_setCameraMode); + }; + } else { + [GVAR(camMode)] call FUNC(cam_setCameraMode); + }; + + // Only update display if it exists, this function is independent of it + if !(isNull SPEC_DISPLAY) then { + [] call FUNC(ui_updateListFocus); + [] call FUNC(ui_updateWidget); + [] call FUNC(ui_updateHelp); + }; +}; diff --git a/addons/spectator/functions/fnc_setSpectator.sqf b/addons/spectator/functions/fnc_setSpectator.sqf index 45bb15df42..c7087d6d5b 100644 --- a/addons/spectator/functions/fnc_setSpectator.sqf +++ b/addons/spectator/functions/fnc_setSpectator.sqf @@ -1,17 +1,17 @@ /* * Author: SilentSpike - * Sets local client to the given spectator state (virtually) - * To physically handle a spectator see ace_spectator_fnc_stageSpectator + * Enter/exit spectator mode for the local player * * Client will be able to communicate in ACRE/TFAR as appropriate - * The spectator interface will be opened/closed + * If "hide player" is true player will be hidden from group, invisible and invulnerable, but unmoved * * Arguments: * 0: Spectator state of local client (default: true) * 1: Force interface (default: true) + * 2: Hide player (if alive) (default: true) * * Return Value: - * None + * None * * Example: * [true] call ace_spectator_fnc_setSpectator @@ -21,47 +21,44 @@ #include "script_component.hpp" -params [["_set",true,[true]], ["_force",true,[true]]]; +params [["_set",true,[true]], ["_force",true,[true]], ["_hide",true,[true]]]; +TRACE_3("Params",_set,_force,_hide); // Only clients can be spectators if !(hasInterface) exitWith {}; -// Exit if no change +// Let the display know if it is or isn't forced +// Could be switched after spectator has already started +GVAR(uiForced) = _force; + +// Exit if no change (everything above this may need to be ran again) if (_set isEqualTo GVAR(isSet)) exitWith {}; -// Handle common addon audio +// Delay if local player (must not be ACE_Player) does not exist +if (isNull player) exitWith { + [ + { !isNull player }, + FUNC(setSpectator), + _this + ] call CBA_fnc_waitUntilAndExecute; +}; + +// Remove any current deafness and disable volume updates while spectating if (["ace_hearing"] call EFUNC(common,isModLoaded)) then { EGVAR(hearing,disableVolumeUpdate) = _set; EGVAR(hearing,deafnessDV) = 0; }; + +// Toggle spectator mode in 3rd party radio addons 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}; if (_set) then { - // Initalize camera variables - GVAR(camBoom) = 0; - GVAR(camDolly) = [0,0]; - GVAR(camGun) = false; + // Initalize the camera + [true] call FUNC(cam); - // Initalize display variables - GVAR(ctrlKey) = false; - GVAR(heldKeys) = []; - GVAR(heldKeys) resize 255; - GVAR(mouse) = [false,false]; - GVAR(mousePos) = [0.5,0.5]; - - // Update units before opening to support pre-set camera unit - [] call FUNC(updateUnits); - - // Initalize the camera objects - GVAR(freeCamera) = "Camera" camCreate (ASLtoATL GVAR(camPos)); - GVAR(unitCamera) = "Camera" camCreate [0,0,0]; - GVAR(targetCamera) = "Camera" camCreate [0,0,0]; - - // Initalize view - GVAR(unitCamera) camSetTarget GVAR(targetCamera); - GVAR(unitCamera) camCommit 0; - [] call FUNC(transitionCamera); + // Create the display when main display is ready + [{ !isNull MAIN_DISPLAY },{ [true] call FUNC(ui) }] call CBA_fnc_waitUntilAndExecute; // Cache current channel to switch back to on exit GVAR(channelCache) = currentChannel; @@ -70,35 +67,6 @@ if (_set) then { GVAR(channel) radioChannelAdd [player]; setCurrentChannel (5 + GVAR(channel)); - // Close map and clear the chat - openMap [false,false]; - clearRadio; - enableRadio false; - - // Disable BI damage effects - BIS_fnc_feedback_allowPP = false; - - // Close any open dialogs - while {dialog} do { - closeDialog 0; - }; - - [{ - disableSerialization; - // Create the display - _display = (findDisplay 46) createDisplay QGVAR(interface); - - // If not forced, make esc end spectator - if (_this) then { - _display displayAddEventHandler ["KeyDown", { - if (_this select 1 == 1) then { - [false] call FUNC(setSpectator); - true - }; - }]; - }; - }, !_force] call CBA_fnc_execNextFrame; - // Cache and disable nametag settings if (["ace_nametags"] call EFUNC(common,isModLoaded)) then { GVAR(nametagSettingCache) = [EGVAR(nametags,showPlayerNames), EGVAR(nametags,showNamesForAI)]; @@ -106,19 +74,14 @@ if (_set) then { EGVAR(nametags,showNamesForAI) = false; }; } else { - // Close any open dialogs (could be interrupts) - while {dialog} do { - closeDialog 0; - }; + // Kill the display (ensure main display exists, handles edge case where spectator turned off beforehand) + [{ !isNull MAIN_DISPLAY },{ [false] call FUNC(ui) }] call CBA_fnc_waitUntilAndExecute; - // Kill the display - (GETUVAR(GVAR(interface),displayNull)) closeDisplay 0; + // This variable doesn't matter anymore + GVAR(uiForced) = nil; // Terminate camera - GVAR(freeCamera) cameraEffect ["terminate", "back"]; - camDestroy GVAR(freeCamera); - camDestroy GVAR(unitCamera); - camDestroy GVAR(targetCamera); + [false] call FUNC(cam); // Remove from spectator chat GVAR(channel) radioChannelRemove [player]; @@ -127,35 +90,6 @@ if (_set) then { setCurrentChannel GVAR(channelCache); GVAR(channelCache) = nil; - // Clear any residual spectator chat - clearRadio; - enableRadio true; - - // Return to player view - player switchCamera "internal"; - - // Enable BI damage effects - BIS_fnc_feedback_allowPP = true; - - // Cleanup camera variables - GVAR(camBoom) = nil; - GVAR(camDolly) = nil; - GVAR(camGun) = nil; - GVAR(freeCamera) = nil; - GVAR(unitCamera) = nil; - GVAR(targetCamera) = nil; - - //Kill these PFEH handlers now because the PFEH can run before the `onunload` event is handled - GVAR(camHandler) = nil; - GVAR(compHandler) = nil; - GVAR(toolHandler) = nil; - - // Cleanup display variables - GVAR(ctrlKey) = nil; - GVAR(heldKeys) = nil; - GVAR(mouse) = nil; - GVAR(mousePos) = nil; - // Reset nametag settings if (["ace_nametags"] call EFUNC(common,isModLoaded)) then { EGVAR(nametags,showPlayerNames) = GVAR(nametagSettingCache) select 0; @@ -164,10 +98,32 @@ if (_set) then { }; }; +// Hide/Unhide the player if enabled and alive +if (alive player) then { + private _hidden = (_hide && _set); + + // Ignore damage (vanilla and ace_medical) + player allowDamage !_hidden; + player setVariable [QEGVAR(medical,allowDamage), !_hidden]; + + // Move to/from group as appropriate + [player, _hidden, QGVAR(isSet), side group player] call EFUNC(common,switchToGroupSide); + + // Ghosts can't talk + if (_hidden) then { + [player, QGVAR(isSet)] call EFUNC(common,hideUnit); + [player, QGVAR(isSet)] call EFUNC(common,muteUnit); + } else { + [player, QGVAR(isSet)] call EFUNC(common,unhideUnit); + [player, QGVAR(isSet)] call EFUNC(common,unmuteUnit); + }; +}; + // Reset interruptions GVAR(interrupts) = []; // Mark spectator state for reference GVAR(isSet) = _set; +player setVariable [QGVAR(isSet), _set, true]; -["ace_spectatorSet", [_set]] call CBA_fnc_localEvent; +["ace_spectatorSet", [_set, player]] call CBA_fnc_globalEvent; diff --git a/addons/spectator/functions/fnc_stageSpectator.sqf b/addons/spectator/functions/fnc_stageSpectator.sqf index a7cc926d33..86b67f2f88 100644 --- a/addons/spectator/functions/fnc_stageSpectator.sqf +++ b/addons/spectator/functions/fnc_stageSpectator.sqf @@ -1,26 +1,27 @@ /* * Author: SilentSpike - * Sets target unit to the given spectator state (physically) - * To virtually handle a spectator see ace_spectator_fnc_setSpectator + * Stores and hides a player safely out of the way (used by setSpectator on living players) * * Units will be gathered at marker ace_spectator_respawn (or [0,0,0] by default) - * Upon unstage, units will be moved to the position they were in upon staging + * Upon unstage, units will be moved to the position they were in before staging * * Arguments: - * 0: Unit to put into spectator stage (default: player) - * 1: Unit should be staged (default: true) + * 0: Unit to handle + * 1: Stage/Unstage * * Return Value: - * None + * None * * Example: - * [player, false] call ace_spectator_fnc_stageSpectator + * [player, true] call ace_spectator_fnc_stageSpectator * - * Public: Yes + * Public: No */ #include "script_component.hpp" +ACE_DEPRECATED(QFUNC(stageSpectator),"3.12.0",[ARR_2(QFUNC(setSpectator),"'s new 3rd parameter")] joinString ""); + params [["_unit",player,[objNull]], ["_set",true,[true]]]; // No change, no service (but allow spectators to be reset) @@ -39,20 +40,35 @@ _unit enableSimulation !_set; if (_set) then { // Position should only be saved on first entry if !(GETVAR(_unit,GVAR(isStaged),false)) then { - GVAR(oldPos) = getPosATL _unit; + SETVAR(_unit,GVAR(preStagePos),getPosATL _unit); + + // Handle players respawning via pause menu (or script) + private _id = _unit addEventHandler ["Respawn",{ + params ["_unit"]; + [_unit] call FUNC(stageSpectator); + }]; + + SETVAR(_unit,GVAR(respawnEH),_id); }; // Ghosts can't talk [_unit, QGVAR(isStaged)] call EFUNC(common,hideUnit); [_unit, QGVAR(isStaged)] call EFUNC(common,muteUnit); + // Position defaults to [0,0,0] if marker doesn't exist _unit setPos (markerPos QGVAR(respawn)); } else { // Physical beings can talk [_unit, QGVAR(isStaged)] call EFUNC(common,unhideUnit); [_unit, QGVAR(isStaged)] call EFUNC(common,unmuteUnit); - _unit setPosATL GVAR(oldPos); + // Restore original position and delete stored value + _unit setPosATL (GETVAR(_unit,GVAR(preStagePos),getPosATL _unit)); + SETVAR(_unit,GVAR(preStagePos),nil); + + // Remove the respawn handling + _unit removeEventHandler ["Respawn",GETVAR(_unit,GVAR(respawnEH),-1)]; + SETVAR(_unit,GVAR(respawnEH),nil); }; // Spectators ignore damage (vanilla and ace_medical) @@ -62,17 +78,10 @@ _unit setVariable [QEGVAR(medical,allowDamage), !_set]; // No theoretical change if an existing spectator was reset if !(_set isEqualTo (GETVAR(_unit,GVAR(isStaged),false))) then { // Mark spectator state for reference - _unit setVariable [QGVAR(isStaged), _set, true]; - - ["ace_spectatorStaged", [_set]] call CBA_fnc_localEvent; + _unit setVariable [QGVAR(isStaged), _set]; }; -//BandAid for #2677 - if player in unitList weird before being staged, weird things can happen -if ((player in GVAR(unitList)) || {ACE_player in GVAR(unitList)}) then { - [] call FUNC(updateUnits); //update list now - if (!(isNull (findDisplay 12249))) then {//If display is open now, close it and restart - WARNING("Player in unitList, call ace_spectator_fnc_stageSpectator before ace_spectator_fnc_setSpectator"); - ["fixWeirdList", true] call FUNC(interrupt); - [{["fixWeirdList", false] call FUNC(interrupt);}, []] call CBA_fnc_execNextFrame; - }; +// If display exists already update the entity list to hide player +if !(isNull SPEC_DISPLAY) then { + [] call FUNC(ui_updateListEntities); }; diff --git a/addons/spectator/functions/fnc_switchFocus.sqf b/addons/spectator/functions/fnc_switchFocus.sqf new file mode 100644 index 0000000000..444bd72b6d --- /dev/null +++ b/addons/spectator/functions/fnc_switchFocus.sqf @@ -0,0 +1,31 @@ +/* + * Author: Nelson Duarte, SilentSpike + * Function used to switch to next or previous camera focus + * + * Arguments: + * 0: Next/Prev unit + * + * Return Value: + * None + * + * Example: + * [false] call ace_spectator_fnc_switchFocus + * + * Public: No + */ + +#include "script_component.hpp" + +private _next = param [0, true]; +private _entities = [true] call FUNC(getTargetEntities); +private _focus = GVAR(camFocus); + +// No entities to switch to +if ((_entities isEqualTo []) || (_entities isEqualTo [_focus])) exitWith {}; + +private _index = (_entities find _focus) max 0; + +_index = (_index + ([-1, 1] select _next)) % (count _entities); +if (_index < 0) then { _index = count _entities + _index; }; + +[_entities select _index] call FUNC(setFocus); diff --git a/addons/spectator/functions/fnc_toggleInterface.sqf b/addons/spectator/functions/fnc_toggleInterface.sqf deleted file mode 100644 index 31472702fc..0000000000 --- a/addons/spectator/functions/fnc_toggleInterface.sqf +++ /dev/null @@ -1,82 +0,0 @@ -/* - * Author: SilentSpike - * Correctly handles toggling of spectator interface elements for clean UX - * - * Arguments: - * 0: Display - * 1: Toogle compass - * 2: Toogle help - * 3: Toogle interface - * 4: Toogle map - * 5: Toogle toolbar - * 6: Toogle unit list - * - * Return Value: - * None - * - * Example: - * [_dsiplay, nil, true] call ace_spectator_fnc_toggleInterface - * - * Public: No - */ - -#include "script_component.hpp" - -params ["_display", ["_toggleComp",false], ["_toggleHelp",false], ["_toggleInterface",false], ["_toggleMap",false], ["_toggleTool",false], ["_toggleUnit",false]]; - -private ["_comp","_help","_map","_tool","_unit"]; -_comp = _display displayCtrl IDC_COMP; -_help = _display displayCtrl IDC_HELP; -_map = _display displayCtrl IDC_MAP; -_tool = _display displayCtrl IDC_TOOL; -_unit = _display displayCtrl IDC_UNIT; - -// Map operates outside of interface -GVAR(showMap) = [GVAR(showMap), !GVAR(showMap)] select _toggleMap; -_map ctrlShow GVAR(showMap); - -if (GVAR(showMap)) then { - // When map is shown, temporarily hide interface to stop overlapping - { - _x ctrlShow false; - } forEach [_comp,_help,_tool,_unit]; - - // Centre map on camera/unit upon opening - if (_toggleMap) then { - _map ctrlMapAnimAdd [0, 0.5, [GVAR(camUnit),GVAR(freeCamera)] select (GVAR(camMode) == 0)]; - ctrlMapAnimCommit _map; - }; -} else { - // Can only toggle interface with map minimised - GVAR(showInterface) = [GVAR(showInterface), !GVAR(showInterface)] select _toggleInterface; - - if (GVAR(showInterface)) then { - // Can only toggle interface elements with interface shown - GVAR(showComp) = [GVAR(showComp), !GVAR(showComp)] select _toggleComp; - GVAR(showHelp) = [GVAR(showHelp), !GVAR(showHelp)] select _toggleHelp; - GVAR(showTool) = [GVAR(showTool), !GVAR(showTool)] select _toggleTool; - GVAR(showUnit) = [GVAR(showUnit), !GVAR(showUnit)] select _toggleUnit; - - _comp ctrlShow GVAR(showComp); - _help ctrlShow GVAR(showHelp); - _tool ctrlShow GVAR(showTool); - _unit ctrlShow GVAR(showUnit); - } else { - { - _x ctrlShow false; - } forEach [_comp,_help,_tool,_unit]; - }; -}; - -// Only run PFHs when respective control is shown, otherwise kill -if (ctrlShown _comp) then { - if (isNil QGVAR(compHandler)) then { GVAR(compHandler) = [FUNC(handleCompass), 0, _display] call CBA_fnc_addPerFrameHandler; }; -} else { - GVAR(compHandler) = nil; -}; - -if (ctrlShown _tool) then { - if (isNil QGVAR(toolHandler)) then { GVAR(toolHandler) = [FUNC(handleToolbar), 0, _display] call CBA_fnc_addPerFrameHandler; }; -} else { - GVAR(toolHandler) = nil; -}; diff --git a/addons/spectator/functions/fnc_transitionCamera.sqf b/addons/spectator/functions/fnc_transitionCamera.sqf deleted file mode 100644 index 254dfef131..0000000000 --- a/addons/spectator/functions/fnc_transitionCamera.sqf +++ /dev/null @@ -1,115 +0,0 @@ -/* - * Author: SilentSpike - * Transitions the spectator camera vision/view/unit - * - * Arguments: - * 0: Camera mode - * - 0: Free - * - 1: Internal - * - 2: External - * 1: Camera unit - * 2: Vision mode - * - -2: Normal - * - -1: NV - * - 0: White hot - * - 1: Black hot - * - * Return Value: - * None - * - * Example: - * [0,objNull] call ace_spectator_fnc_transitionCamera - * - * Public: No - */ - -#include "script_component.hpp" - -params [["_newMode",GVAR(camMode)], ["_newUnit",GVAR(camUnit)], ["_newVision",GVAR(camVision)]]; - -// If new mode isn't available then keep current (unless current also isn't) -if !(_newMode in GVAR(availableModes)) then { - _newMode = GVAR(availableModes) select ((GVAR(availableModes) find GVAR(camMode)) max 0); -}; - -// When no units available to spectate, exit to freecam -if ((GVAR(unitList) isEqualTo []) && (alive _newUnit || isNull _newUnit)) then { - _newMode = 0; - _newUnit = objNull; -}; - -// Reset gun cam if not internal -if (_newMode != 1) then { - GVAR(camGun) = false; -}; - -private ["_camera"]; -if (_newMode == 0) then { // Free - _camera = GVAR(freeCamera); - - // Preserve camUnit value for consistency when manually changing view - _camera cameraEffect ["internal", "back"]; - - // Apply the camera zoom - _camera camSetFov -(linearConversion [0.01,2,GVAR(camZoom),-2,-0.01,true]); - _camera camCommit 0; - - // Agent is switched to in free cam to hide death table and prevent AI chat while allowing icons to draw (also prevents systemChat and unit HUD) - // (Why is so much stuff tied into the current camera unit BI?!) - if (isNull GVAR(camAgent)) then { - GVAR(camAgent) = createAgent ["VirtualMan_F",markerPos QGVAR(respawn),[],0,""]; - }; - - GVAR(camAgent) switchCamera "internal"; -} else { - _camera = GVAR(unitCamera); - - // When null unit is given choose random - if (isNull _newUnit) then { - _newUnit = selectRandom GVAR(unitList); - }; - - // Switch camera view to internal unit view (external uses the camera) - if (GVAR(camGun)) then { - _newUnit switchCamera "gunner"; - } else { - _newUnit switchCamera "internal"; - }; - - // Handle camera differently for internal/external view - if (_newMode == 1) then { - // Terminate camera view - _camera cameraEffect ["terminate", "back"]; - GVAR(camHandler) = nil; - } else { - // Switch to the camera - _camera cameraEffect ["internal", "back"]; - }; - - 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_ui.sqf b/addons/spectator/functions/fnc_ui.sqf new file mode 100644 index 0000000000..69ee454d8b --- /dev/null +++ b/addons/spectator/functions/fnc_ui.sqf @@ -0,0 +1,136 @@ +/* + * Author: SilentSpike + * Handles UI initialisation and destruction + * + * Arguments: + * 0: Init/Terminate + * + * Return Value: + * None + * + * Example: + * [false] call ace_spectator_fnc_ui + * + * Public: No + */ + +#include "script_component.hpp" + +params ["_init"]; + +// No change +if (_init isEqualTo !isNull SPEC_DISPLAY) exitWith {}; + +// Close map +openMap [false,false]; + +// Close any open dialogs +while {dialog} do { + closeDialog 0; +}; + +// Note that init and destroy intentionally happen in reverse order +// Init: Vars > Display > UI Stuff +// Destroy: UI Stuff > Display > Vars +if (_init) then { + // UI visibility tracking + GVAR(uiVisible) = true; + GVAR(uiHelpVisible) = true; + GVAR(uiMapVisible) = true; + GVAR(uiWidgetVisible) = true; + + // Drawing related + GVAR(drawProjectiles) = false; + GVAR(drawUnits) = true; + GVAR(entitiesToDraw) = []; + GVAR(grenadesToDraw) = []; + GVAR(iconsToDraw) = []; + GVAR(projectilesToDraw) = []; + + // RMB tracking is used for follow camera mode + GVAR(holdingRMB) = false; + + // Highlighted map object is used for click and drawing events + GVAR(uiMapHighlighted) = objNull; + + // Holds the current list data + GVAR(curList) = []; + + // Cache view distance and set spectator default + GVAR(oldViewDistance) = viewDistance; + setViewDistance DEFAULT_VIEW_DISTANCE; + + // If counter already exists handle it, otherwise display XEH will handle it + [GETUVAR(RscRespawnCounter,displayNull)] call FUNC(compat_counter); + + // Create the display + MAIN_DISPLAY createDisplay QGVAR(display); + + // Store default H value for scaling purposes + GVAR(uiHelpH) = (ctrlPosition CTRL_HELP) select 3; + + // Initially hide map + [] call FUNC(ui_toggleMap); + + // Initially fade the list + [true] call FUNC(ui_fadeList); + + // Initalise the help, widget and list information + [] call FUNC(ui_updateCamButtons); + [] call FUNC(ui_updateListEntities); + [] call FUNC(ui_updateListFocus); + [] call FUNC(ui_updateWidget); + [] call FUNC(ui_updateHelp); + + // Start updating things to draw + GVAR(collectPFH) = [LINKFUNC(ui_updateIconsToDraw), 0.2] call CBA_fnc_addPerFrameHandler; + + // Draw icons and update the cursor object + GVAR(uiDraw3D) = addMissionEventHandler ["Draw3D", {call FUNC(ui_draw3D)}]; + + // Periodically update list and focus widget + GVAR(uiPFH) = [{ + [] call FUNC(ui_updateListEntities); + [] call FUNC(ui_updateWidget); + }, 5] call CBA_fnc_addPerFrameHandler; +} else { + // Stop updating the list and focus widget + [GVAR(uiPFH)] call CBA_fnc_removePerFrameHandler; + GVAR(uiPFH) = nil; + + // Stop drawing icons and tracking cursor object + removeMissionEventHandler ["Draw3D", GVAR(uiDraw3D)]; + GVAR(uiDraw3D) = nil; + + // Stop updating things to draw + [GVAR(collectPFH)] call CBA_fnc_removePerFrameHandler; + GVAR(collectPFH) = nil; + + // Destroy the display + SPEC_DISPLAY closeDisplay 1; + + // Stop tracking everything + GVAR(uiVisible) = nil; + GVAR(uiHelpVisible) = nil; + GVAR(uiMapVisible) = nil; + GVAR(uiWidgetVisible) = nil; + GVAR(holdingRMB) = nil; + GVAR(uiMapHighlighted) = nil; + GVAR(curList) = nil; + GVAR(uiHelpH) = nil; + + // Stop drawing + GVAR(drawProjectiles) = nil; + GVAR(drawUnits) = nil; + GVAR(entitiesToDraw) = nil; + GVAR(grenadesToDraw) = nil; + GVAR(iconsToDraw) = nil; + GVAR(projectilesToDraw) = nil; + + // Reset view distance + setViewDistance GVAR(oldViewDistance); + GVAR(oldViewDistance) = nil; + + // Ensure chat is shown again + showChat true; +}; diff --git a/addons/spectator/functions/fnc_ui_draw3D.sqf b/addons/spectator/functions/fnc_ui_draw3D.sqf new file mode 100644 index 0000000000..185d8f9dd9 --- /dev/null +++ b/addons/spectator/functions/fnc_ui_draw3D.sqf @@ -0,0 +1,148 @@ +/* + * Author: Nelson Duarte, AACO, SilentSpike + * Function used to draw the 3D icons and track the cursor object + * + * Arguments: + * None + * + * Return Value: + * None + * + * Example: + * addMissionEventHandler ["Draw3D", {call ace_spectator_fnc_ui_draw3D}] + * + * Public: No + */ + +#include "script_component.hpp" +#define HEIGHT_OFFSET 1.5 + +BEGIN_COUNTER(updateCursor); +private _camTarget = GVAR(camFocus); +private _camTargetVeh = vehicle _camTarget; +private _cursorObject = objNull; + +// This doesn't work for units underwater due to use of screenToWorld +// Would be hard to work around due to parallax +private _start = AGLToASL positionCameraToWorld [0,0,0]; +private _end = AGLToASL screenToWorld getMousePosition; + +// Can only select units within name drawing distance +if ((_start distanceSqr _end) <= DISTANCE_NAMES_SQR) then { + private _intersections = lineIntersectsSurfaces [_start, _end, _camTarget, _camTargetVeh]; + + if !(_intersections isEqualTo []) then { + _cursorObject = effectiveCommander ((_intersections select 0) select 3); + }; +}; + +GVAR(cursorObject) = _cursorObject; +END_COUNTER(updateCursor); + +if !(GVAR(uiMapVisible)) then { + if (GVAR(drawUnits)) then { + BEGIN_COUNTER(drawTags); + // Groups and Units + { + _x params ["_unit", "_type", "_icon"]; + private _position = (_unit modelToWorldVisual (_unit selectionPosition "Head")) vectorAdd [0,0,HEIGHT_OFFSET]; + + // Cursor object is always effectiveCommander so no need to check `in` + if (_type == 2 && {_unit in _camTargetVeh || _unit == _cursorObject}) then { + drawIcon3D [ + ICON_BACKGROUND_UNIT, + [0, 0, 0, [0.4, 0.8] select (_unit in _camTargetVeh)], + _position, + 5, + 4, + 0, + "", + 0, + 0.035, + "PuristaMedium", + "center" + ]; + }; + + // Apply modifiers + if (_type == 1 && { time <= GETVAR(_unit,GVAR(highlightTime),0) }) then { + _icon set [1, [1,1,1, ((_icon select 1) select 3)]]; + }; + _icon set [2, _position]; + + // Draw icon + drawIcon3D _icon; + + nil // Speed loop + } count GVAR(iconsToDraw); + END_COUNTER(drawTags); + }; + + // Draw projectiles and grenades paths + if (GVAR(drawProjectiles)) then { + BEGIN_COUNTER(drawTracers); + private _projectilesNew = []; + private _grenadesNew = []; + + // Draw projectiles if there are any + { + _x params [ + ["_projectile", objNull, [objNull]], + ["_segments", [], [[]]] + ]; + + if !(isNull _projectile) then { + // Store new segment + private _newestIndex = _segments pushBack [ + getPosVisual _projectile, + (vectorMagnitude velocity _projectile) call { + if (_this < 250) exitWith { [0,0,1,1] }; + if (_this < 500) exitWith { [0,1,0,1] }; + [1,0,0,1] + } + ]; + + // Clamp number of segments to be drawn + if (_newestIndex > MAX_PROJECTILE_SEGMENTS) then { + _segments deleteAt 0; + DEC(_newestIndex); + }; + + // Store projectiles for next frame + _projectilesNew pushBack [_projectile, _segments]; + + // Draw all projectile segments + private _oldLoc = []; + { + _x params ["_locNew", "_colorNew"]; + if !(_oldLoc isEqualTo []) then { + drawLine3D [_oldLoc, _locNew, _colorNew]; + }; + _oldLoc = _locNew; + + nil // Speed loop + } count _segments; + }; + + nil // Speed loop + } count GVAR(projectilesToDraw); + GVAR(projectilesToDraw) = _projectilesNew; + + { + if !(isNull _x) then { + private _grenadeVelocityMagnitude = vectorMagnitude velocity _x; + + // Draw grenade (rotate icon to represent spinning) + drawIcon3D [ICON_GRENADE, [1,0,0,1], getPosVisual _x, 0.6, 0.6, if (_grenadeVelocityMagnitude > 0) then { time * 100 * _grenadeVelocityMagnitude } else { 0 }, "", 0, 0.05, "TahomaB"]; + + // Store grenade for next frame + _grenadesNew pushBack _x; + }; + + nil // Speed loop + } count GVAR(grenadesToDraw); + + GVAR(grenadesToDraw) = _grenadesNew; + END_COUNTER(drawTracers); + }; +}; diff --git a/addons/spectator/functions/fnc_ui_fadeList.sqf b/addons/spectator/functions/fnc_ui_fadeList.sqf new file mode 100644 index 0000000000..dbc5344228 --- /dev/null +++ b/addons/spectator/functions/fnc_ui_fadeList.sqf @@ -0,0 +1,50 @@ +/* + * Author: Nelson Duarte, AACO + * Function used to fade/unfade the entitiy list + * + * Arguments: + * 0: Fade the list + * + * Return Value: + * None + * + * Example: + * [false] call ace_spectator_fnc_ui_fadeList + * + * Public: No + */ + +#include "script_component.hpp" + +params ["_fadeList"]; + +if (GVAR(uiVisible)) then { + private _list = CTRL_LIST; + private _tabs = CTRL_TABS; + + if (_fadeList) then { + _list ctrlSetBackgroundColor [0,0,0,0]; + _list ctrlSetFade 0.8; + + _tabs ctrlSetBackgroundColor [0,0,0,0]; + _tabs ctrlSetFade 0.5; + + ctrlSetFocus CTRL_MOUSE; + + showChat true; + } else { + _list ctrlSetBackgroundColor [0,0,0,0.75]; + _list ctrlSetFade 0; + + _tabs ctrlSetBackgroundColor [0,0,0,0.25]; + _tabs ctrlSetFade 0; + + ctrlSetFocus _list; + + // List overlaps with chat + showChat false; + }; + + _list ctrlCommit 0.2; + _tabs ctrlCommit 0.2; +}; diff --git a/addons/spectator/functions/fnc_ui_getTreeDataIndex.sqf b/addons/spectator/functions/fnc_ui_getTreeDataIndex.sqf new file mode 100644 index 0000000000..529751a09f --- /dev/null +++ b/addons/spectator/functions/fnc_ui_getTreeDataIndex.sqf @@ -0,0 +1,44 @@ +/* + * Author: Nelson Duarte, AACO + * Function used to find the tree path of an entity + * + * Arguments: + * 0: Data to search tree for + * + * Return Value: + * Tree path to data + * + * Example: + * [groupID _group] call ace_spectator_fnc_ui_getTreeDataIndex + * + * Public: No + */ + +#include "script_component.hpp" + +params [["_data", "", [""]]]; + +scopeName QGVAR(getTreeDataIndex); + +// Make sure data is not empty +if (_data != "") then { + private _ctrl = CTRL_LIST; + + for "_sideIndex" from 0 to ((_ctrl tvCount []) - 1) do { + if (_ctrl tvData [_sideIndex] == _data) then { + [_sideIndex] breakOut QGVAR(getTreeDataIndex); + }; + for "_groupIndex" from 0 to ((_ctrl tvCount [_sideIndex]) - 1) do { + if (_ctrl tvData [_sideIndex, _groupIndex] == _data) then { + [_sideIndex, _groupIndex] breakOut QGVAR(getTreeDataIndex); + }; + for "_unitIndex" from 0 to ((_ctrl tvCount [_sideIndex, _groupIndex]) - 1) do { + if (_ctrl tvData [_sideIndex, _groupIndex, _unitIndex] == _data) then { + [_sideIndex, _groupIndex, _unitIndex] breakOut QGVAR(getTreeDataIndex); + }; + }; + }; + }; +}; + +[-1] // return empty path if not found (worst case) diff --git a/addons/spectator/functions/fnc_ui_handleChildDestroyed.sqf b/addons/spectator/functions/fnc_ui_handleChildDestroyed.sqf new file mode 100644 index 0000000000..f2dcab47ef --- /dev/null +++ b/addons/spectator/functions/fnc_ui_handleChildDestroyed.sqf @@ -0,0 +1,28 @@ +/* + * Author: Nelson Duarte + * Function used to handle child destroyed event + * This only matters when abort button is pressed in child escape menu + * Will close main display to exit client from mission + * + * Arguments: + * 0: Spectator display + * 1: Child display + * 2: Exit code of child + * + * Return Value: + * None + * + * Example: + * _this call ace_spectator_fnc_ui_handleChildDestroyed + * + * Public: No + */ + +#include "script_component.hpp" + +params ["_display","_child","_exitCode"]; + +if (_exitCode == 104) then { + _display closeDisplay 2; + MAIN_DISPLAY closeDisplay 2; +}; diff --git a/addons/spectator/functions/fnc_ui_handleKeyDown.sqf b/addons/spectator/functions/fnc_ui_handleKeyDown.sqf new file mode 100644 index 0000000000..696ba2e652 --- /dev/null +++ b/addons/spectator/functions/fnc_ui_handleKeyDown.sqf @@ -0,0 +1,209 @@ +/* + * Author: Nelson Duarte, AACO, SilentSpike + * Function used to handle key down event + * + * Arguments: + * 0: Spectator display + * 1: Key DIK code + * 2: State of shift + * 3: State of ctrl + * 4: State of alt + * + * Return Value: + * None + * + * Example: + * _this call ace_spectator_fnc_ui_handleKeyDown + * + * Public: No + */ + +#include "script_component.hpp" +#include "\A3\ui_f\hpp\defineDIKCodes.inc" + +params ["","_key","_shift","_ctrl","_alt"]; + +// Handle map toggle +if (_key == DIK_M) exitWith { + [] call FUNC(ui_toggleMap); + true +}; + +// Handle very fast speed +if (_key == DIK_LALT) exitWith { + [true] call FUNC(cam_toggleSlow); + true +}; + +// Handle escape menu +if (_key == DIK_ESCAPE) exitWith { + if (GVAR(uiMapVisible)) then { + [] call FUNC(ui_toggleMap); + } else { + if (GVAR(uiForced)) then { + private _displayType = ["RscDisplayInterrupt","RscDisplayMPInterrupt"] select isMultiplayer; + SPEC_DISPLAY createDisplay _displayType; + } else { + [false] call FUNC(setSpectator); + }; + }; + true +}; + +// Handle perspective cycling +if (_key in [DIK_SPACE, DIK_NUMPADENTER]) exitWith { + private _oldMode = GVAR(camMode); + private _modes = GVAR(availableModes); + + // Get current index and index count + private _iMode = (_modes find _oldMode) max 0; + private _countModes = count _modes; + + if (_countModes != 0) then { + _iMode = (_iMode + 1) % _countModes; + if (_iMode < 0) then { _iMode = _countModes + _iMode; }; + }; + + private _newMode = _modes select _iMode; + + [_newMode] call FUNC(cam_setCameraMode); + + true +}; + +// Handle vision mode cycling +if (_key == DIK_N) exitWith { + private _oldVision = GVAR(camVision); + private _visions = GVAR(availableVisions); + + // Get current index and index count + private _iVision = (_visions find _oldVision) max 0; + private _countVisions = count _visions; + + if (_countVisions != 0) then { + _iVision = (_iVision + 1) % _countVisions; + if (_iVision < 0) then { _iVision = _countVisions + _iVision; }; + }; + + private _newVision = _visions select _iVision; + + [_newVision] call FUNC(cam_setVisionMode); + true +}; + +// Handle postive change in draw +if (_key == DIK_PGUP) exitWith { + setViewDistance ((viewDistance + 250) min MAX_VIEW_DISTANCE); + true +}; + +// Handle negative change in draw +if (_key == DIK_PGDN) exitWith { + setViewDistance ((viewDistance - 250) max MIN_VIEW_DISTANCE); + true +}; + +// Handle spectate lights +if (_key == DIK_L) exitWith { + if (GVAR(camLight)) then { + { deleteVehicle _x; } forEach GVAR(camLights); + GVAR(camLights) = []; + } else { + private _cameraLight = "#lightpoint" createvehicleLocal getPosASL GVAR(camera); + _cameraLight setLightBrightness 2; + _cameraLight setLightAmbient [1,1,1]; + _cameraLight setLightColor [0,0,0]; + _cameraLight lightAttachObject [GVAR(camera), [0,0,0]]; + + private _pointerLight = "#lightpoint" createvehicleLocal getPosASL GVAR(camera); + _pointerLight setLightBrightness 1; + _pointerLight setLightAmbient [1,1,1]; + _pointerLight setLightColor [0,0,0]; + + GVAR(camLights) = [_cameraLight, _pointerLight]; + }; + + GVAR(camLight) = !GVAR(camLight); + + true +}; + +// Handle toggling the UI +if (_key == DIK_BACKSPACE) exitWith { + [] call FUNC(ui_toggleUI); + true +}; + +// Handle toggling help +if (_key == DIK_F1) exitWith { + GVAR(uiHelpVisible) = !GVAR(uiHelpVisible); + + [] call FUNC(ui_updateHelp); + + CTRL_HELP ctrlShow GVAR(uiHelpVisible); + CTRL_HELP_BACK ctrlShow GVAR(uiHelpVisible); + + true +}; + +// Handle toggle focus info widget +if (_key == DIK_I) exitWith { + GVAR(uiWidgetVisible) = !GVAR(uiWidgetVisible); + [] call FUNC(ui_updateWidget); + true +}; + +// Handle toggling projectile drawing +if (_key == DIK_P) exitWith { + GVAR(drawProjectiles) = !GVAR(drawProjectiles); + true +}; + +// Handle toggling unit drawing +if (_key == DIK_O) exitWith { + GVAR(drawUnits) = !GVAR(drawUnits); + true +}; + +// Handle getting next focus target +if (_key == DIK_RIGHT) exitWith { + [true] call FUNC(switchFocus); + true +}; + +// Handle getting previous focus target +if (_key == DIK_LEFT) exitWith { + [false] call FUNC(switchFocus); + true +}; + +// If the zeus key is pressed and unit is curator, open zeus interface +if ((_key in (actionKeys "CuratorInterface")) && {!isNull (getAssignedCuratorLogic player)}) exitWith { + // Close the UI and disable camera input + [false] call FUNC(ui); + GVAR(camera) camCommand "manual off"; + + // Display XEH handles re-opening + openCuratorInterface; + + // Set the curator camera to the spectator camera location + [{!isNull curatorCamera},{ + curatorCamera setPosASL (getPosASL GVAR(camera)); + curatorCamera setDir (getDirVisual GVAR(camera)); + + // Curator tracks its own vision mode + [getAssignedCuratorLogic player, 0] call bis_fnc_toggleCuratorVisionMode; + }] call CBA_fnc_waitUntilAndExecute; + true +}; + +// Handle acre spectate headset down (if present) +if ( + ["acre_sys_radio"] call EFUNC(common,isModLoaded) && + { [_key, [_shift, _ctrl, _alt]] isEqualTo ((["ACRE2", "HeadSet"] call CBA_fnc_getKeybind) select 5) } +) exitWith { + [] call acre_sys_core_fnc_toggleHeadset; + true +}; + +false // default to unhandled diff --git a/addons/spectator/functions/fnc_ui_handleKeyUp.sqf b/addons/spectator/functions/fnc_ui_handleKeyUp.sqf new file mode 100644 index 0000000000..672f2f7bb8 --- /dev/null +++ b/addons/spectator/functions/fnc_ui_handleKeyUp.sqf @@ -0,0 +1,31 @@ +/* + * Author: Nelson Duarte, SilentSpike + * Function used to handle key up event + * + * Arguments: + * 0: Spectator display + * 1: Key DIK code + * 2: State of shift + * 3: State of ctrl + * 4: State of alt + * + * Return Value: + * None + * + * Example: + * _this call ace_spectator_fnc_ui_handleKeyUp + * + * Public: No + */ + +#include "script_component.hpp" +#include "\A3\ui_f\hpp\defineDIKCodes.inc" + +params ["","_key","_shift","_ctrl","_alt"]; + +if (_key == DIK_LALT) exitWith { + [false] call FUNC(cam_toggleSlow); + true +}; + +false diff --git a/addons/spectator/functions/fnc_ui_handleListClick.sqf b/addons/spectator/functions/fnc_ui_handleListClick.sqf new file mode 100644 index 0000000000..9616e77cac --- /dev/null +++ b/addons/spectator/functions/fnc_ui_handleListClick.sqf @@ -0,0 +1,56 @@ +/* + * Author: Nelson Duarte, AACO, SilentSpike + * Function used to handle list single/double clicks + * + * Expected behaviour: + * Clicking an entry focuses the camera on it (any camera mode) + * Double clicking an entry teleports the free camera nearby and focuses on it + * + * Arguments: + * 0: Double clicked + * 1: List Click EH's _this + * + * Return Value: + * None + * + * Example: + * [false, _this] call ace_spectator_fnc_ui_handleListClick + * + * Public: No + */ +#include "script_component.hpp" + +params ["_dblClick","_params"]; +_params params ["_list","_index"]; + +private _handled = false; +private _data = _list tvData _index; + +// List contains unique object variables +private _object = missionNamespace getVariable [_data, objNull]; + +if !(isNull _object) then { + if (_dblClick) then { + // Place camera within ~10m of the object and above ground level + private _pos = getPosASLVisual _object; + GVAR(camera) setPosASL (AGLtoASL (_pos getPos [1 + random 10, random 360]) vectorAdd [0,0,2 + random 10]); + + // Reset the focus + [objNull] call FUNC(setFocus); + [_object] call FUNC(setFocus); + + _handled = true; + } else { + if (_object != GVAR(camFocus)) then { + [_object] call FUNC(setFocus); + + _handled = true; + }; + }; +}; + +if (_handled) then { + playSound "ReadoutClick"; +}; + +_handled diff --git a/addons/spectator/functions/fnc_ui_handleMapClick.sqf b/addons/spectator/functions/fnc_ui_handleMapClick.sqf new file mode 100644 index 0000000000..6e74ed0e97 --- /dev/null +++ b/addons/spectator/functions/fnc_ui_handleMapClick.sqf @@ -0,0 +1,40 @@ +/* + * Author: Nelson Duarte, AACO + * Function used to handle map mouse click events + * + * Arguments: + * 0: Map control + * 1: Mouse button pressed + * 2: x screen coordinate clicked + * 3: y screen coordinate clicked + * + * Return Value: + * None + * + * Example: + * _this call ace_spectator_fnc_ui_handleMapClick + * + * Public: No + */ + +#include "script_component.hpp" + +params ["", "", "_x", "_y"]; + +if (isNull GVAR(uiMapHighlighted)) then { + // Give user feedback that camera is no longer focused + if !(isNull GVAR(camFocus)) then { + playSound "ReadoutHideClick1"; + }; + + // Preserve camera height on teleport + private _pos = CTRL_MAP ctrlMapScreenToWorld [_x, _y]; + _pos set [2, (getPosASLVisual GVAR(camera)) select 2]; + + GVAR(camera) setPosASL _pos; +} else { + // Give user feedback that camera is focused on highlighted unit + playSound "ReadoutClick"; +}; + +[GVAR(uiMapHighlighted)] call FUNC(setFocus); diff --git a/addons/spectator/functions/fnc_ui_handleMapDraw.sqf b/addons/spectator/functions/fnc_ui_handleMapDraw.sqf new file mode 100644 index 0000000000..2dee32b58a --- /dev/null +++ b/addons/spectator/functions/fnc_ui_handleMapDraw.sqf @@ -0,0 +1,88 @@ +/* + * Author: Nelson Duarte, AACO + * Function used to handle map draw + * + * Arguments: + * 0: Map control + * + * Return Value: + * None + * + * Example: + * _this call ace_spectator_fnc_ui_handleMapDraw + * + * Public: No + */ + +#include "script_component.hpp" +#define MAP_MIN_ENTITY_DISTANCE 30 + +// Moved timer into map controls group, update here +CTRL_TIME ctrlSetText (["+", [time / 3600] call BIS_fnc_timeToString] joinString ""); + +BEGIN_COUNTER(drawMap); + +params ["_map"]; + +// Track nearest unit +private _loc = _map ctrlMapScreenToWorld getMousePosition; +private _nearestEntity = objNull; +private _minDist = 999999; + +// Draw unit icons +private _handledVehicles = []; +{ + private _dist = _x distance2D _loc; + + if (_dist < _minDist && { _dist < MAP_MIN_ENTITY_DISTANCE }) then { + _minDist = _dist; + _nearestEntity = _x; + }; + + private _vehicle = vehicle _x; + if !(_vehicle in _handledVehicles) then { + _handledVehicles pushBack _vehicle; + + private _vehicleTexture = [_vehicle] call EFUNC(common,getVehicleIcon); + private _sideColor = [side group _vehicle] call BIS_fnc_sideColor; + private _text = ""; + + if (GVAR(uiMapHighlighted) == _vehicle || {GVAR(uiMapHighlighted) in _vehicle}) then { + _text = ([GVAR(uiMapHighlighted)] call EFUNC(common,getName)) select [0, NAME_MAX_CHARACTERS]; + if !(isPlayer GVAR(uiMapHighlighted)) then { _text = format ["%1: %2", localize "str_player_ai", _text]; }; + _sideColor = [0.8, 0.8, 0.5, 1]; + }; + + if (NEEDS_REVIVE(_vehicle)) then { + _vehicleTexture = ICON_REVIVE; + _sideColor = [0.5, 0, 0, 1]; + }; + + if (time <= _vehicle getVariable [QGVAR(highlightTime), 0]) then { + _sideColor = [1, 1, 1, 1]; + }; + + _map drawIcon [_vehicleTexture, _sideColor, getPosASLVisual _vehicle, 24, 24, getDirVisual _vehicle, _text, 1, 0.04, "TahomaB", "right"]; + }; + nil // Speed loop +} count ([] call FUNC(getTargetEntities)); + +// Set highlighted unit +private _text = if (isNull _nearestEntity) then { + "" +} else { + format ["%1 [%2 m]", [_nearestEntity] call EFUNC(common,getName), round (_nearestEntity distance2D GVAR(camera))] +}; + +GVAR(uiMapHighlighted) = _nearestEntity; +CTRL_MAP_FOOTER ctrlSetText _text; + +// Draw camera icon +if !(isNil QGVAR(camera)) then { + private _cameraPos = getPosASLVisual GVAR(camera); + private _cameraDir = getDirVisual GVAR(camera); + _map drawIcon [ICON_CAMERA, [0.5, 1, 0.5, 1], _cameraPos, 32, 48, _cameraDir, "", 1, 0.05, "TahomaB", "right"]; + _map drawArrow [_cameraPos, (_cameraPos getPos [300, _cameraDir]), [0.5, 1, 0.5, 1]]; +}; + +END_COUNTER(drawMap); diff --git a/addons/spectator/functions/fnc_ui_handleMouseButtonDblClick.sqf b/addons/spectator/functions/fnc_ui_handleMouseButtonDblClick.sqf new file mode 100644 index 0000000000..f880daf81b --- /dev/null +++ b/addons/spectator/functions/fnc_ui_handleMouseButtonDblClick.sqf @@ -0,0 +1,27 @@ +/* + * Author: Nelson Duarte, AACO, SilentSpike + * Function used to handle mouse button double clicks + * + * Expected behaviour: + * Double left click teleports free camera toward the unit, but does not focus + * + * Arguments: + * 0: Control + * 1: Mouse button pressed + * + * Return Value: + * None + * + * Example: + * _this call ace_spectator_fnc_ui_handleMouseButtonDblClick + * + * Public: No + */ + +#include "script_component.hpp" + +params ["", "_button"]; + +if (_button == 0 && {!isNull GVAR(cursorObject)}) then { + [GVAR(cursorObject)] call FUNC(cam_prepareTarget); +}; diff --git a/addons/spectator/functions/fnc_ui_handleMouseButtonDown.sqf b/addons/spectator/functions/fnc_ui_handleMouseButtonDown.sqf new file mode 100644 index 0000000000..a6bb64d744 --- /dev/null +++ b/addons/spectator/functions/fnc_ui_handleMouseButtonDown.sqf @@ -0,0 +1,52 @@ +/* + * Author: Nelson Duarte, AACO, SilentSpike + * Function used to handle mouse down event + * + * Expected behaviour: + * Left clicking a unit focuses the camera on that unit (in any camera mode) + * Left clicking empty space removes the current camera focus in free camera + * Right clicking removes the camera lock, but retains the focus in free camera + * Right clicking and dragging orbits around the unit in follow camera + * + * Arguments: + * 0: Control + * 1: Mouse button pressed + * + * Return Value: + * None + * + * Example: + * _this call ace_spectator_fnc_ui_handleMouseButtonDown + * + * Public: No + */ + +#include "script_component.hpp" + +params ["", "_button"]; + +// Left click +if (_button == 0) exitWith { + if (isNull GVAR(cursorObject)) then { + if (GVAR(camMode) == MODE_FREE && { !isNull GVAR(camFocus) }) then { + playSound "ReadoutHideClick1"; + [objNull] call FUNC(setFocus); + }; + } else { + if (GVAR(cursorObject) in ([] call FUNC(getTargetEntities))) then { + playSound "ReadoutClick"; + + // Focus will be at screen center + [GVAR(cursorObject)] call FUNC(setFocus); + setMousePosition [0.5, 0.5]; + }; + }; +}; + +// Right click +if (_button == 1) then { + if (GVAR(camMode) == MODE_FREE && { !isNull GVAR(camFocus) } && { !isNull (attachedTo GVAR(camDummy)) }) then { + [] call FUNC(cam_resetTarget); + }; + GVAR(holdingRMB) = true; +}; diff --git a/addons/spectator/functions/fnc_ui_handleMouseMoving.sqf b/addons/spectator/functions/fnc_ui_handleMouseMoving.sqf new file mode 100644 index 0000000000..af3f1ede62 --- /dev/null +++ b/addons/spectator/functions/fnc_ui_handleMouseMoving.sqf @@ -0,0 +1,31 @@ +/* + * Author: Nelson Duarte, AACO + * Function used to handle mouse moving event + * + * Arguments: + * 0: Control + * 1: Change in x + * 2: Change in y + * + * Return Value: + * None + * + * Example: + * _this call ace_spectator_fnc_ui_handleMouseMoving + * + * Public: No + */ + +#include "script_component.hpp" + +if (GVAR(holdingRMB) && { GVAR(camMode) == MODE_FOLLOW }) then { + params ["", "_deltaX", "_deltaY"]; + + if (_deltaX != 0) then { + GVAR(camYaw) = ((GVAR(camYaw) + (_deltaX * 100 * GVAR(camDeltaTime)) + 180) % 360) - 180; + }; + + if (_deltaY != 0) then { + GVAR(camPitch) = (((GVAR(camPitch) - (_deltaY * 100 * GVAR(camDeltaTime))) max -90) min 90); + }; +}; diff --git a/addons/spectator/functions/fnc_ui_handleMouseZChanged.sqf b/addons/spectator/functions/fnc_ui_handleMouseZChanged.sqf new file mode 100644 index 0000000000..5e54cb8b72 --- /dev/null +++ b/addons/spectator/functions/fnc_ui_handleMouseZChanged.sqf @@ -0,0 +1,27 @@ +/* + * Author: Nelson Duarte, AACO + * Function used to handle mouse scroll event + * + * Arguments: + * 0: Control + * 1: Change in Z + * + * Return Value: + * None + * + * Example: + * _this call ace_spectator_fnc_ui_handleMouseZChanged + * + * Public: No + */ + +#include "script_component.hpp" +#define FOLLOW_CAMERA_MAX_DISTANCE 5 + +if (GVAR(camMode) == MODE_FOLLOW) then { + if ((_this select 1) > 0) then { + GVAR(camDistance) = (GVAR(camDistance) - 1) max 0; + } else { + GVAR(camDistance) = (GVAR(camDistance) + 1) min FOLLOW_CAMERA_MAX_DISTANCE; + }; +}; diff --git a/addons/spectator/functions/fnc_ui_toggleMap.sqf b/addons/spectator/functions/fnc_ui_toggleMap.sqf new file mode 100644 index 0000000000..2970ed65d6 --- /dev/null +++ b/addons/spectator/functions/fnc_ui_toggleMap.sqf @@ -0,0 +1,46 @@ +/* + * Author: Nelson Duarte, AACO + * Function used to toggle the map + * + * Arguments: + * None + * + * Return Value: + * None + * + * Example: + * [] call ace_spectator_fnc_ui_toggleMap + * + * Public: No + */ + +#include "script_component.hpp" + +if (GVAR(uiMapVisible)) then { + CTRL_MAP ctrlShow false; + CTRL_MAP_GROUP ctrlShow false; + + ctrlSetFocus CTRL_MOUSE; + + if (GVAR(camMode) == MODE_FREE) then { + GVAR(camera) camCommand "manual on"; + }; +} else { + CTRL_MAP ctrlShow true; + CTRL_MAP_GROUP ctrlShow true; + + CTRL_MAP_TITLE ctrlSetText (getMissionConfigValue ["onLoadName", getMissionConfigValue ["briefingName", localize ELSTRING(common,unknown)]]); + CTRL_MAP_SPEC_NUM ctrlSetText str ({GETVAR(_x,GVAR(isSet),false)} count allPlayers); + + CTRL_MAP ctrlMapAnimAdd [0, 0.05, getPosASLVisual GVAR(camera)]; + ctrlMapAnimCommit CTRL_MAP; + + // Disable camera input while map is open + GVAR(camera) camCommand "manual off"; +}; + +// Toggle the tracking variable +GVAR(uiMapVisible) = !GVAR(uiMapVisible); + +// Reset highlighted object +GVAR(uiMapHighlighted) = objNull; diff --git a/addons/spectator/functions/fnc_ui_toggleUI.sqf b/addons/spectator/functions/fnc_ui_toggleUI.sqf new file mode 100644 index 0000000000..b15e8b1962 --- /dev/null +++ b/addons/spectator/functions/fnc_ui_toggleUI.sqf @@ -0,0 +1,34 @@ +/* + * Author: Nelson Duarte, AACO, SilentSpike + * Function used to toggle the whole user interface + * + * Arguments: + * None + * + * Return Value: + * None + * + * Example: + * [] call ace_spectator_fnc_ui_toggleUI + * + * Public: No + */ + +#include "script_component.hpp" + +private _visible = !GVAR(uiVisible); + +{ + private _fade = 1; + if (_visible) then { + _fade = getNumber (configFile >> QGVAR(display) >> "Controls" >> ctrlClassName _x >> "fade"); + }; + + _x ctrlSetFade _fade; + _x ctrlCommit 0.25; +} forEach [CTRL_LIST, CTRL_TABS, CTRL_CAM_TYPES, CTRL_WIDGET]; + +showChat !_visible; +playSound (["HintExpand","HintCollapse"] select _visible); + +GVAR(uiVisible) = _visible; diff --git a/addons/spectator/functions/fnc_ui_updateCamButtons.sqf b/addons/spectator/functions/fnc_ui_updateCamButtons.sqf new file mode 100644 index 0000000000..d110aac4ea --- /dev/null +++ b/addons/spectator/functions/fnc_ui_updateCamButtons.sqf @@ -0,0 +1,38 @@ +/* + * Author: SilentSpike + * Used to update the docked camera buttons + * Disables unavailable, highlights current + * + * Arguments: + * None + * + * Return Value: + * None + * + * Example: + * [] call ace_spectator_fnc_ui_updateCamButtons + * + * Public: No + */ + +#include "script_component.hpp" + +// These correspond to the camera mode indices +#define ENUM_IDCs [IDC_FREE, IDC_FPS, IDC_FOLLOW] +#define ENUM_ACTIVE [CAM_ICON_FREE_SELECTED, CAM_ICON_FPS_SELECTED, CAM_ICON_FOLLOW_SELECTED] +#define ENUM_INACTIVE [CAM_ICON_FREE, CAM_ICON_FPS, CAM_ICON_FOLLOW] + +private _current = ENUM_IDCs select GVAR(camMode); + +{ + if (_forEachIndex in GVAR(availableModes)) then { + // Highlight the current camera mode button + private _icon = ([ENUM_INACTIVE, ENUM_ACTIVE] select (_x == _current)) select _forEachIndex; + + (CTRL_CAM_TYPES controlsGroupCtrl _x) ctrlSetText _icon; + (CTRL_CAM_TYPES controlsGroupCtrl _x) ctrlShow true; + } else { + // Disable any inactive camera modes + (CTRL_CAM_TYPES controlsGroupCtrl _x) ctrlShow false; + }; +} forEach ENUM_IDCs; diff --git a/addons/spectator/functions/fnc_ui_updateHelp.sqf b/addons/spectator/functions/fnc_ui_updateHelp.sqf new file mode 100644 index 0000000000..74ab2d9a46 --- /dev/null +++ b/addons/spectator/functions/fnc_ui_updateHelp.sqf @@ -0,0 +1,138 @@ +/* + * Author: Nelson Duarte, SilentSpike + * Updates spectator UI help element + * + * Note that there are some redundant conditions in this file + * This is intentional, since controls appear via priority que + * The overhead is minimal + * + * Arguments: + * None + * + * Return Value: + * None + * + * Example: + * [] call ace_spectator_fnc_ui_updateHelp + * + * Public: No + */ + +#include "script_component.hpp" +#include "\A3\ui_f\hpp\defineDIKCodes.inc" +#define MAX_CONTROLS_HELP_ENTRIES 12 + +if !(GVAR(uiHelpVisible)) exitWith {}; + +private _cameraMode = GVAR(camMode); +private _availableModes = GVAR(availableModes); +private _hasTarget = !isNull GVAR(camFocus); + +private _controls = []; + +// When not in first person, camera rotation applies +if (_cameraMode != MODE_FPS) then { + _controls pushback ["[RMB]", localize "STR_A3_Spectator_Helper_CameraRotation"]; +}; + +// When in free camera, focus/un-focus with LMB +if (_cameraMode == MODE_FREE) then { + if (_hasTarget) then { + _controls pushBack ["[LMB]", localize "STR_A3_Spectator_Helper_Unfocus"]; + } else { + _controls pushBack ["[LMB]", localize "STR_A3_Spectator_Helper_Focus"]; + }; +}; + +// When the camera has a focus, switch mode applies (if other modes are available) +if (_hasTarget && {count _availableModes > 1}) then { + _controls pushBack [ + format ["[%1]", toUpper ([DIK_SPACE] call CBA_fnc_localizeKey)], + localize "STR_A3_Spectator_Helper_CameraMode" + ]; +}; + +if (_cameraMode == MODE_FREE) then { + _controls pushback [ + format ["[%1/%2]", [DIK_W] call CBA_fnc_localizeKey, [DIK_S] call CBA_fnc_localizeKey], + localize "STR_A3_Spectator_Helper_Movement" + ]; + _controls pushback [ + format ["[%1/%2]", [DIK_A] call CBA_fnc_localizeKey, [DIK_D] call CBA_fnc_localizeKey], + localize "STR_A3_Spectator_Helper_Strafing" + ]; + _controls pushback [ + format ["[%1/%2]", [DIK_Q] call CBA_fnc_localizeKey, [DIK_Z] call CBA_fnc_localizeKey], + localize "STR_A3_Spectator_Helper_Height" + ]; +} else { + _controls pushback [ + format ["[%1]", toUpper ([DIK_RIGHT] call CBA_fnc_localizeKey)], + localize LSTRING(nextUnit) + ]; + _controls pushback [ + format ["[%1]", toUpper ([DIK_LEFT] call CBA_fnc_localizeKey)], + localize LSTRING(prevUnit) + ]; +}; + +if (_cameraMode != MODE_FPS) then { + _controls pushback [ + format ["[%1]", ([DIK_N] call CBA_fnc_localizeKey)], + localize LSTRING(nextVis) + ]; +}; + +_controls pushBack [ + format ["[%1]", toUpper ([DIK_BACK] call CBA_fnc_localizeKey)], + localize "STR_A3_Spectator_Helper_Interface" +]; +_controls pushBack [ + format ["[%1]", [DIK_F1] call CBA_fnc_localizeKey], + localize "STR_A3_Spectator_Helper_Controls" +]; + +// Too many controls in the UI, leave these out? +// _controls pushBack [ +// format ["[%1]", [DIK_M] call CBA_fnc_localizeKey], +// localize "str_usract_map" +// ]; +// _controls pushBack [ +// format ["[%1]", [DIK_I] call CBA_fnc_localizeKey], +// localize LSTRING(uiIcons) +// ]; +// _controls pushBack [ +// format ["[%1]", [DIK_O] call CBA_fnc_localizeKey], +// localize LSTRING(uiProjectiles) +// ]; + +if (_cameraMode == MODE_FREE) then { + _controls pushBack ["[LSHIFT]", localize "STR_A3_Spectator_Helper_Shift"]; + _controls pushBack ["[LALT]", localize LSTRING(camSlow)]; +}; + +if (count _controls > MAX_CONTROLS_HELP_ENTRIES) then { + _controls resize MAX_CONTROLS_HELP_ENTRIES; +}; + +private _help = CTRL_HELP; + +_help ctrlEnable false; +_help lnbSetColumnsPos [0, 0.45]; +lnbClear _help; + +{ + _help lnbAddRow _x; + _help lnbSetColor [[_forEachIndex, 0], [0.75,0.6,0,1]]; +} forEach _controls; + +// Set height based on number of rows +private _newH = (GVAR(uiHelpH) / MAX_CONTROLS_HELP_ENTRIES) * count _controls; +private _newY = safezoneY + safezoneH - _newH; + +(ctrlPosition _help) params ["_newX","","_newW"]; + +{ + _x ctrlSetPosition [_newX, _newY, _newW, _newH]; + _x ctrlCommit 0.15; +} forEach [CTRL_HELP_BACK, _help]; diff --git a/addons/spectator/functions/fnc_ui_updateIconsToDraw.sqf b/addons/spectator/functions/fnc_ui_updateIconsToDraw.sqf new file mode 100644 index 0000000000..12dcb11af9 --- /dev/null +++ b/addons/spectator/functions/fnc_ui_updateIconsToDraw.sqf @@ -0,0 +1,147 @@ +/* + * Author: Nelson Duarte, AACO, SilentSpike + * Function used update the things to 3D draw + * + * Arguments: + * None + * + * Return Value: + * None + * + * Examples: + * [] call ace_spectator_fnc_ui_updateIconsToDraw + * + * Public: No + */ + +#include "script_component.hpp" + +private _iconsToDraw = []; +private _entitiesToDraw = []; + +// camToWorld is used instead of camera object to account for FPP +private _camPos = AGLToASL positionCameraToWorld [0,0,0]; +{ + private _vehicle = vehicle _x; + private _inVehicle = (_vehicle != _x); + private _distanceToCameraSqr = _camPos distanceSqr _x; + + if (_distanceToCameraSqr <= DISTANCE_ICONS_SQR && { !_inVehicle || { _x == effectiveCommander _vehicle } }) then { + private _group = group _x; + private _isLeader = _x == leader _group; + private _groupColor = [side _group] call BIS_fnc_sideColor; + + // Calculate distance fade + (_distanceToCameraSqr call { + if (_this <= 250000) exitWith { // 500^2 + [1, 4, -2.5, 0.04] + }; + if (_this <= 1000000) exitWith { // 1000^2 + [0.75, 3.5, -2.2, 0.035] + }; + if (_this <= 2250000) exitWith { // 1500^2 + [0.5, 3, -1.9, 0.03] + }; + if (_this <= 4000000) exitWith { // 2000^2 + [0.3, 2.5, -1.6, 0.025] + }; + if (_this <= 6250000) exitWith { // 2500^2 + [0.2, 2, -1.3, 0.02] + }; + [0.15, 1.5, -1, 0.015] + }) params ["_fadeByDistance", "_sizeByDistance", "_heightByDistance", "_fontSizeByDistance"]; + + // Apply color fade + _groupColor set [3, _fadeByDistance]; + + // Show unit name only if camera is near enough + if (_distanceToCameraSqr < DISTANCE_NAMES_SQR) then { + private _name = ([_x] call EFUNC(common,getName)) select [0, NAME_MAX_CHARACTERS]; + if !(isPlayer _x) then { _name = format ["%1: %2", localize "str_player_ai", _name]; }; + + if (_inVehicle) then { + private _crewCount = (({alive _x} count (crew _vehicle)) - 1); + if (_crewCount > 0) then { + _name = format ["%1 (+%2)", _name, _crewCount]; + }; + }; + + // Draw unit name for effective commander or all units on foot + _iconsToDraw pushBack [_x, 2, [ + "", + [1,1,1,1], + [0,0,0], + 0, + _heightByDistance, + 0, + _name, + 2, + _fontSizeByDistance, + "PuristaMedium", + "center" + ]]; + } else { + // Draw group name for effective commander or leader on foot + if (_inVehicle || _isLeader) then { + _iconsToDraw pushBack [_x, 0, [ + "", + [1,1,1,_fadeByDistance], + [0,0,0], + 0, + _heightByDistance, + 0, + groupID _group, + 2, + _fontSizeByDistance, + "PuristaMedium", + "center" + ]]; + }; + }; + + // Draw group icon for effective commander or leader on foot + if (_inVehicle || _isLeader) then { + _iconsToDraw pushBack [_x, 0, [ + [_group, true] call FUNC(getGroupIcon), + _groupColor, + [0,0,0], + _sizeByDistance, + _sizeByDistance, + 0, + "", + 0, + 0.035, + "PuristaMedium", + "center" + ]]; + }; + + // Draw unit icon for effective commander or all units on foot + _iconsToDraw pushBack [_x, 1, [ + [ICON_UNIT, ICON_REVIVE] select (NEEDS_REVIVE(_x)), + _groupColor, + [0,0,0], + _sizeByDistance, + _sizeByDistance, + 0, + "", + 0, + 0.035, + "PuristaMedium", + "center" + ]]; + + // Track entities themselves for use with fired EH + _entitiesToDraw pushBack _vehicle; + + // Add fired EH for drawing and icon highlighting + if (GETVAR(_vehicle,GVAR(firedEH),-1) == -1) then { + SETVAR(_vehicle,GVAR(firedEH),_vehicle addEventHandler [ARR_2("Fired",{_this call FUNC(handleFired)})]); + }; + }; + + nil // Speed loop +} count ([] call FUNC(getTargetEntities)); + +GVAR(iconsToDraw) = _iconsToDraw; +GVAR(entitiesToDraw) = _entitiesToDraw; diff --git a/addons/spectator/functions/fnc_ui_updateListEntities.sqf b/addons/spectator/functions/fnc_ui_updateListEntities.sqf new file mode 100644 index 0000000000..cb165b5f45 --- /dev/null +++ b/addons/spectator/functions/fnc_ui_updateListEntities.sqf @@ -0,0 +1,222 @@ +/* + * Author: Nelson Duarte, AACO, SilentSpike + * Updates spectator UI list of units/groups + * + * Arguments: + * None + * + * Return Value: + * None + * + * Example: + * [] call ace_spectator_fnc_ui_updateListEntities + * + * Public: No + */ + +#include "script_component.hpp" + +private _newUnits = []; +private _newGroups = []; +// Always show the 4 main sides in this intuative order +private _newSides = [str west, str east, str resistance, str civilian]; +private _newList = [ + [west, str west, [west] call BIS_fnc_sideName, [west] call BIS_fnc_sideColor, []], + [east, str east, [east] call BIS_fnc_sideName, [east] call BIS_fnc_sideColor, []], + [resistance, str resistance, [resistance] call BIS_fnc_sideName, [resistance] call BIS_fnc_sideColor, []], + [civilian, str civilian, [civilian] call BIS_fnc_sideName, [civilian] call BIS_fnc_sideColor, []] +]; + +// Go through entity groups and cache information (include dead entities) +private _entities = [true] call FUNC(getTargetEntities); +{ + // Add the group if new + private _group = _x; + if !(str _group in _newGroups) then { + // Include the group if it contains valid entities + private _entitiesGroup = units _group arrayIntersect _entities; + + if !(_entitiesGroup isEqualTo []) then { + // Cache the info of valid units in the group + private _unitsInfo = []; + { + _newUnits pushBack ([_x] call BIS_fnc_objectVar); + + private _name = ([_x] call EFUNC(common,getName)) select [0, NAME_MAX_CHARACTERS]; + if !(isPlayer _x) then { _name = format ["%1: %2", localize "str_player_ai", _name]; }; + + _unitsInfo pushBack [ + _x, + alive _x, + alive _x && { NEEDS_REVIVE(_x) }, + _name + ]; + nil // Speed loop + } count _entitiesGroup; + + // Cache the info of the group itself + private _groupTexture = [_group] call FUNC(getGroupIcon); + private _groupInfo = [_group, str _group, _groupTexture, groupID _group]; + + // Add the group to the correct side + private _side = side _group; + private _sideIndex = _newSides find (str _side); + + // Add the side if new + if (_sideIndex < 0) then { + _newList pushBack [ + _side, + str _side, + [_side] call BIS_fnc_sideName, + [_side] call BIS_fnc_sideColor, + [] + ]; + + _sideIndex = _newSides pushBack (str _side); + }; + + // Add it to the right index + _newGroups pushBack (str _group); + ((_newList select _sideIndex) select 4) pushBack [_groupInfo, _unitsInfo]; + }; + }; + nil // Speed loop +} count allGroups; + +// Whether an update to the list is required (really only if something changed) +if !(GVAR(curList) isEqualTo _newList) then { + private _ctrl = CTRL_LIST; + + // Remove groups/units that are no longer there + for "_sideIndex" from ((_ctrl tvCount []) - 1) to 0 step -1 do { + for "_groupIndex" from ((_ctrl tvCount [_sideIndex]) - 1) to 0 step -1 do { + for "_unitIndex" from ((_ctrl tvCount [_sideIndex, _groupIndex]) - 1) to 0 step -1 do { + private _lookup = _newUnits find (_ctrl tvData [_sideIndex, _groupIndex, _unitIndex]); + if (_lookup < 0) then { + _ctrl tvDelete [_sideIndex, _groupIndex, _unitIndex]; + } else { + _newUnits deleteAt _lookup; + }; + }; + private _lookup = _newGroups find (_ctrl tvData [_sideIndex, _groupIndex]); + if (_lookup < 0) then { + _ctrl tvDelete [_sideIndex, _groupIndex]; + } else { + _newGroups deleteAt _lookup; + }; + }; + private _lookup = _newSides find (_ctrl tvData [_sideIndex]); + if (_lookup < 0) then { + _ctrl tvDelete [_sideIndex]; + } else { + _newSides deleteAt _lookup; + }; + }; + + // Hash location lookups, note hashing assumes unique side/group/unit data + private _sideDataToPathHash = [[], []]; + private _groupDataToPathHash = [[], []]; + private _unitDataToPathHash = [[], []]; + + for "_sideIndex" from 0 to ((_ctrl tvCount []) - 1) do { + (_sideDataToPathHash select 0) pushBack (_ctrl tvData [_sideIndex]); + (_sideDataToPathHash select 1) pushBack [_sideIndex]; + for "_groupIndex" from 0 to ((_ctrl tvCount [_sideIndex]) - 1) do { + (_groupDataToPathHash select 0) pushBack (_ctrl tvData [_sideIndex, _groupIndex]); + (_groupDataToPathHash select 1) pushBack [_sideIndex, _groupIndex]; + for "_unitIndex" from 0 to ((_ctrl tvCount [_sideIndex, _groupIndex]) - 1) do { + (_unitDataToPathHash select 0) pushBack (_ctrl tvData [_sideIndex, _groupIndex, _unitIndex]); + (_unitDataToPathHash select 1) pushBack [_sideIndex, _groupIndex, _unitIndex]; + }; + }; + }; + + // Update/add the values + { + _x params ["_side", "_sideStr", "_sideTitle", "_sideColor", "_nestedGroupData"]; + + private _sideIndex = -1; + private _lookup = (_sideDataToPathHash select 0) find _sideStr; + if (_lookup < 0) then { + _sideIndex = _ctrl tvAdd [[], _sideTitle]; + _ctrl tvSetData [[_sideIndex], _sideStr]; + _ctrl tvExpand [_sideIndex]; + } else { + // pop data out of hash to improve later lookups + (_sideDataToPathHash select 0) deleteAt _lookup; + private _path = (_sideDataToPathHash select 1) deleteAt _lookup; + _sideIndex = _path select 0; + + _ctrl tvSetText [_path, _sideTitle]; + }; + + { + _x params ["_groupInfo", "_nestedUnitData"]; + _groupInfo params ["_group", "_groupStr", "_groupTexture", "_groupId"]; + + private _groupIndex = -1; + private _lookup = (_groupDataToPathHash select 0) find _groupStr; + if (_lookup < 0) then { + _groupIndex = _ctrl tvAdd [[_sideIndex], _groupId]; + _ctrl tvSetData [[_sideIndex, _groupIndex], _groupStr]; + _ctrl tvSetPicture [[_sideIndex, _groupIndex], _groupTexture]; + _ctrl tvSetPictureColor [[_sideIndex, _groupIndex], _sideColor]; + _ctrl tvSetTooltip [[_sideIndex, _groupIndex], _groupId]; + _ctrl tvExpand [_sideIndex, _groupIndex]; + } else { + // pop data out of hash to improve later lookups + (_groupDataToPathHash select 0) deleteAt _lookup; + private _path = (_groupDataToPathHash select 1) deleteAt _lookup; + _groupIndex = _path select 1; + + _ctrl tvSetText [_path, _groupId]; + _ctrl tvSetPicture [_path, _groupTexture]; + _ctrl tvSetPictureColor [_path, _sideColor]; + _ctrl tvSetTooltip [_path, _groupId]; + }; + + { + _x params ["_unit", "_isAlive", "_isIncapacitated", "_name"]; + + // Show full name in tooltip + whether medic + whether engineer + private _tooltip = [[_unit] call EFUNC(common,getName)]; + if ([_unit] call EFUNC(common,isMedic)) then { _tooltip pushBack (localize "str_support_medic"); }; + if ([_unit] call EFUNC(common,isEngineer)) then { _tooltip pushBack (localize LSTRING(TooltipEngineer)); }; + _tooltip = _tooltip joinString " - "; + + private _texture = [_isAlive, _isIncapacitated, _unit] call { + params ["","","_unit"]; + if !(_this select 0) exitWith { ICON_DEAD }; + if (_this select 1) exitWith { ICON_REVIVE }; + [vehicle _unit] call EFUNC(common,getVehicleIcon) + }; + + private _lookup = (_unitDataToPathHash select 0) find ([_unit] call BIS_fnc_objectVar); + if (_lookup < 0) then { + private _unitIndex = _ctrl tvAdd [[_sideIndex, _groupIndex], _name]; + _ctrl tvSetData [[_sideIndex, _groupIndex, _unitIndex], [_unit] call BIS_fnc_objectVar]; + _ctrl tvSetPicture [[_sideIndex, _groupIndex, _unitIndex], _texture]; + _ctrl tvSetPictureColor [[_sideIndex, _groupIndex, _unitIndex], _sideColor]; + _ctrl tvSetTooltip [[_sideIndex, _groupIndex, _unitIndex], _tooltip]; + } else { + // pop data out of hash to improve later lookups + (_unitDataToPathHash select 0) deleteAt _lookup; + private _path = (_unitDataToPathHash select 1) deleteAt _lookup; + _ctrl tvSetText [_path, _name]; + _ctrl tvSetPicture [_path, _texture]; + _ctrl tvSetPictureColor [_path, _sideColor]; + _ctrl tvSetTooltip [_path, _tooltip]; + }; + nil // Speed loop + } count _nestedUnitData; + nil // Speed loop + } count _nestedGroupData; + nil // Speed loop + } count _newList; + + // Store the new list as the current list + GVAR(curList) = _newList; +}; + +// Update focus if required +[] call FUNC(ui_updateListFocus); diff --git a/addons/spectator/functions/fnc_ui_updateListFocus.sqf b/addons/spectator/functions/fnc_ui_updateListFocus.sqf new file mode 100644 index 0000000000..1e9dcafaec --- /dev/null +++ b/addons/spectator/functions/fnc_ui_updateListFocus.sqf @@ -0,0 +1,19 @@ +/* + * Author: Nelson Duarte, AACO, SilentSpike + * Function used to update the list current selection + * + * Arguments: + * None + * + * Return Value: + * None + * + * Example: + * [] call ace_spectator_fnc_ui_updateListFocus + * + * Public: No + */ + +#include "script_component.hpp" + +CTRL_LIST tvSetCurSel ([[GVAR(camFocus)] call BIS_fnc_objectVar] call FUNC(ui_getTreeDataIndex)); diff --git a/addons/spectator/functions/fnc_ui_updateWidget.sqf b/addons/spectator/functions/fnc_ui_updateWidget.sqf new file mode 100644 index 0000000000..068bff7cb0 --- /dev/null +++ b/addons/spectator/functions/fnc_ui_updateWidget.sqf @@ -0,0 +1,90 @@ +/* + * Author: Nelson Duarte, SilentSpike + * Updates spectator UI unit info widget + * + * Arguments: + * None + * + * Return Value: + * None + * + * Example: + * [] call ace_spectator_fnc_ui_updateWidget + * + * Public: No + */ + +#include "script_component.hpp" +#define IMG_COMMANDER "a3\Ui_f\data\IGUI\Cfg\CommandBar\imageCommander_ca.paa" +#define IMG_DRIVER "a3\Ui_f\data\IGUI\Cfg\CommandBar\imageDriver_ca.paa" +#define IMG_GUNNER "a3\Ui_f\data\IGUI\Cfg\CommandBar\imageGunner_ca.paa" +#define IMG_CARGO "a3\Ui_f\data\IGUI\Cfg\CommandBar\imageCargo_ca.paa" +#define IMG_UNARMED "" // TODO: Find suitable unarmed icon + +// Hide if no target or widget is toggled off +if (!GVAR(uiWidgetVisible) || {isNull GVAR(camFocus)}) exitWith {CTRL_WIDGET ctrlShow false}; + +private _focus = GVAR(camFocus); + +private _name = ([_focus] call EFUNC(common,getName)) select [0, NAME_MAX_CHARACTERS]; +if !(isPlayer _focus) then { _name = format ["%1: %2", localize "str_player_ai", _name]; }; + +private _unitTypePicture = ""; +private _vehicleTypePicture = ""; +private _vehiclePositionPicture = ""; +if (_focus != vehicle _focus) then { + _vehicleTypePicture = getText (configFile >> "CfgVehicles" >> typeOf vehicle _focus >> "Picture"); + + _vehiclePositionPicture = switch (_focus) do { + case (commander vehicle _focus): {IMG_COMMANDER}; + case (driver vehicle _focus): {IMG_DRIVER}; + case (gunner vehicle _focus): {IMG_GUNNER}; + default {IMG_CARGO}; + }; +} else { + _unitTypePicture = [_focus] call EFUNC(common,getVehicleIcon); +}; + + +private _weapon = currentWeapon _focus; +private _weaponPicture = if (_weapon != "") then { + getText (configFile >> "CfgWeapons" >> _weapon >> "Picture") +} else { + IMG_UNARMED +}; + +private _throwable = (currentThrowable _focus) param [0,""]; +private _throwablePicture = if (_throwable != "") then { + getText (configFile >> "CfgMagazines" >> _throwable >> "Picture") +} else { + IMG_UNARMED +}; + +(getPlayerScores _focus) params [ + ["_kills",0,[0]], + ["_softKills",0,[0]], + ["_armoredKills",0,[0]], + ["_airKills",0,[0]], + ["_deaths",0,[0]], + ["_total",0,[0]] +]; + +CTRL_WIDGET_NAME ctrlSetText _name; +CTRL_WIDGET_KILLS ctrlSetText str _kills; +CTRL_WIDGET_LAND ctrlSetText str _softKills; +CTRL_WIDGET_ARMORED ctrlSetText str _armoredKills; +CTRL_WIDGET_AIR ctrlSetText str _airKills; +CTRL_WIDGET_DEATHS ctrlSetText str _deaths; +CTRL_WIDGET_TOTAL ctrlSetText str _total; + +CTRL_WIDGET_WEAPON ctrlSetText _weaponPicture; +CTRL_WIDGET_THROWABLE ctrlSetText _throwablePicture; + +CTRL_WIDGET_UNIT ctrlSetText _unitTypePicture; +CTRL_WIDGET_VEHICLE ctrlSetText _vehicleTypePicture; +CTRL_WIDGET_VEHICLE_POS ctrlSetText _vehiclePositionPicture; + +// Handle widget toggling +if !(ctrlShown CTRL_WIDGET) then { + CTRL_WIDGET ctrlShow true; +}; diff --git a/addons/spectator/functions/fnc_updateCameraModes.sqf b/addons/spectator/functions/fnc_updateCameraModes.sqf index de1611823b..2931fe5295 100644 --- a/addons/spectator/functions/fnc_updateCameraModes.sqf +++ b/addons/spectator/functions/fnc_updateCameraModes.sqf @@ -3,8 +3,10 @@ * Adds or removes spectator camera modes from the selection available to the local player. * Possible camera modes are: * - 0: Free - * - 1: Internal - * - 2: External + * - 1: First person + * - 2: Follow + * + * Default selection is [0,1,2] * * Arguments: * 0: Camera modes to add @@ -21,13 +23,16 @@ #include "script_component.hpp" -params [["_addModes",[],[[]]], ["_removeModes",[],[[]]]]; -private ["_newModes","_currentModes"]; +if !(EGVAR(common,settingsInitFinished)) exitWith { + EGVAR(common,runAtSettingsInitialized) pushBack [DFUNC(updateCameraModes),_this]; +}; -_currentModes = GVAR(availableModes); +params [["_addModes",[],[[]]], ["_removeModes",[],[[]]]]; + +private _currentModes = GVAR(availableModes); // Restrict additions to only possible values -_newModes = _addModes arrayIntersect [0,1,2]; +private _newModes = _addModes arrayIntersect ALL_MODES; _newModes append (_currentModes - _removeModes); _newModes = _newModes arrayIntersect _newModes; @@ -35,14 +40,19 @@ _newModes sort true; // Can't become an empty array if (_newModes isEqualTo []) then { - ["Cannot remove all camera modes (%1)", QFUNC(updateCameraModes)] call BIS_fnc_error; + WARNING("Cannot remove all spectator camera modes"); } else { GVAR(availableModes) = _newModes; }; // Update camera in case of change -if (GVAR(isSet)) then { - [] call FUNC(transitionCamera); +if !(isNil QGVAR(camera)) then { + // If mode was free and no longer available, find a focus + if (!(MODE_FREE in _newModes) && {GVAR(camMode) == MODE_FREE} && {isNull GVAR(camFocus)}) then { + [true] call FUNC(setFocus); + }; + + [GVAR(camMode)] call FUNC(cam_setCameraMode); }; _newModes diff --git a/addons/spectator/functions/fnc_updateSpectatableSides.sqf b/addons/spectator/functions/fnc_updateSides.sqf similarity index 73% rename from addons/spectator/functions/fnc_updateSpectatableSides.sqf rename to addons/spectator/functions/fnc_updateSides.sqf index 57f7756d54..ec4606b951 100644 --- a/addons/spectator/functions/fnc_updateSpectatableSides.sqf +++ b/addons/spectator/functions/fnc_updateSides.sqf @@ -1,7 +1,6 @@ /* * Author: SilentSpike - * Adds or removes sides from the selection available to spectate by the local player. - * Note that the side filter setting is applied to the available sides dynamically. + * Adds or removes sides from the selection available to spectate. Local effect. * * Default selection is [west,east,resistance,civilian] * @@ -10,10 +9,10 @@ * 1: Sides to remove * * Return Value: - * Spectatable sides + * Sides available * * Example: - * [[west], [east,civilian]] call ace_spectator_fnc_updateSpectatableSides + * [[west], [east,civilian]] call ace_spectator_fnc_updateSides * * Public: Yes */ diff --git a/addons/spectator/functions/fnc_updateUnits.sqf b/addons/spectator/functions/fnc_updateUnits.sqf index e5b15b6bc1..6df7cad8ad 100644 --- a/addons/spectator/functions/fnc_updateUnits.sqf +++ b/addons/spectator/functions/fnc_updateUnits.sqf @@ -1,75 +1,40 @@ /* * Author: SilentSpike - * Adds units to spectator whitelist/blacklist and refreshes the filter units + * Adds and removed units from the spectator list. Local effect. * * Arguments: - * 0: Units to add to the whitelist - * 1: Use blacklist (default: false) + * 0: Units to show in the list + * 1: Units to hide in the list * * Return Value: - * None + * None * * Example: - * [allUnits,true] call ace_spectator_fnc_updateUnits + * [allPlayers, [player]] call ace_spectator_fnc_updateUnits * * Public: Yes */ #include "script_component.hpp" -params [["_newUnits",[],[[]]],["_blacklist",false,[false]]]; - // Function only matters on player clients if (!hasInterface) exitWith {}; -// If adding to a list we can exit here, since it won't show up until the UI refreshes anyway -if !(_newUnits isEqualTo []) exitWith { - if (_blacklist) then { - GVAR(unitWhitelist) = GVAR(unitWhitelist) - _newUnits; - GVAR(unitBlacklist) append _newUnits; - } else { - GVAR(unitBlacklist) = GVAR(unitBlacklist) - _newUnits; - GVAR(unitWhitelist) append _newUnits; +params [["_addUnits",[],[[]]], ["_removeUnits",[],[[], true]]]; + +// Deprecated parameter (remember to remove bool from params when removed) +if (_removeUnits isEqualType true) then { + ACE_DEPRECATED("Boolean parameter","3.12.0","array (see function header or doc)"); + if (_removeUnits) then { + _removeUnits = _addUnits; + _addUnits = []; }; }; -private ["_sides","_cond","_filteredUnits","_filteredGroups"]; +// Add to the whitelist and prevent list overlap +GVAR(unitBlacklist) = GVAR(unitBlacklist) - _addUnits; +GVAR(unitWhitelist) append _addUnits; -// Unit setting filter -_newUnits = [[],allPlayers,playableUnits,allUnits] select GVAR(filterUnits); - -// Side setting filter -_sides = []; -_cond = [{_this == (side group player)},{(_this getFriend (side group player)) >= 0.6},{(_this getFriend (side group player)) < 0.6},{true}] select GVAR(filterSides); -{ - if (_x call _cond) then { - _sides pushBack _x; - }; -} forEach GVAR(availableSides); - -// Filter units and append to list -_filteredUnits = []; -{ - if ( - (alive _x) && - {(_x isKindOf "CAManBase")} && - {(side group _x) in _sides} && // Side filter - {simulationEnabled _x} && - {!(_x getVariable [QGVAR(isStaged), false])} // Who watches the watchmen? - ) then { - _filteredUnits pushBack _x; - }; -} forEach (_newUnits - GVAR(unitBlacklist)); -_filteredUnits append GVAR(unitWhitelist); - -// Cache icons and colour for drawing -_filteredGroups = []; -{ - // Intentionally re-applied to units in case their status changes - [_x] call FUNC(cacheUnitInfo); - _filteredGroups pushBack (group _x); -} forEach _filteredUnits; - -// Replace previous lists entirely (removes any no longer valid) -GVAR(unitList) = _filteredUnits arrayIntersect _filteredUnits; -GVAR(groupList) = _filteredGroups arrayIntersect _filteredGroups; +// Blacklist overrides the whitelist +GVAR(unitWhitelist) = GVAR(unitWhitelist) - _removeUnits; +GVAR(unitBlacklist) append _removeUnits; diff --git a/addons/spectator/functions/fnc_updateVisionModes.sqf b/addons/spectator/functions/fnc_updateVisionModes.sqf index c2bbb09167..56b6696752 100644 --- a/addons/spectator/functions/fnc_updateVisionModes.sqf +++ b/addons/spectator/functions/fnc_updateVisionModes.sqf @@ -1,7 +1,7 @@ /* * Author: SilentSpike * Adds or removes spectator vision modes from the selection available to the local player. - * The default selection is [-2,-1,0,1]. + * * Possible vision modes are: * - -2: Normal * - -1: Night vision @@ -14,6 +14,8 @@ * - 6: White Hot / Darker Red Cold * - 7: Thermal (Shade of Red and Green, Bodies are white) * + * Default selection is [-2,-1,0,1] + * * Arguments: * 0: Vision modes to add * 1: Vision modes to remove @@ -29,13 +31,16 @@ #include "script_component.hpp" -params [["_addModes",[],[[]]], ["_removeModes",[],[[]]]]; -private ["_newModes","_currentModes"]; +if !(EGVAR(common,settingsInitFinished)) exitWith { + EGVAR(common,runAtSettingsInitialized) pushBack [DFUNC(updateVisionModes),_this]; +}; -_currentModes = GVAR(availableVisions); +params [["_addModes",[],[[]]], ["_removeModes",[],[[]]]]; + +private _currentModes = GVAR(availableVisions); // Restrict additions to only possible values -_newModes = _addModes arrayIntersect [-2,-1,0,1,2,3,4,5,6,7]; +private _newModes = _addModes arrayIntersect [-2,-1,0,1,2,3,4,5,6,7]; _newModes append (_currentModes - _removeModes); _newModes = _newModes arrayIntersect _newModes; @@ -43,14 +48,14 @@ _newModes sort true; // Can't become an empty array if (_newModes isEqualTo []) then { - ["Cannot remove all vision modes (%1)", QFUNC(updateVisionModes)] call BIS_fnc_error; + WARNING("Cannot remove all spectator vision modes"); } else { GVAR(availableVisions) = _newModes; }; // Update camera in case of change -if (GVAR(isSet)) then { - [] call FUNC(transitionCamera); +if !(isNil QGVAR(camera)) then { + [GVAR(camVision)] call FUNC(cam_setVisionMode); }; _newModes diff --git a/addons/spectator/script_component.hpp b/addons/spectator/script_component.hpp index 38561f3cdd..b4e7c82ac8 100644 --- a/addons/spectator/script_component.hpp +++ b/addons/spectator/script_component.hpp @@ -24,39 +24,117 @@ #define X_PART(num) (W_PART(num) + (safezoneX + (safezoneW - SIZEX)/2)) #define Y_PART(num) (H_PART(num) + (safezoneY + (safezoneH - SIZEY)/2)) -// UI tools -#define TOOL_H H_PART(1) -#define TOOL_W W_PART(5) -#define MARGIN TOOL_W * 0.05 +// UI/Camera related values +#define SPEED_SLOW 0.1 +#define SPEED_DEFAULT 1 +#define SPEED_FAST 2 // Seems to be some form of multiplier (but using 1 stil makes it faster...?) -// UI compass -#define COMPASS_W (TOOL_W * 4) -#define COMPASS_X (safeZoneX + safeZoneW * 0.5 - COMPASS_W * 0.5) +#define MODE_FREE 0 +#define MODE_FPS 1 +#define MODE_FOLLOW 2 +#define ALL_MODES [MODE_FREE,MODE_FPS,MODE_FOLLOW] -// UI IDCs -#define IDC_COMP 4490 -#define IDC_COMP_0 5000 -#define IDC_COMP_90 5090 -#define IDC_COMP_180 5180 -#define IDC_COMP_270 5270 +#define VISION_NORM -2 +#define VISION_NVG -1 -#define IDC_HELP 7631 -#define IDC_HELP_LIST 7622 +#define MAX_VIEW_DISTANCE 2500 +#define MIN_VIEW_DISTANCE 500 +#define DEFAULT_VIEW_DISTANCE 1200 -#define IDC_MAP 6791 +#define FIRE_HIGHLIGHT_TIME 0.05 +#define MAX_GRENADES 15 +#define MAX_PROJECTILES 50 +#define MAX_PROJECTILE_SEGMENTS 50 -#define IDC_TOOL 3000 -#define IDC_TOOL_CLOCK 3003 -#define IDC_TOOL_FOV 3005 -#define IDC_TOOL_NAME 3001 -#define IDC_TOOL_SPEED 3006 -#define IDC_TOOL_VIEW 3002 -#define IDC_TOOL_VISION 3004 +#define DISTANCE_ICONS_SQR 9000000 // Icons are rendered within 3000m, squared for `distanceSqr` speed +#define DISTANCE_NAMES_SQR 30625 // Names are rendered within 175m, squared for `distanceSqr` speed +#define NAME_MAX_CHARACTERS 17 -#define IDC_UNIT 6002 -#define IDC_UNIT_TREE 6005 +#define LIST_ENTITIES 0 +#define LIST_UPDATE_RATE 1 -// UI colours -#define COL_BACK 0.1,0.1,0.1,0.7 -#define COL_FORE 1,1,1,1 -#define COL_FORE_D 0.1,0.1,0.1,0.8 +// Revive variables +#define BIS_REVIVE "BIS_revive_incapacitated" +#define ACE_REVIVE "ACE_isUnconscious" +#define NEEDS_REVIVE(unit) (unit getVariable [ACE_REVIVE,false]) || {unit getVariable [BIS_REVIVE,false]} + +// Icons used in the UI/drawing +#define ICON_DEAD "a3\Ui_F_Curator\Data\CfgMarkers\kia_ca.paa" +#define ICON_GRENADE "A3\Ui_f\data\IGUI\Cfg\HoldActions\holdAction_connect_ca.paa" +#define ICON_UNIT "a3\Ui_f\data\GUI\Rsc\RscDisplayEGSpectator\UnitIcon_ca.paa" +#define ICON_REVIVE "a3\Ui_f\data\GUI\Rsc\RscDisplayEGSpectator\ReviveIcon_ca.paa" +#define ICON_BACKGROUND_UNIT "a3\Ui_f\data\GUI\Rsc\RscDisplayEGSpectator\UnitName_ca.paa" +#define ICON_CAMERA "a3\Ui_f\data\GUI\Rsc\RscDisplayEGSpectator\cameraTexture_ca.paa" +#define CAM_ICON_FREE "a3\Ui_f\data\GUI\Rsc\RscDisplayEGSpectator\FreeSelected.paa" +#define CAM_ICON_FREE_SELECTED "a3\Ui_f\data\GUI\Rsc\RscDisplayEGSpectator\Free.paa" +#define CAM_ICON_FOLLOW "a3\Ui_f\data\GUI\Rsc\RscDisplayEGSpectator\FollowSelected.paa" +#define CAM_ICON_FOLLOW_SELECTED "a3\Ui_f\data\GUI\Rsc\RscDisplayEGSpectator\Follow.paa" +#define CAM_ICON_FPS "a3\Ui_f\data\GUI\Rsc\RscDisplayEGSpectator\FpsSelected.paa" +#define CAM_ICON_FPS_SELECTED "a3\Ui_f\data\GUI\Rsc\RscDisplayEGSpectator\Fps.paa" + +// IDCs +#define MAIN_DISPLAY ([] call BIS_fnc_displayMission) + +#define IDD_SPEC_DISPLAY 60000 +#define SPEC_DISPLAY (findDisplay IDD_SPEC_DISPLAY) + +#define IDC_MOUSE 60001 +#define CTRL_MOUSE (SPEC_DISPLAY displayCtrl IDC_MOUSE) + +#define IDC_TIME 60002 +#define CTRL_TIME (SPEC_DISPLAY displayCtrl IDC_TIME) + +#define IDC_LIST 60003 +#define CTRL_LIST (SPEC_DISPLAY displayCtrl IDC_LIST) + +#define IDC_TABS 60004 +#define CTRL_TABS (SPEC_DISPLAY displayCtrl IDC_TABS) + +#define IDC_CAM_TYPES 60005 +#define CTRL_CAM_TYPES (SPEC_DISPLAY displayCtrl IDC_CAM_TYPES) +#define IDC_FREE 60006 +#define IDC_FOLLOW 60007 +#define IDC_FPS 60008 + +#define IDC_MAP_GROUP 60010 +#define CTRL_MAP_GROUP (SPEC_DISPLAY displayCtrl IDC_MAP_GROUP) +#define IDC_MAP_TITLE 60011 +#define CTRL_MAP_TITLE (SPEC_DISPLAY displayCtrl IDC_MAP_TITLE) +#define IDC_MAP_FOOTER 60012 +#define CTRL_MAP_FOOTER (SPEC_DISPLAY displayCtrl IDC_MAP_FOOTER) +#define IDC_MAP_SPEC_NUM 60013 +#define CTRL_MAP_SPEC_NUM (SPEC_DISPLAY displayCtrl IDC_MAP_SPEC_NUM) +#define IDC_MAP 60014 +#define CTRL_MAP (SPEC_DISPLAY displayCtrl IDC_MAP) + +#define IDC_HELP_BACK 60020 +#define CTRL_HELP_BACK (SPEC_DISPLAY displayCtrl IDC_HELP_BACK) +#define IDC_HELP 60021 +#define CTRL_HELP (SPEC_DISPLAY displayCtrl IDC_HELP) + +#define IDC_WIDGET 60030 +#define CTRL_WIDGET (SPEC_DISPLAY displayCtrl IDC_WIDGET) +#define IDC_WIDGET_VEHICLE 60031 +#define CTRL_WIDGET_VEHICLE (SPEC_DISPLAY displayCtrl IDC_WIDGET_VEHICLE) +#define IDC_WIDGET_UNIT 60032 +#define CTRL_WIDGET_UNIT (SPEC_DISPLAY displayCtrl IDC_WIDGET_UNIT) +#define IDC_WIDGET_NAME 60033 +#define CTRL_WIDGET_NAME (SPEC_DISPLAY displayCtrl IDC_WIDGET_NAME) +#define IDC_WIDGET_VEHICLE_POS 60034 +#define CTRL_WIDGET_VEHICLE_POS (SPEC_DISPLAY displayCtrl IDC_WIDGET_VEHICLE_POS) +#define IDC_WIDGET_KILLS 60035 +#define CTRL_WIDGET_KILLS (SPEC_DISPLAY displayCtrl IDC_WIDGET_KILLS) +#define IDC_WIDGET_LAND 60036 +#define CTRL_WIDGET_LAND (SPEC_DISPLAY displayCtrl IDC_WIDGET_LAND) +#define IDC_WIDGET_ARMORED 60037 +#define CTRL_WIDGET_ARMORED (SPEC_DISPLAY displayCtrl IDC_WIDGET_ARMORED) +#define IDC_WIDGET_AIR 60038 +#define CTRL_WIDGET_AIR (SPEC_DISPLAY displayCtrl IDC_WIDGET_AIR) +#define IDC_WIDGET_DEATHS 60039 +#define CTRL_WIDGET_DEATHS (SPEC_DISPLAY displayCtrl IDC_WIDGET_DEATHS) +#define IDC_WIDGET_TOTAL 60040 +#define CTRL_WIDGET_TOTAL (SPEC_DISPLAY displayCtrl IDC_WIDGET_TOTAL) +#define IDC_WIDGET_WEAPON 60041 +#define CTRL_WIDGET_WEAPON (SPEC_DISPLAY displayCtrl IDC_WIDGET_WEAPON) +#define IDC_WIDGET_THROWABLE 60042 +#define CTRL_WIDGET_THROWABLE (SPEC_DISPLAY displayCtrl IDC_WIDGET_THROWABLE) diff --git a/addons/spectator/stringtable.xml b/addons/spectator/stringtable.xml index bf1565d4c4..9c7dc249a3 100644 --- a/addons/spectator/stringtable.xml +++ b/addons/spectator/stringtable.xml @@ -1,9 +1,19 @@  + + ACE Spectator + ACE Zuschauer + ACE スペクテイター + Spettatore ACE + Spectateur ACE + ACE 旁观者 + ACE 旁觀者 + Obserwator ACE + Spectator Settings - Zuschauer Einstellungen + Zuschauer-Einstellungen Ustawienia obserwatora Preferências de Espectador Настройки спектатора @@ -12,6 +22,9 @@ Impostazioni Spettatore Réglages de spectateur スペクテイター設定 + 관전자 설정 + 旁观者设定 + 旁觀者設定 Configure how the spectator system will operate by default. @@ -24,150 +37,25 @@ Configura come il sistema spettatore si comporterà di default. Configure comment le système de spectateurs opère par défaut. スペクテイター システムが標準でどのように動作するか設定できます。 + 어떻게 관전자 시스템이 기본적으로 작동되는지 설정합니다 + 设定旁观者系统相关配置 + 設定旁觀者系統相關配置 - - Unit filter - Einheitenfilter - Filtr jednostek - Filtro de unidades - Фильтр юнитов - Filtr jednotek - Filtro de unidad - Filtro Unità - Filtre d'unités - ユニット フィルタ + + AI Enabled + KI Sichtbarkeit + AI にも有効化 + AI Abilitate + 可觀察AI + 可观察AI - - Method of filtering spectatable units. - Einheiten denen zugeschaut werden kann. - Wybierz jednostki, jakie będzie można obserwować po uruchomeniu obserwatora. - Método para filtrar unidades espectáveis - Метод фильтрации наблюдаемых юнитов. - Método de filtrado de unidades de espectador - Metoda filtrování pozorovaných jednotek. - Metodo di filtraggio delle unità osservabili. - Méthode de filtration des unités regardables. - 観察できるユニットへのフィルタ設定ができます。 - - - No units - Keine Einheiten - Brak jednostek - Sem unidades - Никто - Žádné jednotky - Ninguna - Nessuna unità - Pas d'unités - ユニットなし - - - Only players - Nur Spieler - Tylko gracze - Somente jogadores - Только игроки - Pouze hráči - Solo jugadores - Solo giocatori - Joueurs seulements - プレイヤのみ - - - Playable Units - Nur spielbare Einheiten - Grywalne jednostki - Unidades jogáveis - Играбельные юниты - Hratelné jednotky - Unidades jugables - Unità giocabili - Unités jouables - プレイ可能なユニットのみ - - - All units - Alle Einheiten - Wszystkie jednostki - Todas unidades - Все юниты - Všechny jednotky - Todas las unidades - Tutte le unità - Toutes les unités - 全てのユニット - - - Side filter - Fraktionenfilter - Filtr stron - Filtro de lados - Фильтр стороны - Filtr stran - Filtro de bando - Filtro Lato - Filtre de faction - 勢力フィルタ - - - Method of filtering spectatable sides. - Fraktionen denen zugeschaut werden kann. - Wybierz strony, jakie będzie można obserwować po uruchomeniu obserwatora. - Método para filtrar lados espectáveis. - Метод фильтрации наблюдаемых сторон. - Método de filtrado de bandos de espectador - Metoda filtrování pozorovaných stran. - Metodo per filtrare i lati osservabili. - Méthode de filtration des factions regardables - 観察できる勢力へのフィルタ設定ができます。 - - - Player side - Spielerseite - Strona gracza - Lado do jogador - Сторона игрока - Strana hráče - Bando del jugador - Lato giocatore - Faction du joueur - プレイヤーと同じ勢力 - - - Friendly sides - Verbündete - Strony sojusznicze - Lados aliados - Дружественные стороны - Strana spojenců - Bandos amigos - Lati alleati - Factions amies - 友軍勢力 - - - Hostile sides - Feinde - Strony wrogie - Lados hostis - Враждебные стороны - Strana nepřítele - Bandos enemigos - Lati nemici - Factions hostiles - 敵対勢力 - - - All sides - Alle Fraktionen - Wszystkie strony - Todos os lados - Все стороны - Všechny strany - Todos los bandos - Tutti i lati - Toutes les factions - 全ての勢力 + + Make AI viewable in spectator + Macht KI-Einheiten den Zuschauern sichtbar + スペクテイターで AI 視点を可能に + Permette la visibilità delle AI in spettatore + 開啟此功能後可在觀察者模式下觀察AI單位。 + 开启此功能后可在观察者模式下观察AI单位。 Camera modes @@ -180,9 +68,12 @@ Modalità camera Mode de caméra カメラ モード + 카메라 모드 + 摄影机模式 + 攝影機模式 - Camera modes that can be used. + Camera modes that can be used Verwendbare Kameramodi Tryby kamery, jakie mogą być używane. Modos de camera que podem ser utilizados @@ -192,6 +83,9 @@ Modalità che la camera può utilizzare. Modes de caméra qui peuvent être utilisés カメラ モードを使えます。 + 사용할 수 있는 카메라 모드들 입니다 + 设定可使用的摄影机模式 + 設定可使用的攝影機模式 All @@ -204,38 +98,24 @@ Tutte Tous 全て + 모두 + 所有 + 所有 - - Free only - Nur freie Kamera - Tylko wolna - Somente livre - Только свободная - Pouze volná - Solo libre - Solo libera - Libre seulement - 自由視点のみ - - - Internal only - Erste Person //Bitte überprüfen! - Tylko wewnętrznaSomente internaТолько внутренняяPouze pohled z první osobySolo internaSolo internaInterne seulement一人称視点のみ - - External only - Dritte Person //Bitte überpfüfen! - Tylko zewnętrznaSomente externaТолько внешняяPouze pohled z třetí osobySolo externaSolo esternaExterne seulement三人称視点のみ - Internal and external - Erste und dritte Person - Wewnętrzna i zewnętrzna - Interna e externa - Внутренняя и внешняя - Pohled z první a třetí osoby - Interna y externa - Interna ed Esterna - Interne et externe - 一人称と三人称視点 + 1PP and 3PP + 1ère et 3e personne + 1.ª y 3.ª persona + 1° e 3° pers + 1 i 3 os. + первого а также третьего + 1PP und 3PP + 1. a 3. osoby + 1ª e 3ª pessoa + 1PP 과 3PP 카메라 + 1PP と 3PP カメラ + 第一人稱與第三人稱 + 第一人称与第三人称 Vision modes @@ -248,9 +128,12 @@ Modalità visuali Modes de vision ビジョン モード + 시야 모드 + 视觉模式 + 視覺模式 - Vision modes that can be used. + Vision modes that can be used Sichtmodi die verwendet werden können. Tryby wizji, jakie mogą być używane. Modos de visão que podem ser utilizados @@ -260,6 +143,9 @@ Modalità visuali che possono essere usate. Modes de visions qui peuvent être utilisés ビジョン モードを使えます。 + 사용할 수 있는 시야 모드들 입니다 + 设定可使用的视觉模式 + 設定可使用的視覺模式 Night vision @@ -272,6 +158,9 @@ Visione Notturna Vision nocturne 夜間暗視 + 야간투시경 + 夜视 + 夜視 Thermal imaging @@ -284,31 +173,25 @@ Visione Termica Vision thermique 熱源画像 + 열화상 + 热成像 + 熱成像 - - Spectator Units - Zuschauereinheiten - Jednostki obserwatora - Unidades espectadoras - Юниты - Unidades espectador - Jednotky pozorovatele - Unità Osservabili - Unités spectatrices - スペクテイター ユニット - - - Spectator Controls - Zuschauersteuerung - Sterowanie obserwatorem - Controle do espectador - Управление спектатором - Controles de espectador - Ovládání pozorovatele - Controlli Osservatore - Contrôles de spectateur - スペクテイター操作 + + Engineer + Pionier + Mechanik + Engenheiro + Инженер + Inženýr + Ingeniero + Geniere + Ingénieur + 工兵 + 정비공 + 工兵 + 工兵 Free @@ -321,15 +204,10 @@ Libera Libre 自由視点 + 자유 + 自由模式 + 自由模式 - - Internal - Erste Person //Bitte überprüfen! - WewnętrznaInternaВнутренняяPohled z první osobyInternaInternaInterne一人称視点 - - External - Dritte Person //Bitte überprüfen! - ZewnętrznaExternaВнешняяPohled z třetí osobyExternaEsternaExterne三人称視点 Normal Normal @@ -341,6 +219,9 @@ Normale Normale 通常 + 정상 + 正常 + 正常 Night @@ -353,6 +234,9 @@ Notturno Nuit 暗視装置 + 야간 + 夜视 + 夜視 Thermal @@ -365,271 +249,26 @@ Termico Thermique 熱源画像 + 열상 + 热成像 + 熱成像 - - Free Camera - Freie Kamera - Kamera swobodna - Câmera livre - Свободная камера - Volná Kamera - Cámara libre - Camera Libera - Caméra libre - 自由視点 + + Icons + Icons + アイコン + Icone + 單位圖示 + 单位图示 - - Camera Forward - Kamera vor - Kamera naprzód - Câmera para frente - Камера вперед - Vpřed (Kamera) - Cámara delantera - Camera Avanti - Caméra en avant - カメラを前に - - - Camera Backward - Kamera zurück - Kamera w tył - Câmera para trás - Камера назад - Zpět (Kamera) - Cámara trasera - Camera Indietro - Caméra en arrière - カメラを後ろに - - - Camera Left - Kamera links - Kamera w lewo - Câmera para esquerda - Камера влево - Doleva (Kamera) - Cámara izquierda - Camera Sinistra - Caméra à gauche - カメラを左に - - - Camera Right - Kamera rechts - Kamera w prawo - Câmera para direita - Камера вправо - Doprava (Kamera) - Cámara derecha - Camera Destra - Caméra à droite - カメラを右に - - - Camera Up - Kamera hoch - Kamera w górę - Câmera para cima - Камера вверх - Nahoru (Kamera) - Cámara arriba - Camera Su - Caméra en haut - カメラを上に - - - Camera Down - Kamera runter - Kamera w dół - Câmera para baixo - Камера вниз - Dolů (Kamera) - Cámara abajo - Camera Giù - Caméra en bas - カメラを下に - - - Pan Camera - Kamera mitschwenken - Panoramowanie - Câmera panorâmica - Панорамирование - Cámara panorámica - Otáčet kameru - Camera Panoramica - Tourner la caméra - カメラを振る - - - Dolly Camera - Kamerafahrt - Płynna kamera - Câmera dolly - Рельсовая камера - Cámara dolly - Posouvat kameru - Camera dolly - Bouger la caméra - カメラを動かす - - - Lock Camera to Target - Kamera Ziel verfolgen - Zablokuj kamerę na celu - Travar câmera em alvo - Зафиксировать камеру на цели - Zamknout kameru na Cíl - Fijar cámara al objetivo - Blocca la camera su obbiettivo - Verrouiller la caméra sur la cible - カメラを目標に固定 - - - Speed Boost - Geschwindigkeitserhöhung - Przyśpieszenie kamery - Aumento de velocidade - Ускорение камеры - Aumento de velocidad - Zrychlení kamery - Aumento Velocità - Boost de vitesse - 速度の増加 - - - Interface - Nuteroberfläche - Interfejs - Interface - Интерфейс - Rozhraní - Interfaz - Interfaccia - Interface - インターフェイス - - - Toggle Interface - Nutzeroberfläche umschalten - Przełącz interfejs - Alternar interface - Переключить интерфейс - Zobrazit/skrýt rozhraní - Conmutar - Apri Interfaccia - Bascule de l'interface - インターフェイスをトグル - - - Toggle Unit Icons - Einheitensymbole umschalten - Przełącz ikony jednostek - Alternar ícone de unidades - Вкл./выкл. иконки юнитов - Zobrazit/skrýt ikony jednotek - Conmutar iconos de unidad - Apri Icone Unità - Bascule des icônes des unités - ユニット アイコンをトグル - - - Toggle Unit List - Einheitenliste umschalten - Przełącz listę jednostek - Alternar lista de unidades - Вкл./выкл. список юнитов - Zobrazit/skrýt seznam jednotek - Conmutar lista de unidades - Apri Lista Unità - Bascule de la liste des unités - ユニット一覧をトグル - - - Toggle Toolbar - Werkzeuge umschalten - Przełącz pasek narzędzi - Alternar barra de ferramentas - Вкл./выкл. тулбар - Conmutar barra de herramientas - Zobrazit/skrýt spodní panel - Apri Barra degli Strumenti - Bascule de la barre d'outils - ツールバーをトグル - - - Toggle Compass - Kompass umschalten - Przełącz kompas - Alternar bússola - Вкл./выкл. компас - Zobrazit/skrýt kompas - Conmutar brújula - Apri Bussola - Basculer le compas - 方位磁石をトグル - - - Toggle Map - Karte umschalten - Przełącz mapę - Alternar mapa - Вкл./выкл. карту - Zobrazit/skrýt mapu - Conmutar map - Apri Mappa - Basculer la carte - 地図をトグル - - - Toggle Help - Hilfe umschalten - Przełącz pomoc - Alternar ajuda - Вкл./выкл. помощь - Zobrazit/skrýt ovládání - Conmutar ayuda - Apri Aiuti - Basculer l'aide - ヘルプをトグル - - - Camera Attributes - Kameraeigenschaften - Atrybuty kamery - Atributos de câmera - Атрибуты камеры - Atributos de cámara - Atributy kamery - Attributi Camera - Propriétés de la caméra - カメラ高度 - - - Next Camera - Nächste Kamera - Następna kamera - Próxima câmera - Следующая камера - Následující kamera - Siguiente cámara - Prossima Camera - Caméra suivante - 次のカメラ - - - Previous Camera - Vorherige Kamera - Poprzednia kamera - Câmera anterior - Предыдущая камера - Předchozí kamera - Anterior cámara - Precedente Camera - Caméra précédente - 前のカメラ + + Projectiles + Geschosse + 弾道表示 + Proiettili + 顯示彈道 + 显示弹道 Next Unit @@ -639,9 +278,12 @@ Следующий юнит Následující jednotka Siguiente unidad - Prossima Unità + Unità Successiva Unité suivante 次のユニット + 다음 인원 + 下个单位 + 下個單位 Previous Unit @@ -651,105 +293,28 @@ Предыдущий юнит Předchozí jednotka Anterior unidad - Precedente Unità + Unità Precedente Unité précédente 前のユニット + 이전 인원 + 上个单位 + 上個單位 - Next Vision Mode - Nächster Sichtmodus - Następny tryb wizji - Próximo modo de visão - Следующий режим видения - Siguiente modo de visión - Následující mód zobrazení - Prossima Modalità Visiva - Mode de vision suivant - 次のビジョン モード + Vision Mode + Sichtmodus + ビジョン モード + Modalità Visiva + 視覺模式 + 视觉模式 - - Previous Vision Mode - Vorheriger Sichtmodus - Poprzedni tryb wizji - Modo de visão anterior - Предыдущий режим видения - Anterior modo de visión - Předchozí mód zobrazení - Precedente Modalità Visiva - Mode de vision précédent - 前のビジョン モード - - - Adjust Zoom - Vergrößerung einstellen - Reguluj zoom - Ajustar zoom - Настроить зум - Regulovat přiblížení - Ajustar aumento - Aggiusta Zoom - Ajuster le zoom - 拡大倍率を調節 - - - Adjust Speed - Geschwindigkeit einstellen - Reguluj prędkość - Ajuster velocidade - Настроить скорость - Regulovat rychlost - Ajustar velocidad - Aggiusta Velocità - Ajuster la vitesse - 速度を調節 - - - Increment Zoom - Vergrößern - Reguluj zoom (krok) - Incrementar zoom - Увеличить зум - Incrementar aumento - Regulovat přiblížení (pomalu) - Aumenta Zoom - Augmenter le zoom - 拡大倍率を増やす - - - Increment Speed - Geschwindkeit erhöhen - Reguluj prędkość (krok) - Incrementar velocidade - Увеличить скорость - Incrementar velocidad - Regulovat rychlost (pomalu) - Aumenta Velocità - Augmenter la vitesse - 速度を増やす - - - Reset Zoom - Vergrößerung zurücksetzen - Resetuj zoom - Redefinir zoom - Сбросить зум - Obnovit přiblížení - Reiniciar aumento - Resetta Zoom - RAZ zoom - 拡大倍率を初期化 - - - Reset Speed - Geschwindigkeit zurücksetzen - Resetuj prędkość - Redefinir velocidade - Сбросить скорость - Obnovit rychlost - Reiniciar velocidad - Resetta Velocità - RAZ vitesse - 速度を初期化 + + Slow Speed + Langsam + 速度低下 + Bassa Velocità + 慢速度 + 慢速度 - \ No newline at end of file + diff --git a/addons/spectator/ui.hpp b/addons/spectator/ui.hpp new file mode 100644 index 0000000000..f26572f6d5 --- /dev/null +++ b/addons/spectator/ui.hpp @@ -0,0 +1,459 @@ +class RscButton; +class RscControlsGroup; +class RscControlsGroupNoScrollbars; +class RscListNBox { + class ScrollBar; +}; +class RscMapControl; +class RscPicture; +class RscPictureKeepAspect; +class RscText; +class RscToolbox; +class RscTree; + +// Based on RscDisplayEGSpectator (sadly Arma doesn't like display inheritance) +class GVAR(display) { + idd = IDD_SPEC_DISPLAY; + enableSimulation = 1; + movingEnable = 0; + closeOnMissionEnd = 1; + + onLoad = QUOTE(with uiNameSpace do {GVAR(display) = _this select 0};); + + onKeyDown = QUOTE(_this call FUNC(ui_handleKeyDown)); + onKeyUp = QUOTE(_this call FUNC(ui_handleKeyUp)); + onMouseMoving = QUOTE(_this call FUNC(ui_handleMouseMoving)); + onChildDestroyed = QUOTE(_this call FUNC(ui_handleChildDestroyed)); + + class ControlsBackground { + class MouseHandler: RscText { + idc = IDC_MOUSE; + + onMouseButtonDown = QUOTE(_this call FUNC(ui_handleMouseButtonDown)); + onMouseButtonUp = QUOTE(if ((_this select 1) == 1) then { GVAR(holdingRMB) = false; };); + onMouseButtonDblClick = QUOTE(_this call FUNC(ui_handleMouseButtonDblClick)); + onMouseZChanged = QUOTE(_this call FUNC(ui_handleMouseZChanged)); + + text = ""; + x = "safeZoneXAbs"; + y = "safeZoneY"; + w = "safeZoneWAbs"; + h = "safeZoneH"; + colorBackground[] = {1,1,1,0}; + style = 16; + }; + }; + class Controls { + class List: RscTree { + idc = IDC_LIST; + + onMouseEnter = QUOTE([false] call FUNC(ui_fadeList)); + onMouseExit = QUOTE([true] call FUNC(ui_fadeList)); + onTreeSelChanged = QUOTE([ARR_2(false,_this)] call FUNC(ui_handleListClick)); + onTreeDblClick = QUOTE([ARR_2(true,_this)] call FUNC(ui_handleListClick)); + + x = "safeZoneX"; + y = safeZoneY + H_PART(1.5); + w = W_PART(13.5); + h = safeZoneH - H_PART(1.5); + + disableKeyboardSearch = 1; + multiselectEnabled = 0; + colorBorder[] = {0,0,0,0}; + colorBackground[] = {0,0,0,0.75}; + expandOnDoubleclick = 1; + fade = 0.8; + shadow = 1; + colorLines[] = {0,0,0,0}; + class ScrollBar { + width = 0; + height = 0; + scrollSpeed = 0.1; + color[] = {1,1,1,0}; + }; + }; + class Tabs: RscToolbox { + idc = IDC_TABS; + + //onToolBoxSelChanged = QUOTE(_this call FUNC(ui_handleTabSelected)); + onMouseEnter = QUOTE([false] call FUNC(ui_fadeList)); + onMouseExit = QUOTE([true] call FUNC(ui_fadeList)); + + x = "safeZoneX"; + y = "safezoneY"; + w = W_PART(13.5); + h = H_PART(1.5); + + fade = 0.5; + rows = 1; + columns = 1; + strings[] = {"$STR_A3_Spectator_Entities"}; + values[] = {0}; + sizeEx = H_PART(1); + colorBackground[] = {0,0,0,0.75}; + colorSelectedBg[] = {0,0,0,0.65}; + }; + class CameraTypesGroup: RscControlsGroupNoScrollbars { + idc = IDC_CAM_TYPES; + x = X_PART(15.5); + y = safezoneY + safezoneH - H_PART(2.38); + w = W_PART(8.6); + h = 2.6; + class controls { + class CameraTypesBackground: RscText { + x = W_PART(0.6); + y = H_PART(0.4); + w = W_PART(7.5); + h = H_PART(2); + colorBackground[] = {0,0,0,0.75}; + }; + class Free: RscButton { + style = 48; + idc = IDC_FREE; + + onButtonClick = QUOTE([MODE_FREE] call FUNC(cam_setCameraMode)); + + x = W_PART(1.3); + y = H_PART(0.8); + w = W_PART(1.63); + h = H_PART(1.37); + + colorBackground[] = {0,0,0,0}; + colorBackgroundDisabled[] = {0,0,0,0}; + colorBackgroundActive[] = {0,0,0,0}; + colorFocused[] = {0,0,0,0}; + text = CAM_ICON_FREE; + tooltip = "$STR_A3_Spectator_free_camera_tooltip"; + }; + class Follow: RscButton { + style = 48; + idc = IDC_FOLLOW; + + onButtonClick = QUOTE([MODE_FOLLOW] call FUNC(cam_setCameraMode)); + + x = W_PART(3.6); + y = H_PART(0.8); + w = W_PART(1.63); + h = H_PART(1.37); + + colorBackground[] = {0,0,0,0}; + colorBackgroundDisabled[] = {0,0,0,0}; + colorBackgroundActive[] = {0,0,0,0}; + colorFocused[] = {0,0,0,0}; + text = CAM_ICON_FOLLOW; + tooltip = "$STR_A3_Spectator_3pp_camera_tooltip"; + }; + class Fps: RscButton { + style = 48; + idc = IDC_FPS; + + onButtonClick = QUOTE([MODE_FPS] call FUNC(cam_setCameraMode)); + + x = W_PART(5.8); + y = H_PART(0.8); + w = W_PART(1.63); + h = H_PART(1.37); + + colorBackground[] = {0,0,0,0}; + colorBackgroundDisabled[] = {0,0,0,0}; + colorBackgroundActive[] = {0,0,0,0}; + colorFocused[] = {0,0,0,0}; + text = CAM_ICON_FPS; + tooltip = "$STR_A3_Spectator_1pp_camera_tooltip"; + + }; + }; + }; + class MapGroup: RscControlsGroupNoScrollbars { + idc = IDC_MAP_GROUP; + x = 0; + y = 0.1; + w = 1; + h = 0.8; + class controls { + class MapHeader: RscText { + x = 0; + y = 0; + w = 1; + h = 0.05; + colorBackground[] = {0,0,0,0.75}; + }; + class MapFooter: RscText { + idc = IDC_MAP_FOOTER; + x = 0; + y = 0.75; + w = 1; + h = 0.05; + text = ""; + style = 2; + colorBackground[] = {0,0,0,0.75}; + sizeEx = H_PART(1); + }; + class GameTimeText: RscText { + idc = IDC_TIME; + x = 0.01; + y = 0.76; + w = 0.29; + h = 0.03; + text = "00:00:00"; + sizeEx = H_PART(1); + }; + class MapTitle: RscText { + idc = IDC_MAP_TITLE; + x = 0.01; + y = 0.01; + w = 0.69; + h = 0.03; + text = ""; + colorText[] = {1,1,1,1}; + sizeEx = H_PART(1); + }; + class SpectatorsCount: RscText { + idc = IDC_MAP_SPEC_NUM; + x = 0.97; + y = 0.01; + w = 0.03; + h = 0.03; + text = ""; + colorText[] = {1,1,1,1}; + sizeEx = H_PART(1); + }; + class SpectatorsIcon: RscPictureKeepAspect { + x = 0.94; + y = 0.01; + w = 0.03; + h = 0.03; + text = CAM_ICON_FPS_SELECTED; + }; + }; + }; + class Map: RscMapControl { + idc = IDC_MAP; + + onDraw = QUOTE(_this call FUNC(ui_handleMapDraw)); + onMouseButtonClick = QUOTE(_this call FUNC(ui_handleMapClick)); + + x = 0; + y = 0.15; + w = 1; + h = 0.7; + + maxSatelliteAlpha = 0.75; + colorBackground[] = {1,1,1,1}; + }; + class HelpBackground: RscText { + idc = IDC_HELP_BACK; + x = safezoneX + safezoneW - W_PART(12); + y = safezoneY + safezoneH - H_PART(8); + w = W_PART(12); + h = H_PART(8); + colorBackground[] = {0,0,0,0.75}; + }; + class Help: RscListNBox { + class ListScrollBar: ScrollBar {}; + disableOverflow = 0; + rowHeight = H_PART(1); + idc = IDC_HELP; + x = safezoneX + safezoneW - W_PART(12); + y = safezoneY + safezoneH - H_PART(12); + w = W_PART(12); + h = H_PART(12); + }; + class FocusInfo: RscControlsGroupNoScrollbars { + idc = IDC_WIDGET; + x = X_PART(12.9); + y = Y_PART(24); + w = W_PART(14.2); + h = H_PART(3.5); + class controls { + class UpperBackground: RscText { + x = 0; + y = 0; + w = W_PART(14.2); + h = H_PART(1.4); + colorBackground[] = {0,0,0,0.75}; + }; + class StatsBackground: RscText { + x = 0; + y = H_PART(1.5); + w = W_PART(6); + h = H_PART(2); + colorBackground[] = {0,0,0,0.75}; + }; + class WeaponBackground: RscText { + x = W_PART(6.1); + y = H_PART(1.5); + w = W_PART(6); + h = H_PART(2); + colorBackground[] = {1,1,1,0.4}; + }; + class ThrowableBackground: RscText { + x = W_PART(12.2); + y = H_PART(1.5); + w = W_PART(2); + h = H_PART(2); + colorBackground[] = {1,1,1,0.4}; + }; + class Name: RscText { + shadow = 0; + idc = IDC_WIDGET_NAME; + text = ""; + x = W_PART(0.1); + y = H_PART(0.1); + w = W_PART(10.8); + h = H_PART(1.2); + sizeEx = H_PART(1); + }; + class VehiclePos: RscPictureKeepAspect { + idc = IDC_WIDGET_VEHICLE_POS; + text = ""; + x = W_PART(11); + y = H_PART(0.2); + w = W_PART(1); + h = H_PART(1); + }; + class VehicleType: RscPicture { + idc = IDC_WIDGET_VEHICLE; + text = ""; + x = W_PART(12.1); + y = H_PART(0.2); + w = W_PART(2); + h = H_PART(1); + }; + class UnitType: RscPictureKeepAspect { + idc = IDC_WIDGET_UNIT; + text = ""; + x = W_PART(13.1); + y = H_PART(0.2); + w = W_PART(1); + h = H_PART(1); + }; + class Kills: RscPictureKeepAspect { + text = "a3\Ui_f\data\IGUI\Cfg\MPTable\infantry_ca.paa"; + x = W_PART(0.1); + y = H_PART(1.6); + w = W_PART(0.8); + h = H_PART(0.8); + }; + class LandKills: RscPictureKeepAspect { + text = "a3\Ui_f\data\IGUI\Cfg\MPTable\soft_ca.paa"; + x = W_PART(1.1); + y = H_PART(1.6); + w = W_PART(0.8); + h = H_PART(0.8); + }; + class ArmoredKills: RscPictureKeepAspect { + text = "a3\Ui_f\data\IGUI\Cfg\MPTable\armored_ca.paa"; + x = W_PART(2.1); + y = H_PART(1.6); + w = W_PART(0.8); + h = H_PART(0.8); + }; + class AirKills: RscPictureKeepAspect { + text = "a3\Ui_f\data\IGUI\Cfg\MPTable\air_ca.paa"; + x = W_PART(3.1); + y = H_PART(1.6); + w = W_PART(0.8); + h = H_PART(0.8); + }; + class Deaths: RscPictureKeepAspect { + text = "a3\Ui_f\data\IGUI\Cfg\MPTable\killed_ca.paa"; + x = W_PART(4.1); + y = H_PART(1.6); + w = W_PART(0.8); + h = H_PART(0.8); + }; + class Total: RscPictureKeepAspect { + text = "a3\Ui_f\data\IGUI\Cfg\MPTable\total_ca.paa"; + x = W_PART(5.1); + y = H_PART(1.6); + w = W_PART(0.8); + h = H_PART(0.8); + }; + class Kills_Count: RscText { + style = 2; + shadow = 0; + idc = IDC_WIDGET_KILLS; + text = ""; + x = W_PART(0.1); + y = H_PART(2.5); + w = W_PART(0.8); + h = H_PART(0.9); + sizeEx = H_PART(0.7); + }; + class LandKills_Count: RscText { + style = 2; + shadow = 0; + idc = IDC_WIDGET_LAND; + text = ""; + x = W_PART(1.1); + y = H_PART(2.5); + w = W_PART(0.8); + h = H_PART(0.9); + sizeEx = H_PART(0.7); + }; + class ArmoredKills_Count: RscText { + style = 2; + shadow = 0; + idc = IDC_WIDGET_ARMORED; + text = ""; + x = W_PART(2.1); + y = H_PART(2.5); + w = W_PART(0.8); + h = H_PART(0.9); + sizeEx = H_PART(0.7); + }; + class AirKills_Count: RscText { + style = 2; + shadow = 0; + idc = IDC_WIDGET_AIR; + text = ""; + x = W_PART(3.1); + y = H_PART(2.5); + w = W_PART(0.8); + h = H_PART(0.9); + sizeEx = H_PART(0.7); + }; + class Deaths_Count: RscText { + style = 2; + shadow = 0; + idc = IDC_WIDGET_DEATHS; + text = ""; + x = W_PART(4.1); + y = H_PART(2.5); + w = W_PART(0.8); + h = H_PART(0.9); + sizeEx = H_PART(0.7); + }; + class Total_Count: RscText { + style = 2; + shadow = 0; + idc = IDC_WIDGET_TOTAL; + text = ""; + x = W_PART(5.1); + y = H_PART(2.5); + w = W_PART(0.8); + h = H_PART(0.9); + sizeEx = H_PART(0.7); + }; + class WeaponPicture: RscPictureKeepAspect { + idc = IDC_WIDGET_WEAPON; + text = ""; + x = W_PART(6.2); + y = H_PART(1.6); + w = W_PART(5.8); + h = H_PART(1.8); + }; + class ThrowablePicture: RscPictureKeepAspect { + idc = IDC_WIDGET_THROWABLE; + text = ""; + x = W_PART(12.3); + y = H_PART(1.6); + w = W_PART(1.8); + h = H_PART(1.8); + }; + }; + }; + }; +}; + diff --git a/addons/spottingscope/CfgVehicles.hpp b/addons/spottingscope/CfgVehicles.hpp index 84ce5f177f..fa2574cb8d 100644 --- a/addons/spottingscope/CfgVehicles.hpp +++ b/addons/spottingscope/CfgVehicles.hpp @@ -43,7 +43,7 @@ class CfgVehicles { class ACE_Actions: ACE_Actions{ class ACE_MainActions: ACE_MainActions { - selection = "main_gun"; + selection = "main_turret_axis"; class ACE_Pickup { selection = ""; displayName = CSTRING(PickUp); diff --git a/addons/spottingscope/CfgWeapons.hpp b/addons/spottingscope/CfgWeapons.hpp index acdf7c910f..9f4368d2ac 100644 --- a/addons/spottingscope/CfgWeapons.hpp +++ b/addons/spottingscope/CfgWeapons.hpp @@ -1,7 +1,7 @@ class CfgWeapons { class ACE_ItemCore; - class InventoryItem_Base_F; + class CBA_MiscItem_ItemInfo; class ACE_SpottingScope: ACE_ItemCore { scope = 2; @@ -10,7 +10,7 @@ class CfgWeapons { picture = QPATHTOF(UI\w_spottingscope_ca.paa); model = QPATHTOF(data\ace_spottingscope.p3d); - class ItemInfo: InventoryItem_Base_F { + class ItemInfo: CBA_MiscItem_ItemInfo { mass = 40; }; }; diff --git a/addons/spottingscope/XEH_preInit.sqf b/addons/spottingscope/XEH_preInit.sqf index a7feade1c3..b47cf6628d 100644 --- a/addons/spottingscope/XEH_preInit.sqf +++ b/addons/spottingscope/XEH_preInit.sqf @@ -2,6 +2,8 @@ ADDON = false; +PREP_RECOMPILE_START; #include "XEH_PREP.hpp" +PREP_RECOMPILE_END; ADDON = true; diff --git a/addons/spottingscope/data/ace_spottingscope.p3d b/addons/spottingscope/data/ace_spottingscope.p3d index 969d0b37f5..2298b9c8f9 100644 Binary files a/addons/spottingscope/data/ace_spottingscope.p3d and b/addons/spottingscope/data/ace_spottingscope.p3d differ diff --git a/addons/spottingscope/functions/fnc_animateReticle.sqf b/addons/spottingscope/functions/fnc_animateReticle.sqf index 10bbf9b564..7fbf71fe23 100644 --- a/addons/spottingscope/functions/fnc_animateReticle.sqf +++ b/addons/spottingscope/functions/fnc_animateReticle.sqf @@ -8,6 +8,9 @@ * Return Value: * None * + * Example: + * [DISPLAY] call ace_spottingscope_fnc_animateReticle + * * Public: No */ #include "script_component.hpp" @@ -15,7 +18,7 @@ disableSerialization; params ["_display"]; -uinamespace setVariable [QGVAR(dlgSpottingScope), _display]; +uinamespace setVariable [QGVAR(dlgSpottingScope), _display]; private _ctrlReticle = _display displayCtrl IDC_RETICLE; private _ctrlBody = _display displayCtrl IDC_BODY; diff --git a/addons/spottingscope/stringtable.xml b/addons/spottingscope/stringtable.xml index 3470fb9db3..fdf621a29e 100644 --- a/addons/spottingscope/stringtable.xml +++ b/addons/spottingscope/stringtable.xml @@ -1,4 +1,4 @@ - + @@ -13,6 +13,9 @@ Megfigyelő távcső Luneta de observador 観測用スコープ + 감적 망원경 + 观测镜 + 觀測鏡 Pick up Spotting Scope @@ -26,6 +29,9 @@ Mefgigy. távcső felvétele Pegar luneta de observador 観測用スコープを拾う + 감적 망원경 줍기 + 捡起观测镜 + 撿起觀測鏡 Place Spotting Scope @@ -39,6 +45,9 @@ Megfigy. távcső elhelyezése Colocar luneta de observador 観測用スコープを置く + 감적 망원경 배치 + 放置观测镜 + 放置觀測鏡 - \ No newline at end of file + diff --git a/addons/switchunits/XEH_postInit.sqf b/addons/switchunits/XEH_postInit.sqf index dc143bc6ac..3e4fbdf46b 100644 --- a/addons/switchunits/XEH_postInit.sqf +++ b/addons/switchunits/XEH_postInit.sqf @@ -21,7 +21,7 @@ if (missionNamespace getVariable [QGVAR(EnableSwitchUnits), false]) then { [player] call FUNC(startSwitchUnits); } else { ["ace_settingChanged", { - PARAMS_2(_name,_value); + params ["_name", "_value"]; if ((_name == QGVAR(EnableSwitchUnits)) && {_value}) then { [player] call FUNC(startSwitchUnits); }; diff --git a/addons/switchunits/XEH_preInit.sqf b/addons/switchunits/XEH_preInit.sqf index a7feade1c3..b47cf6628d 100644 --- a/addons/switchunits/XEH_preInit.sqf +++ b/addons/switchunits/XEH_preInit.sqf @@ -2,6 +2,8 @@ ADDON = false; +PREP_RECOMPILE_START; #include "XEH_PREP.hpp" +PREP_RECOMPILE_END; ADDON = true; diff --git a/addons/switchunits/functions/fnc_handleMapClick.sqf b/addons/switchunits/functions/fnc_handleMapClick.sqf index b0984631d7..db016ac8f3 100644 --- a/addons/switchunits/functions/fnc_handleMapClick.sqf +++ b/addons/switchunits/functions/fnc_handleMapClick.sqf @@ -3,7 +3,7 @@ * Switches to a unit close to a clicked map position * * Arguments: - * 0: Faction + * 0: Faction * 0: unit * 1: sides * 1: Map Position diff --git a/addons/switchunits/stringtable.xml b/addons/switchunits/stringtable.xml index 625e0090fe..18c43bfe2d 100644 --- a/addons/switchunits/stringtable.xml +++ b/addons/switchunits/stringtable.xml @@ -13,18 +13,24 @@ Cambia unità Trocado de unidade ユニットを切り替え + 切换单位 + 切換單位 + 인원 전환 Trying to switch Versuche zu Wechseln Snažím se přehodit Próba zmiany - Sto provando a cambiare + Provando a cambiare Intentando cambiar Essaye de basculer Tentando trocar Попытка переключения 切り替えを試す + 전환 시도중 + 尝试切换中 + 嘗試切換中 This unit is too close to the enemy. @@ -38,6 +44,9 @@ Questa unità è troppo vicina al nemico. Essa unidade está muito perto do inimigo. このユニットは敵に近すぎます。 + 그 인원은 적과 너무 가깝습니다. + 这单位太接近敌人了 + 這單位太接近敵人了 SwitchUnits System @@ -51,6 +60,9 @@ Переключение между юнитами Sistema Cambio Unità SwitchUnits システム + 切换单位系统 + 切換單位系統 + 인원 전환 시스템 Switch to West? @@ -63,7 +75,10 @@ Átváltás BLUFOR-ra? На синих? Cambia per BLUFOR? - ウエストへ切り替えますか? + 同盟軍へ切り替えますか? + 切换至蓝方? + 切換至藍方? + 청군으로 전환합니까? Allow switching to west units? @@ -76,7 +91,10 @@ Nyugat-fakciós egységekre való váltás engedélyezése? Разрешить переключаться на синих юнитов? Consenti passaggio ad unità BLUFOR? - ウエスト側ユニットへ切り替えられるようにしますか? + 同盟軍側ユニットへ切り替えられるようにしますか? + 允许切换至蓝方? + 允許切換至藍方? + 청군 인원으로 전환합니까? Switch to East? @@ -89,7 +107,10 @@ Átváltás OPFOR-ra? На красных? Cambia per OPFOR? - イースト側へ切り替えますか? + OPFOR軍側へ切り替えますか? + 切换至红方? + 切換至紅方? + 대항군으로 전환합니까? Allow switching to east units? @@ -102,7 +123,10 @@ Kelet-fakciós egységekre való váltás engedélyezése? Разрешить переключаться на красных юнитов? Consenti passaggio ad unità OPFOR? - イースト側ユニットへ切り替えられるようにしますか? + OPFOR軍側ユニットへ切り替えられるようにしますか? + 允许切换至红方? + 允許切換至紅方? + 대항군 인원으로 전환합니까? Switch to Independent? @@ -115,7 +139,10 @@ Átváltás INDFOR-ra? На независимых? Cambia per INDFOR? - インデペンデントへ切り替えますか? + 独立軍へ切り替えますか? + 切换至独立方? + 切換至獨立方? + 독립군 으로 전환합니까? Allow switching to independent units? @@ -128,7 +155,10 @@ Független egységekre való váltás engedélyezése? Разрешить переключаться на независимых юнитов? Consenti passaggio ad unità INDFOR? - インデペンデント側ユニットへ切り替えられるようにしますか? + 独立軍側ユニットへ切り替えられるようにしますか? + 允许切换至独立方? + 允許切換至獨立方? + 독립군 인원으로 전환합니까? Switch to Civilian? @@ -141,7 +171,10 @@ Átváltás civilre? На гражданских? Cambia per Civili? - シビリアンへ切り替えますか? + 市民へ切り替えますか? + 민간인으로 전환합니까? + 切换至平民方? + 切換至平民方? Allow switching to civilian units? @@ -154,7 +187,10 @@ Civil egységekre való váltás engedélyezése? Разрешить переключаться на гражданских юнитов? Consenti passaggio ad unità civili? - シビリアン側ユニットへ切り替えられるようにしますか? + 市民側ユニットへ切り替えられるようにしますか? + 민간인으로 전환하는걸 허가합니까? + 允许切换至平民方? + 允許切換至平民方? Enable Safe Zone? @@ -168,6 +204,9 @@ Безопасная зона Abilita Zona Sicura? 安全地帯を有効にしますか? + 안전 지대 활성화? + 启用安全区? + 啟用安全區? Enable a safe zone around enemy units? Players can't switch to units inside of the safe zone. @@ -181,6 +220,9 @@ Включить безопасную зону вокруг вражеских юнитов? Игроки не могут переключаться на юнитов, находящихся в безопасной зоне. Abilita una zona sicura attorno ad unità nemiche? I giocatori non possono cambiare ad unità dentro la zona sicura. 敵ユニットから逃れる安全地帯を有効にしますか?プレイヤーは安全地帯内のユニットへ切り替えできません。 + 적 주위로 안전 지대를 활성화합니까? 안전 지대 내에서는 플레이어가 인원 전환을 할 수 없습니다. + 启用敌方周围安全地带? 玩家不能切换到安全区内的单位 + 啟用敵方周圍安全地帶? 玩家不能切換到安全區內的單位 Safe Zone Radius @@ -194,6 +236,9 @@ Радиус безопасной зоны Raggio Zona Sicura 安全地帯の半径 + 안전 지대 반경 + 安全区半径 + 安全區半徑 The safe zone around players from a different team. Default: 200 @@ -206,7 +251,10 @@ A biztonságos zóna más csapatból lévő játékosok körül. Alapértelmezett: 200 Радиус безопасной зоны вокруг ироков из противоположной команды. По-умолчанию: 200 La zona sicura attorno ai giocatori di un team diverso. Default: 200 - 別のチームへのプレイヤーの周囲にある安全地帯の範囲。標準:200 + 別のチームへのプレイヤーの周囲にある安全地帯の範囲。標準: 200 + 다른 진영으로 부터의 플레이어 안전 지대. 기본설정: 200 + 安全区的范围。预设值:200 + 安全區的範圍。預設值:200 Module allows you to switch side during the game. @@ -219,6 +267,9 @@ Questo modulo ti permette di cambiare lato durante la partita. El módulo permite a las unidades cambiar de bando durante el juego. モジュールはゲームにおいて、陣営の切り替えを有効にします。 + 이 모듈은 당신을 게임 중에 진영을 바꿀 수 있게 해줍니다. + 此模块允许你在游戏中切换至另一方 + 此模塊允許你在遊戲中切換至另一方 - \ No newline at end of file + diff --git a/addons/tacticalladder/XEH_preInit.sqf b/addons/tacticalladder/XEH_preInit.sqf index a7feade1c3..b47cf6628d 100644 --- a/addons/tacticalladder/XEH_preInit.sqf +++ b/addons/tacticalladder/XEH_preInit.sqf @@ -2,6 +2,8 @@ ADDON = false; +PREP_RECOMPILE_START; #include "XEH_PREP.hpp" +PREP_RECOMPILE_END; ADDON = true; diff --git a/addons/tacticalladder/functions/fnc_cancelTLdeploy.sqf b/addons/tacticalladder/functions/fnc_cancelTLdeploy.sqf index b009028c93..f66dd79a25 100644 --- a/addons/tacticalladder/functions/fnc_cancelTLdeploy.sqf +++ b/addons/tacticalladder/functions/fnc_cancelTLdeploy.sqf @@ -31,6 +31,7 @@ GVAR(ladder) animate ["rotate", 0]; { GVAR(ladder) animate [_x, 0]; + true } count __ANIMS; // remove mouse buttons and hint diff --git a/addons/tacticalladder/functions/fnc_confirmTLdeploy.sqf b/addons/tacticalladder/functions/fnc_confirmTLdeploy.sqf index 3703fe1f47..1eb47abf48 100644 --- a/addons/tacticalladder/functions/fnc_confirmTLdeploy.sqf +++ b/addons/tacticalladder/functions/fnc_confirmTLdeploy.sqf @@ -21,10 +21,8 @@ params ["_unit", "_ladder"]; // enable running again [_unit, "forceWalk", "ACE_Ladder", false] call EFUNC(common,statusEffect_set); -private ["_pos1", "_pos2"]; - -_pos1 = getPosASL _ladder; -_pos2 = AGLToASL (_ladder modelToWorld (_ladder selectionPosition "check2")); +private _pos1 = getPosASL _ladder; +private _pos2 = AGLToASL (_ladder modelToWorld (_ladder selectionPosition "check2")); if (lineIntersects [_pos1, _pos2, _ladder]) exitWith {false}; diff --git a/addons/tacticalladder/functions/fnc_deployTL.sqf b/addons/tacticalladder/functions/fnc_deployTL.sqf index b0eb1e0f68..9df416dca7 100644 --- a/addons/tacticalladder/functions/fnc_deployTL.sqf +++ b/addons/tacticalladder/functions/fnc_deployTL.sqf @@ -21,16 +21,15 @@ if (backpack _unit != 'ACE_TacticalLadder_Pack') exitWith {}; removeBackpack _unit; -private ["_pos", "_offset", "_ladder"]; -_pos = _unit modelToWorld [0,0,0]; -_offset = if ((_unit call CBA_fnc_getUnitAnim select 0) == "prone") then { 1 } else {0.8}; +private _pos = _unit modelToWorld [0,0,0]; +private _offset = if ((_unit call CBA_fnc_getUnitAnim select 0) == "prone") then { 1 } else {0.8}; _pos set [0, (_pos select 0) + (sin getDir _unit) * _offset]; _pos set [1, (_pos select 1) + (cos getDir _unit) * _offset]; _pos set [2, [_unit] call CBA_fnc_realHeight]; -_ladder = "ACE_TacticalLadder" createVehicle _pos; +private _ladder = "ACE_TacticalLadder" createVehicle _pos; _ladder setPos _pos; _ladder setDir getDir _unit; diff --git a/addons/tacticalladder/functions/fnc_handleInteractMenuOpened.sqf b/addons/tacticalladder/functions/fnc_handleInteractMenuOpened.sqf index c7187acd55..4c46ea46c2 100644 --- a/addons/tacticalladder/functions/fnc_handleInteractMenuOpened.sqf +++ b/addons/tacticalladder/functions/fnc_handleInteractMenuOpened.sqf @@ -8,6 +8,9 @@ * Return Value: * None * + * Example: + * [bob] call ace_tacticalladder_fnc_handleInteractMenuOpened + * * Public: No */ #include "script_component.hpp" diff --git a/addons/tacticalladder/functions/fnc_handleKilled.sqf b/addons/tacticalladder/functions/fnc_handleKilled.sqf index c5d6aa1314..742231900c 100644 --- a/addons/tacticalladder/functions/fnc_handleKilled.sqf +++ b/addons/tacticalladder/functions/fnc_handleKilled.sqf @@ -8,6 +8,9 @@ * Return Value: * None * + * Example: + * [bob] call ace_tacticalladder_fnc_handleKilled + * * Public: No */ #include "script_component.hpp" diff --git a/addons/tacticalladder/functions/fnc_handlePlayerChanged.sqf b/addons/tacticalladder/functions/fnc_handlePlayerChanged.sqf index 07118acbaf..713c75df7f 100644 --- a/addons/tacticalladder/functions/fnc_handlePlayerChanged.sqf +++ b/addons/tacticalladder/functions/fnc_handlePlayerChanged.sqf @@ -9,6 +9,9 @@ * Return Value: * None * + * Example: + * [bob, kevin] call ace_tacticalladder_fnc_handlePlayerChanged + * * Public: No */ #include "script_component.hpp" diff --git a/addons/tacticalladder/functions/fnc_handleScrollWheel.sqf b/addons/tacticalladder/functions/fnc_handleScrollWheel.sqf index e7d4136526..ea8156a81d 100644 --- a/addons/tacticalladder/functions/fnc_handleScrollWheel.sqf +++ b/addons/tacticalladder/functions/fnc_handleScrollWheel.sqf @@ -20,10 +20,9 @@ params ["_scroll"]; if (isNull GVAR(ladder)) exitWith { false }; if (ACE_Modifier == 0) then { - private ["_currentStep"]; // Lengthening if (_scroll > 0) then { - _currentStep = GVAR(currentStep); + private _currentStep = GVAR(currentStep); if (_currentStep == 11) exitWith {}; _currentStep = _currentStep + 1; if (GVAR(ladder) animationPhase (format["extract_%1", _currentStep]) == 0) then { @@ -32,17 +31,17 @@ if (ACE_Modifier == 0) then { }; }; if (_scroll < 0) then { - _currentStep = GVAR(currentStep); + private _currentStep = GVAR(currentStep); if (_currentStep == 3) exitWith {}; if (GVAR(ladder) animationPhase (format["extract_%1", _currentStep]) == 1) then { GVAR(ladder) animate [format["extract_%1", _currentStep], 0]; GVAR(currentStep) = _currentStep - 1; }; }; -} else { +};// else { // Tilting (disabled due to sinking, interaction point offset and unsuitable animation) //GVAR(currentAngle) = 0 max (GVAR(currentAngle) + _scroll) min 30; //GVAR(ladder) animate ["rotate", GVAR(currentAngle)]; -}; +//}; true diff --git a/addons/tacticalladder/functions/fnc_handleUnconscious.sqf b/addons/tacticalladder/functions/fnc_handleUnconscious.sqf index e9ce28d524..287e465e30 100644 --- a/addons/tacticalladder/functions/fnc_handleUnconscious.sqf +++ b/addons/tacticalladder/functions/fnc_handleUnconscious.sqf @@ -8,12 +8,17 @@ * Return Value: * None * + * Example: + * [bob] call ace_tacticalladder_fnc_handleUnconscious + * * Public: No */ #include "script_component.hpp" params ["_unit"]; +if (!local _unit) exitWith {}; + if (!isNull (GETMVAR(ladder,objNull)) && {GVAR(ladder) in attachedObjects _unit}) then { [_unit, GVAR(ladder)] call FUNC(cancelTLdeploy); }; diff --git a/addons/tacticalladder/stringtable.xml b/addons/tacticalladder/stringtable.xml index 6dda5db48e..e94a292bc1 100644 --- a/addons/tacticalladder/stringtable.xml +++ b/addons/tacticalladder/stringtable.xml @@ -1,4 +1,4 @@ - + @@ -13,6 +13,9 @@ Teleszkopikus létra Escada telescópica タクティカル ラダー + 로프 사다리 + 伸缩梯子 + 伸縮梯子 Deploy ladder @@ -26,6 +29,9 @@ Létra lerakása Implantar escada ラダーを設置 + 사다리 배치 + 布署梯子 + 佈署梯子 Drop ladder @@ -39,6 +45,9 @@ Létra eldobása Derrubar escada ラダーを落とす + 사다리 놓기 + 降下梯子 + 降下梯子 Extend @@ -51,6 +60,9 @@ Extender Déployer 伸ばす + 늘리기 + 伸长梯子 + 伸長梯子 +Ctrl tilt @@ -63,6 +75,9 @@ +Ctrl incliner +Ctrl per inclinare +Ctrl で傾ける + +컨트롤키 기울이기 + +Ctrl 倾斜 + +Ctrl 傾斜 Position ladder @@ -76,6 +91,9 @@ Létra elhelyezése Posicionar escada ラダーの位置 + 사다리 위치 + 梯子位置 + 梯子位置 Pickup ladder @@ -89,6 +107,9 @@ Létra felvétele Pegar escada ラダーを拾う + 사다리 줍기 + 捡起梯子 + 撿起梯子 - \ No newline at end of file + diff --git a/addons/tagging/CfgWeapons.hpp b/addons/tagging/CfgWeapons.hpp index 1984b3b14a..4405696a08 100644 --- a/addons/tagging/CfgWeapons.hpp +++ b/addons/tagging/CfgWeapons.hpp @@ -1,6 +1,6 @@ class CfgWeapons { class ACE_ItemCore; - class InventoryItem_Base_F; + class CBA_MiscItem_ItemInfo; class ACE_SpraypaintBlack : ACE_ItemCore { author = "jokoho48"; @@ -11,7 +11,7 @@ class CfgWeapons { scope = 2; hiddenSelections[] = {"camo"}; hiddenSelectionsTextures[] = {QPATHTOF(data\spraycanBlack_co.paa)}; - class ItemInfo: InventoryItem_Base_F { + class ItemInfo: CBA_MiscItem_ItemInfo { mass = 10; }; }; diff --git a/addons/tagging/XEH_postInit.sqf b/addons/tagging/XEH_postInit.sqf index ddac9b9ab9..1e7003281a 100644 --- a/addons/tagging/XEH_postInit.sqf +++ b/addons/tagging/XEH_postInit.sqf @@ -3,8 +3,7 @@ // Cache for static objects -GVAR(cacheStaticModels) = createLocation ["ACE_HashLocation", [-10000,-10000,-10000], 0, 0]; -GVAR(cacheStaticModels) setText QGVAR(cacheStaticModels); +GVAR(cacheStaticModels) = [false] call CBA_fnc_createNamespace; // Consider static everything vehicle that inherit from Static // This include houses (which we don't need), but also walls, that we do @@ -17,7 +16,7 @@ for "_index" from 0 to (_countOptions - 1) do { private _model = getText (_cfgClass >> "model"); if (_model != "") then { private _array = _model splitString "\"; - GVAR(cacheStaticModels) setVariable [toLower (_array select ((count _array) - 2)), _cfgClass]; + GVAR(cacheStaticModels) setVariable [(_array select ((count _array) - 1)), true]; }; }; }; @@ -33,7 +32,7 @@ for "_index" from 0 to (_countOptions - 1) do { private _model = getText (_cfgClass >> "model"); if (_model != "") then { private _array = _model splitString "\"; - GVAR(cacheStaticModels) setVariable [toLower (_array select ((count _array) - 2)), _cfgClass]; + GVAR(cacheStaticModels) setVariable [(_array select ((count _array) - 1)), true]; }; }; }; diff --git a/addons/tagging/XEH_preInit.sqf b/addons/tagging/XEH_preInit.sqf index 66458c6995..e1487c671f 100644 --- a/addons/tagging/XEH_preInit.sqf +++ b/addons/tagging/XEH_preInit.sqf @@ -2,7 +2,9 @@ ADDON = false; +PREP_RECOMPILE_START; #include "XEH_PREP.hpp" +PREP_RECOMPILE_END; GVAR(cachedTags) = []; GVAR(cachedRequiredItems) = []; diff --git a/addons/tagging/functions/fnc_checkTaggable.sqf b/addons/tagging/functions/fnc_checkTaggable.sqf index d739bbfec5..e4328687a9 100644 --- a/addons/tagging/functions/fnc_checkTaggable.sqf +++ b/addons/tagging/functions/fnc_checkTaggable.sqf @@ -9,16 +9,14 @@ * Is surface taggable * * Example: - * [unit] call ace_tagging_fnc_checkTaggable + * [player] call ace_tagging_fnc_checkTaggable * * Public: No */ #include "script_component.hpp" -params ["_unit"]; - -[[_unit], { +[_this, { params ["_unit"]; // Exit if no required item in inventory @@ -45,15 +43,11 @@ params ["_unit"]; if (_object isKindOf "Static") exitWith {false}; // If the class is not categorized correctly search the cache - private _array = str(_object) splitString " "; - private _str = toLower (_array select 1); - TRACE_1("Object:",_str); - private _objClass = GVAR(cacheStaticModels) getVariable _str; + private _modelName = (getModelInfo _object) select 0; + private _isStatic = GVAR(cacheStaticModels) getVariable [_modelName, false]; + TRACE_2("Object:",_modelName,_isStatic); // If the class in not on the cache, exit - if (isNil "_objClass") exitWith { - false - }; - true + (!_isStatic) }) exitWith { TRACE_1("Pointed object is non static",_object); false diff --git a/addons/tagging/functions/fnc_createTag.sqf b/addons/tagging/functions/fnc_createTag.sqf index 87c9ff13f9..c579c6e05f 100644 --- a/addons/tagging/functions/fnc_createTag.sqf +++ b/addons/tagging/functions/fnc_createTag.sqf @@ -28,9 +28,8 @@ if (_texture == "") exitWith { false }; -private _tag = "UserTexture1m_F" createVehicle [0,0,0]; +private _tag = createSimpleObject ["UserTexture1m_F", _tagPosASL]; _tag setObjectTextureGlobal [0, _texture]; -_tag setPosASL _tagPosASL; _tag setVectorDirAndUp _vectorDirAndUp; // Throw a global event for mision makers diff --git a/addons/tagging/functions/fnc_moduleInit.sqf b/addons/tagging/functions/fnc_moduleInit.sqf index 235bd3a046..8b2d42a010 100644 --- a/addons/tagging/functions/fnc_moduleInit.sqf +++ b/addons/tagging/functions/fnc_moduleInit.sqf @@ -10,6 +10,9 @@ * Return Value: * None * + * Example: + * [LOGIC, [bob, kevin], true] call ace_tagging_fnc_moduleInit + * * Public: No */ #include "script_component.hpp" diff --git a/addons/tagging/functions/fnc_tag.sqf b/addons/tagging/functions/fnc_tag.sqf index 3aec5ec139..4893037117 100644 --- a/addons/tagging/functions/fnc_tag.sqf +++ b/addons/tagging/functions/fnc_tag.sqf @@ -49,15 +49,11 @@ if ((!isNull _object) && { if (_object isKindOf "Static") exitWith {false}; // If the class is not categorized correctly search the cache - private _array = str(_object) splitString " "; - private _str = toLower (_array select 1); - TRACE_1("Object:",_str); - private _objClass = GVAR(cacheStaticModels) getVariable _str; + private _modelName = (getModelInfo _object) select 0; + private _isStatic = GVAR(cacheStaticModels) getVariable [_modelName, false]; + TRACE_2("Object:",_modelName,_isStatic); // If the class in not on the cache, exit - if (isNil "_objClass") exitWith { - false - }; - true + (!_isStatic) }) exitWith { TRACE_1("Pointed object is non static",_object); false @@ -81,7 +77,7 @@ private _v3 = _v2 vectorCrossProduct _v1; TRACE_3("Reference:", _v1, _v2, _v3); -_fnc_isOk = { +private _fnc_isOk = { params ["_rx", "_ry"]; private _startPosASL2 = _touchingPoint vectorAdd (_v2 vectorMultiply _rx) vectorAdd (_v3 vectorMultiply _ry) vectorAdd (_v1 vectorMultiply (-0.06)); private _endPosASL2 = _startPosASL2 vectorAdd (_v1 vectorMultiply (0.12)); diff --git a/addons/tagging/functions/fnc_tagTestingThread.sqf b/addons/tagging/functions/fnc_tagTestingThread.sqf index ead21f8d91..a21cf69f2b 100644 --- a/addons/tagging/functions/fnc_tagTestingThread.sqf +++ b/addons/tagging/functions/fnc_tagTestingThread.sqf @@ -27,12 +27,13 @@ GVAR(tagsToTest) = GVAR(tagsToTest) select { private _intersections = lineIntersectsSurfaces [_tagPosASL, _endPosASL, _tag, objNull, true, 1, "GEOM", "FIRE"]; // If there's no intersections - if (_intersections isEqualTo []) exitWith { + if (_intersections isEqualTo []) then { TRACE_1("No intersections, deleting:",_tag); deleteVehicle _tag; false + } else { + true }; - true }; // If there's no more tag diff --git a/addons/tagging/stringtable.xml b/addons/tagging/stringtable.xml index bbcaead48d..8b6a9ff638 100644 --- a/addons/tagging/stringtable.xml +++ b/addons/tagging/stringtable.xml @@ -6,54 +6,99 @@ Маркировка タグ付け Tagowanie + Markierungssystem + 뿌리기 + Marquage + Marcamento + 喷漆 + 噴漆 Configure how the tagging system will operate by default. Настройка работы системы спрей-маркеров по-умолчанию. 標準で開くタグ付けシステムの設定を行います。 Skonfiguruj zachowanie systemu tagowania. + Konfiguriert, wie das Markierungssystem standardmäßig funktioniert. + 뿌리기 시스템의 기본사항을 설정합니다. + Configure le fonctionnement par défaut du système de marquage. + Configura quanto il sistema di marcamento agirà da se. + 定义喷漆系统预设设定 + 定義噴漆系統預設設定 Quick Tag Быстрый маркер クイック タグ Szybkie tagowanie + Schnelle Markierung + 빠른 뿌리기 + Marquage rapide + Marcamento Rapido + 快速喷漆 + 快速噴漆 Action performed on main tag interaction point. Действие, выполняемое при выборе главного пункта меню маркировки. インタラクション ポインにむけてタグ付けをします。 Akcja wykonywana na głównym punkcie interakcji tagu. + Aktion, die am Haupt-Interaktionspunkt ausgeführt werden soll. + 이 동작은 상호작용에서 뿌리기를 할 수 있게 해준다 + Action réalisé au point de marquage principal. + Azione eseguita sul punto di interazione dei tag principali. + 直接喷漆在互动选单瞄准的点上。 + 直接噴漆在互動選單瞄準的點上。 Last Used Повторить последний 最後の使用 Ostatnio użyte + Zuletzt benutzt + 최근 사용 + Dernier utilisé + Ultimo Usato + 上次最后使用 + 上次最後使用 Random X Случайный Х 無作為な X印 Losowy X + Zufällig X + 무작위 X + Aléatoire X + Random X + 随机X标记 + 隨機X標記 Random Случайный 無作為 Losowy + Zufällig + 무작위 + Aléatoire + Random + 随机 + 隨機 Tag Markieren Marcar - Taguj - Tag + Oznakuj Marca Označit Marcar Маркер タグ + 뿌리기 + Tag + 喷漆 + 噴漆 X black @@ -66,6 +111,9 @@ X em preto Черный Х 黒の X印 + 검정 X + 黑色X标记 + 黑色X標記 X red @@ -78,6 +126,9 @@ X em vermelho Красный Х 赤の X印 + 빨간 X + 红色X标记 + 紅色X標記 X green @@ -90,6 +141,9 @@ X em verde Зеленый Х 緑の X印 + 초록 X + 绿色X标记 + 綠色X標記 X blue @@ -102,6 +156,9 @@ X em azul Синий Х 青の X印 + 파랑 X + 蓝色X标记 + 藍色X標記 Black spray paint @@ -114,6 +171,9 @@ Spray de tinta preta Черный спрей 黒のスプレー缶 + 검정 스프레이 + 黑色喷漆 + 黑色噴漆 Red spray paint @@ -126,6 +186,9 @@ Spray de tinta vermelha Красный спрей 赤のスプレー缶 + 빨강 스프레이 + 红色喷漆 + 紅色噴漆 Green spray paint @@ -138,6 +201,9 @@ Spray de tinta verde Зеленый спрей 緑のスプレー缶 + 초록 스프레이 + 绿色喷漆 + 綠色噴漆 Blue spray paint @@ -150,18 +216,24 @@ Spray de tinta azul Синий спрей 青のスプレー缶 + 파랑 스프레이 + 蓝色喷漆 + 藍色噴漆 A can of spray paint for tagging walls. Eine Farbsprühdose um Wände zu markieren. Lata de pintura en aerosol para marcar. Farba w sprayu, służy do oznakowywania terenu. - Un spray de peinture pour taguer les murs. + Un spray de peinture pour marquer les murs. Una bomboletta di spay per contrassegnare i muri. Plechovka se sprejem k vytváření značek. Uma lata de tinta spray para marcar paredes. Балончик спрея для рисования маркеров на стенах. スプレー缶は壁にタグ付できます。 + 벽에 뿌릴 수 있는 스프레이캔 입니다. + 喷漆可喷涂在墙壁上 + 噴漆可噴塗在牆壁上 diff --git a/addons/thermals/config.cpp b/addons/thermals/config.cpp index a61598929d..c9f3962821 100644 --- a/addons/thermals/config.cpp +++ b/addons/thermals/config.cpp @@ -26,12 +26,12 @@ class CfgVehicles { // so if a vehicle's engine starts, the entire model will begin to warm up at the rate of htMax up to a temperature of afMax, // likewise if it begins driving, the entire model will heat up at the rate specified by htMax to a maximum temperature of mfMax. class AllVehicles: All { - htMin=60; // Minimum half-cooling time (in seconds) - htMax=1800; // Maximum half-cooling time (in seconds) - afMax=70; // Maximum temperature in case the model is alive (in celsius) - mfMax=50; // Maximum temperature when the model is moving (in celsius) - mFact=0.0; // Metabolism factor - number from interval <0, 1> (0 - metabolism has no influence, 1 - metabolism has full influence (no other temperature source will be considered)) - tBody=0; // Metabolism temperature of the model (in celsius) + htMin = 60; // Minimum half-cooling time (in seconds) + htMax = 1800; // Maximum half-cooling time (in seconds) + afMax = 70; // Maximum temperature in case the model is alive (in celsius) + mfMax = 50; // Maximum temperature when the model is moving (in celsius) + mFact = 0.0; // Metabolism factor - number from interval <0, 1> (0 - metabolism has no influence, 1 - metabolism has full influence (no other temperature source will be considered)) + tBody = 0; // Metabolism temperature of the model (in celsius) }; class Animal; diff --git a/addons/trenches/CfgWeapons.hpp b/addons/trenches/CfgWeapons.hpp index 9f9049360a..de79bc277f 100644 --- a/addons/trenches/CfgWeapons.hpp +++ b/addons/trenches/CfgWeapons.hpp @@ -1,6 +1,6 @@ class CfgWeapons { - class InventoryItem_Base_F; class ACE_ItemCore; + class CBA_MiscItem_ItemInfo; class ACE_EntrenchingTool: ACE_ItemCore { author = ECSTRING(common,ACETeam); @@ -9,7 +9,7 @@ class CfgWeapons { model = QPATHTOEF(apl,ace_entrchtool.p3d); picture = QPATHTOF(ui\w_entrchtool_ca.paa); scope = 2; - class ItemInfo: InventoryItem_Base_F { + class ItemInfo: CBA_MiscItem_ItemInfo { mass = 10; }; }; diff --git a/addons/trenches/XEH_preInit.sqf b/addons/trenches/XEH_preInit.sqf index a7feade1c3..b47cf6628d 100644 --- a/addons/trenches/XEH_preInit.sqf +++ b/addons/trenches/XEH_preInit.sqf @@ -2,6 +2,8 @@ ADDON = false; +PREP_RECOMPILE_START; #include "XEH_PREP.hpp" +PREP_RECOMPILE_END; ADDON = true; diff --git a/addons/trenches/functions/fnc_canDigTrench.sqf b/addons/trenches/functions/fnc_canDigTrench.sqf index 0cbed2d9b7..a99c5c6b60 100644 --- a/addons/trenches/functions/fnc_canDigTrench.sqf +++ b/addons/trenches/functions/fnc_canDigTrench.sqf @@ -1,6 +1,6 @@ /* * Author: Ruthberg, commy2, esteldunedain - * Checks if a unit can dig a trench + * Checks if a unit can dig a trench. * * Arguments: * 0: Unit @@ -15,17 +15,8 @@ */ #include "script_component.hpp" -#define SURFACE_BLACKLIST ["water", "concrete", "tarmac", "wood", "metal", "roof_tin", "roof_tiles", "wood_int", "concrete_int", "tiles_int", "metal_int", "stony", "rock", "int_concrete", "int_tiles", "int_wood", "tiling", "wavymetal", "int_metal"] - params ["_unit"]; if !("ACE_EntrenchingTool" in items _unit) exitWith {false}; -// Can't dig trench if above ground level -if ((getPosATL _unit) select 2 > 0.05) exitWith {false}; - -private _surfaceClass = (surfaceType getPosASL _unit) select [1]; -private _surfaceType = getText (configFile >> "CfgSurfaces" >> _surfaceClass >> "soundEnviron"); -TRACE_1("",_surfaceType); - -!(_surfaceType in SURFACE_BLACKLIST) +_unit call EFUNC(common,canDig) diff --git a/addons/trenches/functions/fnc_continueDiggingTrench.sqf b/addons/trenches/functions/fnc_continueDiggingTrench.sqf index 954eed1ca3..de961c73ff 100644 --- a/addons/trenches/functions/fnc_continueDiggingTrench.sqf +++ b/addons/trenches/functions/fnc_continueDiggingTrench.sqf @@ -79,7 +79,7 @@ if(_actualProgress == 0) then { }; private _progressLeft = (_actualProgress * 10) + 1; -private ["_i"]; + for "_i" from _progressLeft to 10 do { private _vectorDiffZ = 1 - (_i / 10); private _delay = _digTime * ((_i / 10) - _actualProgress); diff --git a/addons/trenches/functions/fnc_handleInteractMenuOpened.sqf b/addons/trenches/functions/fnc_handleInteractMenuOpened.sqf index 91d6b0140b..5e68b6f60f 100644 --- a/addons/trenches/functions/fnc_handleInteractMenuOpened.sqf +++ b/addons/trenches/functions/fnc_handleInteractMenuOpened.sqf @@ -8,6 +8,9 @@ * Return Value: * None * + * Example: + * [bob] call ace_trenches_fnc_handleInteractMenuOpened + * * Public: No */ #include "script_component.hpp" diff --git a/addons/trenches/functions/fnc_handleKilled.sqf b/addons/trenches/functions/fnc_handleKilled.sqf index e9f0353cb1..6b57e20c91 100644 --- a/addons/trenches/functions/fnc_handleKilled.sqf +++ b/addons/trenches/functions/fnc_handleKilled.sqf @@ -8,6 +8,9 @@ * Return Value: * None * + * Example: + * [bob] call ace_trenches_fnc_handleKilled + * * Public: No */ #include "script_component.hpp" diff --git a/addons/trenches/functions/fnc_handlePlayerChanged.sqf b/addons/trenches/functions/fnc_handlePlayerChanged.sqf index 684ccc22ce..f4ebb8e2d5 100644 --- a/addons/trenches/functions/fnc_handlePlayerChanged.sqf +++ b/addons/trenches/functions/fnc_handlePlayerChanged.sqf @@ -9,6 +9,9 @@ * Return Value: * None * + * Example: + * [bob, kevin] call ace_trenches_fnc_handlePlayerChanged + * * Public: No */ #include "script_component.hpp" diff --git a/addons/trenches/functions/fnc_handlePlayerInventoryChanged.sqf b/addons/trenches/functions/fnc_handlePlayerInventoryChanged.sqf index cbae02d07a..11bdef6072 100644 --- a/addons/trenches/functions/fnc_handlePlayerInventoryChanged.sqf +++ b/addons/trenches/functions/fnc_handlePlayerInventoryChanged.sqf @@ -9,6 +9,9 @@ * Return Value: * None * + * Example: + * [bob, "weapon"] call ace_trenches_fnc_handlePlayerInverntoryChanged + * * Public: No */ #include "script_component.hpp" diff --git a/addons/trenches/functions/fnc_handleUnconscious.sqf b/addons/trenches/functions/fnc_handleUnconscious.sqf index e4fc2814b2..c1f282d6c3 100644 --- a/addons/trenches/functions/fnc_handleUnconscious.sqf +++ b/addons/trenches/functions/fnc_handleUnconscious.sqf @@ -8,12 +8,17 @@ * Return Value: * None * + * Example: + * [bob] call ace_trenches_fnc_handleUnconscious + * * Public: No */ #include "script_component.hpp" params ["_unit"]; +if (!local _unit) exitWith {}; + if (_unit getVariable [QGVAR(isPlacing), false]) then { [_unit] call FUNC(placeCancel); }; diff --git a/addons/trenches/functions/fnc_placeConfirm.sqf b/addons/trenches/functions/fnc_placeConfirm.sqf index 7c3be2d901..7e5e94de8d 100644 --- a/addons/trenches/functions/fnc_placeConfirm.sqf +++ b/addons/trenches/functions/fnc_placeConfirm.sqf @@ -50,9 +50,9 @@ private _v1 = _v3 vectorCrossProduct _v2; // Stick the trench to the ground _basePos set [2, getTerrainHeightASL _basePos]; private _minzoffset = 0; -private ["_ix","_iy"]; -for [{_ix = -_dx/2},{_ix <= _dx/2},{_ix = _ix + _dx/3}] do { - for [{_iy = -_dy/2},{_iy <= _dy/2},{_iy = _iy + _dy/3}] do { + +for [{private _ix = -_dx/2},{_ix <= _dx/2},{_ix = _ix + _dx/3}] do { + for [{private _iy = -_dy/2},{_iy <= _dy/2},{_iy = _iy + _dy/3}] do { private _pos = _basePos vectorAdd (_v2 vectorMultiply _ix) vectorAdd (_v1 vectorMultiply _iy); _minzoffset = _minzoffset min ((getTerrainHeightASL _pos) - (_pos select 2)); diff --git a/addons/trenches/functions/fnc_placeTrench.sqf b/addons/trenches/functions/fnc_placeTrench.sqf index 7ec97a0c41..6a9e29d767 100644 --- a/addons/trenches/functions/fnc_placeTrench.sqf +++ b/addons/trenches/functions/fnc_placeTrench.sqf @@ -67,9 +67,8 @@ GVAR(digPFH) = [{ // Stick the trench to the ground _basePos set [2, getTerrainHeightASL _basePos]; private _minzoffset = 0; - private ["_ix","_iy"]; - for [{_ix = -_dx/2},{_ix <= _dx/2},{_ix = _ix + _dx/3}] do { - for [{_iy = -_dy/2},{_iy <= _dy/2},{_iy = _iy + _dy/3}] do { + for [{private _ix = -_dx/2},{_ix <= _dx/2},{_ix = _ix + _dx/3}] do { + for [{private _iy = -_dy/2},{_iy <= _dy/2},{_iy = _iy + _dy/3}] do { private _pos = _basePos vectorAdd (_v2 vectorMultiply _ix) vectorAdd (_v1 vectorMultiply _iy); _minzoffset = _minzoffset min ((getTerrainHeightASL _pos) - (_pos select 2)); diff --git a/addons/trenches/functions/fnc_removeTrench.sqf b/addons/trenches/functions/fnc_removeTrench.sqf index 53059f34bf..d22db5d27e 100644 --- a/addons/trenches/functions/fnc_removeTrench.sqf +++ b/addons/trenches/functions/fnc_removeTrench.sqf @@ -64,7 +64,7 @@ private _fnc_onFailure = { [(_removeTimeLeft + 0.5), [_unit, _trench], _fnc_onFinish, _fnc_onFailure, localize LSTRING(RemovingTrench)] call EFUNC(common,progressBar); private _progressLeft = ((1 - _actualProgress) * 10) + 1; -private ["_i"]; + for "_i" from _progressLeft to 10 do { private _vectorDiffZ = _i / 10; private _delay = _removeTime * ((_i / 10) - (1 - _actualProgress)); diff --git a/addons/trenches/stringtable.xml b/addons/trenches/stringtable.xml index a56d56640b..161e3eae39 100644 --- a/addons/trenches/stringtable.xml +++ b/addons/trenches/stringtable.xml @@ -1,9 +1,9 @@ - + Entrenching Tool - Schanzzeug + Klappspaten Saperka Pala Pala para trincheras @@ -12,11 +12,14 @@ Ferramenta de trincheira Саперная лопата シャベル + 야전삽 + 战备锹 + 戰備鍬 Entrenching Tool Saperka, używana do budowy wnęk - Mit Schanzzeug können Erdwälle oder Gräben ausgehoben werden. + Mit dem Klappspaten können Erdwälle oder Gräben ausgehoben werden. Pala Pala para trincheras Outil de tranchée @@ -24,6 +27,9 @@ Ferramenta de trincheira Саперная лопата シャベル + 야전용 삽. 군인들의 영원한 친구 + 战备锹 + 戰備鍬 Envelope - Small @@ -35,6 +41,9 @@ Trincheira - Pequena Окоп - Малый 塹壕 - 小型 + 참호 - 소형 + 掩体 - 小 + 掩體 - 小 Small Personal Trench @@ -47,6 +56,9 @@ Trincheira pessoal pequena Малый персональный окоп 小型の個人用塹壕 + 소형 개인참호 + 小型个人掩体 + 小型個人掩體 Dig Small Trench @@ -59,6 +71,9 @@ Cavar trincheira pequena Вырыть малый окоп 小型塹壕を掘る + 소형참호 파기 + 盖小掩体 + 蓋小掩體 Envelope - Big @@ -70,6 +85,9 @@ Trincheira - Grande Окоп - Большой 塹壕 - 大型 + 참호 - 대형 + 掩体 - 大 + 掩體 - 大 Large Personal Trench @@ -82,6 +100,9 @@ Trincheira pessoal grande Большой персональный окоп 大型の塹壕を掘る + 대형 참호 + 大型个人掩体 + 大型個人掩體 Dig Big Trench @@ -94,6 +115,9 @@ Cavar trincheira grande Вырыть большой окоп 大型の塹壕を掘る + 대형참호 파기 + 盖大掩体 + 蓋大掩體 Confirm Dig @@ -106,6 +130,9 @@ Confirmar excavação Копать ここに掘る + 여기에 파기 + 确认开工 + 確認開工 Cancel Dig @@ -118,6 +145,9 @@ Cancelar excavação Отменить копание 掘るのを中止 + 취소하기 + 取消动作 + 取消動作 Rotate @@ -131,18 +161,24 @@ Rotaciona Bращать 回転 + 돌리기 + 旋转 + 旋轉 Digging Trench Grabe Schützengraben Kopanie wnęki - Sto Scavando la Trincea + Scavando la Trincea Cavando trinchera Creuse la tranchée Vykopat zákop Cavando trincheira Копание окопа 塹壕を掘っている + 참호 파는중 + 正在盖掩体中 + 正在蓋掩體中 Continue Digging Trench @@ -152,6 +188,11 @@ Продолжить копание окопа Pokračovat v kopání 塹壕を掘りつづける + Graben fortsetzen + 계속해서 참호파기 + Continua a Scavare la Trincea + 继续盖掩体 + 繼續蓋掩體 Remove Trench @@ -161,6 +202,11 @@ Убрать окоп Odstranit zákop 塹壕を消す + Schützengraben entfernen + 참호 제거 + Rimuove Trincea + 移除掩体 + 移除掩體 Removing Trench @@ -170,6 +216,11 @@ Убирание окопа Odstraňuji zákop 塹壕を消している + Entferne Schützengraben + 참호 제거중... + Rimuovendo la Trincea + 移除掩体中 + 移除掩體中 - \ No newline at end of file + diff --git a/addons/tripod/CfgWeapons.hpp b/addons/tripod/CfgWeapons.hpp index 3c5ca6d2b1..5cbeb1faf6 100644 --- a/addons/tripod/CfgWeapons.hpp +++ b/addons/tripod/CfgWeapons.hpp @@ -1,6 +1,6 @@ class CfgWeapons { class ACE_ItemCore; - class InventoryItem_Base_F; + class CBA_MiscItem_ItemInfo; class ACE_Tripod: ACE_ItemCore { author[] = {"Rocko", "Scubaman3D"}; @@ -10,7 +10,7 @@ class CfgWeapons { model = QPATHTOF(data\w_sniper_tripod.p3d); picture = QPATHTOF(UI\w_sniper_tripod_ca.paa); - class ItemInfo: InventoryItem_Base_F { + class ItemInfo: CBA_MiscItem_ItemInfo { mass = 40; }; }; diff --git a/addons/tripod/XEH_preInit.sqf b/addons/tripod/XEH_preInit.sqf index a7feade1c3..b47cf6628d 100644 --- a/addons/tripod/XEH_preInit.sqf +++ b/addons/tripod/XEH_preInit.sqf @@ -2,6 +2,8 @@ ADDON = false; +PREP_RECOMPILE_START; #include "XEH_PREP.hpp" +PREP_RECOMPILE_END; ADDON = true; diff --git a/addons/tripod/functions/fnc_handleInteractMenuOpened.sqf b/addons/tripod/functions/fnc_handleInteractMenuOpened.sqf index 8c49359d96..014eed55d4 100644 --- a/addons/tripod/functions/fnc_handleInteractMenuOpened.sqf +++ b/addons/tripod/functions/fnc_handleInteractMenuOpened.sqf @@ -8,6 +8,9 @@ * Return Value: * None * + * Example: + * [bob] call ace_tripod_fnc_handleInteractMenuOpened + * * Public: No */ #include "script_component.hpp" diff --git a/addons/tripod/functions/fnc_handleKilled.sqf b/addons/tripod/functions/fnc_handleKilled.sqf index ee28fc1f45..90dd388617 100644 --- a/addons/tripod/functions/fnc_handleKilled.sqf +++ b/addons/tripod/functions/fnc_handleKilled.sqf @@ -8,6 +8,9 @@ * Return Value: * None * + * Example: + * [bob] call ace_tripod_fnc_handleKilled + * * Public: No */ #include "script_component.hpp" diff --git a/addons/tripod/functions/fnc_handlePlayerChanged.sqf b/addons/tripod/functions/fnc_handlePlayerChanged.sqf index dd0cad6533..3d37b7949f 100644 --- a/addons/tripod/functions/fnc_handlePlayerChanged.sqf +++ b/addons/tripod/functions/fnc_handlePlayerChanged.sqf @@ -9,6 +9,9 @@ * Return Value: * None * + * Example: + * [bob] call ace_tripod_fnc_handlePlayerChanged + * * Public: No */ #include "script_component.hpp" diff --git a/addons/tripod/functions/fnc_handleUnconscious.sqf b/addons/tripod/functions/fnc_handleUnconscious.sqf index f81cecea58..01558d6389 100644 --- a/addons/tripod/functions/fnc_handleUnconscious.sqf +++ b/addons/tripod/functions/fnc_handleUnconscious.sqf @@ -8,12 +8,17 @@ * Return Value: * None * + * Example: + * [bob] call ace_tripod_fnc_handleUnconscious + * * Public: No */ #include "script_component.hpp" params ["_unit"]; +if (!local _unit) exitWith {}; + if (_unit getVariable [QGVAR(adjusting), false]) then { _unit setVariable [QGVAR(adjusting), false, true]; }; diff --git a/addons/tripod/functions/fnc_place.sqf b/addons/tripod/functions/fnc_place.sqf index b4b6790ef6..15fa4a295c 100644 --- a/addons/tripod/functions/fnc_place.sqf +++ b/addons/tripod/functions/fnc_place.sqf @@ -27,12 +27,10 @@ if (stance _unit == "STAND") then { [{ params ["_unit"]; - private ["_direction", "_position", "_tripod"]; + private _direction = getDir _unit; + private _position = getPosASL _unit vectorAdd [0.8 * sin _direction, 0.8 * cos _direction, 0.02]; - _direction = getDir _unit; - _position = getPosASL _unit vectorAdd [0.8 * sin _direction, 0.8 * cos _direction, 0.02]; - - _tripod = "ACE_TripodObject" createVehicle [0, 0, 0]; + private _tripod = "ACE_TripodObject" createVehicle [0, 0, 0]; { _tripod animate [_x, 1]; diff --git a/addons/tripod/stringtable.xml b/addons/tripod/stringtable.xml index 6b673a4ef5..a63bda06b0 100644 --- a/addons/tripod/stringtable.xml +++ b/addons/tripod/stringtable.xml @@ -1,4 +1,4 @@ - + @@ -13,6 +13,9 @@ SSWT Készlet Kit SSWT SSWT キット + SSWT 키트 + 狙击手专用三脚架 + 狙擊手專用三腳架 Place SSWT Kit @@ -26,6 +29,9 @@ SSWT készlet elhelyezése Colocar kit SSWT SSWT キットを置く + SSWT 키트 배치 + 放置狙击手专用三脚架 + 放置狙擊手專用三腳架 Pick up SSWT Kit @@ -39,6 +45,9 @@ Подобрать снайперский штатив Prendi Kit SSWT SSWT キットを拾う + SSWT 키트 줍기 + 捡起狙击手专用三脚架 + 撿起狙擊手專用三腳架 Adjust SSWT Kit @@ -52,6 +61,9 @@ Выровнять снайперский штатив Aggiusta Kit SSWT SSWT キットを調節 + SSWT 키트 조절 + 调整狙击手专用三脚架 + 調整狙擊手專用三腳架 Done @@ -65,6 +77,9 @@ Готово Fatto 完了 + 완료 + 完成 + 完成 adjust @@ -78,6 +93,9 @@ подстройка aggiusta 調節 + 조절 + 调整 + 調整 - \ No newline at end of file + diff --git a/addons/ui/XEH_preInit.sqf b/addons/ui/XEH_preInit.sqf index 3dee364f02..b937d5d81c 100644 --- a/addons/ui/XEH_preInit.sqf +++ b/addons/ui/XEH_preInit.sqf @@ -2,7 +2,9 @@ ADDON = false; +PREP_RECOMPILE_START; #include "XEH_PREP.hpp" +PREP_RECOMPILE_END; GVAR(interfaceInitialized) = false; diff --git a/addons/ui/functions/fnc_moduleInit.sqf b/addons/ui/functions/fnc_moduleInit.sqf index 79a9ef2d93..6a3e74aa67 100644 --- a/addons/ui/functions/fnc_moduleInit.sqf +++ b/addons/ui/functions/fnc_moduleInit.sqf @@ -9,6 +9,11 @@ * * Return Value: * None + * + * Example: + * [LOGIC, [bob, kevin], true] call ace_ui_fnc_moduleInit + * + * Public: No */ #include "script_component.hpp" diff --git a/addons/ui/stringtable.xml b/addons/ui/stringtable.xml index f039bfd7e7..70fb157a69 100644 --- a/addons/ui/stringtable.xml +++ b/addons/ui/stringtable.xml @@ -9,6 +9,11 @@ Интерфейс ユーザ インタフェイス Interfejs użytkownika + Benutzeroberfläche + 사용자 인터페이스 + Interfaccia Utente + 使用者介面 + 使用者介面 User Interface @@ -18,14 +23,24 @@ Пользовательский интерфейс ユーザ インタフェイス Interfejs użytkownika + Benutzeroberfläche + 사용자 인터페이스 + Interfaccia Utente + 使用者介面 + 使用者介面 This module allows toggling visible user interface parts. Este módulo permite ligar ou desligar partes da interface do usuário Ce module permet le basculement de parties visibles de l'interface utlisateur Этот модуль позволяет переключать видимость элементов пользовательского интерфейса. - モジュールではユーザ インタフェイスの一部をトグル表示できます。 + モジュールではユーザ インタフェイスの一部表示を切り替えできます。 Moduł ten pozwala zmienić stan widoczności poszczególnych elementów UI. + Dieses Modul erlaubt es, Teile der Benutzeroberfläche (UI) an- oder auszuschalten. + 이 모듈은 사용자 인터페이스의 부분을 토글하는것을 가능케 해줍니다. + Questo modulo consente di commutare parti di interfaccia utente visibili. + 此模块允许你调整使用者介面的任何一个元件 + 此模塊允許你調整使用者介面的任何一個元件 Allow Selective UI @@ -35,6 +50,11 @@ Включить настраиваемый интерфейс 選択できるユーザ インタフェイスを有効化します Zezwól na selektywne UI + Erlaube selektives UI + 선택적 사용자 인터페이스 허가 + Permette l'UI Selettiva + 允许调整使用者介面 + 允許調整使用者介面 Allow client to modify their UI. @@ -44,6 +64,11 @@ Позволить клиентам изменять их пользовательский интерфейс. クライアントがユーザ インタフェイスを編集できるようにします。 Zezwól klientowi na modyfikację UI. + Erlaube Clients, ihr UI zu modifizieren. + 클라이언트가 선택적 사용자 인터페이스 사용하는것을 허가합니다 + Permette al client di modificare la propria UI. + 允许客户端自行调整使用者介面 + 允許客戶端自行調整使用者介面 Soldier/Vehicle/Weapon Information @@ -53,6 +78,11 @@ Информация о Солдате/Технике/Оружии 兵士/車両/武器の情報 Informacje o żołnierzu/pojeździe/broni + Soldat/Fahrzeug/Waffe Information + 병사/차량/무기 정보 + Informazioni Soldato/Veicolo/Arma + 士兵/载具/武器资讯栏 + 士兵/載具/武器資訊欄 Vehicle Radar @@ -62,6 +92,11 @@ Радар в технике 車両のレーダ Radar w pojeździe + Fahrzeugradar + 차량 레이더 + Rada Veicolo + 载具雷达 + 載具雷達 Vehicle Compass @@ -71,6 +106,11 @@ Компас в технике 車両のレーダ Kompas w pojeździe + Fahrzeugkompass + 차량 나침반 + Bussola Veicolo + 载具指北针 + 載具指北針 Command Menu @@ -80,6 +120,11 @@ Командное меню 指揮メニュー Menu dowodzenia + Kommandomenü + 지휘 메뉴 + Menù di Comando + 指挥选单 + 指揮選單 Group Bar @@ -89,6 +134,11 @@ Панель командира 指揮メニュー Pasek grupy + Gruppenleiste + 그룹 막대 + Barra del Gruppo + 小队状态栏 + 小隊狀態欄 Weapon Name @@ -98,6 +148,11 @@ Название оружия 武器名 Nazwa broni + Waffenname + 무기 이름 + Nome Arma + 武器名称 + 武器名稱 Weapon Name Background @@ -107,6 +162,11 @@ Фон названия оружия 武器名の背景表示 Tło nazwy broni + Waffenname Hintergrund + 무기 이름 배경 + Nome Sfondo Arma + 武器名称背景 + 武器名稱背景 Firing Mode @@ -116,6 +176,11 @@ Режим стрельбы 射撃モード Tryb ognia + Feuermodus + 사격 모드 + Modalità di Fuoco + 射击模式 + 射擊模式 Ammo Type @@ -125,6 +190,11 @@ Тип боеприпасов 弾種 Typ amunicji + Munitionstyp + 탄종 + Tipo Munizioni + 弹药类型 + 彈藥類型 Ammo Count @@ -134,6 +204,11 @@ Количество боеприпасов 弾薬数 Ilość amunicji + Munitionsanzahl + 탄약수 + Contatore Munizioni + 弹药数量 + 彈藥數量 Magazine Count @@ -143,6 +218,11 @@ Количество магазинов 弾倉装填数 Ilość magazynków + Magazinanzahl + 탄창수 + Contatore Caricatore + 弹匣数量 + 彈匣數量 Throwable Type @@ -152,6 +232,11 @@ Тип гранаты 投げる種類 Typ granatu + Wurfobjekt-Typ + 투척물 종류 + Tipo Lanciabile + 投掷物类型 + 投擲物類型 Throwable Count @@ -161,6 +246,11 @@ Количество гранат 投げられる数 Ilość granatów + Wurfobjekt-Anzahl + 투척물 개수 + Contatore Lanciabili + 投掷物数量 + 投擲物數量 Zeroing @@ -170,6 +260,11 @@ Дальность стрельбы ゼロイン Wyzerowanie broni + Nullung + 영점 + Azzeramento + 归零距离 + 歸零距離 Weapon Lower Info Background @@ -178,6 +273,11 @@ Фон ниформации об оружии снизу 武器名の背景表示 (下側) Tło dolnej części informacji o broni + Hintergrund der unteren Waffen-Info-Leiste + 무기 상세 정보 배경 + Informazioni Sfondo Arma Bassa + 武器底部资讯栏背景 + 武器底部資訊欄背景 Stance @@ -187,6 +287,11 @@ Стойка 姿勢 Postura + Haltung + 자세 + Postura + 姿态 + 姿態 Stamina Bar @@ -196,6 +301,11 @@ Полоса выносливости 体力バー Pasek staminy + Ausdaueranzeige + 체력 막대 + Barra Stamina + 体力栏 + 體力欄 Gunner Weapon Name @@ -204,6 +314,11 @@ Название орудия наводчика 射手用の武器名 Nazwa broni strzelca + Richtschütze Waffenname + 사수 무기 명칭 + Nome Arma Artigliere + 炮手武器名称 + 砲手武器名稱 Gunner Weapon Name Background @@ -212,6 +327,11 @@ Фон названия орудия наводчика 射手用の武器名の背景表示 Tło nazwy broni strzelca + Richtschütze Waffenname Hintergrund + 사수 무기 명칭 배경 + Nome Sfondo Arma Artigliere + 炮手武器名称背景 + 砲手武器名稱背景 Gunner Firing Mode @@ -220,6 +340,11 @@ Режим стрельбы наводчика 射手用の発射モード Tryb ognia strzelca + Richtschütze Feuermodus + 사수 사격 모드 + Modalità di Fuoco Artigliere + 炮手射击模式 + 砲手射擊模式 Gunner Ammo Type @@ -228,6 +353,11 @@ Тип боеприпасов наводчика 射手用の弾種 Typ amunicji strzelca + Richtschütze Munitionstyp + 사수 탄종 + Tipo Munizioni Artigliere + 炮手弹药类型 + 砲手彈藥類型 Gunner Ammo Count @@ -236,6 +366,11 @@ Количество боеприпасов наводчика 射手用の弾数 Ilość amunicji strzelca + Richtschütze Munitionsanzahl + 사수 탄약 수량 + Contatore Munizioni Artigliere + 炮手弹药数量 + 砲手彈藥數量 Gunner Magazine Count @@ -244,6 +379,11 @@ Количество магазинов наводчика 射手用の弾倉数 Ilość magazynków strzelca + Richtschütze Magazinanzahl + 사수 탄창 수량 + Contatore Caricatore Artigliere + 炮手弹匣数量 + 砲手彈匣數量 Gunner Launchable Type @@ -252,6 +392,11 @@ Тип пусковой установки наводчика 射手用のランチャーの種類 Typ rakiet strzelca + Richtschütze Raketentyp + 사수 발사체 종류 + Tipo Lanciabile Artigliere + 炮手发射物类型 + 砲手發射物類型 Gunner Launchable Count @@ -260,6 +405,11 @@ Количество снарядов пусковой установки наводчика 射手用のランチャー弾薬数 Ilość rakiet strzelca + Richtschütze Raketenanzahl + 사수 발사체 수량 + Contatore Lanciabili Artigliere + 炮手发射物数量 + 砲手發射物數量 Gunner Zeroing @@ -268,6 +418,11 @@ Дальность стрельбы наводчика 射手用ゼロイン Wyzerowanie broni strzelca + Richtschütze Nullung + 사수 영점 + Azzeramento Artigliere + 炮手归零距离 + 砲手歸零距離 Gunner Weapon Lower Info Background @@ -276,6 +431,11 @@ Фон ниформации об орудии наводчика снизу 射手用の武器名の背景表示 (下側) Tło dolnej części informacji o broni strzelca + Hintergrund der unteren Waffen-Info-Leiste (Richtschütze) + 사수 무기 상세 정보 배경 + Informazioni Sfondo Arma Artigliere Bassa + 炮手武器底部资讯栏背景 + 砲手武器底部資訊欄背景 Vehicle Name @@ -285,6 +445,11 @@ Название техники 車両名 Nazwa pojazdu + Fahrzeugname + 차량 명칭 + Nome Veicolo + 载具名称 + 載具名稱 Vehicle Name Background @@ -294,6 +459,11 @@ Фон названия техники 車両名の背景 Tło nazwy pojazdu + Fahrzeugname Hintergrund + 차량 명칭 배경 + Nome Sfondo Veicolo + 载具名称背景 + 載具名稱背景 Vehicle Fuel Bar @@ -301,8 +471,13 @@ Barra de Combustível do Veículo Barre d'éssence du véhicule Полоса топлива - 車両の給油計 + 車両の燃料計 Pasek paliwa + Fahrzeug-Treibstoffleiste + 차량 연료 막대 + Barra Carburante Veicolo + 载具燃料栏 + 載具燃料欄 Vehicle Speed @@ -312,6 +487,11 @@ Скорость техники 車両の速度計 Prędkościomierz + Fahrzeuggeschwindigkeit + 차량 속도 + Velocità Veicolo + 载具速度 + 載具速度 Vehicle Altitude @@ -321,6 +501,11 @@ Высота полета 車両の高度計 Wysokościomierz radarowy + Fahrzeughöhe + 차량 고도 + Altitudine Veicolo + 载具高度 + 載具高度 Vehicle Damage @@ -330,6 +515,11 @@ Повреждение техники 車両の損傷表示 Uszkodzenia pojazdu + Fahrzeugschaden + 차량 피해 + Danno Veicolo + 载具伤害 + 載具傷害 Vehicle Info Background @@ -339,6 +529,11 @@ Фон информации о технике 車両状態の背景 Tło informacji o pojeździe + Fahrzeug Info Hintergrund + 차량 정보 배경 + Informazioni Sfondo Veicolo + 载具资讯栏背景 + 載具資訊欄背景 Requires Soldier/Vehicle/Weapon Information. @@ -348,6 +543,11 @@ Требуется Информация о Солдате/Технике/Оружии. 兵士/車両/武器の情報を必要とします。 Wymaga informacji o żołnierzu/pojeździe/broni. + Benötigt Soldat/Fahrzeug/Waffe Information. + 병사/차량/무기의 정보가 필요합니다. + Richiede informazione Soldato/Veicolo/Arma. + 需要士兵/载具/武器的资讯. + 需要士兵/載具/武器的資訊. Modifying User Interface is disabled. @@ -357,14 +557,24 @@ Изменение пользовательского интерфейса запрещено. 変更されたユーザ インタフェイスを無効化します。 Modyfikacja interfejsu użytkownika jest wyłączona. + Die Modifizierung des UI ist deaktiviert. + 사용자 인터페이스 변경이 비활성화 되어있습니다. + La modifica dell'Interfaccia Utente è disabilitata. + 自定使用者介面功能已关闭 + 自定使用者介面功能已關閉 Cannot modify a forced User Interface element. Não é possível modificar um elemento forçado da interface do usuário. - Impossible de modifier un élément de l'interface utilisateur forcé + Impossible de modifier un élément de l'interface utilisateur forcé. Невозможно изменить зафиксированный элемент пользовательского интерфейса. ユーザー インタフェイス要素は変更できません。 Nie można modyfikować wymuszonego elementu interfejsu użytkownika. + Gesperrte UI-Elemente können nicht modifiziert werden. + 강제 사용자 인터페이스는 변경하실 수 없습니다. + Impossibile modificare un elemento forzato d' Interfaccia Utente. + 无法编辑已被锁定的使用者介面元件 + 無法編輯已被鎖定的使用者介面元件 diff --git a/addons/vector/CfgVehicles.hpp b/addons/vector/CfgVehicles.hpp index f06f79aa12..23aa8d7412 100644 --- a/addons/vector/CfgVehicles.hpp +++ b/addons/vector/CfgVehicles.hpp @@ -6,15 +6,15 @@ class CfgVehicles { scopeCurator = 2; displayName = CSTRING(VectorName); vehicleClass = "Items"; - class TransportWeapons { - MACRO_ADDWEAPON(ACE_Vector,1); + class TransportItems { + MACRO_ADDITEM(ACE_Vector,1); }; }; class Box_NATO_Support_F; class ACE_Box_Misc: Box_NATO_Support_F { - class TransportWeapons { - MACRO_ADDWEAPON(ACE_Vector,6); + class TransportItems { + MACRO_ADDITEM(ACE_Vector,6); }; }; }; diff --git a/addons/vector/XEH_preInit.sqf b/addons/vector/XEH_preInit.sqf index a7feade1c3..b47cf6628d 100644 --- a/addons/vector/XEH_preInit.sqf +++ b/addons/vector/XEH_preInit.sqf @@ -2,6 +2,8 @@ ADDON = false; +PREP_RECOMPILE_START; #include "XEH_PREP.hpp" +PREP_RECOMPILE_END; ADDON = true; diff --git a/addons/vector/functions/fnc_adjustBrightness.sqf b/addons/vector/functions/fnc_adjustBrightness.sqf index da951322af..b31cc5361c 100644 --- a/addons/vector/functions/fnc_adjustBrightness.sqf +++ b/addons/vector/functions/fnc_adjustBrightness.sqf @@ -1,4 +1,19 @@ -// by commy2 +/* + * Author: commy2 + * + * + * Arguments: + * 0: Number + * + * Return Value: + * None + * + * Example: + * [5] call ace_vector_fnc_adjustBrigthness + * + * Public: No + */ + #include "script_component.hpp" disableSerialization; diff --git a/addons/vector/functions/fnc_clearDisplay.sqf b/addons/vector/functions/fnc_clearDisplay.sqf index 73ef7dfcc6..3ec3ef7eb6 100644 --- a/addons/vector/functions/fnc_clearDisplay.sqf +++ b/addons/vector/functions/fnc_clearDisplay.sqf @@ -1,10 +1,19 @@ /* + * Author: commy2 + * Clears the vectors control items. + * + * Arguments: + * 0: String + * + * Return Value: + * None + * + * Example: + * [5] call ace_vector_fnc_clearDisplay + * + * Public: No + */ -by commy2 - -Clears the vectors control items. - -*/ #include "script_component.hpp" disableSerialization; diff --git a/addons/vector/functions/fnc_convertToTexturesDegree.sqf b/addons/vector/functions/fnc_convertToTexturesDegree.sqf index 7e04cfccd2..0a4fc349d3 100644 --- a/addons/vector/functions/fnc_convertToTexturesDegree.sqf +++ b/addons/vector/functions/fnc_convertToTexturesDegree.sqf @@ -1,8 +1,18 @@ -/* by commy2 - -converts azimuth into array of textures for the vectors scripted info control - -*/ +/* + * Author: commy2 + * converts azimuth into array of textures for the vectors scripted info control + * + * Arguments: + * 0: Number + * + * Return Value: + * None + * + * Example: + * [5] call ace_vector_fnc_convertToTexturesDegree + * + * Public: No + */ #include "script_component.hpp" @@ -24,8 +34,6 @@ if (GVAR(useMil)) then { _number = abs _number; if (_number isEqualTo 360) then {_number = 0}; - private ["_digit1", "_digit2", "_digit3", "_digit4"]; - private _digit1 = floor (_number / 100); private _digit2 = floor (_number / 10) - _digit1 * 10; private _digit3 = _number mod 10; diff --git a/addons/vector/functions/fnc_convertToTexturesDistance.sqf b/addons/vector/functions/fnc_convertToTexturesDistance.sqf index eb39febfe8..0140e45a2e 100644 --- a/addons/vector/functions/fnc_convertToTexturesDistance.sqf +++ b/addons/vector/functions/fnc_convertToTexturesDistance.sqf @@ -1,29 +1,34 @@ -/* by commy2 - -converts rangefinder distance into array of textures for the vectors scripted info control - -*/ - +/* + * Author: commy2 + * converts rangefinder distance into array of textures for the vectors scripted info control + * + * Arguments: + * 0: Number + * + * Return Value: + * Array + * + * Example: + * [5] call ace_vector_fnc_convertToTexturesDistance + * + * Public: No + */ #include "script_component.hpp" - -private ["_number", "_isNegative"]; - -_number = _this select 0; +params ["_number"]; _number = round _number; -_isNegative = _number < 0; +private _isNegative = _number < 0; _number = abs _number; if (_number >= 10000) exitWith { [QPATHTOF(rsc\vector_minus.paa), QPATHTOF(rsc\vector_minus.paa), QPATHTOF(rsc\vector_minus.paa), QPATHTOF(rsc\vector_minus.paa)] // return }; -private ["_digit1", "_digit2", "_digit3", "_digit4"]; -_digit1 = floor (_number / 1000); -_digit2 = floor (_number / 100) - _digit1 * 10; -_digit3 = floor (_number / 10) - _digit1 * 100 - _digit2 * 10; -_digit4 = _number mod 10; +private _digit1 = floor (_number / 1000); +private _digit2 = floor (_number / 100) - _digit1 * 10; +private _digit3 = floor (_number / 10) - _digit1 * 100 - _digit2 * 10; +private _digit4 = _number mod 10; if (_isNegative) then { diff --git a/addons/vector/functions/fnc_convertToTexturesFOS.sqf b/addons/vector/functions/fnc_convertToTexturesFOS.sqf index 7a77a3aab8..58ce94547b 100644 --- a/addons/vector/functions/fnc_convertToTexturesFOS.sqf +++ b/addons/vector/functions/fnc_convertToTexturesFOS.sqf @@ -1,31 +1,36 @@ -/* by commy2 - -converts rangefinder distance into array of textures for the vectors scripted info control - -*/ +/* + * Author: commy2 + * converts rangefinder distance into array of textures for the vectors scripted info control + * + * Arguments: + * 0: Number + * 1: Number + * + * Return Value: + * Array + * + * Example: + * [5, 6] call ace_vector_fnc_convertToTexturesFOS + * + * Public: No + */ #include "script_component.hpp" - -private ["_number", "_coordinate", "_isNegative"]; - -_number = _this select 0; -_coordinate = _this select 1; +params ["_number", "_coordinate"]; _number = round (_number select _coordinate); -_isNegative = _number < 0; +private _isNegative = _number < 0; _number = abs _number; if (_number > 9999) exitWith { [QPATHTOF(rsc\vector_minus.paa), QPATHTOF(rsc\vector_minus.paa), QPATHTOF(rsc\vector_minus.paa), QPATHTOF(rsc\vector_minus.paa), QPATHTOF(rsc\vector_minus.paa)] // return }; -private ["_digit0", "_digit1", "_digit2", "_digit3", "_digit4"]; - -_digit0 = ""; -_digit1 = floor (_number / 1000); -_digit2 = floor (_number / 100) - _digit1 * 10; -_digit3 = floor (_number / 10) - _digit1 * 100 - _digit2 * 10; -_digit4 = _number mod 10; +private _digit0 = ""; +private _digit1 = floor (_number / 1000); +private _digit2 = floor (_number / 100) - _digit1 * 10; +private _digit3 = floor (_number / 10) - _digit1 * 100 - _digit2 * 10; +private _digit4 = _number mod 10; switch (_coordinate) do { case 0 : { diff --git a/addons/vector/functions/fnc_dataTransfer.sqf b/addons/vector/functions/fnc_dataTransfer.sqf index f99490f04c..4a91a0636d 100644 --- a/addons/vector/functions/fnc_dataTransfer.sqf +++ b/addons/vector/functions/fnc_dataTransfer.sqf @@ -3,10 +3,10 @@ * Data transfer over a connected cable. Based on page 14 of pdf. * * Arguments: - * Nothing + * None * * Return Value: - * Nothing + * None * * Example: * [] call ace_vector_fnc_dataTransfer @@ -15,11 +15,9 @@ */ #include "script_component.hpp" -private ["_distance", "_direction", "_azimuth", "_inclination"]; - -_distance = call FUNC(getDistance); -_direction = call FUNC(getDirection); -_azimuth = _direction select 0; -_inclination = _direction select 1; +private _distance = call FUNC(getDistance); +private _direction = call FUNC(getDirection); +private _azimuth = _direction select 0; +private _inclination = _direction select 1; //Send Data to connected GPS [QGVAR(rangefinderData), [_distance, _azimuth, _inclination]] call CBA_fnc_localEvent; diff --git a/addons/vector/functions/fnc_getDirection.sqf b/addons/vector/functions/fnc_getDirection.sqf index c34826e218..4b67cfed28 100644 --- a/addons/vector/functions/fnc_getDirection.sqf +++ b/addons/vector/functions/fnc_getDirection.sqf @@ -1,3 +1,19 @@ +/* + * Author: commy2 + * + * + * Arguments: + * None + * + * Return Value: + * Array + * + * Example: + * call ace_vector_fnc_getDirection + * + * Public: No + */ + // by commy2 #include "script_component.hpp" diff --git a/addons/vector/functions/fnc_getDistance.sqf b/addons/vector/functions/fnc_getDistance.sqf index f1312be511..7b62b5727b 100644 --- a/addons/vector/functions/fnc_getDistance.sqf +++ b/addons/vector/functions/fnc_getDistance.sqf @@ -1,15 +1,28 @@ -// by commy2 +/* + * Author: commy2 + * + * + * Arguments: + * None + * + * Return Value: + * Array + * + * Example: + * call ace_vector_fnc_getDistance + * + * Public: No + */ + #include "script_component.hpp" #define MIN_DISTANCE 10 #define MAX_DISTANCE [6000, 9000] select GVAR(useFeet) -private ["_dlgVector", "_distance"]; - disableSerialization; -_dlgVector = GETUVAR(ACE_dlgVector,displayNull); +private _dlgVector = GETUVAR(ACE_dlgVector,displayNull); -_distance = ctrlText (_dlgVector displayCtrl 151); +private _distance = ctrlText (_dlgVector displayCtrl 151); if (_distance == "----") exitWith {-1000}; diff --git a/addons/vector/functions/fnc_getFallOfShot.sqf b/addons/vector/functions/fnc_getFallOfShot.sqf index 365a41518e..db906ac660 100644 --- a/addons/vector/functions/fnc_getFallOfShot.sqf +++ b/addons/vector/functions/fnc_getFallOfShot.sqf @@ -1,23 +1,33 @@ -// by commy2 +/* + * Author: commy2 + * + * + * Arguments: + * None + * + * Return Value: + * Array + * + * Example: + * call ace_vector_fnc_getFallOfShot + * + * Public: No + */ + #include "script_component.hpp" -private ["_distanceP1", "_directionP1", "_azimuthP1", "_inclinationP1", "_distanceP2", "_directionP2", "_azimuthP2", "_inclinationP2"]; +private _distanceP1 = GVAR(pData) select 0; +private _directionP1 = GVAR(pData) select 1; +private _azimuthP1 = _directionP1 select 0; +private _inclinationP1 = _directionP1 select 1; +private _distanceP2 = call FUNC(getDistance); +private _directionP2 = call FUNC(getDirection); +private _azimuthP2 = _directionP2 select 0; +private _inclinationP2 = _directionP2 select 1; -_distanceP1 = GVAR(pData) select 0; -_directionP1 = GVAR(pData) select 1; -_azimuthP1 = _directionP1 select 0; -_inclinationP1 = _directionP1 select 1; - -_distanceP2 = call FUNC(getDistance); -_directionP2 = call FUNC(getDirection); -_azimuthP2 = _directionP2 select 0; -_inclinationP2 = _directionP2 select 1; - -private ["_abscissa", "_ordinate", "_applicate"]; - -_abscissa = _distanceP1 * sin (_azimuthP1 - _azimuthP2); -_ordinate = _distanceP1 * cos (_inclinationP1 - _inclinationP2) - _distanceP2 * cos (_azimuthP1 - _azimuthP2); -_applicate = (sin _inclinationP2 * _distanceP2) - (sin _inclinationP1 * _distanceP1); +private _abscissa = _distanceP1 * sin (_azimuthP1 - _azimuthP2); +private _ordinate = _distanceP1 * cos (_inclinationP1 - _inclinationP2) - _distanceP2 * cos (_azimuthP1 - _azimuthP2); +private _applicate = (sin _inclinationP2 * _distanceP2) - (sin _inclinationP1 * _distanceP1); if (_distanceP1 < -999 || {_distanceP2 < -999}) exitWith { [-1000, -1000, -1000] // return diff --git a/addons/vector/functions/fnc_getHeightDistance.sqf b/addons/vector/functions/fnc_getHeightDistance.sqf index 9ec0919917..003aefea51 100644 --- a/addons/vector/functions/fnc_getHeightDistance.sqf +++ b/addons/vector/functions/fnc_getHeightDistance.sqf @@ -1,13 +1,26 @@ -// by commy2 +/* + * Author: commy2 + * + * + * Arguments: + * None + * + * Return Value: + * Array + * + * Example: + * call ace_vector_fnc_getHeightDistance + * + * Public: No + */ + #include "script_component.hpp" -private ["_distance", "_direction", "_azimuth", "_inclination"]; +private _distance = call FUNC(getDistance); +private _direction = call FUNC(getDirection); -_distance = call FUNC(getDistance); -_direction = call FUNC(getDirection); - -_azimuth = _direction select 0; -_inclination = _direction select 1; +private _azimuth = _direction select 0; +private _inclination = _direction select 1; if (_distance < -999) exitWith { [-1000, -1000] // return diff --git a/addons/vector/functions/fnc_getRelativeAzimuthDistance.sqf b/addons/vector/functions/fnc_getRelativeAzimuthDistance.sqf index 765d3d6ec4..ce6716e4d3 100644 --- a/addons/vector/functions/fnc_getRelativeAzimuthDistance.sqf +++ b/addons/vector/functions/fnc_getRelativeAzimuthDistance.sqf @@ -1,28 +1,39 @@ -// by commy2 +/* + * Author: commy2 + * + * + * Arguments: + * None + * + * Return Value: + * Array + * + * Example: + * call ace_vector_fnc_getRelativeAzimuthDistance + * + * Public: No + */ + #include "script_component.hpp" -private ["_distanceP1", "_directionP1", "_azimuthP1", "_inclinationP1", "_distanceP2", "_directionP2", "_azimuthP2", "_inclinationP2"]; +private _distanceP1 = GVAR(pData) select 0; +private _directionP1 = GVAR(pData) select 1; +private _azimuthP1 = _directionP1 select 0; +private _inclinationP1 = _directionP1 select 1; -_distanceP1 = GVAR(pData) select 0; -_directionP1 = GVAR(pData) select 1; -_azimuthP1 = _directionP1 select 0; -_inclinationP1 = _directionP1 select 1; +private _distanceP2 = call FUNC(getDistance); +private _directionP2 = call FUNC(getDirection); +private _azimuthP2 = _directionP2 select 0; +private _inclinationP2 = _directionP2 select 1; -_distanceP2 = call FUNC(getDistance); -_directionP2 = call FUNC(getDirection); -_azimuthP2 = _directionP2 select 0; -_inclinationP2 = _directionP2 select 1; +private _relDirection = sqrt ((_azimuthP1 - _azimuthP2) ^ 2 + (_inclinationP1 - _inclinationP2) ^ 2); +private _relDistance = sqrt (_distanceP1 ^ 2 + _distanceP2 ^ 2 - 2 * _distanceP1 * _distanceP2 * cos _relDirection); +private _relHeight = (sin _inclinationP1 * _distanceP1) - (sin _inclinationP2 * _distanceP2); +private _relLength = sqrt (_relDistance ^ 2 - _relHeight ^ 2); if (str(_relLength) == "-1.#IND") then {_relLength = 0}; -private ["_relDirection", "_relDistance", "_relHeight", "_relLength", "_lenghtP1", "_lenghtP2", "_relAzimuth"]; - -_relDirection = sqrt ((_azimuthP1 - _azimuthP2) ^ 2 + (_inclinationP1 - _inclinationP2) ^ 2); -_relDistance = sqrt (_distanceP1 ^ 2 + _distanceP2 ^ 2 - 2 * _distanceP1 * _distanceP2 * cos _relDirection); -_relHeight = (sin _inclinationP1 * _distanceP1) - (sin _inclinationP2 * _distanceP2); -_relLength = sqrt (_relDistance ^ 2 - _relHeight ^ 2); if (str(_relLength) == "-1.#IND") then {_relLength = 0}; - -_lenghtP1 = cos _inclinationP1 * _distanceP1; -_lenghtP2 = cos _inclinationP2 * _distanceP2; -_relAzimuth = (sin _azimuthP2 * _lenghtP2 - sin _azimuthP1 * _lenghtP1) atan2 (cos _azimuthP2 * _lenghtP2 - cos _azimuthP1 * _lenghtP1); +private _lenghtP1 = cos _inclinationP1 * _distanceP1; +private _lenghtP2 = cos _inclinationP2 * _distanceP2; +private _relAzimuth = (sin _azimuthP2 * _lenghtP2 - sin _azimuthP1 * _lenghtP1) atan2 (cos _azimuthP2 * _lenghtP2 - cos _azimuthP1 * _lenghtP1); if (_relAzimuth < 0) then {_relAzimuth = _relAzimuth + 360}; if (_distanceP1 < -999 || {_distanceP2 < -999}) exitWith { diff --git a/addons/vector/functions/fnc_getRelativeDistance.sqf b/addons/vector/functions/fnc_getRelativeDistance.sqf index 9c6dc38943..f6815ea552 100644 --- a/addons/vector/functions/fnc_getRelativeDistance.sqf +++ b/addons/vector/functions/fnc_getRelativeDistance.sqf @@ -1,22 +1,34 @@ -// by commy2 +/* + * Author: commy2 + * + * + * Arguments: + * None + * + * Return Value: + * Number + * + * Example: + * call ace_vector_fnc_getRelativeDistance + * + * Public: No + */ + #include "script_component.hpp" -private ["_distanceP1", "_directionP1", "_azimuthP1", "_inclinationP1", "_distanceP2", "_directionP2", "_azimuthP2", "_inclinationP2"]; +private _distanceP1 = GVAR(pData) select 0; +private _directionP1 = GVAR(pData) select 1; +private _azimuthP1 = _directionP1 select 0; +private _inclinationP1 = _directionP1 select 1; -_distanceP1 = GVAR(pData) select 0; -_directionP1 = GVAR(pData) select 1; -_azimuthP1 = _directionP1 select 0; -_inclinationP1 = _directionP1 select 1; +private _distanceP2 = call FUNC(getDistance); +private _directionP2 = call FUNC(getDirection); +private _azimuthP2 = _directionP2 select 0; +private _inclinationP2 = _directionP2 select 1; -_distanceP2 = call FUNC(getDistance); -_directionP2 = call FUNC(getDirection); -_azimuthP2 = _directionP2 select 0; -_inclinationP2 = _directionP2 select 1; -private ["_relDirection", "_relDistance"]; - -_relDirection = sqrt ((_azimuthP1 - _azimuthP2) ^ 2 + (_inclinationP1 - _inclinationP2) ^ 2); -_relDistance = sqrt (_distanceP1 ^ 2 + _distanceP2 ^ 2 - 2 * _distanceP1 * _distanceP2 * cos _relDirection); +private _relDirection = sqrt ((_azimuthP1 - _azimuthP2) ^ 2 + (_inclinationP1 - _inclinationP2) ^ 2); +private _relDistance = sqrt (_distanceP1 ^ 2 + _distanceP2 ^ 2 - 2 * _distanceP1 * _distanceP2 * cos _relDirection); if (_distanceP1 < -999 || {_distanceP2 < -999}) exitWith { -1000 // return diff --git a/addons/vector/functions/fnc_getRelativeHeightLength.sqf b/addons/vector/functions/fnc_getRelativeHeightLength.sqf index 319b11b6a6..99cb828232 100644 --- a/addons/vector/functions/fnc_getRelativeHeightLength.sqf +++ b/addons/vector/functions/fnc_getRelativeHeightLength.sqf @@ -1,24 +1,34 @@ -// by commy2 +/* + * Author: commy2 + * + * + * Arguments: + * None + * + * Return Value: + * Array + * + * Example: + * call ace_vector_fnc_getRelativeHeightLength + * + * Public: No + */ + #include "script_component.hpp" -private ["_distanceP1", "_directionP1", "_azimuthP1", "_inclinationP1", "_distanceP2", "_directionP2", "_azimuthP2", "_inclinationP2"]; +private _distanceP1 = GVAR(pData) select 0; +private _directionP1 = GVAR(pData) select 1; +private _azimuthP1 = _directionP1 select 0; +private _inclinationP1 = _directionP1 select 1; +private _distanceP2 = call FUNC(getDistance); +private _directionP2 = call FUNC(getDirection); +private _azimuthP2 = _directionP2 select 0; +private _inclinationP2 = _directionP2 select 1; -_distanceP1 = GVAR(pData) select 0; -_directionP1 = GVAR(pData) select 1; -_azimuthP1 = _directionP1 select 0; -_inclinationP1 = _directionP1 select 1; - -_distanceP2 = call FUNC(getDistance); -_directionP2 = call FUNC(getDirection); -_azimuthP2 = _directionP2 select 0; -_inclinationP2 = _directionP2 select 1; - -private ["_azimuth", "_inclination", "_height", "_length"]; - -_azimuth = abs (_azimuthP1 - _azimuthP2); -_inclination = abs (_inclinationP1 - _inclinationP2); -_height = sqrt (_distanceP1 ^ 2 + _distanceP2 ^ 2 - 2 * _distanceP1 * _distanceP2 * cos _inclination); -_length = sqrt (_distanceP1 ^ 2 + _distanceP2 ^ 2 - 2 * _distanceP1 * _distanceP2 * cos _azimuth); +private _azimuth = abs (_azimuthP1 - _azimuthP2); +private _inclination = abs (_inclinationP1 - _inclinationP2); +private _height = sqrt (_distanceP1 ^ 2 + _distanceP2 ^ 2 - 2 * _distanceP1 * _distanceP2 * cos _inclination); +private _length = sqrt (_distanceP1 ^ 2 + _distanceP2 ^ 2 - 2 * _distanceP1 * _distanceP2 * cos _azimuth); if (_inclination < 0) then {_height = -1 * _height}; diff --git a/addons/vector/functions/fnc_illuminate.sqf b/addons/vector/functions/fnc_illuminate.sqf index 03508aae9e..8ecc10690f 100644 --- a/addons/vector/functions/fnc_illuminate.sqf +++ b/addons/vector/functions/fnc_illuminate.sqf @@ -1,4 +1,19 @@ -// by commy2 +/* + * Author: commy2 + * + * + * Arguments: + * 0: String + * + * Return Value: + * None + * + * Example: + * ["5"] call ace_vector_fnc_illuminate + * + * Public: No + */ + #include "script_component.hpp" disableSerialization; diff --git a/addons/vector/functions/fnc_nextMode.sqf b/addons/vector/functions/fnc_nextMode.sqf index 53054e85e6..8e6d596f58 100644 --- a/addons/vector/functions/fnc_nextMode.sqf +++ b/addons/vector/functions/fnc_nextMode.sqf @@ -1,4 +1,19 @@ -// by commy2 +/* + * Author: commy2 + * + * + * Arguments: + * 0: String + * + * Return Value: + * Array + * + * Example: + * ["5"] call ace_vector_fnc_nextMode + * + * Public: No + */ + #include "script_component.hpp" switch (_this select 0) do { diff --git a/addons/vector/functions/fnc_onKeyDown.sqf b/addons/vector/functions/fnc_onKeyDown.sqf index 830fb3c3c5..194a3b74af 100644 --- a/addons/vector/functions/fnc_onKeyDown.sqf +++ b/addons/vector/functions/fnc_onKeyDown.sqf @@ -1,10 +1,19 @@ /* + * Author: commy2 + * Handles pressing the special vector keys. + * + * Arguments: + * 0: String + * + * Return Value: + * None + * + * Example: + * ["5"] call ace_vector_fnc_onKeyDown + * + * Public: No + */ -by commy2 - -Handles pressing the special vector keys. - -*/ #include "script_component.hpp" // set vector config settings diff --git a/addons/vector/functions/fnc_onKeyHold.sqf b/addons/vector/functions/fnc_onKeyHold.sqf index 3fdd637b61..fdfa22d2b5 100644 --- a/addons/vector/functions/fnc_onKeyHold.sqf +++ b/addons/vector/functions/fnc_onKeyHold.sqf @@ -1,10 +1,20 @@ /* + * Author: commy2 + * PFH executed while holding a vector key down. + * + * Arguments: + * 0: String + * 1: Number + * + * Return Value: + * None + * + * Example: + * ["5", 5] call ace_vector_fnc_onKeyHold + * + * Public: No + */ -by commy2 - -PFH executed while holding a vector key down. - -*/ #include "script_component.hpp" if (!((currentWeapon ACE_player) isKindOf ["ACE_Vector", configFile >> "CfgWeapons"])) exitWith { diff --git a/addons/vector/functions/fnc_onKeyUp.sqf b/addons/vector/functions/fnc_onKeyUp.sqf index fc3d17700e..6896026b50 100644 --- a/addons/vector/functions/fnc_onKeyUp.sqf +++ b/addons/vector/functions/fnc_onKeyUp.sqf @@ -1,10 +1,19 @@ /* + * Author: commy2 + * Handles releasing the special vector keys. + * + * Arguments: + * 0: String + * + * Return Value: + * None + * + * Example: + * ["5"] call ace_vector_fnc_onKeyUp + * + * Public: No + */ -by commy2 - -Handles releasing the special vector keys. - -*/ #include "script_component.hpp" private _fnc_setPFH = { diff --git a/addons/vector/functions/fnc_showAzimuth.sqf b/addons/vector/functions/fnc_showAzimuth.sqf index 2bedd4bf52..59166e1f4c 100644 --- a/addons/vector/functions/fnc_showAzimuth.sqf +++ b/addons/vector/functions/fnc_showAzimuth.sqf @@ -1,4 +1,19 @@ -// by commy2 +/* + * Author: commy2 + * + * + * Arguments: + * None + * + * Return Value: + * None + * + * Example: + * call ace_vector_fnc_showAzimuth + * + * Public: No + */ + #include "script_component.hpp" disableSerialization; diff --git a/addons/vector/functions/fnc_showAzimuthInclination.sqf b/addons/vector/functions/fnc_showAzimuthInclination.sqf index b00c035890..d6b8740e2a 100644 --- a/addons/vector/functions/fnc_showAzimuthInclination.sqf +++ b/addons/vector/functions/fnc_showAzimuthInclination.sqf @@ -1,4 +1,19 @@ -// by commy2 +/* + * Author: commy2 + * + * + * Arguments: + * None + * + * Return Value: + * None + * + * Example: + * call ace_vector_fnc_showAzimuthInclination + * + * Public: No + */ + #include "script_component.hpp" disableSerialization; diff --git a/addons/vector/functions/fnc_showCenter.sqf b/addons/vector/functions/fnc_showCenter.sqf index 4870b10a69..8142a2c3be 100644 --- a/addons/vector/functions/fnc_showCenter.sqf +++ b/addons/vector/functions/fnc_showCenter.sqf @@ -1,10 +1,19 @@ /* + * Author: commy2 + * Shows or hides the vectors center square thingy. + * + * Arguments: + * None + * + * Return Value: + * None + * + * Example: + * call ace_vector_fnc_showCenter + * + * Public: No + */ -by commy2 - -Shows or hides the vectors center square thingy. - -*/ #include "script_component.hpp" ((GETUVAR(ACE_dlgVector,displayNull)) displayCtrl 1301) ctrlSetText (["", QPATHTOF(rsc\vector_center.paa)] select (_this select 0)); diff --git a/addons/vector/functions/fnc_showDistance.sqf b/addons/vector/functions/fnc_showDistance.sqf index 380f784bbc..ffabeb9824 100644 --- a/addons/vector/functions/fnc_showDistance.sqf +++ b/addons/vector/functions/fnc_showDistance.sqf @@ -1,4 +1,19 @@ -// by commy2 +/* + * Author: commy2 + * + * + * Arguments: + * None + * + * Return Value: + * None + * + * Example: + * call ace_vector_fnc_showDistance + * + * Public: No + */ + #include "script_component.hpp" disableSerialization; diff --git a/addons/vector/functions/fnc_showFallOfShot.sqf b/addons/vector/functions/fnc_showFallOfShot.sqf index b7bed77a0b..459f1dcaed 100644 --- a/addons/vector/functions/fnc_showFallOfShot.sqf +++ b/addons/vector/functions/fnc_showFallOfShot.sqf @@ -1,4 +1,19 @@ -// by commy2 +/* + * Author: commy2 + * + * + * Arguments: + * 0: Unknown + * + * Return Value: + * None + * + * Example: + * [?] call ace_vector_fnc_showFallOfShot + * + * Public: No + */ + #include "script_component.hpp" GVAR(FOSState) = _this select 0; diff --git a/addons/vector/functions/fnc_showHeightDistance.sqf b/addons/vector/functions/fnc_showHeightDistance.sqf index b34e8111bc..cbe0b7b86d 100644 --- a/addons/vector/functions/fnc_showHeightDistance.sqf +++ b/addons/vector/functions/fnc_showHeightDistance.sqf @@ -1,4 +1,19 @@ -// by commy2 +/* + * Author: commy2 + * + * + * Arguments: + * None + * + * Return Value: + * None + * + * Example: + * call ace_vector_fnc_showHeightDistance + * + * Public: No + */ + #include "script_component.hpp" disableSerialization; diff --git a/addons/vector/functions/fnc_showP1.sqf b/addons/vector/functions/fnc_showP1.sqf index 8d509d575f..3975399bcb 100644 --- a/addons/vector/functions/fnc_showP1.sqf +++ b/addons/vector/functions/fnc_showP1.sqf @@ -1,10 +1,19 @@ /* + * Author: commy2 + * Shows or hides the 1-P text line. + * + * Arguments: + * None + * + * Return Value: + * None + * + * Example: + * call ace_vector_fnc_showP1 + * + * Public: No + */ -by commy2 - -Shows or hides the 1-P text line. - -*/ #include "script_component.hpp" disableSerialization; diff --git a/addons/vector/functions/fnc_showRelativeAzimuthDistance.sqf b/addons/vector/functions/fnc_showRelativeAzimuthDistance.sqf index 95797b9d6c..a9426be05c 100644 --- a/addons/vector/functions/fnc_showRelativeAzimuthDistance.sqf +++ b/addons/vector/functions/fnc_showRelativeAzimuthDistance.sqf @@ -1,4 +1,19 @@ -// by commy2 +/* + * Author: commy2 + * + * + * Arguments: + * None + * + * Return Value: + * None + * + * Example: + * call ace_vector_fnc_showRelativeAzimuthDistance + * + * Public: No + */ + #include "script_component.hpp" disableSerialization; diff --git a/addons/vector/functions/fnc_showRelativeDistance.sqf b/addons/vector/functions/fnc_showRelativeDistance.sqf index 74b778d8bf..e0853efa03 100644 --- a/addons/vector/functions/fnc_showRelativeDistance.sqf +++ b/addons/vector/functions/fnc_showRelativeDistance.sqf @@ -1,4 +1,19 @@ -// by commy2 +/* + * Author: commy2 + * + * + * Arguments: + * None + * + * Return Value: + * None + * + * Example: + * call ace_vector_fnc_showRelativeDistance + * + * Public: No + */ + #include "script_component.hpp" disableSerialization; diff --git a/addons/vector/functions/fnc_showRelativeHeightLength.sqf b/addons/vector/functions/fnc_showRelativeHeightLength.sqf index 0b9f5c1928..13bd8061e1 100644 --- a/addons/vector/functions/fnc_showRelativeHeightLength.sqf +++ b/addons/vector/functions/fnc_showRelativeHeightLength.sqf @@ -1,4 +1,19 @@ -// by commy2 +/* + * Author: commy2 + * + * + * Arguments: + * None + * + * Return Value: + * None + * + * Example: + * call ace_vector_fnc_showRelativeHeightLength + * + * Public: No + */ + #include "script_component.hpp" disableSerialization; diff --git a/addons/vector/functions/fnc_showReticle.sqf b/addons/vector/functions/fnc_showReticle.sqf index bcd565774f..aeecfc5ef3 100644 --- a/addons/vector/functions/fnc_showReticle.sqf +++ b/addons/vector/functions/fnc_showReticle.sqf @@ -1,10 +1,19 @@ /* + * Author: commy2 + * Shows or hides the electronic reticle. + * + * Arguments: + * None + * + * Return Value: + * None + * + * Example: + * call ace_vector_fnc_showReticle + * + * Public: No + */ -by commy2 - -Shows or hides the electronic reticle. - -*/ #include "script_component.hpp" ((GETUVAR(ACE_dlgVector,displayNull)) displayCtrl 1302) ctrlSetText (["", QPATHTOF(rsc\vector_crosshair.paa)] select (_this select 0)); diff --git a/addons/vector/functions/fnc_showText.sqf b/addons/vector/functions/fnc_showText.sqf index b578269115..66628d8d44 100644 --- a/addons/vector/functions/fnc_showText.sqf +++ b/addons/vector/functions/fnc_showText.sqf @@ -1,4 +1,19 @@ -// by commy2 +/* + * Author: commy2 + * + * + * Arguments: + * 0: String + * + * Return Value: + * None + * + * Example: + * ["5"] call ace_vector_fnc_showText + * + * Public: No + */ + #include "script_component.hpp" disableSerialization; diff --git a/addons/vector/stringtable.xml b/addons/vector/stringtable.xml index 30e61a0258..76feaa2b5c 100644 --- a/addons/vector/stringtable.xml +++ b/addons/vector/stringtable.xml @@ -1,4 +1,4 @@ - + @@ -13,6 +13,9 @@ Vector 21 Nite Vector 21 Nite ベクター 21 ナイト + Vector 21 Nite + Vector 21 Nite + Vector 21 Nite Vector 21 @@ -26,6 +29,9 @@ Vector 21 Vector 21 ベクター 21 + Vector 21 + Vector 21 + Vector 21 Rangefinder @@ -39,6 +45,9 @@ Medidor de Distância Дальномер 測距機器 + 거리측정기 + 测距仪 + 測距儀 Vector - Azimuth Key @@ -52,6 +61,9 @@ Vector - Irányszög gomb Vector – Азимут ベクター - 方位角キー + Vector - 방위각 키 + Vector - 方位按键 + Vector - 方位按鍵 Vector - Distance Key @@ -65,6 +77,9 @@ Vector - Távolság gomb Vector – Расстояние ベクター - 距離キー + Vector - 거리 키 + Vector - 距离按键 + Vector - 距離按鍵 - \ No newline at end of file + diff --git a/addons/vehiclelock/CfgVehicles.hpp b/addons/vehiclelock/CfgVehicles.hpp index bf4231f426..4c51fae072 100644 --- a/addons/vehiclelock/CfgVehicles.hpp +++ b/addons/vehiclelock/CfgVehicles.hpp @@ -28,6 +28,7 @@ distance = 4; \ condition = QUOTE(([ARR_2(_player, _target)] call FUNC(hasKeyForVehicle)) && {(locked _target) in [ARR_2(2,3)]}); \ statement = QUOTE([ARR_3(QUOTE(QGVAR(setVehicleLock)), [ARR_2(_target,false)], [_target])] call CBA_fnc_targetEvent); \ + exceptions[] = {"isNotSwimming"}; \ priority = 0.3; \ icon = QPATHTOF(UI\key_menuIcon_ca.paa); \ }; \ @@ -36,6 +37,7 @@ distance = 4; \ condition = QUOTE(([ARR_2(_player, _target)] call FUNC(hasKeyForVehicle)) && {(locked _target) in [ARR_2(0,1)]}); \ statement = QUOTE([ARR_3(QUOTE(QGVAR(setVehicleLock)), [ARR_2(_target,true)], [_target])] call CBA_fnc_targetEvent); \ + exceptions[] = {"isNotSwimming"}; \ priority = 0.2; \ icon = QPATHTOF(UI\key_menuIcon_ca.paa); \ }; \ @@ -44,6 +46,7 @@ distance = 4; \ condition = QUOTE([ARR_3(_player, _target, 'canLockpick')] call FUNC(lockpick)); \ statement = QUOTE([ARR_3(_player, _target, 'startLockpick')] call FUNC(lockpick)); \ + exceptions[] = {"isNotSwimming"}; \ priority = 0.1; \ }; \ }; \ @@ -61,6 +64,13 @@ class CfgVehicles { class Helicopter: Air { MACRO_LOCK_ACTIONS }; + class Motorcycle: LandVehicle { + MACRO_LOCK_ACTIONS + }; + class Ship; + class Ship_F: Ship { + MACRO_LOCK_ACTIONS + }; class Logic; class Module_F: Logic { diff --git a/addons/vehiclelock/CfgWeapons.hpp b/addons/vehiclelock/CfgWeapons.hpp index 1d72a5538d..8c7f7b137a 100644 --- a/addons/vehiclelock/CfgWeapons.hpp +++ b/addons/vehiclelock/CfgWeapons.hpp @@ -1,6 +1,6 @@ class CfgWeapons { - class InventoryItem_Base_F; class ACE_ItemCore; + class CBA_MiscItem_ItemInfo; class ACE_key_master: ACE_ItemCore { scopeArsenal = 0; @@ -10,7 +10,7 @@ class CfgWeapons { model = "\A3\weapons_F\ammo\mag_univ.p3d"; picture = QPATHTOF(ui\keyBlack.paa); scope = 2; - class ItemInfo: InventoryItem_Base_F { + class ItemInfo: CBA_MiscItem_ItemInfo { mass = 0; }; }; diff --git a/addons/vehiclelock/XEH_preInit.sqf b/addons/vehiclelock/XEH_preInit.sqf index a7feade1c3..b47cf6628d 100644 --- a/addons/vehiclelock/XEH_preInit.sqf +++ b/addons/vehiclelock/XEH_preInit.sqf @@ -2,6 +2,8 @@ ADDON = false; +PREP_RECOMPILE_START; #include "XEH_PREP.hpp" +PREP_RECOMPILE_END; ADDON = true; diff --git a/addons/vehiclelock/functions/fnc_addKeyForVehicle.sqf b/addons/vehiclelock/functions/fnc_addKeyForVehicle.sqf index b45bf150f3..c7408bf5f5 100644 --- a/addons/vehiclelock/functions/fnc_addKeyForVehicle.sqf +++ b/addons/vehiclelock/functions/fnc_addKeyForVehicle.sqf @@ -18,8 +18,6 @@ */ #include "script_component.hpp" -private ["_previousMags","_newMags","_keyMagazine","_keyName"]; - if (!params [["_unit", objNull, [objNull]], ["_veh", objNull, [objNull]], ["_useCustom", false, [false]]]) exitWith { ERROR("Input wrong type"); }; @@ -29,15 +27,15 @@ if (isNull _unit) exitWith {ERROR("null unit");}; if (isNull _veh) exitWith {ERROR("null vehicle");}; if (_useCustom) then { - _previousMags = magazinesDetail _unit; + private _previousMags = magazinesDetail _unit; _unit addMagazine ["ACE_key_customKeyMagazine", 1]; //addMagazine array has global effects - _newMags = (magazinesDetail _unit) - _previousMags; + private _newMags = (magazinesDetail _unit) - _previousMags; if ((count _newMags) == 0) exitWith {ERROR("failed to add magazine (inventory full?)");}; - _keyMagazine = _newMags select 0; + private _keyMagazine = _newMags select 0; TRACE_2("setting up key on server",_veh,_keyMagazine); //Have the server run add the key to the vehicle's key array: [QGVAR(setupCustomKey), [_veh, _keyMagazine]] call CBA_fnc_serverEvent; } else { - _keyName = [_veh] call FUNC(getVehicleSideKey); + private _keyName = [_veh] call FUNC(getVehicleSideKey); _unit addItem _keyName; //addItem has global effects }; diff --git a/addons/vehiclelock/functions/fnc_getVehicleSideKey.sqf b/addons/vehiclelock/functions/fnc_getVehicleSideKey.sqf index eda75922c4..6642b12f8d 100644 --- a/addons/vehiclelock/functions/fnc_getVehicleSideKey.sqf +++ b/addons/vehiclelock/functions/fnc_getVehicleSideKey.sqf @@ -15,17 +15,15 @@ */ #include "script_component.hpp" -private ["_vehConfigSide","_vehSide","_returnValue"]; - params ["_veh"]; TRACE_1("params",_veh); if (isNull _veh) exitWith {ERROR("null vehicle"); "error"}; -_vehConfigSide = [_veh, true] call BIS_fnc_objectSide; -_vehSide = _veh getVariable [QGVAR(lockSide), _vehConfigSide]; +private _vehConfigSide = [_veh, true] call BIS_fnc_objectSide; +private _vehSide = _veh getVariable [QGVAR(lockSide), _vehConfigSide]; -_returnValue = ""; +private _returnValue = ""; switch (_vehSide) do { case (west): {_returnValue = "ACE_key_west"}; diff --git a/addons/vehiclelock/functions/fnc_handleVehicleInitPost.sqf b/addons/vehiclelock/functions/fnc_handleVehicleInitPost.sqf index b0835a6272..652cecadb8 100644 --- a/addons/vehiclelock/functions/fnc_handleVehicleInitPost.sqf +++ b/addons/vehiclelock/functions/fnc_handleVehicleInitPost.sqf @@ -25,13 +25,11 @@ TRACE_1("params",_vehicle); //If the module wasn't placed, just exit (needs to be in wait because objectInitEH is before moduleInit) if (GVAR(VehicleStartingLockState) == -1) exitWith {}; - private ["_lock"]; - params ["_vehicle"]; if ((_vehicle isKindOf "Car") || {_vehicle isKindOf "Tank"} || {_vehicle isKindOf "Helicopter"}) then { //set lock state (eliminates the ambigious 1-"Default" and 3-"Locked for Player" states) - _lock = switch (GVAR(VehicleStartingLockState)) do { + private _lock = switch (GVAR(VehicleStartingLockState)) do { case (0): { (locked _vehicle) in [2, 3] }; case (1): { true }; case (2): { false }; diff --git a/addons/vehiclelock/functions/fnc_hasKeyForVehicle.sqf b/addons/vehiclelock/functions/fnc_hasKeyForVehicle.sqf index 390104cefc..bc566794fe 100644 --- a/addons/vehiclelock/functions/fnc_hasKeyForVehicle.sqf +++ b/addons/vehiclelock/functions/fnc_hasKeyForVehicle.sqf @@ -16,25 +16,23 @@ */ #include "script_component.hpp" -private ["_returnValue","_sideKeyName","_customKeys"]; - params ["_unit", "_veh"]; TRACE_2("params",_unit,_veh); if (isNull _unit) exitWith {ERROR("null unit"); false}; if (isNull _veh) exitWith {ERROR("null vehicle"); false}; -_returnValue = false; +private _returnValue = false; //Master can open anything "no matter what" if ("ACE_key_master" in (items _unit)) then {_returnValue = true}; //Check side key -_sideKeyName = [_veh] call FUNC(getVehicleSideKey); +private _sideKeyName = [_veh] call FUNC(getVehicleSideKey); if (_sideKeyName in (items _unit)) then {_returnValue = true}; //Check custom keys -_customKeys = _veh getVariable [QGVAR(customKeys), []]; +private _customKeys = _veh getVariable [QGVAR(customKeys), []]; { if (_x in (magazinesDetail _unit)) then {_returnValue = true;}; } forEach _customKeys; diff --git a/addons/vehiclelock/functions/fnc_lockpick.sqf b/addons/vehiclelock/functions/fnc_lockpick.sqf index bf15a6eadd..a08289454a 100644 --- a/addons/vehiclelock/functions/fnc_lockpick.sqf +++ b/addons/vehiclelock/functions/fnc_lockpick.sqf @@ -20,8 +20,6 @@ */ #include "script_component.hpp" -private ["_vehLockpickStrenth","_condition","_returnValue"]; - params ["_unit", "_veh", "_funcType"]; TRACE_3("params",_unit,_veh,_funcType); @@ -34,14 +32,14 @@ if ((locked _veh) == 0) exitWith {false}; //need lockpick item if (!("ACE_key_lockpick" in (items _unit))) exitWith {false}; -_vehLockpickStrenth = _veh getVariable[QGVAR(lockpickStrength), GVAR(DefaultLockpickStrength)]; +private _vehLockpickStrenth = _veh getVariable[QGVAR(lockpickStrength), GVAR(DefaultLockpickStrength)]; if (!(_vehLockpickStrenth isEqualType 0)) exitWith {ERROR("ACE_vehicleLock_LockpickStrength invalid"); false}; //-1 indicates unpickable lock if (_vehLockpickStrenth < 0) exitWith {false}; //Condition check for progressBar -_condition = { +private _condition = { params ["_args"]; _args params ["_unit", "_veh"]; ((_unit distance _veh) < 5) && {(speed _veh) < 0.1} @@ -49,10 +47,13 @@ _condition = { if (!([[_unit, _veh]] call _condition)) exitWith {false}; -_returnValue = _funcType in ["canLockpick", "startLockpick", "finishLockpick"]; +private _returnValue = _funcType in ["canLockpick", "startLockpick", "finishLockpick"]; switch (_funcType) do { + case "canLockpick": { + _returnValue = !([_unit, _veh] call FUNC(hasKeyForVehicle)) && {(locked _veh) in [2, 3]}; + }; case "startLockpick": { - [_vehLockpickStrenth, [_unit, _veh, "finishLockpick"], {(_this select 0) call FUNC(lockpick)}, {}, (localize LSTRING(Action_LockpickInUse)), _condition] call EFUNC(common,progressBar); + [_vehLockpickStrenth, [_unit, _veh, "finishLockpick"], {(_this select 0) call FUNC(lockpick)}, {}, (localize LSTRING(Action_LockpickInUse)), _condition, ["isNotInside", "isNotSwimming"]] call EFUNC(common,progressBar); }; case "finishLockpick": { [QGVAR(setVehicleLock), [_veh, false], [_veh]] call CBA_fnc_targetEvent; diff --git a/addons/vehiclelock/functions/fnc_moduleSync.sqf b/addons/vehiclelock/functions/fnc_moduleSync.sqf index 82477f881c..569f4a0691 100644 --- a/addons/vehiclelock/functions/fnc_moduleSync.sqf +++ b/addons/vehiclelock/functions/fnc_moduleSync.sqf @@ -25,11 +25,9 @@ TRACE_3("params",_logic,_syncedObjects,_activated); if !(_activated) exitWith {WARNING("Vehicle Lock Sync Module - placed but not active");}; [{ - private ["_listOfVehicles"]; - params ["_syncedObjects"]; - _listOfVehicles = []; + private _listOfVehicles = []; { if ((_x isKindOf "Car") || (_x isKindOf "Tank") || (_x isKindOf "Helicopter")) then { _listOfVehicles pushBack _x; diff --git a/addons/vehiclelock/stringtable.xml b/addons/vehiclelock/stringtable.xml index da262f867c..2ad5d7b22e 100644 --- a/addons/vehiclelock/stringtable.xml +++ b/addons/vehiclelock/stringtable.xml @@ -13,6 +13,9 @@ Sblocca il veicolo Destravar veículo 車両の鍵を開ける + 차량 잠금열기 + 载具解锁 + 載具解鎖 Lock Vehicle @@ -26,6 +29,9 @@ Chiudi il veicolo a chiave Travar Veículo 車両を施錠 + 차량 잠그기 + 载具上锁 + 載具上鎖 Lockpick Vehicle @@ -39,6 +45,9 @@ Scassina veicolo Usar mixa no Veículo 鍵をこじ開ける + 차량 문따기 + 解锁载具 + 解鎖載具 Picking Lock... @@ -52,6 +61,9 @@ Scassino il veicolo... Usando Mixa... 鍵をこじ開けている・・・ + 문따는중... + 解锁中... + 解鎖中... A custom key that will open a specific vehicle. @@ -65,6 +77,9 @@ Una chiave personalizzata che apre determinati veicoli. Uma chave específica que abre um veículo específico. カスタム キーは特定車両を開けられます。 + 특정 차량을 여는 특수 열쇠 + 使用指定的钥匙来开启特定的载具 + 使用指定的鑰匙來開啟特定的載具 A Master Key will open any lock, no matter what! @@ -78,6 +93,9 @@ Un passe-partout che apre qualsiasi serratura! Uma chave mestre irá abrir qualquer fechadura, não importa qual! マスター キーは全ての鍵を開けられます。 + 어떤 차량도 열 수 있는 마스터키 입니다! + 万用解锁钥匙,能解锁任何载具 + 萬用解鎖鑰匙,能解鎖任何載具 A lockpick set that can pick the locks of most vehicles. @@ -91,6 +109,9 @@ Un grimardello per forzare la maggior parte dei veicoli Um set de chave mixas que pode abrir a maioria dos veículos. ピッキング ツールでは多くの車両をこじ開けられます。 + 거의 모든 차량을 열 수 있게 해주는 해정도구 모음입니다. + 一组解锁钥匙 (可解锁大部份载具) + 一組解鎖鑰匙 (可解鎖大部份載具) A key that should open most WEST vehicles. @@ -103,7 +124,10 @@ Ключ для открытия большинства машин Красных. Una chiave che apre la maggior parte dei veicoli occidentali Uma chave que abre a maioria dos veículos ocidentais - このキーは多くの WEST 車両を開けられます。 + このキーは多くの同盟軍車両を開けられます。 + 거의 모든 서방진영 차량을 여는 열쇠입니다. + 一组解锁钥匙 (可解锁大部份蓝方载具) + 一組解鎖鑰匙 (可解鎖大部份藍方載具) A key that should open most EAST vehicle. @@ -116,7 +140,10 @@ Ключ для открытия большинства машин Синих. Una chaive che apre la maggior parte dei veicoli orientali Uma chave que abre a maioria dos veículos orientais - このキーは多くの EAST 車両を開けられます。 + このキーは多くのOPFOR軍車両を開けられます。 + 거의 모든 동방진영 차량을 여는 열쇠입니다. + 一组解锁钥匙 (可解锁大部份红方载具) + 一組解鎖鑰匙 (可解鎖大部份紅方載具) A key that should open most INDEP vehicle. @@ -129,7 +156,10 @@ Ключ для открытия большинства машин Независимых. Una chaive che apre la maggior parte dei veicoli degli indipendenti Uma chave que abre a maioria dos veículos independentes - このキーは多くの INDEP 車両を開けられます。 + このキーは多くの独立軍車両を開けられます。 + 거의 모든 중립진영 차량을 여는 열쇠입니다. + 一组解锁钥匙 (可解锁大部份独立方载具) + 一組解鎖鑰匙 (可解鎖大部份獨立方載具) A key that should open most CIV vehicle. @@ -142,7 +172,10 @@ Ключ для открытия большинства машин Гражданских. Una chaive che apr ela maggior parte dei veicoli civili Uma chave que abre a maioria dos veículos civis. - このキーは多くの CIV 車両を開けられます。 + このキーは多くの市民車両を開けられます。 + 거의 모든 민간인 차량을 여는 열쇠입니다 + 一组解锁钥匙 (可解锁大部份平民载具) + 一組解鎖鑰匙 (可解鎖大部份平民載具) Vehicle Lock Setup @@ -156,6 +189,9 @@ Запирание транспорта Impostazioni Blocco Veicolo 車両の施錠の設定 + 차량 잠금 설정 + 载具上锁设置 + 載具上鎖設置 Lock Vehicle Inventory @@ -169,6 +205,9 @@ Закрывать инвентарь транспорта Blocca Inventario Veicolo 施錠されている車両のインベントリ + 차량 소지품 잠금 + 上锁载具的车箱 + 上鎖載具的車箱 Locks the inventory of locked vehicles @@ -181,7 +220,10 @@ Bezárja a zárt járművek rakterét is Закрывать инвентарь транспорта, если транспорт закрыт Blocca l'inventario di un veicolo bloccato - 施錠されている車両の、開けないインベントリ + 施錠されている車両の開けないインベントリ + 잠긴 차량의 소지품을 뒤지지못하게 합니다. + 上锁载具的车箱,使玩家不能拿取/查看载具内的装备 + 上鎖載具的車箱,使玩家不能拿取/查看載具內的裝備 Vehicle Starting Lock State @@ -195,6 +237,9 @@ Начальное состояние замков Stato Iniziale del Blocco per Veicoli 開始時における車両の鍵の状態 + 시작시 차량 잠금 상태 + 载具初始上锁状态 + 載具初始上鎖狀態 Set lock state for all vehicles (removes ambiguous lock states) @@ -207,7 +252,10 @@ Beállítja a zár-állapotot az összes járműhöz (eltávolítja az azonosíthatatlan zárállapotokat) Устанавливает начальное состояние замков всех транспортных средств (устраняет неоднозначные состояния) Imposta lo stato di blocco per tutti i veicoli (rimuove stati di blocco ambigui) - 全車両への鍵の状態を設定します。(あいまいな鍵の状態を削除) + 全車両へ鍵の状態を設定します。(あいまいな鍵の状態を削除) + 모든 차량의 잠금 상태를 정합니다. (애매한 잠금 상태는 모두 없앱니다.) + 设定所有载具的初始上锁状态 (移除不明确的锁定状态) + 設定所有載具的初始上鎖狀態 (移除不明確的鎖定狀態) As Is @@ -221,6 +269,9 @@ Как есть Com'è そのまま + 그대로 + 无变化 + 無變化 Locked @@ -234,6 +285,9 @@ Закрыт Bloccato 施錠ずみ + 잠김 + 上锁 + 上鎖 Unlocked @@ -247,6 +301,9 @@ Открыт Sbloccato 開錠ずみ + 열림 + 解锁 + 解鎖 Default Lockpick Strength @@ -259,7 +316,10 @@ Alapértelmezett zártörő-erősség Сила отмычки по-умолчанию Durabilità Default del Grimaldello - ピッキング ツールの標準の有効度 + ピッキング ツールの能力設定 + 기본 해정도구 설정 + 预设开锁能力 + 預設開鎖能力 Default Time to lockpick (in seconds). Default: 10 @@ -272,7 +332,10 @@ Alapértelmezett idő a zárfeltöréshez (másodpercben). Alapértelmezett: 10 Время для взлома замка отмычкой (в секундах). По-умолчанию: 10 Tempo Default richiesto per forzare serrature (in secondi). Default: 10 - ピッキング ツールに標準の時間を設定。(秒) 標準:10 + ピッキング ツールを使った作業時間の標準設定。(秒) 標準: 10 + 해정을 위해 들이는 기본시간입니다(초 단위). 기본설정: 10 + 开锁时间(秒)。预设:10 + 開鎖時間(秒)。預設:10 Settings for lockpick strength and initial vehicle lock state. Removes ambiguous lock states. @@ -285,7 +348,10 @@ Beállítások a zártörő erősségére és alapértelmezett zár-állapotra a járműveken. Eltávolítja az azonosíthatatlan zár-állapotokat. Настройки силы отмычек и начальное состояние замков транспорта. Устраняет неоднозначные состояния замков. Impostazioni per resistenza iniziale delle serrature e stato di blocco dei veicoli. Rimuove stati di blocco ambigui. - ピッキング ツールの強さと車両の鍵の初期状態を設定できます。あいまいな鍵の状態を削除します。 + ピッキング ツールの能力と車両の鍵の初期状態を設定できます。あいまいな鍵の状態を削除します。 + 해정도구 설정과 시작시 차량의 잠금 상태 그리고 애매한 잠금 상태를 지우는 설정입니다. + 设定开锁能力和初始载具上锁状态。移除不明确的锁定状态 + 設定開鎖能力和初始載具上鎖狀態。移除不明確的鎖定狀態 Vehicle Key Assign @@ -299,6 +365,9 @@ Назначение ключей от транспорта Assegna Chiavi Veicoli 車両の鍵を割り当て + 차량 열쇠 등록 + 指定载具钥匙 + 指定載具鑰匙 Sync with vehicles and players. Will handout custom keys to players for every synced vehicle. Only valid for objects present at mission start. @@ -312,6 +381,9 @@ Синхронизируйте с транспортом и игроком. Это выдаст игроку ключи от всех синхронизированных транспортных средств. Работает только для объектов, присутствующих на старте миссии Sincronizza con veicoli e giocatori. Distribuirà chiavi ai giocatori per ogni veicolo sincronizzato. Valido solo per oggetti presenti ad inizio missione. 車両とプレイヤへ同期します。プレイヤへ同期された車両のカスタム キーを作ります。これはミッション開始時に作成されたオブジェクトでのみ有効です。 + 차량과 플레이어에게 동기화됩니다. 동기화된 차량은 플레이어에게 열쇠를 지급합니다. 오직 미션 시작시에 생긴 물체들만 유효합니다. + 可同步在载具与玩家身上。将使被同步的玩家掌握其他被同步载具的钥匙。此模块只会在任务刚开始时触发。 + 可同步在載具與玩家身上。將使被同步的玩家掌握其他被同步載具的鑰匙。此模塊只會在任務剛開始時觸發。 - \ No newline at end of file + diff --git a/addons/vehicles/CfgWeapons.hpp b/addons/vehicles/CfgWeapons.hpp index c4d28c3e31..78a82abccf 100644 --- a/addons/vehicles/CfgWeapons.hpp +++ b/addons/vehicles/CfgWeapons.hpp @@ -27,7 +27,7 @@ class CfgWeapons { }; 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","500Rnd_65x39_Belt","500Rnd_65x39_Belt_Tracer_Red_Splash","500Rnd_65x39_Belt_Tracer_Green_Splash","500Rnd_65x39_Belt_Tracer_Yellow_Splash"}; + magazines[] = {"PylonWeapon_2000Rnd_65x39_belt", "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","500Rnd_65x39_Belt","500Rnd_65x39_Belt_Tracer_Red_Splash","500Rnd_65x39_Belt_Tracer_Green_Splash","500Rnd_65x39_Belt_Tracer_Yellow_Splash"}; }; class HMG_127: LMG_RCWS { diff --git a/addons/vehicles/XEH_postInit.sqf b/addons/vehicles/XEH_postInit.sqf index c55fcf2544..2e54b2ea84 100644 --- a/addons/vehicles/XEH_postInit.sqf +++ b/addons/vehicles/XEH_postInit.sqf @@ -15,7 +15,7 @@ GVAR(isSpeedLimiter) = false; true } else { // Conditions: canInteract - if !([ACE_player, objNull, ["isnotinside"]] call EFUNC(common,canInteractWith)) exitWith {false}; + if !([ACE_player, objNull, ["isNotInside"]] call EFUNC(common,canInteractWith)) exitWith {false}; // Conditions: specific if !(ACE_player == driver vehicle ACE_player && {vehicle ACE_player isKindOf 'Car' || diff --git a/addons/vehicles/XEH_preInit.sqf b/addons/vehicles/XEH_preInit.sqf index a7feade1c3..b47cf6628d 100644 --- a/addons/vehicles/XEH_preInit.sqf +++ b/addons/vehicles/XEH_preInit.sqf @@ -2,6 +2,8 @@ ADDON = false; +PREP_RECOMPILE_START; #include "XEH_PREP.hpp" +PREP_RECOMPILE_END; ADDON = true; diff --git a/addons/vehicles/functions/fnc_speedLimiter.sqf b/addons/vehicles/functions/fnc_speedLimiter.sqf index 2d445be3c8..d84bdfff9f 100644 --- a/addons/vehicles/functions/fnc_speedLimiter.sqf +++ b/addons/vehicles/functions/fnc_speedLimiter.sqf @@ -28,7 +28,7 @@ if (GVAR(isSpeedLimiter)) exitWith { playSound "ACE_Sound_Click"; GVAR(isSpeedLimiter) = true; -private _maxSpeed = speed _vehicle max 10; +private _maxSpeed = speed _vehicle max 5; [{ params ["_args", "_idPFH"]; diff --git a/addons/vehicles/stringtable.xml b/addons/vehicles/stringtable.xml index df6f251695..36ff7f99e6 100644 --- a/addons/vehicles/stringtable.xml +++ b/addons/vehicles/stringtable.xml @@ -1,4 +1,4 @@ - + @@ -13,6 +13,9 @@ Limitador de Velocidade Ativo Limitatore Attivo 速度制限を有効化 + 속도 제한기 켜짐 + 启用速度限制 + 啟用速度限制 Speed Limiter off @@ -26,6 +29,9 @@ Limitador de Velocidade Desativado Limitatore Non Attivo 速度制限を無効化 + 속도 제한기 꺼짐 + 停用速度限制 + 停用速度限制 Speed Limiter @@ -39,6 +45,9 @@ Limitador de Velocidade Limitatore di Velocità 速度制限 + 속도 제한기 + 速度限制器 + 速度限制器 - \ No newline at end of file + diff --git a/addons/viewdistance/XEH_clientInit.sqf b/addons/viewdistance/XEH_clientInit.sqf index 1fed0bd818..eb609a40f9 100644 --- a/addons/viewdistance/XEH_clientInit.sqf +++ b/addons/viewdistance/XEH_clientInit.sqf @@ -26,4 +26,8 @@ if (!hasInterface) exitWith {}; ["vehicle",{ [false] call FUNC(adaptViewDistance); }] call CBA_fnc_addPlayerEventHandler; + ["ACE_controlledUAV", { + [false] call FUNC(adaptViewDistance); + }] call CBA_fnc_addEventHandler; + }] call CBA_fnc_addEventHandler; diff --git a/addons/viewdistance/XEH_preInit.sqf b/addons/viewdistance/XEH_preInit.sqf index a7feade1c3..b47cf6628d 100644 --- a/addons/viewdistance/XEH_preInit.sqf +++ b/addons/viewdistance/XEH_preInit.sqf @@ -2,6 +2,8 @@ ADDON = false; +PREP_RECOMPILE_START; #include "XEH_PREP.hpp" +PREP_RECOMPILE_END; ADDON = true; diff --git a/addons/viewdistance/functions/fnc_adaptViewDistance.sqf b/addons/viewdistance/functions/fnc_adaptViewDistance.sqf index 4816ee946e..0277b96244 100644 --- a/addons/viewdistance/functions/fnc_adaptViewDistance.sqf +++ b/addons/viewdistance/functions/fnc_adaptViewDistance.sqf @@ -22,6 +22,12 @@ if (!GVAR(enabled) || isNull ACE_player) exitWith {}; private _vehicle = vehicle ACE_player; +ACE_controlledUAV params ["_uav"]; +if (!isNull _uav) then { + TRACE_1("using UAV",ACE_controlledUAV); + _vehicle = _uav; +}; + private _landVehicle = _vehicle isKindOf "LandVehicle" || {_vehicle isKindOf "Ship_F"}; private _airVehicle = _vehicle isKindOf "Air"; diff --git a/addons/viewdistance/functions/fnc_initModule.sqf b/addons/viewdistance/functions/fnc_initModule.sqf index cc73e71395..3afd3ccd6a 100644 --- a/addons/viewdistance/functions/fnc_initModule.sqf +++ b/addons/viewdistance/functions/fnc_initModule.sqf @@ -9,6 +9,11 @@ * * Return Value: * None + * + * Example: + * [LOGIC; [bob, kevin], true] call ace_viewdistance_fnc_initModule + * + * Public: No */ #include "script_component.hpp" diff --git a/addons/viewdistance/stringtable.xml b/addons/viewdistance/stringtable.xml index eacb06f62a..7ea9bb1cce 100644 --- a/addons/viewdistance/stringtable.xml +++ b/addons/viewdistance/stringtable.xml @@ -13,6 +13,9 @@ Ограничитель дальности видимости Limitatore Distanza Visiva 視界距離の制限 + 시야 제한기 + 视野距离限制器 + 視野距離限制器 Allows limiting maximum view distance that can be set by players. @@ -26,6 +29,9 @@ Позволяет ограничить максимальную дальность видимости, которая может быть установлена игроками. Consente di limitare la distanza visiva massima che può essere impostata dai giocatori. プレイヤーへ最大の視界距離を制限できます。 + 플레이어가 볼 수 있는 최대 시야를 제한합니다. + 允许玩家最大的可视距离 + 允許玩家最大的可視距離 Enable ACE viewdistance @@ -39,6 +45,9 @@ Ограничить дальность видимости Abilita distanza visiva ACE ACE 視界距離を有効化 + ACE 시야 활성화 + 启用ACE视距 + 啟用ACE視距 Enables ACE viewdistance @@ -52,6 +61,9 @@ Включает ограничитель дальности видимости ACE Abilita distanza visiva ACE ACE 視界距離を有効化 + ACE 시야 활성화 + 启用ACE视距 + 啟用ACE視距 View Distance Limit @@ -65,6 +77,9 @@ Дальность видимости Limite Distanza Visiva 視界距離の制限 + 시야 제한기 + 视野距离限制 + 視野距離限制 Sets the limit for how high clients can raise their view distance (up to 10000) @@ -78,6 +93,9 @@ Устанавливает предел дальности, насколько клиенты могут увеличить свою дальность видимости (до 10000) Imposta il limite massimo a cui i client possono alzare la propria distanza visiva (massimo 10000) 各クライアントが最大まで設定できる視界距離を設定します。(最大 10000) + 클라이언트가 최대 얼마나 멀리 볼 수 있는지 제한을 둡니다 (10000 까지 가능) + 设定客户端最高可显示的视野距离 (最高至10000) + 設定客戶端最高可顯示的視野距離 (最高至10000) Limit for client's view distance set here and can overridden by module @@ -91,6 +109,9 @@ Предел дальности видимости клиентов устанавливается здесь и может быть переопределен модулем Limite per la distanza visiva del client impostato qui e può essere scavalcato dal modulo クライアントへの視界距離の設定や、それをモジュールにより上書きできます + 클라이언트의 시야를 이 모듈로 치환할 수 있습니다. + 玩家的视距限制可在此设定,也可透过模块改写 + 玩家的視距限制可在此設定,也可透過模塊改寫 Client View Distance (On Foot) @@ -104,6 +125,9 @@ Дальность видимости (Пешком) Distanza Visiva Client (a Piedi) クライアント側視界距離 (地上) + 클라이언트 시야 (보병) + 客户端视野距离 (步行) + 客戶端視野距離 (步行) Changes in game view distance when the player is on foot. @@ -117,6 +141,9 @@ Изменяет дальность видимости в игре, когда игрок перемещается пешком. Cambia la distanza visiva in gioco quando il giocatore è a piedi. プレイヤーが地上にいる時の視界距離を変更します。 + 플레이어가 보병일 경우의 시야를 바꿀 수 있습니다. + 改变玩家步行时的视野距离. + 改變玩家步行時的視野距離. Client View Distance (Land Vehicle) @@ -130,6 +157,9 @@ Дальность видимости (В наземном трансп.) Distanza Visiva Client (Veicolo Terrestre) クライアント側視界距離 (車両) + 클라이언트 시야 (차량) + 客户端视野距离 (地面载具) + 客戶端視野距離 (地面載具) Changes in game view distance when the player is in a land vehicle. @@ -143,6 +173,9 @@ Изменяет дальность видимости в игре, когда игрок перемещается в наземном транспорте. Cambia la distanza visiva in gioco quando il giocatore è in un veicolo terrestre. プレイヤーが車両の時の視界距離を変更します。 + 플레이어가 차량 내부일 경우의 시야를 바꿀 수 있습니다. + 改变玩家于地面载具内时的视野距离 + 改變玩家於地面載具內時的視野距離 Client View Distance (Air Vehicle) @@ -156,6 +189,9 @@ Дальность видимости (В воздушном трансп.) Distanza Visiva Client (Veicoli d'Aria) クライアント側視界距離 (航空機) + 클라이언트 시야 (항공기) + 客户端视野距离 (空中载具) + 客戶端視野距離 (空中載具) Changes in game view distance when the player is in an air vehicle. @@ -169,6 +205,9 @@ Изменяет дальность видимости в игре, когда игрок перемещается в воздушном транспорте. Cambia la distanza visiva in gioco quando il giocatore è in un mezzo aereo. プレイヤーが航空機に乗っている時の視界距離を変更します。 + 플레이어가 항공기 내부일 경우의 시야를 바꿀 수 있습니다. + 改变玩家于空中载具内时的视野距离 + 改變玩家於空中載具內時的視野距離 Dynamic Object View Distance @@ -182,6 +221,9 @@ Динамич. дальность отрисовки объектов Distanza Visiva Oggetti Dinamica 動的なオブジェクトの描画距離 + 동적 물체 시야 + 动态物件的视野距离 + 動態物件的視野距離 Sets the object view distance as a coefficient of the view distance or based on field of view. FoV Based's lowest and highest value is the value which is set when enabling the option. @@ -195,6 +237,9 @@ Устанавливает дальность отрисовки объектов как коэффициент от общей дальности видимости. Imposta la distanza visiva degli oggetti come un coefficiente basato sulla distanza visiva oppure basato sul campo visivo. 視野角を元にするか、視界距離によるオブジェクト描画距離を決定します。視野角を元にするオプションを有効化した場合、視野角により最低と最高値が変動します。 + 설정된 시야 혹은 시계(FoV)에 계수를 적용해 물체 시야를 적용합니다. 시계를 바탕으로 하는 옵션을 활성화할 경우 시계에 의한 최저와 최고치가 변동됩니다. + 设定物件可被观察的距离,透过视野距离或是视野角度来决定。 + 設定物件可被觀察的距離,透過視野距離或是視野角度來決定。 Off @@ -208,6 +253,9 @@ Выкл. Disabilitato 無効 + 끄기 + 关闭 + 關閉 Very Low @@ -221,6 +269,9 @@ Очень низкая Molto Basso 最低 + 매우 낮음 + 非常低 + 非常低 Low @@ -234,6 +285,9 @@ Низкая Basso + 낮음 + + Medium @@ -247,6 +301,9 @@ Средняя Medio 通常 + 중간 + + High @@ -260,6 +317,9 @@ Высокая Alto + 높음 + + Very High @@ -273,6 +333,9 @@ Очень высокая Molto Alto 最高 + 매우 높음 + 非常高 + 非常高 FoV Based @@ -285,6 +348,9 @@ Basada en campo de visión Champ de vision basé 視野角を元にする + 시계(FoV) + 由视野角度决定 + 由視野角度決定 View Distance: @@ -298,6 +364,9 @@ Дальность видимости: Distanza Visiva: 視界距離: + 시야: + 视野距离: + 視野距離: Object View Distance is @@ -311,6 +380,9 @@ Дальность видимости объектов: Distanza Visiva Oggetti è オブジェクト描画距離は + 동적 물체 시야는 + 物件视野距离为 + 物件視野距離為 That option is invalid! The limit is @@ -324,6 +396,9 @@ Настройка не верна! Текущий предел Questa opzione è invalida! Il limite è このオプションは無効です!制限は + 이 옵션은 불가능합니다! 제한은 + 该选项是无效的! 限制是 + 該選項是無效的! 限制是 Video Settings @@ -337,6 +412,9 @@ Видео настройки Impostazioni Video 映像設定 + 영상 설정 + 影像设定 + 影像設定 - \ No newline at end of file + diff --git a/addons/weaponselect/XEH_postInit.sqf b/addons/weaponselect/XEH_postInit.sqf index b19059cff1..4706363271 100644 --- a/addons/weaponselect/XEH_postInit.sqf +++ b/addons/weaponselect/XEH_postInit.sqf @@ -196,6 +196,18 @@ if (!hasInterface) exitWith {}; {false}, [10, [false, false, false]], false] call CBA_fnc_addKeybind; //9 Key +["ACE3 Vehicles", QGVAR(CollisionLights), localize LSTRING(CollisionLights), { + // Conditions: canInteract + if (!([ACE_player, vehicle ACE_player, []] call EFUNC(common,canInteractWith))) exitWith {false}; + // Conditions: specific + if ((ACE_player isEqualTo (vehicle ACE_player)) || {ACE_player != (driver (vehicle ACE_player))}) exitWith {false}; + + // Statement + (vehicle ACE_player) setCollisionLight !(isCollisionLightOn (vehicle ACE_player)); + true +}, +{false}, +[0, [false, false, false]]] call CBA_fnc_addKeybind; // Register fire event handler ["ace_firedPlayer", DFUNC(throwGrenade)] call CBA_fnc_addEventHandler; diff --git a/addons/weaponselect/XEH_preInit.sqf b/addons/weaponselect/XEH_preInit.sqf index 4166247505..0335ee5fda 100644 --- a/addons/weaponselect/XEH_preInit.sqf +++ b/addons/weaponselect/XEH_preInit.sqf @@ -2,7 +2,9 @@ ADDON = false; +PREP_RECOMPILE_START; #include "XEH_PREP.hpp" +PREP_RECOMPILE_END; // collect frag and other grenades separately GVAR(GrenadesAll) = []; diff --git a/addons/weaponselect/functions/fnc_putWeaponAway.sqf b/addons/weaponselect/functions/fnc_putWeaponAway.sqf index d2747bf23f..0d7e93a429 100644 --- a/addons/weaponselect/functions/fnc_putWeaponAway.sqf +++ b/addons/weaponselect/functions/fnc_putWeaponAway.sqf @@ -19,4 +19,4 @@ params ["_unit"]; _unit call EFUNC(common,fixLoweredRifleAnimation); -_unit action ["SwitchWeapon", _unit, _unit, 99]; +_unit action ["SwitchWeapon", _unit, _unit, 299]; diff --git a/addons/weaponselect/functions/fnc_selectWeaponMode.sqf b/addons/weaponselect/functions/fnc_selectWeaponMode.sqf index 80784778de..c0a5f00a8a 100644 --- a/addons/weaponselect/functions/fnc_selectWeaponMode.sqf +++ b/addons/weaponselect/functions/fnc_selectWeaponMode.sqf @@ -42,7 +42,7 @@ private _mode = _modes select _index; _index = 0; while { - _index < 100 && {currentMuzzle _unit != _muzzle || {currentWeaponMode _unit != _mode}} + _index < 299 && {currentMuzzle _unit != _muzzle || {currentWeaponMode _unit != _mode}} } do { _unit action ["SwitchWeapon", _unit, _unit, _index]; _index = _index + 1; diff --git a/addons/weaponselect/functions/fnc_selectWeaponMuzzle.sqf b/addons/weaponselect/functions/fnc_selectWeaponMuzzle.sqf index 973d34f7c8..3d7f05e954 100644 --- a/addons/weaponselect/functions/fnc_selectWeaponMuzzle.sqf +++ b/addons/weaponselect/functions/fnc_selectWeaponMuzzle.sqf @@ -42,7 +42,7 @@ private _muzzle = _muzzles select _index; _index = 0; while { - _index < 100 && {currentMuzzle _unit != _muzzle} + _index < 299 && {currentMuzzle _unit != _muzzle} } do { _unit action ["SwitchWeapon", _unit, _unit, _index]; _index = _index + 1; diff --git a/addons/weaponselect/functions/fnc_selectWeaponVehicle.sqf b/addons/weaponselect/functions/fnc_selectWeaponVehicle.sqf index 7435dd30d8..883588ee4b 100644 --- a/addons/weaponselect/functions/fnc_selectWeaponVehicle.sqf +++ b/addons/weaponselect/functions/fnc_selectWeaponVehicle.sqf @@ -31,7 +31,7 @@ if (_turret isEqualTo [] && {_unit == driver _vehicle}) then { _index = 0; while { - _index < 100 && {currentWeapon _vehicle != _weapon} + _index < 299 && {currentWeapon _vehicle != _weapon} } do { _unit action ["SwitchWeapon", _vehicle, _unit, _index]; _index = _index + 1; @@ -46,7 +46,7 @@ if (_turret isEqualTo [] && {_unit == driver _vehicle}) then { _index = 0; while { - _index < 100 && {_vehicle currentWeaponTurret _turret != _weapon} + _index < 299 && {_vehicle currentWeaponTurret _turret != _weapon} } do { _unit action ["SwitchWeapon", _vehicle, _unit, _index]; _index = _index + 1; diff --git a/addons/weaponselect/functions/fnc_throwGrenade.sqf b/addons/weaponselect/functions/fnc_throwGrenade.sqf index 3f55e02f51..10a730f504 100644 --- a/addons/weaponselect/functions/fnc_throwGrenade.sqf +++ b/addons/weaponselect/functions/fnc_throwGrenade.sqf @@ -20,7 +20,7 @@ TRACE_10("firedEH:",_unit, _weapon, _muzzle, _mode, _ammo, _magazine, _projectil if (_weapon != "Throw") exitWith {}; -private _count = {_x == _magazine} count magazines _unit; +private _count = ({_x == _magazine} count uniformItems _unit) + ({_x == _magazine} count vestItems _unit) + ({_x == _magazine} count backpackItems _unit); [_magazine, _count] call FUNC(displayGrenadeTypeAndNumber); diff --git a/addons/weaponselect/stringtable.xml b/addons/weaponselect/stringtable.xml index 2045f93cd1..054a0f94e7 100644 --- a/addons/weaponselect/stringtable.xml +++ b/addons/weaponselect/stringtable.xml @@ -13,6 +13,9 @@ Mostra indicazioni nel lancio granate Mostrat texto ao lançar granada 手榴弾を投げるときに通知 + 수류탄 투척시 화면에 문자 표시 + 投掷手榴弹时显示提示讯息 + 投擲手榴彈時顯示提示訊息 Display a hint or text on grenade throw. @@ -26,6 +29,9 @@ Mostra una notifica quando si lanciano granate Mostra um hint ou texto ao lançar uma granada 手榴弾を投げるときに、ヒントか文で通知します。 + 수류탄 투척시 화면에 문자나 힌트를 표시합니다. + 投掷手榴弹时显示提示讯息。 + 投擲手榴彈時顯示提示訊息。 Select Pistol @@ -39,6 +45,9 @@ Selecionar Pistola Seleziona la Pistola 拳銃を選択 + 권총 선택 + 选择手枪 + 選擇手槍 Select Rifle @@ -52,6 +61,9 @@ Selecionar Rifle Seleziona il fucile 小銃を選択 + 소총 선택 + 选择步枪 + 選擇步槍 Select Launcher @@ -65,6 +77,9 @@ Selecionar Lançador Seleziona il lanciamissili ランチャーを選択 + 발사기 선택 + 选择发射器 + 選擇發射器 Select Grenade Launcher @@ -78,6 +93,9 @@ Selecionar Lança-Granadas Seleziona il lanciagranate グレネード ランチャーを選択 + 유탄발사기 선택 + 选择榴弹发射器 + 選擇榴彈發射器 Select Binoculars @@ -91,6 +109,9 @@ Selecionar Binóculos Seleziona il Binocolo 双眼鏡を選択 + 망원경 선택 + 选择望远镜 + 選擇望遠鏡 Holster Weapon @@ -104,6 +125,9 @@ Guardar Arma Nascondi l'arma 武器をしまう + 무기 집어넣기 + 武器套 + 武器套 Engine on @@ -117,6 +141,9 @@ Motore acceso Включить двигатель エンジン始動 + 엔진 켜기 + 引擎发动 + 引擎發動 Engine off @@ -130,6 +157,9 @@ Motore spento Выключить двигатель エンジン停止 + 엔진 끄기 + 引擎熄火 + 引擎熄火 Select Main Gun @@ -143,6 +173,9 @@ Seleziona Arma Primaria Выбрать основное оружие 主砲を選択 + 주포 선택 + 选择主武器 + 選擇主武器 Select Machine Gun @@ -156,6 +189,9 @@ Seleziona Mitragliatrice Выбрать пулемёт 機関砲を選択 + 기관총 선택 + 选择机枪 + 選擇機槍 Select Missiles @@ -169,6 +205,9 @@ Seleziona Missili Выбрать ракеты ミサイルを選択 + 미사일 선택 + 选择导弹 + 選擇導彈 Grenade %1 @@ -182,6 +221,9 @@ Granata %1 Granada %1 %1 手榴弾 + %1 수류탄 + 手榴弹 %1 + 手榴彈 %1 Ready Grenade @@ -195,6 +237,9 @@ Granata pronta Granada pronta 投てきよし + 투척물 준비 + 准备手榴弹 + 準備手榴彈 Select Frag Grenade @@ -208,6 +253,9 @@ Seleziona Granata a Frammentazione Выбрать осколочную гранату 破片手榴弾を選択 + 살상 투척물 선택 + 选择破片手榴弹 + 選擇破片手榴彈 Select Non-Frag Grenade @@ -221,6 +269,9 @@ Seleziona granate non a frammentazione Выбрать гранату その他の手榴弾を選択 + 비살상 투척물 선택 + 选择非破片手榴弹 + 選擇非破片手榴彈 Throw Selected Grenade @@ -234,6 +285,9 @@ Lancia la Granata Selezionata Бросить выбранную гранату 選択された手榴弾を投げる + 선택된 투척물 투척 + 投掷选择的手榴弹 + 投擲選擇的手榴彈 No grenades left @@ -247,6 +301,9 @@ Granate esaurite Sem mais granadas もう手榴弾は無い + 투척물 없음 + 已无手榴弹 + 已無手榴彈 No frags left @@ -260,6 +317,9 @@ Nessuna granata a frammentazione rimanente Осколочных гранат нет もう破片手榴弾は無い + 세열 수류탄 없음 + 已无破片手榴弹 + 已無破片手榴彈 No misc. grenades left @@ -273,6 +333,9 @@ Nessun'altra granata rimanente. Нелетальные гранаты закончились もうその他の手榴弾は無い + 기타 투척물 없음 + 已无其他手榴弹 + 已無其他手榴彈 No grenade selected @@ -286,6 +349,9 @@ Nessuna granata selezionata Нет выбранной гранаты 手榴弾は選択されていない + 선택된 수류탄 없음 + 未选择手榴弹 + 未選擇手榴彈 Fire Smoke Launcher @@ -298,7 +364,13 @@ Пустить дымовую завесу Lancia fumogeno Lançador de fumaça - 煙幕発射機を発射 + 発煙弾発射機を発射 + 연막발사기 박사 + 发射烟雾发射器 + 發射煙霧發射器 + + + Toggle Collision Lights - \ No newline at end of file + diff --git a/addons/weather/ACE_Settings.hpp b/addons/weather/ACE_Settings.hpp index d3b9b1fd2e..d41b9d7b95 100644 --- a/addons/weather/ACE_Settings.hpp +++ b/addons/weather/ACE_Settings.hpp @@ -11,12 +11,6 @@ class ACE_Settings { typeName = "BOOL"; value = 1; }; - class GVAR(syncRain) { - displayName = CSTRING(syncRain_DisplayName); - description = CSTRING(syncRain_Description); - typeName = "BOOL"; - value = 1; - }; class GVAR(syncWind) { displayName = CSTRING(syncWind_DisplayName); description = CSTRING(syncWind_Description); diff --git a/addons/weather/CfgVehicles.hpp b/addons/weather/CfgVehicles.hpp index ab3d408fdc..eedffd7900 100644 --- a/addons/weather/CfgVehicles.hpp +++ b/addons/weather/CfgVehicles.hpp @@ -24,12 +24,6 @@ class CfgVehicles { typeName = "BOOL"; defaultValue = 1; }; - class syncRain { - displayName = CSTRING(syncRain_DisplayName); - description = CSTRING(syncRain_Description); - typeName = "BOOL"; - defaultValue = 1; - }; class syncWind { displayName = CSTRING(syncWind_DisplayName); description = CSTRING(syncWind_Description); diff --git a/addons/weather/XEH_postInit.sqf b/addons/weather/XEH_postInit.sqf index 569dd87dc4..0e72fc4748 100644 --- a/addons/weather/XEH_postInit.sqf +++ b/addons/weather/XEH_postInit.sqf @@ -6,17 +6,13 @@ GVAR(badWeatherShift) = (random 1) ^ 2 * 10; GVAR(humidityShift) = (5 - random 10) / 100; GVAR(wind_period_start_time) = CBA_missionTime; -GVAR(rain_period_start_time) = CBA_missionTime; - -GVAR(ACE_rain) = rain; "ACE_WIND_PARAMS" addPublicVariableEventHandler { GVAR(wind_period_start_time) = CBA_missionTime; }; -"ACE_RAIN_PARAMS" addPublicVariableEventHandler { GVAR(rain_period_start_time) = CBA_missionTime; }; -"ACE_MISC_PARAMS" addPublicVariableEventHandler { - if (!isServer) then { +if (!isServer) then { + "ACE_MISC_PARAMS" addPublicVariableEventHandler { TRACE_1("MISC PARAMS PVEH",ACE_MISC_PARAMS); + GVAR(currentOvercast) = (ACE_MISC_PARAMS select 0); if (GVAR(syncMisc)) then { - 30 setLightnings (ACE_MISC_PARAMS select 0); 30 setRainbow (ACE_MISC_PARAMS select 1); 30 setFog (ACE_MISC_PARAMS select 2); }; @@ -60,29 +56,13 @@ simulWeatherSync; ["ace_settingsInitialized",{ - TRACE_1("ace_settingsInitialized eh",GVAR(syncRain)); - - //Create a 0 sec delay PFEH to update rain every frame: - if (GVAR(syncRain)) then { - [{ - 0 setRain GVAR(ACE_rain); - }, 0, []] call CBA_fnc_addPerFrameHandler; - }; - - //Create a 1 sec delay PFEH to update wind/rain/temp/humidity: - - //If we don't sync rain, set next time to infinity - GVAR(nextUpdateRain) = if (GVAR(syncRain)) then {0} else {1e99}; + // Create a 1 sec delay PFEH to update wind/temp/humidity GVAR(nextUpdateTempAndHumidity) = 0; [{ BEGIN_COUNTER(weatherPFEH); [] call FUNC(updateWind); //Every 1 second - if (CBA_missionTime >= GVAR(nextUpdateRain)) then { - [] call FUNC(updateRain); //Every 2 seconds - GVAR(nextUpdateRain) = 2 + CBA_missionTime; - }; if (CBA_missionTime >= GVAR(nextUpdateTempAndHumidity)) then { [] call FUNC(updateTemperature); //Every 20 seconds [] call FUNC(updateHumidity); //Every 20 seconds diff --git a/addons/weather/XEH_postServerInit.sqf b/addons/weather/XEH_postServerInit.sqf index cd1fca2c4c..92cd53e337 100644 --- a/addons/weather/XEH_postServerInit.sqf +++ b/addons/weather/XEH_postServerInit.sqf @@ -5,14 +5,28 @@ GVAR(rain_next_period) = -1; GVAR(rain_period_count) = 0; GVAR(current_rain) = 0; GVAR(rain_current_range) = -1+(random 2); +GVAR(rain_period_start_time) = CBA_missionTime; +GVAR(ACE_rain) = rain; // Wind call FUNC(initWind); ["ace_settingsInitialized", { - TRACE_2("ace_settingsInitialized eh",GVAR(enableServerController),GVAR(serverUpdateInterval)); + TRACE_3("ace_settingsInitialized eh",GVAR(enableServerController),GVAR(serverUpdateInterval),GVAR(useACEWeather)); if (GVAR(enableServerController)) then { [FUNC(serverController), GVAR(serverUpdateInterval)] call CBA_fnc_addPerFrameHandler; }; + + if (GVAR(useACEWeather)) then { + GVAR(nextUpdateRain) = 0; + + addMissionEventHandler ["EachFrame", { + if (CBA_missionTime >= GVAR(nextUpdateRain)) then { + [] call FUNC(updateRain); // Every 2 seconds + GVAR(nextUpdateRain) = 2 + CBA_missionTime; + }; + 0 setRain GVAR(ACE_rain); // Update rain every frame + }]; + }; }] call CBA_fnc_addEventHandler; diff --git a/addons/weather/XEH_preInit.sqf b/addons/weather/XEH_preInit.sqf index f0161c7173..1b551f133e 100644 --- a/addons/weather/XEH_preInit.sqf +++ b/addons/weather/XEH_preInit.sqf @@ -3,7 +3,9 @@ ADDON = false; +PREP_RECOMPILE_START; #include "XEH_PREP.hpp" +PREP_RECOMPILE_END; // Make sure this data is read before client/server postInit call FUNC(getMapData); diff --git a/addons/weather/functions/fnc_calculateAirDensity.sqf b/addons/weather/functions/fnc_calculateAirDensity.sqf index bda8410ddd..61d18d7201 100644 --- a/addons/weather/functions/fnc_calculateAirDensity.sqf +++ b/addons/weather/functions/fnc_calculateAirDensity.sqf @@ -23,7 +23,8 @@ _pressure = _pressure * 100; // hPa to Pa if (_relativeHumidity > 0) then { // Saturation vapor pressure calculated according to: http://wahiduddin.net/calc/density_algorithms.htm - private _pSat = 6.1078 * 10 ^ ((7.5 * _temperature) / (_temperature + 237.3)); + // 610.78 gives pressure in Pa - https://en.wikipedia.org/wiki/Density_of_air + private _pSat = 610.78 * 10 ^ ((7.5 * _temperature) / (_temperature + 237.3)); private _vaporPressure = _relativeHumidity * _pSat; private _partialPressure = _pressure - _vaporPressure; diff --git a/addons/weather/functions/fnc_calculateBarometricPressure.sqf b/addons/weather/functions/fnc_calculateBarometricPressure.sqf index 29b8fa7877..0749004c21 100644 --- a/addons/weather/functions/fnc_calculateBarometricPressure.sqf +++ b/addons/weather/functions/fnc_calculateBarometricPressure.sqf @@ -15,4 +15,4 @@ */ #include "script_component.hpp" -((1013.25 - 10 * overcast) * (1 - (0.0065 * (EGVAR(common,mapAltitude) + _this)) / (KELVIN(GVAR(currentTemperature)) + 0.0065 * EGVAR(common,mapAltitude))) ^ 5.255754495); +((1013.25 - 10 * GVAR(currentOvercast)) * (1 - (0.0065 * (EGVAR(common,mapAltitude) + _this)) / (KELVIN(GVAR(currentTemperature)) + 0.0065 * EGVAR(common,mapAltitude))) ^ 5.255754495); diff --git a/addons/weather/functions/fnc_calculateSpeedOfSound.sqf b/addons/weather/functions/fnc_calculateSpeedOfSound.sqf index f645ba2368..ed968d94f0 100644 --- a/addons/weather/functions/fnc_calculateSpeedOfSound.sqf +++ b/addons/weather/functions/fnc_calculateSpeedOfSound.sqf @@ -15,4 +15,4 @@ */ #include "script_component.hpp" -(331.3 + (0.6 * _this)) +(331.3 * sqrt(1 + (_this / 273.15))) diff --git a/addons/weather/functions/fnc_getMapData.sqf b/addons/weather/functions/fnc_getMapData.sqf index 2b222c2d8b..1d27386574 100644 --- a/addons/weather/functions/fnc_getMapData.sqf +++ b/addons/weather/functions/fnc_getMapData.sqf @@ -45,6 +45,7 @@ GVAR(Humidity) = [82, 80, 78, 70, 71, 72, 70, 73, 78, 80, 83, 82]; GVAR(currentTemperature) = 20; GVAR(currentHumidity) = 0.5; +GVAR(currentOvercast) = 0; // Get all non inherited arrays to filter maps that inherit from Stratis/Altis/Tanoa private _nonInheritedArrays = configProperties [configFile >> "CfgWorlds" >> _worldName, "isArray _x", false]; diff --git a/addons/weather/functions/fnc_initModuleSettings.sqf b/addons/weather/functions/fnc_initModuleSettings.sqf index f1e9c1d6fc..9cafed8e71 100644 --- a/addons/weather/functions/fnc_initModuleSettings.sqf +++ b/addons/weather/functions/fnc_initModuleSettings.sqf @@ -29,9 +29,8 @@ if !(_activated) exitWith {}; [_logic, QGVAR(useACEWeather), "useACEWeather"] call EFUNC(common,readSettingFromModule); // Control client side weather effects -[_logic, QGVAR(syncRain), "syncRain"] call EFUNC(common,readSettingFromModule); [_logic, QGVAR(syncWind), "syncWind"] call EFUNC(common,readSettingFromModule); // Wind, Gusts, Waves -[_logic, QGVAR(syncMisc), "syncMisc"] call EFUNC(common,readSettingFromModule); // Lightnings, Rainbow, Fog +[_logic, QGVAR(syncMisc), "syncMisc"] call EFUNC(common,readSettingFromModule); // Rainbow, Fog // Server weather update interval [_logic, QGVAR(serverUpdateInterval), "serverUpdateInterval"] call EFUNC(common,readSettingFromModule); diff --git a/addons/weather/functions/fnc_serverController.sqf b/addons/weather/functions/fnc_serverController.sqf index 79d2aab93e..684dc37e49 100644 --- a/addons/weather/functions/fnc_serverController.sqf +++ b/addons/weather/functions/fnc_serverController.sqf @@ -20,10 +20,6 @@ if (GVAR(useACEWeather)) then { [] call FUNC(updateAceWeather); } else { // Simply replicate the server weather on the clients - if (GVAR(syncRain)) then { - ACE_RAIN_PARAMS = [rain, rain, GVAR(serverUpdateInterval)]; - publicVariable "ACE_RAIN_PARAMS"; - }; if (GVAR(syncWind)) then { //Wind _dir is the "source" of the wind [eg: "northerly wind": _dir = 0 -> wind = [0,-1,0];] private _windDir = ((((wind select 0) atan2 (wind select 1)) + 180) % 360); @@ -31,7 +27,7 @@ if (GVAR(useACEWeather)) then { publicVariable "ACE_WIND_PARAMS"; }; if (GVAR(syncMisc)) then { - ACE_MISC_PARAMS = [lightnings, rainbow, fogParams, GVAR(temperatureShift), GVAR(badWeatherShift), GVAR(humidityShift)]; + ACE_MISC_PARAMS = [overcast, rainbow, fogParams, GVAR(temperatureShift), GVAR(badWeatherShift), GVAR(humidityShift)]; publicVariable "ACE_MISC_PARAMS"; }; }; diff --git a/addons/weather/functions/fnc_updateAceWeather.sqf b/addons/weather/functions/fnc_updateAceWeather.sqf index db8783cd83..0e340a447d 100644 --- a/addons/weather/functions/fnc_updateAceWeather.sqf +++ b/addons/weather/functions/fnc_updateAceWeather.sqf @@ -1,6 +1,6 @@ /* * Author: ACE2 Team, esteldunedain, ruthberg - * Updates the wind and rain evolution on the server. Broadcasts the current and next values to the clients + * Updates the wind and rain evolution on the server. Broadcasts the current and next values to the clients where needed. * * Arguments: * None @@ -18,7 +18,7 @@ private _overcastMultiplier = 1 max (2* overcast) min 2; // 0 (@ overcast 0), 2 (@ overcast 1) // Rain simulation -if (GVAR(syncRain) && {GVAR(rain_period_count) > GVAR(rain_next_period)}) then { +if (GVAR(rain_period_count) > GVAR(rain_next_period)) then { GVAR(rain_next_period) = ceil((1 + (random 10)) / _overcastMultiplier); GVAR(rain_period_count) = 0; @@ -49,7 +49,6 @@ if (GVAR(syncRain) && {GVAR(rain_period_count) > GVAR(rain_next_period)}) then { TRACE_4("",_lastRain,_rainOverCast,_transitionTime,overcast); GVAR(rain_period_start_time) = CBA_missionTime; - publicVariable "ACE_RAIN_PARAMS"; }; // Wind simulation @@ -100,7 +99,7 @@ if (GVAR(syncWind) && {GVAR(wind_period_count) > GVAR(wind_next_period)}) then { if (GVAR(syncMisc)) then { - ACE_MISC_PARAMS = [lightnings, rainbow, fogParams, GVAR(temperatureShift), GVAR(badWeatherShift), GVAR(humidityShift)]; + ACE_MISC_PARAMS = [overcast, rainbow, fogParams, GVAR(temperatureShift), GVAR(badWeatherShift), GVAR(humidityShift)]; publicVariable "ACE_MISC_PARAMS"; }; diff --git a/addons/weather/functions/fnc_updateHumidity.sqf b/addons/weather/functions/fnc_updateHumidity.sqf index acd103615b..31945d4fb2 100644 --- a/addons/weather/functions/fnc_updateHumidity.sqf +++ b/addons/weather/functions/fnc_updateHumidity.sqf @@ -3,10 +3,10 @@ * Updates GVAR(currentHumidity) * * Arguments: - * Nothing + * None * * Return Value: - * Nothing + * None * * Example: * [] call ace_weather_fnc_updateHumidity @@ -19,7 +19,7 @@ private _month = date select 1; GVAR(currentHumidity) = (GVAR(Humidity) select (_month - 1)) / 100; -if ((rain > 0) && {overcast > 0.7}) then { +if ((rain > 0) && {GVAR(currentOvercast) > 0.7}) then { GVAR(currentHumidity) = 1; } else { private _avgTemperature = ((GVAR(TempDay) select (_month - 1)) + (GVAR(TempNight) select (_month - 1))) / 2; diff --git a/addons/weather/functions/fnc_updateRain.sqf b/addons/weather/functions/fnc_updateRain.sqf index b073a6a24c..8b8e79abf1 100644 --- a/addons/weather/functions/fnc_updateRain.sqf +++ b/addons/weather/functions/fnc_updateRain.sqf @@ -3,10 +3,10 @@ * Updates rain based on ACE_RAIN_PARAMS * * Arguments: - * Nothing + * None * * Return Value: - * Nothing + * None * * Example: * [] call ace_weather_fnc_updateRain @@ -18,9 +18,6 @@ if (!isNil "ACE_RAIN_PARAMS") then { ACE_RAIN_PARAMS params ["_oldRain", "_newRain", "_period"]; - private _periodPosition = (CBA_missionTime - GVAR(rain_period_start_time)) min _period; - private _periodPercent = (_periodPosition / _period) min 1; - GVAR(ACE_Rain) = linearConversion [GVAR(rain_period_start_time), (GVAR(rain_period_start_time) + _period), CBA_missionTime, _oldRain, _newRain]; TRACE_3("Update Rain",rain,ACE_RAIN_PARAMS,GVAR(ACE_Rain)); diff --git a/addons/weather/functions/fnc_updateTemperature.sqf b/addons/weather/functions/fnc_updateTemperature.sqf index 6f2d911c15..847d594b9b 100644 --- a/addons/weather/functions/fnc_updateTemperature.sqf +++ b/addons/weather/functions/fnc_updateTemperature.sqf @@ -3,10 +3,10 @@ * Updates GVAR(currentTemperature) based on the map data * * Arguments: - * Nothing + * None * * Return Value: - * Nothing + * None * * Example: * [] call ace_weather_fnc_updateTemperature @@ -21,7 +21,7 @@ private _month = date select 1; private _timeRatio = abs(_time - 12) / 12; GVAR(currentTemperature) = (GVAR(TempDay) select (_month - 1)) * (1 - _timeRatio) + (GVAR(TempNight) select (_month - 1)) * _timeRatio; -GVAR(currentTemperature) = GVAR(currentTemperature) + GVAR(temperatureShift) - GVAR(badWeatherShift) * overcast; +GVAR(currentTemperature) = GVAR(currentTemperature) + GVAR(temperatureShift) - GVAR(badWeatherShift) * GVAR(currentOvercast); GVAR(currentTemperature) = round(GVAR(currentTemperature) * 10) / 10; TRACE_2("temperatureShift/badWeatherShift",GVAR(temperatureShift),GVAR(badWeatherShift)); diff --git a/addons/weather/functions/fnc_updateWind.sqf b/addons/weather/functions/fnc_updateWind.sqf index 72ae0470ba..0dfc87a526 100644 --- a/addons/weather/functions/fnc_updateWind.sqf +++ b/addons/weather/functions/fnc_updateWind.sqf @@ -3,10 +3,10 @@ * Updates wind, gusts and waves based on ACE_wind * * Arguments: - * Nothing + * None * * Return Value: - * Nothing + * None * * Example: * [] call ace_weather_fnc_updateWind @@ -18,7 +18,12 @@ if (!GVAR(syncWind)) exitWith { ACE_wind = wind }; ACE_wind = [] call FUNC(getWind); -setWind [ACE_wind select 0, ACE_wind select 1, true]; + +// setWind correctly replicates to clients +if (isServer) then { + setWind [ACE_wind select 0, ACE_wind select 1, true]; +}; + 2 setGusts 0; // Set waves: 0 when no wind, 1 when wind >= 16 m/s diff --git a/addons/weather/init3DEN.sqf b/addons/weather/init3DEN.sqf index 1bae6c4d95..34b7dc2d5b 100644 --- a/addons/weather/init3DEN.sqf +++ b/addons/weather/init3DEN.sqf @@ -7,8 +7,6 @@ // we have to auto set these settings manually - on mission creation add3DENEventHandler ["onMissionNew", { set3DENMissionAttributes [ - ["Intel", "IntelRainIsForced", true], - ["Intel", "IntelLightningIsForced", true], ["Intel", "IntelWavesIsForced", true], ["Intel", "IntelWindIsForced", true] ]; diff --git a/addons/weather/stringtable.xml b/addons/weather/stringtable.xml index 0a241488b9..7da25430b8 100644 --- a/addons/weather/stringtable.xml +++ b/addons/weather/stringtable.xml @@ -13,6 +13,9 @@ Zobrazit údaje o větru Mostrar informação do vento 風速を表示 + 바람 정보 표시 + 显示风力资讯 + 顯示風力資訊 Show Wind Info (Toggle) @@ -25,7 +28,10 @@ Széladatok mutatása (pecek) Zobrazit údaje o větru (přep.) Mostrar informação do vento (alternar) - 風速を表示 (トグル) + 風速を表示 (切り替え) + 바람 정보 표시 (토글) + 显示风力资讯(切换) + 顯示風力資訊(切換) Weather @@ -38,7 +44,10 @@ Időjárás Погода Meteo - ACE 天候モジュールではマルチプレイで同期します。 + 天候 + 기후 + 天气 + 天氣 Multiplayer synchronized ACE weather module @@ -52,6 +61,9 @@ ACE Модуль для синхронизации погоды в мультиплеере Modulo Sincronizzazione Meteo ACE Multiplayer ACE 天候モジュールではマルチプレイで同期します。 + ACE 기후 모듈과 멀티플레이가 동기화됩니다. + 使用ACE天气模块来同步所有客户端的天气状态(多人游戏) + 使用ACE天氣模塊來同步所有客戶端的天氣狀態(多人遊戲) Weather propagation @@ -65,6 +77,9 @@ Единая погода для всех Propagazione Meteo 天候の統一 + 기후 전파 + 天气状态广播 + 天氣狀態廣播 Enables server side weather propagation @@ -78,6 +93,9 @@ Включает управление погодой на серверной стороне Abilita propagazione meteo lato server サーバ側による天候の統一を有効化 + 서버의 기후를 전파합니다 + 启用伺服器的天气状态广播 + 啟用伺服器的天氣狀態廣播 ACE Weather @@ -91,6 +109,9 @@ Погода ACE Meteo ACE ACE 天候 + ACE 기후 + ACE 天气 + ACE 天氣 Overrides the default weather (editor, mission settings) with ACE weather (map based) @@ -104,32 +125,9 @@ Заменяет погоду по-умолчанию (из редактора, настроек миссии) погодой ACE (на основе карты) Scavalca il meteo default (editor, parametri missione) con il meteo ACE (basato su mappa) ACE 天候 (マップを元) による標準の天候 (エディタやミッション設定) を上書きします。 - - - Sync Rain - Synchronizuj deszcz - Sincronizar lluvia - Regen synchronisieren - Synchronizuj déšť - Sincronizar chuva - Synchronisation de la pluie - Eső szinkronizálása - Синхрониз. дождь - Sincronizza Pioggia - 降雨の同期 - - - Synchronizes rain - Synchronizuje deszcz - Sincroniza la lluvia - Synchronisiert den Regen - Synchronizace deště - Sincroniza a chuva - Synchronise la pluie - Szinkronizálja az esőt - Синхронизирует дождь - Sincronizza Pioggia - 降雨の同期 + 기존의 기후(에디터, 임무 설정)를 ACE 기후로 치환합니다. (지도에 따라) + 使ACE天气覆盖预设的天气 (编辑任务设置) + 使ACE天氣覆蓋預設的天氣 (編輯任務設置) Sync Wind @@ -143,6 +141,9 @@ Синхрониз. ветер Sincronizza Vento 風を同期 + 바람 동기화 + 同步风 + 同步風 Synchronizes wind @@ -156,6 +157,9 @@ Синхронизирует ветер Sincronizza Vento 風を同期 + 바람을 동기화 합니다 + 同步风 + 同步風 Sync Misc @@ -169,19 +173,15 @@ Синхрониз. прочее Sincronizza Misto その他を同期 + 기타 동기화 + 同步杂项 + 同步雜項 - Synchronizes lightnings, rainbow, fog,... - Synchronizuje pioruny, tęcze, mgłę,... - Sincroniza relampagos, arcoiris, niebla... - Synchronisiert Blitze, Regenbögen, Nebel,... - Synchronizace blesků, duhy, mlhy,... - Sincroniza relâmpagos, arco-íris, neblina... - Synchronise les éclairs, les arcs en ciel, le brouillard,... - Szinkronizálja a villámokat, szivárványokat, ködöt,... - Синхронизирует молнии, радугу, туман,... - Sincronizza lampi, arcobaleni, nebbia,... - ライティングや虹、霧などを同期 + Synchronizes rainbow, fog, temperature and humidity + Sincronizza arcobaleno, nebbia, temperatura e umidità + 同步彩虹、霧、溫度與濕度 + 同步彩虹、雾、温度与湿度 Update Interval @@ -195,6 +195,9 @@ Интервал обновления Intervallo Aggiornamenti 更新間隔 + 갱신 간격 + 更新间隔 + 更新間隔 Defines the interval (seconds) between weather updates @@ -208,6 +211,9 @@ Определяет интервал (в секундах) между обновлениями погоды Definisce l'intervallo (in secondi) tra aggiornamenti del meteo 天候を更新する間隔を定義します。(秒) + 기후를 갱신 하는 간격을 초 단위로 정합니다. + 设定天气更新的时间间隔(秒) + 設定天氣更新的時間間隔(秒) - \ No newline at end of file + diff --git a/addons/winddeflection/XEH_preInit.sqf b/addons/winddeflection/XEH_preInit.sqf index 9104abccdb..ad1c47f67c 100644 --- a/addons/winddeflection/XEH_preInit.sqf +++ b/addons/winddeflection/XEH_preInit.sqf @@ -12,6 +12,8 @@ ADDON = false; +PREP_RECOMPILE_START; #include "XEH_PREP.hpp" +PREP_RECOMPILE_END; ADDON = true; diff --git a/addons/winddeflection/functions/fnc_handleFired.sqf b/addons/winddeflection/functions/fnc_handleFired.sqf index e78620471d..2411c608d4 100644 --- a/addons/winddeflection/functions/fnc_handleFired.sqf +++ b/addons/winddeflection/functions/fnc_handleFired.sqf @@ -6,7 +6,7 @@ * None. Parameters inherited from EFUNC(common,firedEH) * * Return Value: - * Nothing + * None * * Example: * [clientFiredBIS-XEH] call ace_advanced_ballistics_fnc_handleFired diff --git a/addons/winddeflection/functions/fnc_initModuleSettings.sqf b/addons/winddeflection/functions/fnc_initModuleSettings.sqf index 037ce15c47..52847d15ee 100644 --- a/addons/winddeflection/functions/fnc_initModuleSettings.sqf +++ b/addons/winddeflection/functions/fnc_initModuleSettings.sqf @@ -10,6 +10,9 @@ * Return Value: * None * + * Example: + * [LOGIC, [bob, kevin], true] call ace_winddeflection_fnc_initModuelSettings + * * Public: No */ diff --git a/addons/winddeflection/functions/fnc_updateTrajectoryPFH.sqf b/addons/winddeflection/functions/fnc_updateTrajectoryPFH.sqf index acf8b2a9fa..5920bbb3e4 100644 --- a/addons/winddeflection/functions/fnc_updateTrajectoryPFH.sqf +++ b/addons/winddeflection/functions/fnc_updateTrajectoryPFH.sqf @@ -7,9 +7,10 @@ * 1: airFriction - air friction of the bullet * * Return Value: - * Nothing + * None * * Example: + * [bullet, 2] call ace_winddeflection_fnc_updateTrajectoryPFH * * Public: No */ @@ -18,34 +19,32 @@ [{ // BEGIN_COUNTER(pfeh); - private ["_accel", "_accelRef", "_bulletSpeed", "_bulletVelocity", "_deleted", "_deltaT", "_drag", "_dragRef", "_isWind", "_trueSpeed", "_trueVelocity"]; params ["_args"]; _args params ["_lastTime"]; - _deltaT = CBA_missionTime - _lastTime; + private _deltaT = CBA_missionTime - _lastTime; _args set [0, CBA_missionTime]; - _deleted = 0; - _isWind = (vectorMagnitude ACE_wind > 0); + private _isWind = (vectorMagnitude ACE_wind > 0); { _x params ["_bullet", "_airFriction"]; - _bulletVelocity = velocity _bullet; - _bulletSpeed = vectorMagnitude _bulletVelocity; + private _bulletVelocity = velocity _bullet; + private _bulletSpeedSqr = vectorMagnitudeSqr _bulletVelocity; - if ((!alive _bullet) || {(_bullet isKindOf "BulletBase") && {_bulletSpeed < 100}}) then { + if ((!alive _bullet) || {(_bullet isKindOf "BulletBase") && {_bulletSpeedSqr < 10000}}) then { GVAR(trackedBullets) deleteAt (GVAR(trackedBullets) find _x); } else { if (_isWind) then { - _trueVelocity = _bulletVelocity vectorDiff ACE_wind; - _trueSpeed = vectorMagnitude _trueVelocity; + private _trueVelocity = _bulletVelocity vectorDiff ACE_wind; + private _trueSpeed = vectorMagnitude _trueVelocity; - _dragRef = _deltaT * _airFriction * _bulletSpeed * _bulletSpeed; - _accelRef = (vectorNormalized _bulletVelocity) vectorMultiply (_dragRef); + private _dragRef = _deltaT * _airFriction * _bulletSpeedSqr; + private _accelRef = (vectorNormalized _bulletVelocity) vectorMultiply (_dragRef); _bulletVelocity = _bulletVelocity vectorDiff _accelRef; - _drag = _deltaT * _airFriction * _trueSpeed; - _accel = _trueVelocity vectorMultiply (_drag); + private _drag = _deltaT * _airFriction * _trueSpeed; + private _accel = _trueVelocity vectorMultiply (_drag); _bulletVelocity = _bulletVelocity vectorAdd _accel; }; _bullet setVelocity _bulletVelocity; diff --git a/addons/winddeflection/stringtable.xml b/addons/winddeflection/stringtable.xml index bc385f3524..572717afd4 100644 --- a/addons/winddeflection/stringtable.xml +++ b/addons/winddeflection/stringtable.xml @@ -13,6 +13,9 @@ Informazioni sul vento Informação do vento 風の情報 + 바람 정보 + 风力资讯 + 風力資訊 Direction: %1 @@ -26,6 +29,9 @@ Direzione: %1° Direção: %1 風向: %1 + 방향: %1 + 风向: %1 + 風向: %1 Speed: %1 m/s @@ -39,6 +45,9 @@ Velocità: %1 m/s Velocidade: %1 m/s 風速: %1 m/s + 풍속: %1 m/s + 风速: %1 m/s + 風速: %1 m/s Weather Information @@ -52,6 +61,9 @@ Meteo Informação Meteorológica 天候の情報 + 기상 정보 + 天气资讯 + 天氣資訊 Humidity: %1% @@ -65,6 +77,9 @@ Umidità: %1% Humidade: %1% 湿度: %1% + 습도: %1% + 湿度: %1% + 濕度: %1% Wind Deflection @@ -77,7 +92,10 @@ Szél-hárítás Отклонение ветром Deviazione del Vento - 風向による変化 + 風向の変化 + 풍향 변화 + 风偏 + 風偏 Wind Deflection @@ -90,7 +108,10 @@ Szél-hárítás Отклонение ветром Deviazione del Vento - 風向による変化 + 風向の変化 + 풍향 변화 + 风偏 + 風偏 Enables wind deflection @@ -103,7 +124,10 @@ Engedélyezi a szél-hárítást Включает отклонение ветром Abilita deviazione del vento - 風向による変化を有効化 + 風向の変化を有効化 + 풍향 변화를 적용합니다 + 开启风偏效果 + 開啟風偏效果 Vehicle Enabled @@ -117,6 +141,9 @@ Для техники Abilita per Veicoli 車両へ有効化 + 차량 적용 + 启用风偏给载具 + 啟用風偏給載具 Enables wind deflection for static/vehicle gunners @@ -129,7 +156,10 @@ Engedélyezi a szél-hárítást a statikus/jármű-lövészeknél Включает отклонение ветром для стрелков стационарных орудий и техники Abilita deviazione del vento per artiglieri di statiche/veicoli - 重火器や車両へ、風による変化を有効化 + 重火器や車両へ、風向の変化を有効化 + 차량이나 거치식 무기 사수에게 풍향 변화를 적용합니다 + 使风偏作用在固定式武器与载具炮手身上 + 使風偏作用在固定式武器與載具砲手身上 Simulation Interval @@ -143,6 +173,9 @@ Интервал симуляции Intervallo Simulazione シミュレーションの間隔 + 模拟间隔 + 模擬間隔 + 시뮬레이션 간격 Defines the interval between every calculation step @@ -156,6 +189,9 @@ Определяет временной интервал между расчетами Definisce l'intervallo tra ogni passaggio di calcolo 各計算に適用させる間隔を定義します + 매 계산마다의 간격을 정의합니다 + 定义每个计算之间的时间间隔 + 定義每個計算之間的時間間隔 Simulation Radius @@ -169,6 +205,9 @@ Радиус симуляции Raggio Simulazione シミュレーション半径 + 模拟半径 + 模擬半徑 + 시뮬레이션 범위 Defines the radius around the player (in meters) at which projectiles are wind deflected @@ -181,7 +220,10 @@ Meghatározza a játékos körüli hatókört (méterben), ahol a lövedékeket háríthatja a szél Определяет радиус вокруг игрока (а метрах), в котором снаряды отклоняются ветром Definisce il raggio attorno al giocatore (in metri) dove viene applicata la deviazione del vento ai proiettili - プレイヤーの周囲に適用させる風による弾道の変化の半径を定義します (メートル) + 弾道が風によって影響される範囲をプレイヤーを中心とした半径で定義します (メートル) + 플레이어 주위로 발사체가 풍향 변화의 영향을 받는 범위를 정합니다 (미터) + 定义玩家多少半径范围内(单位公尺)子弹会受到风偏的引响 + 定義玩家多少半徑範圍內(單位公尺)子彈會受到風偏的引響 Wind influence on projectiles trajectory @@ -194,7 +236,10 @@ Szél hatása a lövedékek röppályájára Влияние втера на траекторию снарядов Influenza del vento sulla traiettoria dei proiettili - 風が弾道へ影響させます + 風を弾道へ影響させます + 발사체의 궤도에 풍향 변화를 줍니다. + 风力的大小会引响到弹道的轨迹 + 風力的大小會引響到彈道的軌跡 - \ No newline at end of file + diff --git a/addons/yardage450/CfgVehicles.hpp b/addons/yardage450/CfgVehicles.hpp index d8f2ccabe3..2dc52de68a 100644 --- a/addons/yardage450/CfgVehicles.hpp +++ b/addons/yardage450/CfgVehicles.hpp @@ -6,15 +6,15 @@ class CfgVehicles { scopeCurator = 2; displayName = CSTRING(DisplayName); vehicleClass = "Items"; - class TransportWeapons { - MACRO_ADDWEAPON(ACE_Yardage450,1); + class TransportItems { + MACRO_ADDITEM(ACE_Yardage450,1); }; }; class Box_NATO_Support_F; class ACE_Box_Misc: Box_NATO_Support_F { - class TransportWeapons { - MACRO_ADDWEAPON(ACE_Yardage450,4); + class TransportItems { + MACRO_ADDITEM(ACE_Yardage450,4); }; }; }; diff --git a/addons/yardage450/XEH_preInit.sqf b/addons/yardage450/XEH_preInit.sqf index a7feade1c3..b47cf6628d 100644 --- a/addons/yardage450/XEH_preInit.sqf +++ b/addons/yardage450/XEH_preInit.sqf @@ -2,6 +2,8 @@ ADDON = false; +PREP_RECOMPILE_START; #include "XEH_PREP.hpp" +PREP_RECOMPILE_END; ADDON = true; diff --git a/addons/yardage450/functions/fnc_acquireTarget.sqf b/addons/yardage450/functions/fnc_acquireTarget.sqf index 2b04900171..abe5d8d729 100644 --- a/addons/yardage450/functions/fnc_acquireTarget.sqf +++ b/addons/yardage450/functions/fnc_acquireTarget.sqf @@ -3,12 +3,13 @@ * Fires the laser to acquire the target * * Arguments: - * Nothing + * None * * Return Value: - * Nothing + * None * * Example: + * call ace_yardage450_fnc_acquireTarget * * Public: No */ @@ -19,8 +20,6 @@ #define MAX_DISTANCE ([732, 800] select GVAR(useYards)) #define METERING_POINT_NUMBER 8 -private ["_result", "_distance", "_min", "_max", "_range"]; - GVAR(lasing) = true; GVAR(targetAcquired) = false; @@ -33,8 +32,8 @@ GVAR(distanceIndex) = -1; [_this select 1] call CBA_fnc_removePerFrameHandler; }; - _result = [eyePos ACE_player, ACE_player weaponDirection (currentWeapon ACE_player), ACE_player] call EFUNC(laser,shootRay); - _distance = _result select 1; + private _result = [eyePos ACE_player, ACE_player weaponDirection (currentWeapon ACE_player), ACE_player] call EFUNC(laser,shootRay); + private _distance = _result select 1; _distance = _distance - 1 + (random 2); @@ -42,15 +41,15 @@ GVAR(distanceIndex) = -1; GVAR(distances) set [GVAR(distanceIndex), _distance]; if (count GVAR(distances) == METERING_POINT_NUMBER) then { - _min = MAX_DISTANCE; - _max = MIN_DISTANCE; + private _min = MAX_DISTANCE; + private _max = MIN_DISTANCE; { _min = _x min _min; _max = _max max _x; } forEach GVAR(distances); if (abs(_max - _min) < 5) then { - _range = (_min + _max) / 2; + private _range = (_min + _max) / 2; if (_range >= MIN_DISTANCE && _range <= MAX_DISTANCE) then { GVAR(targetAcquired) = true; GVAR(targetRangeText) = Str(round(_range)); diff --git a/addons/yardage450/functions/fnc_turnOn.sqf b/addons/yardage450/functions/fnc_turnOn.sqf index a56bddb016..28e9c1da2d 100644 --- a/addons/yardage450/functions/fnc_turnOn.sqf +++ b/addons/yardage450/functions/fnc_turnOn.sqf @@ -3,12 +3,13 @@ * Shows the Yardage 450 screen elements * * Arguments: - * Nothing + * None * * Return Value: - * Nothing + * None * * Example: + * call ace_yardage450_fnc_acquireTarget * * Public: No */ diff --git a/addons/yardage450/stringtable.xml b/addons/yardage450/stringtable.xml index 434e506ed0..6ab95aff7f 100644 --- a/addons/yardage450/stringtable.xml +++ b/addons/yardage450/stringtable.xml @@ -1,4 +1,4 @@ - + @@ -13,6 +13,9 @@ Yardage 450 Yardage 450 ヤードエイジ 450 + Yardage 450 + Yardage 450 + Yardage 450 Laser Rangefinder @@ -26,6 +29,9 @@ Distanziometro Laser Télémètre laser レーザー測距機 + 레이저 거리측정기 + 雷射测距仪 + 雷射測距儀 Yardage 450 - Power Button @@ -39,6 +45,9 @@ Yardage 450 - Bottone Accensione Yardage 450 - bouton d'alimentation ヤードエイジ 450 - 起動ボタン + Yardage 450 - 전원 버튼 + Yardage 450 - 电源按钮 + Yardage 450 - 電源按鈕 - \ No newline at end of file + diff --git a/addons/zeus/CfgFactionClasses.hpp b/addons/zeus/CfgFactionClasses.hpp new file mode 100644 index 0000000000..7d758adfc0 --- /dev/null +++ b/addons/zeus/CfgFactionClasses.hpp @@ -0,0 +1,27 @@ +class CfgFactionClasses { + class GVAR(AI) { + displayName = "ACE AI"; + priority = 2; + side = 7; + }; + class GVAR(Captive) { + displayName = "ACE Captive"; + priority = 2; + side = 7; + }; + class GVAR(Medical) { + displayName = "ACE Medical"; + priority = 2; + side = 7; + }; + class GVAR(Repair) { + displayName = "ACE Repair"; + priority = 2; + side = 7; + }; + class GVAR(Utility) { + displayName = "ACE Utility"; + priority = 2; + side = 7; + }; +}; diff --git a/addons/zeus/CfgVehicles.hpp b/addons/zeus/CfgVehicles.hpp index 4ab9ad871c..453e69616b 100644 --- a/addons/zeus/CfgVehicles.hpp +++ b/addons/zeus/CfgVehicles.hpp @@ -86,6 +86,7 @@ class CfgVehicles { class GVAR(moduleBase): Module_F { author = ECSTRING(common,ACETeam); category = "ACE"; + function = QEFUNC(common,dummy); functionPriority = 1; isGlobal = 1; isTriggerActivated = 0; @@ -94,84 +95,175 @@ class CfgVehicles { }; class GVAR(moduleAddSpareTrack): GVAR(moduleBase) { curatorCanAttach = 1; + category = QGVAR(Repair); displayName = CSTRING(ModuleAddSpareTrack_DisplayName); function = QFUNC(moduleAddSpareTrack); - icon = QPATHTOF(UI\Icon_Module_Zeus_Medic_ca.paa);//@todo + icon = "a3\ui_f\data\IGUI\Cfg\Actions\repair_ca.paa"; }; class GVAR(moduleAddSpareWheel): GVAR(moduleBase) { curatorCanAttach = 1; + category = QGVAR(Repair); displayName = CSTRING(ModuleAddSpareWheel_DisplayName); function = QFUNC(moduleAddSpareWheel); - icon = QPATHTOF(UI\Icon_Module_Zeus_Medic_ca.paa);//@todo + icon = "a3\ui_f\data\IGUI\Cfg\Actions\repair_ca.paa"; + }; + class GVAR(moduleAddOrRemoveFRIES): GVAR(moduleBase) { + curatorCanAttach = 1; + category = QGVAR(Utility); + displayName = CSTRING(ModuleAddOrRemoveFRIES_DisplayName); + function = QFUNC(moduleAddOrRemoveFRIES); }; class GVAR(moduleCaptive): GVAR(moduleBase) { curatorCanAttach = 1; + category = QGVAR(Captive); displayName = CSTRING(ModuleCaptive_DisplayName); function = QFUNC(moduleCaptive); icon = QPATHTOF(UI\Icon_Module_Zeus_Captive_ca.paa); }; + class GVAR(moduleConfigurePylons): GVAR(moduleBase) { + curatorCanAttach = 1; + category = QGVAR(Utility); + displayName = ECSTRING(pylons,ConfigurePylons); + function = QFUNC(moduleConfigurePylons); + icon = "a3\data_f_jets\logos\jets_logo_small_ca.paa"; + }; class GVAR(moduleDefendArea): GVAR(moduleBase) { curatorCanAttach = 1; + category = QGVAR(AI); displayName = CSTRING(ModuleDefendArea_DisplayName); curatorInfoType = QGVAR(RscDefendArea); }; + class GVAR(moduleEditableObjects): GVAR(moduleBase) { + curatorCanAttach = 1; + category = QGVAR(Utility); + displayName = CSTRING(ModuleEditableObjects_DisplayName); + curatorInfoType = QGVAR(RscEditableObjects); + }; class GVAR(moduleGlobalSetSkill): GVAR(moduleBase) { + category = QGVAR(AI); displayName = CSTRING(ModuleGlobalSetSkill_DisplayName); curatorInfoType = QGVAR(RscGlobalSetSkill); }; class GVAR(moduleGroupSide): GVAR(moduleBase) { curatorCanAttach = 1; + category = QGVAR(Utility); displayName = CSTRING(ModuleGroupSide_DisplayName); curatorInfoType = QGVAR(RscGroupSide); }; + class GVAR(moduleLoadIntoCargo): GVAR(moduleBase) { + curatorCanAttach = 1; + category = QGVAR(Utility); + displayName = CSTRING(ModuleLoadIntoCargo_DisplayName); + function = QFUNC(moduleLoadIntoCargo); + icon = "a3\ui_f\data\IGUI\Cfg\Actions\loadVehicle_ca.paa"; + }; class GVAR(modulePatrolArea): GVAR(moduleBase) { curatorCanAttach = 1; + category = QGVAR(AI); displayName = CSTRING(ModulePatrolArea_DisplayName); curatorInfoType = QGVAR(RscPatrolArea); }; class GVAR(moduleSearchArea): GVAR(moduleBase) { curatorCanAttach = 1; + category = QGVAR(AI); displayName = CSTRING(ModuleSearchArea_DisplayName); curatorInfoType = QGVAR(RscSearchArea); }; class GVAR(moduleSearchNearby): GVAR(moduleBase) { curatorCanAttach = 1; + category = QGVAR(AI); displayName = CSTRING(ModuleSearchNearby_DisplayName); function = QFUNC(moduleSearchNearby); }; + class GVAR(moduleSuppressiveFire): GVAR(moduleBase) { + curatorCanAttach = 1; + category = QGVAR(AI); + displayName = CSTRING(ModuleSuppressiveFire_DisplayName); + function = QFUNC(moduleSuppressiveFire); + }; class GVAR(moduleSetMedic): GVAR(moduleBase) { curatorCanAttach = 1; + category = QGVAR(Medical); displayName = CSTRING(ModuleSetMedic_DisplayName); function = QFUNC(moduleSetMedic); icon = QPATHTOF(UI\Icon_Module_Zeus_Medic_ca.paa); }; class GVAR(moduleSetMedicalFacility): GVAR(moduleBase) { curatorCanAttach = 1; + category = QGVAR(Medical); displayName = CSTRING(ModuleSetMedicalFacility_DisplayName); function = QFUNC(moduleSetMedicalFacility); icon = QPATHTOF(UI\Icon_Module_Zeus_Medic_ca.paa); }; class GVAR(moduleSetMedicalVehicle): GVAR(moduleBase) { curatorCanAttach = 1; + category = QGVAR(Medical); displayName = CSTRING(ModuleSetMedicalVehicle_DisplayName); function = QFUNC(moduleSetMedicalVehicle); icon = QPATHTOF(UI\Icon_Module_Zeus_Medic_ca.paa); }; + class GVAR(moduleSimulation): GVAR(moduleBase) { + curatorCanAttach = 1; + category = QGVAR(Utility); + displayName = CSTRING(ModuleSimulation_DisplayName); + function = QFUNC(moduleSimulation); + }; class GVAR(moduleSurrender): GVAR(moduleBase) { curatorCanAttach = 1; + category = QGVAR(Captive); displayName = CSTRING(ModuleSurrender_DisplayName); function = QFUNC(moduleSurrender); icon = QPATHTOF(UI\Icon_Module_Zeus_Surrender_ca.paa); }; class GVAR(moduleTeleportPlayers): GVAR(moduleBase) { curatorCanAttach = 1; + category = QGVAR(Utility); displayName = CSTRING(ModuleTeleportPlayers_DisplayName); curatorInfoType = QGVAR(RscTeleportPlayers); }; class GVAR(moduleUnconscious): GVAR(moduleBase) { curatorCanAttach = 1; + category = QGVAR(Medical); displayName = CSTRING(ModuleUnconscious_DisplayName); function = QFUNC(moduleUnconscious); icon = QPATHTOF(UI\Icon_Module_Zeus_Unconscious_ca.paa); }; + class GVAR(moduleGarrison): GVAR(moduleBase) { + curatorCanAttach = 1; + category = QGVAR(AI); + displayName = CSTRING(ModuleGarrison_DisplayName); + curatorInfoType = QGVAR(RscGarrison); + icon = QPATHTOF(UI\Icon_Module_Zeus_Garrison_ca.paa); + }; + class GVAR(moduleUnGarrison): GVAR(moduleBase) { + curatorCanAttach = 1; + category = QGVAR(AI); + displayName = CSTRING(ModuleUnGarrison_DisplayName); + function = QFUNC(moduleUnGarrison); + icon = QPATHTOF(UI\Icon_Module_Zeus_UnGarrison_ca.paa); + }; + class GVAR(moduleToggleNvg): GVAR(moduleBase) { + curatorCanAttach = 1; + category = QGVAR(AI); + displayName = CSTRING(moduleToggleNVG_DisplayName); + curatorInfoType = QGVAR(RscToggleNvg); + }; + class GVAR(moduleToggleFlashlight): GVAR(moduleBase) { + curatorCanAttach = 1; + category = QGVAR(AI); + displayName = CSTRING(moduleToggleFlashlight_DisplayName); + curatorInfoType = QGVAR(RscToggleFlashlight); + }; + class GVAR(AddFullArsenal): GVAR(moduleBase) { + curatorCanAttach = 1; + category = QGVAR(Utility); + displayName = CSTRING(ModuleAddFullArsenal_DisplayName); + function = QFUNC(moduleAddArsenal); + }; + class GVAR(RemoveFullArsenal): GVAR(moduleBase) { + curatorCanAttach = 1; + category = QGVAR(Utility); + displayName = CSTRING(ModuleRemoveArsenal_DisplayName); + function = QFUNC(moduleRemoveArsenal); + }; }; diff --git a/addons/zeus/XEH_PREP.hpp b/addons/zeus/XEH_PREP.hpp index eb70a8529d..bb842edaf3 100644 --- a/addons/zeus/XEH_PREP.hpp +++ b/addons/zeus/XEH_PREP.hpp @@ -4,27 +4,45 @@ PREP(bi_moduleCurator); PREP(bi_moduleMine); PREP(bi_moduleProjectile); PREP(bi_moduleRemoteControl); +PREP(getModuleDestination); PREP(handleZeusUnitAssigned); +PREP(moduleAddArsenal); PREP(moduleAddSpareTrack); PREP(moduleAddSpareWheel); +PREP(moduleAddOrRemoveFRIES); PREP(moduleCaptive); +PREP(moduleConfigurePylons); +PREP(moduleGarrison); PREP(moduleGlobalSetSkill); PREP(moduleGroupSide); +PREP(moduleLoadIntoCargo); +PREP(moduleRemoveArsenal); PREP(moduleSearchNearby); PREP(moduleSetMedic); PREP(moduleSetMedicalVehicle); PREP(moduleSetMedicalFacility); +PREP(moduleSimulation); +PREP(moduleSuppressiveFire); +PREP(moduleSuppressiveFireLocal); PREP(moduleSurrender); PREP(moduleTeleportPlayers); +PREP(moduleToggleFlashlight); +PREP(moduleToggleNvg); PREP(moduleUnconscious); +PREP(moduleUnGarrison); PREP(moduleZeusSettings); +PREP(showMessage); PREP(ui_attributeCargo); //PREP(ui_attributePosition); PREP(ui_attributeRadius); PREP(ui_defendArea); +PREP(ui_garrison); +PREP(ui_editableObjects); PREP(ui_globalSetSkill); PREP(ui_groupSide); PREP(ui_patrolArea); PREP(ui_searchArea); PREP(ui_teleportPlayers); +PREP(ui_toggleFlashlight); +PREP(ui_toggleNvg); PREP(zeusAttributes); diff --git a/addons/zeus/XEH_postInit.sqf b/addons/zeus/XEH_postInit.sqf index 9062ae5e9a..5929e8664e 100644 --- a/addons/zeus/XEH_postInit.sqf +++ b/addons/zeus/XEH_postInit.sqf @@ -2,7 +2,7 @@ ["ace_settingsInitialized",{ // Only add an InitPost EH if setting is enabled (and apply retroactively) - if (isServer && GVAR(autoAddObjects)) then { + if (isServer && {GVAR(autoAddObjects)}) then { ["AllVehicles", "InitPost", FUNC(addObjectToCurator), true, [], true] call CBA_fnc_addClassEventHandler; }; }] call CBA_fnc_addEventHandler; @@ -10,7 +10,37 @@ // Global skill module PVs values for persistence, just listen for the PV QGVAR(GlobalSkillAI) addPublicVariableEventHandler FUNC(moduleGlobalSetSkill); +[QGVAR(moveToRespawnPosition), BIS_fnc_moveToRespawnPosition] call CBA_fnc_addEventHandler; [QGVAR(moduleDefendArea), CBA_fnc_taskDefend] call CBA_fnc_addEventHandler; [QGVAR(modulePatrolArea), CBA_fnc_taskPatrol] call CBA_fnc_addEventHandler; [QGVAR(moduleSearchNearby), CBA_fnc_searchNearby] call CBA_fnc_addEventHandler; [QGVAR(moduleSearchArea), CBA_fnc_taskSearchArea] call CBA_fnc_addEventHandler; +[QGVAR(suppressiveFire), LINKFUNC(moduleSuppressiveFireLocal)] call CBA_fnc_addEventHandler; +[QGVAR(enableFlashlight), { + params ["_unit", "_mode"]; + _unit enableGunLights _mode; +}] call CBA_fnc_addEventHandler; + +// Editable object commands must be ran on server, this events are used in the respective module +if (isServer) then { + [QGVAR(equipFries), EFUNC(fastroping,equipFRIES)] call CBA_fnc_addEventHandler; + [QGVAR(addObjects), { + params ["_objects", ["_curator", objNull]]; + + if !(isNull _curator) exitWith { _curator addCuratorEditableObjects [_objects, true]; }; + + { + _x addCuratorEditableObjects [_objects, true]; + } forEach allCurators; + }] call CBA_fnc_addEventHandler; + + [QGVAR(removeObjects), { + params ["_objects", ["_curator", objNull]]; + + if !(isNull _curator) exitWith { _curator removeCuratorEditableObjects [_objects, true]; }; + + { + _x removeCuratorEditableObjects [_objects, true]; + } forEach allCurators; + }] call CBA_fnc_addEventHandler; +}; diff --git a/addons/zeus/XEH_preInit.sqf b/addons/zeus/XEH_preInit.sqf index 47a1adefa3..a55f9c304e 100644 --- a/addons/zeus/XEH_preInit.sqf +++ b/addons/zeus/XEH_preInit.sqf @@ -2,7 +2,9 @@ ADDON = false; +PREP_RECOMPILE_START; #include "XEH_PREP.hpp" +PREP_RECOMPILE_END; if (isServer) then { [QGVAR(zeusUnitAssigned), FUNC(handleZeusUnitAssigned)] call CBA_fnc_addEventHandler; diff --git a/addons/zeus/config.cpp b/addons/zeus/config.cpp index ac7ac9832a..5b764b6007 100644 --- a/addons/zeus/config.cpp +++ b/addons/zeus/config.cpp @@ -4,23 +4,36 @@ class CfgPatches { class ADDON { name = COMPONENT_NAME; units[] = { + QGVAR(moduleConfigurePylons), QGVAR(moduleDefendArea), + QGVAR(moduleEditableObjects), QGVAR(moduleGlobalSetSkill), QGVAR(moduleGroupSide), + QGVAR(moduleLoadIntoCargo), QGVAR(modulePatrolArea), QGVAR(moduleSearchArea), QGVAR(moduleSearchNearby), + QGVAR(moduleGarrison), + QGVAR(moduleUnGarrison), + QGVAR(moduleTeleportPlayers), + QGVAR(moduleToggleNvg), + QGVAR(moduleToggleFlashlight), + QGVAR(moduleSimulation), + QGVAR(moduleSuppressiveFire), + QGVAR(AddFullArsenal), + QGVAR(RemoveFullArsenal), QGVAR(moduleTeleportPlayers) }; weapons[] = {}; requiredVersion = REQUIRED_VERSION; - requiredAddons[] = {"ace_common"}; + requiredAddons[] = {"ace_common", "ace_ai"}; author = ECSTRING(common,ACETeam); authors[] = {"SilentSpike"}; url = ECSTRING(main,URL); VERSION_CONFIG; }; - // Use additional cfgPatches to contextually remove modules from zeus + + // Use additional CfgPatches to contextually remove modules from zeus class GVAR(captives): ADDON { units[] = { QGVAR(moduleCaptive), @@ -35,20 +48,39 @@ class CfgPatches { QGVAR(moduleSetMedicalFacility) }; }; + class GVAR(cargo): ADDON { + units[] = { + QGVAR(moduleLoadIntoCargo) + }; + }; class GVAR(cargoAndRepair): ADDON { units[] = { QGVAR(moduleAddSpareTrack), QGVAR(moduleAddSpareWheel) }; }; + class GVAR(fastroping): ADDON { + units[] = { + QGVAR(moduleAddOrRemoveFRIES) + }; + }; + class GVAR(pylons): ADDON { + units[] = { + QGVAR(moduleConfigurePylons) + }; + }; }; class ACE_Curator { GVAR(captives) = "ace_captives"; GVAR(medical) = "ace_medical"; + GVAR(cargo) = "ace_cargo"; GVAR(cargoAndRepair)[] = {"ace_cargo", "ace_repair"}; + GVAR(fastroping) = "ace_fastroping"; + GVAR(pylons) = "ace_pylons"; }; +#include "CfgFactionClasses.hpp" #include "CfgEventHandlers.hpp" #include "CfgVehicles.hpp" #include "ACE_Settings.hpp" diff --git a/addons/zeus/functions/fnc_addObjectToCurator.sqf b/addons/zeus/functions/fnc_addObjectToCurator.sqf index cab5b3da6f..230f035eb3 100644 --- a/addons/zeus/functions/fnc_addObjectToCurator.sqf +++ b/addons/zeus/functions/fnc_addObjectToCurator.sqf @@ -8,6 +8,9 @@ * Return Value: * None * + * Example: + * [object] call ace_zeus_fnc_addObjectToCurator + * * Public: No */ diff --git a/addons/zeus/functions/fnc_bi_moduleCurator.sqf b/addons/zeus/functions/fnc_bi_moduleCurator.sqf index 231f2cb08d..b556b08197 100644 --- a/addons/zeus/functions/fnc_bi_moduleCurator.sqf +++ b/addons/zeus/functions/fnc_bi_moduleCurator.sqf @@ -10,7 +10,10 @@ * 2: activated * * Return Value: - * nil + * None + * + * Example: + * [LOGIC, [bob, kevin], true] call ace_zeus_fnc_bi_moduleCurator * * Public: No */ @@ -98,7 +101,7 @@ if (_activated) then { //--- Handle ownership [_logic,_ownerVar,_ownerUID,_adminVar] spawn { scriptname "BIS_fnc_moduleCurator: Owner"; - + params ["_logic", "_ownerVar", "_ownerUID", "_adminVar"]; if (_adminVar != "") then {_ownerVar = _adminVar;}; diff --git a/addons/zeus/functions/fnc_bi_moduleMine.sqf b/addons/zeus/functions/fnc_bi_moduleMine.sqf index 5a14fbe218..434130ffe6 100644 --- a/addons/zeus/functions/fnc_bi_moduleMine.sqf +++ b/addons/zeus/functions/fnc_bi_moduleMine.sqf @@ -9,7 +9,10 @@ * 2: activated * * Return Value: - * nil + * None + * + * Example: + * [LOGIC, [bob, kevin], true] call ace_zeus_fnc_bi_moduleMine * * Public: No */ diff --git a/addons/zeus/functions/fnc_bi_moduleProjectile.sqf b/addons/zeus/functions/fnc_bi_moduleProjectile.sqf index 1a9da0ab02..eaad90c6d6 100644 --- a/addons/zeus/functions/fnc_bi_moduleProjectile.sqf +++ b/addons/zeus/functions/fnc_bi_moduleProjectile.sqf @@ -10,7 +10,10 @@ * 2: activated * * Return Value: - * nil + * None + * + * Example: + * [LOGIC, [bob, kevin], true] call ace_zeus_fnc_bi_moduleProjectile * * Public: No */ diff --git a/addons/zeus/functions/fnc_bi_moduleRemoteControl.sqf b/addons/zeus/functions/fnc_bi_moduleRemoteControl.sqf index f32afef130..6d2d3fd950 100644 --- a/addons/zeus/functions/fnc_bi_moduleRemoteControl.sqf +++ b/addons/zeus/functions/fnc_bi_moduleRemoteControl.sqf @@ -9,7 +9,10 @@ * 2: activated * * Return Value: - * nil + * None + * + * Example: + * [LOGIC, [bob, kevin], true] call ace_zeus_fnc_bi_moduleRemoteControl * * Public: No */ diff --git a/addons/zeus/functions/fnc_getModuleDestination.sqf b/addons/zeus/functions/fnc_getModuleDestination.sqf new file mode 100644 index 0000000000..138d8342a5 --- /dev/null +++ b/addons/zeus/functions/fnc_getModuleDestination.sqf @@ -0,0 +1,116 @@ +/* + * Author: PabstMirror + * Allows zeus to click to indicate a 3d position. + * + * Arguments: + * 0: The souce object + * 1: Code to run when position is ready + * - Code is passed + * 0: Successful + * 1: Object + * 2: Position ASL + * 3: State of Shift + * 4: State of Ctrl + * 5: State of Alt + * 2: Text (default: "") + * 3: Icon image file (default: "\a3\ui_f\data\IGUI\Cfg\Cursors\select_target_ca.paa") + * 4: Icon color (default: [1,0,0,1]) + * + * Return Value: + * None + * + * Example: + * [player, {systemChat format ["Done %1", _this]}] call ace_zeus_fnc_getModuleDestination + * + * Public: No + */ +#include "script_component.hpp" + +params ["_object", "_code", ["_text", ""], ["_icon", "\a3\ui_f\data\IGUI\Cfg\Cursors\select_target_ca.paa"], ["_color", [1,0,0,1]]]; + +if (missionNamespace getVariable [QGVAR(moduleDestination_running), false]) exitWith { + [false, _object, [0,0,0], false, false, false] call _code; + ERROR("getModuleDestination already running"); +}; + +GVAR(moduleDestination_running) = true; + +// Add mouse button eh for the zeus display (triggered from 2d or 3d) +GVAR(moduleDestination_displayEHMouse) = [findDisplay 312, "mouseButtonDown", { + params ["", "_mouseButton", "", "", "_shift", "_ctrl", "_alt"]; + + if (_mouseButton != 0) exitWith {}; // Only watch for LMB + TRACE_2("placed",_object,_mousePosASL); + + _thisArgs params ["_object", "_code"]; + + // Get mouse position on 2D map or 3D world + private _mousePosASL = if (ctrlShown ((findDisplay 312) displayCtrl 50)) then { + private _pos2d = (((findDisplay 312) displayCtrl 50) ctrlMapScreenToWorld getMousePosition); + _pos2d set [2, getTerrainHeightASL _pos2d]; + _pos2d + } else { + AGLToASL (screenToWorld getMousePosition); + }; + + [true, _object, _mousePosASL, _shift, _ctrl, _alt] call _code; + GVAR(moduleDestination_running) = false; +}, [_object, _code]] call CBA_fnc_addBISEventHandler; + +// Add key eh for the zeus display (triggered from 2d or 3d) +GVAR(moduleDestination_displayEHKeyboard) = [findDisplay 312, "KeyDown", { + params ["", "_keyCode", "_shift", "_ctrl", "_alt"]; + + if (_keyCode != 1) exitWith {}; // Only watch for ESC + TRACE_2("aborted",_object,_mousePosASL); + + _thisArgs params ["_object", "_code"]; + + // Get mouse position on 2D map or 3D world + private _mousePosASL = if (ctrlShown ((findDisplay 312) displayCtrl 50)) then { + private _pos2d = (((findDisplay 312) displayCtrl 50) ctrlMapScreenToWorld getMousePosition); + _pos2d set [2, getTerrainHeightASL _pos2d]; + _pos2d + } else { + AGLToASL (screenToWorld getMousePosition); + }; + + [false, _object, _mousePosASL, _shift, _ctrl, _alt] call _code; + GVAR(moduleDestination_running) = false; + true +}, [_object, _code]] call CBA_fnc_addBISEventHandler; + +// Add draw EH for the zeus map - draws the 2D icon and line +GVAR(moduleDestination_mapDrawEH) = [((findDisplay 312) displayCtrl 50), "draw", { + params ["_mapCtrl"]; + _thisArgs params ["_object", "_text", "_icon", "_color"]; + + private _pos2d = (((findDisplay 312) displayCtrl 50) ctrlMapScreenToWorld getMousePosition); + _mapCtrl drawIcon [_icon, _color, _pos2d, 24, 24, 45, _text, 1, 0.03, "TahomaB", "right"]; + _mapCtrl drawLine [getPos _object, _pos2d, _color]; +}, [_object, _text, _icon, _color]] call CBA_fnc_addBISEventHandler; + +// Add draw EH for 3D camera view - draws the 3D icon and line +[{ + (_this select 0) params ["_object", "_code", "_text", "_icon", "_color"]; + if ((isNull _object) || {isNull findDisplay 312} || {!isNull findDisplay 49}) then { + TRACE_3("null-exit",isNull _object,isNull findDisplay 312,isNull findDisplay 49); + GVAR(moduleDestination_running) = false; + [false, _object, [0,0,0], false, false, false] call _code; + }; + if (GVAR(moduleDestination_running)) then { + // Draw the 3d icon and line + private _mousePosAGL = screenToWorld getMousePosition; + drawIcon3D [_icon, _color, _mousePosAGL, 1.5, 1.5, 45, _text]; + drawLine3D [_mousePosAGL, ASLtoAGL (getPosASL _object), _color];; + } else { + TRACE_4("cleaning up",_this select 1,GVAR(moduleDestination_displayEHMouse),GVAR(moduleDestination_displayEHKeyboard),GVAR(moduleDestination_mapDrawEH)); + (_this select 1) call CBA_fnc_removePerFrameHandler; + (findDisplay 312) displayRemoveEventHandler ["mouseButtonDown", GVAR(moduleDestination_displayEHMouse)]; + (findDisplay 312) displayRemoveEventHandler ["KeyDown", GVAR(moduleDestination_displayEHKeyboard)]; + ((findDisplay 312) displayCtrl 50) ctrlRemoveEventHandler ["draw", GVAR(moduleDestination_mapDrawEH)]; + GVAR(moduleDestination_displayEHMouse) = nil; + GVAR(moduleDestination_displayEHKeyboard) = nil; + GVAR(moduleDestination_mapDrawEH) = nil; + }; +}, 0, [_object, _code, _text, _icon, _color]] call CBA_fnc_addPerFrameHandler; diff --git a/addons/zeus/functions/fnc_handleZeusUnitAssigned.sqf b/addons/zeus/functions/fnc_handleZeusUnitAssigned.sqf index 65663e65fd..2899d8d952 100644 --- a/addons/zeus/functions/fnc_handleZeusUnitAssigned.sqf +++ b/addons/zeus/functions/fnc_handleZeusUnitAssigned.sqf @@ -12,23 +12,24 @@ * 1: The zeus player * * Return Value: - * nil + * None + * + * Example: + * [LOGIC, bob] call ace_zeus_fnc_handleZeusUnitAssigned * * Public: No */ #include "script_component.hpp" -private ["_removeAddons", "_numCfgs", "_cfg", "_requiredAddon"]; - if !(isClass (configFile >> "ACE_Curator")) exitWith { ERROR("The ACE_Curator class does not exist") }; params ["_logic"]; -_removeAddons = []; +private _removeAddons = []; -_numCfgs = count (configFile >> "ACE_Curator"); +private _numCfgs = count (configFile >> "ACE_Curator"); for "_n" from 0 to (_numCfgs - 1) do { - _cfg = (configFile >> "ACE_Curator") select _n; + private _cfg = (configFile >> "ACE_Curator") select _n; if (isArray _cfg) then { _requiredAddon = getArray _cfg; diff --git a/addons/zeus/functions/fnc_moduleAddArsenal.sqf b/addons/zeus/functions/fnc_moduleAddArsenal.sqf new file mode 100644 index 0000000000..b8eed64d76 --- /dev/null +++ b/addons/zeus/functions/fnc_moduleAddArsenal.sqf @@ -0,0 +1,38 @@ +/* + * Author: alganthe + * Add a full arsenal to an object + * + * Arguments: + * 0: The module logic + * + * Return Value: + * None + * + * Public: No + */ +#include "script_component.hpp" + +params ["_logic"]; +if (!local _logic) exitWith {}; + +private _object = attachedTo _logic; +TRACE_3("moduleAddArsenal",_logic,_object,typeOf _object); + +switch (true) do { + case (isNull _object): { + [LSTRING(NothingSelected)] call FUNC(showMessage); + }; + case (isPlayer _object): { + ["str_a3_cfgvehicles_moduleremotecontrol_f_errorPlayer"] call FUNC(showMessage); + }; + case (!alive _object): { + [LSTRING(OnlyAlive)] call FUNC(showMessage); + }; + default { + TRACE_1("BIS_fnc_arsenal: AmmoboxInit",_object); + // Global Effects: "Action to access the Arsenal will be added automatically on all clients." + ["AmmoboxInit", [_object, true]] call BIS_fnc_arsenal; + }; +}; + +deleteVehicle _logic; diff --git a/addons/zeus/functions/fnc_moduleAddOrRemoveFRIES.sqf b/addons/zeus/functions/fnc_moduleAddOrRemoveFRIES.sqf new file mode 100644 index 0000000000..5b05d256f4 --- /dev/null +++ b/addons/zeus/functions/fnc_moduleAddOrRemoveFRIES.sqf @@ -0,0 +1,56 @@ +/* + * Author: 654wak654 + * Add/Removes FRIES from a helicopter. + * + * Arguments: + * 0: The module logic + * 1: Synchronized units + * 2: Activated + * + * Return Value: + * None + * + * Example: + * [LOGIC, [bob, kevin], true] call ace_zeus_fnc_moduleAddOrRemoveFRIES + * + * Public: No + */ +#include "script_component.hpp" + +params ["_logic", "_units", "_activated"]; + +if !(_activated && {local _logic}) exitWith {}; + +if !(["ace_fastroping"] call EFUNC(common,isModLoaded)) then { + [LSTRING(RequiresAddon)] call FUNC(showMessage); +} else { + (GETMVAR(BIS_fnc_curatorObjectPlaced_mouseOver,[""])) params ["_mouseOverType", "_mouseOverUnit"]; + + if (_mouseOverType != "OBJECT") then { + [LSTRING(NothingSelected)] call FUNC(showMessage); + } else { + if !(alive _mouseOverUnit) then { + [LSTRING(OnlyAlive)] call FUNC(showMessage); + } else { + private _config = configFile >> "CfgVehicles" >> typeOf _mouseOverUnit; + private _displayName = getText (_config >> "displayName"); + if !(isNumber (_config >> QEGVAR(fastroping,enabled))) then { + [LSTRING(NotFastRopeCompatible), _displayName] call FUNC(showMessage); + } else { + private _fries = GETVAR(_mouseOverUnit,EGVAR(fastroping,FRIES),objNull); + if (isNull _fries) then { + [QGVAR(equipFries), [_mouseOverUnit]] call CBA_fnc_serverEvent; + } else { + if ([_mouseOverUnit] call EFUNC(fastroping,canCutRopes)) then { + [LSTRING(CantRemoveFRIES), _displayName] call FUNC(showMessage); + } else { + [_mouseOverUnit] call EFUNC(fastroping,cutRopes); + deleteVehicle _fries; + }; + }; + }; + }; + }; +}; + +deleteVehicle _logic; diff --git a/addons/zeus/functions/fnc_moduleAddSpareTrack.sqf b/addons/zeus/functions/fnc_moduleAddSpareTrack.sqf index 2926fafcf9..56d3dca9d9 100644 --- a/addons/zeus/functions/fnc_moduleAddSpareTrack.sqf +++ b/addons/zeus/functions/fnc_moduleAddSpareTrack.sqf @@ -10,6 +10,9 @@ * Return Value: * None * + * Example: + * [LOGIC, [bob, kevin], true] call ace_zeus_fnc_moduleAddSpareTrack + * * Public: No */ #include "script_component.hpp" @@ -19,18 +22,18 @@ params ["_logic", "_units", "_activated"]; if !(_activated && local _logic) exitWith {}; if !(["ace_cargo"] call EFUNC(common,isModLoaded) && ["ace_repair"] call EFUNC(common,isModLoaded)) then { - [LSTRING(RequiresAddon)] call EFUNC(common,displayTextStructured); + [LSTRING(RequiresAddon)] call FUNC(showMessage); } else { (GETMVAR(bis_fnc_curatorObjectPlaced_mouseOver,[""])) params ["_mouseOverType", "_mouseOverUnit"]; if (_mouseOverType != "OBJECT") then { - [LSTRING(NothingSelected)] call EFUNC(common,displayTextStructured); + [LSTRING(NothingSelected)] call FUNC(showMessage); } else { if !(alive _mouseOverUnit) then { - [LSTRING(OnlyAlive)] call EFUNC(common,displayTextStructured); + [LSTRING(OnlyAlive)] call FUNC(showMessage); } else { if (getNumber (configFile >> "CfgVehicles" >> "ACE_Track" >> QEGVAR(cargo,size)) > [_mouseOverUnit] call EFUNC(cargo,getCargoSpaceLeft)) then { - [LSTRING(OnlyEnoughCargoSpace)] call EFUNC(common,displayTextStructured); + [LSTRING(OnlyEnoughCargoSpace)] call FUNC(showMessage); } else { ["ace_addCargo", ["ACE_Track", _mouseOverUnit, 1, true]] call CBA_fnc_localEvent; }; diff --git a/addons/zeus/functions/fnc_moduleAddSpareWheel.sqf b/addons/zeus/functions/fnc_moduleAddSpareWheel.sqf index 2c051c94b6..da9327af7a 100644 --- a/addons/zeus/functions/fnc_moduleAddSpareWheel.sqf +++ b/addons/zeus/functions/fnc_moduleAddSpareWheel.sqf @@ -10,6 +10,9 @@ * Return Value: * None * + * Example: + * [LOGIC, [bob, kevin], true] call ace_zeus_fnc_moduleAddSpareWheel + * * Public: No */ #include "script_component.hpp" @@ -19,18 +22,18 @@ params ["_logic", "_units", "_activated"]; if !(_activated && local _logic) exitWith {}; if !(["ace_cargo"] call EFUNC(common,isModLoaded) && ["ace_repair"] call EFUNC(common,isModLoaded)) then { - [LSTRING(RequiresAddon)] call EFUNC(common,displayTextStructured); + [LSTRING(RequiresAddon)] call FUNC(showMessage); } else { (GETMVAR(bis_fnc_curatorObjectPlaced_mouseOver,[""])) params ["_mouseOverType", "_mouseOverUnit"]; if (_mouseOverType != "OBJECT") then { - [LSTRING(NothingSelected)] call EFUNC(common,displayTextStructured); + [LSTRING(NothingSelected)] call FUNC(showMessage); } else { if !(alive _mouseOverUnit) then { - [LSTRING(OnlyAlive)] call EFUNC(common,displayTextStructured); + [LSTRING(OnlyAlive)] call FUNC(showMessage); } else { if (getNumber (configFile >> "CfgVehicles" >> "ACE_Wheel" >> QEGVAR(cargo,size)) > [_mouseOverUnit] call EFUNC(cargo,getCargoSpaceLeft)) then { - [LSTRING(OnlyEnoughCargoSpace)] call EFUNC(common,displayTextStructured); + [LSTRING(OnlyEnoughCargoSpace)] call FUNC(showMessage); } else { ["ace_addCargo", ["ACE_Wheel", _mouseOverUnit, 1, true]] call CBA_fnc_localEvent; }; diff --git a/addons/zeus/functions/fnc_moduleCaptive.sqf b/addons/zeus/functions/fnc_moduleCaptive.sqf index 7d1c46f873..c2345616f0 100644 --- a/addons/zeus/functions/fnc_moduleCaptive.sqf +++ b/addons/zeus/functions/fnc_moduleCaptive.sqf @@ -8,7 +8,10 @@ * 2: Activated * * Return Value: - * None + * None + * + * Example: + * [LOGIC, [bob, kevin], true] call ace_zeus_fnc_moduleCaptive * * Public: No */ @@ -16,27 +19,26 @@ #include "script_component.hpp" params ["_logic", "_units", "_activated"]; -private ["_mouseOver", "_unit", "_captive"]; if !(_activated && local _logic) exitWith {}; if (isNil QEFUNC(captives,setHandcuffed)) then { - [LSTRING(RequiresAddon)] call EFUNC(common,displayTextStructured); + [LSTRING(RequiresAddon)] call FUNC(showMessage); } else { - _mouseOver = GETMVAR(bis_fnc_curatorObjectPlaced_mouseOver,[""]); + private _mouseOver = GETMVAR(bis_fnc_curatorObjectPlaced_mouseOver,[""]); if ((_mouseOver select 0) != "OBJECT") then { - [LSTRING(NothingSelected)] call EFUNC(common,displayTextStructured); + [LSTRING(NothingSelected)] call FUNC(showMessage); } else { - _unit = effectivecommander (_mouseOver select 1); + private _unit = effectivecommander (_mouseOver select 1); if !(_unit isKindOf "CAManBase") then { - [LSTRING(OnlyInfantry)] call EFUNC(common,displayTextStructured); + [LSTRING(OnlyInfantry)] call FUNC(showMessage); } else { if !(alive _unit) then { - [LSTRING(OnlyAlive)] call EFUNC(common,displayTextStructured); + [LSTRING(OnlyAlive)] call FUNC(showMessage); } else { - _captive = GETVAR(_unit,EGVAR(captives,isHandcuffed),false); + private _captive = GETVAR(_unit,EGVAR(captives,isHandcuffed),false); // Event initalized by ACE_Captives [QEGVAR(captives,setHandcuffed), [_unit, !_captive], _unit] call CBA_fnc_targetEvent; }; diff --git a/addons/zeus/functions/fnc_moduleConfigurePylons.sqf b/addons/zeus/functions/fnc_moduleConfigurePylons.sqf new file mode 100644 index 0000000000..4998ae8bac --- /dev/null +++ b/addons/zeus/functions/fnc_moduleConfigurePylons.sqf @@ -0,0 +1,37 @@ +/* + * Author: 654wak654 + * Opens the pylon configuration menu for the aircraft module is placed on. + * + * Arguments: + * 0: Module logic + * 1: Synchronized units + * 2: Activated + * + * Return Value: + * None + * + * Example: + * [LOGIC, [bob, kevin], true] call ace_zeus_fnc_moduleConfigurePylons + * + * Public: No + */ +#include "script_component.hpp" + +if (canSuspend) exitWith {[FUNC(moduleConfigurePylons), _this] call CBA_fnc_directCall;}; + +params ["_logic", "_units", "_activated"]; + +if !(_activated && {local _logic}) exitWith {}; + +private _aircraft = attachedTo _logic; + +deleteVehicle _logic; + +if (isNull _aircraft) exitWith { + [LSTRING(NothingSelected)] call FUNC(showMessage); +}; +if (!alive _aircraft) exitWith { + [LSTRING(OnlyAlive)] call FUNC(showMessage); +}; + +[_aircraft, true] call EFUNC(pylons,showDialog); diff --git a/addons/zeus/functions/fnc_moduleGarrison.sqf b/addons/zeus/functions/fnc_moduleGarrison.sqf new file mode 100644 index 0000000000..2762102d0c --- /dev/null +++ b/addons/zeus/functions/fnc_moduleGarrison.sqf @@ -0,0 +1,62 @@ +/* + * Author: alganthe + * Module calling the garrison function. + * + * Arguments: + * 0: Module logic + * 1: Position of the module + * 2: Radius of the task + * 3: Filling mode of the garrison function + * 4: Enable or not top down filling + * + * Return Value: + * None + * + * Example: + * [LOGIC, [2203.64, 2281.47, 1], 20, 2, true] call ace_zeus_fnc_moduleGarrison + * + * Public: No +*/ + +#include "script_component.hpp" + +params ["_logic", "_pos", "_radius" ,"_mode" , "_topDownMode", "_teleport"]; + +private _unit = (attachedTo _logic); +private _building = nearestBuilding (getPosASL _unit); + +// Handles errors +scopeName "Main"; +private _fnc_errorAndClose = { + params ["_msg"]; + deleteVehicle _logic; + [_msg] call FUNC(showMessage); + breakOut "Main"; +}; + +switch (false) do { + case !(isNull _unit): { + [LSTRING(NothingSelected)] call _fnc_errorAndClose; + }; + case (_unit isKindOf "CAManBase"): { + [LSTRING(OnlyInfantry)] call _fnc_errorAndClose; + }; + case (alive _unit): { + [LSTRING(OnlyAlive)] call _fnc_errorAndClose; + }; + case (_unit distance _building < 500): { + [LSTRING(BuildingTooFar)] call _fnc_errorAndClose; + }; +}; + +private _units = units _unit; +// Make sure all units are disembarked +{ + if (vehicle _x != _x) then { + moveOut _x; + }; +} forEach _units; + +[_pos, ["Building"], _units, _radius, _mode, _topDownMode, _teleport] call EFUNC(ai,garrison); + +deleteVehicle _logic; diff --git a/addons/zeus/functions/fnc_moduleGlobalSetSkill.sqf b/addons/zeus/functions/fnc_moduleGlobalSetSkill.sqf index 35c6476cc0..ce864e85b0 100644 --- a/addons/zeus/functions/fnc_moduleGlobalSetSkill.sqf +++ b/addons/zeus/functions/fnc_moduleGlobalSetSkill.sqf @@ -7,10 +7,10 @@ * 1: Variable new value * * Return Value: - * None + * None * * Example: - * "ace_zeus_GlobalSkillAI" addPublicVariableEventHandler ace_zeus_fnc_moduleGlobalSetSkill + * [LOGIC, [bob, kevin], true] call ace_zeus_fnc_moduleGlobalSetSkill * * Public: No */ diff --git a/addons/zeus/functions/fnc_moduleGroupSide.sqf b/addons/zeus/functions/fnc_moduleGroupSide.sqf index fa37ca3463..050b92a9fc 100644 --- a/addons/zeus/functions/fnc_moduleGroupSide.sqf +++ b/addons/zeus/functions/fnc_moduleGroupSide.sqf @@ -7,7 +7,7 @@ * 1: Chosen side * * Return Value: - * None + * None * * Example: * [this, west] call ace_zeus_fnc_moduleGroupSide diff --git a/addons/zeus/functions/fnc_moduleLoadIntoCargo.sqf b/addons/zeus/functions/fnc_moduleLoadIntoCargo.sqf new file mode 100644 index 0000000000..630fd537ef --- /dev/null +++ b/addons/zeus/functions/fnc_moduleLoadIntoCargo.sqf @@ -0,0 +1,66 @@ +/* + * Author: 654wak654 + * Loads the object module is placed on into selected vehicle. + * + * Arguments: + * 0: Module logic + * 1: Synchronized units + * 2: Activated + * + * Return Value: + * None + * + * Example: + * [LOGIC, [bob, kevin], true] call ace_zeus_fnc_moduleLoadIntoCargo + * + * Public: No + */ +#include "script_component.hpp" + +if (canSuspend) exitWith {[FUNC(moduleLoadIntoCargo), _this] call CBA_fnc_directCall;}; + +params ["_logic", "_units", "_activated"]; + +if !(_activated && {local _logic}) exitWith {}; + +private _cargo = attachedTo _logic; + +deleteVehicle _logic; + +if !(missionNamespace getVariable [QEGVAR(cargo,enable), false]) exitWith { + [LSTRING(RequiresAddon)] call FUNC(showMessage); +}; +if (isNull _cargo) exitWith { + [LSTRING(NothingSelected)] call FUNC(showMessage); +}; +if (!alive _cargo) exitWith { + [LSTRING(OnlyAlive)] call FUNC(showMessage); +}; + +[ + _cargo, + { + params ["_successful", "_cargo", "_mousePosASL"]; + if (!_successful) exitWith {}; + + private _holder = (nearestObjects [ASLToAGL _mousePosASL, EGVAR(cargo,cargoHolderTypes), 5]) param [0, objNull]; + if (isNull _holder) exitWith { + [LSTRING(NothingSelected)] call FUNC(showMessage); + }; + if (!alive _holder) exitWith { + [LSTRING(OnlyAlive)] call FUNC(showMessage); + }; + + private _displayName = [_cargo] call EFUNC(common,getName); + if ([_cargo, _holder] call EFUNC(cargo,loadItem)) then { + private _loadedItem = [localize ELSTRING(cargo,LoadedItem), "
", " "] call CBA_fnc_replace; + private _holderDisplayName = [_holder] call EFUNC(common,getName); + [_loadedItem, _displayName, _holderDisplayName] call FUNC(showMessage); + } else { + private _loadingFailed = [localize ELSTRING(cargo,LoadingFailed), "
", " "] call CBA_fnc_replace; + [_loadingFailed, _displayName] call FUNC(showMessage); + }; + }, + localize LSTRING(ModuleLoadIntoCargo_DisplayName), + "a3\ui_f\data\IGUI\Cfg\Actions\loadVehicle_ca.paa" +] call FUNC(getModuleDestination); diff --git a/addons/zeus/functions/fnc_moduleRemoveArsenal.sqf b/addons/zeus/functions/fnc_moduleRemoveArsenal.sqf new file mode 100644 index 0000000000..9e267e4cf5 --- /dev/null +++ b/addons/zeus/functions/fnc_moduleRemoveArsenal.sqf @@ -0,0 +1,41 @@ +/* + * Author: alganthe + * Remove arsenal from an object + * + * Arguments: + * 0: The module logic + * + * Return Value: + * None + * + * Public: No +*/ + +#include "script_component.hpp" + +params ["_logic"]; +if (!local _logic) exitWith {}; + +private _object = attachedTo _logic; +TRACE_3("moduleRemoveArsenal",_logic,_object,typeOf _object); + +switch (true) do { + case (isNull _object): { + [LSTRING(NothingSelected)] call FUNC(showMessage); + }; + case (isPlayer _object): { + ["str_a3_cfgvehicles_moduleremotecontrol_f_errorPlayer"] call FUNC(showMessage); + }; + case (!alive _object): { + [LSTRING(OnlyAlive)] call FUNC(showMessage); + }; + default { + TRACE_1("Calling removeVirtualXXXCargo functions",_object); + [_object, (_object call BIS_fnc_getVirtualItemCargo), true] call BIS_fnc_removeVirtualItemCargo; + [_object, (_object call BIS_fnc_getVirtualWeaponCargo), true] call BIS_fnc_removeVirtualWeaponCargo; + [_object, (_object call BIS_fnc_getVirtualMagazineCargo), true] call BIS_fnc_removeVirtualMagazineCargo; + [_object, (_object call BIS_fnc_getVirtualBackpackCargo), true] call BIS_fnc_removeVirtualBackpackCargo; + }; +}; + +deleteVehicle _logic; diff --git a/addons/zeus/functions/fnc_moduleSearchNearby.sqf b/addons/zeus/functions/fnc_moduleSearchNearby.sqf index 48f35bbfee..30d545e6d9 100644 --- a/addons/zeus/functions/fnc_moduleSearchNearby.sqf +++ b/addons/zeus/functions/fnc_moduleSearchNearby.sqf @@ -8,7 +8,10 @@ * 2: Activated * * Return Value: - * None + * None + * + * Example: + * [LOGIC, [bob, kevin], true] call ace_zeus_fnc_moduleSearchNearby * * Public: No */ @@ -27,7 +30,7 @@ scopeName "Main"; private _fnc_errorAndClose = { params ["_msg"]; deleteVehicle _logic; - [_msg] call EFUNC(common,displayTextStructured); + [_msg] call FUNC(showMessage); breakOut "Main"; }; diff --git a/addons/zeus/functions/fnc_moduleSetMedic.sqf b/addons/zeus/functions/fnc_moduleSetMedic.sqf index d4acda3f54..578aeb27f9 100644 --- a/addons/zeus/functions/fnc_moduleSetMedic.sqf +++ b/addons/zeus/functions/fnc_moduleSetMedic.sqf @@ -8,7 +8,10 @@ * 2: Activated * * Return Value: - * None + * None + * + * Example: + * [LOGIC, [bob, kevin], true] call ace_zeus_fnc_moduleSetMedic * * Public: No */ @@ -16,30 +19,29 @@ #include "script_component.hpp" params ["_logic", "_units", "_activated"]; -private ["_mouseOver", "_unit", "_medicN"]; if !(_activated && local _logic) exitWith {}; if !(["ACE_Medical"] call EFUNC(common,isModLoaded)) then { - [LSTRING(RequiresAddon)] call EFUNC(common,displayTextStructured); + [LSTRING(RequiresAddon)] call FUNC(showMessage); } else { - _mouseOver = GETMVAR(bis_fnc_curatorObjectPlaced_mouseOver,[""]); + private _mouseOver = GETMVAR(bis_fnc_curatorObjectPlaced_mouseOver,[""]); if ((_mouseOver select 0) != "OBJECT") then { - [LSTRING(NothingSelected)] call EFUNC(common,displayTextStructured); + [LSTRING(NothingSelected)] call FUNC(showMessage); } else { - _unit = effectivecommander (_mouseOver select 1); + private _unit = effectivecommander (_mouseOver select 1); if !(_unit isKindOf "CAManBase") then { - [LSTRING(OnlyInfantry)] call EFUNC(common,displayTextStructured); + [LSTRING(OnlyInfantry)] call FUNC(showMessage); } else { if !(alive _unit) then { - [LSTRING(OnlyAlive)] call EFUNC(common,displayTextStructured); + [LSTRING(OnlyAlive)] call FUNC(showMessage); } else { if (GETVAR(_unit,EGVAR(captives,isHandcuffed),false)) then { - [LSTRING(OnlyNonCaptive)] call EFUNC(common,displayTextStructured); + [LSTRING(OnlyNonCaptive)] call FUNC(showMessage); } else { - _medicN = GETVAR(_unit,EGVAR(medical,medicClass),0); + private _medicN = GETVAR(_unit,EGVAR(medical,medicClass),0); if (_medicN < 1) then { _unit setVariable [QEGVAR(medical,medicClass), 1, true]; }; diff --git a/addons/zeus/functions/fnc_moduleSetMedicalFacility.sqf b/addons/zeus/functions/fnc_moduleSetMedicalFacility.sqf index 1e710bf41b..09636bc006 100644 --- a/addons/zeus/functions/fnc_moduleSetMedicalFacility.sqf +++ b/addons/zeus/functions/fnc_moduleSetMedicalFacility.sqf @@ -8,7 +8,10 @@ * 2: Activated * * Return Value: - * None + * None + * + * Example: + * [LOGIC, [bob, kevin], true] call ace_zeus_fnc_moduleSetMedicalFacility * * Public: No */ @@ -16,28 +19,27 @@ #include "script_component.hpp" params ["_logic", "_units", "_activated"]; -private ["_mouseOver", "_unit"]; if !(_activated && local _logic) exitWith {}; if !(["ACE_Medical"] call EFUNC(common,isModLoaded)) then { - [LSTRING(RequiresAddon)] call EFUNC(common,displayTextStructured); + [LSTRING(RequiresAddon)] call FUNC(showMessage); } else { - _mouseOver = GETMVAR(bis_fnc_curatorObjectPlaced_mouseOver,[""]); + private _mouseOver = GETMVAR(bis_fnc_curatorObjectPlaced_mouseOver,[""]); if ((_mouseOver select 0) != "OBJECT") then { - [LSTRING(NothingSelected)] call EFUNC(common,displayTextStructured); + [LSTRING(NothingSelected)] call FUNC(showMessage); } else { - _unit = (_mouseOver select 1); + private _unit = (_mouseOver select 1); if (_unit isKindOf "Man" || {!(_unit isKindOf "Building")}) then { - [LSTRING(OnlyStructures)] call EFUNC(common,displayTextStructured); + [LSTRING(OnlyStructures)] call FUNC(showMessage); } else { if !(alive _unit) then { - [LSTRING(OnlyAlive)] call EFUNC(common,displayTextStructured); + [LSTRING(OnlyAlive)] call FUNC(showMessage); } else { if (GETVAR(_unit,EGVAR(captives,isHandcuffed),false)) then { - [LSTRING(OnlyNonCaptive)] call EFUNC(common,displayTextStructured); + [LSTRING(OnlyNonCaptive)] call FUNC(showMessage); } else { if (!(GETVAR(_unit,EGVAR(medical,isMedicalFacility),false))) then { _unit setVariable [QEGVAR(medical,isMedicalFacility), true, true]; diff --git a/addons/zeus/functions/fnc_moduleSetMedicalVehicle.sqf b/addons/zeus/functions/fnc_moduleSetMedicalVehicle.sqf index 4ffec3460e..6e240416ff 100644 --- a/addons/zeus/functions/fnc_moduleSetMedicalVehicle.sqf +++ b/addons/zeus/functions/fnc_moduleSetMedicalVehicle.sqf @@ -8,7 +8,10 @@ * 2: Activated * * Return Value: - * None + * None + * + * Example: + * [LOGIC, [bob, kevin], true] call ace_zeus_fnc_moduleSetMedicalVehicle * * Public: No */ @@ -16,30 +19,29 @@ #include "script_component.hpp" params ["_logic", "_units", "_activated"]; -private ["_mouseOver", "_unit", "_medicN"]; if !(_activated && local _logic) exitWith {}; if !(["ACE_Medical"] call EFUNC(common,isModLoaded)) then { - [LSTRING(RequiresAddon)] call EFUNC(common,displayTextStructured); + [LSTRING(RequiresAddon)] call FUNC(showMessage); } else { - _mouseOver = GETMVAR(bis_fnc_curatorObjectPlaced_mouseOver,[""]); + private _mouseOver = GETMVAR(bis_fnc_curatorObjectPlaced_mouseOver,[""]); if ((_mouseOver select 0) != "OBJECT") then { - [LSTRING(NothingSelected)] call EFUNC(common,displayTextStructured); + [LSTRING(NothingSelected)] call FUNC(showMessage); } else { - _unit = (_mouseOver select 1); + private _unit = (_mouseOver select 1); if (_unit isKindOf "Man" || {_unit isKindOf "Building"}) then { - [LSTRING(OnlyVehicles)] call EFUNC(common,displayTextStructured); + [LSTRING(OnlyVehicles)] call FUNC(showMessage); } else { if !(alive _unit) then { - [LSTRING(OnlyAlive)] call EFUNC(common,displayTextStructured); + [LSTRING(OnlyAlive)] call FUNC(showMessage); } else { if (GETVAR(_unit,EGVAR(captives,isHandcuffed),false)) then { - [LSTRING(OnlyNonCaptive)] call EFUNC(common,displayTextStructured); + [LSTRING(OnlyNonCaptive)] call FUNC(showMessage); } else { - _medicN = GETVAR(_unit,EGVAR(medical,medicClass),0); + private _medicN = GETVAR(_unit,EGVAR(medical,medicClass),0); if (_medicN < 1) then { _unit setVariable [QEGVAR(medical,medicClass), 1, true]; }; diff --git a/addons/zeus/functions/fnc_moduleSimulation.sqf b/addons/zeus/functions/fnc_moduleSimulation.sqf new file mode 100644 index 0000000000..fc6d6e4a06 --- /dev/null +++ b/addons/zeus/functions/fnc_moduleSimulation.sqf @@ -0,0 +1,30 @@ +/* + * Author: Fisher, SilentSpike + * Toggle Simulation on object. + * + * Arguments: + * 0: The module logic + * + * Return Value: + * None + * + * Example: + * [LOGIC] call ace_zeus_fnc_moduleSimulation + * + * Public: No + */ + +#include "script_component.hpp" + +params ["_logic"]; + +if !(local _logic) exitWith {}; + +private _object = attachedTo _logic; +if (isNull _object) then { + [LSTRING(NothingSelected)] call FUNC(showMessage); +} else { + [QEGVAR(common,enableSimulationGlobal), [_object, !(simulationEnabled _object)]] call CBA_fnc_serverEvent; +}; + +deleteVehicle _logic; diff --git a/addons/zeus/functions/fnc_moduleSuppressiveFire.sqf b/addons/zeus/functions/fnc_moduleSuppressiveFire.sqf new file mode 100644 index 0000000000..b2c9ba88a7 --- /dev/null +++ b/addons/zeus/functions/fnc_moduleSuppressiveFire.sqf @@ -0,0 +1,119 @@ +/* + * Author: bux, PabstMirror + * Commands the selected unit or group to start suppressive fire on the unit, group or location the module is placed on + * + * Arguments: + * 0: Module logic + * 1: Synchronized units + * 2: Activated + * + * Return Value: + * None + * + * Example: + * [LOGIC, [bob, kevin], true] call ace_zeus_fnc_moduleSuppressiveFire + * + * Public: No + */ +// #define DRAW_ZEUS_INFO +#include "script_component.hpp" + +if (canSuspend) exitWith {[FUNC(moduleSuppressiveFire), _this] call CBA_fnc_directCall;}; + +params ["_logic", "_units", "_activated"]; + +if !(_activated && {local _logic}) exitWith {}; + +// Validate the module target +private _unit = effectiveCommander (attachedTo _logic); +TRACE_3("moduleSuppressiveFire placed",_unit,typeOf _unit,typeOf _logic); + +deleteVehicle _logic; // cleanup logic now, we just needed it to get the attached unit + +if (isNull _unit) exitWith { + [LSTRING(NothingSelected)] call FUNC(showMessage); +}; +if (!alive _unit) exitWith { + [LSTRING(OnlyAlive)] call FUNC(showMessage); +}; +if ([_unit] call EFUNC(common,isPlayer)) exitWith { + ["str_a3_cfgvehicles_moduleremotecontrol_f_errorPlayer"] call FUNC(showMessage); +}; + +[_unit, { + params ["_successful", "_unit", "_mousePosASL"]; + TRACE_3("getModuleDestination return",_successful,_unit,_mousePosASL); + if !(_successful && {alive _unit}) exitWith {}; + private _vehicle = vehicle _unit; + + private _targetASL = _mousePosASL vectorAdd [0,0,0.6]; // mouse pos is at ground level zero, raise up a bit; + private _artilleryMag = ""; + + if ((getNumber (configFile >> "CfgVehicles" >> (typeOf _vehicle) >> "artilleryScanner")) == 1) then { + // Artillery - Get mortar ammo type and verify in range + if (isNull gunner _vehicle) exitWith {_targetASL = [];}; + { + private _ammo = getText (configFile >> "CfgMagazines" >> _x >> "ammo"); + private _hit = getNumber (configFile >> "CfgAmmo" >> _ammo >> "hit"); + if (_hit > 20) exitWith {_artilleryMag = _x;}; + } forEach getArtilleryAmmo [_vehicle]; + TRACE_1("getArtilleryAmmo",_artilleryMag); + if (_artilleryMag == "") exitWith {_targetASL = [];}; + private _eta = _vehicle getArtilleryETA [ASLtoAGL _targetASL, _artilleryMag]; + TRACE_1("getArtilleryETA",_eta); + if (_eta < 0) exitWith { + [ELSTRING(Interaction,NotInRange)] call FUNC(showMessage); + _targetASL = []; + }; + ["TOF: %1 sec", _eta toFixed 1] call FUNC(showMessage); + } else { + // Direct fire - Get a target position that will work + private _lis = lineIntersectsSurfaces [eyePos _unit, _targetASL, _unit, _vehicle]; + if ((count _lis) > 0) then { // If point is hidden, unit won't fire, do a ray cast to find where they should shoot at + _targetASL = ((_lis select 0) select 0); + TRACE_1("using ray cast pos",_mousePosASL distance _targetASL); + }; + if (_unit isEqualTo _vehicle) then { // Max range a unit can fire seems to be based on the weapon's config + private _distance = _targetASL vectorDistance eyePos _unit; + private _maxWeaponRange = getNumber (configFile >> "CfgWeapons" >> (currentWeapon _unit) >> "maxRange"); + TRACE_3("",_distance,_maxWeaponRange,currentWeapon _unit); + if (_distance > (_maxWeaponRange - 50)) then { + if (_distance > (2.5 * _maxWeaponRange)) then { + _targetASL = []; + [ELSTRING(Interaction,NotInRange)] call FUNC(showMessage); + } else { + // 1-2.5x the weapon max range, find a virtual point the AI can shoot at (won't have accurate elevation, but it will put rounds downrange) + private _fakeElevation = (_distance / 100000) * (_distance - _maxWeaponRange); + _targetASL = (eyePos _unit) vectorAdd (((eyePos _unit) vectorFromTo _targetASL) vectorMultiply (_maxWeaponRange - 50)) vectorAdd [0,0,_fakeElevation]; + TRACE_2("using virtual halfway point",_mousePosASL distance _targetASL,_fakeElevation); + }; + }; + }; + }; + + if (_targetASL isEqualTo []) exitWith {}; + + private _units = [_unit]; + if (_unit == (leader _unit)) then {_units = units _unit;}; + if (_artilleryMag != "") then {_units = [gunner _vehicle];}; + + { + if (((_unit distance _x) < 30) && {!([_x] call EFUNC(common,isPlayer))} && {[_x] call EFUNC(common,isAwake)}) then { + TRACE_2("sending event",_x,_targetASL); + [QGVAR(suppressiveFire), [_x, _targetASL, _artilleryMag], _x] call CBA_fnc_targetEvent; + }; + } forEach _units; + +#ifdef DRAW_ZEUS_INFO + [eyePos _unit, _mousePosASL, [0,0,1,1]] call EFUNC(common,addLineToDebugDraw); + [eyePos _unit, _targetASL, [1,0,0,1]] call EFUNC(common,addLineToDebugDraw); + if (_unit != _vehicle) then { + [_vehicle] call CBA_fnc_addUnitTrackProjectiles; + } else { + { + [_x] call CBA_fnc_addUnitTrackProjectiles; + } forEach _units; + }; +#endif + +}, localize LSTRING(ModuleSuppressiveFire_DisplayName)] call FUNC(getModuleDestination); diff --git a/addons/zeus/functions/fnc_moduleSuppressiveFireLocal.sqf b/addons/zeus/functions/fnc_moduleSuppressiveFireLocal.sqf new file mode 100644 index 0000000000..7b11b7e18f --- /dev/null +++ b/addons/zeus/functions/fnc_moduleSuppressiveFireLocal.sqf @@ -0,0 +1,42 @@ +/* + * Author: bux, PabstMirror + * Commands the selected unit or group to start suppressive fire on the unit, group or location the module is placed on + * + * Arguments: + * 0: Unit + * 1: Fire Pos ASL + * 2: Artiller Magazine + * + * Return Value: + * None + * + * Example: + * [bob, [5, 6, 7], "bigmagazine"] call ace_zeus_fnc_moduleSuppressiveFireLocal + * + * Public: No + */ +#include "script_component.hpp" + +params ["_unit", "_targetASL", "_artilleryMag"]; +TRACE_4("moduleSuppressiveFireLocal",_unit,local _unit,_targetASL,_artilleryMag); + +if (_artilleryMag != "") exitWith { + (vehicle _unit) doArtilleryFire [ASLtoAGL _targetASL, _artilleryMag, 4]; + TRACE_3("doArtilleryFire",_unit,_targetASL,_artilleryMag); +}; + +[{ + params ["_unit", "_burstsLeft", "_nextRun", "_targetASL", "_artilleryMag"]; + if (!alive _unit) exitWith {true}; + if (CBA_missionTime >= _nextRun) then { + _burstsLeft = _burstsLeft - 1; + _this set [1, _burstsLeft]; + _this set [2, _nextRun + 4]; + _unit doSuppressiveFire _targetASL; + TRACE_2("doSuppressiveFire",_unit,_targetASL); + }; + (_burstsLeft <= 0) +}, { + TRACE_1("Done",_this); +}, [_unit, 11, CBA_missionTime, _targetASL, _artilleryMag]] call CBA_fnc_waitUntilAndExecute; + diff --git a/addons/zeus/functions/fnc_moduleSurrender.sqf b/addons/zeus/functions/fnc_moduleSurrender.sqf index e14501feb0..2d24242fbd 100644 --- a/addons/zeus/functions/fnc_moduleSurrender.sqf +++ b/addons/zeus/functions/fnc_moduleSurrender.sqf @@ -8,7 +8,10 @@ * 2: Activated * * Return Value: - * None + * None + * + * Example: + * [LOGIC, [bob, kevin], true] call ace_zeus_fnc_moduleSurrender * * Public: No */ @@ -16,30 +19,29 @@ #include "script_component.hpp" params ["_logic", "_units", "_activated"]; -private ["_mouseOver", "_unit", "_surrendering"]; if !(_activated && local _logic) exitWith {}; if (isNil QEFUNC(captives,setSurrendered)) then { - [LSTRING(RequiresAddon)] call EFUNC(common,displayTextStructured); + [LSTRING(RequiresAddon)] call FUNC(showMessage); } else { - _mouseOver = GETMVAR(bis_fnc_curatorObjectPlaced_mouseOver,[""]); + private _mouseOver = GETMVAR(bis_fnc_curatorObjectPlaced_mouseOver,[""]); if ((_mouseOver select 0) != "OBJECT") then { - [LSTRING(NothingSelected)] call EFUNC(common,displayTextStructured); + [LSTRING(NothingSelected)] call FUNC(showMessage); } else { - _unit = effectivecommander (_mouseOver select 1); + private _unit = effectivecommander (_mouseOver select 1); if !(_unit isKindOf "CAManBase") then { - [LSTRING(OnlyInfantry)] call EFUNC(common,displayTextStructured); + [LSTRING(OnlyInfantry)] call FUNC(showMessage); } else { if !(alive _unit) then { - [LSTRING(OnlyAlive)] call EFUNC(common,displayTextStructured); + [LSTRING(OnlyAlive)] call FUNC(showMessage); } else { if (GETVAR(_unit,EGVAR(captives,isHandcuffed),false)) then { - [LSTRING(OnlyNonCaptive)] call EFUNC(common,displayTextStructured); + [LSTRING(OnlyNonCaptive)] call FUNC(showMessage); } else { - _surrendering = GETVAR(_unit,EGVAR(captives,isSurrendering),false); + private _surrendering = GETVAR(_unit,EGVAR(captives,isSurrendering),false); // Event initalized by ACE_Captives [QEGVAR(captives,setSurrendered), [_unit, !_surrendering], _unit] call CBA_fnc_targetEvent; }; diff --git a/addons/zeus/functions/fnc_moduleTeleportPlayers.sqf b/addons/zeus/functions/fnc_moduleTeleportPlayers.sqf index 2a43f26ed1..c52517a7d0 100644 --- a/addons/zeus/functions/fnc_moduleTeleportPlayers.sqf +++ b/addons/zeus/functions/fnc_moduleTeleportPlayers.sqf @@ -8,7 +8,7 @@ * 2: Teleport group * * Return Value: - * None + * None * * Example: * [player, "5854854754", false] call ace_zeus_fnc_moduleTeleportPlayers @@ -36,9 +36,10 @@ if (_group) then { private _attached = attachedTo _logic; if (isNull _attached) then { - [_x, _logic] call BIS_fnc_moveToRespawnPosition; + // Function takes position AGL and must be ran where local + [QGVAR(moveToRespawnPosition), [_x, _logic modelToWorld [0,0,0]], _x] call CBA_fnc_targetEvent; } else { - [_x, _attached] call BIS_fnc_moveToRespawnPosition; + [QGVAR(moveToRespawnPosition), [_x, _attached], _x] call CBA_fnc_targetEvent; }; } forEach _player; diff --git a/addons/zeus/functions/fnc_moduleToggleFlashlight.sqf b/addons/zeus/functions/fnc_moduleToggleFlashlight.sqf new file mode 100644 index 0000000000..4ebfd5a1c0 --- /dev/null +++ b/addons/zeus/functions/fnc_moduleToggleFlashlight.sqf @@ -0,0 +1,64 @@ +/* + * Author: alganthe + * Zeus module function to toggle Flashlights + * + * Arguments: + * 0: Logic object + * 1: Toggle mode + * 2: Add gear + * 3: Target of the toggle 0: blufor; 1: opfor; 2: indep; 3: civ; 4: selected group + * + * Return Value: + * None + * + * Example: + * [LOGIC, true, true, 4] call ace_zeus_fnc_moduleToggleFlashlight + * + * Public: No +*/ + +#include "script_component.hpp" + +params ["_logic", "_toggle", "_addGear", "_target"]; + +private _units = []; + +if (_target == 4) then { + _units = units (attachedTo _logic); +} else { + _units = allUnits select {alive _x && {side _x == ([blufor, opfor, independent, civilian] select _target)}}, +}; + +if (_toggle) then { + { + // enableGunLights doesn't work on players + if !(isPlayer _x || {(currentWeapon _x) isEqualTo ""}) then { + private _pointer = (_x weaponAccessories (currentWeapon _x)) select 1; + + if (!(_pointer isEqualTo "") && {isNull (configfile >> "CfgWeapons" >> _pointer >> "ItemInfo" >> "Pointer")}) then { + [QGVAR(enableFlashlight), [_x, "forceOn"], _x] call CBA_fnc_targetEvent; + + } else { + if (_addGear) then { + // Retrieve compatible items for the pointer slot + private _pointerSlotCompatible = [currentWeapon _x, "pointer"] call CBA_fnc_compatibleItems; + + // Get flashlights from the array above and select the first one + private _flashlight = (_pointerSlotCompatible select {isNull (configfile >> "CfgWeapons" >> _x >> "ItemInfo" >> "Pointer")}) select 0; + + [QEGVAR(common,addWeaponItem), [_x, (currentWeapon _x), _flashlight], _x] call CBA_fnc_targetEvent; + [QGVAR(enableFlashlight), [_x, "forceOn"], _x] call CBA_fnc_targetEvent; + }; + }; + }; + } foreach _units; + +} else { + { + if !(isPlayer _x || {(currentWeapon _x) isEqualTo ""}) then { + [QGVAR(enableFlashlight), [_x, "forceOff"], _x] call CBA_fnc_targetEvent; + }; + } foreach _units; +}; + +deleteVehicle _logic; diff --git a/addons/zeus/functions/fnc_moduleToggleNvg.sqf b/addons/zeus/functions/fnc_moduleToggleNvg.sqf new file mode 100644 index 0000000000..16511063fe --- /dev/null +++ b/addons/zeus/functions/fnc_moduleToggleNvg.sqf @@ -0,0 +1,69 @@ +/* + * Author: alganthe + * Zeus module function to toggle NVGs + * + * Arguments: + * 0: Logic object + * 1: Toggle mode + * 2: Target of the toggle 0: blufor; 1: opfor; 2: indep; 3: civ; 4: selected group + * + * Return Value: + * None + * + * Example: + * [LOGIC, true, 4] call ace_zeus_fnc_moduleToggleNvg + * + * Public: No +*/ + +#include "script_component.hpp" + +params ["_logic", "_toggle", "_target"]; + +private _units = []; + +if (_target == 4) then { + _units = units (attachedTo _logic); +} else { + _units = allUnits select {alive _x && {side _x == ([blufor, opfor, independent, civilian] select _target)}}, +}; + +if (_toggle) then { + { + if (!isplayer _x && {hmd _x isEqualTo ""}) then { + private _cfgArray = getArray (configFile >> 'CfgVehicles' >> typeOf _x >>'linkedItems'); + + private _nvgClass = _cfgArray select {_x isKindOf ["NVGoggles",(configFile >> "CfgWeapons")]}; + private _nvgHelmet =_cfgArray select {count (getArray (configFile >> "CfgWeapons" >> _x >> "subItems")) > 0}; + + // Can't have more than 1 assigned by default + if (count _nvgClass == 1 || {count _nvgHelmet == 1}) then { + if (count _nvgHelmet == 1) then { + _x addHeadgear (_nvgHelmet select 0); + } else { + _x linkItem (_nvgClass select 0); + }; + + } else { + _x linkItem "NVGoggles"; + }; + }; + } foreach _units; + +} else { + { + if (!isplayer _x) then { + private _cfgArray = getArray (configFile >> 'CfgVehicles' >> typeOf _x >>'linkedItems'); + + private _nvgHelmet =_cfgArray select {count (getArray (configFile >> "CfgWeapons" >> _x >> "subItems")) > 0}; + + if (count _nvgHelmet == 1) then { + removeHeadgear _x; + } else { + _x unlinkItem (hmd _x); + }; + }; + } foreach _units; +}; + +deleteVehicle _logic; diff --git a/addons/zeus/functions/fnc_moduleUnGarrison.sqf b/addons/zeus/functions/fnc_moduleUnGarrison.sqf new file mode 100644 index 0000000000..08fb7ada10 --- /dev/null +++ b/addons/zeus/functions/fnc_moduleUnGarrison.sqf @@ -0,0 +1,51 @@ +/* + * Author: alganthe + * Un-garrison a garrisoned group. + * + * Arguments: + * 0: Module logic + * + * Return Value: + * None + * + * Example: + * [LOGIC] call ace_zeus_fnc_moduleUngarrison + * + * Public: No +*/ + +#include "script_component.hpp" + +params ["_logic"]; + +if (!local _logic) exitWith {}; // Module is global + +scopeName "Main"; +private _fnc_errorAndClose = { + params ["_msg"]; + deleteVehicle _logic; + [_msg] call FUNC(showMessage); + breakOut "Main"; +}; + +private _unit = effectiveCommander (attachedTo _logic); + +switch (false) do { + case !(isNull _unit): { + [LSTRING(NothingSelected)] call _fnc_errorAndClose; + }; + case (_unit isKindOf "CAManBase"): { + [LSTRING(OnlyInfantry)] call _fnc_errorAndClose; + }; + case (alive _unit): { + [LSTRING(OnlyAlive)] call _fnc_errorAndClose; + }; + case !(isPlayer _unit): { + ["str_a3_cfgvehicles_moduleremotecontrol_f_errorPlayer"] call _fnc_errorAndClose; + }; +}; +private _units = units _unit; + +[QEGVAR(ai,unGarrison), [_units], _units] call CBA_fnc_targetEvent; + +deleteVehicle _logic; diff --git a/addons/zeus/functions/fnc_moduleUnconscious.sqf b/addons/zeus/functions/fnc_moduleUnconscious.sqf index d9f9031cee..30dc7b9d27 100644 --- a/addons/zeus/functions/fnc_moduleUnconscious.sqf +++ b/addons/zeus/functions/fnc_moduleUnconscious.sqf @@ -8,7 +8,10 @@ * 2: Activated * * Return Value: - * None + * None + * + * Example: + * [LOGIC, [bob, kevin], true] call ace_zeus_fnc_moduleUnconscious * * Public: No */ @@ -16,27 +19,26 @@ #include "script_component.hpp" params ["_logic", "_units", "_activated"]; -private ["_mouseOver", "_unit", "_conscious"]; if !(_activated && local _logic) exitWith {}; if (isNil QEFUNC(medical,setUnconscious)) then { - [LSTRING(RequiresAddon)] call EFUNC(common,displayTextStructured); + [LSTRING(RequiresAddon)] call FUNC(showMessage); } else { - _mouseOver = GETMVAR(bis_fnc_curatorObjectPlaced_mouseOver,[""]); + private _mouseOver = GETMVAR(bis_fnc_curatorObjectPlaced_mouseOver,[""]); if ((_mouseOver select 0) != "OBJECT") then { - [LSTRING(NothingSelected)] call EFUNC(common,displayTextStructured); + [LSTRING(NothingSelected)] call FUNC(showMessage); } else { - _unit = effectivecommander (_mouseOver select 1); + private _unit = effectivecommander (_mouseOver select 1); if !(_unit isKindOf "CAManBase") then { - [LSTRING(OnlyInfantry)] call EFUNC(common,displayTextStructured); + [LSTRING(OnlyInfantry)] call FUNC(showMessage); } else { if !(alive _unit) then { - [LSTRING(OnlyAlive)] call EFUNC(common,displayTextStructured); + [LSTRING(OnlyAlive)] call FUNC(showMessage); } else { - _conscious = GETVAR(_unit,ACE_isUnconscious,false); + private _conscious = GETVAR(_unit,ACE_isUnconscious,false); // Function handles locality for me [_unit, !_conscious, 10e10, true] call EFUNC(medical,setUnconscious); }; diff --git a/addons/zeus/functions/fnc_moduleZeusSettings.sqf b/addons/zeus/functions/fnc_moduleZeusSettings.sqf index 0f3d720599..b52c597c2c 100644 --- a/addons/zeus/functions/fnc_moduleZeusSettings.sqf +++ b/addons/zeus/functions/fnc_moduleZeusSettings.sqf @@ -8,7 +8,10 @@ * 2: activated * * Return Value: - * None + * None + * + * Example: + * [LOGIC, [bob, kevin], true] call ace_zeus_fnc_moduleZeusSettings * * Public: No */ diff --git a/addons/zeus/functions/fnc_showMessage.sqf b/addons/zeus/functions/fnc_showMessage.sqf new file mode 100644 index 0000000000..755b9b6278 --- /dev/null +++ b/addons/zeus/functions/fnc_showMessage.sqf @@ -0,0 +1,24 @@ +/* + * Author: 654wak654 + * Shows a Zeus message through the BIS function, handles localization. + * If multiple args are given, they get formatted. + * + * Arguments: + * 0: Message + * N: Anything (default: nil) + * + * Return Value: + * None + * + * Example: + * ["something"] call ace_zeus_fnc_showMessage + * ["something %1 in %2", "strange", getPos neighborhood] call ace_zeus_fnc_showMessage + * + * Public: Yes + */ +#include "script_component.hpp" + +if (!(_this isEqualTypeParams [""])) exitWith {ERROR_1("First arg must be string [%1]",_this);}; + +private _message = _this apply {if ((_x isEqualType "") && {isLocalized _x}) then {localize _x} else {_x}}; +[objNull, format _message] call BIS_fnc_showCuratorFeedbackMessage; diff --git a/addons/zeus/functions/fnc_ui_attributeCargo.sqf b/addons/zeus/functions/fnc_ui_attributeCargo.sqf index 444fa5e7e2..fb57362fa1 100644 --- a/addons/zeus/functions/fnc_ui_attributeCargo.sqf +++ b/addons/zeus/functions/fnc_ui_attributeCargo.sqf @@ -7,10 +7,10 @@ * 0: ace_cargo controls group * * Return Value: - * None + * None * * Example: - * onSetFocus = "_this call ace_zeus_fnc_ui_vehCargo" + * [CONTROL] call ace_zeus_fnc_ui_attributeCargo * * Public: No */ @@ -20,7 +20,7 @@ params ["_control"]; TRACE_1("params",_control); -private _veh = GETMVAR(BIS_fnc_initCuratorAttributes_target,objnull); +private _veh = GETMVAR(BIS_fnc_initCuratorAttributes_target,objNull); TRACE_1("",_veh); private _loaded = _veh getVariable [QEGVAR(cargo,loaded), []]; diff --git a/addons/zeus/functions/fnc_ui_attributePosition.sqf b/addons/zeus/functions/fnc_ui_attributePosition.sqf index 95557a891b..e0396e2c03 100644 --- a/addons/zeus/functions/fnc_ui_attributePosition.sqf +++ b/addons/zeus/functions/fnc_ui_attributePosition.sqf @@ -6,19 +6,20 @@ * 0: position controls group * * Return Value: - * None + * None + * + * Example: + * [CONTROL] call ace_zeus_fnc_ui_attributePosition * * Public: No */ #include "script_component.hpp" -disableSerialization; - //Generic Init: params ["_control"]; private _display = ctrlParent _control; -private _logic = GETMVAR(BIS_fnc_initCuratorAttributes_target,objnull); +private _logic = GETMVAR(BIS_fnc_initCuratorAttributes_target,objNull); _control ctrlRemoveAllEventHandlers "setFocus"; diff --git a/addons/zeus/functions/fnc_ui_attributeRadius.sqf b/addons/zeus/functions/fnc_ui_attributeRadius.sqf index c26f8ac97d..3c4d296f91 100644 --- a/addons/zeus/functions/fnc_ui_attributeRadius.sqf +++ b/addons/zeus/functions/fnc_ui_attributeRadius.sqf @@ -6,15 +6,16 @@ * 0: radius controls group * * Return Value: - * None + * None + * + * Example: + * [CONTROL] call ace_zeus_fnc_ui_attributeRadius * * Public: No */ #include "script_component.hpp" -disableSerialization; - //Generic Init: params ["_control"]; private _display = ctrlParent _control; diff --git a/addons/zeus/functions/fnc_ui_defendArea.sqf b/addons/zeus/functions/fnc_ui_defendArea.sqf index 6fcb4a17d5..13de25c2fa 100644 --- a/addons/zeus/functions/fnc_ui_defendArea.sqf +++ b/addons/zeus/functions/fnc_ui_defendArea.sqf @@ -6,19 +6,20 @@ * 0: dummy controls group * * Return Value: - * None + * None + * + * Example: + * [CONTROL] call ace_zeus_fnc_ui_defendArea * * Public: No */ #include "script_component.hpp" -disableSerialization; - //Generic Init: params ["_control"]; private _display = ctrlParent _control; -private _logic = GETMVAR(BIS_fnc_initCuratorAttributes_target,objnull); +private _logic = GETMVAR(BIS_fnc_initCuratorAttributes_target,objNull); _control ctrlRemoveAllEventHandlers "setFocus"; @@ -30,7 +31,7 @@ private _fnc_errorAndClose = { params ["_msg"]; _display closeDisplay 0; deleteVehicle _logic; - [_msg] call EFUNC(common,displayTextStructured); + [_msg] call FUNC(showMessage); breakOut "Main"; }; diff --git a/addons/zeus/functions/fnc_ui_editableObjects.sqf b/addons/zeus/functions/fnc_ui_editableObjects.sqf new file mode 100644 index 0000000000..8cb243849e --- /dev/null +++ b/addons/zeus/functions/fnc_ui_editableObjects.sqf @@ -0,0 +1,68 @@ +/* + * Author: Fisher, SilentSpike + * Updated all/local curator with objects in the module radius. + * + * Arguments: + * 0: editableObjects controls group + * + * Return Value: + * None + * + * Example: + * [CONTROL] call ace_zeus_fnc_ui_editableObjects + * + * Public: No + */ + +#include "script_component.hpp" + +params ["_control"]; + +//Generic Init: +private _display = ctrlParent _control; +private _ctrlButtonOK = _display displayCtrl 1; //IDC_OK +private _logic = GETMVAR(BIS_fnc_initCuratorAttributes_target,objNull); +TRACE_1("logicObject",_logic); + +_control ctrlRemoveAllEventHandlers "setFocus"; + +//Specific on-load stuff: +(_display displayCtrl 16188) cbSetChecked true; + +private _fnc_onUnload = { + private _logic = GETMVAR(BIS_fnc_initCuratorAttributes_target,objNull); + if (isNull _logic) exitWith {}; + + if (_this select 1 == 2) then { + deleteVehicle _logic; + }; +}; + +private _fnc_onConfirm = { + params [["_ctrlButtonOK", controlNull, [controlNull]]]; + + private _display = ctrlParent _ctrlButtonOK; + if (isNull _display) exitWith {}; + + private _logic = GETMVAR(BIS_fnc_initCuratorAttributes_target,objNull); + if (isNull _logic) exitWith {}; + + private _radius = GETVAR(_display,GVAR(radius),50); + private _position = GETVAR(_display,GVAR(position),getPos _logic); + private _allCurators = cbChecked (_display displayCtrl 16188); + private _removeObjects = cbChecked (_display displayCtrl 16189); + + private _objects = nearestObjects [_position, ["All"], _radius]; + private _localCurator = [getAssignedCuratorLogic player, objNull] select _allCurators; + + if (_removeObjects) then { + [QGVAR(removeObjects), [_objects, _localCurator]] call CBA_fnc_serverEvent; + } else { + [QGVAR(addObjects), [_objects, _localCurator]] call CBA_fnc_serverEvent; + }; + + deleteVehicle _logic; +}; + +_display displayAddEventHandler ["unload", _fnc_onUnload]; +_ctrlButtonOK ctrlAddEventHandler ["buttonClick", _fnc_onConfirm]; diff --git a/addons/zeus/functions/fnc_ui_garrison.sqf b/addons/zeus/functions/fnc_ui_garrison.sqf new file mode 100644 index 0000000000..cc5087de65 --- /dev/null +++ b/addons/zeus/functions/fnc_ui_garrison.sqf @@ -0,0 +1,104 @@ +/* + * Author: alganthe + * Initalises the "Garrison" zeus module display. + * + * Arguments: + * 0: Garrison controls group + * + * Return Value: + * None + * + * Example: + * onSetFocus = "_this call ace_zeus_fnc_ui_garrison" + * + * Public: No +*/ + +#include "script_component.hpp" + +disableSerialization; + +params ["_control"]; + +//Generic Init: +private _display = ctrlparent _control; +private _ctrlButtonOK = _display displayctrl 1; //IDC_OK +private _logic = GETMVAR(BIS_fnc_initCuratorAttributes_target,objnull); +TRACE_1("logicObject",_logic); + +_control ctrlRemoveAllEventHandlers "setFocus"; + +// Handles errors +private _unit = effectiveCommander (attachedTo _logic); + +scopeName "Main"; +private _fnc_errorAndClose = { + params ["_msg"]; + _display closeDisplay 0; + deleteVehicle _logic; + [_msg] call FUNC(showMessage); + breakOut "Main"; +}; + +switch (false) do { + case !(isNull _unit): { + [LSTRING(NothingSelected)] call _fnc_errorAndClose; + }; + case (_unit isKindOf "CAManBase"): { + [LSTRING(OnlyInfantry)] call _fnc_errorAndClose; + }; + case (alive _unit): { + [LSTRING(OnlyAlive)] call _fnc_errorAndClose; + }; + case !(isPlayer _unit): { + ["str_a3_cfgvehicles_moduleremotecontrol_f_errorPlayer"] call _fnc_errorAndClose; + }; +}; + +//Specific on-load stuff: +private _listbox = _display displayCtrl 73063; +{ + _listbox lbSetValue [_listbox lbAdd (_x select 0), _x select 1]; +} forEach [ + [localize LSTRING(ModuleGarrison_FillingModeEven), 0], + [localize LSTRING(ModuleGarrison_FillingModeBuilding), 1], + [localize LSTRING(ModuleGarrison_FillingModeRandom), 2] +]; + +_listbox lbSetCurSel 0; + +//Specific on-load stuff: +(_display displayCtrl 73061) cbSetChecked (_logic getVariable ["TopDownFilling",false]); +(_display displayCtrl 73062) cbSetChecked (_logic getVariable ["Teleport",false]); + +private _fnc_onUnload = { + params ["_display"]; + + private _logic = GETMVAR(BIS_fnc_initCuratorAttributes_target,objnull); + if (isNull _logic) exitWith {}; + + deleteVehicle _logic; +}; + +private _fnc_onConfirm = { + params [["_ctrlButtonOK", controlNull, [controlNull]]]; + + private _display = ctrlparent _ctrlButtonOK; + if (isNull _display) exitWith {}; + + private _logic = GETMVAR(BIS_fnc_initCuratorAttributes_target,objnull); + if (isNull _logic) exitWith {}; + + private _lb = _display displayCtrl 73063; + + private _radius = GETVAR(_display,GVAR(radius),50); + private _position = GETVAR(_display,GVAR(position),getPos _logic); + private _mode = _lb lbValue (lbCurSel _lb); + private _TopDownFilling = cbChecked (_display displayCtrl 73061); + private _teleport = cbChecked (_display displayCtrl 73062); + + [_logic, _position ,_radius, _mode, _TopDownFilling, _teleport] call FUNC(moduleGarrison); +}; + +_display displayAddEventHandler ["unload", _fnc_onUnload]; +_ctrlButtonOK ctrlAddEventHandler ["buttonclick", _fnc_onConfirm]; diff --git a/addons/zeus/functions/fnc_ui_globalSetSkill.sqf b/addons/zeus/functions/fnc_ui_globalSetSkill.sqf index 8dcac19bce..edca781152 100644 --- a/addons/zeus/functions/fnc_ui_globalSetSkill.sqf +++ b/addons/zeus/functions/fnc_ui_globalSetSkill.sqf @@ -6,25 +6,23 @@ * 0: globalSetSkill controls group * * Return Value: - * None + * None * * Example: - * onSetFocus = "_this call ace_zeus_fnc_ui_globalSetSkill" + * [CONTROL] call ace_zeus_fnc_ui_globalSetSkill * * Public: No */ #include "script_component.hpp" -disableSerialization; - params ["_control"]; TRACE_1("params",_control); //Generic Init: -private _display = ctrlparent _control; -private _ctrlButtonOK = _display displayctrl 1; //IDC_OK -private _logic = GETMVAR(BIS_fnc_initCuratorAttributes_target,objnull); +private _display = ctrlParent _control; +private _ctrlButtonOK = _display displayCtrl 1; //IDC_OK +private _logic = GETMVAR(BIS_fnc_initCuratorAttributes_target,objNull); TRACE_1("logicObject",_logic); _control ctrlRemoveAllEventHandlers "setFocus"; diff --git a/addons/zeus/functions/fnc_ui_groupSide.sqf b/addons/zeus/functions/fnc_ui_groupSide.sqf index be3298c8da..90de9d06ca 100644 --- a/addons/zeus/functions/fnc_ui_groupSide.sqf +++ b/addons/zeus/functions/fnc_ui_groupSide.sqf @@ -6,10 +6,10 @@ * 0: groupSide controls group * * Return Value: - * NONE + * None * * Example: - * onSetFocus = "_this call ace_zeus_fnc_ui_groupSide" + * [CONTROL] call ace_zeus_fnc_ui_groupSide * * Public: No */ @@ -17,14 +17,12 @@ #include "script_component.hpp" #define IDCs [31201,31200,31202,31203] -disableSerialization; - params ["_control"]; //Generic Init: -private _display = ctrlparent _control; -private _ctrlButtonOK = _display displayctrl 1; //IDC_OK -private _logic = GETMVAR(BIS_fnc_initCuratorAttributes_target,objnull); +private _display = ctrlParent _control; +private _ctrlButtonOK = _display displayCtrl 1; //IDC_OK +private _logic = GETMVAR(BIS_fnc_initCuratorAttributes_target,objNull); TRACE_1("logicObject",_logic); _control ctrlRemoveAllEventHandlers "setFocus"; @@ -38,7 +36,7 @@ private _fnc_errorAndClose = { params ["_msg"]; _display closeDisplay 0; deleteVehicle _logic; - [_msg] call EFUNC(common,displayTextStructured); + [_msg] call FUNC(showMessage); breakOut "Main"; }; diff --git a/addons/zeus/functions/fnc_ui_patrolArea.sqf b/addons/zeus/functions/fnc_ui_patrolArea.sqf index d4fbc092a0..c026bbce6a 100644 --- a/addons/zeus/functions/fnc_ui_patrolArea.sqf +++ b/addons/zeus/functions/fnc_ui_patrolArea.sqf @@ -6,19 +6,20 @@ * 0: dummy controls group * * Return Value: - * None + * None + * + * Example: + * [CONTROL] call ace_zeus_fnc_ui_patrolArea * * Public: No */ #include "script_component.hpp" -disableSerialization; - //Generic Init: params ["_control"]; private _display = ctrlParent _control; -private _logic = GETMVAR(BIS_fnc_initCuratorAttributes_target,objnull); +private _logic = GETMVAR(BIS_fnc_initCuratorAttributes_target,objNull); _control ctrlRemoveAllEventHandlers "setFocus"; @@ -30,7 +31,7 @@ private _fnc_errorAndClose = { params ["_msg"]; _display closeDisplay 0; deleteVehicle _logic; - [_msg] call EFUNC(common,displayTextStructured); + [_msg] call FUNC(showMessage); breakOut "Main"; }; diff --git a/addons/zeus/functions/fnc_ui_searchArea.sqf b/addons/zeus/functions/fnc_ui_searchArea.sqf index 3da147b963..06393ca578 100644 --- a/addons/zeus/functions/fnc_ui_searchArea.sqf +++ b/addons/zeus/functions/fnc_ui_searchArea.sqf @@ -6,19 +6,20 @@ * 0: dummy controls group * * Return Value: - * None + * None + * + * Example: + * [CONTROL] call ace_zeus_fnc_ui_searchArea * * Public: No */ #include "script_component.hpp" -disableSerialization; - //Generic Init: params ["_control"]; private _display = ctrlParent _control; -private _logic = GETMVAR(BIS_fnc_initCuratorAttributes_target,objnull); +private _logic = GETMVAR(BIS_fnc_initCuratorAttributes_target,objNull); _control ctrlRemoveAllEventHandlers "setFocus"; @@ -30,7 +31,7 @@ private _fnc_errorAndClose = { params ["_msg"]; _display closeDisplay 0; deleteVehicle _logic; - [_msg] call EFUNC(common,displayTextStructured); + [_msg] call FUNC(showMessage); breakOut "Main"; }; diff --git a/addons/zeus/functions/fnc_ui_teleportPlayers.sqf b/addons/zeus/functions/fnc_ui_teleportPlayers.sqf index bdcd8ae93f..d323a9a467 100644 --- a/addons/zeus/functions/fnc_ui_teleportPlayers.sqf +++ b/addons/zeus/functions/fnc_ui_teleportPlayers.sqf @@ -6,24 +6,22 @@ * 0: teleportPlayers controls group * * Return Value: - * NONE + * None * * Example: - * onSetFocus = "_this call ace_zeus_fnc_ui_teleportPlayers" + * [CONTROL] call ace_zeus_fnc_ui_teleportPlayers * * Public: No */ #include "script_component.hpp" -disableSerialization; - params ["_control"]; //Generic Init: -private _display = ctrlparent _control; -private _ctrlButtonOK = _display displayctrl 1; //IDC_OK -private _logic = GETMVAR(BIS_fnc_initCuratorAttributes_target,objnull); +private _display = ctrlParent _control; +private _ctrlButtonOK = _display displayCtrl 1; //IDC_OK +private _logic = GETMVAR(BIS_fnc_initCuratorAttributes_target,objNull); TRACE_1("logicObject",_logic); _control ctrlRemoveAllEventHandlers "setFocus"; @@ -34,7 +32,7 @@ private _listbox = _display displayCtrl 16189; if (alive _x) then { _listbox lbSetData [_listbox lbAdd (name _x), getPlayerUID _x]; }; -} forEach allPlayers; +} forEach ([] call CBA_fnc_players); _listbox lbSetCurSel 0; (_display displayCtrl 16188) cbSetChecked (_logic getVariable ["tpGroup",false]); diff --git a/addons/zeus/functions/fnc_ui_toggleFlashlight.sqf b/addons/zeus/functions/fnc_ui_toggleFlashlight.sqf new file mode 100644 index 0000000000..3085271dfa --- /dev/null +++ b/addons/zeus/functions/fnc_ui_toggleFlashlight.sqf @@ -0,0 +1,144 @@ +/* + * Author: alganthe + * Initalises the `Toggle Flashlights` zeus module display + * + * Arguments: + * 0: Flashlight toggle controls group + * + * Return Value: + * None + * + * Example: + * onSetFocus = "_this call ace_zeus_fnc_ui_toggleFLashlight" + * + * Public: No +*/ + +#include "script_component.hpp" + +disableSerialization; + +params ["_control"]; + +//Generic Init: +private _display = ctrlparent _control; +private _ctrlButtonOK = _display displayctrl 1; //IDC_OK +private _logic = GETMVAR(BIS_fnc_initCuratorAttributes_target,objnull); +TRACE_1("logicObject",_logic); + +_control ctrlRemoveAllEventHandlers "setFocus"; + +private _unit = effectiveCommander (attachedTo _logic); + +// Handles errors +scopeName "Main"; +private _fnc_errorAndClose = { + params ["_msg"]; + _display closeDisplay 0; + deleteVehicle _logic; + [_msg] call FUNC(showMessage); + breakOut "Main"; +}; + +if !(isNull _unit) then { + switch (false) do { + case (_unit isKindOf "CAManBase"): { + [LSTRING(OnlyInfantry)] call _fnc_errorAndClose; + }; + case (alive _unit): { + [LSTRING(OnlyAlive)] call _fnc_errorAndClose; + }; + }; +}; + +//Specific on-load stuff: +private _comboBox = _display displayCtrl 56218; +private _comboBox2 = _display displayCtrl 56219; +private _comboBox3 = _display displayCtrl 56220; + +{ + _comboBox lbSetValue [_comboBox lbAdd (_x select 0), _x select 1]; +} forEach [ + [localize ELSTRING(common,Disabled), 0], + [localize ELSTRING(common,Enabled), 1] +]; + +if (isNull _unit) then { + { + _comboBox2 lbSetValue [_comboBox2 lbAdd (_x select 0), _x select 1]; + } forEach [ + ["BLUFOR", 0], + ["OPFOR", 1], + ["INDEP", 2], + ["CIV", 3] + ]; +} else { + { + _comboBox2 lbSetValue [_comboBox2 lbAdd (_x select 0), _x select 1]; + } forEach [ + [localize LSTRING(moduleToggleNVG_SelectedGroup), 4], + ["BLUFOR", 0], + ["OPFOR", 1], + ["INDEP", 2], + ["CIV", 3] + ]; +}; + +{ + _comboBox3 lbSetValue [_comboBox3 lbAdd (_x select 0), _x select 1]; +} foreach [ + [localize ELSTRING(common,Disabled), 0], + [localize ELSTRING(common,Enabled), 1] +]; + + +private _enabledDefault = false; +if (!isNull _unit) then { + _enabledDefault = _unit isFlashlightOn (currentWeapon _unit); +}; +_comboBox lbSetCurSel ([0,1] select _enabledDefault); +_comboBox2 lbSetCurSel 0; +_comboBox3 lbSetCurSel 0; + +private _fnc_onUnload = { + params ["_display"]; + + private _logic = GETMVAR(BIS_fnc_initCuratorAttributes_target,objnull); + if (isNull _logic) exitWith {}; + + deleteVehicle _logic; +}; + +private _fnc_onConfirm = { + params [["_ctrlButtonOK", controlNull, [controlNull]]]; + + private _display = ctrlparent _ctrlButtonOK; + if (isNull _display) exitWith {}; + + private _logic = GETMVAR(BIS_fnc_initCuratorAttributes_target,objnull); + if (isNull _logic) exitWith {}; + + private _combo1 = _display displayCtrl 56218; + private _combo2 = _display displayCtrl 56219; + private _combo3 = _display displayCtrl 56220; + + private _toggle = _combo1 lbValue (lbCurSel _combo1); + private _target = _combo2 lbValue (lbCurSel _combo2); + private _gear = _combo3 lbValue (lbCurSel _combo3); + + + _toggle = [ + false, + true + ] select (_toggle == 1); + + _gear = [ + false, + true + ] select (_gear == 1); + + [_logic, _toggle, _gear, _target] call FUNC(moduleToggleFlashlight); +}; + +_display displayAddEventHandler ["unload", _fnc_onUnload]; +_ctrlButtonOK ctrlAddEventHandler ["buttonclick", _fnc_onConfirm]; diff --git a/addons/zeus/functions/fnc_ui_toggleNvg.sqf b/addons/zeus/functions/fnc_ui_toggleNvg.sqf new file mode 100644 index 0000000000..10ed14aa0e --- /dev/null +++ b/addons/zeus/functions/fnc_ui_toggleNvg.sqf @@ -0,0 +1,127 @@ +/* + * Author: alganthe + * Initalises the `Toggle NVGs` zeus module display + * + * Arguments: + * 0: Nvg toggle controls group + * + * Return Value: + * None + * + * Example: + * onSetFocus = "_this call ace_zeus_fnc_ui_toggleNvg" + * + * Public: No +*/ + +#include "script_component.hpp" + +disableSerialization; + +params ["_control"]; + +//Generic Init: +private _display = ctrlparent _control; +private _ctrlButtonOK = _display displayctrl 1; //IDC_OK +private _logic = GETMVAR(BIS_fnc_initCuratorAttributes_target,objnull); +TRACE_1("logicObject",_logic); + +_control ctrlRemoveAllEventHandlers "setFocus"; + +private _unit = effectiveCommander (attachedTo _logic); + +// Handles errors +scopeName "Main"; +private _fnc_errorAndClose = { + params ["_msg"]; + _display closeDisplay 0; + deleteVehicle _logic; + [_msg] call FUNC(showMessage); + breakOut "Main"; +}; + +if !(isNull _unit) then { + switch (false) do { + case (_unit isKindOf "CAManBase"): { + [LSTRING(OnlyInfantry)] call _fnc_errorAndClose; + }; + case (alive _unit): { + [LSTRING(OnlyAlive)] call _fnc_errorAndClose; + }; + }; +}; + +//Specific on-load stuff: +private _comboBox = _display displayCtrl 92855; +private _comboBox2 = _display displayCtrl 92856; + +{ + _comboBox lbSetValue [_comboBox lbAdd (_x select 0), _x select 1]; +} forEach [ + [localize ELSTRING(common,Disabled), 0], + [localize ELSTRING(common,Enabled), 1] +]; + +if (isNull _unit) then { + { + _comboBox2 lbSetValue [_comboBox2 lbAdd (_x select 0), _x select 1]; + } forEach [ + ["BLUFOR", 0], + ["OPFOR", 1], + ["INDEP", 2], + ["CIV", 3] + ]; +} else { + { + _comboBox2 lbSetValue [_comboBox2 lbAdd (_x select 0), _x select 1]; + } forEach [ + [localize LSTRING(moduleToggleNVG_SelectedGroup), 4], + ["BLUFOR", 0], + ["OPFOR", 1], + ["INDEP", 2], + ["CIV", 3] + ]; +}; + + +private _enabledDefault = false; +if (!isNull _unit) then { + _enabledDefault = !(hmd _unit isEqualTo ""); +}; +_comboBox lbSetCurSel ([0,1] select _enabledDefault); +_comboBox2 lbSetCurSel 0; + +private _fnc_onUnload = { + params ["_display"]; + + private _logic = GETMVAR(BIS_fnc_initCuratorAttributes_target,objnull); + if (isNull _logic) exitWith {}; + + deleteVehicle _logic; +}; + +private _fnc_onConfirm = { + params [["_ctrlButtonOK", controlNull, [controlNull]]]; + + private _display = ctrlparent _ctrlButtonOK; + if (isNull _display) exitWith {}; + + private _logic = GETMVAR(BIS_fnc_initCuratorAttributes_target,objnull); + if (isNull _logic) exitWith {}; + + private _combo1 = _display displayCtrl 92855; + private _combo2 = _display displayCtrl 92856; + + private _toggle = _combo1 lbValue (lbCurSel _combo1); + private _target = _combo2 lbValue (lbCurSel _combo2); + + private _toggle = [ + false, + true + ] select (_toggle == 1); + + [_logic, _toggle, _target] call FUNC(moduleToggleNvg); +}; + +_display displayAddEventHandler ["unload", _fnc_onUnload]; +_ctrlButtonOK ctrlAddEventHandler ["buttonclick", _fnc_onConfirm]; diff --git a/addons/zeus/functions/fnc_zeusAttributes.sqf b/addons/zeus/functions/fnc_zeusAttributes.sqf index dcbef69510..5481120cd3 100644 --- a/addons/zeus/functions/fnc_zeusAttributes.sqf +++ b/addons/zeus/functions/fnc_zeusAttributes.sqf @@ -9,7 +9,7 @@ * 2: Display class name * * Return Value: - * None + * None * * Example: * onLoad = "['onLoad',_this,'RscDisplayExample'] call ace_zeus_fnc_zeusAttributes" diff --git a/addons/zeus/stringtable.xml b/addons/zeus/stringtable.xml index 6a6f75a450..ddae08d623 100644 --- a/addons/zeus/stringtable.xml +++ b/addons/zeus/stringtable.xml @@ -13,6 +13,9 @@ Настройки Зевса Impostazioni Zeus Zeus 設定 + Zeus 설정 + 宙斯设定 + 宙斯設定 Provides control over various aspects of Zeus. @@ -21,15 +24,18 @@ Poskytuje kontrolu na různými aspekty Zeuse. Bietet die Steuerung verschiedener Zeus-Optionen an. Proporciona controle sobre diversos aspectos do Zeus. - Fourni le contrôle des différents aspects de Zeus + Fourni le contrôle des différents aspects de Zeus. Különböző beállítási lehetőségeket biztosít a Zeus részeihez. Позволяет контролировать различные аспекты Зевса. Fornisce controllo su vari aspetti di Zeus. - Zeus のさまざまな側面を強化します。 + Zeus の操作性をさまざまな側面から強化します。 + Zeus에게 다양한 방면의 조작을 제공해줍니다 + 提供宙斯各个方面的控制权 + 提供宙斯各個方面的控制權 Ascension Messages - Wiad. o nowym Zeusie + Wiadomość o nowym Zeusie Mensajes de ascensión Zpráva o novém Zeusovi Aufstiegsnachrichten @@ -39,6 +45,9 @@ Сообщения о вознесении Messaggi di Ascesa 転生表示 + 재림 메세지 + 宙斯上任讯息 + 宙斯上任訊息 Display global popup messages when a player is assigned as Zeus. @@ -47,11 +56,14 @@ Zobrazit globální zprávu když je hráč přiřazen jako Zeus. Zeige globale Popup-Nachrichten wenn ein Spieler zu Zeus wird. Mostra uma mensagem popup quando um jogador é atribuido ao Zeus. - Affiche un message global quand un joueur est assigné en tant que Zeus + Affiche un message global quand un joueur est assigné en tant que Zeus. Globális üzeneteket jelez ki, ha egy játékos Zeus-nak lesz beosztva. Отображает глобальное всплывающее сообщение, когда один из игроков становится Зевсом. Mostra messaggi popup globali quando un giocatore viene assegnato come Zeus. プレイヤーが Zeus になるとき、全体へポップアップ表示をおこないます。 + 플레이어가 Zeus 될 시 서버에 이를 알리는 팝업이 등장합니다. + 当一位玩家被指定为宙斯时显示全域讯息 + 當一位玩家被指定為宙斯時顯示全域訊息 Zeus Eagle @@ -65,6 +77,9 @@ Орел Зевса Aquila Zeus Zeus イーグル + Zeus 독수리 + 宙斯鹰眼模式 + 宙斯鷹眼模式 Spawn an eagle that follows the Zeus camera. @@ -78,6 +93,9 @@ Спавнит орла, который следует за камерой Зевса. Crea un'aquila che segue la camera Zeus. Zeus カメラを追うイーグルを出現します。 + Zeus의 카메라를 따라다니는 독수리를 생성합니다. + 生成一个老鹰跟着宙斯的摄影机 + 生成一個老鷹跟著宙斯的攝影機 Wind Sounds @@ -91,6 +109,9 @@ Звук ветра Suoni del Vento 風の音 + 바람 소리 + 风声 + 風聲 Play wind sounds when Zeus remote controls a unit. @@ -99,15 +120,18 @@ Přehrát varování (vítr) když Zeus převezmě kontrolu nad jednotkou. Spiele Windgeräusche ab, wenn Zeus eine Einheit steuert. Reproduz sons de vento quando uma unidade é remotamente controlada pelo Zeus. - Joue des bruits de vent quand Zeus controle une unité + Joue des bruits de vent quand Zeus controle une unité. Szélhangokat játszik le, ha a Zeus távvezérel egy egységet. Проигрывает звук ветра каждый раз, когда Зевс вселяется в юнита. Esegui rumori di vento quando Zeus controlla un'unità in remoto. ユニットが Zeus 遠隔操作になったとき、風の音がします。 + Zeus가 유닛을 조작할 때 바람소리가 납니다. + 当宙斯开始控制单位时利用风的声音提示 + 當宙斯開始控制單位時利用風的聲音提示 Ordnance Warning - Ostrz. o ostrzale arty. + Ostrzeżenie o ostrzale artyleryjskim Advertencia de artefactos explosivos Varování před dělostřelectvem Artilleriewarnung @@ -117,6 +141,9 @@ Предупреждение об арте Allarme Esplosivi 砲撃の警告 + 폭격 경고 + 武装警告 + 武裝警告 Play a radio warning when Zeus uses ordnance. @@ -125,11 +152,14 @@ Přehrát varování (rádio) když Zeus použije dělostřelectvo. Spiele eine Radiowarnung ab, wenn Zeus Artillerie verwendet. Reproduz uma aviso via rádio quando o Zeus usa um explosivo. - Joue un son radio quand le Zeus utilise du matériel militaire + Joue un son radio quand le Zeus utilise du matériel militaire. Rádiós figyelmeztetés kiadása, ha a Zeus tüzérséget használ. Проигрывает звук радио каждый раз, когда Зевс использует артиллерию. - Esegui un messaggio radio quando Zeus usa esplosivi. + Riproduci un messaggio radio quando Zeus usa esplosivi. Zeus が砲撃をつかうときに、無線で警告を流します。 + Zeus가 폭격시 경고 무전을 재생합니다. + 当宙斯开始攻击时使用无线电警告 + 當宙斯開始攻擊時使用無線電警告 Reveal Mines @@ -143,6 +173,9 @@ Показывать мины Rivela Mine 地雷の表示 + 지뢰 표시 + 显示地雷 + 顯示地雷 Reveal mines to allies and place map markers. @@ -151,11 +184,14 @@ Odhalí miny pro spojence a umístnit jejich značku na mapu. Melde Minen gegenüber Verbündeten und platziere entsprechende Kartenmarkierungen. Revelar minas para aliados e colocar marcadores no mapa. - Révéler les mines et placer un marqueur sur la carte + Révéler les mines et placer un marqueur sur la carte. Feltárja az aknákat a szövetségeseknek, és jelölőket helyez el a térképen. Показывает мины союзникам и отмечает их маркерами на карте. Rivela mine ad alleati e piazza marcatori in mappa. 友軍に地雷と地図へ設置マーカーを表示します。 + 아군에게 지도 상의 모든 지뢰를 표시합니다. + 地图将标记队友放置的地雷 + 地圖將標記隊友放置的地雷 Reveal to Allies @@ -169,6 +205,9 @@ Показывать союзникам Rivela ad Alleati 友軍へ表示 + 모든 아군에게 표시 + 透露给盟军 + 透露給盟軍 Allies + Map Markers @@ -182,6 +221,9 @@ Союзники + Маркеры на карте Alleati + Marcatori Mappa 友軍と地図マーカー + 아군 + 지도 마커 + 显示盟军+地图标记 + 顯示盟軍+地圖標記 Toggle Captive @@ -193,8 +235,11 @@ Basculer en captif Elfogott állapot váltása Пленный (вкл./выкл.) - Apri Catturato - 捕虜としてトグル + Attivatore Prigioniero + 捕虜として切り替え + 포로 토글 + 切换俘虏 + 切換俘虜 Defend Area @@ -202,7 +247,67 @@ Защитить зону Bránit oblast 防衛範囲 - Osłaniaj obszar + Broń obszaru + Verteidige Gebiet + 지역 방어 + Difendi Area + 防御区域 + 防禦區域 + + + Update Editable Objects + Aktualisiere bearbeitbare Objekte + 編集可能なオブジェクトを更新 + Aktualizuj edytowalne obiekty + 수정 가능한 물체 갱신 + Màj les objets éditables + Aggiorna Oggetti Modificabili + 更新可编辑的物件 + 更新可編輯的物件 + + + All Curators + Alle Zeus' + 全キュレーター + 모든 큐레이터 + Wszyscy kuratorzy + Tous curateurs + Tutti i Moderatori + 所有编辑者 + 所有編輯者 + + + Apply changes to all curators + Änderungen bei allen Zeus' aktualisieren + 全キュレーターへ変更を適用 + 모든 큐레이터에 변화를 적용합니다 + Zatwierdź zmiany dla wszystkich kuratorów + Applique les changements à tous les curateurs + Applica i cambiamenti a tutti i moderatori + 确认变更给所有编辑者 + 確認變更給所有編輯者 + + + Remove Objects + Entferne Objekte + オブジェクトの削除 + 물체 삭제 + Usuń obiekty + Enlève les objets + Rimuovi Oggetti + 移除物件 + 移除物件 + + + Remove existing instead of adding new + Entfernt Bestehendes, statt Neues hinzuzufügen + 新しく追加するために削除します + 물체를 삭제합니다 + Usuń istniejące zamiast dodawać nowe + Enlève les objets existants au lieu d'en ajouter de nouveaux + Rimuove gli esistenti e li sostituisce con i nuovi + 移除已存在的物件来新增新的物件 + 移除已存在的物件來新增新的物件 Global AI Skill @@ -211,6 +316,11 @@ Globální zkušenosti AI 総合的な AI スキル Globalne umiejętności AI + Globale KI-Fähigkeit + 서버 인공지능 실력 + Abilità AI Globale + AI技巧设定 + AI技巧設定 General Skill @@ -219,14 +329,24 @@ Primární zkušenosti 総合スキル Ogólne umiejętności + Allgemeine Fähigkeit + 전반적 실력 + Abilità Generale + 总体技巧 + 總體技巧 Changes: general, commanding, courage Change: general, commanding, courage Изменяет: general, commanding, courage Upravuje: general, commanding, courage - 変更:general, commanding, courage + 変更: general, commanding, courage Zmienia: ogólne, dowodzenie, odwaga + Ändert: general, commanding, courage + 변화: 전반적, 지휘, 사기 + Cambia: generale, comando, + 改变: 战斗技巧,指挥技巧,勇气大小 + 改變: 戰鬥技巧,指揮技巧,勇氣大小 Accuracy @@ -235,14 +355,24 @@ Přesnost 精度 Precyzja + Genauigkeit + 명중률 + Precisione + 精确度 + 精確度 Changes: aimingAccuracy - Change: aimingAccuracy + Change : aimingAccuracy Изменяет: aimingAccuracy Upravuje: aimingAccuracy - 変更:aimingAccuracy + 変更: aimingAccuracy Zmienia: precyzję celowania + Ändert: aimingAccuracy + 변화: 조준 명중률 + Cambia: aimingAccuracy + 改变: 瞄准精确度 + 改變: 瞄準精確度 Weapon Handling @@ -251,46 +381,76 @@ Zacházení se zbraní 武器の扱い Obsługa broni + Waffenhandhabung + 무기 조작 + Uso dell'Arma + 武器掌握 + 武器掌握 Changes: aimingShake, aimingSpeed, reloadSpeed - Change: aimingShake, aimingSpeed, reloadSpeed + Change : aimingShake, aimingSpeed, reloadSpeed Изменяет: aimingShake, aimingSpeed, reloadSpeed Upravuje: aimingShake, aimingSpeed, reloadSpeed - 変更:aimingShake, aimingSpeed, reloadSpeed + 変更: aimingShake, aimingSpeed, reloadSpeed Zmienia: drżenie broni, szybkość celowania, szybkość przeładowania + Ändert: aimingShake, aimingSpeed, reloadSpeed + 변화: 조준시 흔들림, 조준 속도, 재장전 속도 + Cambia: aimingShake, aimingSpeed, reloadSpeed + 改变: 手晃幅度,瞄准速度, 重新装填速度 + 改變: 手晃幅度,瞄準速度, 重新裝填速度 Spotting - repérage + Repérage Обнаружение Vnímavost 索敵 Rozpoznanie + Aufklärung + 탐지 + Ricognizione + 索敌能力 + 索敵能力 Changes: spotDistance, spotTime - Change: spotDistance, spotTime + Change : spotDistance, spotTime Изменяет: spotDistance, spotTime Upravuje: spotDistance, spotTime - 変更:spotDistance, spotTime + 変更: spotDistance, spotTime Zmienia: zasięg rozpoznawania, czas rozpoznawania + Ändert: spotDistance, spotTime + 변화: 탐지 거리, 탐지까지의 시간 + Cambia: spotDistance, spotTime + 改变: 搜索距离, 发现时间 + 改變: 搜索距離, 發現時間 Seek Cover - Chercher couverture + Chercher des couvertures Поиск укрытий Vyhledávat krytí 遮蔽 Szukaj osłon + Deckungssuche + 엄폐물 찾기 + Cerca Copertura + 寻找掩护 + 尋找掩護 Should AI seek cover - L'IA devrait elle chercher couverture + L'IA devrait elle chercher des couvertures Должны ли боты искать укрытия AI se bude snažit vyhledávat krytí AI は遮蔽を取るようになります Czy AI powinno szukać osłon + Soll KI nach Deckung suchen + 인공지능이 엄폐물을 찾아갑니다 + Le AI dovrebbero cercare una copertura + 决定AI是否会寻找掩护 + 決定AI是否會尋找掩護 Auto Combat @@ -299,6 +459,11 @@ Automatický režim boje 自動戦闘 Auto walka + Automatischer Kampfmodus + 자동 교전 + Combattimento Automatico + 自动交战 + 自動交戰 Should AI automatically switch to combat mode @@ -307,6 +472,11 @@ AI se automaticky přepne do bojového režimu AI は自動的に戦闘状態へ切り替えます Czy AI powinno automatycznie przechodzić w tryb walki + Soll KI automatisch in Kampfmodus umschalten + 인공지능이 자동적으로 교전 상태에 돌입합니다 + Le AI dovrebbero passare in modalità di combattimento automaticamente + 决定AI是否会自动与敌人交战 + 決定AI是否會自動與敵人交戰 Group Side @@ -315,6 +485,11 @@ Strana skupiny グループ側 Strona grupy + Gruppenseite + 진영 측 + Fazione del Gruppo + 小队阵营 + 小隊陣營 Patrol Area @@ -323,6 +498,11 @@ Oblast hlídkování 哨戒範囲 Patrol obszaru + Patrouillengebiet + 정찰 구역 + Area di Pattugliamento + 巡逻区域 + 巡邏區域 Toggle Surrender @@ -334,8 +514,44 @@ Basculer en capitulation Kapituláló állapot váltása Сдавшийся (вкл./выкл.) - Apri Resa - 捕虜としてトグル + Attivatore Resa + 投降として切り替え + 항복 토글 + 切换投降 + 切換投降 + + + Add/Remove FRIES + FRIES Hinzufügen/Entfernen + FRIES の追加と削除 + 패스트로프 추가/제거 + Dodaj/usuń FRIES + Aj./Enlève FRIES + Aggiungi/Rimuovi FRIES + 增加/移除快速垂降进场撤离系统 + 增加/移除快速垂降進場撤離系統 + + + %1 is not fastrope compatible. + %1 ist nicht FRIES-kompatibel. + %1 はファストロープに対応していません。 + %1은 패스트로프하기에 적합하지 않습니다. + %1 nie jest kompatybilny ze zjazdem linowym. + %1 n'est pas compatible. + %1 non è compatibile con il fastrope. + %1无法使用快速绳降系统 + %1無法使用快速繩降系統 + + + Unable to remove FRIES, ropes are deployed. + FRIES kann nicht entfernt werden, noch in Benutzung + すでにロープが展開されているため、FRIES を削除できません。 + 패스트로프 제거 불가능, 줄이 이미 배치되었습니다. + Nie można usunąć FRIES, liny są wypuszczone. + Pas en mesure d'enlever le FRIES, les cordes ne sont pas déployées. + Impossibile rimuovere le FRIES, le corde sono ancora dispiegate + 无法移除快速绳降系统,因为绳索已被释放出来 + 無法移除快速繩降系統,因為繩索已被釋放出來 Teleport Players @@ -344,6 +560,11 @@ Teleportovat hráče プレイヤーを移動 Teleportuj graczy + Spieler teleportieren + 플레이어 순간이동 + Teletrasporta Giocatori + 传送玩家 + 傳送玩家 Player @@ -352,14 +573,24 @@ Hráč プレイヤー Gracz + Spieler + 플레이어 + Giocatore + 玩家 + 玩家 Teleport selected player to module position Téléporter le joueur sélectionné à la position du module Телепортирует выбранного игрока к местоположению модуля Teleportuje vybraného hráče na pozici modulu - 選択したプレイヤーをプレイヤーをモジュール位置へ移動します + 選択したプレイヤーをモジュール位置へ移動します Teleportuje wybranego gracza na pozycję modułu + Teleportiert ausgewählten Spieler zur Position des Moduls + 모듈의 위치로 플레이어 순간이동 + Teletrasporta il giocatore selezionato nella posizione del modulo + 传送选定的玩家至模块位置 + 傳送選定的玩家至模塊位置 Teleport Group @@ -368,6 +599,11 @@ Teleportovat skupinu グループを移動 Teleport grupy + Gruppe teleportieren + 그룹 순간이동 + Teletrasporta Gruppo + 传送小队 + 傳送小隊 Teleports all units in group @@ -376,6 +612,11 @@ Teleportuje všechny jednotky ve skupině グループ内の全ユニットを移動させます Teleportuje wszystkie jednostki w grupie + Teleportiert alle Einheiten der Gruppe + 그룹내에 모든 인원을 순간이동 시킵니다 + Teletrasporta tutte le unità del gruppo + 传送全部小队成员 + 傳送全部小隊成員 Toggle Unconscious @@ -387,8 +628,11 @@ Basculer en inconscient Eszméletlen állapot váltása Без сознания (вкл./выкл.) - Apri Incosciente - 気絶をトグル + Attivatore Incoscienza + 気絶を切り替え + 기절 토글 + 切换昏迷 + 切換昏迷 Search Area @@ -397,14 +641,24 @@ Prohledat oblast 捜索範囲 Przeszukaj teren + Durchsuche Gebiet + 지역 수색 + Area di Ricerca + 搜索区域 + 搜索區域 Search Nearby Building Chercher le bâtiment proche Обыскать ближайшие здания Prohledat nejbližší budovu - 近くの建物を創作します + 近くの建物を捜索します Przeszukaj najbliższy budynek + Durchsuche nahegelegenes Gebäude + 근처 건물 수색 + Cerca Edifici nelle Vicinanze + 搜索附近的建筑物 + 搜索附近的建築物 Assign Medic @@ -417,6 +671,9 @@ Assegna Medico Assigner médecin 衛生兵に割り当て + 의무병 임명 + 指定医疗兵 + 指定醫療兵 Assign Medical Vehicle @@ -429,6 +686,9 @@ Assegna Veicolo Medico Assigner véhicule médical 医療車両として割り当て + 의무 차량 임명 + 指定医疗载具 + 指定醫療載具 Assign Medical Facility @@ -441,6 +701,20 @@ Assegna Struttura Medica Assigner installation médicale 医療施設として割り当て + 의무 시설 임명 + 指定医疗设施 + 指定醫療設施 + + + Toggle Simulation + Ändere Simulation + Przełącz symulację + シミュレーションを切り替え + 재현 토글 + Bascule Simulation + Attivatore Simulazione + 切换模拟 + 切換模擬 Add Spare Wheel @@ -453,6 +727,9 @@ Agregar rueda de auxilio Ajouter pièce de rechange 予備タイヤを追加 + 예비 바퀴 추가 + 增加备用轮胎 + 增加備用輪胎 Add Spare Track @@ -465,6 +742,9 @@ Agregar oruga de repuesto Ajouter une chenille de secours 車両へ予備タイヤを追加します。 + 예비 궤도 추가 + 增加备用履带 + 增加備用履帶 Unit must be alive @@ -478,6 +758,9 @@ Si può fare solo su persone vive Usar somente em unidades vivas ユニットを生存させます + 대상이 반드시 살아있어야 합니다 + 单位必须是活着 + 單位必須是活著 Unit must be infantry @@ -491,6 +774,9 @@ Si può usare solo su fanteria a piedi Usar somente em infantaria desmontada ユニットを歩兵にさせます + 대상이 반드시 보병이어야 합니다 + 单位必须是步兵 + 單位必須是步兵 Unit must be a structure @@ -503,6 +789,9 @@ Si può usare solo su strutture L'unité doit être une structure ユニットを構造物とします + 대상이 반드시 건축물이어야만 합니다 + 单位必须是建筑 + 單位必須是建築 Unit must be a vehicle @@ -515,6 +804,9 @@ Si può usare solo su veicoli L'unité doit être un véhicule ユニットを車両とします + 대상이 반드시 차량이어야만 합니다 + 单位必须是载具 + 單位必須是載具 Unit must be a vehicle with cargo space @@ -527,6 +819,9 @@ La unidad debe ser un vehículo con espacio de carga L'unité doit être un véhicule avec de l'espace de cargaison ユニットをカーゴ スペースがある車両にします + 대상이 반드시 화물을 실을 수 있는 차량이어야 합니다 + 单位必须是载具且有载货空间 + 單位必須是載具且有載貨空間 Unit must have cargo space left @@ -539,6 +834,9 @@ La unidad debe tener espacio de carga disponible L'unité doit avoir de l'espace libre en cargaison ユニットへカーゴ スペースを与えます + 대상의 화물공간이 남아있어야합니다 + 单位必须有剩余的载货空间 + 單位必須有剩餘的載貨空間 Unit must not be captive @@ -552,6 +850,9 @@ Юнит не должен быть пленным L'unità non dev'essere un prigioniero ユニットを捕虜にさせません + 대상이 포로면 안됩니다 + 单位不能被俘虏 + 單位不能被俘虜 Unit must belong to an appropriate side @@ -560,6 +861,11 @@ Jednotka musí patřit k příslušné straně ユニットを適切な陣営にします Jednostka musi należeć do odpowiedniej strony + Einheit muss einer passenden Seite angehören + 대상이 적절한 진영에 속해야만합니다 + L'unità deve appartenere ad una fazione coerente + 单位必须属于一个合适的一边 + 單位必須屬於一個合適的一邊 Nearest building is too far away @@ -568,6 +874,11 @@ Nejbližší budova je příliš daleko 近くに建物がありません。 Najbliższy budynek jest zbyt daleko + Nächstgelegenes Gebäude ist zu weit entfernt + 가장가까운 건물이 너무 멈 + L'edificio più vicino è troppo lontano + 最近的房子离太远了 + 最近的房子離太遠了 Place on a unit @@ -581,6 +892,9 @@ Semmi sincs az egér alatt Piazza su una unità ユニットの上に設置 + 대상에 배치하기 + 放置在一个单位上 + 放置在一個單位上 Requires an addon that is not present @@ -594,6 +908,9 @@ Требуется аддон, который отсутствует Richiede un addon che non è presente 要求されたアドオンは存在していません + 需要一个不存在的插件 + 需要一個不存在的插件 + 현재 없는 애드온을 필요로 합니다 Add Objects to Curator @@ -606,6 +923,9 @@ Ajouter des objets au curateur (Zeus) Fügt Objekte zum Kurator hinzu キュレーターにオブジェクトを追加 + 큐레이터에 물체 추가 + 增加物件给任务策划人 + 增加物件給任務策劃人 Adds any spawned object to all curators in the mission @@ -618,22 +938,35 @@ Ajoute n'importe quel objet spawné à tous les curateurs de la mission Fügt jedes gespawnte Objekt allen Kuratoren der Mission hinzu ミッション内で作成されたオブジェクトに全キュレーターを追加 + 미션 내 큐레이터에 모든 생성 물체 추가 + 在任务中生成物件给所有的任务策划人 + 在任務中生成物件給所有的任務策劃人 Cargo: - Cargo: + Cargo : Груз: Náklad: - カーゴ: + カーゴ: Ładunek: + Ladung: + 화물: + Cargo: + 货物: + 貨物: Task Position Position de la tâche Местоположение задания Pozice úkolu - タスクの位置 + タスク位置 Pozycja zadania + Position der Aufgabe + 작업 위치 + Posizione Incarico + 目标位置 + 目標位置 Select a position to perform the task at @@ -641,6 +974,11 @@ Выбрать местоположение для выполнения задания 次の選択位置をタスクとして実行 Wybierz pozycję na której wykonać zadanie + Wähle eine Position, an der die Aufgabe ausgeführt werden soll + 작업을 할 위치를 선택하십시요 + Seleziona una posizione per eseguire l'incarico + 选择要执行目标的位置 + 選擇要執行目標的位置 Task Radius @@ -648,6 +986,11 @@ Радиус задания タスク範囲 Obszar zadania + Radius der Aufgabe + 작업 반경 + Raggio Incarico + 目标半径 + 目標半徑 Radius to perform the task within @@ -655,14 +998,215 @@ Радиус выполнения задания 次の範囲をタスクとして実行 Obszar na którym zadanie powinno zostać wykonane + Radius, in dem die Aufgabe ausgeführt werden soll + 다음 반경 내에서 작업 + Raggio per eseguire un incarico + 设定目标范围半径 + 設定目標範圍半徑 Invalid radius entered - rayon invalide entré + Rayon invalide entré Введен неправильный радиус Vložen neplatný parametr 無効な半径が入力されました Wpisano nieprawidłowy promień + Ungültiger Radius eingegeben + 알 수 없는 반경 입력됨 + Raggio Invalido Inserito + 错误的半径值 + 錯誤的半徑值 + + + Suppressive Fire + Unterdrückungsfeuer + Fuoco di Soppressione + Tir de suppression + 制圧射撃 + 火力压制 + 火力壓制 + Ogień zaporowy + + + Add Full Arsenal + Füge ganzes Arsenal hinzu + Ajouter Arsenal Complet + Aggiungi Arsenale Completo + オブジェクトに完全なアーセナルを追加 + 增加完整的虚拟军火库到物件上 + 增加完整的虛擬軍火庫到物件上 + Dodaj Wirtualny Arsenał + + + Remove Arsenal + Entferne Arsenal + Retirer Arsenal + Rimuovi Arsenale + オブジェクトからアーセナルを削除 + 移除物件上的虚拟军火库 + 移除物件上的虛擬軍火庫 + Usuń Wirtualny Arsenał + + + Load into Cargo + In Frachtraum laden + Carica nel Cargo + カーゴに積み込み + 裝載到貨物中 + 装载到货物中 + + + Toggle NVGs + Nachtsichtgeräte Hinzufügen/Entfernen + Basculer JVN + Attiva NVGs + 暗視装置の切り替え + 切換夜視鏡 + 切换夜视镜 + + + NVG equipment + Nachtsichtgeräte + Equipment de vision nocturne + Attrezzatura NVG + 暗視装置 + 夜視鏡裝備 + 夜视镜装备 + + + Add or remove NVGs from units + Nachtsichtgeräte Hinzufügen/Entfernen + Ajouter ou retirer JVN des unités + Aggiunge o rimuove NVGs alle unità + ユニットから暗視装置の追加と削除 + 增加或移除單位的夜視鏡 + 增加或移除单位的夜视镜 + + + Toggle NVG target + Wechsle Nachtsichtgeräteziel + Cible du basculement + Attiva obiettivo NVG + 選択先の暗視装置の切り替え + 切換目標的夜視鏡狀態 + 切换目标的夜视镜状态 + + + Selected group + Ausgewählte Gruppe + Groupe sélectionné + Gruppo selezionato + 選択されたグループ + 選擇小隊 + 选择小队 + + + Toggle flashlights + Ändere Taschenlampen + Basculer lampes torches + Attiva torce + フラッシュライトの切り替え + 切換手電筒 + 切换手电筒 + + + Toggle flashlight target + Wechsle Nachtsichtgeräteziel + Cible du basculement + Attiva obiettivo torcia + 選択先のフラッシュライトの切り替え + 切換目標的手電筒狀態 + 切换目标的手电筒状态 + + + Flashlight + Taschenlampe + Lampe torche + Torcia + フラッシュライト + 手電筒 + 手电筒 + + + Add gear + Ausrüstung hinzufügen + Ajouter équipement + Aggiungi equipaggiamento + 装備を追加 + 增加裝備 + 增加装备 + + + Garrison group + Garnir zone + 歩哨グループ + Proteggi gruppo + 佈置駐軍 + 布置驻军 + + + Fill from top to bottom + Remplir de haut en bas + 上から下まで占拠 + Riempi dall'alto al basso + 由上而下進行填滿 + 由上而下进行填满 + + + Fill buildings from the highest position first + Remplir les bâtiments par la position la plus haute d'abord + 建物を最も高い位置から占拠していきます + Riempi gli edifici dalla posizione più alta prima + 從建築物的最高點開始布置衛哨 + 从建筑物的最高点开始布置卫哨 + + + Building filling mode + Mode de remplissage de bâtiment + 建物占拠モード + Modalità riempimento edifici + 駐軍填充建築物模式 + 驻军填充建筑物模式 + + + Even filling + Remplissage égal + 均一に占拠 + Riempimento uguale + 平均分配 + 平均分配 + + + Building by building + Bâtiment par bâtiment + 建物から建物へ + Edificio per edificio + 一棟填滿後再換下一棟 + 一栋填满后再换下一栋 + + + Random filling + Remplir au hasard + ランダムに占拠 + Riempimento casuale + 隨機分配 + 随机分配 + + + Teleport + Téléporter + テレポート + Teletrasporto + 傳送 + 传送 + + + Un-garrison group + Dégarnir zone + 非歩哨グループ + Non proteggere gruppo + 解除駐軍駐守狀態 + 解除驻军驻守状态 diff --git a/addons/zeus/ui/Icon_Module_Zeus_Garrison_ca.paa b/addons/zeus/ui/Icon_Module_Zeus_Garrison_ca.paa new file mode 100644 index 0000000000..8410763fd0 Binary files /dev/null and b/addons/zeus/ui/Icon_Module_Zeus_Garrison_ca.paa differ diff --git a/addons/zeus/ui/Icon_Module_Zeus_UnGarrison_ca.paa b/addons/zeus/ui/Icon_Module_Zeus_UnGarrison_ca.paa new file mode 100644 index 0000000000..387b1b2884 Binary files /dev/null and b/addons/zeus/ui/Icon_Module_Zeus_UnGarrison_ca.paa differ diff --git a/addons/zeus/ui/RscAttributes.hpp b/addons/zeus/ui/RscAttributes.hpp index 1efcde2c66..2bb2c97d85 100644 --- a/addons/zeus/ui/RscAttributes.hpp +++ b/addons/zeus/ui/RscAttributes.hpp @@ -97,6 +97,59 @@ class GVAR(RscDefendArea): RscDisplayAttributes { }; }; +class GVAR(RscEditableObjects): RscDisplayAttributes { + onLoad = QUOTE([ARR_3('onLoad', _this, QQGVAR(RscEditableObjects))] call FUNC(zeusAttributes)); + onUnload = QUOTE([ARR_3('onUnload', _this, QQGVAR(RscEditableObjects))] call FUNC(zeusAttributes)); + class Controls: Controls { + class Background: Background {}; + class Title: Title {}; + class Content: Content { + class Controls { + class radius: GVAR(AttributeRadius) {}; + //class position: GVAR(AttributePosition) {}; + class editableObjects: RscControlsGroupNoScrollbars { + onSetFocus = QUOTE(_this call FUNC(ui_editableObjects)); + idc = 26422; + x = 0; + y = 0; + w = W_PART(11.1); + h = H_PART(2.5); + class controls { + class Label: RscText { + idc = -1; + text = CSTRING(ModuleEditableObjects_curators); + toolTip = CSTRING(ModuleEditableObjects_curators_desc); + x = 0; + y = 0; + w = W_PART(10); + h = H_PART(1); + colorBackground[] = {0,0,0,0.5}; + }; + class AllCurators: RscCheckBox { + idc = 16188; + x = W_PART(10.1); + y = 0; + w = W_PART(1); + h = H_PART(1); + }; + class Label2: Label { + text = CSTRING(ModuleEditableObjects_removal); + toolTip = CSTRING(ModuleEditableObjects_removal_desc); + y = H_PART(1.1); + }; + class EditingMode: AllCurators { + idc = 16189; + y = H_PART(1.1); + }; + }; + }; + }; + }; + class ButtonOK: ButtonOK {}; + class ButtonCancel: ButtonCancel {}; + }; +}; + class GVAR(RscGlobalSetSkill): RscDisplayAttributes { onLoad = QUOTE([ARR_3('onLoad', _this, QUOTE(QGVAR(RscGlobalSetSkill)))] call FUNC(zeusAttributes)); onUnload = QUOTE([ARR_3('onUnload', _this, QUOTE(QGVAR(RscGlobalSetSkill)))] call FUNC(zeusAttributes)); @@ -364,7 +417,6 @@ class GVAR(RscTeleportPlayers): RscDisplayAttributes { }; }; - class GVAR(AttributeCargo): RscControlsGroupNoScrollbars { onSetFocus = QUOTE(_this call FUNC(ui_attributeCargo)); idc = -1; @@ -420,3 +472,199 @@ class RscDisplayAttributesVehicleEmpty: RscDisplayAttributes { }; }; }; + +class GVAR(RscGarrison): RscDisplayAttributes { + onLoad = QUOTE([ARR_3('onLoad', _this, QUOTE(QGVAR(RscGarrison)))] call FUNC(zeusAttributes)); + onUnload = QUOTE([ARR_3('onUnload', _this, QUOTE(QGVAR(RscGarrison)))] call FUNC(zeusAttributes)); + class Controls: Controls { + class Background: Background {}; + class Title: Title {}; + class Content: Content { + class Controls { + class Garrison: RscControlsGroupNoScrollbars { + onSetFocus = QUOTE(_this call FUNC(ui_garrison)); + idc = 73060; + x = 0; + y = 0; + w = W_PART(26); + h = H_PART(8.5); + class controls { + class radius: GVAR(AttributeRadius) {}; + class TopDownFillingTitle: Title { + idc = -1; + text = CSTRING(ModuleGarrison_TopDownFillingText); + toolTip = CSTRING(ModuleGarrison_TopDownFillingTooltip); + x = 0; + y = H_PART(1.2); + w = W_PART(10); + h = H_PART(1); + colorBackground[] = {0,0,0,0.5}; + }; + class TopDownFilling: RscCheckBox { + idc = 73061; + x = W_PART(10.1); + y = H_PART(1.2); + w = W_PART(1); + h = H_PART(1); + }; + class TeleportTitle: Title { + idc = -1; + text = CSTRING(ModuleGarrison_TeleportText); + x = 0; + y = H_PART(2.3); + w = W_PART(10); + h = H_PART(1); + colorBackground[] = {0,0,0,0.5}; + }; + class Teleport: RscCheckBox { + idc = 73062; + x = W_PART(10.1); + y = H_PART(2.3); + w = W_PART(1); + h = H_PART(1); + }; + class FillingModeTitle: RscText { + idc = -1; + text = CSTRING(ModuleGarrison_FillingModeText); + x = 0; + y = H_PART(3.5); + w = W_PART(26); + h = H_PART(1); + colorBackground[] = {0,0,0,0.5}; + }; + class FillingMode: RscListbox { + idc = 73063; + x = 0; + y = H_PART(4.5); + w = W_PART(26); + h = H_PART(4); + }; + }; + }; + }; + }; + class ButtonOK: ButtonOK {}; + class ButtonCancel: ButtonCancel {}; + }; +}; + +class GVAR(RscToggleNvg): RscDisplayAttributes { + onLoad = QUOTE([ARR_3('onLoad', _this, QUOTE(QGVAR(RscToggleNvg)))] call FUNC(zeusAttributes)); + onUnload = QUOTE([ARR_3('onUnload', _this, QUOTE(QGVAR(RscToggleNvg)))] call FUNC(zeusAttributes)); + class Controls: Controls { + class Background: Background {}; + class Title: Title {}; + class Content: Content { + class Controls { + class ToggleNvg: RscControlsGroupNoScrollbars { + onSetFocus = QUOTE(_this call FUNC(ui_toggleNvg)); + idc = 92854; + x = 0; + y = 0; + w = W_PART(26); + h = H_PART(3); + class controls { + class ToggleNvgTitle: Title { + idc = -1; + text = CSTRING(moduleToggleNVG_ToggleNvgTitle); + toolTip = CSTRING(moduleToggleNVG_ToggleNvgTitleTooltip); + x = H_PART(0); + y = H_PART(0); + w = W_PART(7); + }; + class ToggleNvgCombo: RscCombo { + idc = 92855; + x = H_PART(6); + y = H_PART(0); + w = W_PART(10.1); + h = H_PART(1); + }; + class ToggleNvgSideTitle: Title { + idc = -1; + text = CSTRING(moduleToggleNVG_ToggleNvgSide); + x = H_PART(0); + y = H_PART(1.2); + w = W_PART(7); + }; + class ToggleNvgSideCombo: RscCombo { + idc = 92856; + x = H_PART(6); + y = H_PART(1.2); + w = W_PART(10.1); + h = H_PART(1); + }; + }; + }; + }; + }; + class ButtonOK: ButtonOK {}; + class ButtonCancel: ButtonCancel {}; + }; +}; + +class GVAR(RscToggleFlashlight): RscDisplayAttributes { + onLoad = QUOTE([ARR_3('onLoad', _this, QUOTE(QGVAR(RscToggleFlashlight)))] call FUNC(zeusAttributes)); + onUnload = QUOTE([ARR_3('onUnload', _this, QUOTE(QGVAR(RscToggleFlashlight)))] call FUNC(zeusAttributes)); + class Controls: Controls { + class Background: Background {}; + class Title: Title {}; + class Content: Content { + class Controls { + class ToggleFlashlight: RscControlsGroupNoScrollbars { + onSetFocus = QUOTE(_this call FUNC(ui_toggleFlashlight)); + idc = 56217; + x = 0; + y = 0; + w = W_PART(26); + h = H_PART(5); + class controls { + class ToggleFlashlightTitle: Title { + idc = -1; + text = CSTRING(moduleToggleFlashlight_ToggleFlashlightTitle); + x = H_PART(0); + y = H_PART(0); + w = W_PART(7); + }; + class ToggleFlashlightCombo: RscCombo { + idc = 56218; + x = H_PART(6); + y = H_PART(0); + w = W_PART(10.1); + h = H_PART(1); + }; + class ToggleFlashlightSideTitle: Title { + idc = -1; + text = CSTRING(moduleToggleFlashlight_ToggleFlashlightSide); + x = H_PART(0); + y = H_PART(1.2); + w = W_PART(7); + }; + class ToggleFlashlightSideCombo: RscCombo { + idc = 56219; + x = H_PART(6); + y = H_PART(1.2); + w = W_PART(10.1); + h = H_PART(1); + }; + class ToggleFlashlightGearTitle: Title { + idc = -1; + text = CSTRING(moduleToggleFlashlight_ToggleFlashlightGear); + x = H_PART(0); + y = H_PART(2.4); + w = W_PART(7); + }; + class ToggleFlashlightGearCombo: RscCombo { + idc = 56220; + x = H_PART(6); + y = H_PART(2.4); + w = W_PART(10.1); + h = H_PART(1); + }; + }; + }; + }; + }; + class ButtonOK: ButtonOK {}; + class ButtonCancel: ButtonCancel {}; + }; +}; diff --git a/docs/.dockerignore b/docs/.dockerignore new file mode 100644 index 0000000000..85de9cf933 --- /dev/null +++ b/docs/.dockerignore @@ -0,0 +1 @@ +src diff --git a/docs/.gitignore b/docs/.gitignore index 3232b5a935..7836aaf3f3 100644 --- a/docs/.gitignore +++ b/docs/.gitignore @@ -18,3 +18,5 @@ addons CNAME tools/temp + +Gemfile.lock diff --git a/docs/Dockerfile b/docs/Dockerfile new file mode 100644 index 0000000000..033cd89d67 --- /dev/null +++ b/docs/Dockerfile @@ -0,0 +1,17 @@ +# Build: +# docker build -t ace3mod/jekyll . +# +# Run: +# docker run -it -p 4000:4000 -v $(pwd):/usr/src/app ace3mod/jekyll +# +# Run with --incremental flag: +# docker run -it -p 4000:4000 -v $(pwd):/usr/src/app ace3mod/jekyll --incremental + +FROM starefossen/github-pages:latest +MAINTAINER bux + +COPY . /usr/src/app + +VOLUME "/usr/src/app" + +ENTRYPOINT ["jekyll", "serve", "--future", "--config", "_config_dev.yml", "-H", "0.0.0.0", "-P", "4000"] diff --git a/docs/Gemfile.lock b/docs/Gemfile.lock deleted file mode 100644 index faafb3cd3d..0000000000 --- a/docs/Gemfile.lock +++ /dev/null @@ -1,135 +0,0 @@ -GEM - remote: http://rubygems.org/ - specs: - RedCloth (4.2.9) - RedCloth (4.2.9-x86-mingw32) - activesupport (4.2.5.2) - i18n (~> 0.7) - json (~> 1.7, >= 1.7.7) - minitest (~> 5.1) - thread_safe (~> 0.3, >= 0.3.4) - tzinfo (~> 1.1) - addressable (2.3.8) - coffee-script (2.4.1) - coffee-script-source - execjs - coffee-script-source (1.10.0) - colorator (0.1) - ethon (0.8.1) - ffi (>= 1.3.0) - execjs (2.6.0) - faraday (0.9.2) - multipart-post (>= 1.2, < 3) - ffi (1.9.10) - ffi (1.9.10-x86-mingw32) - gemoji (2.1.0) - github-pages (52) - RedCloth (= 4.2.9) - github-pages-health-check (= 1.0.1) - jekyll (= 3.0.3) - jekyll-coffeescript (= 1.0.1) - jekyll-feed (= 0.4.0) - jekyll-gist (= 1.4.0) - jekyll-mentions (= 1.0.1) - jekyll-paginate (= 1.1.0) - jekyll-redirect-from (= 0.9.1) - jekyll-sass-converter (= 1.3.0) - jekyll-seo-tag (= 1.3.1) - jekyll-sitemap (= 0.10.0) - jekyll-textile-converter (= 0.1.0) - jemoji (= 0.5.1) - kramdown (= 1.9.0) - liquid (= 3.0.6) - mercenary (~> 0.3) - rdiscount (= 2.1.8) - redcarpet (= 3.3.3) - rouge (= 1.10.1) - terminal-table (~> 1.4) - github-pages-health-check (1.0.1) - addressable (~> 2.3) - net-dns (~> 0.8) - octokit (~> 4.0) - public_suffix (~> 1.4) - typhoeus (~> 0.7) - html-pipeline (2.3.0) - activesupport (>= 2, < 5) - nokogiri (>= 1.4) - i18n (0.7.0) - jekyll (3.0.3) - colorator (~> 0.1) - jekyll-sass-converter (~> 1.0) - jekyll-watch (~> 1.1) - kramdown (~> 1.3) - liquid (~> 3.0) - mercenary (~> 0.3.3) - rouge (~> 1.7) - safe_yaml (~> 1.0) - jekyll-coffeescript (1.0.1) - coffee-script (~> 2.2) - jekyll-feed (0.4.0) - jekyll-gist (1.4.0) - octokit (~> 4.2) - jekyll-mentions (1.0.1) - html-pipeline (~> 2.3) - jekyll (~> 3.0) - jekyll-paginate (1.1.0) - jekyll-redirect-from (0.9.1) - jekyll (>= 2.0) - jekyll-sass-converter (1.3.0) - sass (~> 3.2) - jekyll-seo-tag (1.3.1) - jekyll (~> 3.0) - jekyll-sitemap (0.10.0) - jekyll-textile-converter (0.1.0) - RedCloth (~> 4.0) - jekyll-watch (1.3.1) - listen (~> 3.0) - jemoji (0.5.1) - gemoji (~> 2.0) - html-pipeline (~> 2.2) - jekyll (>= 2.0) - json (1.8.3) - kramdown (1.9.0) - liquid (3.0.6) - listen (3.0.6) - rb-fsevent (>= 0.9.3) - rb-inotify (>= 0.9.7) - mercenary (0.3.5) - mini_portile2 (2.0.0) - minitest (5.8.4) - multipart-post (2.0.0) - net-dns (0.8.0) - nokogiri (1.6.7.2) - mini_portile2 (~> 2.0.0.rc2) - nokogiri (1.6.7.2-x86-mingw32) - mini_portile2 (~> 2.0.0.rc2) - octokit (4.2.0) - sawyer (~> 0.6.0, >= 0.5.3) - public_suffix (1.5.3) - rb-fsevent (0.9.7) - rb-inotify (0.9.7) - ffi (>= 0.5.0) - rdiscount (2.1.8) - redcarpet (3.3.3) - rouge (1.10.1) - safe_yaml (1.0.4) - sass (3.4.21) - sawyer (0.6.0) - addressable (~> 2.3.5) - faraday (~> 0.8, < 0.10) - terminal-table (1.5.2) - thread_safe (0.3.5) - typhoeus (0.8.0) - ethon (>= 0.8.0) - tzinfo (1.2.2) - thread_safe (~> 0.1) - -PLATFORMS - ruby - x86-mingw32 - -DEPENDENCIES - github-pages - -BUNDLED WITH - 1.12.5 diff --git a/docs/README.md b/docs/README.md index 9c20ecb281..ee47a3cdd9 100644 --- a/docs/README.md +++ b/docs/README.md @@ -1,10 +1,52 @@ -# Source of http://ace3mod.com/ +# Source of https://ace3mod.com/ -## Setting up the development environment +## Updating compiled JavaScript and CSS files -### Installing prerequisites +- Install [Node.js](https://nodejs.org/download/) +- Open Command Prompt and navigate to `src` directory + ``` + cd /docs/src + ``` -#### Windows (CMD) +- Install Node packages + ``` + npm install + ``` + _On Bash on Ubuntu on Windows also install `nodejs-legacy` in case of errors._ + +- Update files + ``` + grunt + ``` + +## Setting up the Jekyll environment + +### Using Docker + +We include files for [Docker](https://www.docker.com/) to run Jekyll in a separate container. This allows you to not having to install anything apart from Docker on your computer. + +#### Running the Dockerfile + +- Install [Docker](https://www.docker.com/) +- cd into the `/docs/` directory +- Open Command Prompt and navigate to this directory + ``` + cd /docs + ``` + +- Build and run the container + ``` + docker-compose up + ``` + +- Navigate to [http://localhost:4000](http://localhost:4000) + + +### Manually + +#### Installing prerequisites + +##### Windows (CMD) - Install [Ruby 2.0.0-p648 (x64)](http://rubyinstaller.org/downloads/) - Install [Ruby DevKit for 2.0 (x64)](http://rubyinstaller.org/downloads/) @@ -23,6 +65,7 @@ bundle install ``` + #### Debian / Bash on Ubuntu on Windows - Open Bash and navigate to this directory @@ -32,14 +75,14 @@ - Install `make` and `gcc` ``` - sudo apt-get make gcc + sudo apt-get install make gcc ``` -- Install `ruby 2.0`, `rbuy2.0-dev` and `ruby-switch` +- Install `ruby2.0`, `ruby2.0-dev` and `ruby-switch` ``` sudo apt-add-repository ppa:brightbox/ruby-ng - sudo apt update - sudo apt install ruby2.0 ruby2.0-dev ruby-switch + sudo apt-get update + sudo apt-get install ruby2.0 ruby2.0-dev ruby-switch ``` - Set Ruby version @@ -62,7 +105,7 @@ find ~/.bundle/cache -type d -exec chmod 0755 {} + ``` -### Running +#### Running - Run Jekyll through bundler ``` @@ -72,21 +115,3 @@ - Navigate to http://localhost:4000 -### Updating compiled JavaScript and CSS files - -- Install [Node.js](https://nodejs.org/download/) -- Open Command Prompt and navigate to `src` directory - ``` - cd /docs/src - ``` - -- Install Node packages - ``` - npm install - ``` - _On Bash on Ubuntu on Windows also install `nodejs-legacy` in case of errors._ - -- Update files - ``` - grunt - ``` diff --git a/docs/README_DE.md b/docs/README_DE.md index 36f52c5fa8..f0b92aeffe 100644 --- a/docs/README_DE.md +++ b/docs/README_DE.md @@ -4,7 +4,7 @@

- ACE3 Version + ACE3 Version ACE3 Fehlermeldungen @@ -15,8 +15,8 @@ ACE3 Lizenz - - ACE3 Slack + + ACE3 Slack ACE3 Build Status @@ -70,14 +70,14 @@ Die Mod ist **modular aufgebaut**. Beinahe jede PBO kann entfernt werden, sodass #### 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). +- [Erste Schritte](https://ace3mod.com/wiki/user/getting-started.html). #### Mitwirken 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 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 Wunsch zu einer neuen Funktion mitteilen?](http://ace3mod.com/wiki/user/how-to-make-a-feature-request.html) +- [Wie kann ich ein Problem melden](https://ace3mod.com/wiki/user/how-to-report-an-issue.html) +- [Wie kann ich ein Wunsch zu einer neuen Funktion mitteilen?](https://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 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. diff --git a/docs/README_PL.md b/docs/README_PL.md index 27428eed5d..9e39d80d34 100644 --- a/docs/README_PL.md +++ b/docs/README_PL.md @@ -3,7 +3,7 @@

- ACE3 Wersja + ACE3 Wersja ACE3 Zagadnienia @@ -14,8 +14,8 @@ ACE3 Licencja - - ACE3 Slack + + ACE3 Slack ACE3 Build Status @@ -65,15 +65,15 @@ Modyfikacja ta jest **budowana modułowo**, dzięki temu prawie każdy dostarczo ### Poradniki i instrukcje Jeżeli zainstalowałeś ACE3 lecz masz problem ze zrozumieniem jak to wszystko działa, lub gdzie zacząć, zacznij od przeczytania tego: -- [Wprowadzenie](http://ace3mod.com/wiki/user/getting-started.html) +- [Wprowadzenie](https://ace3mod.com/wiki/user/getting-started.html) #### Współpraca Możesz pomóc w rozwoju addonu szukając potencjalnych bugów w naszym kodzie, lub zgłaszając nowe funkcje. Aby wnieść swój wkład do ACE3, po prostu zforkuj to repozytorium na swoje konto GitHub i zgłoś swoje pull requesty do przeglądu przez innych współpracowników. Pamiętaj, aby dodać siebie do listy autorów każdego PBO jakie edytujesz oraz do pliku ['AUTHORS.txt'](https://github.com/acemod/ACE3/blob/master/AUTHORS.txt) dodając także swój adres e-mail. Używaj naszego [Issue Tracker-a](https://github.com/acemod/ACE3/issues) aby zgłaszać bugi, proponować nowe funkcje lub sugerować zmiany do aktualnie istniejących. Zobacz także: -- [Jak zgłosić bug-a](http://ace3mod.com/wiki/user/how-to-report-an-issue.html) -- [Jak zgłosić feature request-a](http://ace3mod.com/wiki/user/how-to-make-a-feature-request.html) +- [Jak zgłosić bug-a](https://ace3mod.com/wiki/user/how-to-report-an-issue.html) +- [Jak zgłosić feature request-a](https://ace3mod.com/wiki/user/how-to-make-a-feature-request.html) #### Testowanie i budowanie Aby pomóc nam w testowaniu najnowszych zmian rozwojowych, pobierz nasz master branch ([bezpośrednio](https://github.com/acemod/ACE3/archive/master.zip), lub [korzystając z git](https://help.github.com/articles/fetching-a-remote/)), a następnie złóż testowego build-a: -- [Konfiguracja środowiska do testów](http://ace3mod.com/wiki/development/setting-up-the-development-environment.html) – intrukcja krok-po-kroku jak poprawnie ustawić i zbudować wersję ACE3 do celów testowych. +- [Konfiguracja środowiska do testów](https://ace3mod.com/wiki/development/setting-up-the-development-environment.html) – intrukcja krok-po-kroku jak poprawnie ustawić i zbudować wersję ACE3 do celów testowych. diff --git a/docs/_config.yml b/docs/_config.yml index 9dd11e9a3b..527a849881 100644 --- a/docs/_config.yml +++ b/docs/_config.yml @@ -1,26 +1,24 @@ -#baseurl: /ACE3 - name: ACE3 description: ACE3 is a joint effort by the teams behind ACE 2, AGM and CSE to improve the realism and authenticity of Arma 3. keywords: Advanced Combat Enhancement 3, ACE, ACE3, Arma, Arma 3, Mod, Modification, Realism, AGM, CSE, Bohemia, Interactive -productionUrl: http://ace3mod.com +productionUrl: https://ace3mod.com ace: githubUrl: https://github.com/acemod/ACE3 version: major: 3 - minor: 7 + minor: 11 patch: 0 - build: 6 + build: 26 acex: githubUrl: https://github.com/acemod/ACEX version: major: 3 - minor: 0 + minor: 2 patch: 0 - build: 0 + build: 4 markdown: kramdown diff --git a/docs/_config_dev.yml b/docs/_config_dev.yml index 31d20e5439..b5cda7124a 100644 --- a/docs/_config_dev.yml +++ b/docs/_config_dev.yml @@ -10,17 +10,17 @@ ace: githubUrl: https://github.com/acemod/ACE3 version: major: 3 - minor: 7 + minor: 11 patch: 0 - build: 6 + build: 26 acex: githubUrl: https://github.com/acemod/ACEX version: major: 3 - minor: 0 + minor: 2 patch: 0 - build: 0 + build: 4 markdown: kramdown diff --git a/docs/_includes/_footer.html b/docs/_includes/_footer.html index d391330c6e..8763b6c35a 100644 --- a/docs/_includes/_footer.html +++ b/docs/_includes/_footer.html @@ -3,22 +3,22 @@

ACE3

ACE3 is a joint effort by the teams behind ACE2, AGM and CSE to improve the realism and authenticity of Arma 3.

-

If you want to contribute something to ACE3, simply fork the GitHub repository and submit your pull requests for review.

+

If you want to contribute something to ACE3, simply fork the GitHub repository and submit your pull requests for review.

Issues / Feedback

-

Issues, feature requests and feedback are welcome at the ACE3 GitHub issue tracker.

-

Before reporting an issue, please read the wiki entry "How to report an issue".

-

We have created a single issue for feature requests.

+

Issues, feature requests and feedback are welcome at the ACE3 GitHub issue tracker.

+

Before reporting an issue, please read the wiki entry "How to report an issue".

+

We have created a single issue for feature requests.

Social Media

- +
diff --git a/docs/_includes/_header.html b/docs/_includes/_header.html index 8737b505ae..84bcab8d2e 100644 --- a/docs/_includes/_header.html +++ b/docs/_includes/_header.html @@ -8,7 +8,7 @@ - + @@ -19,8 +19,11 @@ - + + + + diff --git a/docs/_includes/dependencies_list.md b/docs/_includes/dependencies_list.md index 09de6ba5a3..c6883682c4 100644 --- a/docs/_includes/dependencies_list.md +++ b/docs/_includes/dependencies_list.md @@ -23,7 +23,7 @@ {% endif %} {% if include.component == "atragmx" %} -`ACE_common`, `ACE_weather` +`ACE_Advanced_Ballistics`, `ACE_common`, `ACE_weather` {% endif %} {% if include.component == "attach" %} @@ -138,6 +138,10 @@ `ace_interaction` {% endif %} +{% if include.component == "hellfire" %} +`ace_interaction`, `ace_missileguidance` +{% endif %} + {% if include.component == "hitreactions" %} `ace_common` {% endif %} @@ -202,6 +206,10 @@ `ace_common` {% endif %} +{% if include.component == "maverick" %} +`ace_hellfire` +{% endif %} + {% if include.component == "medical" %} `ace_interaction`, `ace_apl` {% endif %} @@ -258,6 +266,10 @@ `ace_common` {% endif %} +{% if include.component == "nlaw" %} +`ace_missileguidance` +{% endif %} + {% if include.component == "noidle" %} `ace_common` {% endif %} @@ -290,8 +302,16 @@ `ace_common` {% endif %} +{% if include.component == "pylons" %} +`ace_interact_menu` +{% endif %} + +{% if include.component == "quickmount" %} +`ace_common` +{% endif %} + {% if include.component == "rangecard" %} -`ACE_Advanced_Ballistics` +`ACE_Advanced_Ballistics`, `ace_scopes` {% endif %} {% if include.component == "realisticnames" %} @@ -419,7 +439,7 @@ {% endif %} {% if include.component == "zeus" %} -`ace_common` +`ace_common`, `ace_ai` {% endif %} {% if include.component == "compat_adr_97" %} @@ -447,11 +467,15 @@ {% endif %} {% if include.component == "compat_rhs_afrf3" %} -`ace_rearm`, `ace_refuel`, `ace_repair`, `rhs_c_weapons`, `rhs_c_troops`, `rhs_c_bmd`, `rhs_c_bmp`, `rhs_c_bmp3`, `rhs_c_a2port_armor`, `rhs_c_btr`, `rhs_c_sprut`, `rhs_c_t72`, `rhs_c_tanks`, `rhs_c_a2port_air`, `rhs_c_a2port_car`, `rhs_c_cars`, `rhs_c_trucks`, `rhs_c_2s3`, `rhs_c_rva` +`ace_rearm`, `ace_refuel`, `ace_repair`, `rhs_c_weapons`, `rhs_c_troops`, `rhs_c_bmd`, `rhs_c_bmp`, `rhs_c_bmp3`, `rhs_c_a2port_armor`, `rhs_c_btr`, `rhs_c_sprut`, `rhs_c_t72`, `rhs_c_tanks`, `rhs_c_a2port_air`, `rhs_c_a2port_car`, `rhs_c_cars`, `rhs_c_trucks`, `rhs_c_2s3`, `rhs_c_rva`, `rhs_c_heavyweapons` +{% endif %} + +{% if include.component == "compat_rhs_gref3" %} +`rhsgref_main`, `rhsgref_c_weapons` {% endif %} {% if include.component == "compat_rhs_usf3" %} -`ace_javelin`, `ace_rearm`, `ace_refuel`, `ace_repair`, `rhsusf_c_weapons`, `rhsusf_c_troops`, `rhsusf_c_m1a1`, `rhsusf_c_m1a2`, `RHS_US_A2_AirImport`, `rhsusf_c_m109`, `rhsusf_c_HEMTT_A4`, `rhsusf_c_hmmwv`, `rhsusf_c_rg33`, `rhsusf_c_fmtv`, `rhsusf_c_m113`, `RHS_US_A2Port_Armor` +`ace_javelin`, `ace_rearm`, `ace_refuel`, `ace_repair`, `rhsusf_c_weapons`, `rhsusf_c_troops`, `rhsusf_c_m1a1`, `rhsusf_c_m1a2`, `RHS_US_A2_AirImport`, `rhsusf_c_m109`, `rhsusf_c_HEMTT_A4`, `rhsusf_c_hmmwv`, `rhsusf_c_rg33`, `rhsusf_c_fmtv`, `rhsusf_c_m113`, `RHS_US_A2Port_Armor`, `rhsusf_c_melb` {% endif %} {% if include.component == "compat_rksl_pm_ii" %} @@ -470,6 +494,10 @@ `ace_common` {% endif %} +{% if include.component == "nouniformrestrictions" %} +`ace_common` +{% endif %} + {% if include.component == "particles" %} `ace_common` {% endif %} diff --git a/docs/_includes/dependenciesx_list.md b/docs/_includes/dependenciesx_list.md index 8f387be41d..1526c3e12c 100644 --- a/docs/_includes/dependenciesx_list.md +++ b/docs/_includes/dependenciesx_list.md @@ -1,3 +1,7 @@ +{% if include.component == "fortify" %} +`acex_main`, `ace_interaction` +{% endif %} + {% if include.component == "headless" %} `acex_main` {% endif %} @@ -9,4 +13,3 @@ {% if include.component == "viewrestriction" %} `acex_main` {% endif %} - diff --git a/docs/_posts/2015-07-30-ace3-version320.md b/docs/_posts/2015-07-30-ace3-version320.md index 8abb849250..850717f47c 100644 --- a/docs/_posts/2015-07-30-ace3-version320.md +++ b/docs/_posts/2015-07-30-ace3-version320.md @@ -29,7 +29,7 @@ While porting some of ACE 2's AGM's and CSE's features we've ported some of the Fixing errors we were additionally working on further optimizing existing code and we've managed to achieve a big performance boost in our wind deflection code. -Furthermore a problem with vanilla damage being applied to some units has been fixed. If you still encounter this issue please report it following this guideline: http://ace3mod.com/wiki/user/how-to-report-an-issue.html +Furthermore a problem with vanilla damage being applied to some units has been fixed. If you still encounter this issue please report it following this guideline: {{ site.baseurl }}/wiki/user/how-to-report-an-issue.html ### The Shiny Things diff --git a/docs/_posts/2015-09-17-ace3-version331.md b/docs/_posts/2015-09-17-ace3-version331.md index 13d6435d90..2a4fbb46fe 100644 --- a/docs/_posts/2015-09-17-ace3-version331.md +++ b/docs/_posts/2015-09-17-ace3-version331.md @@ -72,4 +72,4 @@ https://github.com/acemod/ACE3/releases/tag/v3.3.0 With the changes of 3.3.1 which can be found here: https://github.com/acemod/ACE3/releases/tag/v3.3.1 (Be sure to download v3.3.1) -If you want to chat with fellow ACE3 users or with a dev feel free to join our public slack chat. Registration is free and open for everyone: http://slackin.ace3mod.com/ +If you want to chat with fellow ACE3 users or with a dev feel free to join our public slack chat. Registration is free and open for everyone: https://slackin.ace3mod.com/ diff --git a/docs/_posts/2015-12-03-ace3-version340.md b/docs/_posts/2015-12-03-ace3-version340.md index ddaf1bd890..1382663470 100644 --- a/docs/_posts/2015-12-03-ace3-version340.md +++ b/docs/_posts/2015-12-03-ace3-version340.md @@ -62,4 +62,4 @@ The complete change log of 3.4.0 can be found at: https://github.com/acemod/ACE3 And most important: If you want to chat with fellow ACE3 users or with a dev, if you have an idea or are in need of help feel free to join our public slack chat. -Registration is open for everyone: http://slackin.ace3mod.com/ +Registration is open for everyone: https://slackin.ace3mod.com/ diff --git a/docs/_posts/2016-03-02-ace3-version350.md b/docs/_posts/2016-03-02-ace3-version350.md index 668e0adee5..a6b6b89d8c 100644 --- a/docs/_posts/2016-03-02-ace3-version350.md +++ b/docs/_posts/2016-03-02-ace3-version350.md @@ -82,4 +82,4 @@ Make sure to [follow us on twitter](https://twitter.com/intent/follow?screen_nam **And most important:** If you want to chat with fellow ACE3 users or with a dev, if you have an idea or are in need of help feel free to join our public slack chat. -**Registration is open for everyone: [http://slackin.ace3mod.com/](http://slackin.ace3mod.com/)** +**Registration is open for everyone: [https://slackin.ace3mod.com/](https://slackin.ace3mod.com/)** diff --git a/docs/_posts/2016-06-21-moving-ace3-frameworks-to-cba.md b/docs/_posts/2016-06-21-moving-ace3-frameworks-to-cba.md index 1e7ccc8a1b..e5effd04b2 100644 --- a/docs/_posts/2016-06-21-moving-ace3-frameworks-to-cba.md +++ b/docs/_posts/2016-06-21-moving-ace3-frameworks-to-cba.md @@ -66,7 +66,7 @@ This update does not mean that if your mod depends on any of this functionality ### Replacing deprecated functionality -It is recommended to replace any functionality that is deprecated with its replacement as soon as possible. If you are in need of any help with moving from deprecated ACE3 functionality to it's replacement, please visit our [Public Slack team at http://slackin.ace3mod.com](http://slackin.ace3mod.com){:target="_blank"}. +It is recommended to replace any functionality that is deprecated with its replacement as soon as possible. If you are in need of any help with moving from deprecated ACE3 functionality to it's replacement, please visit our [Public Slack team at https://slackin.ace3mod.com](https://slackin.ace3mod.com){:target="_blank"}. ## ACE3 Events @@ -77,4 +77,4 @@ Any code currently using the old ACE3 event functions will still function correc --- -We hope you like the new frameworks made publicly available in CBA A3 and without needing a dependency on ACE3. Feel free to leave your feedback either on the [CBA BI forum thread](https://forums.bistudio.com/topic/168277-cba-community-base-addons-arma-3/){:target="_blank"}, the [ACE3 BI forum thread](https://forums.bistudio.com/topic/181341-ace3-a-collaborative-merger-between-agm-cse-and-ace/){:target="_blank"} or in our [public chat](http://slackin.ace3mod.com){:target="_blank"}. +We hope you like the new frameworks made publicly available in CBA A3 and without needing a dependency on ACE3. Feel free to leave your feedback either on the [CBA BI forum thread](https://forums.bistudio.com/topic/168277-cba-community-base-addons-arma-3/){:target="_blank"}, the [ACE3 BI forum thread](https://forums.bistudio.com/topic/181341-ace3-a-collaborative-merger-between-agm-cse-and-ace/){:target="_blank"} or in our [public chat](https://slackin.ace3mod.com){:target="_blank"}. diff --git a/docs/_posts/2016-06-30-ace3-version360.md b/docs/_posts/2016-06-30-ace3-version360.md index 3471d85b3a..c8e4ed9a20 100644 --- a/docs/_posts/2016-06-30-ace3-version360.md +++ b/docs/_posts/2016-06-30-ace3-version360.md @@ -100,6 +100,6 @@ The full changelog for ACE3 v3.6.0 can be found here: [https://github.com/acemod We are still in need for translations for some languages within the ACE3 project. Please have a look at [this github issue to track the progress and what languages lack translations](https://github.com/acemod/ACE3/issues/367){:target="_blank"}. Any and all help with this is appreciated. And most finally, we would like to invite you to our ACE3 public Slack chat. Here you can chat with fellow ACE3 users and developers, ask questions and receive help. -Registration is open for everyone: [http://slackin.ace3mod.com](http://slackin.ace3mod.com){:target="_blank"}. +Registration is open for everyone: [https://slackin.ace3mod.com](https://slackin.ace3mod.com){:target="_blank"}. Make sure to [follow us on twitter](https://twitter.com/intent/follow?screen_name=ace3mod&tw_p=followbutton){:target="_blank"} and to [like our facebook page](https://www.facebook.com/ACE3Mod/){:target="_blank"}. diff --git a/docs/_posts/2016-09-17-ace3-version370.md b/docs/_posts/2016-09-17-ace3-version370.md index 44ce8a956c..bd25b4c0fd 100644 --- a/docs/_posts/2016-09-17-ace3-version370.md +++ b/docs/_posts/2016-09-17-ace3-version370.md @@ -66,11 +66,11 @@ We are still in need for translations for some languages within the ACE3 project
- Slack Monochrome black logo + Slack Monochrome black logo
And most finally, we would like to invite you to our ACE3 public Slack chat. Here you can chat with fellow ACE3 users and developers, ask questions and receive help. -Registration is open for everyone: [http://slackin.ace3mod.com](http://slackin.ace3mod.com){:target="_blank"}. +Registration is open for everyone: [https://slackin.ace3mod.com](https://slackin.ace3mod.com){:target="_blank"}. Make sure to [follow us on twitter](https://twitter.com/intent/follow?screen_name=ace3mod&tw_p=followbutton){:target="_blank"} and to [like our facebook page](https://www.facebook.com/ACE3Mod/){:target="_blank"}. diff --git a/docs/_posts/2016-11-04-ace3-version381.md b/docs/_posts/2016-11-04-ace3-version381.md new file mode 100644 index 0000000000..0ba73a5c2d --- /dev/null +++ b/docs/_posts/2016-11-04-ace3-version381.md @@ -0,0 +1,60 @@ +--- +title: ACEREP #00007 +description: Status report on ACE3 version 3.8.1 +parent: posts +image: /img/news/161104_blood.jpg +author: bux +layout: post +--- + +Just about two month ago we've released 3.7.0. A version that had most of the bugs fixed even before the official release. For the first time we were actively supplying users interested in helping us with pre release versions of the mod - so called release candidates. Quite a lot of communities tested the several release candidates and provided us with very valuable feedback. Especially on bugs and quirks that are near impossible to test alone. + + + +A big shoutout to those who helped testing! Thank you. + +We've used this approach for 3.8.0 as well and hope that again most of the bugs have been fixed already and that you can enjoy ACE3 without annoying interruptions. + +We will keep this approach for the future and invite you to join to test the release candidates. All information will be posted in our public chat to which you're invited too. You can access it here: [https://slackin.ace3mod.com](https://slackin.ace3mod.com){:target="_blank"} + +So, why didn't we release any minor releases for 3.7.0 (e.g. 3.7.1)? In short: We didn't feel that it was necessary. During and directly after the release we had already added new and awesome features so that we had to do a major release. + +Two new features have made it into 3.8.0 which are "blood splatters" and "ammo box cook off". +Wounded units will now leave more visible trails of blood on the ground which could make for interesting missions like escaping as a wounded soldier who is being tracked down by enemy combatants. +When ammo boxes are destroyed the contained ammunition now will cook off in a multitude of small explosions and the boxes won't just sink into the ground. + +
+
+ A wounded insurgent in front of a damaged truck. +
+
+ +With 3.8.0 the map tools will allow you to draw straight lines again. A feature that sadly is missing in vanilla Arma 3. + +## The Future things + +### Medical rewrite + +If you're following ACE3 development on GitHub closely you might already have spotted it: The medical system gets a huge rewrite. That's true, we're completely redoing the medical system. Until now the medical system has been a merge of the AGM and CSE medical systems. The AGM one kind of became what you know as the "basic system" and CSE's respectively the "advanced system". Being two separate systems it was always hard for us to improve one or the other without reworking the other one too. Not an ideal situation. Another issue we will address with this rewrite is the amount of influence a medical condition has on gameplay. An issue we've often heard from different communities as well. There's an [interesting discussion going on GitHub with a lot of different ideas and feature requests](https://github.com/acemod/ACE3/issues/3134){:target="_blank"}. Worth a read. + +With the state machine system that has been introduced in CBA we are now able to strictly define various health states of players such as unconsciousness or cardiac arrest and what can happen in those states. This allows us to massively declutter the code which will not only reduce the possibility of bugs, but also enable us to add more features and gameplay elements to the medical system - with no performance loss at all. + +We're really looking forward to the result and how you will like it. + +### Night Vision Googles Improvements + +If you've [watched dslyecxi's recent YouTube videos](https://www.youtube.com/user/Dslyecxi){:target="_blank"} or if you're [following us on twitter](https://twitter.com/intent/follow?screen_name=ace3mod&tw_p=followbutton){:target="_blank"} you might already have seen that dslyecxi has put together a mod vastly improving night vision googles and the resulting very limiting view. Check out his video with the explanation why vanilla Arma 3 NVGs are a bad representation of real life NVGs and what he has done to improve that. + + + + +dslyecxi has donated his mod to ACE3 and we're looking into integrating it for a future release. + +## The End Things + +The full changelog for ACE3 v3.8.1 can be found here: [https://github.com/acemod/ACE3/releases/v3.8.1](https://github.com/acemod/ACE3/releases/v3.8.1){:target="_blank"} + +We are still in need for translations for some languages within the ACE3 project. Please have a look at [this GitHub issue to track the progress and what languages lack translations](https://github.com/acemod/ACE3/issues/367){:target="_blank"}. Any and all help with this is very appreciated. + +Make sure to [follow us on twitter](https://twitter.com/intent/follow?screen_name=ace3mod&tw_p=followbutton){:target="_blank"} and to [like our facebook page](https://www.facebook.com/ACE3Mod/){:target="_blank"}. + diff --git a/docs/_posts/2017-02-21-ace3-version390.md b/docs/_posts/2017-02-21-ace3-version390.md new file mode 100644 index 0000000000..42368de04e --- /dev/null +++ b/docs/_posts/2017-02-21-ace3-version390.md @@ -0,0 +1,48 @@ +--- +title: ACEREP #00008 +description: Status report on ACE3 version 3.9.0 +parent: posts +image: /img/news/170221_csatconvoy.jpg +author: bux +layout: post +--- + +Another year, another release. 3.9.0 is the first release of 2017 and we'd like to thank everyone who has helped us to make it a smooth one. + + + + + + +The release candidate testing was very successful and we have received important feedback helping us to fix some issues beforehand. + +
+
+ CSAT driving a convoy through one of Tanoa's villages while two CSAT soldiers are arresting two civilians. +
+
+ +This update mainly features quite a lot of bug and compatibility fixes as well as necessary changes for the next Arma 3 update. In particular we've added the 64bit compatible DLL files. Though, don't expect any dramatic performance increases as the DLLs were just rebuilt to make them compatible. + +A new component has been added which removes the restriction for picking up and wearing enemy uniforms. You can find it in the `/optionals` folder in ACE3 and to use it you could e.g. copy it to the `/addons` folder. We've decided to put it into optionals because being able to wear an enemy's uniform isn't always the desired behavior for everyone. + +We have invested some time in polishing the ballistic features of ACE3. As an example the range cards and the ATragMX now respect the distance between the center of the bore and the center of the scope to more accurately calculate firing solutions. If you're an addon maker [we've added new config entries which can be added to your addon or a compatibility patch](/wiki/framework/scopes-framework.html). And as an added benefit, shooting with this change is even more accurate than in vanilla. +Speaking of the ATragMX it is now closer to the real life counter part than ever before: It now features a muzzle velocity/temperature interpolation, calculating muzzle velocity by factoring in powder burn rates at different temperatures and the "Truing Drop" feature which helps a shooter calculate a better flight path based on actual shooting results. And because "our" ATragMX is models closely to the real world one you could even use the [real manual to read about those features](https://www.horusvision.com/download/manual_Horus_ATrag-v385.pdf){:target="_blank"}. + +And even Zeus got a little love in this update. You can find new helper modules in the Zeus interface like teleporting players, adding FRIES to a helicopter, toggle the simulation of objects and more. The modules have been cleaned up into distinct categories to make them easier to find. + +
+
+ Showcasing the Zeus interface with the new ACE3 sections and utility modules. A helicopter is getting FRIES attached using ACE3 Zeus. +
+
+ +As mentioned in our [last ACEREP](/2016/11/04/ace3-version381.html) we're still working on our big medical rewrite. Progress though has stalled a little bit due to the holidays and real life occupations. But it's already in quite a good state. More on that will follow in a future ACEREP. + +## The End Things + +The full (and funny) changelog for ACE3 v3.9.0 can be found here: [https://github.com/acemod/ACE3/releases/v3.9.0](https://github.com/acemod/ACE3/releases/v3.9.0){:target="_blank"} + +We are still in need for translations for some languages within the ACE3 project. Please have a look at [this GitHub issue to track the progress and what languages lack translations](https://github.com/acemod/ACE3/issues/367){:target="_blank"}. Any and all help with this is very appreciated. + +Make sure to [follow us on twitter](https://twitter.com/intent/follow?screen_name=ace3mod&tw_p=followbutton){:target="_blank"} and to [like our facebook page](https://www.facebook.com/ACE3Mod/){:target="_blank"}. diff --git a/docs/_posts/2017-07-14-ace3-version3100.md b/docs/_posts/2017-07-14-ace3-version3100.md new file mode 100644 index 0000000000..08cecb455a --- /dev/null +++ b/docs/_posts/2017-07-14-ace3-version3100.md @@ -0,0 +1,77 @@ +--- +title: ACEREP #00009 +description: Status report on ACE3 version 3.10.0 +parent: posts +image: /img/news/170714_jet_rearm.jpg +author: bux +layout: post +--- + +Last week we have released another big update to ACE3 (and a little hotfix too). ACE3 v3.10.0 (and v3.10.1) brought a numerous amount of additions, changes, fixes and improved translations. Following the release of [Jets DLC](https://arma3.com/dlc/jets) for Arma 3 a lot of things have changed on how we need to handle certain situations in the code and configuration. + + + +With Jets DLC focusing primarily on ... Jets ... this update we also focused a little bit more on aircraft. As an example we added rearm features to the new pylon system introduced with Jets DLC, we added settings to increase the fuel hose's length (for refueling on the carrier) and removed our custom flight model changes in favour of the constantly improved one's from vanilla Arma 3. + +
+
+ A pilot and two deck crew members rearming an F-18 Black Wasp. +
+
+ +Secondly Zeus has received new toys and improvements. One of which is to use AI to suppress positions and direct it using a slick new UI component we have developed for the Zeus interface. + + + + +
+ +### Intercept + +Back in [ACEREP #00004]({{site.baseUrl}}/2016/03/02/ace3-version350.html) we last spoke about Intercept a project that hooks into the Arma 3 game engine and calls scripting commands on an engine level (in C++) thus circumventing the SQF interpreter and saving valuable time executing the commands. + +
+
+ The intercept project's logo. +
+
+ +Though in June 2016 progress on Intercept had become stagnant as the main developer got started on his new job and time for intercept had become rather sparse. In may 2017 [@dedmen](https://github.com/dedmen){:target="_blank"} joined the project and Intercept has made a lot of progress since then. + +It has now reached a milestone where **100% of Arma 3 script commands** are available to be used and a lot of the core code was redesigned and refactored which also removed the latest hurdle in getting Intercept **whitelisted by BattlEye**. + +Besides just improving on existing code also new features have been added. The most notable being the ability to register one's own SQF commands so one can easily move small parts of one's SQF code directly to Intercept:, + +* [https://github.com/intercept/intercept/issues/10](https://github.com/intercept/intercept/issues/10){:target="_blank"} +* [https://github.com/intercept/intercept/wiki/Registered-Functions](https://github.com/intercept/intercept/wiki/Registered-Functions){:target="_blank"} + +64bit support and Linux server compatibility have been added to Intercept which was also important because now Intercept can use its full potential even on a server. + +The latest features currently in active development are cross plugin communication and a [rework of the eventhandler system](https://github.com/intercept/intercept/issues/3){:target="_blank"}. It allows doing the following: + +```cpp +// showing a message when a unit is being hit +// of who did the damage and how much damage has been inflicted +void intercept::post_init() { + static auto hitEH = addEventHandler(sqf::player(), + [](object unit, object causedBy, float damage, object instigator) { + sqf::system_chat(sqf::format({ "Ouch! %1 Hit me for %2!", causedBy, damage })); + }); +} +``` + +Thanks to [@senfo's](https://github.com/RZSenfo){:target="_blank"} ongoing investigations we might also be able to get real multi threading to SQF/Intercept. Making it possible to run some scripts in parallel. + +Intercept is already being used to create new scripting mods. [@dedmen is working on bringing LUA scripting to Arma](https://www.reddit.com/r/arma/comments/6dy7vg/lua_scripting_in_arma/){:target="_blank"}. +@overfl0, [@zakant](https://github.com/zakant){:target="_blank"} and @KoffeinFlummi are starting to bring Python scripting to life. + +What Intercept needs most right now are people trying it out, finding bugs and give ideas, and maybe even contribute to Intercept or any of the great child projects that are growing all around it. + +### The End Things +The change log for ACE3 v3.10.0 can be found here: [https://github.com/acemod/ACE3/releases/v3.10.0](https://github.com/acemod/ACE3/releases/v3.10.0){:target="_blank"} + +The change log for ACE3 v3.10.1 can be found here: [https://github.com/acemod/ACE3/releases/v3.10.1](https://github.com/acemod/ACE3/releases/v3.10.1){:target="_blank"} + +We are still in need for translations for some languages within the ACE3 project. Please have a look at [this GitHub issue to track the progress and what languages lack translations](https://github.com/acemod/ACE3/issues/367){:target="_blank"}. Any and all help with this is very appreciated. + +Make sure to [follow us on twitter](https://twitter.com/intent/follow?screen_name=ace3mod&tw_p=followbutton){:target="_blank"} and to [like our facebook page](https://www.facebook.com/ACE3Mod/){:target="_blank"}. diff --git a/docs/css/app.css b/docs/css/app.css index e0c9415d19..6621799c85 100644 --- a/docs/css/app.css +++ b/docs/css/app.css @@ -1,4 +1,4 @@ -/*! normalize.css v3.0.2 | MIT License | git.io/normalize */html{font-family:sans-serif;-ms-text-size-adjust:100%;-webkit-text-size-adjust:100%}body{margin:0}article,aside,details,figcaption,figure,footer,header,hgroup,main,menu,nav,section,summary{display:block}audio,canvas,progress,video{display:inline-block;vertical-align:baseline}audio:not([controls]){display:none;height:0}[hidden],template{display:none}a{background-color:transparent}a:active,a:hover{outline:0}abbr[title]{border-bottom:1px dotted}b,strong{font-weight:bold}dfn{font-style:italic}h1{font-size:2em;margin:0.67em 0}mark{background:#ff0;color:#000}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sup{top:-0.5em}sub{bottom:-0.25em}img{border:0}svg:not(:root){overflow:hidden}figure{margin:1em 40px}hr{-moz-box-sizing:content-box;box-sizing:content-box;height:0}pre{overflow:auto}code,kbd,pre,samp{font-family:monospace, monospace;font-size:1em}button,input,optgroup,select,textarea{color:inherit;font:inherit;margin:0}button{overflow:visible}button,select{text-transform:none}button,html input[type="button"],input[type="reset"],input[type="submit"]{-webkit-appearance:button;cursor:pointer}button[disabled],html input[disabled]{cursor:default}button::-moz-focus-inner,input::-moz-focus-inner{border:0;padding:0}input{line-height:normal}input[type="checkbox"],input[type="radio"]{box-sizing:border-box;padding:0}input[type="number"]::-webkit-inner-spin-button,input[type="number"]::-webkit-outer-spin-button{height:auto}input[type="search"]{-webkit-appearance:textfield;-moz-box-sizing:content-box;-webkit-box-sizing:content-box;box-sizing:content-box}input[type="search"]::-webkit-search-cancel-button,input[type="search"]::-webkit-search-decoration{-webkit-appearance:none}fieldset{border:1px solid #c0c0c0;margin:0 2px;padding:0.35em 0.625em 0.75em}legend{border:0;padding:0}textarea{overflow:auto}optgroup{font-weight:bold}table{border-collapse:collapse;border-spacing:0}td,th{padding:0}meta.foundation-version{font-family:"/5.5.1/"}meta.foundation-mq-small{font-family:"/only screen/";width:0em}meta.foundation-mq-small-only{font-family:"/only screen and (max-width: 40em)/";width:0em}meta.foundation-mq-medium{font-family:"/only screen and (min-width:40.0625em)/";width:40.0625em}meta.foundation-mq-medium-only{font-family:"/only screen and (min-width:40.0625em) and (max-width:64em)/";width:40.0625em}meta.foundation-mq-large{font-family:"/only screen and (min-width:64.0625em)/";width:64.0625em}meta.foundation-mq-large-only{font-family:"/only screen and (min-width:64.0625em) and (max-width:90em)/";width:64.0625em}meta.foundation-mq-xlarge{font-family:"/only screen and (min-width:90.0625em)/";width:90.0625em}meta.foundation-mq-xlarge-only{font-family:"/only screen and (min-width:90.0625em) and (max-width:120em)/";width:90.0625em}meta.foundation-mq-xxlarge{font-family:"/only screen and (min-width:120.0625em)/";width:120.0625em}meta.foundation-data-attribute-namespace{font-family:false}html,body{height:100%}*,*:before,*:after{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}html,body{font-size:100%}body{background:#fff;color:#222;padding:0;margin:0;font-family:"Open Sans","Helvetica Neue",Helvetica,Roboto,Arial,sans-serif;font-weight:400;font-style:normal;line-height:1.5;position:relative;cursor:auto}a:hover{cursor:pointer}img{max-width:100%;height:auto}img{-ms-interpolation-mode:bicubic}#map_canvas img,#map_canvas embed,#map_canvas object,.map_canvas img,.map_canvas embed,.map_canvas object{max-width:none !important}.left{float:left !important}.right{float:right !important}.clearfix:before,.clearfix:after{content:" ";display:table}.clearfix:after{clear:both}.hide{display:none}.invisible{visibility:hidden}.antialiased{-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}img{display:inline-block;vertical-align:middle}textarea{height:auto;min-height:50px}select{width:100%}[class*="block-grid-"]{display:block;padding:0;margin:0 -.625rem}[class*="block-grid-"]:before,[class*="block-grid-"]:after{content:" ";display:table}[class*="block-grid-"]:after{clear:both}[class*="block-grid-"]>li{display:block;height:auto;float:left;padding:0 .625rem 1.25rem}@media only screen{.small-block-grid-1>li{width:100%;list-style:none}.small-block-grid-1>li:nth-of-type(1n){clear:none}.small-block-grid-1>li:nth-of-type(1n+1){clear:both}.small-block-grid-2>li{width:50%;list-style:none}.small-block-grid-2>li:nth-of-type(1n){clear:none}.small-block-grid-2>li:nth-of-type(2n+1){clear:both}.small-block-grid-3>li{width:33.3333333333%;list-style:none}.small-block-grid-3>li:nth-of-type(1n){clear:none}.small-block-grid-3>li:nth-of-type(3n+1){clear:both}.small-block-grid-4>li{width:25%;list-style:none}.small-block-grid-4>li:nth-of-type(1n){clear:none}.small-block-grid-4>li:nth-of-type(4n+1){clear:both}.small-block-grid-5>li{width:20%;list-style:none}.small-block-grid-5>li:nth-of-type(1n){clear:none}.small-block-grid-5>li:nth-of-type(5n+1){clear:both}.small-block-grid-6>li{width:16.6666666667%;list-style:none}.small-block-grid-6>li:nth-of-type(1n){clear:none}.small-block-grid-6>li:nth-of-type(6n+1){clear:both}.small-block-grid-7>li{width:14.2857142857%;list-style:none}.small-block-grid-7>li:nth-of-type(1n){clear:none}.small-block-grid-7>li:nth-of-type(7n+1){clear:both}.small-block-grid-8>li{width:12.5%;list-style:none}.small-block-grid-8>li:nth-of-type(1n){clear:none}.small-block-grid-8>li:nth-of-type(8n+1){clear:both}.small-block-grid-9>li{width:11.1111111111%;list-style:none}.small-block-grid-9>li:nth-of-type(1n){clear:none}.small-block-grid-9>li:nth-of-type(9n+1){clear:both}.small-block-grid-10>li{width:10%;list-style:none}.small-block-grid-10>li:nth-of-type(1n){clear:none}.small-block-grid-10>li:nth-of-type(10n+1){clear:both}.small-block-grid-11>li{width:9.0909090909%;list-style:none}.small-block-grid-11>li:nth-of-type(1n){clear:none}.small-block-grid-11>li:nth-of-type(11n+1){clear:both}.small-block-grid-12>li{width:8.3333333333%;list-style:none}.small-block-grid-12>li:nth-of-type(1n){clear:none}.small-block-grid-12>li:nth-of-type(12n+1){clear:both}}@media only screen and (min-width: 40.0625em){.medium-block-grid-1>li{width:100%;list-style:none}.medium-block-grid-1>li:nth-of-type(1n){clear:none}.medium-block-grid-1>li:nth-of-type(1n+1){clear:both}.medium-block-grid-2>li{width:50%;list-style:none}.medium-block-grid-2>li:nth-of-type(1n){clear:none}.medium-block-grid-2>li:nth-of-type(2n+1){clear:both}.medium-block-grid-3>li{width:33.3333333333%;list-style:none}.medium-block-grid-3>li:nth-of-type(1n){clear:none}.medium-block-grid-3>li:nth-of-type(3n+1){clear:both}.medium-block-grid-4>li{width:25%;list-style:none}.medium-block-grid-4>li:nth-of-type(1n){clear:none}.medium-block-grid-4>li:nth-of-type(4n+1){clear:both}.medium-block-grid-5>li{width:20%;list-style:none}.medium-block-grid-5>li:nth-of-type(1n){clear:none}.medium-block-grid-5>li:nth-of-type(5n+1){clear:both}.medium-block-grid-6>li{width:16.6666666667%;list-style:none}.medium-block-grid-6>li:nth-of-type(1n){clear:none}.medium-block-grid-6>li:nth-of-type(6n+1){clear:both}.medium-block-grid-7>li{width:14.2857142857%;list-style:none}.medium-block-grid-7>li:nth-of-type(1n){clear:none}.medium-block-grid-7>li:nth-of-type(7n+1){clear:both}.medium-block-grid-8>li{width:12.5%;list-style:none}.medium-block-grid-8>li:nth-of-type(1n){clear:none}.medium-block-grid-8>li:nth-of-type(8n+1){clear:both}.medium-block-grid-9>li{width:11.1111111111%;list-style:none}.medium-block-grid-9>li:nth-of-type(1n){clear:none}.medium-block-grid-9>li:nth-of-type(9n+1){clear:both}.medium-block-grid-10>li{width:10%;list-style:none}.medium-block-grid-10>li:nth-of-type(1n){clear:none}.medium-block-grid-10>li:nth-of-type(10n+1){clear:both}.medium-block-grid-11>li{width:9.0909090909%;list-style:none}.medium-block-grid-11>li:nth-of-type(1n){clear:none}.medium-block-grid-11>li:nth-of-type(11n+1){clear:both}.medium-block-grid-12>li{width:8.3333333333%;list-style:none}.medium-block-grid-12>li:nth-of-type(1n){clear:none}.medium-block-grid-12>li:nth-of-type(12n+1){clear:both}}@media only screen and (min-width: 64.0625em){.large-block-grid-1>li{width:100%;list-style:none}.large-block-grid-1>li:nth-of-type(1n){clear:none}.large-block-grid-1>li:nth-of-type(1n+1){clear:both}.large-block-grid-2>li{width:50%;list-style:none}.large-block-grid-2>li:nth-of-type(1n){clear:none}.large-block-grid-2>li:nth-of-type(2n+1){clear:both}.large-block-grid-3>li{width:33.3333333333%;list-style:none}.large-block-grid-3>li:nth-of-type(1n){clear:none}.large-block-grid-3>li:nth-of-type(3n+1){clear:both}.large-block-grid-4>li{width:25%;list-style:none}.large-block-grid-4>li:nth-of-type(1n){clear:none}.large-block-grid-4>li:nth-of-type(4n+1){clear:both}.large-block-grid-5>li{width:20%;list-style:none}.large-block-grid-5>li:nth-of-type(1n){clear:none}.large-block-grid-5>li:nth-of-type(5n+1){clear:both}.large-block-grid-6>li{width:16.6666666667%;list-style:none}.large-block-grid-6>li:nth-of-type(1n){clear:none}.large-block-grid-6>li:nth-of-type(6n+1){clear:both}.large-block-grid-7>li{width:14.2857142857%;list-style:none}.large-block-grid-7>li:nth-of-type(1n){clear:none}.large-block-grid-7>li:nth-of-type(7n+1){clear:both}.large-block-grid-8>li{width:12.5%;list-style:none}.large-block-grid-8>li:nth-of-type(1n){clear:none}.large-block-grid-8>li:nth-of-type(8n+1){clear:both}.large-block-grid-9>li{width:11.1111111111%;list-style:none}.large-block-grid-9>li:nth-of-type(1n){clear:none}.large-block-grid-9>li:nth-of-type(9n+1){clear:both}.large-block-grid-10>li{width:10%;list-style:none}.large-block-grid-10>li:nth-of-type(1n){clear:none}.large-block-grid-10>li:nth-of-type(10n+1){clear:both}.large-block-grid-11>li{width:9.0909090909%;list-style:none}.large-block-grid-11>li:nth-of-type(1n){clear:none}.large-block-grid-11>li:nth-of-type(11n+1){clear:both}.large-block-grid-12>li{width:8.3333333333%;list-style:none}.large-block-grid-12>li:nth-of-type(1n){clear:none}.large-block-grid-12>li:nth-of-type(12n+1){clear:both}}button,.button{border-style:solid;border-width:0;cursor:pointer;font-family:"Open Sans","Helvetica Neue",Helvetica,Roboto,Arial,sans-serif;font-weight:400;line-height:normal;margin:0 0 1.25rem;position:relative;text-decoration:none;text-align:center;-webkit-appearance:none;-moz-appearance:none;border-radius:0;display:inline-block;padding-top:1rem;padding-right:2rem;padding-bottom:1.0625rem;padding-left:2rem;font-size:1rem;background-color:#ba2619;border-color:#951e14;color:#fff;transition:background-color 300ms ease-out}button:hover,button:focus,.button:hover,.button:focus{background-color:#951e14}button:hover,button:focus,.button:hover,.button:focus{color:#fff}button.secondary,.button.secondary{background-color:#e7e7e7;border-color:#b9b9b9;color:#333}button.secondary:hover,button.secondary:focus,.button.secondary:hover,.button.secondary:focus{background-color:#b9b9b9}button.secondary:hover,button.secondary:focus,.button.secondary:hover,.button.secondary:focus{color:#333}button.success,.button.success{background-color:#43AC6A;border-color:#368a55;color:#fff}button.success:hover,button.success:focus,.button.success:hover,.button.success:focus{background-color:#368a55}button.success:hover,button.success:focus,.button.success:hover,.button.success:focus{color:#fff}button.alert,.button.alert{background-color:#f04124;border-color:#cf2a0e;color:#fff}button.alert:hover,button.alert:focus,.button.alert:hover,.button.alert:focus{background-color:#cf2a0e}button.alert:hover,button.alert:focus,.button.alert:hover,.button.alert:focus{color:#fff}button.warning,.button.warning{background-color:#f08a24;border-color:#cf6e0e;color:#fff}button.warning:hover,button.warning:focus,.button.warning:hover,.button.warning:focus{background-color:#cf6e0e}button.warning:hover,button.warning:focus,.button.warning:hover,.button.warning:focus{color:#fff}button.info,.button.info{background-color:#a0d3e8;border-color:#61b6d9;color:#333}button.info:hover,button.info:focus,.button.info:hover,.button.info:focus{background-color:#61b6d9}button.info:hover,button.info:focus,.button.info:hover,.button.info:focus{color:#fff}button.large,.button.large{padding-top:1.125rem;padding-right:2.25rem;padding-bottom:1.1875rem;padding-left:2.25rem;font-size:1.25rem}button.small,.button.small{padding-top:.875rem;padding-right:1.75rem;padding-bottom:.9375rem;padding-left:1.75rem;font-size:.8125rem}button.tiny,.button.tiny{padding-top:.625rem;padding-right:1.25rem;padding-bottom:.6875rem;padding-left:1.25rem;font-size:.6875rem}button.expand,.button.expand{padding-right:0;padding-left:0;width:100%}button.left-align,.button.left-align{text-align:left;text-indent:.75rem}button.right-align,.button.right-align{text-align:right;padding-right:.75rem}button.radius,.button.radius{border-radius:3px}button.round,.button.round{border-radius:1000px}button.disabled,button[disabled],.button.disabled,.button[disabled]{background-color:#ba2619;border-color:#951e14;color:#fff;cursor:default;opacity:.7;box-shadow:none}button.disabled:hover,button.disabled:focus,button[disabled]:hover,button[disabled]:focus,.button.disabled:hover,.button.disabled:focus,.button[disabled]:hover,.button[disabled]:focus{background-color:#951e14}button.disabled:hover,button.disabled:focus,button[disabled]:hover,button[disabled]:focus,.button.disabled:hover,.button.disabled:focus,.button[disabled]:hover,.button[disabled]:focus{color:#fff}button.disabled:hover,button.disabled:focus,button[disabled]:hover,button[disabled]:focus,.button.disabled:hover,.button.disabled:focus,.button[disabled]:hover,.button[disabled]:focus{background-color:#ba2619}button.disabled.secondary,button[disabled].secondary,.button.disabled.secondary,.button[disabled].secondary{background-color:#e7e7e7;border-color:#b9b9b9;color:#333;cursor:default;opacity:.7;box-shadow:none}button.disabled.secondary:hover,button.disabled.secondary:focus,button[disabled].secondary:hover,button[disabled].secondary:focus,.button.disabled.secondary:hover,.button.disabled.secondary:focus,.button[disabled].secondary:hover,.button[disabled].secondary:focus{background-color:#b9b9b9}button.disabled.secondary:hover,button.disabled.secondary:focus,button[disabled].secondary:hover,button[disabled].secondary:focus,.button.disabled.secondary:hover,.button.disabled.secondary:focus,.button[disabled].secondary:hover,.button[disabled].secondary:focus{color:#333}button.disabled.secondary:hover,button.disabled.secondary:focus,button[disabled].secondary:hover,button[disabled].secondary:focus,.button.disabled.secondary:hover,.button.disabled.secondary:focus,.button[disabled].secondary:hover,.button[disabled].secondary:focus{background-color:#e7e7e7}button.disabled.success,button[disabled].success,.button.disabled.success,.button[disabled].success{background-color:#43AC6A;border-color:#368a55;color:#fff;cursor:default;opacity:.7;box-shadow:none}button.disabled.success:hover,button.disabled.success:focus,button[disabled].success:hover,button[disabled].success:focus,.button.disabled.success:hover,.button.disabled.success:focus,.button[disabled].success:hover,.button[disabled].success:focus{background-color:#368a55}button.disabled.success:hover,button.disabled.success:focus,button[disabled].success:hover,button[disabled].success:focus,.button.disabled.success:hover,.button.disabled.success:focus,.button[disabled].success:hover,.button[disabled].success:focus{color:#fff}button.disabled.success:hover,button.disabled.success:focus,button[disabled].success:hover,button[disabled].success:focus,.button.disabled.success:hover,.button.disabled.success:focus,.button[disabled].success:hover,.button[disabled].success:focus{background-color:#43AC6A}button.disabled.alert,button[disabled].alert,.button.disabled.alert,.button[disabled].alert{background-color:#f04124;border-color:#cf2a0e;color:#fff;cursor:default;opacity:.7;box-shadow:none}button.disabled.alert:hover,button.disabled.alert:focus,button[disabled].alert:hover,button[disabled].alert:focus,.button.disabled.alert:hover,.button.disabled.alert:focus,.button[disabled].alert:hover,.button[disabled].alert:focus{background-color:#cf2a0e}button.disabled.alert:hover,button.disabled.alert:focus,button[disabled].alert:hover,button[disabled].alert:focus,.button.disabled.alert:hover,.button.disabled.alert:focus,.button[disabled].alert:hover,.button[disabled].alert:focus{color:#fff}button.disabled.alert:hover,button.disabled.alert:focus,button[disabled].alert:hover,button[disabled].alert:focus,.button.disabled.alert:hover,.button.disabled.alert:focus,.button[disabled].alert:hover,.button[disabled].alert:focus{background-color:#f04124}button.disabled.warning,button[disabled].warning,.button.disabled.warning,.button[disabled].warning{background-color:#f08a24;border-color:#cf6e0e;color:#fff;cursor:default;opacity:.7;box-shadow:none}button.disabled.warning:hover,button.disabled.warning:focus,button[disabled].warning:hover,button[disabled].warning:focus,.button.disabled.warning:hover,.button.disabled.warning:focus,.button[disabled].warning:hover,.button[disabled].warning:focus{background-color:#cf6e0e}button.disabled.warning:hover,button.disabled.warning:focus,button[disabled].warning:hover,button[disabled].warning:focus,.button.disabled.warning:hover,.button.disabled.warning:focus,.button[disabled].warning:hover,.button[disabled].warning:focus{color:#fff}button.disabled.warning:hover,button.disabled.warning:focus,button[disabled].warning:hover,button[disabled].warning:focus,.button.disabled.warning:hover,.button.disabled.warning:focus,.button[disabled].warning:hover,.button[disabled].warning:focus{background-color:#f08a24}button.disabled.info,button[disabled].info,.button.disabled.info,.button[disabled].info{background-color:#a0d3e8;border-color:#61b6d9;color:#333;cursor:default;opacity:.7;box-shadow:none}button.disabled.info:hover,button.disabled.info:focus,button[disabled].info:hover,button[disabled].info:focus,.button.disabled.info:hover,.button.disabled.info:focus,.button[disabled].info:hover,.button[disabled].info:focus{background-color:#61b6d9}button.disabled.info:hover,button.disabled.info:focus,button[disabled].info:hover,button[disabled].info:focus,.button.disabled.info:hover,.button.disabled.info:focus,.button[disabled].info:hover,.button[disabled].info:focus{color:#fff}button.disabled.info:hover,button.disabled.info:focus,button[disabled].info:hover,button[disabled].info:focus,.button.disabled.info:hover,.button.disabled.info:focus,.button[disabled].info:hover,.button[disabled].info:focus{background-color:#a0d3e8}button::-moz-focus-inner{border:0;padding:0}@media only screen and (min-width: 40.0625em){button,.button{display:inline-block}}.clearing-thumbs,[data-clearing]{margin-bottom:0;margin-left:0;list-style:none}.clearing-thumbs:before,.clearing-thumbs:after,[data-clearing]:before,[data-clearing]:after{content:" ";display:table}.clearing-thumbs:after,[data-clearing]:after{clear:both}.clearing-thumbs li,[data-clearing] li{float:left;margin-right:10px}.clearing-thumbs[class*="block-grid-"] li,[data-clearing][class*="block-grid-"] li{margin-right:0}.clearing-blackout{background:#333;position:fixed;width:100%;height:100%;top:0;left:0;z-index:998}.clearing-blackout .clearing-close{display:block}.clearing-container{position:relative;z-index:998;height:100%;overflow:hidden;margin:0}.clearing-touch-label{position:absolute;top:50%;left:50%;color:#aaa;font-size:0.6em}.visible-img{height:95%;position:relative}.visible-img img{position:absolute;left:50%;top:50%;transform:translateY(-50%) translateX(-50%);-webkit-transform:translateY(-50%) translateX(-50%);-ms-transform:translateY(-50%) translateX(-50%);max-height:100%;max-width:100%}.clearing-caption{color:#ccc;font-size:.875em;line-height:1.3;margin-bottom:0;text-align:center;bottom:0;background:#333;width:100%;padding:10px 30px 20px;position:absolute;left:0}.clearing-close{z-index:999;padding-left:20px;padding-top:10px;font-size:30px;line-height:1;color:#ccc;display:none}.clearing-close:hover,.clearing-close:focus{color:#ccc}.clearing-assembled .clearing-container{height:100%}.clearing-assembled .clearing-container .carousel>ul{display:none}.clearing-feature li{display:none}.clearing-feature li.clearing-featured-img{display:block}@media only screen and (min-width: 40.0625em){.clearing-main-prev,.clearing-main-next{position:absolute;height:100%;width:40px;top:0}.clearing-main-prev>span,.clearing-main-next>span{position:absolute;top:50%;display:block;width:0;height:0;border:solid 12px}.clearing-main-prev>span:hover,.clearing-main-next>span:hover{opacity:0.8}.clearing-main-prev{left:0}.clearing-main-prev>span{left:5px;border-color:transparent;border-right-color:#ccc}.clearing-main-next{right:0}.clearing-main-next>span{border-color:transparent;border-left-color:#ccc}.clearing-main-prev.disabled,.clearing-main-next.disabled{opacity:0.3}.clearing-assembled .clearing-container .carousel{background:rgba(51,51,51,0.8);height:120px;margin-top:10px;text-align:center}.clearing-assembled .clearing-container .carousel>ul{display:inline-block;z-index:999;height:100%;position:relative;float:none}.clearing-assembled .clearing-container .carousel>ul li{display:block;width:120px;min-height:inherit;float:left;overflow:hidden;margin-right:0;padding:0;position:relative;cursor:pointer;opacity:0.4;clear:none}.clearing-assembled .clearing-container .carousel>ul li.fix-height img{height:100%;max-width:none}.clearing-assembled .clearing-container .carousel>ul li a.th{border:none;box-shadow:none;display:block}.clearing-assembled .clearing-container .carousel>ul li img{cursor:pointer !important;width:100% !important}.clearing-assembled .clearing-container .carousel>ul li.visible{opacity:1}.clearing-assembled .clearing-container .carousel>ul li:hover{opacity:0.8}.clearing-assembled .clearing-container .visible-img{background:#333;overflow:hidden;height:85%}.clearing-close{position:absolute;top:10px;right:20px;padding-left:0;padding-top:0}}form{margin:0 0 1rem}form .row .row{margin:0 -.5rem}form .row .row .column,form .row .row .columns{padding:0 .5rem}form .row .row.collapse{margin:0}form .row .row.collapse .column,form .row .row.collapse .columns{padding:0}form .row .row.collapse input{-webkit-border-bottom-right-radius:0;-webkit-border-top-right-radius:0;border-bottom-right-radius:0;border-top-right-radius:0}form .row input.column,form .row input.columns,form .row textarea.column,form .row textarea.columns{padding-left:.5rem}label{font-size:.875rem;color:#4d4d4d;cursor:pointer;display:block;font-weight:400;line-height:1.5;margin-bottom:0}label.right{float:none !important;text-align:right}label.inline{margin:0 0 1rem 0;padding:.5625rem 0}label small{text-transform:capitalize;color:#676767}.prefix,.postfix{display:block;position:relative;z-index:2;text-align:center;width:100%;padding-top:0;padding-bottom:0;border-style:solid;border-width:1px;overflow:visible;font-size:.875rem;height:2.3125rem;line-height:2.3125rem}.postfix.button{padding-left:0;padding-right:0;padding-top:0;padding-bottom:0;text-align:center;border:none}.prefix.button{padding-left:0;padding-right:0;padding-top:0;padding-bottom:0;text-align:center;border:none}.prefix.button.radius{border-radius:0;-webkit-border-bottom-left-radius:3px;-webkit-border-top-left-radius:3px;border-bottom-left-radius:3px;border-top-left-radius:3px}.postfix.button.radius{border-radius:0;-webkit-border-bottom-right-radius:3px;-webkit-border-top-right-radius:3px;border-bottom-right-radius:3px;border-top-right-radius:3px}.prefix.button.round{border-radius:0;-webkit-border-bottom-left-radius:1000px;-webkit-border-top-left-radius:1000px;border-bottom-left-radius:1000px;border-top-left-radius:1000px}.postfix.button.round{border-radius:0;-webkit-border-bottom-right-radius:1000px;-webkit-border-top-right-radius:1000px;border-bottom-right-radius:1000px;border-top-right-radius:1000px}span.prefix,label.prefix{background:#f2f2f2;border-right:none;color:#333;border-color:#ccc}span.postfix,label.postfix{background:#f2f2f2;border-left:none;color:#333;border-color:#ccc}input[type="text"],input[type="password"],input[type="date"],input[type="datetime"],input[type="datetime-local"],input[type="month"],input[type="week"],input[type="email"],input[type="number"],input[type="search"],input[type="tel"],input[type="time"],input[type="url"],input[type="color"],textarea{-webkit-appearance:none;border-radius:0;background-color:#fff;font-family:inherit;border-style:solid;border-width:1px;border-color:#ccc;box-shadow:inset 0 1px 2px rgba(0,0,0,0.1);color:rgba(0,0,0,0.75);display:block;font-size:.875rem;margin:0 0 1rem 0;padding:.5rem;height:2.3125rem;width:100%;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;transition:all .15s linear}input[type="text"]:focus,input[type="password"]:focus,input[type="date"]:focus,input[type="datetime"]:focus,input[type="datetime-local"]:focus,input[type="month"]:focus,input[type="week"]:focus,input[type="email"]:focus,input[type="number"]:focus,input[type="search"]:focus,input[type="tel"]:focus,input[type="time"]:focus,input[type="url"]:focus,input[type="color"]:focus,textarea:focus{background:#fafafa;border-color:#999;outline:none}input[type="text"]:disabled,input[type="password"]:disabled,input[type="date"]:disabled,input[type="datetime"]:disabled,input[type="datetime-local"]:disabled,input[type="month"]:disabled,input[type="week"]:disabled,input[type="email"]:disabled,input[type="number"]:disabled,input[type="search"]:disabled,input[type="tel"]:disabled,input[type="time"]:disabled,input[type="url"]:disabled,input[type="color"]:disabled,textarea:disabled{background-color:#ddd;cursor:default}input[type="text"][disabled],input[type="text"][readonly],fieldset[disabled] input[type="text"],input[type="password"][disabled],input[type="password"][readonly],fieldset[disabled] input[type="password"],input[type="date"][disabled],input[type="date"][readonly],fieldset[disabled] input[type="date"],input[type="datetime"][disabled],input[type="datetime"][readonly],fieldset[disabled] input[type="datetime"],input[type="datetime-local"][disabled],input[type="datetime-local"][readonly],fieldset[disabled] input[type="datetime-local"],input[type="month"][disabled],input[type="month"][readonly],fieldset[disabled] input[type="month"],input[type="week"][disabled],input[type="week"][readonly],fieldset[disabled] input[type="week"],input[type="email"][disabled],input[type="email"][readonly],fieldset[disabled] input[type="email"],input[type="number"][disabled],input[type="number"][readonly],fieldset[disabled] input[type="number"],input[type="search"][disabled],input[type="search"][readonly],fieldset[disabled] input[type="search"],input[type="tel"][disabled],input[type="tel"][readonly],fieldset[disabled] input[type="tel"],input[type="time"][disabled],input[type="time"][readonly],fieldset[disabled] input[type="time"],input[type="url"][disabled],input[type="url"][readonly],fieldset[disabled] input[type="url"],input[type="color"][disabled],input[type="color"][readonly],fieldset[disabled] input[type="color"],textarea[disabled],textarea[readonly],fieldset[disabled] textarea{background-color:#ddd;cursor:default}input[type="text"].radius,input[type="password"].radius,input[type="date"].radius,input[type="datetime"].radius,input[type="datetime-local"].radius,input[type="month"].radius,input[type="week"].radius,input[type="email"].radius,input[type="number"].radius,input[type="search"].radius,input[type="tel"].radius,input[type="time"].radius,input[type="url"].radius,input[type="color"].radius,textarea.radius{border-radius:3px}form .row .prefix-radius.row.collapse input,form .row .prefix-radius.row.collapse textarea,form .row .prefix-radius.row.collapse select,form .row .prefix-radius.row.collapse button{border-radius:0;-webkit-border-bottom-right-radius:3px;-webkit-border-top-right-radius:3px;border-bottom-right-radius:3px;border-top-right-radius:3px}form .row .prefix-radius.row.collapse .prefix{border-radius:0;-webkit-border-bottom-left-radius:3px;-webkit-border-top-left-radius:3px;border-bottom-left-radius:3px;border-top-left-radius:3px}form .row .postfix-radius.row.collapse input,form .row .postfix-radius.row.collapse textarea,form .row .postfix-radius.row.collapse select,form .row .postfix-radius.row.collapse button{border-radius:0;-webkit-border-bottom-left-radius:3px;-webkit-border-top-left-radius:3px;border-bottom-left-radius:3px;border-top-left-radius:3px}form .row .postfix-radius.row.collapse .postfix{border-radius:0;-webkit-border-bottom-right-radius:3px;-webkit-border-top-right-radius:3px;border-bottom-right-radius:3px;border-top-right-radius:3px}form .row .prefix-round.row.collapse input,form .row .prefix-round.row.collapse textarea,form .row .prefix-round.row.collapse select,form .row .prefix-round.row.collapse button{border-radius:0;-webkit-border-bottom-right-radius:1000px;-webkit-border-top-right-radius:1000px;border-bottom-right-radius:1000px;border-top-right-radius:1000px}form .row .prefix-round.row.collapse .prefix{border-radius:0;-webkit-border-bottom-left-radius:1000px;-webkit-border-top-left-radius:1000px;border-bottom-left-radius:1000px;border-top-left-radius:1000px}form .row .postfix-round.row.collapse input,form .row .postfix-round.row.collapse textarea,form .row .postfix-round.row.collapse select,form .row .postfix-round.row.collapse button{border-radius:0;-webkit-border-bottom-left-radius:1000px;-webkit-border-top-left-radius:1000px;border-bottom-left-radius:1000px;border-top-left-radius:1000px}form .row .postfix-round.row.collapse .postfix{border-radius:0;-webkit-border-bottom-right-radius:1000px;-webkit-border-top-right-radius:1000px;border-bottom-right-radius:1000px;border-top-right-radius:1000px}input[type="submit"]{-webkit-appearance:none;border-radius:0}textarea[rows]{height:auto}textarea{max-width:100%}select{-webkit-appearance:none !important;border-radius:0;background-color:#FAFAFA;background-image:url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZlcnNpb249IjEuMSIgeD0iMTJweCIgeT0iMHB4IiB3aWR0aD0iMjRweCIgaGVpZ2h0PSIzcHgiIHZpZXdCb3g9IjAgMCA2IDMiIGVuYWJsZS1iYWNrZ3JvdW5kPSJuZXcgMCAwIDYgMyIgeG1sOnNwYWNlPSJwcmVzZXJ2ZSI+PHBvbHlnb24gcG9pbnRzPSI1Ljk5MiwwIDIuOTkyLDMgLTAuMDA4LDAgIi8+PC9zdmc+);background-position:100% center;background-repeat:no-repeat;border-style:solid;border-width:1px;border-color:#ccc;padding:.5rem;font-size:.875rem;font-family:"Open Sans","Helvetica Neue",Helvetica,Roboto,Arial,sans-serif;color:rgba(0,0,0,0.75);line-height:normal;border-radius:0;height:2.3125rem}select::-ms-expand{display:none}select.radius{border-radius:3px}select:hover{background-color:#f3f3f3;border-color:#999}select:disabled{background-color:#ddd;cursor:default}select[multiple]{height:auto}input[type="file"],input[type="checkbox"],input[type="radio"],select{margin:0 0 1rem 0}input[type="checkbox"]+label,input[type="radio"]+label{display:inline-block;margin-left:.5rem;margin-right:1rem;margin-bottom:0;vertical-align:baseline}input[type="file"]{width:100%}fieldset{border:1px solid #ddd;padding:1.25rem;margin:1.125rem 0}fieldset legend{font-weight:700;background:#fff;padding:0 .1875rem;margin:0;margin-left:-.1875rem}[data-abide] .error small.error,[data-abide] .error span.error,[data-abide] span.error,[data-abide] small.error{display:block;padding:.375rem .5625rem .5625rem;margin-top:-1px;margin-bottom:1rem;font-size:.75rem;font-weight:400;font-style:italic;background:#f04124;color:#fff}[data-abide] span.error,[data-abide] small.error{display:none}span.error,small.error{display:block;padding:.375rem .5625rem .5625rem;margin-top:-1px;margin-bottom:1rem;font-size:.75rem;font-weight:400;font-style:italic;background:#f04124;color:#fff}.error input,.error textarea,.error select{margin-bottom:0}.error input[type="checkbox"],.error input[type="radio"]{margin-bottom:1rem}.error label,.error label.error{color:#f04124}.error small.error{display:block;padding:.375rem .5625rem .5625rem;margin-top:-1px;margin-bottom:1rem;font-size:.75rem;font-weight:400;font-style:italic;background:#f04124;color:#fff}.error>label>small{color:#676767;background:transparent;padding:0;text-transform:capitalize;font-style:normal;font-size:60%;margin:0;display:inline}.error span.error-message{display:block}input.error,textarea.error,select.error{margin-bottom:0}label.error{color:#f04124}.row{width:100%;margin-left:auto;margin-right:auto;margin-top:0;margin-bottom:0;max-width:62.5rem}.row:before,.row:after{content:" ";display:table}.row:after{clear:both}.row.collapse>.column,.row.collapse>.columns{padding-left:0;padding-right:0}.row.collapse .row{margin-left:0;margin-right:0}.row .row{width:auto;margin-left:-.9375rem;margin-right:-.9375rem;margin-top:0;margin-bottom:0;max-width:none}.row .row:before,.row .row:after{content:" ";display:table}.row .row:after{clear:both}.row .row.collapse{width:auto;margin:0;max-width:none}.row .row.collapse:before,.row .row.collapse:after{content:" ";display:table}.row .row.collapse:after{clear:both}.column,.columns{padding-left:.9375rem;padding-right:.9375rem;width:100%;float:left}[class*="column"]+[class*="column"]:last-child{float:right}[class*="column"]+[class*="column"].end{float:left}@media only screen{.small-push-0{position:relative;left:0%;right:auto}.small-pull-0{position:relative;right:0%;left:auto}.small-push-1{position:relative;left:8.3333333333%;right:auto}.small-pull-1{position:relative;right:8.3333333333%;left:auto}.small-push-2{position:relative;left:16.6666666667%;right:auto}.small-pull-2{position:relative;right:16.6666666667%;left:auto}.small-push-3{position:relative;left:25%;right:auto}.small-pull-3{position:relative;right:25%;left:auto}.small-push-4{position:relative;left:33.3333333333%;right:auto}.small-pull-4{position:relative;right:33.3333333333%;left:auto}.small-push-5{position:relative;left:41.6666666667%;right:auto}.small-pull-5{position:relative;right:41.6666666667%;left:auto}.small-push-6{position:relative;left:50%;right:auto}.small-pull-6{position:relative;right:50%;left:auto}.small-push-7{position:relative;left:58.3333333333%;right:auto}.small-pull-7{position:relative;right:58.3333333333%;left:auto}.small-push-8{position:relative;left:66.6666666667%;right:auto}.small-pull-8{position:relative;right:66.6666666667%;left:auto}.small-push-9{position:relative;left:75%;right:auto}.small-pull-9{position:relative;right:75%;left:auto}.small-push-10{position:relative;left:83.3333333333%;right:auto}.small-pull-10{position:relative;right:83.3333333333%;left:auto}.small-push-11{position:relative;left:91.6666666667%;right:auto}.small-pull-11{position:relative;right:91.6666666667%;left:auto}.column,.columns{position:relative;padding-left:.9375rem;padding-right:.9375rem;float:left}.small-1{width:8.3333333333%}.small-2{width:16.6666666667%}.small-3{width:25%}.small-4{width:33.3333333333%}.small-5{width:41.6666666667%}.small-6{width:50%}.small-7{width:58.3333333333%}.small-8{width:66.6666666667%}.small-9{width:75%}.small-10{width:83.3333333333%}.small-11{width:91.6666666667%}.small-12{width:100%}.small-offset-0{margin-left:0% !important}.small-offset-1{margin-left:8.3333333333% !important}.small-offset-2{margin-left:16.6666666667% !important}.small-offset-3{margin-left:25% !important}.small-offset-4{margin-left:33.3333333333% !important}.small-offset-5{margin-left:41.6666666667% !important}.small-offset-6{margin-left:50% !important}.small-offset-7{margin-left:58.3333333333% !important}.small-offset-8{margin-left:66.6666666667% !important}.small-offset-9{margin-left:75% !important}.small-offset-10{margin-left:83.3333333333% !important}.small-offset-11{margin-left:91.6666666667% !important}.small-reset-order{margin-left:0;margin-right:0;left:auto;right:auto;float:left}.column.small-centered,.columns.small-centered{margin-left:auto;margin-right:auto;float:none}.column.small-uncentered,.columns.small-uncentered{margin-left:0;margin-right:0;float:left}.column.small-centered:last-child,.columns.small-centered:last-child{float:none}.column.small-uncentered:last-child,.columns.small-uncentered:last-child{float:left}.column.small-uncentered.opposite,.columns.small-uncentered.opposite{float:right}.row.small-collapse>.column,.row.small-collapse>.columns{padding-left:0;padding-right:0}.row.small-collapse .row{margin-left:0;margin-right:0}.row.small-uncollapse>.column,.row.small-uncollapse>.columns{padding-left:.9375rem;padding-right:.9375rem;float:left}}@media only screen and (min-width: 40.0625em){.medium-push-0{position:relative;left:0%;right:auto}.medium-pull-0{position:relative;right:0%;left:auto}.medium-push-1{position:relative;left:8.3333333333%;right:auto}.medium-pull-1{position:relative;right:8.3333333333%;left:auto}.medium-push-2{position:relative;left:16.6666666667%;right:auto}.medium-pull-2{position:relative;right:16.6666666667%;left:auto}.medium-push-3{position:relative;left:25%;right:auto}.medium-pull-3{position:relative;right:25%;left:auto}.medium-push-4{position:relative;left:33.3333333333%;right:auto}.medium-pull-4{position:relative;right:33.3333333333%;left:auto}.medium-push-5{position:relative;left:41.6666666667%;right:auto}.medium-pull-5{position:relative;right:41.6666666667%;left:auto}.medium-push-6{position:relative;left:50%;right:auto}.medium-pull-6{position:relative;right:50%;left:auto}.medium-push-7{position:relative;left:58.3333333333%;right:auto}.medium-pull-7{position:relative;right:58.3333333333%;left:auto}.medium-push-8{position:relative;left:66.6666666667%;right:auto}.medium-pull-8{position:relative;right:66.6666666667%;left:auto}.medium-push-9{position:relative;left:75%;right:auto}.medium-pull-9{position:relative;right:75%;left:auto}.medium-push-10{position:relative;left:83.3333333333%;right:auto}.medium-pull-10{position:relative;right:83.3333333333%;left:auto}.medium-push-11{position:relative;left:91.6666666667%;right:auto}.medium-pull-11{position:relative;right:91.6666666667%;left:auto}.column,.columns{position:relative;padding-left:.9375rem;padding-right:.9375rem;float:left}.medium-1{width:8.3333333333%}.medium-2{width:16.6666666667%}.medium-3{width:25%}.medium-4{width:33.3333333333%}.medium-5{width:41.6666666667%}.medium-6{width:50%}.medium-7{width:58.3333333333%}.medium-8{width:66.6666666667%}.medium-9{width:75%}.medium-10{width:83.3333333333%}.medium-11{width:91.6666666667%}.medium-12{width:100%}.medium-offset-0{margin-left:0% !important}.medium-offset-1{margin-left:8.3333333333% !important}.medium-offset-2{margin-left:16.6666666667% !important}.medium-offset-3{margin-left:25% !important}.medium-offset-4{margin-left:33.3333333333% !important}.medium-offset-5{margin-left:41.6666666667% !important}.medium-offset-6{margin-left:50% !important}.medium-offset-7{margin-left:58.3333333333% !important}.medium-offset-8{margin-left:66.6666666667% !important}.medium-offset-9{margin-left:75% !important}.medium-offset-10{margin-left:83.3333333333% !important}.medium-offset-11{margin-left:91.6666666667% !important}.medium-reset-order{margin-left:0;margin-right:0;left:auto;right:auto;float:left}.column.medium-centered,.columns.medium-centered{margin-left:auto;margin-right:auto;float:none}.column.medium-uncentered,.columns.medium-uncentered{margin-left:0;margin-right:0;float:left}.column.medium-centered:last-child,.columns.medium-centered:last-child{float:none}.column.medium-uncentered:last-child,.columns.medium-uncentered:last-child{float:left}.column.medium-uncentered.opposite,.columns.medium-uncentered.opposite{float:right}.row.medium-collapse>.column,.row.medium-collapse>.columns{padding-left:0;padding-right:0}.row.medium-collapse .row{margin-left:0;margin-right:0}.row.medium-uncollapse>.column,.row.medium-uncollapse>.columns{padding-left:.9375rem;padding-right:.9375rem;float:left}.push-0{position:relative;left:0%;right:auto}.pull-0{position:relative;right:0%;left:auto}.push-1{position:relative;left:8.3333333333%;right:auto}.pull-1{position:relative;right:8.3333333333%;left:auto}.push-2{position:relative;left:16.6666666667%;right:auto}.pull-2{position:relative;right:16.6666666667%;left:auto}.push-3{position:relative;left:25%;right:auto}.pull-3{position:relative;right:25%;left:auto}.push-4{position:relative;left:33.3333333333%;right:auto}.pull-4{position:relative;right:33.3333333333%;left:auto}.push-5{position:relative;left:41.6666666667%;right:auto}.pull-5{position:relative;right:41.6666666667%;left:auto}.push-6{position:relative;left:50%;right:auto}.pull-6{position:relative;right:50%;left:auto}.push-7{position:relative;left:58.3333333333%;right:auto}.pull-7{position:relative;right:58.3333333333%;left:auto}.push-8{position:relative;left:66.6666666667%;right:auto}.pull-8{position:relative;right:66.6666666667%;left:auto}.push-9{position:relative;left:75%;right:auto}.pull-9{position:relative;right:75%;left:auto}.push-10{position:relative;left:83.3333333333%;right:auto}.pull-10{position:relative;right:83.3333333333%;left:auto}.push-11{position:relative;left:91.6666666667%;right:auto}.pull-11{position:relative;right:91.6666666667%;left:auto}}@media only screen and (min-width: 64.0625em){.large-push-0{position:relative;left:0%;right:auto}.large-pull-0{position:relative;right:0%;left:auto}.large-push-1{position:relative;left:8.3333333333%;right:auto}.large-pull-1{position:relative;right:8.3333333333%;left:auto}.large-push-2{position:relative;left:16.6666666667%;right:auto}.large-pull-2{position:relative;right:16.6666666667%;left:auto}.large-push-3{position:relative;left:25%;right:auto}.large-pull-3{position:relative;right:25%;left:auto}.large-push-4{position:relative;left:33.3333333333%;right:auto}.large-pull-4{position:relative;right:33.3333333333%;left:auto}.large-push-5{position:relative;left:41.6666666667%;right:auto}.large-pull-5{position:relative;right:41.6666666667%;left:auto}.large-push-6{position:relative;left:50%;right:auto}.large-pull-6{position:relative;right:50%;left:auto}.large-push-7{position:relative;left:58.3333333333%;right:auto}.large-pull-7{position:relative;right:58.3333333333%;left:auto}.large-push-8{position:relative;left:66.6666666667%;right:auto}.large-pull-8{position:relative;right:66.6666666667%;left:auto}.large-push-9{position:relative;left:75%;right:auto}.large-pull-9{position:relative;right:75%;left:auto}.large-push-10{position:relative;left:83.3333333333%;right:auto}.large-pull-10{position:relative;right:83.3333333333%;left:auto}.large-push-11{position:relative;left:91.6666666667%;right:auto}.large-pull-11{position:relative;right:91.6666666667%;left:auto}.column,.columns{position:relative;padding-left:.9375rem;padding-right:.9375rem;float:left}.large-1{width:8.3333333333%}.large-2{width:16.6666666667%}.large-3{width:25%}.large-4{width:33.3333333333%}.large-5{width:41.6666666667%}.large-6{width:50%}.large-7{width:58.3333333333%}.large-8{width:66.6666666667%}.large-9{width:75%}.large-10{width:83.3333333333%}.large-11{width:91.6666666667%}.large-12{width:100%}.large-offset-0{margin-left:0% !important}.large-offset-1{margin-left:8.3333333333% !important}.large-offset-2{margin-left:16.6666666667% !important}.large-offset-3{margin-left:25% !important}.large-offset-4{margin-left:33.3333333333% !important}.large-offset-5{margin-left:41.6666666667% !important}.large-offset-6{margin-left:50% !important}.large-offset-7{margin-left:58.3333333333% !important}.large-offset-8{margin-left:66.6666666667% !important}.large-offset-9{margin-left:75% !important}.large-offset-10{margin-left:83.3333333333% !important}.large-offset-11{margin-left:91.6666666667% !important}.large-reset-order{margin-left:0;margin-right:0;left:auto;right:auto;float:left}.column.large-centered,.columns.large-centered{margin-left:auto;margin-right:auto;float:none}.column.large-uncentered,.columns.large-uncentered{margin-left:0;margin-right:0;float:left}.column.large-centered:last-child,.columns.large-centered:last-child{float:none}.column.large-uncentered:last-child,.columns.large-uncentered:last-child{float:left}.column.large-uncentered.opposite,.columns.large-uncentered.opposite{float:right}.row.large-collapse>.column,.row.large-collapse>.columns{padding-left:0;padding-right:0}.row.large-collapse .row{margin-left:0;margin-right:0}.row.large-uncollapse>.column,.row.large-uncollapse>.columns{padding-left:.9375rem;padding-right:.9375rem;float:left}.push-0{position:relative;left:0%;right:auto}.pull-0{position:relative;right:0%;left:auto}.push-1{position:relative;left:8.3333333333%;right:auto}.pull-1{position:relative;right:8.3333333333%;left:auto}.push-2{position:relative;left:16.6666666667%;right:auto}.pull-2{position:relative;right:16.6666666667%;left:auto}.push-3{position:relative;left:25%;right:auto}.pull-3{position:relative;right:25%;left:auto}.push-4{position:relative;left:33.3333333333%;right:auto}.pull-4{position:relative;right:33.3333333333%;left:auto}.push-5{position:relative;left:41.6666666667%;right:auto}.pull-5{position:relative;right:41.6666666667%;left:auto}.push-6{position:relative;left:50%;right:auto}.pull-6{position:relative;right:50%;left:auto}.push-7{position:relative;left:58.3333333333%;right:auto}.pull-7{position:relative;right:58.3333333333%;left:auto}.push-8{position:relative;left:66.6666666667%;right:auto}.pull-8{position:relative;right:66.6666666667%;left:auto}.push-9{position:relative;left:75%;right:auto}.pull-9{position:relative;right:75%;left:auto}.push-10{position:relative;left:83.3333333333%;right:auto}.pull-10{position:relative;right:83.3333333333%;left:auto}.push-11{position:relative;left:91.6666666667%;right:auto}.pull-11{position:relative;right:91.6666666667%;left:auto}}.inline-list{margin:0 auto 1.0625rem auto;margin-left:-1.375rem;margin-right:0;padding:0;list-style:none;overflow:hidden}.inline-list>li{list-style:none;float:left;margin-left:1.375rem;display:block}.inline-list>li>*{display:block}.panel{border-style:solid;border-width:1px;border-color:#d8d8d8;margin-bottom:1.25rem;padding:1.25rem;background:#f2f2f2;color:#333}.panel>:first-child{margin-top:0}.panel>:last-child{margin-bottom:0}.panel h1,.panel h2,.panel h3,.panel h4,.panel h5,.panel h6,.panel p,.panel li,.panel dl{color:#333}.panel h1,.panel h2,.panel h3,.panel h4,.panel h5,.panel h6{line-height:1;margin-bottom:.625rem}.panel h1.subheader,.panel h2.subheader,.panel h3.subheader,.panel h4.subheader,.panel h5.subheader,.panel h6.subheader{line-height:1.4}.panel.callout{border-style:solid;border-width:1px;border-color:#f6c4bf;margin-bottom:1.25rem;padding:1.25rem;background:#fdf0ef;color:#333}.panel.callout>:first-child{margin-top:0}.panel.callout>:last-child{margin-bottom:0}.panel.callout h1,.panel.callout h2,.panel.callout h3,.panel.callout h4,.panel.callout h5,.panel.callout h6,.panel.callout p,.panel.callout li,.panel.callout dl{color:#333}.panel.callout h1,.panel.callout h2,.panel.callout h3,.panel.callout h4,.panel.callout h5,.panel.callout h6{line-height:1;margin-bottom:.625rem}.panel.callout h1.subheader,.panel.callout h2.subheader,.panel.callout h3.subheader,.panel.callout h4.subheader,.panel.callout h5.subheader,.panel.callout h6.subheader{line-height:1.4}.panel.callout a:not(.button){color:#ba2619}.panel.callout a:not(.button):hover,.panel.callout a:not(.button):focus{color:#a02116}.panel.radius{border-radius:3px}.side-nav{display:block;margin:0;padding:.875rem 0;list-style-type:none;list-style-position:outside;font-family:"Open Sans","Helvetica Neue",Helvetica,Roboto,Arial,sans-serif}.side-nav li{margin:0 0 .4375rem 0;font-size:.875rem;font-weight:400}.side-nav li a:not(.button){display:block;color:#ba2619;margin:0;padding:.4375rem .875rem}.side-nav li a:not(.button):hover,.side-nav li a:not(.button):focus{background:rgba(0,0,0,0.025);color:#e65346}.side-nav li.active>a:first-child:not(.button){color:#e65346;font-weight:400;font-family:"Open Sans","Helvetica Neue",Helvetica,Roboto,Arial,sans-serif}.side-nav li.divider{border-top:1px solid;height:0;padding:0;list-style:none;border-top-color:#fff}.side-nav li.heading{color:#ba2619;font-size:.875rem;font-weight:bold;text-transform:uppercase}table{background:#fff;margin-bottom:1.25rem;border:solid 1px #ddd;table-layout:auto}table caption{background:transparent;color:#222;font-size:1rem;font-weight:bold}table thead{background:#f5f5f5}table thead tr th,table thead tr td{padding:.5rem .625rem .625rem;font-size:.875rem;font-weight:700;color:#222}table tfoot{background:#f5f5f5}table tfoot tr th,table tfoot tr td{padding:.5rem .625rem .625rem;font-size:.875rem;font-weight:700;color:#222}table tr th,table tr td{padding:.5625rem .625rem;font-size:.875rem;color:#222;text-align:left}table tr.even,table tr.alt,table tr:nth-of-type(even){background:#F9F9F9}table thead tr th,table tfoot tr th,table tfoot tr td,table tbody tr th,table tbody tr td,table tr td{display:table-cell;line-height:1.125rem}.th{line-height:0;display:inline-block;border:solid 4px #fff;max-width:100%;box-shadow:0 0 0 1px rgba(0,0,0,0.2);transition:all 200ms ease-out}.th:hover,.th:focus{box-shadow:0 0 6px 1px rgba(186,38,25,0.5)}.th.radius{border-radius:3px}meta.foundation-mq-topbar{font-family:"/only screen and (min-width:40.0625em)/";width:40.0625em}.contain-to-grid{width:100%;background:#333}.contain-to-grid .top-bar{margin-bottom:0}.fixed{width:100%;left:0;position:fixed;top:0;z-index:99}.fixed.expanded:not(.top-bar){overflow-y:auto;height:auto;width:100%;max-height:100%}.fixed.expanded:not(.top-bar) .title-area{position:fixed;width:100%;z-index:99}.fixed.expanded:not(.top-bar) .top-bar-section{z-index:98;margin-top:2.8125rem}.top-bar{overflow:hidden;height:2.8125rem;line-height:2.8125rem;position:relative;background:#333;margin-bottom:0}.top-bar ul{margin-bottom:0;list-style:none}.top-bar .row{max-width:none}.top-bar form,.top-bar input{margin-bottom:0}.top-bar input{height:1.75rem;padding-top:.35rem;padding-bottom:.35rem;font-size:.75rem}.top-bar .button,.top-bar button{padding-top:0.4125rem;padding-bottom:0.4125rem;margin-bottom:0;font-size:.75rem}@media only screen and (max-width: 40em){.top-bar .button,.top-bar button{position:relative;top:-1px}}.top-bar .title-area{position:relative;margin:0}.top-bar .name{height:2.8125rem;margin:0;font-size:16px}.top-bar .name h1,.top-bar .name h2,.top-bar .name h3,.top-bar .name h4,.top-bar .name p,.top-bar .name span{line-height:2.8125rem;font-size:1.0625rem;margin:0}.top-bar .name h1 a,.top-bar .name h2 a,.top-bar .name h3 a,.top-bar .name h4 a,.top-bar .name p a,.top-bar .name span a{font-weight:400;color:#fff;width:75%;display:block;padding:0 .9375rem}.top-bar .toggle-topbar{position:absolute;right:0;top:0}.top-bar .toggle-topbar a{color:#fff;text-transform:uppercase;font-size:.8125rem;font-weight:700;position:relative;display:block;padding:0 .9375rem;height:2.8125rem;line-height:2.8125rem}.top-bar .toggle-topbar.menu-icon{top:50%;margin-top:-16px}.top-bar .toggle-topbar.menu-icon a{height:34px;line-height:33px;padding:0 2.5rem 0 .9375rem;color:#fff;position:relative}.top-bar .toggle-topbar.menu-icon a span::after{content:"";position:absolute;display:block;height:0;top:50%;margin-top:-8px;right:.9375rem;box-shadow:0 0 0 1px #fff,0 7px 0 1px #fff,0 14px 0 1px #fff;width:16px}.top-bar .toggle-topbar.menu-icon a span:hover:after{box-shadow:0 0 0 1px "",0 7px 0 1px "",0 14px 0 1px ""}.top-bar.expanded{height:auto;background:transparent}.top-bar.expanded .title-area{background:#333}.top-bar.expanded .toggle-topbar a{color:#888}.top-bar.expanded .toggle-topbar a span::after{box-shadow:0 0 0 1px #888,0 7px 0 1px #888,0 14px 0 1px #888}.top-bar-section{left:0;position:relative;width:auto;transition:left 300ms ease-out}.top-bar-section ul{padding:0;width:100%;height:auto;display:block;font-size:16px;margin:0}.top-bar-section .divider,.top-bar-section [role="separator"]{border-top:solid 1px #1a1a1a;clear:both;height:1px;width:100%}.top-bar-section ul li{background:#333}.top-bar-section ul li>a{display:block;width:100%;color:#fff;padding:12px 0 12px 0;padding-left:.9375rem;font-family:"Open Sans","Helvetica Neue",Helvetica,Roboto,Arial,sans-serif;font-size:.8125rem;font-weight:400;text-transform:none}.top-bar-section ul li>a.button{font-size:.8125rem;padding-right:.9375rem;padding-left:.9375rem;background-color:#ba2619;border-color:#951e14;color:#fff}.top-bar-section ul li>a.button:hover,.top-bar-section ul li>a.button:focus{background-color:#951e14}.top-bar-section ul li>a.button:hover,.top-bar-section ul li>a.button:focus{color:#fff}.top-bar-section ul li>a.button.secondary{background-color:#e7e7e7;border-color:#b9b9b9;color:#333}.top-bar-section ul li>a.button.secondary:hover,.top-bar-section ul li>a.button.secondary:focus{background-color:#b9b9b9}.top-bar-section ul li>a.button.secondary:hover,.top-bar-section ul li>a.button.secondary:focus{color:#333}.top-bar-section ul li>a.button.success{background-color:#43AC6A;border-color:#368a55;color:#fff}.top-bar-section ul li>a.button.success:hover,.top-bar-section ul li>a.button.success:focus{background-color:#368a55}.top-bar-section ul li>a.button.success:hover,.top-bar-section ul li>a.button.success:focus{color:#fff}.top-bar-section ul li>a.button.alert{background-color:#f04124;border-color:#cf2a0e;color:#fff}.top-bar-section ul li>a.button.alert:hover,.top-bar-section ul li>a.button.alert:focus{background-color:#cf2a0e}.top-bar-section ul li>a.button.alert:hover,.top-bar-section ul li>a.button.alert:focus{color:#fff}.top-bar-section ul li>a.button.warning{background-color:#f08a24;border-color:#cf6e0e;color:#fff}.top-bar-section ul li>a.button.warning:hover,.top-bar-section ul li>a.button.warning:focus{background-color:#cf6e0e}.top-bar-section ul li>a.button.warning:hover,.top-bar-section ul li>a.button.warning:focus{color:#fff}.top-bar-section ul li>button{font-size:.8125rem;padding-right:.9375rem;padding-left:.9375rem;background-color:#ba2619;border-color:#951e14;color:#fff}.top-bar-section ul li>button:hover,.top-bar-section ul li>button:focus{background-color:#951e14}.top-bar-section ul li>button:hover,.top-bar-section ul li>button:focus{color:#fff}.top-bar-section ul li>button.secondary{background-color:#e7e7e7;border-color:#b9b9b9;color:#333}.top-bar-section ul li>button.secondary:hover,.top-bar-section ul li>button.secondary:focus{background-color:#b9b9b9}.top-bar-section ul li>button.secondary:hover,.top-bar-section ul li>button.secondary:focus{color:#333}.top-bar-section ul li>button.success{background-color:#43AC6A;border-color:#368a55;color:#fff}.top-bar-section ul li>button.success:hover,.top-bar-section ul li>button.success:focus{background-color:#368a55}.top-bar-section ul li>button.success:hover,.top-bar-section ul li>button.success:focus{color:#fff}.top-bar-section ul li>button.alert{background-color:#f04124;border-color:#cf2a0e;color:#fff}.top-bar-section ul li>button.alert:hover,.top-bar-section ul li>button.alert:focus{background-color:#cf2a0e}.top-bar-section ul li>button.alert:hover,.top-bar-section ul li>button.alert:focus{color:#fff}.top-bar-section ul li>button.warning{background-color:#f08a24;border-color:#cf6e0e;color:#fff}.top-bar-section ul li>button.warning:hover,.top-bar-section ul li>button.warning:focus{background-color:#cf6e0e}.top-bar-section ul li>button.warning:hover,.top-bar-section ul li>button.warning:focus{color:#fff}.top-bar-section ul li:hover:not(.has-form)>a{background-color:#555;background:#333;color:#fff}.top-bar-section ul li.active>a{background:#ba2619;color:#fff}.top-bar-section ul li.active>a:hover{background:#a02116;color:#fff}.top-bar-section .has-form{padding:.9375rem}.top-bar-section .has-dropdown{position:relative}.top-bar-section .has-dropdown>a:after{content:"";display:block;width:0;height:0;border:inset 5px;border-color:transparent transparent transparent rgba(255,255,255,0.4);border-left-style:solid;margin-right:.9375rem;margin-top:-4.5px;position:absolute;top:50%;right:0}.top-bar-section .has-dropdown.moved{position:static}.top-bar-section .has-dropdown.moved>.dropdown{display:block;position:static !important;height:auto;width:auto;overflow:visible;clip:auto;position:absolute !important;width:100%}.top-bar-section .has-dropdown.moved>a:after{display:none}.top-bar-section .dropdown{padding:0;position:absolute;left:100%;top:0;z-index:99;display:block;position:absolute !important;height:1px;width:1px;overflow:hidden;clip:rect(1px, 1px, 1px, 1px)}.top-bar-section .dropdown li{width:100%;height:auto}.top-bar-section .dropdown li a{font-weight:400;padding:8px .9375rem}.top-bar-section .dropdown li a.parent-link{font-weight:400}.top-bar-section .dropdown li.title h5,.top-bar-section .dropdown li.parent-link{margin-bottom:0;margin-top:0;font-size:1.125rem}.top-bar-section .dropdown li.title h5 a,.top-bar-section .dropdown li.parent-link a{color:#fff;display:block}.top-bar-section .dropdown li.title h5 a:hover,.top-bar-section .dropdown li.parent-link a:hover{background:none}.top-bar-section .dropdown li.has-form{padding:8px .9375rem}.top-bar-section .dropdown li .button,.top-bar-section .dropdown li button{top:auto}.top-bar-section .dropdown label{padding:8px .9375rem 2px;margin-bottom:0;text-transform:uppercase;color:#777;font-weight:700;font-size:.625rem}.js-generated{display:block}@media only screen and (min-width: 40.0625em){.top-bar{background:#333;overflow:visible}.top-bar:before,.top-bar:after{content:" ";display:table}.top-bar:after{clear:both}.top-bar .toggle-topbar{display:none}.top-bar .title-area{float:left}.top-bar .name h1 a,.top-bar .name h2 a,.top-bar .name h3 a,.top-bar .name h4 a,.top-bar .name h5 a,.top-bar .name h6 a{width:auto}.top-bar input,.top-bar .button,.top-bar button{font-size:.875rem;position:relative;height:1.75rem;top:.53125rem}.top-bar.expanded{background:#333}.contain-to-grid .top-bar{max-width:62.5rem;margin:0 auto;margin-bottom:0}.top-bar-section{transition:none 0 0;left:0 !important}.top-bar-section ul{width:auto;height:auto !important;display:inline}.top-bar-section ul li{float:left}.top-bar-section ul li .js-generated{display:none}.top-bar-section li.hover>a:not(.button){background-color:#555;background:#333;color:#fff}.top-bar-section li:not(.has-form) a:not(.button){padding:0 .9375rem;line-height:2.8125rem;background:#333}.top-bar-section li:not(.has-form) a:not(.button):hover{background-color:#555;background:#333}.top-bar-section li.active:not(.has-form) a:not(.button){padding:0 .9375rem;line-height:2.8125rem;color:#fff;background:#ba2619}.top-bar-section li.active:not(.has-form) a:not(.button):hover{background:#a02116;color:#fff}.top-bar-section .has-dropdown>a{padding-right:2.1875rem !important}.top-bar-section .has-dropdown>a:after{content:"";display:block;width:0;height:0;border:inset 5px;border-color:rgba(255,255,255,0.4) transparent transparent transparent;border-top-style:solid;margin-top:-2.5px;top:1.40625rem}.top-bar-section .has-dropdown.moved{position:relative}.top-bar-section .has-dropdown.moved>.dropdown{display:block;position:absolute !important;height:1px;width:1px;overflow:hidden;clip:rect(1px, 1px, 1px, 1px)}.top-bar-section .has-dropdown.hover>.dropdown,.top-bar-section .has-dropdown.not-click:hover>.dropdown{display:block;position:static !important;height:auto;width:auto;overflow:visible;clip:auto;position:absolute !important}.top-bar-section .has-dropdown>a:focus+.dropdown{display:block;position:static !important;height:auto;width:auto;overflow:visible;clip:auto;position:absolute !important}.top-bar-section .has-dropdown .dropdown li.has-dropdown>a:after{border:none;content:"\00bb";top:1rem;margin-top:-1px;right:5px;line-height:1.2}.top-bar-section .dropdown{left:0;top:auto;background:transparent;min-width:100%}.top-bar-section .dropdown li a{color:#fff;line-height:2.8125rem;white-space:nowrap;padding:12px .9375rem;background:#333}.top-bar-section .dropdown li:not(.has-form):not(.active)>a:not(.button){color:#fff;background:#333}.top-bar-section .dropdown li:not(.has-form):not(.active):hover>a:not(.button){color:#fff;background-color:#555;background:#333}.top-bar-section .dropdown li label{white-space:nowrap;background:#333}.top-bar-section .dropdown li .dropdown{left:100%;top:0}.top-bar-section>ul>.divider,.top-bar-section>ul>[role="separator"]{border-bottom:none;border-top:none;border-right:solid 1px #4e4e4e;clear:none;height:2.8125rem;width:0}.top-bar-section .has-form{background:#333;padding:0 .9375rem;height:2.8125rem}.top-bar-section .right li .dropdown{left:auto;right:0}.top-bar-section .right li .dropdown li .dropdown{right:100%}.top-bar-section .left li .dropdown{right:auto;left:0}.top-bar-section .left li .dropdown li .dropdown{left:100%}.no-js .top-bar-section ul li:hover>a{background-color:#555;background:#333;color:#fff}.no-js .top-bar-section ul li:active>a{background:#ba2619;color:#fff}.no-js .top-bar-section .has-dropdown:hover>.dropdown{display:block;position:static !important;height:auto;width:auto;overflow:visible;clip:auto;position:absolute !important}.no-js .top-bar-section .has-dropdown>a:focus+.dropdown{display:block;position:static !important;height:auto;width:auto;overflow:visible;clip:auto;position:absolute !important}}.text-left{text-align:left !important}.text-right{text-align:right !important}.text-center{text-align:center !important}.text-justify{text-align:justify !important}@media only screen and (max-width: 40em){.small-only-text-left{text-align:left !important}.small-only-text-right{text-align:right !important}.small-only-text-center{text-align:center !important}.small-only-text-justify{text-align:justify !important}}@media only screen{.small-text-left{text-align:left !important}.small-text-right{text-align:right !important}.small-text-center{text-align:center !important}.small-text-justify{text-align:justify !important}}@media only screen and (min-width: 40.0625em) and (max-width: 64em){.medium-only-text-left{text-align:left !important}.medium-only-text-right{text-align:right !important}.medium-only-text-center{text-align:center !important}.medium-only-text-justify{text-align:justify !important}}@media only screen and (min-width: 40.0625em){.medium-text-left{text-align:left !important}.medium-text-right{text-align:right !important}.medium-text-center{text-align:center !important}.medium-text-justify{text-align:justify !important}}@media only screen and (min-width: 64.0625em) and (max-width: 90em){.large-only-text-left{text-align:left !important}.large-only-text-right{text-align:right !important}.large-only-text-center{text-align:center !important}.large-only-text-justify{text-align:justify !important}}@media only screen and (min-width: 64.0625em){.large-text-left{text-align:left !important}.large-text-right{text-align:right !important}.large-text-center{text-align:center !important}.large-text-justify{text-align:justify !important}}@media only screen and (min-width: 90.0625em) and (max-width: 120em){.xlarge-only-text-left{text-align:left !important}.xlarge-only-text-right{text-align:right !important}.xlarge-only-text-center{text-align:center !important}.xlarge-only-text-justify{text-align:justify !important}}@media only screen and (min-width: 90.0625em){.xlarge-text-left{text-align:left !important}.xlarge-text-right{text-align:right !important}.xlarge-text-center{text-align:center !important}.xlarge-text-justify{text-align:justify !important}}@media only screen and (min-width: 120.0625em) and (max-width: 99999999em){.xxlarge-only-text-left{text-align:left !important}.xxlarge-only-text-right{text-align:right !important}.xxlarge-only-text-center{text-align:center !important}.xxlarge-only-text-justify{text-align:justify !important}}@media only screen and (min-width: 120.0625em){.xxlarge-text-left{text-align:left !important}.xxlarge-text-right{text-align:right !important}.xxlarge-text-center{text-align:center !important}.xxlarge-text-justify{text-align:justify !important}}div,dl,dt,dd,ul,ol,li,h1,h2,h3,h4,h5,h6,pre,form,p,blockquote,th,td{margin:0;padding:0}a{color:#ba2619;text-decoration:none;line-height:inherit}a:hover,a:focus{color:#a02116}a img{border:none}p{font-family:inherit;font-weight:400;font-size:1rem;line-height:1.6;margin-bottom:1.25rem;text-rendering:optimizeLegibility}p.lead{font-size:1.21875rem;line-height:1.6}p aside{font-size:.875rem;line-height:1.35;font-style:italic}h1,h2,h3,h4,h5,h6{font-family:"Open Sans","Helvetica Neue",Helvetica,Roboto,Arial,sans-serif;font-weight:700;font-style:normal;color:#222;text-rendering:optimizeLegibility;margin-top:.2rem;margin-bottom:.5rem;line-height:1.4}h1 small,h2 small,h3 small,h4 small,h5 small,h6 small{font-size:80%;color:#6f6f6f;line-height:0}h1{font-size:1.5625rem}h2{font-size:1.25rem}h3{font-size:1.0625rem}h4{font-size:.9375rem}h5{font-size:1rem}h6{font-size:1rem}.subheader{line-height:1.4;color:#6f6f6f;font-weight:400;margin-top:.2rem;margin-bottom:.5rem}hr{border:solid #ddd;border-width:1px 0 0;clear:both;margin:1.25rem 0 1.1875rem;height:0}em,i{font-style:italic;line-height:inherit}strong,b{font-weight:700;line-height:inherit}small{font-size:80%;line-height:inherit}code{font-family:Consolas,"Liberation Mono",Courier,monospace;font-weight:400;color:#333;background-color:rgba(0,0,0,0.04);border-width:1px;border-style:none;border-color:rgba(0,0,0,0.04);padding:.125rem .3125rem .0625rem}ul,ol,dl{font-size:1rem;line-height:1.6;margin-bottom:1.25rem;list-style-position:outside;font-family:inherit}ul{margin-left:1.1rem}ul.no-bullet{margin-left:0}ul.no-bullet li ul,ul.no-bullet li ol{margin-left:1.25rem;margin-bottom:0;list-style:none}ul li ul,ul li ol{margin-left:1.25rem;margin-bottom:0}ul.square li ul,ul.circle li ul,ul.disc li ul{list-style:inherit}ul.square{list-style-type:square;margin-left:1.1rem}ul.circle{list-style-type:circle;margin-left:1.1rem}ul.disc{list-style-type:disc;margin-left:1.1rem}ul.no-bullet{list-style:none}ol{margin-left:1.4rem}ol li ul,ol li ol{margin-left:1.25rem;margin-bottom:0}dl dt{margin-bottom:.3rem;font-weight:700}dl dd{margin-bottom:.75rem}abbr,acronym{text-transform:uppercase;font-size:90%;color:#222;cursor:help}abbr{text-transform:none}abbr[title]{border-bottom:1px dotted #ddd}blockquote{margin:0 0 1.25rem;padding:.5625rem 1.25rem 0 1.1875rem;border-left:1px solid #ddd}blockquote cite{display:block;font-size:.8125rem;color:#555}blockquote cite:before{content:"\2014 \0020"}blockquote cite a,blockquote cite a:visited{color:#555}blockquote,blockquote p{line-height:1.6;color:#6f6f6f}.vcard{display:inline-block;margin:0 0 1.25rem 0;border:1px solid #ddd;padding:.625rem .75rem}.vcard li{margin:0;display:block}.vcard .fn{font-weight:700;font-size:.9375rem}.vevent .summary{font-weight:700}.vevent abbr{cursor:default;text-decoration:none;font-weight:700;border:none;padding:0 .0625rem}@media only screen and (min-width: 40.0625em){h1,h2,h3,h4,h5,h6{line-height:1.4}h1{font-size:1.875rem}h2{font-size:1.5625rem}h3{font-size:1.375rem}h4{font-size:1.25rem}h5{font-size:1rem}h6{font-size:1rem}}@media only screen{.show-for-small-only,.show-for-small-up,.show-for-small,.show-for-small-down,.hide-for-medium-only,.hide-for-medium-up,.hide-for-medium,.show-for-medium-down,.hide-for-large-only,.hide-for-large-up,.hide-for-large,.show-for-large-down,.hide-for-xlarge-only,.hide-for-xlarge-up,.hide-for-xlarge,.show-for-xlarge-down,.hide-for-xxlarge-only,.hide-for-xxlarge-up,.hide-for-xxlarge,.show-for-xxlarge-down{display:inherit !important}.hide-for-small-only,.hide-for-small-up,.hide-for-small,.hide-for-small-down,.show-for-medium-only,.show-for-medium-up,.show-for-medium,.hide-for-medium-down,.show-for-large-only,.show-for-large-up,.show-for-large,.hide-for-large-down,.show-for-xlarge-only,.show-for-xlarge-up,.show-for-xlarge,.hide-for-xlarge-down,.show-for-xxlarge-only,.show-for-xxlarge-up,.show-for-xxlarge,.hide-for-xxlarge-down{display:none !important}.visible-for-small-only,.visible-for-small-up,.visible-for-small,.visible-for-small-down,.hidden-for-medium-only,.hidden-for-medium-up,.hidden-for-medium,.visible-for-medium-down,.hidden-for-large-only,.hidden-for-large-up,.hidden-for-large,.visible-for-large-down,.hidden-for-xlarge-only,.hidden-for-xlarge-up,.hidden-for-xlarge,.visible-for-xlarge-down,.hidden-for-xxlarge-only,.hidden-for-xxlarge-up,.hidden-for-xxlarge,.visible-for-xxlarge-down{position:static !important;height:auto;width:auto;overflow:visible;clip:auto}.hidden-for-small-only,.hidden-for-small-up,.hidden-for-small,.hidden-for-small-down,.visible-for-medium-only,.visible-for-medium-up,.visible-for-medium,.hidden-for-medium-down,.visible-for-large-only,.visible-for-large-up,.visible-for-large,.hidden-for-large-down,.visible-for-xlarge-only,.visible-for-xlarge-up,.visible-for-xlarge,.hidden-for-xlarge-down,.visible-for-xxlarge-only,.visible-for-xxlarge-up,.visible-for-xxlarge,.hidden-for-xxlarge-down{position:absolute !important;height:1px;width:1px;overflow:hidden;clip:rect(1px, 1px, 1px, 1px)}table.show-for-small-only,table.show-for-small-up,table.show-for-small,table.show-for-small-down,table.hide-for-medium-only,table.hide-for-medium-up,table.hide-for-medium,table.show-for-medium-down,table.hide-for-large-only,table.hide-for-large-up,table.hide-for-large,table.show-for-large-down,table.hide-for-xlarge-only,table.hide-for-xlarge-up,table.hide-for-xlarge,table.show-for-xlarge-down,table.hide-for-xxlarge-only,table.hide-for-xxlarge-up,table.hide-for-xxlarge,table.show-for-xxlarge-down{display:table !important}thead.show-for-small-only,thead.show-for-small-up,thead.show-for-small,thead.show-for-small-down,thead.hide-for-medium-only,thead.hide-for-medium-up,thead.hide-for-medium,thead.show-for-medium-down,thead.hide-for-large-only,thead.hide-for-large-up,thead.hide-for-large,thead.show-for-large-down,thead.hide-for-xlarge-only,thead.hide-for-xlarge-up,thead.hide-for-xlarge,thead.show-for-xlarge-down,thead.hide-for-xxlarge-only,thead.hide-for-xxlarge-up,thead.hide-for-xxlarge,thead.show-for-xxlarge-down{display:table-header-group !important}tbody.show-for-small-only,tbody.show-for-small-up,tbody.show-for-small,tbody.show-for-small-down,tbody.hide-for-medium-only,tbody.hide-for-medium-up,tbody.hide-for-medium,tbody.show-for-medium-down,tbody.hide-for-large-only,tbody.hide-for-large-up,tbody.hide-for-large,tbody.show-for-large-down,tbody.hide-for-xlarge-only,tbody.hide-for-xlarge-up,tbody.hide-for-xlarge,tbody.show-for-xlarge-down,tbody.hide-for-xxlarge-only,tbody.hide-for-xxlarge-up,tbody.hide-for-xxlarge,tbody.show-for-xxlarge-down{display:table-row-group !important}tr.show-for-small-only,tr.show-for-small-up,tr.show-for-small,tr.show-for-small-down,tr.hide-for-medium-only,tr.hide-for-medium-up,tr.hide-for-medium,tr.show-for-medium-down,tr.hide-for-large-only,tr.hide-for-large-up,tr.hide-for-large,tr.show-for-large-down,tr.hide-for-xlarge-only,tr.hide-for-xlarge-up,tr.hide-for-xlarge,tr.show-for-xlarge-down,tr.hide-for-xxlarge-only,tr.hide-for-xxlarge-up,tr.hide-for-xxlarge,tr.show-for-xxlarge-down{display:table-row}th.show-for-small-only,td.show-for-small-only,th.show-for-small-up,td.show-for-small-up,th.show-for-small,td.show-for-small,th.show-for-small-down,td.show-for-small-down,th.hide-for-medium-only,td.hide-for-medium-only,th.hide-for-medium-up,td.hide-for-medium-up,th.hide-for-medium,td.hide-for-medium,th.show-for-medium-down,td.show-for-medium-down,th.hide-for-large-only,td.hide-for-large-only,th.hide-for-large-up,td.hide-for-large-up,th.hide-for-large,td.hide-for-large,th.show-for-large-down,td.show-for-large-down,th.hide-for-xlarge-only,td.hide-for-xlarge-only,th.hide-for-xlarge-up,td.hide-for-xlarge-up,th.hide-for-xlarge,td.hide-for-xlarge,th.show-for-xlarge-down,td.show-for-xlarge-down,th.hide-for-xxlarge-only,td.hide-for-xxlarge-only,th.hide-for-xxlarge-up,td.hide-for-xxlarge-up,th.hide-for-xxlarge,td.hide-for-xxlarge,th.show-for-xxlarge-down,td.show-for-xxlarge-down{display:table-cell !important}}@media only screen and (min-width: 40.0625em){.hide-for-small-only,.show-for-small-up,.hide-for-small,.hide-for-small-down,.show-for-medium-only,.show-for-medium-up,.show-for-medium,.show-for-medium-down,.hide-for-large-only,.hide-for-large-up,.hide-for-large,.show-for-large-down,.hide-for-xlarge-only,.hide-for-xlarge-up,.hide-for-xlarge,.show-for-xlarge-down,.hide-for-xxlarge-only,.hide-for-xxlarge-up,.hide-for-xxlarge,.show-for-xxlarge-down{display:inherit !important}.show-for-small-only,.hide-for-small-up,.show-for-small,.show-for-small-down,.hide-for-medium-only,.hide-for-medium-up,.hide-for-medium,.hide-for-medium-down,.show-for-large-only,.show-for-large-up,.show-for-large,.hide-for-large-down,.show-for-xlarge-only,.show-for-xlarge-up,.show-for-xlarge,.hide-for-xlarge-down,.show-for-xxlarge-only,.show-for-xxlarge-up,.show-for-xxlarge,.hide-for-xxlarge-down{display:none !important}.hidden-for-small-only,.visible-for-small-up,.hidden-for-small,.hidden-for-small-down,.visible-for-medium-only,.visible-for-medium-up,.visible-for-medium,.visible-for-medium-down,.hidden-for-large-only,.hidden-for-large-up,.hidden-for-large,.visible-for-large-down,.hidden-for-xlarge-only,.hidden-for-xlarge-up,.hidden-for-xlarge,.visible-for-xlarge-down,.hidden-for-xxlarge-only,.hidden-for-xxlarge-up,.hidden-for-xxlarge,.visible-for-xxlarge-down{position:static !important;height:auto;width:auto;overflow:visible;clip:auto}.visible-for-small-only,.hidden-for-small-up,.visible-for-small,.visible-for-small-down,.hidden-for-medium-only,.hidden-for-medium-up,.hidden-for-medium,.hidden-for-medium-down,.visible-for-large-only,.visible-for-large-up,.visible-for-large,.hidden-for-large-down,.visible-for-xlarge-only,.visible-for-xlarge-up,.visible-for-xlarge,.hidden-for-xlarge-down,.visible-for-xxlarge-only,.visible-for-xxlarge-up,.visible-for-xxlarge,.hidden-for-xxlarge-down{position:absolute !important;height:1px;width:1px;overflow:hidden;clip:rect(1px, 1px, 1px, 1px)}table.hide-for-small-only,table.show-for-small-up,table.hide-for-small,table.hide-for-small-down,table.show-for-medium-only,table.show-for-medium-up,table.show-for-medium,table.show-for-medium-down,table.hide-for-large-only,table.hide-for-large-up,table.hide-for-large,table.show-for-large-down,table.hide-for-xlarge-only,table.hide-for-xlarge-up,table.hide-for-xlarge,table.show-for-xlarge-down,table.hide-for-xxlarge-only,table.hide-for-xxlarge-up,table.hide-for-xxlarge,table.show-for-xxlarge-down{display:table !important}thead.hide-for-small-only,thead.show-for-small-up,thead.hide-for-small,thead.hide-for-small-down,thead.show-for-medium-only,thead.show-for-medium-up,thead.show-for-medium,thead.show-for-medium-down,thead.hide-for-large-only,thead.hide-for-large-up,thead.hide-for-large,thead.show-for-large-down,thead.hide-for-xlarge-only,thead.hide-for-xlarge-up,thead.hide-for-xlarge,thead.show-for-xlarge-down,thead.hide-for-xxlarge-only,thead.hide-for-xxlarge-up,thead.hide-for-xxlarge,thead.show-for-xxlarge-down{display:table-header-group !important}tbody.hide-for-small-only,tbody.show-for-small-up,tbody.hide-for-small,tbody.hide-for-small-down,tbody.show-for-medium-only,tbody.show-for-medium-up,tbody.show-for-medium,tbody.show-for-medium-down,tbody.hide-for-large-only,tbody.hide-for-large-up,tbody.hide-for-large,tbody.show-for-large-down,tbody.hide-for-xlarge-only,tbody.hide-for-xlarge-up,tbody.hide-for-xlarge,tbody.show-for-xlarge-down,tbody.hide-for-xxlarge-only,tbody.hide-for-xxlarge-up,tbody.hide-for-xxlarge,tbody.show-for-xxlarge-down{display:table-row-group !important}tr.hide-for-small-only,tr.show-for-small-up,tr.hide-for-small,tr.hide-for-small-down,tr.show-for-medium-only,tr.show-for-medium-up,tr.show-for-medium,tr.show-for-medium-down,tr.hide-for-large-only,tr.hide-for-large-up,tr.hide-for-large,tr.show-for-large-down,tr.hide-for-xlarge-only,tr.hide-for-xlarge-up,tr.hide-for-xlarge,tr.show-for-xlarge-down,tr.hide-for-xxlarge-only,tr.hide-for-xxlarge-up,tr.hide-for-xxlarge,tr.show-for-xxlarge-down{display:table-row}th.hide-for-small-only,td.hide-for-small-only,th.show-for-small-up,td.show-for-small-up,th.hide-for-small,td.hide-for-small,th.hide-for-small-down,td.hide-for-small-down,th.show-for-medium-only,td.show-for-medium-only,th.show-for-medium-up,td.show-for-medium-up,th.show-for-medium,td.show-for-medium,th.show-for-medium-down,td.show-for-medium-down,th.hide-for-large-only,td.hide-for-large-only,th.hide-for-large-up,td.hide-for-large-up,th.hide-for-large,td.hide-for-large,th.show-for-large-down,td.show-for-large-down,th.hide-for-xlarge-only,td.hide-for-xlarge-only,th.hide-for-xlarge-up,td.hide-for-xlarge-up,th.hide-for-xlarge,td.hide-for-xlarge,th.show-for-xlarge-down,td.show-for-xlarge-down,th.hide-for-xxlarge-only,td.hide-for-xxlarge-only,th.hide-for-xxlarge-up,td.hide-for-xxlarge-up,th.hide-for-xxlarge,td.hide-for-xxlarge,th.show-for-xxlarge-down,td.show-for-xxlarge-down{display:table-cell !important}}@media only screen and (min-width: 64.0625em){.hide-for-small-only,.show-for-small-up,.hide-for-small,.hide-for-small-down,.hide-for-medium-only,.show-for-medium-up,.hide-for-medium,.hide-for-medium-down,.show-for-large-only,.show-for-large-up,.show-for-large,.show-for-large-down,.hide-for-xlarge-only,.hide-for-xlarge-up,.hide-for-xlarge,.show-for-xlarge-down,.hide-for-xxlarge-only,.hide-for-xxlarge-up,.hide-for-xxlarge,.show-for-xxlarge-down{display:inherit !important}.show-for-small-only,.hide-for-small-up,.show-for-small,.show-for-small-down,.show-for-medium-only,.hide-for-medium-up,.show-for-medium,.show-for-medium-down,.hide-for-large-only,.hide-for-large-up,.hide-for-large,.hide-for-large-down,.show-for-xlarge-only,.show-for-xlarge-up,.show-for-xlarge,.hide-for-xlarge-down,.show-for-xxlarge-only,.show-for-xxlarge-up,.show-for-xxlarge,.hide-for-xxlarge-down{display:none !important}.hidden-for-small-only,.visible-for-small-up,.hidden-for-small,.hidden-for-small-down,.hidden-for-medium-only,.visible-for-medium-up,.hidden-for-medium,.hidden-for-medium-down,.visible-for-large-only,.visible-for-large-up,.visible-for-large,.visible-for-large-down,.hidden-for-xlarge-only,.hidden-for-xlarge-up,.hidden-for-xlarge,.visible-for-xlarge-down,.hidden-for-xxlarge-only,.hidden-for-xxlarge-up,.hidden-for-xxlarge,.visible-for-xxlarge-down{position:static !important;height:auto;width:auto;overflow:visible;clip:auto}.visible-for-small-only,.hidden-for-small-up,.visible-for-small,.visible-for-small-down,.visible-for-medium-only,.hidden-for-medium-up,.visible-for-medium,.visible-for-medium-down,.hidden-for-large-only,.hidden-for-large-up,.hidden-for-large,.hidden-for-large-down,.visible-for-xlarge-only,.visible-for-xlarge-up,.visible-for-xlarge,.hidden-for-xlarge-down,.visible-for-xxlarge-only,.visible-for-xxlarge-up,.visible-for-xxlarge,.hidden-for-xxlarge-down{position:absolute !important;height:1px;width:1px;overflow:hidden;clip:rect(1px, 1px, 1px, 1px)}table.hide-for-small-only,table.show-for-small-up,table.hide-for-small,table.hide-for-small-down,table.hide-for-medium-only,table.show-for-medium-up,table.hide-for-medium,table.hide-for-medium-down,table.show-for-large-only,table.show-for-large-up,table.show-for-large,table.show-for-large-down,table.hide-for-xlarge-only,table.hide-for-xlarge-up,table.hide-for-xlarge,table.show-for-xlarge-down,table.hide-for-xxlarge-only,table.hide-for-xxlarge-up,table.hide-for-xxlarge,table.show-for-xxlarge-down{display:table !important}thead.hide-for-small-only,thead.show-for-small-up,thead.hide-for-small,thead.hide-for-small-down,thead.hide-for-medium-only,thead.show-for-medium-up,thead.hide-for-medium,thead.hide-for-medium-down,thead.show-for-large-only,thead.show-for-large-up,thead.show-for-large,thead.show-for-large-down,thead.hide-for-xlarge-only,thead.hide-for-xlarge-up,thead.hide-for-xlarge,thead.show-for-xlarge-down,thead.hide-for-xxlarge-only,thead.hide-for-xxlarge-up,thead.hide-for-xxlarge,thead.show-for-xxlarge-down{display:table-header-group !important}tbody.hide-for-small-only,tbody.show-for-small-up,tbody.hide-for-small,tbody.hide-for-small-down,tbody.hide-for-medium-only,tbody.show-for-medium-up,tbody.hide-for-medium,tbody.hide-for-medium-down,tbody.show-for-large-only,tbody.show-for-large-up,tbody.show-for-large,tbody.show-for-large-down,tbody.hide-for-xlarge-only,tbody.hide-for-xlarge-up,tbody.hide-for-xlarge,tbody.show-for-xlarge-down,tbody.hide-for-xxlarge-only,tbody.hide-for-xxlarge-up,tbody.hide-for-xxlarge,tbody.show-for-xxlarge-down{display:table-row-group !important}tr.hide-for-small-only,tr.show-for-small-up,tr.hide-for-small,tr.hide-for-small-down,tr.hide-for-medium-only,tr.show-for-medium-up,tr.hide-for-medium,tr.hide-for-medium-down,tr.show-for-large-only,tr.show-for-large-up,tr.show-for-large,tr.show-for-large-down,tr.hide-for-xlarge-only,tr.hide-for-xlarge-up,tr.hide-for-xlarge,tr.show-for-xlarge-down,tr.hide-for-xxlarge-only,tr.hide-for-xxlarge-up,tr.hide-for-xxlarge,tr.show-for-xxlarge-down{display:table-row}th.hide-for-small-only,td.hide-for-small-only,th.show-for-small-up,td.show-for-small-up,th.hide-for-small,td.hide-for-small,th.hide-for-small-down,td.hide-for-small-down,th.hide-for-medium-only,td.hide-for-medium-only,th.show-for-medium-up,td.show-for-medium-up,th.hide-for-medium,td.hide-for-medium,th.hide-for-medium-down,td.hide-for-medium-down,th.show-for-large-only,td.show-for-large-only,th.show-for-large-up,td.show-for-large-up,th.show-for-large,td.show-for-large,th.show-for-large-down,td.show-for-large-down,th.hide-for-xlarge-only,td.hide-for-xlarge-only,th.hide-for-xlarge-up,td.hide-for-xlarge-up,th.hide-for-xlarge,td.hide-for-xlarge,th.show-for-xlarge-down,td.show-for-xlarge-down,th.hide-for-xxlarge-only,td.hide-for-xxlarge-only,th.hide-for-xxlarge-up,td.hide-for-xxlarge-up,th.hide-for-xxlarge,td.hide-for-xxlarge,th.show-for-xxlarge-down,td.show-for-xxlarge-down{display:table-cell !important}}@media only screen and (min-width: 90.0625em){.hide-for-small-only,.show-for-small-up,.hide-for-small,.hide-for-small-down,.hide-for-medium-only,.show-for-medium-up,.hide-for-medium,.hide-for-medium-down,.hide-for-large-only,.show-for-large-up,.hide-for-large,.hide-for-large-down,.show-for-xlarge-only,.show-for-xlarge-up,.show-for-xlarge,.show-for-xlarge-down,.hide-for-xxlarge-only,.hide-for-xxlarge-up,.hide-for-xxlarge,.show-for-xxlarge-down{display:inherit !important}.show-for-small-only,.hide-for-small-up,.show-for-small,.show-for-small-down,.show-for-medium-only,.hide-for-medium-up,.show-for-medium,.show-for-medium-down,.show-for-large-only,.hide-for-large-up,.show-for-large,.show-for-large-down,.hide-for-xlarge-only,.hide-for-xlarge-up,.hide-for-xlarge,.hide-for-xlarge-down,.show-for-xxlarge-only,.show-for-xxlarge-up,.show-for-xxlarge,.hide-for-xxlarge-down{display:none !important}.hidden-for-small-only,.visible-for-small-up,.hidden-for-small,.hidden-for-small-down,.hidden-for-medium-only,.visible-for-medium-up,.hidden-for-medium,.hidden-for-medium-down,.hidden-for-large-only,.visible-for-large-up,.hidden-for-large,.hidden-for-large-down,.visible-for-xlarge-only,.visible-for-xlarge-up,.visible-for-xlarge,.visible-for-xlarge-down,.hidden-for-xxlarge-only,.hidden-for-xxlarge-up,.hidden-for-xxlarge,.visible-for-xxlarge-down{position:static !important;height:auto;width:auto;overflow:visible;clip:auto}.visible-for-small-only,.hidden-for-small-up,.visible-for-small,.visible-for-small-down,.visible-for-medium-only,.hidden-for-medium-up,.visible-for-medium,.visible-for-medium-down,.visible-for-large-only,.hidden-for-large-up,.visible-for-large,.visible-for-large-down,.hidden-for-xlarge-only,.hidden-for-xlarge-up,.hidden-for-xlarge,.hidden-for-xlarge-down,.visible-for-xxlarge-only,.visible-for-xxlarge-up,.visible-for-xxlarge,.hidden-for-xxlarge-down{position:absolute !important;height:1px;width:1px;overflow:hidden;clip:rect(1px, 1px, 1px, 1px)}table.hide-for-small-only,table.show-for-small-up,table.hide-for-small,table.hide-for-small-down,table.hide-for-medium-only,table.show-for-medium-up,table.hide-for-medium,table.hide-for-medium-down,table.hide-for-large-only,table.show-for-large-up,table.hide-for-large,table.hide-for-large-down,table.show-for-xlarge-only,table.show-for-xlarge-up,table.show-for-xlarge,table.show-for-xlarge-down,table.hide-for-xxlarge-only,table.hide-for-xxlarge-up,table.hide-for-xxlarge,table.show-for-xxlarge-down{display:table !important}thead.hide-for-small-only,thead.show-for-small-up,thead.hide-for-small,thead.hide-for-small-down,thead.hide-for-medium-only,thead.show-for-medium-up,thead.hide-for-medium,thead.hide-for-medium-down,thead.hide-for-large-only,thead.show-for-large-up,thead.hide-for-large,thead.hide-for-large-down,thead.show-for-xlarge-only,thead.show-for-xlarge-up,thead.show-for-xlarge,thead.show-for-xlarge-down,thead.hide-for-xxlarge-only,thead.hide-for-xxlarge-up,thead.hide-for-xxlarge,thead.show-for-xxlarge-down{display:table-header-group !important}tbody.hide-for-small-only,tbody.show-for-small-up,tbody.hide-for-small,tbody.hide-for-small-down,tbody.hide-for-medium-only,tbody.show-for-medium-up,tbody.hide-for-medium,tbody.hide-for-medium-down,tbody.hide-for-large-only,tbody.show-for-large-up,tbody.hide-for-large,tbody.hide-for-large-down,tbody.show-for-xlarge-only,tbody.show-for-xlarge-up,tbody.show-for-xlarge,tbody.show-for-xlarge-down,tbody.hide-for-xxlarge-only,tbody.hide-for-xxlarge-up,tbody.hide-for-xxlarge,tbody.show-for-xxlarge-down{display:table-row-group !important}tr.hide-for-small-only,tr.show-for-small-up,tr.hide-for-small,tr.hide-for-small-down,tr.hide-for-medium-only,tr.show-for-medium-up,tr.hide-for-medium,tr.hide-for-medium-down,tr.hide-for-large-only,tr.show-for-large-up,tr.hide-for-large,tr.hide-for-large-down,tr.show-for-xlarge-only,tr.show-for-xlarge-up,tr.show-for-xlarge,tr.show-for-xlarge-down,tr.hide-for-xxlarge-only,tr.hide-for-xxlarge-up,tr.hide-for-xxlarge,tr.show-for-xxlarge-down{display:table-row}th.hide-for-small-only,td.hide-for-small-only,th.show-for-small-up,td.show-for-small-up,th.hide-for-small,td.hide-for-small,th.hide-for-small-down,td.hide-for-small-down,th.hide-for-medium-only,td.hide-for-medium-only,th.show-for-medium-up,td.show-for-medium-up,th.hide-for-medium,td.hide-for-medium,th.hide-for-medium-down,td.hide-for-medium-down,th.hide-for-large-only,td.hide-for-large-only,th.show-for-large-up,td.show-for-large-up,th.hide-for-large,td.hide-for-large,th.hide-for-large-down,td.hide-for-large-down,th.show-for-xlarge-only,td.show-for-xlarge-only,th.show-for-xlarge-up,td.show-for-xlarge-up,th.show-for-xlarge,td.show-for-xlarge,th.show-for-xlarge-down,td.show-for-xlarge-down,th.hide-for-xxlarge-only,td.hide-for-xxlarge-only,th.hide-for-xxlarge-up,td.hide-for-xxlarge-up,th.hide-for-xxlarge,td.hide-for-xxlarge,th.show-for-xxlarge-down,td.show-for-xxlarge-down{display:table-cell !important}}@media only screen and (min-width: 120.0625em){.hide-for-small-only,.show-for-small-up,.hide-for-small,.hide-for-small-down,.hide-for-medium-only,.show-for-medium-up,.hide-for-medium,.hide-for-medium-down,.hide-for-large-only,.show-for-large-up,.hide-for-large,.hide-for-large-down,.hide-for-xlarge-only,.show-for-xlarge-up,.hide-for-xlarge,.hide-for-xlarge-down,.show-for-xxlarge-only,.show-for-xxlarge-up,.show-for-xxlarge,.show-for-xxlarge-down{display:inherit !important}.show-for-small-only,.hide-for-small-up,.show-for-small,.show-for-small-down,.show-for-medium-only,.hide-for-medium-up,.show-for-medium,.show-for-medium-down,.show-for-large-only,.hide-for-large-up,.show-for-large,.show-for-large-down,.show-for-xlarge-only,.hide-for-xlarge-up,.show-for-xlarge,.show-for-xlarge-down,.hide-for-xxlarge-only,.hide-for-xxlarge-up,.hide-for-xxlarge,.hide-for-xxlarge-down{display:none !important}.hidden-for-small-only,.visible-for-small-up,.hidden-for-small,.hidden-for-small-down,.hidden-for-medium-only,.visible-for-medium-up,.hidden-for-medium,.hidden-for-medium-down,.hidden-for-large-only,.visible-for-large-up,.hidden-for-large,.hidden-for-large-down,.hidden-for-xlarge-only,.visible-for-xlarge-up,.hidden-for-xlarge,.hidden-for-xlarge-down,.visible-for-xxlarge-only,.visible-for-xxlarge-up,.visible-for-xxlarge,.visible-for-xxlarge-down{position:static !important;height:auto;width:auto;overflow:visible;clip:auto}.visible-for-small-only,.hidden-for-small-up,.visible-for-small,.visible-for-small-down,.visible-for-medium-only,.hidden-for-medium-up,.visible-for-medium,.visible-for-medium-down,.visible-for-large-only,.hidden-for-large-up,.visible-for-large,.visible-for-large-down,.visible-for-xlarge-only,.hidden-for-xlarge-up,.visible-for-xlarge,.visible-for-xlarge-down,.hidden-for-xxlarge-only,.hidden-for-xxlarge-up,.hidden-for-xxlarge,.hidden-for-xxlarge-down{position:absolute !important;height:1px;width:1px;overflow:hidden;clip:rect(1px, 1px, 1px, 1px)}table.hide-for-small-only,table.show-for-small-up,table.hide-for-small,table.hide-for-small-down,table.hide-for-medium-only,table.show-for-medium-up,table.hide-for-medium,table.hide-for-medium-down,table.hide-for-large-only,table.show-for-large-up,table.hide-for-large,table.hide-for-large-down,table.hide-for-xlarge-only,table.show-for-xlarge-up,table.hide-for-xlarge,table.hide-for-xlarge-down,table.show-for-xxlarge-only,table.show-for-xxlarge-up,table.show-for-xxlarge,table.show-for-xxlarge-down{display:table !important}thead.hide-for-small-only,thead.show-for-small-up,thead.hide-for-small,thead.hide-for-small-down,thead.hide-for-medium-only,thead.show-for-medium-up,thead.hide-for-medium,thead.hide-for-medium-down,thead.hide-for-large-only,thead.show-for-large-up,thead.hide-for-large,thead.hide-for-large-down,thead.hide-for-xlarge-only,thead.show-for-xlarge-up,thead.hide-for-xlarge,thead.hide-for-xlarge-down,thead.show-for-xxlarge-only,thead.show-for-xxlarge-up,thead.show-for-xxlarge,thead.show-for-xxlarge-down{display:table-header-group !important}tbody.hide-for-small-only,tbody.show-for-small-up,tbody.hide-for-small,tbody.hide-for-small-down,tbody.hide-for-medium-only,tbody.show-for-medium-up,tbody.hide-for-medium,tbody.hide-for-medium-down,tbody.hide-for-large-only,tbody.show-for-large-up,tbody.hide-for-large,tbody.hide-for-large-down,tbody.hide-for-xlarge-only,tbody.show-for-xlarge-up,tbody.hide-for-xlarge,tbody.hide-for-xlarge-down,tbody.show-for-xxlarge-only,tbody.show-for-xxlarge-up,tbody.show-for-xxlarge,tbody.show-for-xxlarge-down{display:table-row-group !important}tr.hide-for-small-only,tr.show-for-small-up,tr.hide-for-small,tr.hide-for-small-down,tr.hide-for-medium-only,tr.show-for-medium-up,tr.hide-for-medium,tr.hide-for-medium-down,tr.hide-for-large-only,tr.show-for-large-up,tr.hide-for-large,tr.hide-for-large-down,tr.hide-for-xlarge-only,tr.show-for-xlarge-up,tr.hide-for-xlarge,tr.hide-for-xlarge-down,tr.show-for-xxlarge-only,tr.show-for-xxlarge-up,tr.show-for-xxlarge,tr.show-for-xxlarge-down{display:table-row}th.hide-for-small-only,td.hide-for-small-only,th.show-for-small-up,td.show-for-small-up,th.hide-for-small,td.hide-for-small,th.hide-for-small-down,td.hide-for-small-down,th.hide-for-medium-only,td.hide-for-medium-only,th.show-for-medium-up,td.show-for-medium-up,th.hide-for-medium,td.hide-for-medium,th.hide-for-medium-down,td.hide-for-medium-down,th.hide-for-large-only,td.hide-for-large-only,th.show-for-large-up,td.show-for-large-up,th.hide-for-large,td.hide-for-large,th.hide-for-large-down,td.hide-for-large-down,th.hide-for-xlarge-only,td.hide-for-xlarge-only,th.show-for-xlarge-up,td.show-for-xlarge-up,th.hide-for-xlarge,td.hide-for-xlarge,th.hide-for-xlarge-down,td.hide-for-xlarge-down,th.show-for-xxlarge-only,td.show-for-xxlarge-only,th.show-for-xxlarge-up,td.show-for-xxlarge-up,th.show-for-xxlarge,td.show-for-xxlarge,th.show-for-xxlarge-down,td.show-for-xxlarge-down{display:table-cell !important}}.show-for-landscape,.hide-for-portrait{display:inherit !important}.hide-for-landscape,.show-for-portrait{display:none !important}table.hide-for-landscape,table.show-for-portrait{display:table !important}thead.hide-for-landscape,thead.show-for-portrait{display:table-header-group !important}tbody.hide-for-landscape,tbody.show-for-portrait{display:table-row-group !important}tr.hide-for-landscape,tr.show-for-portrait{display:table-row !important}td.hide-for-landscape,td.show-for-portrait,th.hide-for-landscape,th.show-for-portrait{display:table-cell !important}@media only screen and (orientation: landscape){.show-for-landscape,.hide-for-portrait{display:inherit !important}.hide-for-landscape,.show-for-portrait{display:none !important}table.show-for-landscape,table.hide-for-portrait{display:table !important}thead.show-for-landscape,thead.hide-for-portrait{display:table-header-group !important}tbody.show-for-landscape,tbody.hide-for-portrait{display:table-row-group !important}tr.show-for-landscape,tr.hide-for-portrait{display:table-row !important}td.show-for-landscape,td.hide-for-portrait,th.show-for-landscape,th.hide-for-portrait{display:table-cell !important}}@media only screen and (orientation: portrait){.show-for-portrait,.hide-for-landscape{display:inherit !important}.hide-for-portrait,.show-for-landscape{display:none !important}table.show-for-portrait,table.hide-for-landscape{display:table !important}thead.show-for-portrait,thead.hide-for-landscape{display:table-header-group !important}tbody.show-for-portrait,tbody.hide-for-landscape{display:table-row-group !important}tr.show-for-portrait,tr.hide-for-landscape{display:table-row !important}td.show-for-portrait,td.hide-for-landscape,th.show-for-portrait,th.hide-for-landscape{display:table-cell !important}}.show-for-touch{display:none !important}.hide-for-touch{display:inherit !important}.touch .show-for-touch{display:inherit !important}.touch .hide-for-touch{display:none !important}table.hide-for-touch{display:table !important}.touch table.show-for-touch{display:table !important}thead.hide-for-touch{display:table-header-group !important}.touch thead.show-for-touch{display:table-header-group !important}tbody.hide-for-touch{display:table-row-group !important}.touch tbody.show-for-touch{display:table-row-group !important}tr.hide-for-touch{display:table-row !important}.touch tr.show-for-touch{display:table-row !important}td.hide-for-touch{display:table-cell !important}.touch td.show-for-touch{display:table-cell !important}th.hide-for-touch{display:table-cell !important}.touch th.show-for-touch{display:table-cell !important}.print-only{display:none !important}@media print{*{background:transparent !important;color:#000 !important;box-shadow:none !important;text-shadow:none !important}.show-for-print{display:block}.hide-for-print{display:none}table.show-for-print{display:table !important}thead.show-for-print{display:table-header-group !important}tbody.show-for-print{display:table-row-group !important}tr.show-for-print{display:table-row !important}td.show-for-print{display:table-cell !important}th.show-for-print{display:table-cell !important}a,a:visited{text-decoration:underline}a[href]:after{content:" (" attr(href) ")"}abbr[title]:after{content:" (" attr(title) ")"}.ir a:after,a[href^="javascript:"]:after,a[href^="#"]:after{content:""}pre,blockquote{border:1px solid #999;page-break-inside:avoid}thead{display:table-header-group}tr,img{page-break-inside:avoid}img{max-width:100% !important}@page{margin:0.5cm}p,h2,h3{orphans:3;widows:3}h2,h3{page-break-after:avoid}.hide-on-print{display:none !important}.print-only{display:block !important}.hide-for-print{display:none !important}.show-for-print{display:inherit !important}}@media print{.show-for-print{display:block}.hide-for-print{display:none}table.show-for-print{display:table !important}thead.show-for-print{display:table-header-group !important}tbody.show-for-print{display:table-row-group !important}tr.show-for-print{display:table-row !important}td.show-for-print{display:table-cell !important}th.show-for-print{display:table-cell !important}}.slick-slider{position:relative;display:block;box-sizing:border-box;-moz-box-sizing:border-box;-webkit-touch-callout:none;-webkit-user-select:none;-khtml-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;-ms-touch-action:pan-y;touch-action:pan-y;-webkit-tap-highlight-color:transparent}.slick-list{position:relative;overflow:hidden;display:block;margin:0;padding:0}.slick-list:focus{outline:none}.slick-list.dragging{cursor:pointer;cursor:hand}.slick-slider .slick-track,.slick-slider .slick-list{-webkit-transform:translate3d(0, 0, 0);-moz-transform:translate3d(0, 0, 0);-ms-transform:translate3d(0, 0, 0);-o-transform:translate3d(0, 0, 0);transform:translate3d(0, 0, 0)}.slick-track{position:relative;left:0;top:0;display:block}.slick-track:before,.slick-track:after{content:"";display:table}.slick-track:after{clear:both}.slick-loading .slick-track{visibility:hidden}.slick-slide{float:left;height:100%;min-height:1px;display:none}[dir="rtl"] .slick-slide{float:right}.slick-slide img{display:block}.slick-slide.slick-loading img{display:none}.slick-slide.dragging img{pointer-events:none}.slick-initialized .slick-slide{display:block}.slick-loading .slick-slide{visibility:hidden}.slick-vertical .slick-slide{display:block;height:auto;border:1px solid transparent}.slick-loading .slick-list{background:#fff url("../img/ajax-loader.gif") center center no-repeat}.slick-prev,.slick-next{position:absolute;display:block;height:20px;width:20px;line-height:0;font-size:0;cursor:pointer;background:transparent;color:transparent;top:50%;margin-top:-10px;padding:0;border:none;outline:none}.slick-prev:hover,.slick-prev:focus,.slick-next:hover,.slick-next:focus{outline:none;background:transparent;color:transparent}.slick-prev:hover:before,.slick-prev:focus:before,.slick-next:hover:before,.slick-next:focus:before{opacity:1}.slick-prev.slick-disabled:before,.slick-next.slick-disabled:before{opacity:.25}.slick-prev:before,.slick-next:before{font-family:"FontAwesome";font-size:20px;line-height:1;color:#ba2619;opacity:.75;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}.slick-prev{left:15px}[dir="rtl"] .slick-prev{left:auto;right:15px}.slick-prev:before{content:""}[dir="rtl"] .slick-prev:before{content:""}.slick-next{right:15px}[dir="rtl"] .slick-next{left:15px;right:auto}.slick-next:before{content:""}[dir="rtl"] .slick-next:before{content:""}.slick-slider{margin-bottom:30px}.slick-dots{margin:0;position:absolute;bottom:15px;list-style:none;display:block;text-align:center;padding:0;width:100%}.slick-dots li{position:relative;display:inline-block;height:20px;width:20px;margin:0 5px;padding:0;cursor:pointer}.slick-dots li button{border:0;background:transparent;display:block;height:20px;width:20px;outline:none;line-height:0;font-size:0;color:transparent;padding:5px;cursor:pointer}.slick-dots li button:hover,.slick-dots li button:focus{outline:none}.slick-dots li button:hover:before,.slick-dots li button:focus:before{opacity:1}.slick-dots li button:before{position:absolute;top:0;left:0;content:"";width:20px;height:20px;font-family:"FontAwesome";font-size:12px;line-height:20px;text-align:center;color:#000;opacity:.25;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}.slick-dots li.slick-active button:before{color:#ba2619;opacity:.75}/*! +/*! normalize.css v3.0.2 | MIT License | git.io/normalize */html{font-family:sans-serif;-ms-text-size-adjust:100%;-webkit-text-size-adjust:100%}body{margin:0}article,aside,details,figcaption,figure,footer,header,hgroup,main,menu,nav,section,summary{display:block}audio,canvas,progress,video{display:inline-block;vertical-align:baseline}audio:not([controls]){display:none;height:0}[hidden],template{display:none}a{background-color:transparent}a:active,a:hover{outline:0}abbr[title]{border-bottom:1px dotted}b,strong{font-weight:bold}dfn{font-style:italic}h1{font-size:2em;margin:0.67em 0}mark{background:#ff0;color:#000}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sup{top:-0.5em}sub{bottom:-0.25em}img{border:0}svg:not(:root){overflow:hidden}figure{margin:1em 40px}hr{-moz-box-sizing:content-box;box-sizing:content-box;height:0}pre{overflow:auto}code,kbd,pre,samp{font-family:monospace, monospace;font-size:1em}button,input,optgroup,select,textarea{color:inherit;font:inherit;margin:0}button{overflow:visible}button,select{text-transform:none}button,html input[type="button"],input[type="reset"],input[type="submit"]{-webkit-appearance:button;cursor:pointer}button[disabled],html input[disabled]{cursor:default}button::-moz-focus-inner,input::-moz-focus-inner{border:0;padding:0}input{line-height:normal}input[type="checkbox"],input[type="radio"]{box-sizing:border-box;padding:0}input[type="number"]::-webkit-inner-spin-button,input[type="number"]::-webkit-outer-spin-button{height:auto}input[type="search"]{-webkit-appearance:textfield;-moz-box-sizing:content-box;-webkit-box-sizing:content-box;box-sizing:content-box}input[type="search"]::-webkit-search-cancel-button,input[type="search"]::-webkit-search-decoration{-webkit-appearance:none}fieldset{border:1px solid #c0c0c0;margin:0 2px;padding:0.35em 0.625em 0.75em}legend{border:0;padding:0}textarea{overflow:auto}optgroup{font-weight:bold}table{border-collapse:collapse;border-spacing:0}td,th{padding:0}meta.foundation-version{font-family:"/5.5.1/"}meta.foundation-mq-small{font-family:"/only screen/";width:0em}meta.foundation-mq-small-only{font-family:"/only screen and (max-width: 40em)/";width:0em}meta.foundation-mq-medium{font-family:"/only screen and (min-width:40.0625em)/";width:40.0625em}meta.foundation-mq-medium-only{font-family:"/only screen and (min-width:40.0625em) and (max-width:64em)/";width:40.0625em}meta.foundation-mq-large{font-family:"/only screen and (min-width:64.0625em)/";width:64.0625em}meta.foundation-mq-large-only{font-family:"/only screen and (min-width:64.0625em) and (max-width:90em)/";width:64.0625em}meta.foundation-mq-xlarge{font-family:"/only screen and (min-width:90.0625em)/";width:90.0625em}meta.foundation-mq-xlarge-only{font-family:"/only screen and (min-width:90.0625em) and (max-width:120em)/";width:90.0625em}meta.foundation-mq-xxlarge{font-family:"/only screen and (min-width:120.0625em)/";width:120.0625em}meta.foundation-data-attribute-namespace{font-family:false}html,body{height:100%}*,*:before,*:after{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}html,body{font-size:100%}body{background:#fff;color:#222;padding:0;margin:0;font-family:"Open Sans","Helvetica Neue",Helvetica,Roboto,Arial,sans-serif;font-weight:400;font-style:normal;line-height:1.5;position:relative;cursor:auto}a:hover{cursor:pointer}img{max-width:100%;height:auto}img{-ms-interpolation-mode:bicubic}#map_canvas img,#map_canvas embed,#map_canvas object,.map_canvas img,.map_canvas embed,.map_canvas object{max-width:none !important}.left{float:left !important}.right{float:right !important}.clearfix:before,.clearfix:after{content:" ";display:table}.clearfix:after{clear:both}.hide{display:none}.invisible{visibility:hidden}.antialiased{-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}img{display:inline-block;vertical-align:middle}textarea{height:auto;min-height:50px}select{width:100%}[class*="block-grid-"]{display:block;padding:0;margin:0 -.625rem}[class*="block-grid-"]:before,[class*="block-grid-"]:after{content:" ";display:table}[class*="block-grid-"]:after{clear:both}[class*="block-grid-"]>li{display:block;height:auto;float:left;padding:0 .625rem 1.25rem}@media only screen{.small-block-grid-1>li{width:100%;list-style:none}.small-block-grid-1>li:nth-of-type(1n){clear:none}.small-block-grid-1>li:nth-of-type(1n+1){clear:both}.small-block-grid-2>li{width:50%;list-style:none}.small-block-grid-2>li:nth-of-type(1n){clear:none}.small-block-grid-2>li:nth-of-type(2n+1){clear:both}.small-block-grid-3>li{width:33.3333333333%;list-style:none}.small-block-grid-3>li:nth-of-type(1n){clear:none}.small-block-grid-3>li:nth-of-type(3n+1){clear:both}.small-block-grid-4>li{width:25%;list-style:none}.small-block-grid-4>li:nth-of-type(1n){clear:none}.small-block-grid-4>li:nth-of-type(4n+1){clear:both}.small-block-grid-5>li{width:20%;list-style:none}.small-block-grid-5>li:nth-of-type(1n){clear:none}.small-block-grid-5>li:nth-of-type(5n+1){clear:both}.small-block-grid-6>li{width:16.6666666667%;list-style:none}.small-block-grid-6>li:nth-of-type(1n){clear:none}.small-block-grid-6>li:nth-of-type(6n+1){clear:both}.small-block-grid-7>li{width:14.2857142857%;list-style:none}.small-block-grid-7>li:nth-of-type(1n){clear:none}.small-block-grid-7>li:nth-of-type(7n+1){clear:both}.small-block-grid-8>li{width:12.5%;list-style:none}.small-block-grid-8>li:nth-of-type(1n){clear:none}.small-block-grid-8>li:nth-of-type(8n+1){clear:both}.small-block-grid-9>li{width:11.1111111111%;list-style:none}.small-block-grid-9>li:nth-of-type(1n){clear:none}.small-block-grid-9>li:nth-of-type(9n+1){clear:both}.small-block-grid-10>li{width:10%;list-style:none}.small-block-grid-10>li:nth-of-type(1n){clear:none}.small-block-grid-10>li:nth-of-type(10n+1){clear:both}.small-block-grid-11>li{width:9.0909090909%;list-style:none}.small-block-grid-11>li:nth-of-type(1n){clear:none}.small-block-grid-11>li:nth-of-type(11n+1){clear:both}.small-block-grid-12>li{width:8.3333333333%;list-style:none}.small-block-grid-12>li:nth-of-type(1n){clear:none}.small-block-grid-12>li:nth-of-type(12n+1){clear:both}}@media only screen and (min-width: 40.0625em){.medium-block-grid-1>li{width:100%;list-style:none}.medium-block-grid-1>li:nth-of-type(1n){clear:none}.medium-block-grid-1>li:nth-of-type(1n+1){clear:both}.medium-block-grid-2>li{width:50%;list-style:none}.medium-block-grid-2>li:nth-of-type(1n){clear:none}.medium-block-grid-2>li:nth-of-type(2n+1){clear:both}.medium-block-grid-3>li{width:33.3333333333%;list-style:none}.medium-block-grid-3>li:nth-of-type(1n){clear:none}.medium-block-grid-3>li:nth-of-type(3n+1){clear:both}.medium-block-grid-4>li{width:25%;list-style:none}.medium-block-grid-4>li:nth-of-type(1n){clear:none}.medium-block-grid-4>li:nth-of-type(4n+1){clear:both}.medium-block-grid-5>li{width:20%;list-style:none}.medium-block-grid-5>li:nth-of-type(1n){clear:none}.medium-block-grid-5>li:nth-of-type(5n+1){clear:both}.medium-block-grid-6>li{width:16.6666666667%;list-style:none}.medium-block-grid-6>li:nth-of-type(1n){clear:none}.medium-block-grid-6>li:nth-of-type(6n+1){clear:both}.medium-block-grid-7>li{width:14.2857142857%;list-style:none}.medium-block-grid-7>li:nth-of-type(1n){clear:none}.medium-block-grid-7>li:nth-of-type(7n+1){clear:both}.medium-block-grid-8>li{width:12.5%;list-style:none}.medium-block-grid-8>li:nth-of-type(1n){clear:none}.medium-block-grid-8>li:nth-of-type(8n+1){clear:both}.medium-block-grid-9>li{width:11.1111111111%;list-style:none}.medium-block-grid-9>li:nth-of-type(1n){clear:none}.medium-block-grid-9>li:nth-of-type(9n+1){clear:both}.medium-block-grid-10>li{width:10%;list-style:none}.medium-block-grid-10>li:nth-of-type(1n){clear:none}.medium-block-grid-10>li:nth-of-type(10n+1){clear:both}.medium-block-grid-11>li{width:9.0909090909%;list-style:none}.medium-block-grid-11>li:nth-of-type(1n){clear:none}.medium-block-grid-11>li:nth-of-type(11n+1){clear:both}.medium-block-grid-12>li{width:8.3333333333%;list-style:none}.medium-block-grid-12>li:nth-of-type(1n){clear:none}.medium-block-grid-12>li:nth-of-type(12n+1){clear:both}}@media only screen and (min-width: 64.0625em){.large-block-grid-1>li{width:100%;list-style:none}.large-block-grid-1>li:nth-of-type(1n){clear:none}.large-block-grid-1>li:nth-of-type(1n+1){clear:both}.large-block-grid-2>li{width:50%;list-style:none}.large-block-grid-2>li:nth-of-type(1n){clear:none}.large-block-grid-2>li:nth-of-type(2n+1){clear:both}.large-block-grid-3>li{width:33.3333333333%;list-style:none}.large-block-grid-3>li:nth-of-type(1n){clear:none}.large-block-grid-3>li:nth-of-type(3n+1){clear:both}.large-block-grid-4>li{width:25%;list-style:none}.large-block-grid-4>li:nth-of-type(1n){clear:none}.large-block-grid-4>li:nth-of-type(4n+1){clear:both}.large-block-grid-5>li{width:20%;list-style:none}.large-block-grid-5>li:nth-of-type(1n){clear:none}.large-block-grid-5>li:nth-of-type(5n+1){clear:both}.large-block-grid-6>li{width:16.6666666667%;list-style:none}.large-block-grid-6>li:nth-of-type(1n){clear:none}.large-block-grid-6>li:nth-of-type(6n+1){clear:both}.large-block-grid-7>li{width:14.2857142857%;list-style:none}.large-block-grid-7>li:nth-of-type(1n){clear:none}.large-block-grid-7>li:nth-of-type(7n+1){clear:both}.large-block-grid-8>li{width:12.5%;list-style:none}.large-block-grid-8>li:nth-of-type(1n){clear:none}.large-block-grid-8>li:nth-of-type(8n+1){clear:both}.large-block-grid-9>li{width:11.1111111111%;list-style:none}.large-block-grid-9>li:nth-of-type(1n){clear:none}.large-block-grid-9>li:nth-of-type(9n+1){clear:both}.large-block-grid-10>li{width:10%;list-style:none}.large-block-grid-10>li:nth-of-type(1n){clear:none}.large-block-grid-10>li:nth-of-type(10n+1){clear:both}.large-block-grid-11>li{width:9.0909090909%;list-style:none}.large-block-grid-11>li:nth-of-type(1n){clear:none}.large-block-grid-11>li:nth-of-type(11n+1){clear:both}.large-block-grid-12>li{width:8.3333333333%;list-style:none}.large-block-grid-12>li:nth-of-type(1n){clear:none}.large-block-grid-12>li:nth-of-type(12n+1){clear:both}}button,.button{border-style:solid;border-width:0;cursor:pointer;font-family:"Open Sans","Helvetica Neue",Helvetica,Roboto,Arial,sans-serif;font-weight:400;line-height:normal;margin:0 0 1.25rem;position:relative;text-decoration:none;text-align:center;-webkit-appearance:none;-moz-appearance:none;border-radius:0;display:inline-block;padding-top:1rem;padding-right:2rem;padding-bottom:1.0625rem;padding-left:2rem;font-size:1rem;background-color:#ba2619;border-color:#951e14;color:#fff;transition:background-color 300ms ease-out}button:hover,button:focus,.button:hover,.button:focus{background-color:#951e14}button:hover,button:focus,.button:hover,.button:focus{color:#fff}button.secondary,.button.secondary{background-color:#e7e7e7;border-color:#b9b9b9;color:#333}button.secondary:hover,button.secondary:focus,.button.secondary:hover,.button.secondary:focus{background-color:#b9b9b9}button.secondary:hover,button.secondary:focus,.button.secondary:hover,.button.secondary:focus{color:#333}button.success,.button.success{background-color:#43AC6A;border-color:#368a55;color:#fff}button.success:hover,button.success:focus,.button.success:hover,.button.success:focus{background-color:#368a55}button.success:hover,button.success:focus,.button.success:hover,.button.success:focus{color:#fff}button.alert,.button.alert{background-color:#f04124;border-color:#cf2a0e;color:#fff}button.alert:hover,button.alert:focus,.button.alert:hover,.button.alert:focus{background-color:#cf2a0e}button.alert:hover,button.alert:focus,.button.alert:hover,.button.alert:focus{color:#fff}button.warning,.button.warning{background-color:#f08a24;border-color:#cf6e0e;color:#fff}button.warning:hover,button.warning:focus,.button.warning:hover,.button.warning:focus{background-color:#cf6e0e}button.warning:hover,button.warning:focus,.button.warning:hover,.button.warning:focus{color:#fff}button.info,.button.info{background-color:#a0d3e8;border-color:#61b6d9;color:#333}button.info:hover,button.info:focus,.button.info:hover,.button.info:focus{background-color:#61b6d9}button.info:hover,button.info:focus,.button.info:hover,.button.info:focus{color:#fff}button.large,.button.large{padding-top:1.125rem;padding-right:2.25rem;padding-bottom:1.1875rem;padding-left:2.25rem;font-size:1.25rem}button.small,.button.small{padding-top:.875rem;padding-right:1.75rem;padding-bottom:.9375rem;padding-left:1.75rem;font-size:.8125rem}button.tiny,.button.tiny{padding-top:.625rem;padding-right:1.25rem;padding-bottom:.6875rem;padding-left:1.25rem;font-size:.6875rem}button.expand,.button.expand{padding-right:0;padding-left:0;width:100%}button.left-align,.button.left-align{text-align:left;text-indent:.75rem}button.right-align,.button.right-align{text-align:right;padding-right:.75rem}button.radius,.button.radius{border-radius:3px}button.round,.button.round{border-radius:1000px}button.disabled,button[disabled],.button.disabled,.button[disabled]{background-color:#ba2619;border-color:#951e14;color:#fff;cursor:default;opacity:.7;box-shadow:none}button.disabled:hover,button.disabled:focus,button[disabled]:hover,button[disabled]:focus,.button.disabled:hover,.button.disabled:focus,.button[disabled]:hover,.button[disabled]:focus{background-color:#951e14}button.disabled:hover,button.disabled:focus,button[disabled]:hover,button[disabled]:focus,.button.disabled:hover,.button.disabled:focus,.button[disabled]:hover,.button[disabled]:focus{color:#fff}button.disabled:hover,button.disabled:focus,button[disabled]:hover,button[disabled]:focus,.button.disabled:hover,.button.disabled:focus,.button[disabled]:hover,.button[disabled]:focus{background-color:#ba2619}button.disabled.secondary,button[disabled].secondary,.button.disabled.secondary,.button[disabled].secondary{background-color:#e7e7e7;border-color:#b9b9b9;color:#333;cursor:default;opacity:.7;box-shadow:none}button.disabled.secondary:hover,button.disabled.secondary:focus,button[disabled].secondary:hover,button[disabled].secondary:focus,.button.disabled.secondary:hover,.button.disabled.secondary:focus,.button[disabled].secondary:hover,.button[disabled].secondary:focus{background-color:#b9b9b9}button.disabled.secondary:hover,button.disabled.secondary:focus,button[disabled].secondary:hover,button[disabled].secondary:focus,.button.disabled.secondary:hover,.button.disabled.secondary:focus,.button[disabled].secondary:hover,.button[disabled].secondary:focus{color:#333}button.disabled.secondary:hover,button.disabled.secondary:focus,button[disabled].secondary:hover,button[disabled].secondary:focus,.button.disabled.secondary:hover,.button.disabled.secondary:focus,.button[disabled].secondary:hover,.button[disabled].secondary:focus{background-color:#e7e7e7}button.disabled.success,button[disabled].success,.button.disabled.success,.button[disabled].success{background-color:#43AC6A;border-color:#368a55;color:#fff;cursor:default;opacity:.7;box-shadow:none}button.disabled.success:hover,button.disabled.success:focus,button[disabled].success:hover,button[disabled].success:focus,.button.disabled.success:hover,.button.disabled.success:focus,.button[disabled].success:hover,.button[disabled].success:focus{background-color:#368a55}button.disabled.success:hover,button.disabled.success:focus,button[disabled].success:hover,button[disabled].success:focus,.button.disabled.success:hover,.button.disabled.success:focus,.button[disabled].success:hover,.button[disabled].success:focus{color:#fff}button.disabled.success:hover,button.disabled.success:focus,button[disabled].success:hover,button[disabled].success:focus,.button.disabled.success:hover,.button.disabled.success:focus,.button[disabled].success:hover,.button[disabled].success:focus{background-color:#43AC6A}button.disabled.alert,button[disabled].alert,.button.disabled.alert,.button[disabled].alert{background-color:#f04124;border-color:#cf2a0e;color:#fff;cursor:default;opacity:.7;box-shadow:none}button.disabled.alert:hover,button.disabled.alert:focus,button[disabled].alert:hover,button[disabled].alert:focus,.button.disabled.alert:hover,.button.disabled.alert:focus,.button[disabled].alert:hover,.button[disabled].alert:focus{background-color:#cf2a0e}button.disabled.alert:hover,button.disabled.alert:focus,button[disabled].alert:hover,button[disabled].alert:focus,.button.disabled.alert:hover,.button.disabled.alert:focus,.button[disabled].alert:hover,.button[disabled].alert:focus{color:#fff}button.disabled.alert:hover,button.disabled.alert:focus,button[disabled].alert:hover,button[disabled].alert:focus,.button.disabled.alert:hover,.button.disabled.alert:focus,.button[disabled].alert:hover,.button[disabled].alert:focus{background-color:#f04124}button.disabled.warning,button[disabled].warning,.button.disabled.warning,.button[disabled].warning{background-color:#f08a24;border-color:#cf6e0e;color:#fff;cursor:default;opacity:.7;box-shadow:none}button.disabled.warning:hover,button.disabled.warning:focus,button[disabled].warning:hover,button[disabled].warning:focus,.button.disabled.warning:hover,.button.disabled.warning:focus,.button[disabled].warning:hover,.button[disabled].warning:focus{background-color:#cf6e0e}button.disabled.warning:hover,button.disabled.warning:focus,button[disabled].warning:hover,button[disabled].warning:focus,.button.disabled.warning:hover,.button.disabled.warning:focus,.button[disabled].warning:hover,.button[disabled].warning:focus{color:#fff}button.disabled.warning:hover,button.disabled.warning:focus,button[disabled].warning:hover,button[disabled].warning:focus,.button.disabled.warning:hover,.button.disabled.warning:focus,.button[disabled].warning:hover,.button[disabled].warning:focus{background-color:#f08a24}button.disabled.info,button[disabled].info,.button.disabled.info,.button[disabled].info{background-color:#a0d3e8;border-color:#61b6d9;color:#333;cursor:default;opacity:.7;box-shadow:none}button.disabled.info:hover,button.disabled.info:focus,button[disabled].info:hover,button[disabled].info:focus,.button.disabled.info:hover,.button.disabled.info:focus,.button[disabled].info:hover,.button[disabled].info:focus{background-color:#61b6d9}button.disabled.info:hover,button.disabled.info:focus,button[disabled].info:hover,button[disabled].info:focus,.button.disabled.info:hover,.button.disabled.info:focus,.button[disabled].info:hover,.button[disabled].info:focus{color:#fff}button.disabled.info:hover,button.disabled.info:focus,button[disabled].info:hover,button[disabled].info:focus,.button.disabled.info:hover,.button.disabled.info:focus,.button[disabled].info:hover,.button[disabled].info:focus{background-color:#a0d3e8}button::-moz-focus-inner{border:0;padding:0}@media only screen and (min-width: 40.0625em){button,.button{display:inline-block}}.clearing-thumbs,[data-clearing]{margin-bottom:0;margin-left:0;list-style:none}.clearing-thumbs:before,.clearing-thumbs:after,[data-clearing]:before,[data-clearing]:after{content:" ";display:table}.clearing-thumbs:after,[data-clearing]:after{clear:both}.clearing-thumbs li,[data-clearing] li{float:left;margin-right:10px}.clearing-thumbs[class*="block-grid-"] li,[data-clearing][class*="block-grid-"] li{margin-right:0}.clearing-blackout{background:#333;position:fixed;width:100%;height:100%;top:0;left:0;z-index:998}.clearing-blackout .clearing-close{display:block}.clearing-container{position:relative;z-index:998;height:100%;overflow:hidden;margin:0}.clearing-touch-label{position:absolute;top:50%;left:50%;color:#aaa;font-size:0.6em}.visible-img{height:95%;position:relative}.visible-img img{position:absolute;left:50%;top:50%;transform:translateY(-50%) translateX(-50%);-webkit-transform:translateY(-50%) translateX(-50%);-ms-transform:translateY(-50%) translateX(-50%);max-height:100%;max-width:100%}.clearing-caption{color:#ccc;font-size:.875em;line-height:1.3;margin-bottom:0;text-align:center;bottom:0;background:#333;width:100%;padding:10px 30px 20px;position:absolute;left:0}.clearing-close{z-index:999;padding-left:20px;padding-top:10px;font-size:30px;line-height:1;color:#ccc;display:none}.clearing-close:hover,.clearing-close:focus{color:#ccc}.clearing-assembled .clearing-container{height:100%}.clearing-assembled .clearing-container .carousel>ul{display:none}.clearing-feature li{display:none}.clearing-feature li.clearing-featured-img{display:block}@media only screen and (min-width: 40.0625em){.clearing-main-prev,.clearing-main-next{position:absolute;height:100%;width:40px;top:0}.clearing-main-prev>span,.clearing-main-next>span{position:absolute;top:50%;display:block;width:0;height:0;border:solid 12px}.clearing-main-prev>span:hover,.clearing-main-next>span:hover{opacity:0.8}.clearing-main-prev{left:0}.clearing-main-prev>span{left:5px;border-color:transparent;border-right-color:#ccc}.clearing-main-next{right:0}.clearing-main-next>span{border-color:transparent;border-left-color:#ccc}.clearing-main-prev.disabled,.clearing-main-next.disabled{opacity:0.3}.clearing-assembled .clearing-container .carousel{background:rgba(51,51,51,0.8);height:120px;margin-top:10px;text-align:center}.clearing-assembled .clearing-container .carousel>ul{display:inline-block;z-index:999;height:100%;position:relative;float:none}.clearing-assembled .clearing-container .carousel>ul li{display:block;width:120px;min-height:inherit;float:left;overflow:hidden;margin-right:0;padding:0;position:relative;cursor:pointer;opacity:0.4;clear:none}.clearing-assembled .clearing-container .carousel>ul li.fix-height img{height:100%;max-width:none}.clearing-assembled .clearing-container .carousel>ul li a.th{border:none;box-shadow:none;display:block}.clearing-assembled .clearing-container .carousel>ul li img{cursor:pointer !important;width:100% !important}.clearing-assembled .clearing-container .carousel>ul li.visible{opacity:1}.clearing-assembled .clearing-container .carousel>ul li:hover{opacity:0.8}.clearing-assembled .clearing-container .visible-img{background:#333;overflow:hidden;height:85%}.clearing-close{position:absolute;top:10px;right:20px;padding-left:0;padding-top:0}}form{margin:0 0 1rem}form .row .row{margin:0 -.5rem}form .row .row .column,form .row .row .columns{padding:0 .5rem}form .row .row.collapse{margin:0}form .row .row.collapse .column,form .row .row.collapse .columns{padding:0}form .row .row.collapse input{-webkit-border-bottom-right-radius:0;-webkit-border-top-right-radius:0;border-bottom-right-radius:0;border-top-right-radius:0}form .row input.column,form .row input.columns,form .row textarea.column,form .row textarea.columns{padding-left:.5rem}label{font-size:.875rem;color:#4d4c4c;cursor:pointer;display:block;font-weight:400;line-height:1.5;margin-bottom:0}label.right{float:none !important;text-align:right}label.inline{margin:0 0 1rem 0;padding:.5625rem 0}label small{text-transform:capitalize;color:#676767}.prefix,.postfix{display:block;position:relative;z-index:2;text-align:center;width:100%;padding-top:0;padding-bottom:0;border-style:solid;border-width:1px;overflow:visible;font-size:.875rem;height:2.3125rem;line-height:2.3125rem}.postfix.button{padding-left:0;padding-right:0;padding-top:0;padding-bottom:0;text-align:center;border:none}.prefix.button{padding-left:0;padding-right:0;padding-top:0;padding-bottom:0;text-align:center;border:none}.prefix.button.radius{border-radius:0;-webkit-border-bottom-left-radius:3px;-webkit-border-top-left-radius:3px;border-bottom-left-radius:3px;border-top-left-radius:3px}.postfix.button.radius{border-radius:0;-webkit-border-bottom-right-radius:3px;-webkit-border-top-right-radius:3px;border-bottom-right-radius:3px;border-top-right-radius:3px}.prefix.button.round{border-radius:0;-webkit-border-bottom-left-radius:1000px;-webkit-border-top-left-radius:1000px;border-bottom-left-radius:1000px;border-top-left-radius:1000px}.postfix.button.round{border-radius:0;-webkit-border-bottom-right-radius:1000px;-webkit-border-top-right-radius:1000px;border-bottom-right-radius:1000px;border-top-right-radius:1000px}span.prefix,label.prefix{background:#f2f2f2;border-right:none;color:#333;border-color:#ccc}span.postfix,label.postfix{background:#f2f2f2;border-left:none;color:#333;border-color:#ccc}input[type="text"],input[type="password"],input[type="date"],input[type="datetime"],input[type="datetime-local"],input[type="month"],input[type="week"],input[type="email"],input[type="number"],input[type="search"],input[type="tel"],input[type="time"],input[type="url"],input[type="color"],textarea{-webkit-appearance:none;border-radius:0;background-color:#fff;font-family:inherit;border-style:solid;border-width:1px;border-color:#ccc;box-shadow:inset 0 1px 2px rgba(0,0,0,0.1);color:rgba(0,0,0,0.75);display:block;font-size:.875rem;margin:0 0 1rem 0;padding:.5rem;height:2.3125rem;width:100%;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;transition:all .15s linear}input[type="text"]:focus,input[type="password"]:focus,input[type="date"]:focus,input[type="datetime"]:focus,input[type="datetime-local"]:focus,input[type="month"]:focus,input[type="week"]:focus,input[type="email"]:focus,input[type="number"]:focus,input[type="search"]:focus,input[type="tel"]:focus,input[type="time"]:focus,input[type="url"]:focus,input[type="color"]:focus,textarea:focus{background:#fafafa;border-color:#999;outline:none}input[type="text"]:disabled,input[type="password"]:disabled,input[type="date"]:disabled,input[type="datetime"]:disabled,input[type="datetime-local"]:disabled,input[type="month"]:disabled,input[type="week"]:disabled,input[type="email"]:disabled,input[type="number"]:disabled,input[type="search"]:disabled,input[type="tel"]:disabled,input[type="time"]:disabled,input[type="url"]:disabled,input[type="color"]:disabled,textarea:disabled{background-color:#ddd;cursor:default}input[type="text"][disabled],input[type="text"][readonly],fieldset[disabled] input[type="text"],input[type="password"][disabled],input[type="password"][readonly],fieldset[disabled] input[type="password"],input[type="date"][disabled],input[type="date"][readonly],fieldset[disabled] input[type="date"],input[type="datetime"][disabled],input[type="datetime"][readonly],fieldset[disabled] input[type="datetime"],input[type="datetime-local"][disabled],input[type="datetime-local"][readonly],fieldset[disabled] input[type="datetime-local"],input[type="month"][disabled],input[type="month"][readonly],fieldset[disabled] input[type="month"],input[type="week"][disabled],input[type="week"][readonly],fieldset[disabled] input[type="week"],input[type="email"][disabled],input[type="email"][readonly],fieldset[disabled] input[type="email"],input[type="number"][disabled],input[type="number"][readonly],fieldset[disabled] input[type="number"],input[type="search"][disabled],input[type="search"][readonly],fieldset[disabled] input[type="search"],input[type="tel"][disabled],input[type="tel"][readonly],fieldset[disabled] input[type="tel"],input[type="time"][disabled],input[type="time"][readonly],fieldset[disabled] input[type="time"],input[type="url"][disabled],input[type="url"][readonly],fieldset[disabled] input[type="url"],input[type="color"][disabled],input[type="color"][readonly],fieldset[disabled] input[type="color"],textarea[disabled],textarea[readonly],fieldset[disabled] textarea{background-color:#ddd;cursor:default}input[type="text"].radius,input[type="password"].radius,input[type="date"].radius,input[type="datetime"].radius,input[type="datetime-local"].radius,input[type="month"].radius,input[type="week"].radius,input[type="email"].radius,input[type="number"].radius,input[type="search"].radius,input[type="tel"].radius,input[type="time"].radius,input[type="url"].radius,input[type="color"].radius,textarea.radius{border-radius:3px}form .row .prefix-radius.row.collapse input,form .row .prefix-radius.row.collapse textarea,form .row .prefix-radius.row.collapse select,form .row .prefix-radius.row.collapse button{border-radius:0;-webkit-border-bottom-right-radius:3px;-webkit-border-top-right-radius:3px;border-bottom-right-radius:3px;border-top-right-radius:3px}form .row .prefix-radius.row.collapse .prefix{border-radius:0;-webkit-border-bottom-left-radius:3px;-webkit-border-top-left-radius:3px;border-bottom-left-radius:3px;border-top-left-radius:3px}form .row .postfix-radius.row.collapse input,form .row .postfix-radius.row.collapse textarea,form .row .postfix-radius.row.collapse select,form .row .postfix-radius.row.collapse button{border-radius:0;-webkit-border-bottom-left-radius:3px;-webkit-border-top-left-radius:3px;border-bottom-left-radius:3px;border-top-left-radius:3px}form .row .postfix-radius.row.collapse .postfix{border-radius:0;-webkit-border-bottom-right-radius:3px;-webkit-border-top-right-radius:3px;border-bottom-right-radius:3px;border-top-right-radius:3px}form .row .prefix-round.row.collapse input,form .row .prefix-round.row.collapse textarea,form .row .prefix-round.row.collapse select,form .row .prefix-round.row.collapse button{border-radius:0;-webkit-border-bottom-right-radius:1000px;-webkit-border-top-right-radius:1000px;border-bottom-right-radius:1000px;border-top-right-radius:1000px}form .row .prefix-round.row.collapse .prefix{border-radius:0;-webkit-border-bottom-left-radius:1000px;-webkit-border-top-left-radius:1000px;border-bottom-left-radius:1000px;border-top-left-radius:1000px}form .row .postfix-round.row.collapse input,form .row .postfix-round.row.collapse textarea,form .row .postfix-round.row.collapse select,form .row .postfix-round.row.collapse button{border-radius:0;-webkit-border-bottom-left-radius:1000px;-webkit-border-top-left-radius:1000px;border-bottom-left-radius:1000px;border-top-left-radius:1000px}form .row .postfix-round.row.collapse .postfix{border-radius:0;-webkit-border-bottom-right-radius:1000px;-webkit-border-top-right-radius:1000px;border-bottom-right-radius:1000px;border-top-right-radius:1000px}input[type="submit"]{-webkit-appearance:none;border-radius:0}textarea[rows]{height:auto}textarea{max-width:100%}select{-webkit-appearance:none !important;border-radius:0;background-color:#FAFAFA;background-image:url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZlcnNpb249IjEuMSIgeD0iMTJweCIgeT0iMHB4IiB3aWR0aD0iMjRweCIgaGVpZ2h0PSIzcHgiIHZpZXdCb3g9IjAgMCA2IDMiIGVuYWJsZS1iYWNrZ3JvdW5kPSJuZXcgMCAwIDYgMyIgeG1sOnNwYWNlPSJwcmVzZXJ2ZSI+PHBvbHlnb24gcG9pbnRzPSI1Ljk5MiwwIDIuOTkyLDMgLTAuMDA4LDAgIi8+PC9zdmc+);background-position:100% center;background-repeat:no-repeat;border-style:solid;border-width:1px;border-color:#ccc;padding:.5rem;font-size:.875rem;font-family:"Open Sans","Helvetica Neue",Helvetica,Roboto,Arial,sans-serif;color:rgba(0,0,0,0.75);line-height:normal;border-radius:0;height:2.3125rem}select::-ms-expand{display:none}select.radius{border-radius:3px}select:hover{background-color:#f3f2f2;border-color:#999}select:disabled{background-color:#ddd;cursor:default}select[multiple]{height:auto}input[type="file"],input[type="checkbox"],input[type="radio"],select{margin:0 0 1rem 0}input[type="checkbox"]+label,input[type="radio"]+label{display:inline-block;margin-left:.5rem;margin-right:1rem;margin-bottom:0;vertical-align:baseline}input[type="file"]{width:100%}fieldset{border:1px solid #ddd;padding:1.25rem;margin:1.125rem 0}fieldset legend{font-weight:700;background:#fff;padding:0 .1875rem;margin:0;margin-left:-.1875rem}[data-abide] .error small.error,[data-abide] .error span.error,[data-abide] span.error,[data-abide] small.error{display:block;padding:.375rem .5625rem .5625rem;margin-top:-1px;margin-bottom:1rem;font-size:.75rem;font-weight:400;font-style:italic;background:#f04124;color:#fff}[data-abide] span.error,[data-abide] small.error{display:none}span.error,small.error{display:block;padding:.375rem .5625rem .5625rem;margin-top:-1px;margin-bottom:1rem;font-size:.75rem;font-weight:400;font-style:italic;background:#f04124;color:#fff}.error input,.error textarea,.error select{margin-bottom:0}.error input[type="checkbox"],.error input[type="radio"]{margin-bottom:1rem}.error label,.error label.error{color:#f04124}.error small.error{display:block;padding:.375rem .5625rem .5625rem;margin-top:-1px;margin-bottom:1rem;font-size:.75rem;font-weight:400;font-style:italic;background:#f04124;color:#fff}.error>label>small{color:#676767;background:transparent;padding:0;text-transform:capitalize;font-style:normal;font-size:60%;margin:0;display:inline}.error span.error-message{display:block}input.error,textarea.error,select.error{margin-bottom:0}label.error{color:#f04124}.row{width:100%;margin-left:auto;margin-right:auto;margin-top:0;margin-bottom:0;max-width:62.5rem}.row:before,.row:after{content:" ";display:table}.row:after{clear:both}.row.collapse>.column,.row.collapse>.columns{padding-left:0;padding-right:0}.row.collapse .row{margin-left:0;margin-right:0}.row .row{width:auto;margin-left:-.9375rem;margin-right:-.9375rem;margin-top:0;margin-bottom:0;max-width:none}.row .row:before,.row .row:after{content:" ";display:table}.row .row:after{clear:both}.row .row.collapse{width:auto;margin:0;max-width:none}.row .row.collapse:before,.row .row.collapse:after{content:" ";display:table}.row .row.collapse:after{clear:both}.column,.columns{padding-left:.9375rem;padding-right:.9375rem;width:100%;float:left}[class*="column"]+[class*="column"]:last-child{float:right}[class*="column"]+[class*="column"].end{float:left}@media only screen{.small-push-0{position:relative;left:0%;right:auto}.small-pull-0{position:relative;right:0%;left:auto}.small-push-1{position:relative;left:8.3333333333%;right:auto}.small-pull-1{position:relative;right:8.3333333333%;left:auto}.small-push-2{position:relative;left:16.6666666667%;right:auto}.small-pull-2{position:relative;right:16.6666666667%;left:auto}.small-push-3{position:relative;left:25%;right:auto}.small-pull-3{position:relative;right:25%;left:auto}.small-push-4{position:relative;left:33.3333333333%;right:auto}.small-pull-4{position:relative;right:33.3333333333%;left:auto}.small-push-5{position:relative;left:41.6666666667%;right:auto}.small-pull-5{position:relative;right:41.6666666667%;left:auto}.small-push-6{position:relative;left:50%;right:auto}.small-pull-6{position:relative;right:50%;left:auto}.small-push-7{position:relative;left:58.3333333333%;right:auto}.small-pull-7{position:relative;right:58.3333333333%;left:auto}.small-push-8{position:relative;left:66.6666666667%;right:auto}.small-pull-8{position:relative;right:66.6666666667%;left:auto}.small-push-9{position:relative;left:75%;right:auto}.small-pull-9{position:relative;right:75%;left:auto}.small-push-10{position:relative;left:83.3333333333%;right:auto}.small-pull-10{position:relative;right:83.3333333333%;left:auto}.small-push-11{position:relative;left:91.6666666667%;right:auto}.small-pull-11{position:relative;right:91.6666666667%;left:auto}.column,.columns{position:relative;padding-left:.9375rem;padding-right:.9375rem;float:left}.small-1{width:8.3333333333%}.small-2{width:16.6666666667%}.small-3{width:25%}.small-4{width:33.3333333333%}.small-5{width:41.6666666667%}.small-6{width:50%}.small-7{width:58.3333333333%}.small-8{width:66.6666666667%}.small-9{width:75%}.small-10{width:83.3333333333%}.small-11{width:91.6666666667%}.small-12{width:100%}.small-offset-0{margin-left:0% !important}.small-offset-1{margin-left:8.3333333333% !important}.small-offset-2{margin-left:16.6666666667% !important}.small-offset-3{margin-left:25% !important}.small-offset-4{margin-left:33.3333333333% !important}.small-offset-5{margin-left:41.6666666667% !important}.small-offset-6{margin-left:50% !important}.small-offset-7{margin-left:58.3333333333% !important}.small-offset-8{margin-left:66.6666666667% !important}.small-offset-9{margin-left:75% !important}.small-offset-10{margin-left:83.3333333333% !important}.small-offset-11{margin-left:91.6666666667% !important}.small-reset-order{margin-left:0;margin-right:0;left:auto;right:auto;float:left}.column.small-centered,.columns.small-centered{margin-left:auto;margin-right:auto;float:none}.column.small-uncentered,.columns.small-uncentered{margin-left:0;margin-right:0;float:left}.column.small-centered:last-child,.columns.small-centered:last-child{float:none}.column.small-uncentered:last-child,.columns.small-uncentered:last-child{float:left}.column.small-uncentered.opposite,.columns.small-uncentered.opposite{float:right}.row.small-collapse>.column,.row.small-collapse>.columns{padding-left:0;padding-right:0}.row.small-collapse .row{margin-left:0;margin-right:0}.row.small-uncollapse>.column,.row.small-uncollapse>.columns{padding-left:.9375rem;padding-right:.9375rem;float:left}}@media only screen and (min-width: 40.0625em){.medium-push-0{position:relative;left:0%;right:auto}.medium-pull-0{position:relative;right:0%;left:auto}.medium-push-1{position:relative;left:8.3333333333%;right:auto}.medium-pull-1{position:relative;right:8.3333333333%;left:auto}.medium-push-2{position:relative;left:16.6666666667%;right:auto}.medium-pull-2{position:relative;right:16.6666666667%;left:auto}.medium-push-3{position:relative;left:25%;right:auto}.medium-pull-3{position:relative;right:25%;left:auto}.medium-push-4{position:relative;left:33.3333333333%;right:auto}.medium-pull-4{position:relative;right:33.3333333333%;left:auto}.medium-push-5{position:relative;left:41.6666666667%;right:auto}.medium-pull-5{position:relative;right:41.6666666667%;left:auto}.medium-push-6{position:relative;left:50%;right:auto}.medium-pull-6{position:relative;right:50%;left:auto}.medium-push-7{position:relative;left:58.3333333333%;right:auto}.medium-pull-7{position:relative;right:58.3333333333%;left:auto}.medium-push-8{position:relative;left:66.6666666667%;right:auto}.medium-pull-8{position:relative;right:66.6666666667%;left:auto}.medium-push-9{position:relative;left:75%;right:auto}.medium-pull-9{position:relative;right:75%;left:auto}.medium-push-10{position:relative;left:83.3333333333%;right:auto}.medium-pull-10{position:relative;right:83.3333333333%;left:auto}.medium-push-11{position:relative;left:91.6666666667%;right:auto}.medium-pull-11{position:relative;right:91.6666666667%;left:auto}.column,.columns{position:relative;padding-left:.9375rem;padding-right:.9375rem;float:left}.medium-1{width:8.3333333333%}.medium-2{width:16.6666666667%}.medium-3{width:25%}.medium-4{width:33.3333333333%}.medium-5{width:41.6666666667%}.medium-6{width:50%}.medium-7{width:58.3333333333%}.medium-8{width:66.6666666667%}.medium-9{width:75%}.medium-10{width:83.3333333333%}.medium-11{width:91.6666666667%}.medium-12{width:100%}.medium-offset-0{margin-left:0% !important}.medium-offset-1{margin-left:8.3333333333% !important}.medium-offset-2{margin-left:16.6666666667% !important}.medium-offset-3{margin-left:25% !important}.medium-offset-4{margin-left:33.3333333333% !important}.medium-offset-5{margin-left:41.6666666667% !important}.medium-offset-6{margin-left:50% !important}.medium-offset-7{margin-left:58.3333333333% !important}.medium-offset-8{margin-left:66.6666666667% !important}.medium-offset-9{margin-left:75% !important}.medium-offset-10{margin-left:83.3333333333% !important}.medium-offset-11{margin-left:91.6666666667% !important}.medium-reset-order{margin-left:0;margin-right:0;left:auto;right:auto;float:left}.column.medium-centered,.columns.medium-centered{margin-left:auto;margin-right:auto;float:none}.column.medium-uncentered,.columns.medium-uncentered{margin-left:0;margin-right:0;float:left}.column.medium-centered:last-child,.columns.medium-centered:last-child{float:none}.column.medium-uncentered:last-child,.columns.medium-uncentered:last-child{float:left}.column.medium-uncentered.opposite,.columns.medium-uncentered.opposite{float:right}.row.medium-collapse>.column,.row.medium-collapse>.columns{padding-left:0;padding-right:0}.row.medium-collapse .row{margin-left:0;margin-right:0}.row.medium-uncollapse>.column,.row.medium-uncollapse>.columns{padding-left:.9375rem;padding-right:.9375rem;float:left}.push-0{position:relative;left:0%;right:auto}.pull-0{position:relative;right:0%;left:auto}.push-1{position:relative;left:8.3333333333%;right:auto}.pull-1{position:relative;right:8.3333333333%;left:auto}.push-2{position:relative;left:16.6666666667%;right:auto}.pull-2{position:relative;right:16.6666666667%;left:auto}.push-3{position:relative;left:25%;right:auto}.pull-3{position:relative;right:25%;left:auto}.push-4{position:relative;left:33.3333333333%;right:auto}.pull-4{position:relative;right:33.3333333333%;left:auto}.push-5{position:relative;left:41.6666666667%;right:auto}.pull-5{position:relative;right:41.6666666667%;left:auto}.push-6{position:relative;left:50%;right:auto}.pull-6{position:relative;right:50%;left:auto}.push-7{position:relative;left:58.3333333333%;right:auto}.pull-7{position:relative;right:58.3333333333%;left:auto}.push-8{position:relative;left:66.6666666667%;right:auto}.pull-8{position:relative;right:66.6666666667%;left:auto}.push-9{position:relative;left:75%;right:auto}.pull-9{position:relative;right:75%;left:auto}.push-10{position:relative;left:83.3333333333%;right:auto}.pull-10{position:relative;right:83.3333333333%;left:auto}.push-11{position:relative;left:91.6666666667%;right:auto}.pull-11{position:relative;right:91.6666666667%;left:auto}}@media only screen and (min-width: 64.0625em){.large-push-0{position:relative;left:0%;right:auto}.large-pull-0{position:relative;right:0%;left:auto}.large-push-1{position:relative;left:8.3333333333%;right:auto}.large-pull-1{position:relative;right:8.3333333333%;left:auto}.large-push-2{position:relative;left:16.6666666667%;right:auto}.large-pull-2{position:relative;right:16.6666666667%;left:auto}.large-push-3{position:relative;left:25%;right:auto}.large-pull-3{position:relative;right:25%;left:auto}.large-push-4{position:relative;left:33.3333333333%;right:auto}.large-pull-4{position:relative;right:33.3333333333%;left:auto}.large-push-5{position:relative;left:41.6666666667%;right:auto}.large-pull-5{position:relative;right:41.6666666667%;left:auto}.large-push-6{position:relative;left:50%;right:auto}.large-pull-6{position:relative;right:50%;left:auto}.large-push-7{position:relative;left:58.3333333333%;right:auto}.large-pull-7{position:relative;right:58.3333333333%;left:auto}.large-push-8{position:relative;left:66.6666666667%;right:auto}.large-pull-8{position:relative;right:66.6666666667%;left:auto}.large-push-9{position:relative;left:75%;right:auto}.large-pull-9{position:relative;right:75%;left:auto}.large-push-10{position:relative;left:83.3333333333%;right:auto}.large-pull-10{position:relative;right:83.3333333333%;left:auto}.large-push-11{position:relative;left:91.6666666667%;right:auto}.large-pull-11{position:relative;right:91.6666666667%;left:auto}.column,.columns{position:relative;padding-left:.9375rem;padding-right:.9375rem;float:left}.large-1{width:8.3333333333%}.large-2{width:16.6666666667%}.large-3{width:25%}.large-4{width:33.3333333333%}.large-5{width:41.6666666667%}.large-6{width:50%}.large-7{width:58.3333333333%}.large-8{width:66.6666666667%}.large-9{width:75%}.large-10{width:83.3333333333%}.large-11{width:91.6666666667%}.large-12{width:100%}.large-offset-0{margin-left:0% !important}.large-offset-1{margin-left:8.3333333333% !important}.large-offset-2{margin-left:16.6666666667% !important}.large-offset-3{margin-left:25% !important}.large-offset-4{margin-left:33.3333333333% !important}.large-offset-5{margin-left:41.6666666667% !important}.large-offset-6{margin-left:50% !important}.large-offset-7{margin-left:58.3333333333% !important}.large-offset-8{margin-left:66.6666666667% !important}.large-offset-9{margin-left:75% !important}.large-offset-10{margin-left:83.3333333333% !important}.large-offset-11{margin-left:91.6666666667% !important}.large-reset-order{margin-left:0;margin-right:0;left:auto;right:auto;float:left}.column.large-centered,.columns.large-centered{margin-left:auto;margin-right:auto;float:none}.column.large-uncentered,.columns.large-uncentered{margin-left:0;margin-right:0;float:left}.column.large-centered:last-child,.columns.large-centered:last-child{float:none}.column.large-uncentered:last-child,.columns.large-uncentered:last-child{float:left}.column.large-uncentered.opposite,.columns.large-uncentered.opposite{float:right}.row.large-collapse>.column,.row.large-collapse>.columns{padding-left:0;padding-right:0}.row.large-collapse .row{margin-left:0;margin-right:0}.row.large-uncollapse>.column,.row.large-uncollapse>.columns{padding-left:.9375rem;padding-right:.9375rem;float:left}.push-0{position:relative;left:0%;right:auto}.pull-0{position:relative;right:0%;left:auto}.push-1{position:relative;left:8.3333333333%;right:auto}.pull-1{position:relative;right:8.3333333333%;left:auto}.push-2{position:relative;left:16.6666666667%;right:auto}.pull-2{position:relative;right:16.6666666667%;left:auto}.push-3{position:relative;left:25%;right:auto}.pull-3{position:relative;right:25%;left:auto}.push-4{position:relative;left:33.3333333333%;right:auto}.pull-4{position:relative;right:33.3333333333%;left:auto}.push-5{position:relative;left:41.6666666667%;right:auto}.pull-5{position:relative;right:41.6666666667%;left:auto}.push-6{position:relative;left:50%;right:auto}.pull-6{position:relative;right:50%;left:auto}.push-7{position:relative;left:58.3333333333%;right:auto}.pull-7{position:relative;right:58.3333333333%;left:auto}.push-8{position:relative;left:66.6666666667%;right:auto}.pull-8{position:relative;right:66.6666666667%;left:auto}.push-9{position:relative;left:75%;right:auto}.pull-9{position:relative;right:75%;left:auto}.push-10{position:relative;left:83.3333333333%;right:auto}.pull-10{position:relative;right:83.3333333333%;left:auto}.push-11{position:relative;left:91.6666666667%;right:auto}.pull-11{position:relative;right:91.6666666667%;left:auto}}.inline-list{margin:0 auto 1.0625rem auto;margin-left:-1.375rem;margin-right:0;padding:0;list-style:none;overflow:hidden}.inline-list>li{list-style:none;float:left;margin-left:1.375rem;display:block}.inline-list>li>*{display:block}.panel{border-style:solid;border-width:1px;border-color:#d8d8d8;margin-bottom:1.25rem;padding:1.25rem;background:#f2f2f2;color:#333}.panel>:first-child{margin-top:0}.panel>:last-child{margin-bottom:0}.panel h1,.panel h2,.panel h3,.panel h4,.panel h5,.panel h6,.panel p,.panel li,.panel dl{color:#333}.panel h1,.panel h2,.panel h3,.panel h4,.panel h5,.panel h6{line-height:1;margin-bottom:.625rem}.panel h1.subheader,.panel h2.subheader,.panel h3.subheader,.panel h4.subheader,.panel h5.subheader,.panel h6.subheader{line-height:1.4}.panel.callout{border-style:solid;border-width:1px;border-color:#f6c4bf;margin-bottom:1.25rem;padding:1.25rem;background:#fdf0ef;color:#333}.panel.callout>:first-child{margin-top:0}.panel.callout>:last-child{margin-bottom:0}.panel.callout h1,.panel.callout h2,.panel.callout h3,.panel.callout h4,.panel.callout h5,.panel.callout h6,.panel.callout p,.panel.callout li,.panel.callout dl{color:#333}.panel.callout h1,.panel.callout h2,.panel.callout h3,.panel.callout h4,.panel.callout h5,.panel.callout h6{line-height:1;margin-bottom:.625rem}.panel.callout h1.subheader,.panel.callout h2.subheader,.panel.callout h3.subheader,.panel.callout h4.subheader,.panel.callout h5.subheader,.panel.callout h6.subheader{line-height:1.4}.panel.callout a:not(.button){color:#ba2619}.panel.callout a:not(.button):hover,.panel.callout a:not(.button):focus{color:#a02116}.panel.radius{border-radius:3px}.side-nav{display:block;margin:0;padding:.875rem 0;list-style-type:none;list-style-position:outside;font-family:"Open Sans","Helvetica Neue",Helvetica,Roboto,Arial,sans-serif}.side-nav li{margin:0 0 .4375rem 0;font-size:.875rem;font-weight:400}.side-nav li a:not(.button){display:block;color:#ba2619;margin:0;padding:.4375rem .875rem}.side-nav li a:not(.button):hover,.side-nav li a:not(.button):focus{background:rgba(0,0,0,0.025);color:#e65346}.side-nav li.active>a:first-child:not(.button){color:#e65346;font-weight:400;font-family:"Open Sans","Helvetica Neue",Helvetica,Roboto,Arial,sans-serif}.side-nav li.divider{border-top:1px solid;height:0;padding:0;list-style:none;border-top-color:#fff}.side-nav li.heading{color:#ba2619;font-size:.875rem;font-weight:bold;text-transform:uppercase}table{background:#fff;margin-bottom:1.25rem;border:solid 1px #ddd;table-layout:auto}table caption{background:transparent;color:#222;font-size:1rem;font-weight:bold}table thead{background:#f5f5f5}table thead tr th,table thead tr td{padding:.5rem .625rem .625rem;font-size:.875rem;font-weight:700;color:#222}table tfoot{background:#f5f5f5}table tfoot tr th,table tfoot tr td{padding:.5rem .625rem .625rem;font-size:.875rem;font-weight:700;color:#222}table tr th,table tr td{padding:.5625rem .625rem;font-size:.875rem;color:#222;text-align:left}table tr.even,table tr.alt,table tr:nth-of-type(even){background:#F9F9F9}table thead tr th,table tfoot tr th,table tfoot tr td,table tbody tr th,table tbody tr td,table tr td{display:table-cell;line-height:1.125rem}.th{line-height:0;display:inline-block;border:solid 4px #fff;max-width:100%;box-shadow:0 0 0 1px rgba(0,0,0,0.2);transition:all 200ms ease-out}.th:hover,.th:focus{box-shadow:0 0 6px 1px rgba(186,38,25,0.5)}.th.radius{border-radius:3px}meta.foundation-mq-topbar{font-family:"/only screen and (min-width:40.0625em)/";width:40.0625em}.contain-to-grid{width:100%;background:#333}.contain-to-grid .top-bar{margin-bottom:0}.fixed{width:100%;left:0;position:fixed;top:0;z-index:99}.fixed.expanded:not(.top-bar){overflow-y:auto;height:auto;width:100%;max-height:100%}.fixed.expanded:not(.top-bar) .title-area{position:fixed;width:100%;z-index:99}.fixed.expanded:not(.top-bar) .top-bar-section{z-index:98;margin-top:2.8125rem}.top-bar{overflow:hidden;height:2.8125rem;line-height:2.8125rem;position:relative;background:#333;margin-bottom:0}.top-bar ul{margin-bottom:0;list-style:none}.top-bar .row{max-width:none}.top-bar form,.top-bar input{margin-bottom:0}.top-bar input{height:1.75rem;padding-top:.35rem;padding-bottom:.35rem;font-size:.75rem}.top-bar .button,.top-bar button{padding-top:0.4125rem;padding-bottom:0.4125rem;margin-bottom:0;font-size:.75rem}@media only screen and (max-width: 40em){.top-bar .button,.top-bar button{position:relative;top:-1px}}.top-bar .title-area{position:relative;margin:0}.top-bar .name{height:2.8125rem;margin:0;font-size:16px}.top-bar .name h1,.top-bar .name h2,.top-bar .name h3,.top-bar .name h4,.top-bar .name p,.top-bar .name span{line-height:2.8125rem;font-size:1.0625rem;margin:0}.top-bar .name h1 a,.top-bar .name h2 a,.top-bar .name h3 a,.top-bar .name h4 a,.top-bar .name p a,.top-bar .name span a{font-weight:400;color:#fff;width:75%;display:block;padding:0 .9375rem}.top-bar .toggle-topbar{position:absolute;right:0;top:0}.top-bar .toggle-topbar a{color:#fff;text-transform:uppercase;font-size:.8125rem;font-weight:700;position:relative;display:block;padding:0 .9375rem;height:2.8125rem;line-height:2.8125rem}.top-bar .toggle-topbar.menu-icon{top:50%;margin-top:-16px}.top-bar .toggle-topbar.menu-icon a{height:34px;line-height:33px;padding:0 2.5rem 0 .9375rem;color:#fff;position:relative}.top-bar .toggle-topbar.menu-icon a span::after{content:"";position:absolute;display:block;height:0;top:50%;margin-top:-8px;right:.9375rem;box-shadow:0 0 0 1px #fff,0 7px 0 1px #fff,0 14px 0 1px #fff;width:16px}.top-bar .toggle-topbar.menu-icon a span:hover:after{box-shadow:0 0 0 1px "",0 7px 0 1px "",0 14px 0 1px ""}.top-bar.expanded{height:auto;background:transparent}.top-bar.expanded .title-area{background:#333}.top-bar.expanded .toggle-topbar a{color:#888}.top-bar.expanded .toggle-topbar a span::after{box-shadow:0 0 0 1px #888,0 7px 0 1px #888,0 14px 0 1px #888}.top-bar-section{left:0;position:relative;width:auto;transition:left 300ms ease-out}.top-bar-section ul{padding:0;width:100%;height:auto;display:block;font-size:16px;margin:0}.top-bar-section .divider,.top-bar-section [role="separator"]{border-top:solid 1px #1a1919;clear:both;height:1px;width:100%}.top-bar-section ul li{background:#333}.top-bar-section ul li>a{display:block;width:100%;color:#fff;padding:12px 0 12px 0;padding-left:.9375rem;font-family:"Open Sans","Helvetica Neue",Helvetica,Roboto,Arial,sans-serif;font-size:.8125rem;font-weight:400;text-transform:none}.top-bar-section ul li>a.button{font-size:.8125rem;padding-right:.9375rem;padding-left:.9375rem;background-color:#ba2619;border-color:#951e14;color:#fff}.top-bar-section ul li>a.button:hover,.top-bar-section ul li>a.button:focus{background-color:#951e14}.top-bar-section ul li>a.button:hover,.top-bar-section ul li>a.button:focus{color:#fff}.top-bar-section ul li>a.button.secondary{background-color:#e7e7e7;border-color:#b9b9b9;color:#333}.top-bar-section ul li>a.button.secondary:hover,.top-bar-section ul li>a.button.secondary:focus{background-color:#b9b9b9}.top-bar-section ul li>a.button.secondary:hover,.top-bar-section ul li>a.button.secondary:focus{color:#333}.top-bar-section ul li>a.button.success{background-color:#43AC6A;border-color:#368a55;color:#fff}.top-bar-section ul li>a.button.success:hover,.top-bar-section ul li>a.button.success:focus{background-color:#368a55}.top-bar-section ul li>a.button.success:hover,.top-bar-section ul li>a.button.success:focus{color:#fff}.top-bar-section ul li>a.button.alert{background-color:#f04124;border-color:#cf2a0e;color:#fff}.top-bar-section ul li>a.button.alert:hover,.top-bar-section ul li>a.button.alert:focus{background-color:#cf2a0e}.top-bar-section ul li>a.button.alert:hover,.top-bar-section ul li>a.button.alert:focus{color:#fff}.top-bar-section ul li>a.button.warning{background-color:#f08a24;border-color:#cf6e0e;color:#fff}.top-bar-section ul li>a.button.warning:hover,.top-bar-section ul li>a.button.warning:focus{background-color:#cf6e0e}.top-bar-section ul li>a.button.warning:hover,.top-bar-section ul li>a.button.warning:focus{color:#fff}.top-bar-section ul li>button{font-size:.8125rem;padding-right:.9375rem;padding-left:.9375rem;background-color:#ba2619;border-color:#951e14;color:#fff}.top-bar-section ul li>button:hover,.top-bar-section ul li>button:focus{background-color:#951e14}.top-bar-section ul li>button:hover,.top-bar-section ul li>button:focus{color:#fff}.top-bar-section ul li>button.secondary{background-color:#e7e7e7;border-color:#b9b9b9;color:#333}.top-bar-section ul li>button.secondary:hover,.top-bar-section ul li>button.secondary:focus{background-color:#b9b9b9}.top-bar-section ul li>button.secondary:hover,.top-bar-section ul li>button.secondary:focus{color:#333}.top-bar-section ul li>button.success{background-color:#43AC6A;border-color:#368a55;color:#fff}.top-bar-section ul li>button.success:hover,.top-bar-section ul li>button.success:focus{background-color:#368a55}.top-bar-section ul li>button.success:hover,.top-bar-section ul li>button.success:focus{color:#fff}.top-bar-section ul li>button.alert{background-color:#f04124;border-color:#cf2a0e;color:#fff}.top-bar-section ul li>button.alert:hover,.top-bar-section ul li>button.alert:focus{background-color:#cf2a0e}.top-bar-section ul li>button.alert:hover,.top-bar-section ul li>button.alert:focus{color:#fff}.top-bar-section ul li>button.warning{background-color:#f08a24;border-color:#cf6e0e;color:#fff}.top-bar-section ul li>button.warning:hover,.top-bar-section ul li>button.warning:focus{background-color:#cf6e0e}.top-bar-section ul li>button.warning:hover,.top-bar-section ul li>button.warning:focus{color:#fff}.top-bar-section ul li:hover:not(.has-form)>a{background-color:#555;background:#333;color:#fff}.top-bar-section ul li.active>a{background:#ba2619;color:#fff}.top-bar-section ul li.active>a:hover{background:#a02116;color:#fff}.top-bar-section .has-form{padding:.9375rem}.top-bar-section .has-dropdown{position:relative}.top-bar-section .has-dropdown>a:after{content:"";display:block;width:0;height:0;border:inset 5px;border-color:transparent transparent transparent rgba(255,255,255,0.4);border-left-style:solid;margin-right:.9375rem;margin-top:-4.5px;position:absolute;top:50%;right:0}.top-bar-section .has-dropdown.moved{position:static}.top-bar-section .has-dropdown.moved>.dropdown{display:block;position:static !important;height:auto;width:auto;overflow:visible;clip:auto;position:absolute !important;width:100%}.top-bar-section .has-dropdown.moved>a:after{display:none}.top-bar-section .dropdown{padding:0;position:absolute;left:100%;top:0;z-index:99;display:block;position:absolute !important;height:1px;width:1px;overflow:hidden;clip:rect(1px, 1px, 1px, 1px)}.top-bar-section .dropdown li{width:100%;height:auto}.top-bar-section .dropdown li a{font-weight:400;padding:8px .9375rem}.top-bar-section .dropdown li a.parent-link{font-weight:400}.top-bar-section .dropdown li.title h5,.top-bar-section .dropdown li.parent-link{margin-bottom:0;margin-top:0;font-size:1.125rem}.top-bar-section .dropdown li.title h5 a,.top-bar-section .dropdown li.parent-link a{color:#fff;display:block}.top-bar-section .dropdown li.title h5 a:hover,.top-bar-section .dropdown li.parent-link a:hover{background:none}.top-bar-section .dropdown li.has-form{padding:8px .9375rem}.top-bar-section .dropdown li .button,.top-bar-section .dropdown li button{top:auto}.top-bar-section .dropdown label{padding:8px .9375rem 2px;margin-bottom:0;text-transform:uppercase;color:#777;font-weight:700;font-size:.625rem}.js-generated{display:block}@media only screen and (min-width: 40.0625em){.top-bar{background:#333;overflow:visible}.top-bar:before,.top-bar:after{content:" ";display:table}.top-bar:after{clear:both}.top-bar .toggle-topbar{display:none}.top-bar .title-area{float:left}.top-bar .name h1 a,.top-bar .name h2 a,.top-bar .name h3 a,.top-bar .name h4 a,.top-bar .name h5 a,.top-bar .name h6 a{width:auto}.top-bar input,.top-bar .button,.top-bar button{font-size:.875rem;position:relative;height:1.75rem;top:.53125rem}.top-bar.expanded{background:#333}.contain-to-grid .top-bar{max-width:62.5rem;margin:0 auto;margin-bottom:0}.top-bar-section{transition:none 0 0;left:0 !important}.top-bar-section ul{width:auto;height:auto !important;display:inline}.top-bar-section ul li{float:left}.top-bar-section ul li .js-generated{display:none}.top-bar-section li.hover>a:not(.button){background-color:#555;background:#333;color:#fff}.top-bar-section li:not(.has-form) a:not(.button){padding:0 .9375rem;line-height:2.8125rem;background:#333}.top-bar-section li:not(.has-form) a:not(.button):hover{background-color:#555;background:#333}.top-bar-section li.active:not(.has-form) a:not(.button){padding:0 .9375rem;line-height:2.8125rem;color:#fff;background:#ba2619}.top-bar-section li.active:not(.has-form) a:not(.button):hover{background:#a02116;color:#fff}.top-bar-section .has-dropdown>a{padding-right:2.1875rem !important}.top-bar-section .has-dropdown>a:after{content:"";display:block;width:0;height:0;border:inset 5px;border-color:rgba(255,255,255,0.4) transparent transparent transparent;border-top-style:solid;margin-top:-2.5px;top:1.40625rem}.top-bar-section .has-dropdown.moved{position:relative}.top-bar-section .has-dropdown.moved>.dropdown{display:block;position:absolute !important;height:1px;width:1px;overflow:hidden;clip:rect(1px, 1px, 1px, 1px)}.top-bar-section .has-dropdown.hover>.dropdown,.top-bar-section .has-dropdown.not-click:hover>.dropdown{display:block;position:static !important;height:auto;width:auto;overflow:visible;clip:auto;position:absolute !important}.top-bar-section .has-dropdown>a:focus+.dropdown{display:block;position:static !important;height:auto;width:auto;overflow:visible;clip:auto;position:absolute !important}.top-bar-section .has-dropdown .dropdown li.has-dropdown>a:after{border:none;content:"\00bb";top:1rem;margin-top:-1px;right:5px;line-height:1.2}.top-bar-section .dropdown{left:0;top:auto;background:transparent;min-width:100%}.top-bar-section .dropdown li a{color:#fff;line-height:2.8125rem;white-space:nowrap;padding:12px .9375rem;background:#333}.top-bar-section .dropdown li:not(.has-form):not(.active)>a:not(.button){color:#fff;background:#333}.top-bar-section .dropdown li:not(.has-form):not(.active):hover>a:not(.button){color:#fff;background-color:#555;background:#333}.top-bar-section .dropdown li label{white-space:nowrap;background:#333}.top-bar-section .dropdown li .dropdown{left:100%;top:0}.top-bar-section>ul>.divider,.top-bar-section>ul>[role="separator"]{border-bottom:none;border-top:none;border-right:solid 1px #4e4e4e;clear:none;height:2.8125rem;width:0}.top-bar-section .has-form{background:#333;padding:0 .9375rem;height:2.8125rem}.top-bar-section .right li .dropdown{left:auto;right:0}.top-bar-section .right li .dropdown li .dropdown{right:100%}.top-bar-section .left li .dropdown{right:auto;left:0}.top-bar-section .left li .dropdown li .dropdown{left:100%}.no-js .top-bar-section ul li:hover>a{background-color:#555;background:#333;color:#fff}.no-js .top-bar-section ul li:active>a{background:#ba2619;color:#fff}.no-js .top-bar-section .has-dropdown:hover>.dropdown{display:block;position:static !important;height:auto;width:auto;overflow:visible;clip:auto;position:absolute !important}.no-js .top-bar-section .has-dropdown>a:focus+.dropdown{display:block;position:static !important;height:auto;width:auto;overflow:visible;clip:auto;position:absolute !important}}.text-left{text-align:left !important}.text-right{text-align:right !important}.text-center{text-align:center !important}.text-justify{text-align:justify !important}@media only screen and (max-width: 40em){.small-only-text-left{text-align:left !important}.small-only-text-right{text-align:right !important}.small-only-text-center{text-align:center !important}.small-only-text-justify{text-align:justify !important}}@media only screen{.small-text-left{text-align:left !important}.small-text-right{text-align:right !important}.small-text-center{text-align:center !important}.small-text-justify{text-align:justify !important}}@media only screen and (min-width: 40.0625em) and (max-width: 64em){.medium-only-text-left{text-align:left !important}.medium-only-text-right{text-align:right !important}.medium-only-text-center{text-align:center !important}.medium-only-text-justify{text-align:justify !important}}@media only screen and (min-width: 40.0625em){.medium-text-left{text-align:left !important}.medium-text-right{text-align:right !important}.medium-text-center{text-align:center !important}.medium-text-justify{text-align:justify !important}}@media only screen and (min-width: 64.0625em) and (max-width: 90em){.large-only-text-left{text-align:left !important}.large-only-text-right{text-align:right !important}.large-only-text-center{text-align:center !important}.large-only-text-justify{text-align:justify !important}}@media only screen and (min-width: 64.0625em){.large-text-left{text-align:left !important}.large-text-right{text-align:right !important}.large-text-center{text-align:center !important}.large-text-justify{text-align:justify !important}}@media only screen and (min-width: 90.0625em) and (max-width: 120em){.xlarge-only-text-left{text-align:left !important}.xlarge-only-text-right{text-align:right !important}.xlarge-only-text-center{text-align:center !important}.xlarge-only-text-justify{text-align:justify !important}}@media only screen and (min-width: 90.0625em){.xlarge-text-left{text-align:left !important}.xlarge-text-right{text-align:right !important}.xlarge-text-center{text-align:center !important}.xlarge-text-justify{text-align:justify !important}}@media only screen and (min-width: 120.0625em) and (max-width: 99999999em){.xxlarge-only-text-left{text-align:left !important}.xxlarge-only-text-right{text-align:right !important}.xxlarge-only-text-center{text-align:center !important}.xxlarge-only-text-justify{text-align:justify !important}}@media only screen and (min-width: 120.0625em){.xxlarge-text-left{text-align:left !important}.xxlarge-text-right{text-align:right !important}.xxlarge-text-center{text-align:center !important}.xxlarge-text-justify{text-align:justify !important}}div,dl,dt,dd,ul,ol,li,h1,h2,h3,h4,h5,h6,pre,form,p,blockquote,th,td{margin:0;padding:0}a{color:#ba2619;text-decoration:none;line-height:inherit}a:hover,a:focus{color:#a02116}a img{border:none}p{font-family:inherit;font-weight:400;font-size:1rem;line-height:1.6;margin-bottom:1.25rem;text-rendering:optimizeLegibility}p.lead{font-size:1.21875rem;line-height:1.6}p aside{font-size:.875rem;line-height:1.35;font-style:italic}h1,h2,h3,h4,h5,h6{font-family:"Open Sans","Helvetica Neue",Helvetica,Roboto,Arial,sans-serif;font-weight:700;font-style:normal;color:#222;text-rendering:optimizeLegibility;margin-top:.2rem;margin-bottom:.5rem;line-height:1.4}h1 small,h2 small,h3 small,h4 small,h5 small,h6 small{font-size:80%;color:#6f6f6f;line-height:0}h1{font-size:1.5625rem}h2{font-size:1.25rem}h3{font-size:1.0625rem}h4{font-size:.9375rem}h5{font-size:1rem}h6{font-size:1rem}.subheader{line-height:1.4;color:#6f6f6f;font-weight:400;margin-top:.2rem;margin-bottom:.5rem}hr{border:solid #ddd;border-width:1px 0 0;clear:both;margin:1.25rem 0 1.1875rem;height:0}em,i{font-style:italic;line-height:inherit}strong,b{font-weight:700;line-height:inherit}small{font-size:80%;line-height:inherit}code{font-family:Consolas,"Liberation Mono",Courier,monospace;font-weight:400;color:#333;background-color:rgba(0,0,0,0.04);border-width:1px;border-style:none;border-color:rgba(0,0,0,0.04);padding:.125rem .3125rem .0625rem}ul,ol,dl{font-size:1rem;line-height:1.6;margin-bottom:1.25rem;list-style-position:outside;font-family:inherit}ul{margin-left:1.1rem}ul.no-bullet{margin-left:0}ul.no-bullet li ul,ul.no-bullet li ol{margin-left:1.25rem;margin-bottom:0;list-style:none}ul li ul,ul li ol{margin-left:1.25rem;margin-bottom:0}ul.square li ul,ul.circle li ul,ul.disc li ul{list-style:inherit}ul.square{list-style-type:square;margin-left:1.1rem}ul.circle{list-style-type:circle;margin-left:1.1rem}ul.disc{list-style-type:disc;margin-left:1.1rem}ul.no-bullet{list-style:none}ol{margin-left:1.4rem}ol li ul,ol li ol{margin-left:1.25rem;margin-bottom:0}dl dt{margin-bottom:.3rem;font-weight:700}dl dd{margin-bottom:.75rem}abbr,acronym{text-transform:uppercase;font-size:90%;color:#222;cursor:help}abbr{text-transform:none}abbr[title]{border-bottom:1px dotted #ddd}blockquote{margin:0 0 1.25rem;padding:.5625rem 1.25rem 0 1.1875rem;border-left:1px solid #ddd}blockquote cite{display:block;font-size:.8125rem;color:#555}blockquote cite:before{content:"\2014 \0020"}blockquote cite a,blockquote cite a:visited{color:#555}blockquote,blockquote p{line-height:1.6;color:#6f6f6f}.vcard{display:inline-block;margin:0 0 1.25rem 0;border:1px solid #ddd;padding:.625rem .75rem}.vcard li{margin:0;display:block}.vcard .fn{font-weight:700;font-size:.9375rem}.vevent .summary{font-weight:700}.vevent abbr{cursor:default;text-decoration:none;font-weight:700;border:none;padding:0 .0625rem}@media only screen and (min-width: 40.0625em){h1,h2,h3,h4,h5,h6{line-height:1.4}h1{font-size:1.875rem}h2{font-size:1.5625rem}h3{font-size:1.375rem}h4{font-size:1.25rem}h5{font-size:1rem}h6{font-size:1rem}}@media only screen{.show-for-small-only,.show-for-small-up,.show-for-small,.show-for-small-down,.hide-for-medium-only,.hide-for-medium-up,.hide-for-medium,.show-for-medium-down,.hide-for-large-only,.hide-for-large-up,.hide-for-large,.show-for-large-down,.hide-for-xlarge-only,.hide-for-xlarge-up,.hide-for-xlarge,.show-for-xlarge-down,.hide-for-xxlarge-only,.hide-for-xxlarge-up,.hide-for-xxlarge,.show-for-xxlarge-down{display:inherit !important}.hide-for-small-only,.hide-for-small-up,.hide-for-small,.hide-for-small-down,.show-for-medium-only,.show-for-medium-up,.show-for-medium,.hide-for-medium-down,.show-for-large-only,.show-for-large-up,.show-for-large,.hide-for-large-down,.show-for-xlarge-only,.show-for-xlarge-up,.show-for-xlarge,.hide-for-xlarge-down,.show-for-xxlarge-only,.show-for-xxlarge-up,.show-for-xxlarge,.hide-for-xxlarge-down{display:none !important}.visible-for-small-only,.visible-for-small-up,.visible-for-small,.visible-for-small-down,.hidden-for-medium-only,.hidden-for-medium-up,.hidden-for-medium,.visible-for-medium-down,.hidden-for-large-only,.hidden-for-large-up,.hidden-for-large,.visible-for-large-down,.hidden-for-xlarge-only,.hidden-for-xlarge-up,.hidden-for-xlarge,.visible-for-xlarge-down,.hidden-for-xxlarge-only,.hidden-for-xxlarge-up,.hidden-for-xxlarge,.visible-for-xxlarge-down{position:static !important;height:auto;width:auto;overflow:visible;clip:auto}.hidden-for-small-only,.hidden-for-small-up,.hidden-for-small,.hidden-for-small-down,.visible-for-medium-only,.visible-for-medium-up,.visible-for-medium,.hidden-for-medium-down,.visible-for-large-only,.visible-for-large-up,.visible-for-large,.hidden-for-large-down,.visible-for-xlarge-only,.visible-for-xlarge-up,.visible-for-xlarge,.hidden-for-xlarge-down,.visible-for-xxlarge-only,.visible-for-xxlarge-up,.visible-for-xxlarge,.hidden-for-xxlarge-down{position:absolute !important;height:1px;width:1px;overflow:hidden;clip:rect(1px, 1px, 1px, 1px)}table.show-for-small-only,table.show-for-small-up,table.show-for-small,table.show-for-small-down,table.hide-for-medium-only,table.hide-for-medium-up,table.hide-for-medium,table.show-for-medium-down,table.hide-for-large-only,table.hide-for-large-up,table.hide-for-large,table.show-for-large-down,table.hide-for-xlarge-only,table.hide-for-xlarge-up,table.hide-for-xlarge,table.show-for-xlarge-down,table.hide-for-xxlarge-only,table.hide-for-xxlarge-up,table.hide-for-xxlarge,table.show-for-xxlarge-down{display:table !important}thead.show-for-small-only,thead.show-for-small-up,thead.show-for-small,thead.show-for-small-down,thead.hide-for-medium-only,thead.hide-for-medium-up,thead.hide-for-medium,thead.show-for-medium-down,thead.hide-for-large-only,thead.hide-for-large-up,thead.hide-for-large,thead.show-for-large-down,thead.hide-for-xlarge-only,thead.hide-for-xlarge-up,thead.hide-for-xlarge,thead.show-for-xlarge-down,thead.hide-for-xxlarge-only,thead.hide-for-xxlarge-up,thead.hide-for-xxlarge,thead.show-for-xxlarge-down{display:table-header-group !important}tbody.show-for-small-only,tbody.show-for-small-up,tbody.show-for-small,tbody.show-for-small-down,tbody.hide-for-medium-only,tbody.hide-for-medium-up,tbody.hide-for-medium,tbody.show-for-medium-down,tbody.hide-for-large-only,tbody.hide-for-large-up,tbody.hide-for-large,tbody.show-for-large-down,tbody.hide-for-xlarge-only,tbody.hide-for-xlarge-up,tbody.hide-for-xlarge,tbody.show-for-xlarge-down,tbody.hide-for-xxlarge-only,tbody.hide-for-xxlarge-up,tbody.hide-for-xxlarge,tbody.show-for-xxlarge-down{display:table-row-group !important}tr.show-for-small-only,tr.show-for-small-up,tr.show-for-small,tr.show-for-small-down,tr.hide-for-medium-only,tr.hide-for-medium-up,tr.hide-for-medium,tr.show-for-medium-down,tr.hide-for-large-only,tr.hide-for-large-up,tr.hide-for-large,tr.show-for-large-down,tr.hide-for-xlarge-only,tr.hide-for-xlarge-up,tr.hide-for-xlarge,tr.show-for-xlarge-down,tr.hide-for-xxlarge-only,tr.hide-for-xxlarge-up,tr.hide-for-xxlarge,tr.show-for-xxlarge-down{display:table-row}th.show-for-small-only,td.show-for-small-only,th.show-for-small-up,td.show-for-small-up,th.show-for-small,td.show-for-small,th.show-for-small-down,td.show-for-small-down,th.hide-for-medium-only,td.hide-for-medium-only,th.hide-for-medium-up,td.hide-for-medium-up,th.hide-for-medium,td.hide-for-medium,th.show-for-medium-down,td.show-for-medium-down,th.hide-for-large-only,td.hide-for-large-only,th.hide-for-large-up,td.hide-for-large-up,th.hide-for-large,td.hide-for-large,th.show-for-large-down,td.show-for-large-down,th.hide-for-xlarge-only,td.hide-for-xlarge-only,th.hide-for-xlarge-up,td.hide-for-xlarge-up,th.hide-for-xlarge,td.hide-for-xlarge,th.show-for-xlarge-down,td.show-for-xlarge-down,th.hide-for-xxlarge-only,td.hide-for-xxlarge-only,th.hide-for-xxlarge-up,td.hide-for-xxlarge-up,th.hide-for-xxlarge,td.hide-for-xxlarge,th.show-for-xxlarge-down,td.show-for-xxlarge-down{display:table-cell !important}}@media only screen and (min-width: 40.0625em){.hide-for-small-only,.show-for-small-up,.hide-for-small,.hide-for-small-down,.show-for-medium-only,.show-for-medium-up,.show-for-medium,.show-for-medium-down,.hide-for-large-only,.hide-for-large-up,.hide-for-large,.show-for-large-down,.hide-for-xlarge-only,.hide-for-xlarge-up,.hide-for-xlarge,.show-for-xlarge-down,.hide-for-xxlarge-only,.hide-for-xxlarge-up,.hide-for-xxlarge,.show-for-xxlarge-down{display:inherit !important}.show-for-small-only,.hide-for-small-up,.show-for-small,.show-for-small-down,.hide-for-medium-only,.hide-for-medium-up,.hide-for-medium,.hide-for-medium-down,.show-for-large-only,.show-for-large-up,.show-for-large,.hide-for-large-down,.show-for-xlarge-only,.show-for-xlarge-up,.show-for-xlarge,.hide-for-xlarge-down,.show-for-xxlarge-only,.show-for-xxlarge-up,.show-for-xxlarge,.hide-for-xxlarge-down{display:none !important}.hidden-for-small-only,.visible-for-small-up,.hidden-for-small,.hidden-for-small-down,.visible-for-medium-only,.visible-for-medium-up,.visible-for-medium,.visible-for-medium-down,.hidden-for-large-only,.hidden-for-large-up,.hidden-for-large,.visible-for-large-down,.hidden-for-xlarge-only,.hidden-for-xlarge-up,.hidden-for-xlarge,.visible-for-xlarge-down,.hidden-for-xxlarge-only,.hidden-for-xxlarge-up,.hidden-for-xxlarge,.visible-for-xxlarge-down{position:static !important;height:auto;width:auto;overflow:visible;clip:auto}.visible-for-small-only,.hidden-for-small-up,.visible-for-small,.visible-for-small-down,.hidden-for-medium-only,.hidden-for-medium-up,.hidden-for-medium,.hidden-for-medium-down,.visible-for-large-only,.visible-for-large-up,.visible-for-large,.hidden-for-large-down,.visible-for-xlarge-only,.visible-for-xlarge-up,.visible-for-xlarge,.hidden-for-xlarge-down,.visible-for-xxlarge-only,.visible-for-xxlarge-up,.visible-for-xxlarge,.hidden-for-xxlarge-down{position:absolute !important;height:1px;width:1px;overflow:hidden;clip:rect(1px, 1px, 1px, 1px)}table.hide-for-small-only,table.show-for-small-up,table.hide-for-small,table.hide-for-small-down,table.show-for-medium-only,table.show-for-medium-up,table.show-for-medium,table.show-for-medium-down,table.hide-for-large-only,table.hide-for-large-up,table.hide-for-large,table.show-for-large-down,table.hide-for-xlarge-only,table.hide-for-xlarge-up,table.hide-for-xlarge,table.show-for-xlarge-down,table.hide-for-xxlarge-only,table.hide-for-xxlarge-up,table.hide-for-xxlarge,table.show-for-xxlarge-down{display:table !important}thead.hide-for-small-only,thead.show-for-small-up,thead.hide-for-small,thead.hide-for-small-down,thead.show-for-medium-only,thead.show-for-medium-up,thead.show-for-medium,thead.show-for-medium-down,thead.hide-for-large-only,thead.hide-for-large-up,thead.hide-for-large,thead.show-for-large-down,thead.hide-for-xlarge-only,thead.hide-for-xlarge-up,thead.hide-for-xlarge,thead.show-for-xlarge-down,thead.hide-for-xxlarge-only,thead.hide-for-xxlarge-up,thead.hide-for-xxlarge,thead.show-for-xxlarge-down{display:table-header-group !important}tbody.hide-for-small-only,tbody.show-for-small-up,tbody.hide-for-small,tbody.hide-for-small-down,tbody.show-for-medium-only,tbody.show-for-medium-up,tbody.show-for-medium,tbody.show-for-medium-down,tbody.hide-for-large-only,tbody.hide-for-large-up,tbody.hide-for-large,tbody.show-for-large-down,tbody.hide-for-xlarge-only,tbody.hide-for-xlarge-up,tbody.hide-for-xlarge,tbody.show-for-xlarge-down,tbody.hide-for-xxlarge-only,tbody.hide-for-xxlarge-up,tbody.hide-for-xxlarge,tbody.show-for-xxlarge-down{display:table-row-group !important}tr.hide-for-small-only,tr.show-for-small-up,tr.hide-for-small,tr.hide-for-small-down,tr.show-for-medium-only,tr.show-for-medium-up,tr.show-for-medium,tr.show-for-medium-down,tr.hide-for-large-only,tr.hide-for-large-up,tr.hide-for-large,tr.show-for-large-down,tr.hide-for-xlarge-only,tr.hide-for-xlarge-up,tr.hide-for-xlarge,tr.show-for-xlarge-down,tr.hide-for-xxlarge-only,tr.hide-for-xxlarge-up,tr.hide-for-xxlarge,tr.show-for-xxlarge-down{display:table-row}th.hide-for-small-only,td.hide-for-small-only,th.show-for-small-up,td.show-for-small-up,th.hide-for-small,td.hide-for-small,th.hide-for-small-down,td.hide-for-small-down,th.show-for-medium-only,td.show-for-medium-only,th.show-for-medium-up,td.show-for-medium-up,th.show-for-medium,td.show-for-medium,th.show-for-medium-down,td.show-for-medium-down,th.hide-for-large-only,td.hide-for-large-only,th.hide-for-large-up,td.hide-for-large-up,th.hide-for-large,td.hide-for-large,th.show-for-large-down,td.show-for-large-down,th.hide-for-xlarge-only,td.hide-for-xlarge-only,th.hide-for-xlarge-up,td.hide-for-xlarge-up,th.hide-for-xlarge,td.hide-for-xlarge,th.show-for-xlarge-down,td.show-for-xlarge-down,th.hide-for-xxlarge-only,td.hide-for-xxlarge-only,th.hide-for-xxlarge-up,td.hide-for-xxlarge-up,th.hide-for-xxlarge,td.hide-for-xxlarge,th.show-for-xxlarge-down,td.show-for-xxlarge-down{display:table-cell !important}}@media only screen and (min-width: 64.0625em){.hide-for-small-only,.show-for-small-up,.hide-for-small,.hide-for-small-down,.hide-for-medium-only,.show-for-medium-up,.hide-for-medium,.hide-for-medium-down,.show-for-large-only,.show-for-large-up,.show-for-large,.show-for-large-down,.hide-for-xlarge-only,.hide-for-xlarge-up,.hide-for-xlarge,.show-for-xlarge-down,.hide-for-xxlarge-only,.hide-for-xxlarge-up,.hide-for-xxlarge,.show-for-xxlarge-down{display:inherit !important}.show-for-small-only,.hide-for-small-up,.show-for-small,.show-for-small-down,.show-for-medium-only,.hide-for-medium-up,.show-for-medium,.show-for-medium-down,.hide-for-large-only,.hide-for-large-up,.hide-for-large,.hide-for-large-down,.show-for-xlarge-only,.show-for-xlarge-up,.show-for-xlarge,.hide-for-xlarge-down,.show-for-xxlarge-only,.show-for-xxlarge-up,.show-for-xxlarge,.hide-for-xxlarge-down{display:none !important}.hidden-for-small-only,.visible-for-small-up,.hidden-for-small,.hidden-for-small-down,.hidden-for-medium-only,.visible-for-medium-up,.hidden-for-medium,.hidden-for-medium-down,.visible-for-large-only,.visible-for-large-up,.visible-for-large,.visible-for-large-down,.hidden-for-xlarge-only,.hidden-for-xlarge-up,.hidden-for-xlarge,.visible-for-xlarge-down,.hidden-for-xxlarge-only,.hidden-for-xxlarge-up,.hidden-for-xxlarge,.visible-for-xxlarge-down{position:static !important;height:auto;width:auto;overflow:visible;clip:auto}.visible-for-small-only,.hidden-for-small-up,.visible-for-small,.visible-for-small-down,.visible-for-medium-only,.hidden-for-medium-up,.visible-for-medium,.visible-for-medium-down,.hidden-for-large-only,.hidden-for-large-up,.hidden-for-large,.hidden-for-large-down,.visible-for-xlarge-only,.visible-for-xlarge-up,.visible-for-xlarge,.hidden-for-xlarge-down,.visible-for-xxlarge-only,.visible-for-xxlarge-up,.visible-for-xxlarge,.hidden-for-xxlarge-down{position:absolute !important;height:1px;width:1px;overflow:hidden;clip:rect(1px, 1px, 1px, 1px)}table.hide-for-small-only,table.show-for-small-up,table.hide-for-small,table.hide-for-small-down,table.hide-for-medium-only,table.show-for-medium-up,table.hide-for-medium,table.hide-for-medium-down,table.show-for-large-only,table.show-for-large-up,table.show-for-large,table.show-for-large-down,table.hide-for-xlarge-only,table.hide-for-xlarge-up,table.hide-for-xlarge,table.show-for-xlarge-down,table.hide-for-xxlarge-only,table.hide-for-xxlarge-up,table.hide-for-xxlarge,table.show-for-xxlarge-down{display:table !important}thead.hide-for-small-only,thead.show-for-small-up,thead.hide-for-small,thead.hide-for-small-down,thead.hide-for-medium-only,thead.show-for-medium-up,thead.hide-for-medium,thead.hide-for-medium-down,thead.show-for-large-only,thead.show-for-large-up,thead.show-for-large,thead.show-for-large-down,thead.hide-for-xlarge-only,thead.hide-for-xlarge-up,thead.hide-for-xlarge,thead.show-for-xlarge-down,thead.hide-for-xxlarge-only,thead.hide-for-xxlarge-up,thead.hide-for-xxlarge,thead.show-for-xxlarge-down{display:table-header-group !important}tbody.hide-for-small-only,tbody.show-for-small-up,tbody.hide-for-small,tbody.hide-for-small-down,tbody.hide-for-medium-only,tbody.show-for-medium-up,tbody.hide-for-medium,tbody.hide-for-medium-down,tbody.show-for-large-only,tbody.show-for-large-up,tbody.show-for-large,tbody.show-for-large-down,tbody.hide-for-xlarge-only,tbody.hide-for-xlarge-up,tbody.hide-for-xlarge,tbody.show-for-xlarge-down,tbody.hide-for-xxlarge-only,tbody.hide-for-xxlarge-up,tbody.hide-for-xxlarge,tbody.show-for-xxlarge-down{display:table-row-group !important}tr.hide-for-small-only,tr.show-for-small-up,tr.hide-for-small,tr.hide-for-small-down,tr.hide-for-medium-only,tr.show-for-medium-up,tr.hide-for-medium,tr.hide-for-medium-down,tr.show-for-large-only,tr.show-for-large-up,tr.show-for-large,tr.show-for-large-down,tr.hide-for-xlarge-only,tr.hide-for-xlarge-up,tr.hide-for-xlarge,tr.show-for-xlarge-down,tr.hide-for-xxlarge-only,tr.hide-for-xxlarge-up,tr.hide-for-xxlarge,tr.show-for-xxlarge-down{display:table-row}th.hide-for-small-only,td.hide-for-small-only,th.show-for-small-up,td.show-for-small-up,th.hide-for-small,td.hide-for-small,th.hide-for-small-down,td.hide-for-small-down,th.hide-for-medium-only,td.hide-for-medium-only,th.show-for-medium-up,td.show-for-medium-up,th.hide-for-medium,td.hide-for-medium,th.hide-for-medium-down,td.hide-for-medium-down,th.show-for-large-only,td.show-for-large-only,th.show-for-large-up,td.show-for-large-up,th.show-for-large,td.show-for-large,th.show-for-large-down,td.show-for-large-down,th.hide-for-xlarge-only,td.hide-for-xlarge-only,th.hide-for-xlarge-up,td.hide-for-xlarge-up,th.hide-for-xlarge,td.hide-for-xlarge,th.show-for-xlarge-down,td.show-for-xlarge-down,th.hide-for-xxlarge-only,td.hide-for-xxlarge-only,th.hide-for-xxlarge-up,td.hide-for-xxlarge-up,th.hide-for-xxlarge,td.hide-for-xxlarge,th.show-for-xxlarge-down,td.show-for-xxlarge-down{display:table-cell !important}}@media only screen and (min-width: 90.0625em){.hide-for-small-only,.show-for-small-up,.hide-for-small,.hide-for-small-down,.hide-for-medium-only,.show-for-medium-up,.hide-for-medium,.hide-for-medium-down,.hide-for-large-only,.show-for-large-up,.hide-for-large,.hide-for-large-down,.show-for-xlarge-only,.show-for-xlarge-up,.show-for-xlarge,.show-for-xlarge-down,.hide-for-xxlarge-only,.hide-for-xxlarge-up,.hide-for-xxlarge,.show-for-xxlarge-down{display:inherit !important}.show-for-small-only,.hide-for-small-up,.show-for-small,.show-for-small-down,.show-for-medium-only,.hide-for-medium-up,.show-for-medium,.show-for-medium-down,.show-for-large-only,.hide-for-large-up,.show-for-large,.show-for-large-down,.hide-for-xlarge-only,.hide-for-xlarge-up,.hide-for-xlarge,.hide-for-xlarge-down,.show-for-xxlarge-only,.show-for-xxlarge-up,.show-for-xxlarge,.hide-for-xxlarge-down{display:none !important}.hidden-for-small-only,.visible-for-small-up,.hidden-for-small,.hidden-for-small-down,.hidden-for-medium-only,.visible-for-medium-up,.hidden-for-medium,.hidden-for-medium-down,.hidden-for-large-only,.visible-for-large-up,.hidden-for-large,.hidden-for-large-down,.visible-for-xlarge-only,.visible-for-xlarge-up,.visible-for-xlarge,.visible-for-xlarge-down,.hidden-for-xxlarge-only,.hidden-for-xxlarge-up,.hidden-for-xxlarge,.visible-for-xxlarge-down{position:static !important;height:auto;width:auto;overflow:visible;clip:auto}.visible-for-small-only,.hidden-for-small-up,.visible-for-small,.visible-for-small-down,.visible-for-medium-only,.hidden-for-medium-up,.visible-for-medium,.visible-for-medium-down,.visible-for-large-only,.hidden-for-large-up,.visible-for-large,.visible-for-large-down,.hidden-for-xlarge-only,.hidden-for-xlarge-up,.hidden-for-xlarge,.hidden-for-xlarge-down,.visible-for-xxlarge-only,.visible-for-xxlarge-up,.visible-for-xxlarge,.hidden-for-xxlarge-down{position:absolute !important;height:1px;width:1px;overflow:hidden;clip:rect(1px, 1px, 1px, 1px)}table.hide-for-small-only,table.show-for-small-up,table.hide-for-small,table.hide-for-small-down,table.hide-for-medium-only,table.show-for-medium-up,table.hide-for-medium,table.hide-for-medium-down,table.hide-for-large-only,table.show-for-large-up,table.hide-for-large,table.hide-for-large-down,table.show-for-xlarge-only,table.show-for-xlarge-up,table.show-for-xlarge,table.show-for-xlarge-down,table.hide-for-xxlarge-only,table.hide-for-xxlarge-up,table.hide-for-xxlarge,table.show-for-xxlarge-down{display:table !important}thead.hide-for-small-only,thead.show-for-small-up,thead.hide-for-small,thead.hide-for-small-down,thead.hide-for-medium-only,thead.show-for-medium-up,thead.hide-for-medium,thead.hide-for-medium-down,thead.hide-for-large-only,thead.show-for-large-up,thead.hide-for-large,thead.hide-for-large-down,thead.show-for-xlarge-only,thead.show-for-xlarge-up,thead.show-for-xlarge,thead.show-for-xlarge-down,thead.hide-for-xxlarge-only,thead.hide-for-xxlarge-up,thead.hide-for-xxlarge,thead.show-for-xxlarge-down{display:table-header-group !important}tbody.hide-for-small-only,tbody.show-for-small-up,tbody.hide-for-small,tbody.hide-for-small-down,tbody.hide-for-medium-only,tbody.show-for-medium-up,tbody.hide-for-medium,tbody.hide-for-medium-down,tbody.hide-for-large-only,tbody.show-for-large-up,tbody.hide-for-large,tbody.hide-for-large-down,tbody.show-for-xlarge-only,tbody.show-for-xlarge-up,tbody.show-for-xlarge,tbody.show-for-xlarge-down,tbody.hide-for-xxlarge-only,tbody.hide-for-xxlarge-up,tbody.hide-for-xxlarge,tbody.show-for-xxlarge-down{display:table-row-group !important}tr.hide-for-small-only,tr.show-for-small-up,tr.hide-for-small,tr.hide-for-small-down,tr.hide-for-medium-only,tr.show-for-medium-up,tr.hide-for-medium,tr.hide-for-medium-down,tr.hide-for-large-only,tr.show-for-large-up,tr.hide-for-large,tr.hide-for-large-down,tr.show-for-xlarge-only,tr.show-for-xlarge-up,tr.show-for-xlarge,tr.show-for-xlarge-down,tr.hide-for-xxlarge-only,tr.hide-for-xxlarge-up,tr.hide-for-xxlarge,tr.show-for-xxlarge-down{display:table-row}th.hide-for-small-only,td.hide-for-small-only,th.show-for-small-up,td.show-for-small-up,th.hide-for-small,td.hide-for-small,th.hide-for-small-down,td.hide-for-small-down,th.hide-for-medium-only,td.hide-for-medium-only,th.show-for-medium-up,td.show-for-medium-up,th.hide-for-medium,td.hide-for-medium,th.hide-for-medium-down,td.hide-for-medium-down,th.hide-for-large-only,td.hide-for-large-only,th.show-for-large-up,td.show-for-large-up,th.hide-for-large,td.hide-for-large,th.hide-for-large-down,td.hide-for-large-down,th.show-for-xlarge-only,td.show-for-xlarge-only,th.show-for-xlarge-up,td.show-for-xlarge-up,th.show-for-xlarge,td.show-for-xlarge,th.show-for-xlarge-down,td.show-for-xlarge-down,th.hide-for-xxlarge-only,td.hide-for-xxlarge-only,th.hide-for-xxlarge-up,td.hide-for-xxlarge-up,th.hide-for-xxlarge,td.hide-for-xxlarge,th.show-for-xxlarge-down,td.show-for-xxlarge-down{display:table-cell !important}}@media only screen and (min-width: 120.0625em){.hide-for-small-only,.show-for-small-up,.hide-for-small,.hide-for-small-down,.hide-for-medium-only,.show-for-medium-up,.hide-for-medium,.hide-for-medium-down,.hide-for-large-only,.show-for-large-up,.hide-for-large,.hide-for-large-down,.hide-for-xlarge-only,.show-for-xlarge-up,.hide-for-xlarge,.hide-for-xlarge-down,.show-for-xxlarge-only,.show-for-xxlarge-up,.show-for-xxlarge,.show-for-xxlarge-down{display:inherit !important}.show-for-small-only,.hide-for-small-up,.show-for-small,.show-for-small-down,.show-for-medium-only,.hide-for-medium-up,.show-for-medium,.show-for-medium-down,.show-for-large-only,.hide-for-large-up,.show-for-large,.show-for-large-down,.show-for-xlarge-only,.hide-for-xlarge-up,.show-for-xlarge,.show-for-xlarge-down,.hide-for-xxlarge-only,.hide-for-xxlarge-up,.hide-for-xxlarge,.hide-for-xxlarge-down{display:none !important}.hidden-for-small-only,.visible-for-small-up,.hidden-for-small,.hidden-for-small-down,.hidden-for-medium-only,.visible-for-medium-up,.hidden-for-medium,.hidden-for-medium-down,.hidden-for-large-only,.visible-for-large-up,.hidden-for-large,.hidden-for-large-down,.hidden-for-xlarge-only,.visible-for-xlarge-up,.hidden-for-xlarge,.hidden-for-xlarge-down,.visible-for-xxlarge-only,.visible-for-xxlarge-up,.visible-for-xxlarge,.visible-for-xxlarge-down{position:static !important;height:auto;width:auto;overflow:visible;clip:auto}.visible-for-small-only,.hidden-for-small-up,.visible-for-small,.visible-for-small-down,.visible-for-medium-only,.hidden-for-medium-up,.visible-for-medium,.visible-for-medium-down,.visible-for-large-only,.hidden-for-large-up,.visible-for-large,.visible-for-large-down,.visible-for-xlarge-only,.hidden-for-xlarge-up,.visible-for-xlarge,.visible-for-xlarge-down,.hidden-for-xxlarge-only,.hidden-for-xxlarge-up,.hidden-for-xxlarge,.hidden-for-xxlarge-down{position:absolute !important;height:1px;width:1px;overflow:hidden;clip:rect(1px, 1px, 1px, 1px)}table.hide-for-small-only,table.show-for-small-up,table.hide-for-small,table.hide-for-small-down,table.hide-for-medium-only,table.show-for-medium-up,table.hide-for-medium,table.hide-for-medium-down,table.hide-for-large-only,table.show-for-large-up,table.hide-for-large,table.hide-for-large-down,table.hide-for-xlarge-only,table.show-for-xlarge-up,table.hide-for-xlarge,table.hide-for-xlarge-down,table.show-for-xxlarge-only,table.show-for-xxlarge-up,table.show-for-xxlarge,table.show-for-xxlarge-down{display:table !important}thead.hide-for-small-only,thead.show-for-small-up,thead.hide-for-small,thead.hide-for-small-down,thead.hide-for-medium-only,thead.show-for-medium-up,thead.hide-for-medium,thead.hide-for-medium-down,thead.hide-for-large-only,thead.show-for-large-up,thead.hide-for-large,thead.hide-for-large-down,thead.hide-for-xlarge-only,thead.show-for-xlarge-up,thead.hide-for-xlarge,thead.hide-for-xlarge-down,thead.show-for-xxlarge-only,thead.show-for-xxlarge-up,thead.show-for-xxlarge,thead.show-for-xxlarge-down{display:table-header-group !important}tbody.hide-for-small-only,tbody.show-for-small-up,tbody.hide-for-small,tbody.hide-for-small-down,tbody.hide-for-medium-only,tbody.show-for-medium-up,tbody.hide-for-medium,tbody.hide-for-medium-down,tbody.hide-for-large-only,tbody.show-for-large-up,tbody.hide-for-large,tbody.hide-for-large-down,tbody.hide-for-xlarge-only,tbody.show-for-xlarge-up,tbody.hide-for-xlarge,tbody.hide-for-xlarge-down,tbody.show-for-xxlarge-only,tbody.show-for-xxlarge-up,tbody.show-for-xxlarge,tbody.show-for-xxlarge-down{display:table-row-group !important}tr.hide-for-small-only,tr.show-for-small-up,tr.hide-for-small,tr.hide-for-small-down,tr.hide-for-medium-only,tr.show-for-medium-up,tr.hide-for-medium,tr.hide-for-medium-down,tr.hide-for-large-only,tr.show-for-large-up,tr.hide-for-large,tr.hide-for-large-down,tr.hide-for-xlarge-only,tr.show-for-xlarge-up,tr.hide-for-xlarge,tr.hide-for-xlarge-down,tr.show-for-xxlarge-only,tr.show-for-xxlarge-up,tr.show-for-xxlarge,tr.show-for-xxlarge-down{display:table-row}th.hide-for-small-only,td.hide-for-small-only,th.show-for-small-up,td.show-for-small-up,th.hide-for-small,td.hide-for-small,th.hide-for-small-down,td.hide-for-small-down,th.hide-for-medium-only,td.hide-for-medium-only,th.show-for-medium-up,td.show-for-medium-up,th.hide-for-medium,td.hide-for-medium,th.hide-for-medium-down,td.hide-for-medium-down,th.hide-for-large-only,td.hide-for-large-only,th.show-for-large-up,td.show-for-large-up,th.hide-for-large,td.hide-for-large,th.hide-for-large-down,td.hide-for-large-down,th.hide-for-xlarge-only,td.hide-for-xlarge-only,th.show-for-xlarge-up,td.show-for-xlarge-up,th.hide-for-xlarge,td.hide-for-xlarge,th.hide-for-xlarge-down,td.hide-for-xlarge-down,th.show-for-xxlarge-only,td.show-for-xxlarge-only,th.show-for-xxlarge-up,td.show-for-xxlarge-up,th.show-for-xxlarge,td.show-for-xxlarge,th.show-for-xxlarge-down,td.show-for-xxlarge-down{display:table-cell !important}}.show-for-landscape,.hide-for-portrait{display:inherit !important}.hide-for-landscape,.show-for-portrait{display:none !important}table.hide-for-landscape,table.show-for-portrait{display:table !important}thead.hide-for-landscape,thead.show-for-portrait{display:table-header-group !important}tbody.hide-for-landscape,tbody.show-for-portrait{display:table-row-group !important}tr.hide-for-landscape,tr.show-for-portrait{display:table-row !important}td.hide-for-landscape,td.show-for-portrait,th.hide-for-landscape,th.show-for-portrait{display:table-cell !important}@media only screen and (orientation: landscape){.show-for-landscape,.hide-for-portrait{display:inherit !important}.hide-for-landscape,.show-for-portrait{display:none !important}table.show-for-landscape,table.hide-for-portrait{display:table !important}thead.show-for-landscape,thead.hide-for-portrait{display:table-header-group !important}tbody.show-for-landscape,tbody.hide-for-portrait{display:table-row-group !important}tr.show-for-landscape,tr.hide-for-portrait{display:table-row !important}td.show-for-landscape,td.hide-for-portrait,th.show-for-landscape,th.hide-for-portrait{display:table-cell !important}}@media only screen and (orientation: portrait){.show-for-portrait,.hide-for-landscape{display:inherit !important}.hide-for-portrait,.show-for-landscape{display:none !important}table.show-for-portrait,table.hide-for-landscape{display:table !important}thead.show-for-portrait,thead.hide-for-landscape{display:table-header-group !important}tbody.show-for-portrait,tbody.hide-for-landscape{display:table-row-group !important}tr.show-for-portrait,tr.hide-for-landscape{display:table-row !important}td.show-for-portrait,td.hide-for-landscape,th.show-for-portrait,th.hide-for-landscape{display:table-cell !important}}.show-for-touch{display:none !important}.hide-for-touch{display:inherit !important}.touch .show-for-touch{display:inherit !important}.touch .hide-for-touch{display:none !important}table.hide-for-touch{display:table !important}.touch table.show-for-touch{display:table !important}thead.hide-for-touch{display:table-header-group !important}.touch thead.show-for-touch{display:table-header-group !important}tbody.hide-for-touch{display:table-row-group !important}.touch tbody.show-for-touch{display:table-row-group !important}tr.hide-for-touch{display:table-row !important}.touch tr.show-for-touch{display:table-row !important}td.hide-for-touch{display:table-cell !important}.touch td.show-for-touch{display:table-cell !important}th.hide-for-touch{display:table-cell !important}.touch th.show-for-touch{display:table-cell !important}.print-only{display:none !important}@media print{*{background:transparent !important;color:#000 !important;box-shadow:none !important;text-shadow:none !important}.show-for-print{display:block}.hide-for-print{display:none}table.show-for-print{display:table !important}thead.show-for-print{display:table-header-group !important}tbody.show-for-print{display:table-row-group !important}tr.show-for-print{display:table-row !important}td.show-for-print{display:table-cell !important}th.show-for-print{display:table-cell !important}a,a:visited{text-decoration:underline}a[href]:after{content:" (" attr(href) ")"}abbr[title]:after{content:" (" attr(title) ")"}.ir a:after,a[href^="javascript:"]:after,a[href^="#"]:after{content:""}pre,blockquote{border:1px solid #999;page-break-inside:avoid}thead{display:table-header-group}tr,img{page-break-inside:avoid}img{max-width:100% !important}@page{margin:0.5cm}p,h2,h3{orphans:3;widows:3}h2,h3{page-break-after:avoid}.hide-on-print{display:none !important}.print-only{display:block !important}.hide-for-print{display:none !important}.show-for-print{display:inherit !important}}@media print{.show-for-print{display:block}.hide-for-print{display:none}table.show-for-print{display:table !important}thead.show-for-print{display:table-header-group !important}tbody.show-for-print{display:table-row-group !important}tr.show-for-print{display:table-row !important}td.show-for-print{display:table-cell !important}th.show-for-print{display:table-cell !important}}.slick-slider{position:relative;display:block;box-sizing:border-box;-moz-box-sizing:border-box;-webkit-touch-callout:none;-webkit-user-select:none;-khtml-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;-ms-touch-action:pan-y;touch-action:pan-y;-webkit-tap-highlight-color:transparent}.slick-list{position:relative;overflow:hidden;display:block;margin:0;padding:0}.slick-list:focus{outline:none}.slick-list.dragging{cursor:pointer;cursor:hand}.slick-slider .slick-track,.slick-slider .slick-list{-webkit-transform:translate3d(0, 0, 0);-moz-transform:translate3d(0, 0, 0);-ms-transform:translate3d(0, 0, 0);-o-transform:translate3d(0, 0, 0);transform:translate3d(0, 0, 0)}.slick-track{position:relative;left:0;top:0;display:block}.slick-track:before,.slick-track:after{content:"";display:table}.slick-track:after{clear:both}.slick-loading .slick-track{visibility:hidden}.slick-slide{float:left;height:100%;min-height:1px;display:none}[dir="rtl"] .slick-slide{float:right}.slick-slide img{display:block}.slick-slide.slick-loading img{display:none}.slick-slide.dragging img{pointer-events:none}.slick-initialized .slick-slide{display:block}.slick-loading .slick-slide{visibility:hidden}.slick-vertical .slick-slide{display:block;height:auto;border:1px solid transparent}.slick-loading .slick-list{background:#fff url("../img/ajax-loader.gif") center center no-repeat}.slick-prev,.slick-next{position:absolute;display:block;height:20px;width:20px;line-height:0;font-size:0;cursor:pointer;background:transparent;color:transparent;top:50%;margin-top:-10px;padding:0;border:none;outline:none}.slick-prev:hover,.slick-prev:focus,.slick-next:hover,.slick-next:focus{outline:none;background:transparent;color:transparent}.slick-prev:hover:before,.slick-prev:focus:before,.slick-next:hover:before,.slick-next:focus:before{opacity:1}.slick-prev.slick-disabled:before,.slick-next.slick-disabled:before{opacity:.25}.slick-prev:before,.slick-next:before{font-family:"FontAwesome";font-size:20px;line-height:1;color:#ba2619;opacity:.75;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}.slick-prev{left:15px}[dir="rtl"] .slick-prev{left:auto;right:15px}.slick-prev:before{content:""}[dir="rtl"] .slick-prev:before{content:""}.slick-next{right:15px}[dir="rtl"] .slick-next{left:15px;right:auto}.slick-next:before{content:""}[dir="rtl"] .slick-next:before{content:""}.slick-slider{margin-bottom:30px}.slick-dots{margin:0;position:absolute;bottom:30px;list-style:none;display:block;text-align:center;padding:0;width:100%}.slick-dots li{position:relative;display:inline-block;height:20px;width:20px;margin:0 5px;padding:0;cursor:pointer}.slick-dots li button{border:0;background:transparent;display:block;height:20px;width:20px;outline:none;line-height:0;font-size:0;color:transparent;padding:5px;cursor:pointer}.slick-dots li button:hover,.slick-dots li button:focus{outline:none}.slick-dots li button:hover:before,.slick-dots li button:focus:before{opacity:1}.slick-dots li button:before{position:absolute;top:0;left:0;content:"";width:20px;height:20px;font-family:"FontAwesome";font-size:12px;line-height:20px;text-align:center;color:#000;opacity:.25;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}.slick-dots li.slick-active button:before{color:#ba2619;opacity:.75}/*! * Font Awesome 4.4.0 by @davegandy - http://fontawesome.io - @fontawesome * License - http://fontawesome.io/license (Font: SIL OFL 1.1, CSS: MIT License) */@font-face{font-family:'FontAwesome';src:url("./fonts/fontawesome-webfont.eot?v=4.4.0");src:url("./fonts/fontawesome-webfont.eot?#iefix&v=4.4.0") format("embedded-opentype"),url("./fonts/fontawesome-webfont.woff2?v=4.4.0") format("woff2"),url("./fonts/fontawesome-webfont.woff?v=4.4.0") format("woff"),url("./fonts/fontawesome-webfont.ttf?v=4.4.0") format("truetype"),url("./fonts/fontawesome-webfont.svg?v=4.4.0#fontawesomeregular") format("svg");font-weight:normal;font-style:normal}.fa{display:inline-block;font:normal normal normal 14px/1 FontAwesome;font-size:inherit;text-rendering:auto;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}.fa-lg{font-size:1.3333333333em;line-height:.75em;vertical-align:-15%}.fa-2x{font-size:2em}.fa-3x{font-size:3em}.fa-4x{font-size:4em}.fa-5x{font-size:5em}.fa-fw{width:1.2857142857em;text-align:center}.fa-ul{padding-left:0;margin-left:2.1428571429em;list-style-type:none}.fa-ul>li{position:relative}.fa-li{position:absolute;left:-2.1428571429em;width:2.1428571429em;top:.1428571429em;text-align:center}.fa-li.fa-lg{left:-1.8571428571em}.fa-border{padding:.2em .25em .15em;border:solid 0.08em #eee;border-radius:.1em}.fa-pull-left{float:left}.fa-pull-right{float:right}.fa.fa-pull-left{margin-right:.3em}.fa.fa-pull-right{margin-left:.3em}.pull-right{float:right}.pull-left{float:left}.fa.pull-left{margin-right:.3em}.fa.pull-right{margin-left:.3em}.fa-spin{-webkit-animation:fa-spin 2s infinite linear;animation:fa-spin 2s infinite linear}.fa-pulse{-webkit-animation:fa-spin 1s infinite steps(8);animation:fa-spin 1s infinite steps(8)}@-webkit-keyframes fa-spin{0%{-webkit-transform:rotate(0deg);transform:rotate(0deg)}100%{-webkit-transform:rotate(359deg);transform:rotate(359deg)}}@keyframes fa-spin{0%{-webkit-transform:rotate(0deg);transform:rotate(0deg)}100%{-webkit-transform:rotate(359deg);transform:rotate(359deg)}}.fa-rotate-90{filter:progid:DXImageTransform.Microsoft.BasicImage(rotation=1);-webkit-transform:rotate(90deg);-ms-transform:rotate(90deg);transform:rotate(90deg)}.fa-rotate-180{filter:progid:DXImageTransform.Microsoft.BasicImage(rotation=2);-webkit-transform:rotate(180deg);-ms-transform:rotate(180deg);transform:rotate(180deg)}.fa-rotate-270{filter:progid:DXImageTransform.Microsoft.BasicImage(rotation=3);-webkit-transform:rotate(270deg);-ms-transform:rotate(270deg);transform:rotate(270deg)}.fa-flip-horizontal{filter:progid:DXImageTransform.Microsoft.BasicImage(rotation=0);-webkit-transform:scale(-1, 1);-ms-transform:scale(-1, 1);transform:scale(-1, 1)}.fa-flip-vertical{filter:progid:DXImageTransform.Microsoft.BasicImage(rotation=2);-webkit-transform:scale(1, -1);-ms-transform:scale(1, -1);transform:scale(1, -1)}:root .fa-rotate-90,:root .fa-rotate-180,:root .fa-rotate-270,:root .fa-flip-horizontal,:root .fa-flip-vertical{filter:none}.fa-stack{position:relative;display:inline-block;width:2em;height:2em;line-height:2em;vertical-align:middle}.fa-stack-1x,.fa-stack-2x{position:absolute;left:0;width:100%;text-align:center}.fa-stack-1x{line-height:inherit}.fa-stack-2x{font-size:2em}.fa-inverse{color:#fff}.fa-glass:before{content:""}.fa-music:before{content:""}.fa-search:before{content:""}.fa-envelope-o:before{content:""}.fa-heart:before{content:""}.fa-star:before{content:""}.fa-star-o:before{content:""}.fa-user:before{content:""}.fa-film:before{content:""}.fa-th-large:before{content:""}.fa-th:before{content:""}.fa-th-list:before{content:""}.fa-check:before{content:""}.fa-remove:before,.fa-close:before,.fa-times:before{content:""}.fa-search-plus:before{content:""}.fa-search-minus:before{content:""}.fa-power-off:before{content:""}.fa-signal:before{content:""}.fa-gear:before,.fa-cog:before{content:""}.fa-trash-o:before{content:""}.fa-home:before{content:""}.fa-file-o:before{content:""}.fa-clock-o:before{content:""}.fa-road:before{content:""}.fa-download:before{content:""}.fa-arrow-circle-o-down:before{content:""}.fa-arrow-circle-o-up:before{content:""}.fa-inbox:before{content:""}.fa-play-circle-o:before{content:""}.fa-rotate-right:before,.fa-repeat:before{content:""}.fa-refresh:before{content:""}.fa-list-alt:before{content:""}.fa-lock:before{content:""}.fa-flag:before{content:""}.fa-headphones:before{content:""}.fa-volume-off:before{content:""}.fa-volume-down:before{content:""}.fa-volume-up:before{content:""}.fa-qrcode:before{content:""}.fa-barcode:before{content:""}.fa-tag:before{content:""}.fa-tags:before{content:""}.fa-book:before{content:""}.fa-bookmark:before{content:""}.fa-print:before{content:""}.fa-camera:before{content:""}.fa-font:before{content:""}.fa-bold:before{content:""}.fa-italic:before{content:""}.fa-text-height:before{content:""}.fa-text-width:before{content:""}.fa-align-left:before{content:""}.fa-align-center:before{content:""}.fa-align-right:before{content:""}.fa-align-justify:before{content:""}.fa-list:before{content:""}.fa-dedent:before,.fa-outdent:before{content:""}.fa-indent:before{content:""}.fa-video-camera:before{content:""}.fa-photo:before,.fa-image:before,.fa-picture-o:before{content:""}.fa-pencil:before{content:""}.fa-map-marker:before{content:""}.fa-adjust:before{content:""}.fa-tint:before{content:""}.fa-edit:before,.fa-pencil-square-o:before{content:""}.fa-share-square-o:before{content:""}.fa-check-square-o:before{content:""}.fa-arrows:before{content:""}.fa-step-backward:before{content:""}.fa-fast-backward:before{content:""}.fa-backward:before{content:""}.fa-play:before{content:""}.fa-pause:before{content:""}.fa-stop:before{content:""}.fa-forward:before{content:""}.fa-fast-forward:before{content:""}.fa-step-forward:before{content:""}.fa-eject:before{content:""}.fa-chevron-left:before{content:""}.fa-chevron-right:before{content:""}.fa-plus-circle:before{content:""}.fa-minus-circle:before{content:""}.fa-times-circle:before{content:""}.fa-check-circle:before{content:""}.fa-question-circle:before{content:""}.fa-info-circle:before{content:""}.fa-crosshairs:before{content:""}.fa-times-circle-o:before{content:""}.fa-check-circle-o:before{content:""}.fa-ban:before{content:""}.fa-arrow-left:before{content:""}.fa-arrow-right:before{content:""}.fa-arrow-up:before{content:""}.fa-arrow-down:before{content:""}.fa-mail-forward:before,.fa-share:before{content:""}.fa-expand:before{content:""}.fa-compress:before{content:""}.fa-plus:before{content:""}.fa-minus:before{content:""}.fa-asterisk:before{content:""}.fa-exclamation-circle:before{content:""}.fa-gift:before{content:""}.fa-leaf:before{content:""}.fa-fire:before{content:""}.fa-eye:before{content:""}.fa-eye-slash:before{content:""}.fa-warning:before,.fa-exclamation-triangle:before{content:""}.fa-plane:before{content:""}.fa-calendar:before{content:""}.fa-random:before{content:""}.fa-comment:before{content:""}.fa-magnet:before{content:""}.fa-chevron-up:before{content:""}.fa-chevron-down:before{content:""}.fa-retweet:before{content:""}.fa-shopping-cart:before{content:""}.fa-folder:before{content:""}.fa-folder-open:before{content:""}.fa-arrows-v:before{content:""}.fa-arrows-h:before{content:""}.fa-bar-chart-o:before,.fa-bar-chart:before{content:""}.fa-twitter-square:before{content:""}.fa-facebook-square:before{content:""}.fa-camera-retro:before{content:""}.fa-key:before{content:""}.fa-gears:before,.fa-cogs:before{content:""}.fa-comments:before{content:""}.fa-thumbs-o-up:before{content:""}.fa-thumbs-o-down:before{content:""}.fa-star-half:before{content:""}.fa-heart-o:before{content:""}.fa-sign-out:before{content:""}.fa-linkedin-square:before{content:""}.fa-thumb-tack:before{content:""}.fa-external-link:before{content:""}.fa-sign-in:before{content:""}.fa-trophy:before{content:""}.fa-github-square:before{content:""}.fa-upload:before{content:""}.fa-lemon-o:before{content:""}.fa-phone:before{content:""}.fa-square-o:before{content:""}.fa-bookmark-o:before{content:""}.fa-phone-square:before{content:""}.fa-twitter:before{content:""}.fa-facebook-f:before,.fa-facebook:before{content:""}.fa-github:before{content:""}.fa-unlock:before{content:""}.fa-credit-card:before{content:""}.fa-feed:before,.fa-rss:before{content:""}.fa-hdd-o:before{content:""}.fa-bullhorn:before{content:""}.fa-bell:before{content:""}.fa-certificate:before{content:""}.fa-hand-o-right:before{content:""}.fa-hand-o-left:before{content:""}.fa-hand-o-up:before{content:""}.fa-hand-o-down:before{content:""}.fa-arrow-circle-left:before{content:""}.fa-arrow-circle-right:before{content:""}.fa-arrow-circle-up:before{content:""}.fa-arrow-circle-down:before{content:""}.fa-globe:before{content:""}.fa-wrench:before{content:""}.fa-tasks:before{content:""}.fa-filter:before{content:""}.fa-briefcase:before{content:""}.fa-arrows-alt:before{content:""}.fa-group:before,.fa-users:before{content:""}.fa-chain:before,.fa-link:before{content:""}.fa-cloud:before{content:""}.fa-flask:before{content:""}.fa-cut:before,.fa-scissors:before{content:""}.fa-copy:before,.fa-files-o:before{content:""}.fa-paperclip:before{content:""}.fa-save:before,.fa-floppy-o:before{content:""}.fa-square:before{content:""}.fa-navicon:before,.fa-reorder:before,.fa-bars:before{content:""}.fa-list-ul:before{content:""}.fa-list-ol:before{content:""}.fa-strikethrough:before{content:""}.fa-underline:before{content:""}.fa-table:before{content:""}.fa-magic:before{content:""}.fa-truck:before{content:""}.fa-pinterest:before{content:""}.fa-pinterest-square:before{content:""}.fa-google-plus-square:before{content:""}.fa-google-plus:before{content:""}.fa-money:before{content:""}.fa-caret-down:before{content:""}.fa-caret-up:before{content:""}.fa-caret-left:before{content:""}.fa-caret-right:before{content:""}.fa-columns:before{content:""}.fa-unsorted:before,.fa-sort:before{content:""}.fa-sort-down:before,.fa-sort-desc:before{content:""}.fa-sort-up:before,.fa-sort-asc:before{content:""}.fa-envelope:before{content:""}.fa-linkedin:before{content:""}.fa-rotate-left:before,.fa-undo:before{content:""}.fa-legal:before,.fa-gavel:before{content:""}.fa-dashboard:before,.fa-tachometer:before{content:""}.fa-comment-o:before{content:""}.fa-comments-o:before{content:""}.fa-flash:before,.fa-bolt:before{content:""}.fa-sitemap:before{content:""}.fa-umbrella:before{content:""}.fa-paste:before,.fa-clipboard:before{content:""}.fa-lightbulb-o:before{content:""}.fa-exchange:before{content:""}.fa-cloud-download:before{content:""}.fa-cloud-upload:before{content:""}.fa-user-md:before{content:""}.fa-stethoscope:before{content:""}.fa-suitcase:before{content:""}.fa-bell-o:before{content:""}.fa-coffee:before{content:""}.fa-cutlery:before{content:""}.fa-file-text-o:before{content:""}.fa-building-o:before{content:""}.fa-hospital-o:before{content:""}.fa-ambulance:before{content:""}.fa-medkit:before{content:""}.fa-fighter-jet:before{content:""}.fa-beer:before{content:""}.fa-h-square:before{content:""}.fa-plus-square:before{content:""}.fa-angle-double-left:before{content:""}.fa-angle-double-right:before{content:""}.fa-angle-double-up:before{content:""}.fa-angle-double-down:before{content:""}.fa-angle-left:before{content:""}.fa-angle-right:before{content:""}.fa-angle-up:before{content:""}.fa-angle-down:before{content:""}.fa-desktop:before{content:""}.fa-laptop:before{content:""}.fa-tablet:before{content:""}.fa-mobile-phone:before,.fa-mobile:before{content:""}.fa-circle-o:before{content:""}.fa-quote-left:before{content:""}.fa-quote-right:before{content:""}.fa-spinner:before{content:""}.fa-circle:before{content:""}.fa-mail-reply:before,.fa-reply:before{content:""}.fa-github-alt:before{content:""}.fa-folder-o:before{content:""}.fa-folder-open-o:before{content:""}.fa-smile-o:before{content:""}.fa-frown-o:before{content:""}.fa-meh-o:before{content:""}.fa-gamepad:before{content:""}.fa-keyboard-o:before{content:""}.fa-flag-o:before{content:""}.fa-flag-checkered:before{content:""}.fa-terminal:before{content:""}.fa-code:before{content:""}.fa-mail-reply-all:before,.fa-reply-all:before{content:""}.fa-star-half-empty:before,.fa-star-half-full:before,.fa-star-half-o:before{content:""}.fa-location-arrow:before{content:""}.fa-crop:before{content:""}.fa-code-fork:before{content:""}.fa-unlink:before,.fa-chain-broken:before{content:""}.fa-question:before{content:""}.fa-info:before{content:""}.fa-exclamation:before{content:""}.fa-superscript:before{content:""}.fa-subscript:before{content:""}.fa-eraser:before{content:""}.fa-puzzle-piece:before{content:""}.fa-microphone:before{content:""}.fa-microphone-slash:before{content:""}.fa-shield:before{content:""}.fa-calendar-o:before{content:""}.fa-fire-extinguisher:before{content:""}.fa-rocket:before{content:""}.fa-maxcdn:before{content:""}.fa-chevron-circle-left:before{content:""}.fa-chevron-circle-right:before{content:""}.fa-chevron-circle-up:before{content:""}.fa-chevron-circle-down:before{content:""}.fa-html5:before{content:""}.fa-css3:before{content:""}.fa-anchor:before{content:""}.fa-unlock-alt:before{content:""}.fa-bullseye:before{content:""}.fa-ellipsis-h:before{content:""}.fa-ellipsis-v:before{content:""}.fa-rss-square:before{content:""}.fa-play-circle:before{content:""}.fa-ticket:before{content:""}.fa-minus-square:before{content:""}.fa-minus-square-o:before{content:""}.fa-level-up:before{content:""}.fa-level-down:before{content:""}.fa-check-square:before{content:""}.fa-pencil-square:before{content:""}.fa-external-link-square:before{content:""}.fa-share-square:before{content:""}.fa-compass:before{content:""}.fa-toggle-down:before,.fa-caret-square-o-down:before{content:""}.fa-toggle-up:before,.fa-caret-square-o-up:before{content:""}.fa-toggle-right:before,.fa-caret-square-o-right:before{content:""}.fa-euro:before,.fa-eur:before{content:""}.fa-gbp:before{content:""}.fa-dollar:before,.fa-usd:before{content:""}.fa-rupee:before,.fa-inr:before{content:""}.fa-cny:before,.fa-rmb:before,.fa-yen:before,.fa-jpy:before{content:""}.fa-ruble:before,.fa-rouble:before,.fa-rub:before{content:""}.fa-won:before,.fa-krw:before{content:""}.fa-bitcoin:before,.fa-btc:before{content:""}.fa-file:before{content:""}.fa-file-text:before{content:""}.fa-sort-alpha-asc:before{content:""}.fa-sort-alpha-desc:before{content:""}.fa-sort-amount-asc:before{content:""}.fa-sort-amount-desc:before{content:""}.fa-sort-numeric-asc:before{content:""}.fa-sort-numeric-desc:before{content:""}.fa-thumbs-up:before{content:""}.fa-thumbs-down:before{content:""}.fa-youtube-square:before{content:""}.fa-youtube:before{content:""}.fa-xing:before{content:""}.fa-xing-square:before{content:""}.fa-youtube-play:before{content:""}.fa-dropbox:before{content:""}.fa-stack-overflow:before{content:""}.fa-instagram:before{content:""}.fa-flickr:before{content:""}.fa-adn:before{content:""}.fa-bitbucket:before{content:""}.fa-bitbucket-square:before{content:""}.fa-tumblr:before{content:""}.fa-tumblr-square:before{content:""}.fa-long-arrow-down:before{content:""}.fa-long-arrow-up:before{content:""}.fa-long-arrow-left:before{content:""}.fa-long-arrow-right:before{content:""}.fa-apple:before{content:""}.fa-windows:before{content:""}.fa-android:before{content:""}.fa-linux:before{content:""}.fa-dribbble:before{content:""}.fa-skype:before{content:""}.fa-foursquare:before{content:""}.fa-trello:before{content:""}.fa-female:before{content:""}.fa-male:before{content:""}.fa-gittip:before,.fa-gratipay:before{content:""}.fa-sun-o:before{content:""}.fa-moon-o:before{content:""}.fa-archive:before{content:""}.fa-bug:before{content:""}.fa-vk:before{content:""}.fa-weibo:before{content:""}.fa-renren:before{content:""}.fa-pagelines:before{content:""}.fa-stack-exchange:before{content:""}.fa-arrow-circle-o-right:before{content:""}.fa-arrow-circle-o-left:before{content:""}.fa-toggle-left:before,.fa-caret-square-o-left:before{content:""}.fa-dot-circle-o:before{content:""}.fa-wheelchair:before{content:""}.fa-vimeo-square:before{content:""}.fa-turkish-lira:before,.fa-try:before{content:""}.fa-plus-square-o:before{content:""}.fa-space-shuttle:before{content:""}.fa-slack:before{content:""}.fa-envelope-square:before{content:""}.fa-wordpress:before{content:""}.fa-openid:before{content:""}.fa-institution:before,.fa-bank:before,.fa-university:before{content:""}.fa-mortar-board:before,.fa-graduation-cap:before{content:""}.fa-yahoo:before{content:""}.fa-google:before{content:""}.fa-reddit:before{content:""}.fa-reddit-square:before{content:""}.fa-stumbleupon-circle:before{content:""}.fa-stumbleupon:before{content:""}.fa-delicious:before{content:""}.fa-digg:before{content:""}.fa-pied-piper:before{content:""}.fa-pied-piper-alt:before{content:""}.fa-drupal:before{content:""}.fa-joomla:before{content:""}.fa-language:before{content:""}.fa-fax:before{content:""}.fa-building:before{content:""}.fa-child:before{content:""}.fa-paw:before{content:""}.fa-spoon:before{content:""}.fa-cube:before{content:""}.fa-cubes:before{content:""}.fa-behance:before{content:""}.fa-behance-square:before{content:""}.fa-steam:before{content:""}.fa-steam-square:before{content:""}.fa-recycle:before{content:""}.fa-automobile:before,.fa-car:before{content:""}.fa-cab:before,.fa-taxi:before{content:""}.fa-tree:before{content:""}.fa-spotify:before{content:""}.fa-deviantart:before{content:""}.fa-soundcloud:before{content:""}.fa-database:before{content:""}.fa-file-pdf-o:before{content:""}.fa-file-word-o:before{content:""}.fa-file-excel-o:before{content:""}.fa-file-powerpoint-o:before{content:""}.fa-file-photo-o:before,.fa-file-picture-o:before,.fa-file-image-o:before{content:""}.fa-file-zip-o:before,.fa-file-archive-o:before{content:""}.fa-file-sound-o:before,.fa-file-audio-o:before{content:""}.fa-file-movie-o:before,.fa-file-video-o:before{content:""}.fa-file-code-o:before{content:""}.fa-vine:before{content:""}.fa-codepen:before{content:""}.fa-jsfiddle:before{content:""}.fa-life-bouy:before,.fa-life-buoy:before,.fa-life-saver:before,.fa-support:before,.fa-life-ring:before{content:""}.fa-circle-o-notch:before{content:""}.fa-ra:before,.fa-rebel:before{content:""}.fa-ge:before,.fa-empire:before{content:""}.fa-git-square:before{content:""}.fa-git:before{content:""}.fa-y-combinator-square:before,.fa-yc-square:before,.fa-hacker-news:before{content:""}.fa-tencent-weibo:before{content:""}.fa-qq:before{content:""}.fa-wechat:before,.fa-weixin:before{content:""}.fa-send:before,.fa-paper-plane:before{content:""}.fa-send-o:before,.fa-paper-plane-o:before{content:""}.fa-history:before{content:""}.fa-circle-thin:before{content:""}.fa-header:before{content:""}.fa-paragraph:before{content:""}.fa-sliders:before{content:""}.fa-share-alt:before{content:""}.fa-share-alt-square:before{content:""}.fa-bomb:before{content:""}.fa-soccer-ball-o:before,.fa-futbol-o:before{content:""}.fa-tty:before{content:""}.fa-binoculars:before{content:""}.fa-plug:before{content:""}.fa-slideshare:before{content:""}.fa-twitch:before{content:""}.fa-yelp:before{content:""}.fa-newspaper-o:before{content:""}.fa-wifi:before{content:""}.fa-calculator:before{content:""}.fa-paypal:before{content:""}.fa-google-wallet:before{content:""}.fa-cc-visa:before{content:""}.fa-cc-mastercard:before{content:""}.fa-cc-discover:before{content:""}.fa-cc-amex:before{content:""}.fa-cc-paypal:before{content:""}.fa-cc-stripe:before{content:""}.fa-bell-slash:before{content:""}.fa-bell-slash-o:before{content:""}.fa-trash:before{content:""}.fa-copyright:before{content:""}.fa-at:before{content:""}.fa-eyedropper:before{content:""}.fa-paint-brush:before{content:""}.fa-birthday-cake:before{content:""}.fa-area-chart:before{content:""}.fa-pie-chart:before{content:""}.fa-line-chart:before{content:""}.fa-lastfm:before{content:""}.fa-lastfm-square:before{content:""}.fa-toggle-off:before{content:""}.fa-toggle-on:before{content:""}.fa-bicycle:before{content:""}.fa-bus:before{content:""}.fa-ioxhost:before{content:""}.fa-angellist:before{content:""}.fa-cc:before{content:""}.fa-shekel:before,.fa-sheqel:before,.fa-ils:before{content:""}.fa-meanpath:before{content:""}.fa-buysellads:before{content:""}.fa-connectdevelop:before{content:""}.fa-dashcube:before{content:""}.fa-forumbee:before{content:""}.fa-leanpub:before{content:""}.fa-sellsy:before{content:""}.fa-shirtsinbulk:before{content:""}.fa-simplybuilt:before{content:""}.fa-skyatlas:before{content:""}.fa-cart-plus:before{content:""}.fa-cart-arrow-down:before{content:""}.fa-diamond:before{content:""}.fa-ship:before{content:""}.fa-user-secret:before{content:""}.fa-motorcycle:before{content:""}.fa-street-view:before{content:""}.fa-heartbeat:before{content:""}.fa-venus:before{content:""}.fa-mars:before{content:""}.fa-mercury:before{content:""}.fa-intersex:before,.fa-transgender:before{content:""}.fa-transgender-alt:before{content:""}.fa-venus-double:before{content:""}.fa-mars-double:before{content:""}.fa-venus-mars:before{content:""}.fa-mars-stroke:before{content:""}.fa-mars-stroke-v:before{content:""}.fa-mars-stroke-h:before{content:""}.fa-neuter:before{content:""}.fa-genderless:before{content:""}.fa-facebook-official:before{content:""}.fa-pinterest-p:before{content:""}.fa-whatsapp:before{content:""}.fa-server:before{content:""}.fa-user-plus:before{content:""}.fa-user-times:before{content:""}.fa-hotel:before,.fa-bed:before{content:""}.fa-viacoin:before{content:""}.fa-train:before{content:""}.fa-subway:before{content:""}.fa-medium:before{content:""}.fa-yc:before,.fa-y-combinator:before{content:""}.fa-optin-monster:before{content:""}.fa-opencart:before{content:""}.fa-expeditedssl:before{content:""}.fa-battery-4:before,.fa-battery-full:before{content:""}.fa-battery-3:before,.fa-battery-three-quarters:before{content:""}.fa-battery-2:before,.fa-battery-half:before{content:""}.fa-battery-1:before,.fa-battery-quarter:before{content:""}.fa-battery-0:before,.fa-battery-empty:before{content:""}.fa-mouse-pointer:before{content:""}.fa-i-cursor:before{content:""}.fa-object-group:before{content:""}.fa-object-ungroup:before{content:""}.fa-sticky-note:before{content:""}.fa-sticky-note-o:before{content:""}.fa-cc-jcb:before{content:""}.fa-cc-diners-club:before{content:""}.fa-clone:before{content:""}.fa-balance-scale:before{content:""}.fa-hourglass-o:before{content:""}.fa-hourglass-1:before,.fa-hourglass-start:before{content:""}.fa-hourglass-2:before,.fa-hourglass-half:before{content:""}.fa-hourglass-3:before,.fa-hourglass-end:before{content:""}.fa-hourglass:before{content:""}.fa-hand-grab-o:before,.fa-hand-rock-o:before{content:""}.fa-hand-stop-o:before,.fa-hand-paper-o:before{content:""}.fa-hand-scissors-o:before{content:""}.fa-hand-lizard-o:before{content:""}.fa-hand-spock-o:before{content:""}.fa-hand-pointer-o:before{content:""}.fa-hand-peace-o:before{content:""}.fa-trademark:before{content:""}.fa-registered:before{content:""}.fa-creative-commons:before{content:""}.fa-gg:before{content:""}.fa-gg-circle:before{content:""}.fa-tripadvisor:before{content:""}.fa-odnoklassniki:before{content:""}.fa-odnoklassniki-square:before{content:""}.fa-get-pocket:before{content:""}.fa-wikipedia-w:before{content:""}.fa-safari:before{content:""}.fa-chrome:before{content:""}.fa-firefox:before{content:""}.fa-opera:before{content:""}.fa-internet-explorer:before{content:""}.fa-tv:before,.fa-television:before{content:""}.fa-contao:before{content:""}.fa-500px:before{content:""}.fa-amazon:before{content:""}.fa-calendar-plus-o:before{content:""}.fa-calendar-minus-o:before{content:""}.fa-calendar-times-o:before{content:""}.fa-calendar-check-o:before{content:""}.fa-industry:before{content:""}.fa-map-pin:before{content:""}.fa-map-signs:before{content:""}.fa-map-o:before{content:""}.fa-map:before{content:""}.fa-commenting:before{content:""}.fa-commenting-o:before{content:""}.fa-houzz:before{content:""}.fa-vimeo:before{content:""}.fa-black-tie:before{content:""}.fa-fonticons:before{content:""}.maxWidth{width:100%}.hidden{display:none}*{transition:all 0.15s ease}body{background-color:#333}body>main{padding:2.5rem 0;background-color:#fff}@media only screen and (max-width: 40em){body>main{padding:1.25rem 0}}body>main img{margin-bottom:1.25rem}@media only screen and (max-width: 40em){aside{margin-bottom:1.5rem}}@media only screen and (max-width: 40em){.row{overflow:hidden}}body>footer{background-color:#333;padding:2.5rem 0;color:#999}body>footer p,body>footer h1,body>footer h2,body>footer h3,body>footer h4,body>footer h5,body>footer h6{color:inherit}body>footer a{color:#e23424}code{font-size:85%;color:inherit !important;overflow-x:scroll;-webkit-overflow-scrolling:touch}.highlight{border:solid 1px #ddd;background:#fff;padding:1em;line-height:23px;margin-bottom:30px;white-space:pre;overflow-x:auto;word-break:inherit;word-wrap:inherit;background:#ffffff}@media only screen and (max-width: 40em){.highlight{overflow-x:scroll;-webkit-overflow-scrolling:touch}}.highlight code{background-color:transparent;border:none;padding:0}.highlight td{padding:8px 15px}.highlight .gl{background:#fafafa;border-right:1px solid #ddd;color:#999;-webkit-touch-callout:none;-webkit-user-select:none;-khtml-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.highlight .c{color:#999988;font-style:italic}.highlight .err{color:#a61717;background-color:#e3d2d2}.highlight .k{font-weight:bold}.highlight .o{font-weight:bold}.highlight .cm{color:#999988;font-style:italic}.highlight .cp{color:#999999;font-weight:bold}.highlight .c1{color:#999988;font-style:italic}.highlight .cs{color:#999999;font-weight:bold;font-style:italic}.highlight .gd{color:#000000;background-color:#ffdddd}.highlight .gd .x{color:#000000;background-color:#ffaaaa}.highlight .ge{font-style:italic}.highlight .gr{color:#aa0000}.highlight .gh{color:#999999}.highlight .gi{color:#000000;background-color:#ddffdd}.highlight .gi .x{color:#000000;background-color:#aaffaa}.highlight .go{color:#888888}.highlight .gp{color:#555555}.highlight .gs{font-weight:bold}.highlight .gu{color:#aaaaaa}.highlight .gt{color:#aa0000}.highlight .kc{font-weight:bold}.highlight .kd{font-weight:bold}.highlight .kp{font-weight:bold}.highlight .kr{font-weight:bold}.highlight .kt{color:#445588;font-weight:bold}.highlight .m{color:#009999}.highlight .s{color:#d14}.highlight .na{color:#008080}.highlight .nb{color:#0086B3}.highlight .nc{color:#445588;font-weight:bold}.highlight .no{color:#008080}.highlight .ni{color:#800080}.highlight .ne{color:#990000;font-weight:bold}.highlight .nf{color:#990000;font-weight:bold}.highlight .nn{color:#555555}.highlight .nt{color:#000080}.highlight .nv{color:#008080}.highlight .ow{font-weight:bold}.highlight .w{color:#bbbbbb}.highlight .mf{color:#009999}.highlight .mh{color:#009999}.highlight .mi{color:#009999}.highlight .mo{color:#009999}.highlight .sb{color:#d14}.highlight .sc{color:#d14}.highlight .sd{color:#d14}.highlight .s2{color:#d14}.highlight .se{color:#d14}.highlight .sh{color:#d14}.highlight .si{color:#d14}.highlight .sx{color:#d14}.highlight .sr{color:#009926}.highlight .s1{color:#d14}.highlight .ss{color:#990073}.highlight .bp{color:#999999}.highlight .vc{color:#008080}.highlight .vg{color:#008080}.highlight .vi{color:#008080}.highlight .il{color:#009999}kbd{display:inline-block;padding:3px 5px;font-size:11px;line-height:10px;color:#555;vertical-align:middle;background-color:#fcfcfc;border:solid 1px #ccc;border-bottom-color:#bbb;border-radius:3px;box-shadow:inset 0 -1px 0 #bbb}.social__icons{margin-bottom:10px}.social__icon{display:inline-block;margin-right:10px}.slider picture img{width:100%}.videoWrapper{position:relative;padding-top:56.25%;margin-bottom:1.25rem}.videoWrapper iframe{position:absolute;top:0;left:0;width:100%;height:100%}.icon{position:relative;top:1px;display:inline-block;width:16px;height:16px}.icon-color{border:1px solid #aaa}.icon-color-white{background-color:#fff}.icon-color-black{background-color:#000}.icon-color-red{background-color:#ba2619}.toc-header{margin-bottom:0}#toc{display:block;margin:1rem 0 0 0}#toc>ol{margin-left:0}#toc>ol>li{margin-bottom:0.5rem}#toc ol{list-style-type:none}.clickable-header{cursor:pointer}.clickable-header:hover{text-decoration:underline}.top-level-header{display:inline-block}.back-to-top{position:relative;margin-left:8px;cursor:pointer;top:-3px}.contentSearch{margin-bottom:30px}@media only screen and (max-width: 40em){.contentSearch{margin-bottom:5px}}.contentSearch-wrapper{position:relative}.contentSearch-wrapper.small-collapse{margin:0 !important}.liveSearch-field{margin-bottom:0 !important}.liveSearch-button{margin-bottom:0}.liveSearch-result-list{position:absolute;width:100%;height:auto;background:white;border:1px #ccc;border-style:none solid solid solid;z-index:99;margin:0;list-style-type:none}@media only screen and (max-width: 40em){.liveSearch-result-list{position:relative}}.liveSearch-result-list li a{-webkit-transition:all 0.15s ease;transition:all 0.15s ease;padding:4px 10px;display:block;width:100%;height:100%;line-height:1.2}.liveSearch-result-list li a:hover{background-color:#eee}.liveSearch-result-list li a:first-child{padding-top:8px}.liveSearch-result-list li a:last-child{padding-bottom:8px}.searchPage-result-list{line-height:1.2;list-style-type:none}.searchPage-result-list li{margin-bottom:20px}@media only screen and (max-width: 40em){.searchPage-result-list li{margin-bottom:15px}}.searchPage-result-list li a{font-weight:bold;color:#1a0dab}.searchPage-result-list li a:hover{color:#1a0dab;text-decoration:underline}.searchPage-result-list li .url{color:#006621}@media only screen and (max-width: 40em){.searchPage-result-list li .additionalInfo{display:none}}.article-list{margin:0;padding:0;list-style-type:none}.article-list header h1{font-size:1.5rem}article header{margin-bottom:0.5rem}article header h1{margin-bottom:0}article .meta{font-size:0.9em}.table-wrapper{width:100%;overflow-y:auto;_overflow:auto;margin:0 0 1em} diff --git a/docs/docker-compose.yml b/docs/docker-compose.yml new file mode 100644 index 0000000000..9999a5b6e8 --- /dev/null +++ b/docs/docker-compose.yml @@ -0,0 +1,10 @@ +version: '2' + +services: + docs: + build: . + restart: always + ports: + - "4000:4000" + volumes: + - ./:/usr/src/app diff --git a/docs/img/icons/icon-128x128.png b/docs/img/icons/icon-128x128.png new file mode 100644 index 0000000000..611f8d1a5c Binary files /dev/null and b/docs/img/icons/icon-128x128.png differ diff --git a/docs/img/icons/icon-144x144.png b/docs/img/icons/icon-144x144.png new file mode 100644 index 0000000000..e56c7c1f65 Binary files /dev/null and b/docs/img/icons/icon-144x144.png differ diff --git a/docs/img/icons/icon-256x256.png b/docs/img/icons/icon-256x256.png new file mode 100644 index 0000000000..5e6e534e05 Binary files /dev/null and b/docs/img/icons/icon-256x256.png differ diff --git a/docs/img/icons/icon-384x384.png b/docs/img/icons/icon-384x384.png new file mode 100644 index 0000000000..004a24c094 Binary files /dev/null and b/docs/img/icons/icon-384x384.png differ diff --git a/docs/img/icons/icon-48x48.png b/docs/img/icons/icon-48x48.png new file mode 100644 index 0000000000..2eaecef162 Binary files /dev/null and b/docs/img/icons/icon-48x48.png differ diff --git a/docs/img/icons/icon-512x512.png b/docs/img/icons/icon-512x512.png new file mode 100644 index 0000000000..94192e6a23 Binary files /dev/null and b/docs/img/icons/icon-512x512.png differ diff --git a/docs/img/icons/icon-96x96.png b/docs/img/icons/icon-96x96.png new file mode 100644 index 0000000000..3d24b64374 Binary files /dev/null and b/docs/img/icons/icon-96x96.png differ diff --git a/docs/img/news/161104_blood.jpg b/docs/img/news/161104_blood.jpg new file mode 100644 index 0000000000..80af0fdd04 Binary files /dev/null and b/docs/img/news/161104_blood.jpg differ diff --git a/docs/img/news/170221_Zeus.jpg b/docs/img/news/170221_Zeus.jpg new file mode 100644 index 0000000000..8d52b28aee Binary files /dev/null and b/docs/img/news/170221_Zeus.jpg differ diff --git a/docs/img/news/170221_csatconvoy.jpg b/docs/img/news/170221_csatconvoy.jpg new file mode 100644 index 0000000000..b80b907468 Binary files /dev/null and b/docs/img/news/170221_csatconvoy.jpg differ diff --git a/docs/img/news/170714_jet_rearm.jpg b/docs/img/news/170714_jet_rearm.jpg new file mode 100644 index 0000000000..4c1de1ba42 Binary files /dev/null and b/docs/img/news/170714_jet_rearm.jpg differ diff --git a/docs/img/news/170714_logo-intercept.png b/docs/img/news/170714_logo-intercept.png new file mode 100644 index 0000000000..a279195750 Binary files /dev/null and b/docs/img/news/170714_logo-intercept.png differ diff --git a/docs/img/scope_module.jpg b/docs/img/scope_module.jpg new file mode 100644 index 0000000000..19629bddd7 Binary files /dev/null and b/docs/img/scope_module.jpg differ diff --git a/docs/img/slider01.jpg b/docs/img/slider01.jpg old mode 100644 new mode 100755 index 2e5961d58a..e19d19c848 Binary files a/docs/img/slider01.jpg and b/docs/img/slider01.jpg differ diff --git a/docs/img/slider01_mobile.jpg b/docs/img/slider01_mobile.jpg old mode 100644 new mode 100755 index 5034e8021b..7ccc2942c2 Binary files a/docs/img/slider01_mobile.jpg and b/docs/img/slider01_mobile.jpg differ diff --git a/docs/img/slider02.jpg b/docs/img/slider02.jpg old mode 100644 new mode 100755 index 63ca4cc676..87d6fc4cc9 Binary files a/docs/img/slider02.jpg and b/docs/img/slider02.jpg differ diff --git a/docs/img/slider02_mobile.jpg b/docs/img/slider02_mobile.jpg old mode 100644 new mode 100755 index 37989dfdf0..d3d4c6744c Binary files a/docs/img/slider02_mobile.jpg and b/docs/img/slider02_mobile.jpg differ diff --git a/docs/img/slider03.jpg b/docs/img/slider03.jpg old mode 100644 new mode 100755 index 4249c163b3..18a6804e19 Binary files a/docs/img/slider03.jpg and b/docs/img/slider03.jpg differ diff --git a/docs/img/slider03_mobile.jpg b/docs/img/slider03_mobile.jpg old mode 100644 new mode 100755 index eaaea83f60..9ec4d304ff Binary files a/docs/img/slider03_mobile.jpg and b/docs/img/slider03_mobile.jpg differ diff --git a/docs/img/wiki/feature/ab_ingame.png b/docs/img/wiki/feature/ab_ingame.png new file mode 100644 index 0000000000..6f53d714d7 Binary files /dev/null and b/docs/img/wiki/feature/ab_ingame.png differ diff --git a/docs/img/wiki/feature/ab_module.jpg b/docs/img/wiki/feature/ab_module.jpg new file mode 100644 index 0000000000..70d2ec52b5 Binary files /dev/null and b/docs/img/wiki/feature/ab_module.jpg differ diff --git a/docs/img/wiki/feature/abtools_inventory.png b/docs/img/wiki/feature/abtools_inventory.png new file mode 100644 index 0000000000..72e1607689 Binary files /dev/null and b/docs/img/wiki/feature/abtools_inventory.png differ diff --git a/docs/img/wiki/feature/atragmx1.png b/docs/img/wiki/feature/atragmx1.png new file mode 100644 index 0000000000..e32a31c899 Binary files /dev/null and b/docs/img/wiki/feature/atragmx1.png differ diff --git a/docs/img/wiki/feature/atragmx2.png b/docs/img/wiki/feature/atragmx2.png new file mode 100644 index 0000000000..6cdaabd3f8 Binary files /dev/null and b/docs/img/wiki/feature/atragmx2.png differ diff --git a/docs/img/wiki/feature/atragmx3.png b/docs/img/wiki/feature/atragmx3.png new file mode 100644 index 0000000000..dd4a1800e1 Binary files /dev/null and b/docs/img/wiki/feature/atragmx3.png differ diff --git a/docs/img/wiki/feature/atragmx3a.png b/docs/img/wiki/feature/atragmx3a.png new file mode 100644 index 0000000000..9e18243d56 Binary files /dev/null and b/docs/img/wiki/feature/atragmx3a.png differ diff --git a/docs/img/wiki/feature/atragmx4.png b/docs/img/wiki/feature/atragmx4.png new file mode 100644 index 0000000000..7db5b69077 Binary files /dev/null and b/docs/img/wiki/feature/atragmx4.png differ diff --git a/docs/img/wiki/feature/atragmx5.png b/docs/img/wiki/feature/atragmx5.png new file mode 100644 index 0000000000..6cba04cdd5 Binary files /dev/null and b/docs/img/wiki/feature/atragmx5.png differ diff --git a/docs/img/wiki/feature/rangecard_menu.jpg b/docs/img/wiki/feature/rangecard_menu.jpg new file mode 100644 index 0000000000..d41ba9fe6b Binary files /dev/null and b/docs/img/wiki/feature/rangecard_menu.jpg differ diff --git a/docs/img/wiki/feature/scope_module.jpg b/docs/img/wiki/feature/scope_module.jpg new file mode 100644 index 0000000000..19629bddd7 Binary files /dev/null and b/docs/img/wiki/feature/scope_module.jpg differ diff --git a/docs/index.html b/docs/index.html index 3bc84a2b03..13bbd53fc1 100644 --- a/docs/index.html +++ b/docs/index.html @@ -8,7 +8,7 @@ sitemap: exclude: "yes" --- -Fork me on GitHub +Fork me on GitHub @@ -64,7 +64,7 @@ sitemap:

Useful frameworks and features

@@ -81,11 +81,11 @@ sitemap:
Everything you need to know about using the mod or developing for it.

-

ACE3 on Github
Latest code, issue reports, feature requests +

ACE3 on Github
Latest code, issue reports, feature requests and more.

-

ACE3 Public Chat
+

ACE3 Public Chat
Join our public chat! We're glad to answer questions concerning ACE3, development or Arma things.
If you made something with this mod (screen shots, artwork, videos) we'd love to see it.

diff --git a/docs/js/footer.dev.js b/docs/js/footer.dev.js index 6d39cf285c..b594d22c70 100644 --- a/docs/js/footer.dev.js +++ b/docs/js/footer.dev.js @@ -2,743 +2,1594 @@ * Build: http://modernizr.com/download/#-shiv-cssclasses-load */ ;window.Modernizr=function(a,b,c){function u(a){j.cssText=a}function v(a,b){return u(prefixes.join(a+";")+(b||""))}function w(a,b){return typeof a===b}function x(a,b){return!!~(""+a).indexOf(b)}function y(a,b,d){for(var e in a){var f=b[a[e]];if(f!==c)return d===!1?a[e]:w(f,"function")?f.bind(d||b):f}return!1}var d="2.8.3",e={},f=!0,g=b.documentElement,h="modernizr",i=b.createElement(h),j=i.style,k,l={}.toString,m={},n={},o={},p=[],q=p.slice,r,s={}.hasOwnProperty,t;!w(s,"undefined")&&!w(s.call,"undefined")?t=function(a,b){return s.call(a,b)}:t=function(a,b){return b in a&&w(a.constructor.prototype[b],"undefined")},Function.prototype.bind||(Function.prototype.bind=function(b){var c=this;if(typeof c!="function")throw new TypeError;var d=q.call(arguments,1),e=function(){if(this instanceof e){var a=function(){};a.prototype=c.prototype;var f=new a,g=c.apply(f,d.concat(q.call(arguments)));return Object(g)===g?g:f}return c.apply(b,d.concat(q.call(arguments)))};return e});for(var z in m)t(m,z)&&(r=z.toLowerCase(),e[r]=m[z](),p.push((e[r]?"":"no-")+r));return e.addTest=function(a,b){if(typeof a=="object")for(var d in a)t(a,d)&&e.addTest(d,a[d]);else{a=a.toLowerCase();if(e[a]!==c)return e;b=typeof b=="function"?b():b,typeof f!="undefined"&&f&&(g.className+=" "+(b?"":"no-")+a),e[a]=b}return e},u(""),i=k=null,function(a,b){function l(a,b){var c=a.createElement("p"),d=a.getElementsByTagName("head")[0]||a.documentElement;return c.innerHTML="x",d.insertBefore(c.lastChild,d.firstChild)}function m(){var a=s.elements;return typeof a=="string"?a.split(" "):a}function n(a){var b=j[a[h]];return b||(b={},i++,a[h]=i,j[i]=b),b}function o(a,c,d){c||(c=b);if(k)return c.createElement(a);d||(d=n(c));var g;return d.cache[a]?g=d.cache[a].cloneNode():f.test(a)?g=(d.cache[a]=d.createElem(a)).cloneNode():g=d.createElem(a),g.canHaveChildren&&!e.test(a)&&!g.tagUrn?d.frag.appendChild(g):g}function p(a,c){a||(a=b);if(k)return a.createDocumentFragment();c=c||n(a);var d=c.frag.cloneNode(),e=0,f=m(),g=f.length;for(;e",g="hidden"in a,k=a.childNodes.length==1||function(){b.createElement("a");var a=b.createDocumentFragment();return typeof a.cloneNode=="undefined"||typeof a.createDocumentFragment=="undefined"||typeof a.createElement=="undefined"}()}catch(c){g=!0,k=!0}})();var s={elements:d.elements||"abbr article aside audio bdi canvas data datalist details dialog figcaption figure footer header hgroup main mark meter nav output progress section summary template time video",version:c,shivCSS:d.shivCSS!==!1,supportsUnknownElements:k,shivMethods:d.shivMethods!==!1,type:"default",shivDocument:r,createElement:o,createDocumentFragment:p};a.html5=s,r(b)}(this,b),e._version=d,g.className=g.className.replace(/(^|\s)no-js(\s|$)/,"$1$2")+(f?" js "+p.join(" "):""),e}(this,this.document),function(a,b,c){function d(a){return"[object Function]"==o.call(a)}function e(a){return"string"==typeof a}function f(){}function g(a){return!a||"loaded"==a||"complete"==a||"uninitialized"==a}function h(){var a=p.shift();q=1,a?a.t?m(function(){("c"==a.t?B.injectCss:B.injectJs)(a.s,0,a.a,a.x,a.e,1)},0):(a(),h()):q=0}function i(a,c,d,e,f,i,j){function k(b){if(!o&&g(l.readyState)&&(u.r=o=1,!q&&h(),l.onload=l.onreadystatechange=null,b)){"img"!=a&&m(function(){t.removeChild(l)},50);for(var d in y[c])y[c].hasOwnProperty(d)&&y[c][d].onload()}}var j=j||B.errorTimeout,l=b.createElement(a),o=0,r=0,u={t:d,s:c,e:f,a:i,x:j};1===y[c]&&(r=1,y[c]=[]),"object"==a?l.data=c:(l.src=c,l.type=a),l.width=l.height="0",l.onerror=l.onload=l.onreadystatechange=function(){k.call(this,r)},p.splice(e,0,u),"img"!=a&&(r||2===y[c]?(t.insertBefore(l,s?null:n),m(k,j)):y[c].push(l))}function j(a,b,c,d,f){return q=0,b=b||"j",e(a)?i("c"==b?v:u,a,b,this.i++,c,d,f):(p.splice(this.i++,0,a),1==p.length&&h()),this}function k(){var a=B;return a.loader={load:j,i:0},a}var l=b.documentElement,m=a.setTimeout,n=b.getElementsByTagName("script")[0],o={}.toString,p=[],q=0,r="MozAppearance"in l.style,s=r&&!!b.createRange().compareNode,t=s?l:n.parentNode,l=a.opera&&"[object Opera]"==o.call(a.opera),l=!!b.attachEvent&&!l,u=r?"object":l?"script":"img",v=l?"script":u,w=Array.isArray||function(a){return"[object Array]"==o.call(a)},x=[],y={},z={timeout:function(a,b){return b.length&&(a.timeout=b[0]),a}},A,B;B=function(a){function b(a){var a=a.split("!"),b=x.length,c=a.pop(),d=a.length,c={url:c,origUrl:c,prefixes:a},e,f,g;for(f=0;f img._pfLastSize) { + img._pfLastSize = img.offsetWidth; + sizes = img.sizes; + img.sizes += ",100vw"; + setTimeout(function () { + img.sizes = sizes; + }); + } + }; - // 'style.currentStyle' is used by IE <= 8 and 'window.getComputedStyle' for all other browsers - info = ('getComputedStyle' in window) && window.getComputedStyle(style, null) || style.currentStyle; + var findPictureImgs = function () { + var i; + var imgs = document.querySelectorAll("picture > img, img[srcset][sizes]"); + for (i = 0; i < imgs.length; i++) { + fixRespimg(imgs[i]); + } + }; + var onResize = function () { + clearTimeout(timer); + timer = setTimeout(findPictureImgs, 99); + }; + var mq = window.matchMedia && matchMedia("(orientation: landscape)"); + var init = function () { + onResize(); - styleMedia = { - matchMedium: function(media) { - var text = '@media ' + media + '{ #matchmediajs-test { width: 1px; } }'; + if (mq && mq.addListener) { + mq.addListener(onResize); + } + }; - // 'style.styleSheet' is used by IE <= 8 and 'style.textContent' for all other browsers - if (style.styleSheet) { - style.styleSheet.cssText = text; - } else { - style.textContent = text; - } + dummySrc.srcset = "data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw=="; - // Test if media query is true or false - return info.width === '1px'; - } - }; - } + if (/^[c|i]|d$/.test(document.readyState || "")) { + init(); + } else { + document.addEventListener("DOMContentLoaded", init); + } - return function(media) { - return { - matches: styleMedia.matchMedium(media || 'all'), - media: media || 'all' - }; - }; -}()); -/*! Picturefill - Responsive Images that work today. -* Author: Scott Jehl, Filament Group, 2012 ( new proposal implemented by Shawn Jansepar ) -* License: MIT/GPLv2 -* Spec: http://picture.responsiveimages.org/ -*/ -(function( w, doc, image ) { - // Enable strict mode - "use strict"; + return onResize; + })()); + } +})(window); - function expose(picturefill) { - /* expose picturefill */ - if ( typeof module === "object" && typeof module.exports === "object" ) { - // CommonJS, just export - module.exports = picturefill; - } else if ( typeof define === "function" && define.amd ) { - // AMD support - define( "picturefill", function() { return picturefill; } ); - } - if ( typeof w === "object" ) { - // If no AMD and we are in the browser, attach to window - w.picturefill = picturefill; - } - } +/*! Picturefill - v3.0.2 + * http://scottjehl.github.io/picturefill + * Copyright (c) 2015 https://github.com/scottjehl/picturefill/blob/master/Authors.txt; + * License: MIT + */ - // If picture is supported, well, that's awesome. Let's get outta here... - if ( w.HTMLPictureElement ) { - expose(function() { }); - return; - } +(function (window, document, undefined) { + // Enable strict mode + "use strict"; - // HTML shim|v it for old IE (IE9 will still need the HTML video tag workaround) - doc.createElement( "picture" ); + // HTML shim|v it for old IE (IE9 will still need the HTML video tag workaround) + document.createElement("picture"); - // local object for method references and testing exposure - var pf = w.picturefill || {}; + var warn, eminpx, alwaysCheckWDescriptor, evalId; + // local object for method references and testing exposure + var pf = {}; + var isSupportTestReady = false; + var noop = function () { + }; + var image = document.createElement("img"); + var getImgAttr = image.getAttribute; + var setImgAttr = image.setAttribute; + var removeImgAttr = image.removeAttribute; + var docElem = document.documentElement; + var types = {}; + var cfg = { + //resource selection: + algorithm: "" + }; + var srcAttr = "data-pfsrc"; + var srcsetAttr = srcAttr + "set"; + // ua sniffing is done for undetectable img loading features, + // to do some non crucial perf optimizations + var ua = navigator.userAgent; + var supportAbort = (/rident/).test(ua) || ((/ecko/).test(ua) && ua.match(/rv\:(\d+)/) && RegExp.$1 > 35 ); + var curSrcProp = "currentSrc"; + var regWDesc = /\s+\+?\d+(e\d+)?w/; + var regSize = /(\([^)]+\))?\s*(.+)/; + var setOptions = window.picturefillCFG; + /** + * Shortcut property for https://w3c.github.io/webappsec/specs/mixedcontent/#restricts-mixed-content ( for easy overriding in tests ) + */ + // baseStyle also used by getEmValue (i.e.: width: 1em is important) + var baseStyle = "position:absolute;left:0;visibility:hidden;display:block;padding:0;border:none;font-size:1em;width:1em;overflow:hidden;clip:rect(0px, 0px, 0px, 0px)"; + var fsCss = "font-size:100%!important;"; + var isVwDirty = true; - var regWDesc = /\s+\+?\d+(e\d+)?w/; + var cssCache = {}; + var sizeLengthCache = {}; + var DPR = window.devicePixelRatio; + var units = { + px: 1, + "in": 96 + }; + var anchor = document.createElement("a"); + /** + * alreadyRun flag used for setOptions. is it true setOptions will reevaluate + * @type {boolean} + */ + var alreadyRun = false; - // namespace - pf.ns = "picturefill"; + // Reusable, non-"g" Regexes - // srcset support test - (function() { - pf.srcsetSupported = "srcset" in image; - pf.sizesSupported = "sizes" in image; - })(); + // (Don't use \s, to avoid matching non-breaking space.) + var regexLeadingSpaces = /^[ \t\n\r\u000c]+/, + regexLeadingCommasOrSpaces = /^[, \t\n\r\u000c]+/, + regexLeadingNotSpaces = /^[^ \t\n\r\u000c]+/, + regexTrailingCommas = /[,]+$/, + regexNonNegativeInteger = /^\d+$/, - // just a string trim workaround - pf.trim = function( str ) { - return str.trim ? str.trim() : str.replace( /^\s+|\s+$/g, "" ); - }; + // ( Positive or negative or unsigned integers or decimals, without or without exponents. + // Must include at least one digit. + // According to spec tests any decimal point must be followed by a digit. + // No leading plus sign is allowed.) + // https://html.spec.whatwg.org/multipage/infrastructure.html#valid-floating-point-number + regexFloatingPoint = /^-?(?:[0-9]+|[0-9]*\.[0-9]+)(?:[eE][+-]?[0-9]+)?$/; - /** - * Gets a string and returns the absolute URL - * @param src - * @returns {String} absolute URL - */ - pf.makeUrl = (function() { - var anchor = doc.createElement( "a" ); - return function(src) { - anchor.href = src; - return anchor.href; - }; - })(); + var on = function (obj, evt, fn, capture) { + if (obj.addEventListener) { + obj.addEventListener(evt, fn, capture || false); + } else if (obj.attachEvent) { + obj.attachEvent("on" + evt, fn); + } + }; - /** - * Shortcut method for https://w3c.github.io/webappsec/specs/mixedcontent/#restricts-mixed-content ( for easy overriding in tests ) - */ - pf.restrictsMixedContent = function() { - return w.location.protocol === "https:"; - }; - /** - * Shortcut method for matchMedia ( for easy overriding in tests ) - */ + /** + * simple memoize function: + */ - pf.matchesMedia = function( media ) { - return w.matchMedia && w.matchMedia( media ).matches; - }; + var memoize = function (fn) { + var cache = {}; + return function (input) { + if (!(input in cache)) { + cache[input] = fn(input); + } + return cache[input]; + }; + }; - // Shortcut method for `devicePixelRatio` ( for easy overriding in tests ) - pf.getDpr = function() { - return ( w.devicePixelRatio || 1 ); - }; + // UTILITY FUNCTIONS - /** - * Get width in css pixel value from a "length" value - * http://dev.w3.org/csswg/css-values-3/#length-value - */ - pf.getWidthFromLength = function( length ) { - var cssValue; - // If a length is specified and doesn’t contain a percentage, and it is greater than 0 or using `calc`, use it. Else, abort. - if ( !(length && length.indexOf( "%" ) > -1 === false && ( parseFloat( length ) > 0 || length.indexOf( "calc(" ) > -1 )) ) { - return false; + // Manual is faster than RegEx + // http://jsperf.com/whitespace-character/5 + function isSpace(c) { + return (c === "\u0020" || // space + c === "\u0009" || // horizontal tab + c === "\u000A" || // new line + c === "\u000C" || // form feed + c === "\u000D"); // carriage return + } + + /** + * gets a mediaquery and returns a boolean or gets a css length and returns a number + * @param css mediaqueries or css length + * @returns {boolean|number} + * + * based on: https://gist.github.com/jonathantneal/db4f77009b155f083738 + */ + var evalCSS = (function () { + + var regLength = /^([\d\.]+)(em|vw|px)$/; + var replace = function () { + var args = arguments, index = 0, string = args[0]; + while (++index in args) { + string = string.replace(args[index], args[++index]); + } + return string; + }; + + var buildStr = memoize(function (css) { + + return "return " + replace((css || "").toLowerCase(), + // interpret `and` + /\band\b/g, "&&", + + // interpret `,` + /,/g, "||", + + // interpret `min-` as >= + /min-([a-z-\s]+):/g, "e.$1>=", + + // interpret `max-` as <= + /max-([a-z-\s]+):/g, "e.$1<=", + + //calc value + /calc([^)]+)/g, "($1)", + + // interpret css values + /(\d+[\.]*[\d]*)([a-z]+)/g, "($1 * e.$2)", + //make eval less evil + /^(?!(e.[a-z]|[0-9\.&=|><\+\-\*\(\)\/])).*/ig, "" + ) + ";"; + }); + + return function (css, length) { + var parsedLength; + if (!(css in cssCache)) { + cssCache[css] = false; + if (length && (parsedLength = css.match(regLength))) { + cssCache[css] = parsedLength[1] * units[parsedLength[2]]; + } else { + /*jshint evil:true */ + try { + cssCache[css] = new Function("e", buildStr(css))(units); + } catch (e) { + } + /*jshint evil:false */ + } + } + return cssCache[css]; + }; + })(); + + var setResolution = function (candidate, sizesattr) { + if (candidate.w) { // h = means height: || descriptor.type === 'h' do not handle yet... + candidate.cWidth = pf.calcListLength(sizesattr || "100vw"); + candidate.res = candidate.w / candidate.cWidth; + } else { + candidate.res = candidate.d; + } + return candidate; + }; + + /** + * + * @param opt + */ + var picturefill = function (opt) { + + if (!isSupportTestReady) { + return; } - /** - * If length is specified in `vw` units, use `%` instead since the div we’re measuring - * is injected at the top of the document. - * - * TODO: maybe we should put this behind a feature test for `vw`? The risk of doing this is possible browser inconsistancies with vw vs % - */ - length = length.replace( "vw", "%" ); + var elements, i, plen; - // Create a cached element for getting length value widths - if ( !pf.lengthEl ) { - pf.lengthEl = doc.createElement( "div" ); + var options = opt || {}; - // Positioning styles help prevent padding/margin/width on `html` or `body` from throwing calculations off. - pf.lengthEl.style.cssText = "border:0;display:block;font-size:1em;left:0;margin:0;padding:0;position:absolute;visibility:hidden"; + if (options.elements && options.elements.nodeType === 1) { + if (options.elements.nodeName.toUpperCase() === "IMG") { + options.elements = [options.elements]; + } else { + options.context = options.elements; + options.elements = null; + } + } - // Add a class, so that everyone knows where this element comes from - pf.lengthEl.className = "helper-from-picturefill-js"; - } + elements = options.elements || pf.qsa((options.context || document), ( options.reevaluate || options.reselect ) ? pf.sel : pf.selShort); - pf.lengthEl.style.width = "0px"; + if ((plen = elements.length)) { - try { - pf.lengthEl.style.width = length; - } catch ( e ) {} + pf.setupRun(options); + alreadyRun = true; - doc.body.appendChild(pf.lengthEl); + // Loop through all elements + for (i = 0; i < plen; i++) { + pf.fillImg(elements[i], options); + } - cssValue = pf.lengthEl.offsetWidth; + pf.teardownRun(options); + } + }; - if ( cssValue <= 0 ) { - cssValue = false; - } + /** + * outputs a warning for the developer + * @param {message} + * @type {Function} + */ + warn = ( window.console && console.warn ) ? + function (message) { + console.warn(message); + } : + noop + ; - doc.body.removeChild( pf.lengthEl ); + if (!(curSrcProp in image)) { + curSrcProp = "src"; + } - return cssValue; - }; + // Add support for standard mime types. + types["image/jpeg"] = true; + types["image/gif"] = true; + types["image/png"] = true; - pf.detectTypeSupport = function( type, typeUri ) { + function detectTypeSupport(type, typeUri) { // based on Modernizr's lossless img-webp test // note: asynchronous - var image = new w.Image(); - image.onerror = function() { - pf.types[ type ] = false; + var image = new window.Image(); + image.onerror = function () { + types[type] = false; picturefill(); }; - image.onload = function() { - pf.types[ type ] = image.width === 1; + image.onload = function () { + types[type] = image.width === 1; picturefill(); }; image.src = typeUri; - return "pending"; - }; - // container of supported mime types that one might need to qualify before using - pf.types = pf.types || {}; + } - pf.initTypeDetects = function() { - // Add support for standard mime types - pf.types[ "image/jpeg" ] = true; - pf.types[ "image/gif" ] = true; - pf.types[ "image/png" ] = true; - pf.types[ "image/svg+xml" ] = doc.implementation.hasFeature("http://www.w3.org/TR/SVG11/feature#Image", "1.1"); - pf.types[ "image/webp" ] = pf.detectTypeSupport("image/webp", "data:image/webp;base64,UklGRh4AAABXRUJQVlA4TBEAAAAvAAAAAAfQ//73v/+BiOh/AAA="); - }; + // test svg support + types["image/svg+xml"] = document.implementation.hasFeature("http://www.w3.org/TR/SVG11/feature#Image", "1.1"); - pf.verifyTypeSupport = function( source ) { - var type = source.getAttribute( "type" ); - // if type attribute exists, return test result, otherwise return true - if ( type === null || type === "" ) { - return true; - } else { - var pfType = pf.types[ type ]; - // if the type test is a function, run it and return "pending" status. The function will rerun picturefill on pending elements once finished. - if ( typeof pfType === "string" && pfType !== "pending") { - pf.types[ type ] = pf.detectTypeSupport( type, pfType ); - return "pending"; - } else if ( typeof pfType === "function" ) { - pfType(); - return "pending"; - } else { - return pfType; - } - } - }; + /** + * updates the internal vW property with the current viewport width in px + */ + function updateMetrics() { - // Parses an individual `size` and returns the length, and optional media query - pf.parseSize = function( sourceSizeStr ) { - var match = /(\([^)]+\))?\s*(.+)/g.exec( sourceSizeStr ); - return { - media: match && match[1], - length: match && match[2] - }; - }; + isVwDirty = false; + DPR = window.devicePixelRatio; + cssCache = {}; + sizeLengthCache = {}; - // Takes a string of sizes and returns the width in pixels as a number - pf.findWidthFromSourceSize = function( sourceSizeListStr ) { - // Split up source size list, ie ( max-width: 30em ) 100%, ( max-width: 50em ) 50%, 33% - // or (min-width:30em) calc(30% - 15px) - var sourceSizeList = pf.trim( sourceSizeListStr ).split( /\s*,\s*/ ), - winningLength; + pf.DPR = DPR || 1; - for ( var i = 0, len = sourceSizeList.length; i < len; i++ ) { - // Match ? length, ie ( min-width: 50em ) 100% - var sourceSize = sourceSizeList[ i ], - // Split "( min-width: 50em ) 100%" into separate strings - parsedSize = pf.parseSize( sourceSize ), - length = parsedSize.length, - media = parsedSize.media; + units.width = Math.max(window.innerWidth || 0, docElem.clientWidth); + units.height = Math.max(window.innerHeight || 0, docElem.clientHeight); - if ( !length ) { - continue; - } - // if there is no media query or it matches, choose this as our winning length - if ( (!media || pf.matchesMedia( media )) && - // pass the length to a method that can properly determine length - // in pixels based on these formats: http://dev.w3.org/csswg/css-values-3/#length-value - (winningLength = pf.getWidthFromLength( length )) ) { - break; - } - } + units.vw = units.width / 100; + units.vh = units.height / 100; - //if we have no winningLength fallback to 100vw - return winningLength || Math.max(w.innerWidth || 0, doc.documentElement.clientWidth); - }; + evalId = [units.height, units.width, DPR].join("-"); - pf.parseSrcset = function( srcset ) { - /** - * A lot of this was pulled from Boris Smus’ parser for the now-defunct WHATWG `srcset` - * https://github.com/borismus/srcset-polyfill/blob/master/js/srcset-info.js - * - * 1. Let input (`srcset`) be the value passed to this algorithm. - * 2. Let position be a pointer into input, initially pointing at the start of the string. - * 3. Let raw candidates be an initially empty ordered list of URLs with associated - * unparsed descriptors. The order of entries in the list is the order in which entries - * are added to the list. - */ - var candidates = []; + units.em = pf.getEmValue(); + units.rem = units.em; + } - while ( srcset !== "" ) { - srcset = srcset.replace( /^\s+/g, "" ); + function chooseLowRes(lowerValue, higherValue, dprValue, isCached) { + var bonusFactor, tooMuch, bonus, meanDensity; - // 5. Collect a sequence of characters that are not space characters, and let that be url. - var pos = srcset.search(/\s/g), - url, descriptor = null; + //experimental + if (cfg.algorithm === "saveData") { + if (lowerValue > 2.7) { + meanDensity = dprValue + 1; + } else { + tooMuch = higherValue - dprValue; + bonusFactor = Math.pow(lowerValue - 0.6, 1.5); - if ( pos !== -1 ) { - url = srcset.slice( 0, pos ); + bonus = tooMuch * bonusFactor; - var last = url.slice(-1); + if (isCached) { + bonus += 0.1 * bonusFactor; + } - // 6. If url ends with a U+002C COMMA character (,), remove that character from url - // and let descriptors be the empty string. Otherwise, follow these substeps - // 6.1. If url is empty, then jump to the step labeled descriptor parser. - - if ( last === "," || url === "" ) { - url = url.replace( /,+$/, "" ); - descriptor = ""; - } - srcset = srcset.slice( pos + 1 ); - - // 6.2. Collect a sequence of characters that are not U+002C COMMA characters (,), and - // let that be descriptors. - if ( descriptor === null ) { - var descpos = srcset.indexOf( "," ); - if ( descpos !== -1 ) { - descriptor = srcset.slice( 0, descpos ); - srcset = srcset.slice( descpos + 1 ); - } else { - descriptor = srcset; - srcset = ""; - } - } - } else { - url = srcset; - srcset = ""; - } - - // 7. Add url to raw candidates, associated with descriptors. - if ( url || descriptor ) { - candidates.push({ - url: url, - descriptor: descriptor - }); - } - } - return candidates; - }; - - pf.parseDescriptor = function( descriptor, sizesattr ) { - // 11. Descriptor parser: Let candidates be an initially empty source set. The order of entries in the list - // is the order in which entries are added to the list. - var sizes = sizesattr || "100vw", - sizeDescriptor = descriptor && descriptor.replace( /(^\s+|\s+$)/g, "" ), - widthInCssPixels = pf.findWidthFromSourceSize( sizes ), - resCandidate; - - if ( sizeDescriptor ) { - var splitDescriptor = sizeDescriptor.split(" "); - - for (var i = splitDescriptor.length - 1; i >= 0; i--) { - var curr = splitDescriptor[ i ], - lastchar = curr && curr.slice( curr.length - 1 ); - - if ( ( lastchar === "h" || lastchar === "w" ) && !pf.sizesSupported ) { - resCandidate = parseFloat( ( parseInt( curr, 10 ) / widthInCssPixels ) ); - } else if ( lastchar === "x" ) { - var res = curr && parseFloat( curr, 10 ); - resCandidate = res && !isNaN( res ) ? res : 1; - } - } - } - return resCandidate || 1; - }; - - /** - * Takes a srcset in the form of url/ - * ex. "images/pic-medium.png 1x, images/pic-medium-2x.png 2x" or - * "images/pic-medium.png 400w, images/pic-medium-2x.png 800w" or - * "images/pic-small.png" - * Get an array of image candidates in the form of - * {url: "/foo/bar.png", resolution: 1} - * where resolution is http://dev.w3.org/csswg/css-values-3/#resolution-value - * If sizes is specified, resolution is calculated - */ - pf.getCandidatesFromSourceSet = function( srcset, sizes ) { - var candidates = pf.parseSrcset( srcset ), - formattedCandidates = []; - - for ( var i = 0, len = candidates.length; i < len; i++ ) { - var candidate = candidates[ i ]; - - formattedCandidates.push({ - url: candidate.url, - resolution: pf.parseDescriptor( candidate.descriptor, sizes ) - }); - } - return formattedCandidates; - }; - - /** - * if it's an img element and it has a srcset property, - * we need to remove the attribute so we can manipulate src - * (the property's existence infers native srcset support, and a srcset-supporting browser will prioritize srcset's value over our winning picture candidate) - * this moves srcset's value to memory for later use and removes the attr - */ - pf.dodgeSrcset = function( img ) { - if ( img.srcset ) { - img[ pf.ns ].srcset = img.srcset; - img.srcset = ""; - img.setAttribute( "data-pfsrcset", img[ pf.ns ].srcset ); - } - }; - - // Accept a source or img element and process its srcset and sizes attrs - pf.processSourceSet = function( el ) { - var srcset = el.getAttribute( "srcset" ), - sizes = el.getAttribute( "sizes" ), - candidates = []; - - // if it's an img element, use the cached srcset property (defined or not) - if ( el.nodeName.toUpperCase() === "IMG" && el[ pf.ns ] && el[ pf.ns ].srcset ) { - srcset = el[ pf.ns ].srcset; - } - - if ( srcset ) { - candidates = pf.getCandidatesFromSourceSet( srcset, sizes ); - } - return candidates; - }; - - pf.backfaceVisibilityFix = function( picImg ) { - // See: https://github.com/scottjehl/picturefill/issues/332 - var style = picImg.style || {}, - WebkitBackfaceVisibility = "webkitBackfaceVisibility" in style, - currentZoom = style.zoom; - - if (WebkitBackfaceVisibility) { - style.zoom = ".999"; - - WebkitBackfaceVisibility = picImg.offsetWidth; - - style.zoom = currentZoom; - } - }; - - pf.setIntrinsicSize = (function() { - var urlCache = {}; - var setSize = function( picImg, width, res ) { - if ( width ) { - picImg.setAttribute( "width", parseInt(width / res, 10) ); + meanDensity = lowerValue + bonus; } - }; - return function( picImg, bestCandidate ) { - var img; - if ( !picImg[ pf.ns ] || w.pfStopIntrinsicSize ) { - return; - } - if ( picImg[ pf.ns ].dims === undefined ) { - picImg[ pf.ns].dims = picImg.getAttribute("width") || picImg.getAttribute("height"); - } - if ( picImg[ pf.ns].dims ) { return; } + } else { + meanDensity = (dprValue > 1) ? + Math.sqrt(lowerValue * higherValue) : + lowerValue; + } - if ( bestCandidate.url in urlCache ) { - setSize( picImg, urlCache[bestCandidate.url], bestCandidate.resolution ); - } else { - img = doc.createElement( "img" ); - img.onload = function() { - urlCache[bestCandidate.url] = img.width; + return meanDensity > dprValue; + } - //IE 10/11 don't calculate width for svg outside document - if ( !urlCache[bestCandidate.url] ) { - try { - doc.body.appendChild( img ); - urlCache[bestCandidate.url] = img.width || img.offsetWidth; - doc.body.removeChild( img ); - } catch(e){} + function applyBestCandidate(img) { + var srcSetCandidates; + var matchingSet = pf.getSet(img); + var evaluated = false; + if (matchingSet !== "pending") { + evaluated = evalId; + if (matchingSet) { + srcSetCandidates = pf.setRes(matchingSet); + pf.applySetCandidate(srcSetCandidates, img); + } + } + img[pf.ns].evaled = evaluated; + } + + function ascendingSort(a, b) { + return a.res - b.res; + } + + function setSrcToCur(img, src, set) { + var candidate; + if (!set && src) { + set = img[pf.ns].sets; + set = set && set[set.length - 1]; + } + + candidate = getCandidateForSrc(src, set); + + if (candidate) { + src = pf.makeUrl(src); + img[pf.ns].curSrc = src; + img[pf.ns].curCan = candidate; + + if (!candidate.res) { + setResolution(candidate, candidate.set.sizes); + } + } + return candidate; + } + + function getCandidateForSrc(src, set) { + var i, candidate, candidates; + if (src && set) { + candidates = pf.parseSet(set); + src = pf.makeUrl(src); + for (i = 0; i < candidates.length; i++) { + if (src === pf.makeUrl(candidates[i].url)) { + candidate = candidates[i]; + break; + } + } + } + return candidate; + } + + function getAllSourceElements(picture, candidates) { + var i, len, source, srcset; + + // SPEC mismatch intended for size and perf: + // actually only source elements preceding the img should be used + // also note: don't use qsa here, because IE8 sometimes doesn't like source as the key part in a selector + var sources = picture.getElementsByTagName("source"); + + for (i = 0, len = sources.length; i < len; i++) { + source = sources[i]; + source[pf.ns] = true; + srcset = source.getAttribute("srcset"); + + // if source does not have a srcset attribute, skip + if (srcset) { + candidates.push({ + srcset: srcset, + media: source.getAttribute("media"), + type: source.getAttribute("type"), + sizes: source.getAttribute("sizes") + }); + } + } + } + + /** + * Srcset Parser + * By Alex Bell | MIT License + * + * @returns Array [{url: _, d: _, w: _, h:_, set:_(????)}, ...] + * + * Based super duper closely on the reference algorithm at: + * https://html.spec.whatwg.org/multipage/embedded-content.html#parse-a-srcset-attribute + */ + + // 1. Let input be the value passed to this algorithm. + // (TO-DO : Explain what "set" argument is here. Maybe choose a more + // descriptive & more searchable name. Since passing the "set" in really has + // nothing to do with parsing proper, I would prefer this assignment eventually + // go in an external fn.) + function parseSrcset(input, set) { + + function collectCharacters(regEx) { + var chars, + match = regEx.exec(input.substring(pos)); + if (match) { + chars = match[0]; + pos += chars.length; + return chars; + } + } + + var inputLength = input.length, + url, + descriptors, + currentDescriptor, + state, + c, + + // 2. Let position be a pointer into input, initially pointing at the start + // of the string. + pos = 0, + + // 3. Let candidates be an initially empty source set. + candidates = []; + + /** + * Adds descriptor properties to a candidate, pushes to the candidates array + * @return undefined + */ + // (Declared outside of the while loop so that it's only created once. + // (This fn is defined before it is used, in order to pass JSHINT. + // Unfortunately this breaks the sequencing of the spec comments. :/ ) + function parseDescriptors() { + + // 9. Descriptor parser: Let error be no. + var pError = false, + + // 10. Let width be absent. + // 11. Let density be absent. + // 12. Let future-compat-h be absent. (We're implementing it now as h) + w, d, h, i, + candidate = {}, + desc, lastChar, value, intVal, floatVal; + + // 13. For each descriptor in descriptors, run the appropriate set of steps + // from the following list: + for (i = 0; i < descriptors.length; i++) { + desc = descriptors[i]; + + lastChar = desc[desc.length - 1]; + value = desc.substring(0, desc.length - 1); + intVal = parseInt(value, 10); + floatVal = parseFloat(value); + + // If the descriptor consists of a valid non-negative integer followed by + // a U+0077 LATIN SMALL LETTER W character + if (regexNonNegativeInteger.test(value) && (lastChar === "w")) { + + // If width and density are not both absent, then let error be yes. + if (w || d) { + pError = true; } - if ( picImg.src === bestCandidate.url ) { - setSize( picImg, urlCache[bestCandidate.url], bestCandidate.resolution ); - } - picImg = null; - img.onload = null; - img = null; - }; - img.src = bestCandidate.url; - } - }; - })(); + // Apply the rules for parsing non-negative integers to the descriptor. + // If the result is zero, let error be yes. + // Otherwise, let width be the result. + if (intVal === 0) { + pError = true; + } else { + w = intVal; + } - pf.applyBestCandidate = function( candidates, picImg ) { - var candidate, - length, - bestCandidate; + // If the descriptor consists of a valid floating-point number followed by + // a U+0078 LATIN SMALL LETTER X character + } else if (regexFloatingPoint.test(value) && (lastChar === "x")) { - candidates.sort( pf.ascendingSort ); + // If width, density and future-compat-h are not all absent, then let error + // be yes. + if (w || d || h) { + pError = true; + } - length = candidates.length; - bestCandidate = candidates[ length - 1 ]; + // Apply the rules for parsing floating-point number values to the descriptor. + // If the result is less than zero, let error be yes. Otherwise, let density + // be the result. + if (floatVal < 0) { + pError = true; + } else { + d = floatVal; + } - for ( var i = 0; i < length; i++ ) { - candidate = candidates[ i ]; - if ( candidate.resolution >= pf.getDpr() ) { - bestCandidate = candidate; - break; - } - } + // If the descriptor consists of a valid non-negative integer followed by + // a U+0068 LATIN SMALL LETTER H character + } else if (regexNonNegativeInteger.test(value) && (lastChar === "h")) { - if ( bestCandidate ) { + // If height and density are not both absent, then let error be yes. + if (h || d) { + pError = true; + } - bestCandidate.url = pf.makeUrl( bestCandidate.url ); + // Apply the rules for parsing non-negative integers to the descriptor. + // If the result is zero, let error be yes. Otherwise, let future-compat-h + // be the result. + if (intVal === 0) { + pError = true; + } else { + h = intVal; + } - if ( picImg.src !== bestCandidate.url ) { - if ( pf.restrictsMixedContent() && bestCandidate.url.substr(0, "http:".length).toLowerCase() === "http:" ) { - if ( window.console !== undefined ) { - console.warn( "Blocked mixed content image " + bestCandidate.url ); - } - } else { - picImg.src = bestCandidate.url; - // currentSrc attribute and property to match - // http://picture.responsiveimages.org/#the-img-element - picImg.currentSrc = picImg.src; + // Anything else, Let error be yes. + } else { + pError = true; + } + } // (close step 13 for loop) - pf.backfaceVisibilityFix( picImg ); - } - } + // 15. If error is still no, then append a new image source to candidates whose + // URL is url, associated with a width width if not absent and a pixel + // density density if not absent. Otherwise, there is a parse error. + if (!pError) { + candidate.url = url; - pf.setIntrinsicSize(picImg, bestCandidate); - } - }; + if (w) { + candidate.w = w; + } + if (d) { + candidate.d = d; + } + if (h) { + candidate.h = h; + } + if (!h && !d && !w) { + candidate.d = 1; + } + if (candidate.d === 1) { + set.has1x = true; + } + candidate.set = set; - pf.ascendingSort = function( a, b ) { - return a.resolution - b.resolution; - }; + candidates.push(candidate); + } + } // (close parseDescriptors fn) - /** - * In IE9, elements get removed if they aren't children of - * video elements. Thus, we conditionally wrap source elements - * using - * and must account for that here by moving those source elements - * back into the picture element. - */ - pf.removeVideoShim = function( picture ) { - var videos = picture.getElementsByTagName( "video" ); - if ( videos.length ) { - var video = videos[ 0 ], - vsources = video.getElementsByTagName( "source" ); - while ( vsources.length ) { - picture.insertBefore( vsources[ 0 ], video ); - } - // Remove the video element once we're finished removing its children - video.parentNode.removeChild( video ); - } - }; + /** + * Tokenizes descriptor properties prior to parsing + * Returns undefined. + * (Again, this fn is defined before it is used, in order to pass JSHINT. + * Unfortunately this breaks the logical sequencing of the spec comments. :/ ) + */ + function tokenize() { - /** - * Find all `img` elements, and add them to the candidate list if they have - * a `picture` parent, a `sizes` attribute in basic `srcset` supporting browsers, - * a `srcset` attribute at all, and they haven’t been evaluated already. - */ - pf.getAllElements = function() { - var elems = [], - imgs = doc.getElementsByTagName( "img" ); + // 8.1. Descriptor tokeniser: Skip whitespace + collectCharacters(regexLeadingSpaces); - for ( var h = 0, len = imgs.length; h < len; h++ ) { - var currImg = imgs[ h ]; + // 8.2. Let current descriptor be the empty string. + currentDescriptor = ""; - if ( currImg.parentNode.nodeName.toUpperCase() === "PICTURE" || - ( currImg.getAttribute( "srcset" ) !== null ) || currImg[ pf.ns ] && currImg[ pf.ns ].srcset !== null ) { - elems.push( currImg ); - } - } - return elems; - }; + // 8.3. Let state be in descriptor. + state = "in descriptor"; - pf.getMatch = function( img, picture ) { - var sources = picture.childNodes, - match; + while (true) { - // Go through each child, and if they have media queries, evaluate them - for ( var j = 0, slen = sources.length; j < slen; j++ ) { - var source = sources[ j ]; + // 8.4. Let c be the character at position. + c = input.charAt(pos); - // ignore non-element nodes - if ( source.nodeType !== 1 ) { - continue; - } + // Do the following depending on the value of state. + // For the purpose of this step, "EOF" is a special character representing + // that position is past the end of input. - // Hitting the `img` element that started everything stops the search for `sources`. - // If no previous `source` matches, the `img` itself is evaluated later. - if ( source === img ) { - return match; - } + // In descriptor + if (state === "in descriptor") { + // Do the following, depending on the value of c: - // ignore non-`source` nodes - if ( source.nodeName.toUpperCase() !== "SOURCE" ) { - continue; - } - // if it's a source element that has the `src` property set, throw a warning in the console - if ( source.getAttribute( "src" ) !== null && typeof console !== undefined ) { - console.warn("The `src` attribute is invalid on `picture` `source` element; instead, use `srcset`."); - } + // Space character + // If current descriptor is not empty, append current descriptor to + // descriptors and let current descriptor be the empty string. + // Set state to after descriptor. + if (isSpace(c)) { + if (currentDescriptor) { + descriptors.push(currentDescriptor); + currentDescriptor = ""; + state = "after descriptor"; + } - var media = source.getAttribute( "media" ); + // U+002C COMMA (,) + // Advance position to the next character in input. If current descriptor + // is not empty, append current descriptor to descriptors. Jump to the step + // labeled descriptor parser. + } else if (c === ",") { + pos += 1; + if (currentDescriptor) { + descriptors.push(currentDescriptor); + } + parseDescriptors(); + return; - // if source does not have a srcset attribute, skip - if ( !source.getAttribute( "srcset" ) ) { - continue; - } + // U+0028 LEFT PARENTHESIS (() + // Append c to current descriptor. Set state to in parens. + } else if (c === "\u0028") { + currentDescriptor = currentDescriptor + c; + state = "in parens"; - // if there's no media specified, OR w.matchMedia is supported - if ( ( !media || pf.matchesMedia( media ) ) ) { - var typeSupported = pf.verifyTypeSupport( source ); + // EOF + // If current descriptor is not empty, append current descriptor to + // descriptors. Jump to the step labeled descriptor parser. + } else if (c === "") { + if (currentDescriptor) { + descriptors.push(currentDescriptor); + } + parseDescriptors(); + return; - if ( typeSupported === true ) { - match = source; - break; - } else if ( typeSupported === "pending" ) { - return false; - } - } - } + // Anything else + // Append c to current descriptor. + } else { + currentDescriptor = currentDescriptor + c; + } + // (end "in descriptor" - return match; - }; + // In parens + } else if (state === "in parens") { - function picturefill( opt ) { - var elements, - element, - parent, - firstMatch, - candidates, - options = opt || {}; + // U+0029 RIGHT PARENTHESIS ()) + // Append c to current descriptor. Set state to in descriptor. + if (c === ")") { + currentDescriptor = currentDescriptor + c; + state = "in descriptor"; - elements = options.elements || pf.getAllElements(); + // EOF + // Append current descriptor to descriptors. Jump to the step labeled + // descriptor parser. + } else if (c === "") { + descriptors.push(currentDescriptor); + parseDescriptors(); + return; - // Loop through all elements - for ( var i = 0, plen = elements.length; i < plen; i++ ) { - element = elements[ i ]; - parent = element.parentNode; - firstMatch = undefined; - candidates = undefined; + // Anything else + // Append c to current descriptor. + } else { + currentDescriptor = currentDescriptor + c; + } - // immediately skip non-`img` nodes - if ( element.nodeName.toUpperCase() !== "IMG" ) { - continue; - } + // After descriptor + } else if (state === "after descriptor") { - // expando for caching data on the img - if ( !element[ pf.ns ] ) { - element[ pf.ns ] = {}; - } + // Do the following, depending on the value of c: + // Space character: Stay in this state. + if (isSpace(c)) { - // if the element has already been evaluated, skip it unless - // `options.reevaluate` is set to true ( this, for example, - // is set to true when running `picturefill` on `resize` ). - if ( !options.reevaluate && element[ pf.ns ].evaluated ) { - continue; - } + // EOF: Jump to the step labeled descriptor parser. + } else if (c === "") { + parseDescriptors(); + return; - // if `img` is in a `picture` element - if ( parent && parent.nodeName.toUpperCase() === "PICTURE" ) { + // Anything else + // Set state to in descriptor. Set position to the previous character in input. + } else { + state = "in descriptor"; + pos -= 1; - // IE9 video workaround - pf.removeVideoShim( parent ); + } + } - // return the first match which might undefined - // returns false if there is a pending source - // TODO the return type here is brutal, cleanup - firstMatch = pf.getMatch( element, parent ); + // Advance position to the next character in input. + pos += 1; - // if any sources are pending in this picture due to async type test(s) - // remove the evaluated attr and skip for now ( the pending test will - // rerun picturefill on this element when complete) - if ( firstMatch === false ) { - continue; - } - } else { - firstMatch = undefined; - } + // Repeat this step. + } // (close while true loop) + } - // Cache and remove `srcset` if present and we’re going to be doing `picture`/`srcset`/`sizes` polyfilling to it. - if ( ( parent && parent.nodeName.toUpperCase() === "PICTURE" ) || - ( !pf.sizesSupported && ( element.srcset && regWDesc.test( element.srcset ) ) ) ) { - pf.dodgeSrcset( element ); - } + // 4. Splitting loop: Collect a sequence of characters that are space + // characters or U+002C COMMA characters. If any U+002C COMMA characters + // were collected, that is a parse error. + while (true) { + collectCharacters(regexLeadingCommasOrSpaces); - if ( firstMatch ) { - candidates = pf.processSourceSet( firstMatch ); - pf.applyBestCandidate( candidates, element ); - } else { - // No sources matched, so we’re down to processing the inner `img` as a source. - candidates = pf.processSourceSet( element ); + // 5. If position is past the end of input, return candidates and abort these steps. + if (pos >= inputLength) { + return candidates; // (we're done, this is the sole return path) + } - if ( element.srcset === undefined || element[ pf.ns ].srcset ) { - // Either `srcset` is completely unsupported, or we need to polyfill `sizes` functionality. - pf.applyBestCandidate( candidates, element ); - } // Else, resolution-only `srcset` is supported natively. - } + // 6. Collect a sequence of characters that are not space characters, + // and let that be url. + url = collectCharacters(regexLeadingNotSpaces); - // set evaluated to true to avoid unnecessary reparsing - element[ pf.ns ].evaluated = true; - } - } + // 7. Let descriptors be a new empty list. + descriptors = []; - /** - * Sets up picture polyfill by polling the document and running - * the polyfill every 250ms until the document is ready. - * Also attaches picturefill on resize - */ - function runPicturefill() { - pf.initTypeDetects(); - picturefill(); - var intervalId = setInterval( function() { - // When the document has finished loading, stop checking for new images - // https://github.com/ded/domready/blob/master/ready.js#L15 - picturefill(); + // 8. If url ends with a U+002C COMMA character (,), follow these substeps: + // (1). Remove all trailing U+002C COMMA characters from url. If this removed + // more than one character, that is a parse error. + if (url.slice(-1) === ",") { + url = url.replace(regexTrailingCommas, ""); + // (Jump ahead to step 9 to skip tokenization and just push the candidate). + parseDescriptors(); - if ( /^loaded|^i|^c/.test( doc.readyState ) ) { - clearInterval( intervalId ); - return; - } - }, 250 ); + // Otherwise, follow these substeps: + } else { + tokenize(); + } // (close else of step 8) - function checkResize() { - var resizeThrottle; + // 16. Return to the step labeled splitting loop. + } // (Close of big while loop.) + } - if ( !w._picturefillWorking ) { - w._picturefillWorking = true; - w.clearTimeout( resizeThrottle ); - resizeThrottle = w.setTimeout( function() { - picturefill({ reevaluate: true }); - w._picturefillWorking = false; - }, 60 ); - } - } + /* + * Sizes Parser + * + * By Alex Bell | MIT License + * + * Non-strict but accurate and lightweight JS Parser for the string value + * + * Reference algorithm at: + * https://html.spec.whatwg.org/multipage/embedded-content.html#parse-a-sizes-attribute + * + * Most comments are copied in directly from the spec + * (except for comments in parens). + * + * Grammar is: + * = # [ , ]? | + * = + * = + * http://www.w3.org/html/wg/drafts/html/master/embedded-content.html#attr-img-sizes + * + * E.g. "(max-width: 30em) 100vw, (max-width: 50em) 70vw, 100vw" + * or "(min-width: 30em), calc(30vw - 15px)" or just "30vw" + * + * Returns the first valid with a media condition that evaluates to true, + * or "100vw" if all valid media conditions evaluate to false. + * + */ - if ( w.addEventListener ) { - w.addEventListener( "resize", checkResize, false ); - } else if ( w.attachEvent ) { - w.attachEvent( "onresize", checkResize ); - } - } + function parseSizes(strValue) { - runPicturefill(); + // (Percentage CSS lengths are not allowed in this case, to avoid confusion: + // https://html.spec.whatwg.org/multipage/embedded-content.html#valid-source-size-list + // CSS allows a single optional plus or minus sign: + // http://www.w3.org/TR/CSS2/syndata.html#numbers + // CSS is ASCII case-insensitive: + // http://www.w3.org/TR/CSS2/syndata.html#characters ) + // Spec allows exponential notation for type: + // http://dev.w3.org/csswg/css-values/#numbers + var regexCssLengthWithUnits = /^(?:[+-]?[0-9]+|[0-9]*\.[0-9]+)(?:[eE][+-]?[0-9]+)?(?:ch|cm|em|ex|in|mm|pc|pt|px|rem|vh|vmin|vmax|vw)$/i; - /* expose methods for testing */ - picturefill._ = pf; + // (This is a quick and lenient test. Because of optional unlimited-depth internal + // grouping parens and strict spacing rules, this could get very complicated.) + var regexCssCalc = /^calc\((?:[0-9a-z \.\+\-\*\/\(\)]+)\)$/i; - expose( picturefill ); + var i; + var unparsedSizesList; + var unparsedSizesListLength; + var unparsedSize; + var lastComponentValue; + var size; -} )( window, window.document, new window.Image() ); + // UTILITY FUNCTIONS + + // (Toy CSS parser. The goals here are: + // 1) expansive test coverage without the weight of a full CSS parser. + // 2) Avoiding regex wherever convenient. + // Quick tests: http://jsfiddle.net/gtntL4gr/3/ + // Returns an array of arrays.) + function parseComponentValues(str) { + var chrctr; + var component = ""; + var componentArray = []; + var listArray = []; + var parenDepth = 0; + var pos = 0; + var inComment = false; + + function pushComponent() { + if (component) { + componentArray.push(component); + component = ""; + } + } + + function pushComponentArray() { + if (componentArray[0]) { + listArray.push(componentArray); + componentArray = []; + } + } + + // (Loop forwards from the beginning of the string.) + while (true) { + chrctr = str.charAt(pos); + + if (chrctr === "") { // ( End of string reached.) + pushComponent(); + pushComponentArray(); + return listArray; + } else if (inComment) { + if ((chrctr === "*") && (str[pos + 1] === "/")) { // (At end of a comment.) + inComment = false; + pos += 2; + pushComponent(); + continue; + } else { + pos += 1; // (Skip all characters inside comments.) + continue; + } + } else if (isSpace(chrctr)) { + // (If previous character in loop was also a space, or if + // at the beginning of the string, do not add space char to + // component.) + if ((str.charAt(pos - 1) && isSpace(str.charAt(pos - 1)) ) || !component) { + pos += 1; + continue; + } else if (parenDepth === 0) { + pushComponent(); + pos += 1; + continue; + } else { + // (Replace any space character with a plain space for legibility.) + chrctr = " "; + } + } else if (chrctr === "(") { + parenDepth += 1; + } else if (chrctr === ")") { + parenDepth -= 1; + } else if (chrctr === ",") { + pushComponent(); + pushComponentArray(); + pos += 1; + continue; + } else if ((chrctr === "/") && (str.charAt(pos + 1) === "*")) { + inComment = true; + pos += 2; + continue; + } + + component = component + chrctr; + pos += 1; + } + } + + function isValidNonNegativeSourceSizeValue(s) { + if (regexCssLengthWithUnits.test(s) && (parseFloat(s) >= 0)) { + return true; + } + if (regexCssCalc.test(s)) { + return true; + } + // ( http://www.w3.org/TR/CSS2/syndata.html#numbers says: + // "-0 is equivalent to 0 and is not a negative number." which means that + // unitless zero and unitless negative zero must be accepted as special cases.) + if ((s === "0") || (s === "-0") || (s === "+0")) { + return true; + } + return false; + } + + // When asked to parse a sizes attribute from an element, parse a + // comma-separated list of component values from the value of the element's + // sizes attribute (or the empty string, if the attribute is absent), and let + // unparsed sizes list be the result. + // http://dev.w3.org/csswg/css-syntax/#parse-comma-separated-list-of-component-values + + unparsedSizesList = parseComponentValues(strValue); + unparsedSizesListLength = unparsedSizesList.length; + + // For each unparsed size in unparsed sizes list: + for (i = 0; i < unparsedSizesListLength; i++) { + unparsedSize = unparsedSizesList[i]; + + // 1. Remove all consecutive s from the end of unparsed size. + // ( parseComponentValues() already omits spaces outside of parens. ) + + // If unparsed size is now empty, that is a parse error; continue to the next + // iteration of this algorithm. + // ( parseComponentValues() won't push an empty array. ) + + // 2. If the last component value in unparsed size is a valid non-negative + // , let size be its value and remove the component value + // from unparsed size. Any CSS function other than the calc() function is + // invalid. Otherwise, there is a parse error; continue to the next iteration + // of this algorithm. + // http://dev.w3.org/csswg/css-syntax/#parse-component-value + lastComponentValue = unparsedSize[unparsedSize.length - 1]; + + if (isValidNonNegativeSourceSizeValue(lastComponentValue)) { + size = lastComponentValue; + unparsedSize.pop(); + } else { + continue; + } + + // 3. Remove all consecutive s from the end of unparsed + // size. If unparsed size is now empty, return size and exit this algorithm. + // If this was not the last item in unparsed sizes list, that is a parse error. + if (unparsedSize.length === 0) { + return size; + } + + // 4. Parse the remaining component values in unparsed size as a + // . If it does not parse correctly, or it does parse + // correctly but the evaluates to false, continue to the + // next iteration of this algorithm. + // (Parsing all possible compound media conditions in JS is heavy, complicated, + // and the payoff is unclear. Is there ever an situation where the + // media condition parses incorrectly but still somehow evaluates to true? + // Can we just rely on the browser/polyfill to do it?) + unparsedSize = unparsedSize.join(" "); + if (!(pf.matchesMedia(unparsedSize) )) { + continue; + } + + // 5. Return size and exit this algorithm. + return size; + } + + // If the above algorithm exhausts unparsed sizes list without returning a + // size value, return 100vw. + return "100vw"; + } + + // namespace + pf.ns = ("pf" + new Date().getTime()).substr(0, 9); + + // srcset support test + pf.supSrcset = "srcset" in image; + pf.supSizes = "sizes" in image; + pf.supPicture = !!window.HTMLPictureElement; + + // UC browser does claim to support srcset and picture, but not sizes, + // this extended test reveals the browser does support nothing + if (pf.supSrcset && pf.supPicture && !pf.supSizes) { + (function (image2) { + image.srcset = "data:,a"; + image2.src = "data:,a"; + pf.supSrcset = image.complete === image2.complete; + pf.supPicture = pf.supSrcset && pf.supPicture; + })(document.createElement("img")); + } + + // Safari9 has basic support for sizes, but does't expose the `sizes` idl attribute + if (pf.supSrcset && !pf.supSizes) { + + (function () { + var width2 = "data:image/gif;base64,R0lGODlhAgABAPAAAP///wAAACH5BAAAAAAALAAAAAACAAEAAAICBAoAOw=="; + var width1 = "data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw=="; + var img = document.createElement("img"); + var test = function () { + var width = img.width; + + if (width === 2) { + pf.supSizes = true; + } + + alwaysCheckWDescriptor = pf.supSrcset && !pf.supSizes; + + isSupportTestReady = true; + // force async + setTimeout(picturefill); + }; + + img.onload = test; + img.onerror = test; + img.setAttribute("sizes", "9px"); + + img.srcset = width1 + " 1w," + width2 + " 9w"; + img.src = width1; + })(); + + } else { + isSupportTestReady = true; + } + + // using pf.qsa instead of dom traversing does scale much better, + // especially on sites mixing responsive and non-responsive images + pf.selShort = "picture>img,img[srcset]"; + pf.sel = pf.selShort; + pf.cfg = cfg; + + /** + * Shortcut property for `devicePixelRatio` ( for easy overriding in tests ) + */ + pf.DPR = (DPR || 1 ); + pf.u = units; + + // container of supported mime types that one might need to qualify before using + pf.types = types; + + pf.setSize = noop; + + /** + * Gets a string and returns the absolute URL + * @param src + * @returns {String} absolute URL + */ + + pf.makeUrl = memoize(function (src) { + anchor.href = src; + return anchor.href; + }); + + /** + * Gets a DOM element or document and a selctor and returns the found matches + * Can be extended with jQuery/Sizzle for IE7 support + * @param context + * @param sel + * @returns {NodeList|Array} + */ + pf.qsa = function (context, sel) { + return ( "querySelector" in context ) ? context.querySelectorAll(sel) : []; + }; + + /** + * Shortcut method for matchMedia ( for easy overriding in tests ) + * wether native or pf.mMQ is used will be decided lazy on first call + * @returns {boolean} + */ + pf.matchesMedia = function () { + if (window.matchMedia && (matchMedia("(min-width: 0.1em)") || {}).matches) { + pf.matchesMedia = function (media) { + return !media || ( matchMedia(media).matches ); + }; + } else { + pf.matchesMedia = pf.mMQ; + } + + return pf.matchesMedia.apply(this, arguments); + }; + + /** + * A simplified matchMedia implementation for IE8 and IE9 + * handles only min-width/max-width with px or em values + * @param media + * @returns {boolean} + */ + pf.mMQ = function (media) { + return media ? evalCSS(media) : true; + }; + + /** + * Returns the calculated length in css pixel from the given sourceSizeValue + * http://dev.w3.org/csswg/css-values-3/#length-value + * intended Spec mismatches: + * * Does not check for invalid use of CSS functions + * * Does handle a computed length of 0 the same as a negative and therefore invalid value + * @param sourceSizeValue + * @returns {Number} + */ + pf.calcLength = function (sourceSizeValue) { + + var value = evalCSS(sourceSizeValue, true) || false; + if (value < 0) { + value = false; + } + + return value; + }; + + /** + * Takes a type string and checks if its supported + */ + + pf.supportsType = function (type) { + return ( type ) ? types[type] : true; + }; + + /** + * Parses a sourceSize into mediaCondition (media) and sourceSizeValue (length) + * @param sourceSizeStr + * @returns {*} + */ + pf.parseSize = memoize(function (sourceSizeStr) { + var match = ( sourceSizeStr || "" ).match(regSize); + return { + media: match && match[1], + length: match && match[2] + }; + }); + + pf.parseSet = function (set) { + if (!set.cands) { + set.cands = parseSrcset(set.srcset, set); + } + return set.cands; + }; + + /** + * returns 1em in css px for html/body default size + * function taken from respondjs + * @returns {*|number} + */ + pf.getEmValue = function () { + var body; + if (!eminpx && (body = document.body)) { + var div = document.createElement("div"), + originalHTMLCSS = docElem.style.cssText, + originalBodyCSS = body.style.cssText; + + div.style.cssText = baseStyle; + + // 1em in a media query is the value of the default font size of the browser + // reset docElem and body to ensure the correct value is returned + docElem.style.cssText = fsCss; + body.style.cssText = fsCss; + + body.appendChild(div); + eminpx = div.offsetWidth; + body.removeChild(div); + + //also update eminpx before returning + eminpx = parseFloat(eminpx, 10); + + // restore the original values + docElem.style.cssText = originalHTMLCSS; + body.style.cssText = originalBodyCSS; + + } + return eminpx || 16; + }; + + /** + * Takes a string of sizes and returns the width in pixels as a number + */ + pf.calcListLength = function (sourceSizeListStr) { + // Split up source size list, ie ( max-width: 30em ) 100%, ( max-width: 50em ) 50%, 33% + // + // or (min-width:30em) calc(30% - 15px) + if (!(sourceSizeListStr in sizeLengthCache) || cfg.uT) { + var winningLength = pf.calcLength(parseSizes(sourceSizeListStr)); + + sizeLengthCache[sourceSizeListStr] = !winningLength ? units.width : winningLength; + } + + return sizeLengthCache[sourceSizeListStr]; + }; + + /** + * Takes a candidate object with a srcset property in the form of url/ + * ex. "images/pic-medium.png 1x, images/pic-medium-2x.png 2x" or + * "images/pic-medium.png 400w, images/pic-medium-2x.png 800w" or + * "images/pic-small.png" + * Get an array of image candidates in the form of + * {url: "/foo/bar.png", resolution: 1} + * where resolution is http://dev.w3.org/csswg/css-values-3/#resolution-value + * If sizes is specified, res is calculated + */ + pf.setRes = function (set) { + var candidates; + if (set) { + + candidates = pf.parseSet(set); + + for (var i = 0, len = candidates.length; i < len; i++) { + setResolution(candidates[i], set.sizes); + } + } + return candidates; + }; + + pf.setRes.res = setResolution; + + pf.applySetCandidate = function (candidates, img) { + if (!candidates.length) { + return; + } + var candidate, + i, + j, + length, + bestCandidate, + curSrc, + curCan, + candidateSrc, + abortCurSrc; + + var imageData = img[pf.ns]; + var dpr = pf.DPR; + + curSrc = imageData.curSrc || img[curSrcProp]; + + curCan = imageData.curCan || setSrcToCur(img, curSrc, candidates[0].set); + + // if we have a current source, we might either become lazy or give this source some advantage + if (curCan && curCan.set === candidates[0].set) { + + // if browser can abort image request and the image has a higher pixel density than needed + // and this image isn't downloaded yet, we skip next part and try to save bandwidth + abortCurSrc = (supportAbort && !img.complete && curCan.res - 0.1 > dpr); + + if (!abortCurSrc) { + curCan.cached = true; + + // if current candidate is "best", "better" or "okay", + // set it to bestCandidate + if (curCan.res >= dpr) { + bestCandidate = curCan; + } + } + } + + if (!bestCandidate) { + + candidates.sort(ascendingSort); + + length = candidates.length; + bestCandidate = candidates[length - 1]; + + for (i = 0; i < length; i++) { + candidate = candidates[i]; + if (candidate.res >= dpr) { + j = i - 1; + + // we have found the perfect candidate, + // but let's improve this a little bit with some assumptions ;-) + if (candidates[j] && + (abortCurSrc || curSrc !== pf.makeUrl(candidate.url)) && + chooseLowRes(candidates[j].res, candidate.res, dpr, candidates[j].cached)) { + + bestCandidate = candidates[j]; + + } else { + bestCandidate = candidate; + } + break; + } + } + } + + if (bestCandidate) { + + candidateSrc = pf.makeUrl(bestCandidate.url); + + imageData.curSrc = candidateSrc; + imageData.curCan = bestCandidate; + + if (candidateSrc !== curSrc) { + pf.setSrc(img, bestCandidate); + } + pf.setSize(img); + } + }; + + pf.setSrc = function (img, bestCandidate) { + var origWidth; + img.src = bestCandidate.url; + + // although this is a specific Safari issue, we don't want to take too much different code paths + if (bestCandidate.set.type === "image/svg+xml") { + origWidth = img.style.width; + img.style.width = (img.offsetWidth + 1) + "px"; + + // next line only should trigger a repaint + // if... is only done to trick dead code removal + if (img.offsetWidth + 1) { + img.style.width = origWidth; + } + } + }; + + pf.getSet = function (img) { + var i, set, supportsType; + var match = false; + var sets = img [pf.ns].sets; + + for (i = 0; i < sets.length && !match; i++) { + set = sets[i]; + + if (!set.srcset || !pf.matchesMedia(set.media) || !(supportsType = pf.supportsType(set.type))) { + continue; + } + + if (supportsType === "pending") { + set = supportsType; + } + + match = set; + break; + } + + return match; + }; + + pf.parseSets = function (element, parent, options) { + var srcsetAttribute, imageSet, isWDescripor, srcsetParsed; + + var hasPicture = parent && parent.nodeName.toUpperCase() === "PICTURE"; + var imageData = element[pf.ns]; + + if (imageData.src === undefined || options.src) { + imageData.src = getImgAttr.call(element, "src"); + if (imageData.src) { + setImgAttr.call(element, srcAttr, imageData.src); + } else { + removeImgAttr.call(element, srcAttr); + } + } + + if (imageData.srcset === undefined || options.srcset || !pf.supSrcset || element.srcset) { + srcsetAttribute = getImgAttr.call(element, "srcset"); + imageData.srcset = srcsetAttribute; + srcsetParsed = true; + } + + imageData.sets = []; + + if (hasPicture) { + imageData.pic = true; + getAllSourceElements(parent, imageData.sets); + } + + if (imageData.srcset) { + imageSet = { + srcset: imageData.srcset, + sizes: getImgAttr.call(element, "sizes") + }; + + imageData.sets.push(imageSet); + + isWDescripor = (alwaysCheckWDescriptor || imageData.src) && regWDesc.test(imageData.srcset || ""); + + // add normal src as candidate, if source has no w descriptor + if (!isWDescripor && imageData.src && !getCandidateForSrc(imageData.src, imageSet) && !imageSet.has1x) { + imageSet.srcset += ", " + imageData.src; + imageSet.cands.push({ + url: imageData.src, + d: 1, + set: imageSet + }); + } + + } else if (imageData.src) { + imageData.sets.push({ + srcset: imageData.src, + sizes: null + }); + } + + imageData.curCan = null; + imageData.curSrc = undefined; + + // if img has picture or the srcset was removed or has a srcset and does not support srcset at all + // or has a w descriptor (and does not support sizes) set support to false to evaluate + imageData.supported = !( hasPicture || ( imageSet && !pf.supSrcset ) || (isWDescripor && !pf.supSizes) ); + + if (srcsetParsed && pf.supSrcset && !imageData.supported) { + if (srcsetAttribute) { + setImgAttr.call(element, srcsetAttr, srcsetAttribute); + element.srcset = ""; + } else { + removeImgAttr.call(element, srcsetAttr); + } + } + + if (imageData.supported && !imageData.srcset && ((!imageData.src && element.src) || element.src !== pf.makeUrl(imageData.src))) { + if (imageData.src === null) { + element.removeAttribute("src"); + } else { + element.src = imageData.src; + } + } + + imageData.parsed = true; + }; + + pf.fillImg = function (element, options) { + var imageData; + var extreme = options.reselect || options.reevaluate; + + // expando for caching data on the img + if (!element[pf.ns]) { + element[pf.ns] = {}; + } + + imageData = element[pf.ns]; + + // if the element has already been evaluated, skip it + // unless `options.reevaluate` is set to true ( this, for example, + // is set to true when running `picturefill` on `resize` ). + if (!extreme && imageData.evaled === evalId) { + return; + } + + if (!imageData.parsed || options.reevaluate) { + pf.parseSets(element, element.parentNode, options); + } + + if (!imageData.supported) { + applyBestCandidate(element); + } else { + imageData.evaled = evalId; + } + }; + + pf.setupRun = function () { + if (!alreadyRun || isVwDirty || (DPR !== window.devicePixelRatio)) { + updateMetrics(); + } + }; + + // If picture is supported, well, that's awesome. + if (pf.supPicture) { + picturefill = noop; + pf.fillImg = noop; + } else { + + // Set up picture polyfill by polling the document + (function () { + var isDomReady; + var regReady = window.attachEvent ? /d$|^c/ : /d$|^c|^i/; + + var run = function () { + var readyState = document.readyState || ""; + + timerId = setTimeout(run, readyState === "loading" ? 200 : 999); + if (document.body) { + pf.fillImgs(); + isDomReady = isDomReady || regReady.test(readyState); + if (isDomReady) { + clearTimeout(timerId); + } + + } + }; + + var timerId = setTimeout(run, document.body ? 9 : 99); + + // Also attach picturefill on resize and readystatechange + // http://modernjavascript.blogspot.com/2013/08/building-better-debounce.html + var debounce = function (func, wait) { + var timeout, timestamp; + var later = function () { + var last = (new Date()) - timestamp; + + if (last < wait) { + timeout = setTimeout(later, wait - last); + } else { + timeout = null; + func(); + } + }; + + return function () { + timestamp = new Date(); + + if (!timeout) { + timeout = setTimeout(later, wait); + } + }; + }; + var lastClientWidth = docElem.clientHeight; + var onResize = function () { + isVwDirty = Math.max(window.innerWidth || 0, docElem.clientWidth) !== units.width || docElem.clientHeight !== lastClientWidth; + lastClientWidth = docElem.clientHeight; + if (isVwDirty) { + pf.fillImgs(); + } + }; + + on(window, "resize", debounce(onResize, 99)); + on(document, "readystatechange", run); + })(); + } + + pf.picturefill = picturefill; + //use this internally for easy monkey patching/performance testing + pf.fillImgs = picturefill; + pf.teardownRun = noop; + + /* expose methods for testing */ + picturefill._ = pf; + + window.picturefillCFG = { + pf: pf, + push: function (args) { + var name = args.shift(); + if (typeof pf[name] === "function") { + pf[name].apply(pf, args); + } else { + cfg[name] = args[0]; + if (alreadyRun) { + pf.fillImgs({reselect: true}); + } + } + } + }; + + while (setOptions && setOptions.length) { + window.picturefillCFG.push(setOptions.shift()); + } + + /* expose picturefill */ + window.picturefill = picturefill; + + /* expose picturefill */ + if (typeof module === "object" && typeof module.exports === "object") { + // CommonJS, just export + module.exports = picturefill; + } else if (typeof define === "function" && define.amd) { + // AMD support + define("picturefill", function () { + return picturefill; + }); + } + + // IE8 evals this sync, so it must be the last thing we do + if (!pf.supPicture) { + types["image/webp"] = detectTypeSupport("image/webp", "data:image/webp;base64,UklGRkoAAABXRUJQVlA4WAoAAAAQAAAAAAAAAAAAQUxQSAwAAAABBxAR/Q9ERP8DAABWUDggGAAAADABAJ0BKgEAAQADADQlpAADcAD++/1QAA=="); + } + +})(window, document); /*! jQuery v2.2.0 | (c) jQuery Foundation | jquery.org/license */ !function(a,b){"object"==typeof module&&"object"==typeof module.exports?module.exports=a.document?b(a,!0):function(a){if(!a.document)throw new Error("jQuery requires a window with a document");return b(a)}:b(a)}("undefined"!=typeof window?window:this,function(a,b){var c=[],d=a.document,e=c.slice,f=c.concat,g=c.push,h=c.indexOf,i={},j=i.toString,k=i.hasOwnProperty,l={},m="2.2.0",n=function(a,b){return new n.fn.init(a,b)},o=/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,p=/^-ms-/,q=/-([\da-z])/gi,r=function(a,b){return b.toUpperCase()};n.fn=n.prototype={jquery:m,constructor:n,selector:"",length:0,toArray:function(){return e.call(this)},get:function(a){return null!=a?0>a?this[a+this.length]:this[a]:e.call(this)},pushStack:function(a){var b=n.merge(this.constructor(),a);return b.prevObject=this,b.context=this.context,b},each:function(a){return n.each(this,a)},map:function(a){return this.pushStack(n.map(this,function(b,c){return a.call(b,c,b)}))},slice:function(){return this.pushStack(e.apply(this,arguments))},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},eq:function(a){var b=this.length,c=+a+(0>a?b:0);return this.pushStack(c>=0&&b>c?[this[c]]:[])},end:function(){return this.prevObject||this.constructor()},push:g,sort:c.sort,splice:c.splice},n.extend=n.fn.extend=function(){var a,b,c,d,e,f,g=arguments[0]||{},h=1,i=arguments.length,j=!1;for("boolean"==typeof g&&(j=g,g=arguments[h]||{},h++),"object"==typeof g||n.isFunction(g)||(g={}),h===i&&(g=this,h--);i>h;h++)if(null!=(a=arguments[h]))for(b in a)c=g[b],d=a[b],g!==d&&(j&&d&&(n.isPlainObject(d)||(e=n.isArray(d)))?(e?(e=!1,f=c&&n.isArray(c)?c:[]):f=c&&n.isPlainObject(c)?c:{},g[b]=n.extend(j,f,d)):void 0!==d&&(g[b]=d));return g},n.extend({expando:"jQuery"+(m+Math.random()).replace(/\D/g,""),isReady:!0,error:function(a){throw new Error(a)},noop:function(){},isFunction:function(a){return"function"===n.type(a)},isArray:Array.isArray,isWindow:function(a){return null!=a&&a===a.window},isNumeric:function(a){var b=a&&a.toString();return!n.isArray(a)&&b-parseFloat(b)+1>=0},isPlainObject:function(a){return"object"!==n.type(a)||a.nodeType||n.isWindow(a)?!1:a.constructor&&!k.call(a.constructor.prototype,"isPrototypeOf")?!1:!0},isEmptyObject:function(a){var b;for(b in a)return!1;return!0},type:function(a){return null==a?a+"":"object"==typeof a||"function"==typeof a?i[j.call(a)]||"object":typeof a},globalEval:function(a){var b,c=eval;a=n.trim(a),a&&(1===a.indexOf("use strict")?(b=d.createElement("script"),b.text=a,d.head.appendChild(b).parentNode.removeChild(b)):c(a))},camelCase:function(a){return a.replace(p,"ms-").replace(q,r)},nodeName:function(a,b){return a.nodeName&&a.nodeName.toLowerCase()===b.toLowerCase()},each:function(a,b){var c,d=0;if(s(a)){for(c=a.length;c>d;d++)if(b.call(a[d],d,a[d])===!1)break}else for(d in a)if(b.call(a[d],d,a[d])===!1)break;return a},trim:function(a){return null==a?"":(a+"").replace(o,"")},makeArray:function(a,b){var c=b||[];return null!=a&&(s(Object(a))?n.merge(c,"string"==typeof a?[a]:a):g.call(c,a)),c},inArray:function(a,b,c){return null==b?-1:h.call(b,a,c)},merge:function(a,b){for(var c=+b.length,d=0,e=a.length;c>d;d++)a[e++]=b[d];return a.length=e,a},grep:function(a,b,c){for(var d,e=[],f=0,g=a.length,h=!c;g>f;f++)d=!b(a[f],f),d!==h&&e.push(a[f]);return e},map:function(a,b,c){var d,e,g=0,h=[];if(s(a))for(d=a.length;d>g;g++)e=b(a[g],g,c),null!=e&&h.push(e);else for(g in a)e=b(a[g],g,c),null!=e&&h.push(e);return f.apply([],h)},guid:1,proxy:function(a,b){var c,d,f;return"string"==typeof b&&(c=a[b],b=a,a=c),n.isFunction(a)?(d=e.call(arguments,2),f=function(){return a.apply(b||this,d.concat(e.call(arguments)))},f.guid=a.guid=a.guid||n.guid++,f):void 0},now:Date.now,support:l}),"function"==typeof Symbol&&(n.fn[Symbol.iterator]=c[Symbol.iterator]),n.each("Boolean Number String Function Array Date RegExp Object Error Symbol".split(" "),function(a,b){i["[object "+b+"]"]=b.toLowerCase()});function s(a){var b=!!a&&"length"in a&&a.length,c=n.type(a);return"function"===c||n.isWindow(a)?!1:"array"===c||0===b||"number"==typeof b&&b>0&&b-1 in a}var t=function(a){var b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u="sizzle"+1*new Date,v=a.document,w=0,x=0,y=ga(),z=ga(),A=ga(),B=function(a,b){return a===b&&(l=!0),0},C=1<<31,D={}.hasOwnProperty,E=[],F=E.pop,G=E.push,H=E.push,I=E.slice,J=function(a,b){for(var c=0,d=a.length;d>c;c++)if(a[c]===b)return c;return-1},K="checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped",L="[\\x20\\t\\r\\n\\f]",M="(?:\\\\.|[\\w-]|[^\\x00-\\xa0])+",N="\\["+L+"*("+M+")(?:"+L+"*([*^$|!~]?=)"+L+"*(?:'((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\"|("+M+"))|)"+L+"*\\]",O=":("+M+")(?:\\((('((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\")|((?:\\\\.|[^\\\\()[\\]]|"+N+")*)|.*)\\)|)",P=new RegExp(L+"+","g"),Q=new RegExp("^"+L+"+|((?:^|[^\\\\])(?:\\\\.)*)"+L+"+$","g"),R=new RegExp("^"+L+"*,"+L+"*"),S=new RegExp("^"+L+"*([>+~]|"+L+")"+L+"*"),T=new RegExp("="+L+"*([^\\]'\"]*?)"+L+"*\\]","g"),U=new RegExp(O),V=new RegExp("^"+M+"$"),W={ID:new RegExp("^#("+M+")"),CLASS:new RegExp("^\\.("+M+")"),TAG:new RegExp("^("+M+"|[*])"),ATTR:new RegExp("^"+N),PSEUDO:new RegExp("^"+O),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+L+"*(even|odd|(([+-]|)(\\d*)n|)"+L+"*(?:([+-]|)"+L+"*(\\d+)|))"+L+"*\\)|)","i"),bool:new RegExp("^(?:"+K+")$","i"),needsContext:new RegExp("^"+L+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+L+"*((?:-\\d)?\\d*)"+L+"*\\)|)(?=[^-]|$)","i")},X=/^(?:input|select|textarea|button)$/i,Y=/^h\d$/i,Z=/^[^{]+\{\s*\[native \w/,$=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,_=/[+~]/,aa=/'|\\/g,ba=new RegExp("\\\\([\\da-f]{1,6}"+L+"?|("+L+")|.)","ig"),ca=function(a,b,c){var d="0x"+b-65536;return d!==d||c?b:0>d?String.fromCharCode(d+65536):String.fromCharCode(d>>10|55296,1023&d|56320)},da=function(){m()};try{H.apply(E=I.call(v.childNodes),v.childNodes),E[v.childNodes.length].nodeType}catch(ea){H={apply:E.length?function(a,b){G.apply(a,I.call(b))}:function(a,b){var c=a.length,d=0;while(a[c++]=b[d++]);a.length=c-1}}}function fa(a,b,d,e){var f,h,j,k,l,o,r,s,w=b&&b.ownerDocument,x=b?b.nodeType:9;if(d=d||[],"string"!=typeof a||!a||1!==x&&9!==x&&11!==x)return d;if(!e&&((b?b.ownerDocument||b:v)!==n&&m(b),b=b||n,p)){if(11!==x&&(o=$.exec(a)))if(f=o[1]){if(9===x){if(!(j=b.getElementById(f)))return d;if(j.id===f)return d.push(j),d}else if(w&&(j=w.getElementById(f))&&t(b,j)&&j.id===f)return d.push(j),d}else{if(o[2])return H.apply(d,b.getElementsByTagName(a)),d;if((f=o[3])&&c.getElementsByClassName&&b.getElementsByClassName)return H.apply(d,b.getElementsByClassName(f)),d}if(c.qsa&&!A[a+" "]&&(!q||!q.test(a))){if(1!==x)w=b,s=a;else if("object"!==b.nodeName.toLowerCase()){(k=b.getAttribute("id"))?k=k.replace(aa,"\\$&"):b.setAttribute("id",k=u),r=g(a),h=r.length,l=V.test(k)?"#"+k:"[id='"+k+"']";while(h--)r[h]=l+" "+qa(r[h]);s=r.join(","),w=_.test(a)&&oa(b.parentNode)||b}if(s)try{return H.apply(d,w.querySelectorAll(s)),d}catch(y){}finally{k===u&&b.removeAttribute("id")}}}return i(a.replace(Q,"$1"),b,d,e)}function ga(){var a=[];function b(c,e){return a.push(c+" ")>d.cacheLength&&delete b[a.shift()],b[c+" "]=e}return b}function ha(a){return a[u]=!0,a}function ia(a){var b=n.createElement("div");try{return!!a(b)}catch(c){return!1}finally{b.parentNode&&b.parentNode.removeChild(b),b=null}}function ja(a,b){var c=a.split("|"),e=c.length;while(e--)d.attrHandle[c[e]]=b}function ka(a,b){var c=b&&a,d=c&&1===a.nodeType&&1===b.nodeType&&(~b.sourceIndex||C)-(~a.sourceIndex||C);if(d)return d;if(c)while(c=c.nextSibling)if(c===b)return-1;return a?1:-1}function la(a){return function(b){var c=b.nodeName.toLowerCase();return"input"===c&&b.type===a}}function ma(a){return function(b){var c=b.nodeName.toLowerCase();return("input"===c||"button"===c)&&b.type===a}}function na(a){return ha(function(b){return b=+b,ha(function(c,d){var e,f=a([],c.length,b),g=f.length;while(g--)c[e=f[g]]&&(c[e]=!(d[e]=c[e]))})})}function oa(a){return a&&"undefined"!=typeof a.getElementsByTagName&&a}c=fa.support={},f=fa.isXML=function(a){var b=a&&(a.ownerDocument||a).documentElement;return b?"HTML"!==b.nodeName:!1},m=fa.setDocument=function(a){var b,e,g=a?a.ownerDocument||a:v;return g!==n&&9===g.nodeType&&g.documentElement?(n=g,o=n.documentElement,p=!f(n),(e=n.defaultView)&&e.top!==e&&(e.addEventListener?e.addEventListener("unload",da,!1):e.attachEvent&&e.attachEvent("onunload",da)),c.attributes=ia(function(a){return a.className="i",!a.getAttribute("className")}),c.getElementsByTagName=ia(function(a){return a.appendChild(n.createComment("")),!a.getElementsByTagName("*").length}),c.getElementsByClassName=Z.test(n.getElementsByClassName),c.getById=ia(function(a){return o.appendChild(a).id=u,!n.getElementsByName||!n.getElementsByName(u).length}),c.getById?(d.find.ID=function(a,b){if("undefined"!=typeof b.getElementById&&p){var c=b.getElementById(a);return c?[c]:[]}},d.filter.ID=function(a){var b=a.replace(ba,ca);return function(a){return a.getAttribute("id")===b}}):(delete d.find.ID,d.filter.ID=function(a){var b=a.replace(ba,ca);return function(a){var c="undefined"!=typeof a.getAttributeNode&&a.getAttributeNode("id");return c&&c.value===b}}),d.find.TAG=c.getElementsByTagName?function(a,b){return"undefined"!=typeof b.getElementsByTagName?b.getElementsByTagName(a):c.qsa?b.querySelectorAll(a):void 0}:function(a,b){var c,d=[],e=0,f=b.getElementsByTagName(a);if("*"===a){while(c=f[e++])1===c.nodeType&&d.push(c);return d}return f},d.find.CLASS=c.getElementsByClassName&&function(a,b){return"undefined"!=typeof b.getElementsByClassName&&p?b.getElementsByClassName(a):void 0},r=[],q=[],(c.qsa=Z.test(n.querySelectorAll))&&(ia(function(a){o.appendChild(a).innerHTML="",a.querySelectorAll("[msallowcapture^='']").length&&q.push("[*^$]="+L+"*(?:''|\"\")"),a.querySelectorAll("[selected]").length||q.push("\\["+L+"*(?:value|"+K+")"),a.querySelectorAll("[id~="+u+"-]").length||q.push("~="),a.querySelectorAll(":checked").length||q.push(":checked"),a.querySelectorAll("a#"+u+"+*").length||q.push(".#.+[+~]")}),ia(function(a){var b=n.createElement("input");b.setAttribute("type","hidden"),a.appendChild(b).setAttribute("name","D"),a.querySelectorAll("[name=d]").length&&q.push("name"+L+"*[*^$|!~]?="),a.querySelectorAll(":enabled").length||q.push(":enabled",":disabled"),a.querySelectorAll("*,:x"),q.push(",.*:")})),(c.matchesSelector=Z.test(s=o.matches||o.webkitMatchesSelector||o.mozMatchesSelector||o.oMatchesSelector||o.msMatchesSelector))&&ia(function(a){c.disconnectedMatch=s.call(a,"div"),s.call(a,"[s!='']:x"),r.push("!=",O)}),q=q.length&&new RegExp(q.join("|")),r=r.length&&new RegExp(r.join("|")),b=Z.test(o.compareDocumentPosition),t=b||Z.test(o.contains)?function(a,b){var c=9===a.nodeType?a.documentElement:a,d=b&&b.parentNode;return a===d||!(!d||1!==d.nodeType||!(c.contains?c.contains(d):a.compareDocumentPosition&&16&a.compareDocumentPosition(d)))}:function(a,b){if(b)while(b=b.parentNode)if(b===a)return!0;return!1},B=b?function(a,b){if(a===b)return l=!0,0;var d=!a.compareDocumentPosition-!b.compareDocumentPosition;return d?d:(d=(a.ownerDocument||a)===(b.ownerDocument||b)?a.compareDocumentPosition(b):1,1&d||!c.sortDetached&&b.compareDocumentPosition(a)===d?a===n||a.ownerDocument===v&&t(v,a)?-1:b===n||b.ownerDocument===v&&t(v,b)?1:k?J(k,a)-J(k,b):0:4&d?-1:1)}:function(a,b){if(a===b)return l=!0,0;var c,d=0,e=a.parentNode,f=b.parentNode,g=[a],h=[b];if(!e||!f)return a===n?-1:b===n?1:e?-1:f?1:k?J(k,a)-J(k,b):0;if(e===f)return ka(a,b);c=a;while(c=c.parentNode)g.unshift(c);c=b;while(c=c.parentNode)h.unshift(c);while(g[d]===h[d])d++;return d?ka(g[d],h[d]):g[d]===v?-1:h[d]===v?1:0},n):n},fa.matches=function(a,b){return fa(a,null,null,b)},fa.matchesSelector=function(a,b){if((a.ownerDocument||a)!==n&&m(a),b=b.replace(T,"='$1']"),c.matchesSelector&&p&&!A[b+" "]&&(!r||!r.test(b))&&(!q||!q.test(b)))try{var d=s.call(a,b);if(d||c.disconnectedMatch||a.document&&11!==a.document.nodeType)return d}catch(e){}return fa(b,n,null,[a]).length>0},fa.contains=function(a,b){return(a.ownerDocument||a)!==n&&m(a),t(a,b)},fa.attr=function(a,b){(a.ownerDocument||a)!==n&&m(a);var e=d.attrHandle[b.toLowerCase()],f=e&&D.call(d.attrHandle,b.toLowerCase())?e(a,b,!p):void 0;return void 0!==f?f:c.attributes||!p?a.getAttribute(b):(f=a.getAttributeNode(b))&&f.specified?f.value:null},fa.error=function(a){throw new Error("Syntax error, unrecognized expression: "+a)},fa.uniqueSort=function(a){var b,d=[],e=0,f=0;if(l=!c.detectDuplicates,k=!c.sortStable&&a.slice(0),a.sort(B),l){while(b=a[f++])b===a[f]&&(e=d.push(f));while(e--)a.splice(d[e],1)}return k=null,a},e=fa.getText=function(a){var b,c="",d=0,f=a.nodeType;if(f){if(1===f||9===f||11===f){if("string"==typeof a.textContent)return a.textContent;for(a=a.firstChild;a;a=a.nextSibling)c+=e(a)}else if(3===f||4===f)return a.nodeValue}else while(b=a[d++])c+=e(b);return c},d=fa.selectors={cacheLength:50,createPseudo:ha,match:W,attrHandle:{},find:{},relative:{">":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(a){return a[1]=a[1].replace(ba,ca),a[3]=(a[3]||a[4]||a[5]||"").replace(ba,ca),"~="===a[2]&&(a[3]=" "+a[3]+" "),a.slice(0,4)},CHILD:function(a){return a[1]=a[1].toLowerCase(),"nth"===a[1].slice(0,3)?(a[3]||fa.error(a[0]),a[4]=+(a[4]?a[5]+(a[6]||1):2*("even"===a[3]||"odd"===a[3])),a[5]=+(a[7]+a[8]||"odd"===a[3])):a[3]&&fa.error(a[0]),a},PSEUDO:function(a){var b,c=!a[6]&&a[2];return W.CHILD.test(a[0])?null:(a[3]?a[2]=a[4]||a[5]||"":c&&U.test(c)&&(b=g(c,!0))&&(b=c.indexOf(")",c.length-b)-c.length)&&(a[0]=a[0].slice(0,b),a[2]=c.slice(0,b)),a.slice(0,3))}},filter:{TAG:function(a){var b=a.replace(ba,ca).toLowerCase();return"*"===a?function(){return!0}:function(a){return a.nodeName&&a.nodeName.toLowerCase()===b}},CLASS:function(a){var b=y[a+" "];return b||(b=new RegExp("(^|"+L+")"+a+"("+L+"|$)"))&&y(a,function(a){return b.test("string"==typeof a.className&&a.className||"undefined"!=typeof a.getAttribute&&a.getAttribute("class")||"")})},ATTR:function(a,b,c){return function(d){var e=fa.attr(d,a);return null==e?"!="===b:b?(e+="","="===b?e===c:"!="===b?e!==c:"^="===b?c&&0===e.indexOf(c):"*="===b?c&&e.indexOf(c)>-1:"$="===b?c&&e.slice(-c.length)===c:"~="===b?(" "+e.replace(P," ")+" ").indexOf(c)>-1:"|="===b?e===c||e.slice(0,c.length+1)===c+"-":!1):!0}},CHILD:function(a,b,c,d,e){var f="nth"!==a.slice(0,3),g="last"!==a.slice(-4),h="of-type"===b;return 1===d&&0===e?function(a){return!!a.parentNode}:function(b,c,i){var j,k,l,m,n,o,p=f!==g?"nextSibling":"previousSibling",q=b.parentNode,r=h&&b.nodeName.toLowerCase(),s=!i&&!h,t=!1;if(q){if(f){while(p){m=b;while(m=m[p])if(h?m.nodeName.toLowerCase()===r:1===m.nodeType)return!1;o=p="only"===a&&!o&&"nextSibling"}return!0}if(o=[g?q.firstChild:q.lastChild],g&&s){m=q,l=m[u]||(m[u]={}),k=l[m.uniqueID]||(l[m.uniqueID]={}),j=k[a]||[],n=j[0]===w&&j[1],t=n&&j[2],m=n&&q.childNodes[n];while(m=++n&&m&&m[p]||(t=n=0)||o.pop())if(1===m.nodeType&&++t&&m===b){k[a]=[w,n,t];break}}else if(s&&(m=b,l=m[u]||(m[u]={}),k=l[m.uniqueID]||(l[m.uniqueID]={}),j=k[a]||[],n=j[0]===w&&j[1],t=n),t===!1)while(m=++n&&m&&m[p]||(t=n=0)||o.pop())if((h?m.nodeName.toLowerCase()===r:1===m.nodeType)&&++t&&(s&&(l=m[u]||(m[u]={}),k=l[m.uniqueID]||(l[m.uniqueID]={}),k[a]=[w,t]),m===b))break;return t-=e,t===d||t%d===0&&t/d>=0}}},PSEUDO:function(a,b){var c,e=d.pseudos[a]||d.setFilters[a.toLowerCase()]||fa.error("unsupported pseudo: "+a);return e[u]?e(b):e.length>1?(c=[a,a,"",b],d.setFilters.hasOwnProperty(a.toLowerCase())?ha(function(a,c){var d,f=e(a,b),g=f.length;while(g--)d=J(a,f[g]),a[d]=!(c[d]=f[g])}):function(a){return e(a,0,c)}):e}},pseudos:{not:ha(function(a){var b=[],c=[],d=h(a.replace(Q,"$1"));return d[u]?ha(function(a,b,c,e){var f,g=d(a,null,e,[]),h=a.length;while(h--)(f=g[h])&&(a[h]=!(b[h]=f))}):function(a,e,f){return b[0]=a,d(b,null,f,c),b[0]=null,!c.pop()}}),has:ha(function(a){return function(b){return fa(a,b).length>0}}),contains:ha(function(a){return a=a.replace(ba,ca),function(b){return(b.textContent||b.innerText||e(b)).indexOf(a)>-1}}),lang:ha(function(a){return V.test(a||"")||fa.error("unsupported lang: "+a),a=a.replace(ba,ca).toLowerCase(),function(b){var c;do if(c=p?b.lang:b.getAttribute("xml:lang")||b.getAttribute("lang"))return c=c.toLowerCase(),c===a||0===c.indexOf(a+"-");while((b=b.parentNode)&&1===b.nodeType);return!1}}),target:function(b){var c=a.location&&a.location.hash;return c&&c.slice(1)===b.id},root:function(a){return a===o},focus:function(a){return a===n.activeElement&&(!n.hasFocus||n.hasFocus())&&!!(a.type||a.href||~a.tabIndex)},enabled:function(a){return a.disabled===!1},disabled:function(a){return a.disabled===!0},checked:function(a){var b=a.nodeName.toLowerCase();return"input"===b&&!!a.checked||"option"===b&&!!a.selected},selected:function(a){return a.parentNode&&a.parentNode.selectedIndex,a.selected===!0},empty:function(a){for(a=a.firstChild;a;a=a.nextSibling)if(a.nodeType<6)return!1;return!0},parent:function(a){return!d.pseudos.empty(a)},header:function(a){return Y.test(a.nodeName)},input:function(a){return X.test(a.nodeName)},button:function(a){var b=a.nodeName.toLowerCase();return"input"===b&&"button"===a.type||"button"===b},text:function(a){var b;return"input"===a.nodeName.toLowerCase()&&"text"===a.type&&(null==(b=a.getAttribute("type"))||"text"===b.toLowerCase())},first:na(function(){return[0]}),last:na(function(a,b){return[b-1]}),eq:na(function(a,b,c){return[0>c?c+b:c]}),even:na(function(a,b){for(var c=0;b>c;c+=2)a.push(c);return a}),odd:na(function(a,b){for(var c=1;b>c;c+=2)a.push(c);return a}),lt:na(function(a,b,c){for(var d=0>c?c+b:c;--d>=0;)a.push(d);return a}),gt:na(function(a,b,c){for(var d=0>c?c+b:c;++db;b++)d+=a[b].value;return d}function ra(a,b,c){var d=b.dir,e=c&&"parentNode"===d,f=x++;return b.first?function(b,c,f){while(b=b[d])if(1===b.nodeType||e)return a(b,c,f)}:function(b,c,g){var h,i,j,k=[w,f];if(g){while(b=b[d])if((1===b.nodeType||e)&&a(b,c,g))return!0}else while(b=b[d])if(1===b.nodeType||e){if(j=b[u]||(b[u]={}),i=j[b.uniqueID]||(j[b.uniqueID]={}),(h=i[d])&&h[0]===w&&h[1]===f)return k[2]=h[2];if(i[d]=k,k[2]=a(b,c,g))return!0}}}function sa(a){return a.length>1?function(b,c,d){var e=a.length;while(e--)if(!a[e](b,c,d))return!1;return!0}:a[0]}function ta(a,b,c){for(var d=0,e=b.length;e>d;d++)fa(a,b[d],c);return c}function ua(a,b,c,d,e){for(var f,g=[],h=0,i=a.length,j=null!=b;i>h;h++)(f=a[h])&&(!c||c(f,d,e))&&(g.push(f),j&&b.push(h));return g}function va(a,b,c,d,e,f){return d&&!d[u]&&(d=va(d)),e&&!e[u]&&(e=va(e,f)),ha(function(f,g,h,i){var j,k,l,m=[],n=[],o=g.length,p=f||ta(b||"*",h.nodeType?[h]:h,[]),q=!a||!f&&b?p:ua(p,m,a,h,i),r=c?e||(f?a:o||d)?[]:g:q;if(c&&c(q,r,h,i),d){j=ua(r,n),d(j,[],h,i),k=j.length;while(k--)(l=j[k])&&(r[n[k]]=!(q[n[k]]=l))}if(f){if(e||a){if(e){j=[],k=r.length;while(k--)(l=r[k])&&j.push(q[k]=l);e(null,r=[],j,i)}k=r.length;while(k--)(l=r[k])&&(j=e?J(f,l):m[k])>-1&&(f[j]=!(g[j]=l))}}else r=ua(r===g?r.splice(o,r.length):r),e?e(null,g,r,i):H.apply(g,r)})}function wa(a){for(var b,c,e,f=a.length,g=d.relative[a[0].type],h=g||d.relative[" "],i=g?1:0,k=ra(function(a){return a===b},h,!0),l=ra(function(a){return J(b,a)>-1},h,!0),m=[function(a,c,d){var e=!g&&(d||c!==j)||((b=c).nodeType?k(a,c,d):l(a,c,d));return b=null,e}];f>i;i++)if(c=d.relative[a[i].type])m=[ra(sa(m),c)];else{if(c=d.filter[a[i].type].apply(null,a[i].matches),c[u]){for(e=++i;f>e;e++)if(d.relative[a[e].type])break;return va(i>1&&sa(m),i>1&&qa(a.slice(0,i-1).concat({value:" "===a[i-2].type?"*":""})).replace(Q,"$1"),c,e>i&&wa(a.slice(i,e)),f>e&&wa(a=a.slice(e)),f>e&&qa(a))}m.push(c)}return sa(m)}function xa(a,b){var c=b.length>0,e=a.length>0,f=function(f,g,h,i,k){var l,o,q,r=0,s="0",t=f&&[],u=[],v=j,x=f||e&&d.find.TAG("*",k),y=w+=null==v?1:Math.random()||.1,z=x.length;for(k&&(j=g===n||g||k);s!==z&&null!=(l=x[s]);s++){if(e&&l){o=0,g||l.ownerDocument===n||(m(l),h=!p);while(q=a[o++])if(q(l,g||n,h)){i.push(l);break}k&&(w=y)}c&&((l=!q&&l)&&r--,f&&t.push(l))}if(r+=s,c&&s!==r){o=0;while(q=b[o++])q(t,u,g,h);if(f){if(r>0)while(s--)t[s]||u[s]||(u[s]=F.call(i));u=ua(u)}H.apply(i,u),k&&!f&&u.length>0&&r+b.length>1&&fa.uniqueSort(i)}return k&&(w=y,j=v),t};return c?ha(f):f}return h=fa.compile=function(a,b){var c,d=[],e=[],f=A[a+" "];if(!f){b||(b=g(a)),c=b.length;while(c--)f=wa(b[c]),f[u]?d.push(f):e.push(f);f=A(a,xa(e,d)),f.selector=a}return f},i=fa.select=function(a,b,e,f){var i,j,k,l,m,n="function"==typeof a&&a,o=!f&&g(a=n.selector||a);if(e=e||[],1===o.length){if(j=o[0]=o[0].slice(0),j.length>2&&"ID"===(k=j[0]).type&&c.getById&&9===b.nodeType&&p&&d.relative[j[1].type]){if(b=(d.find.ID(k.matches[0].replace(ba,ca),b)||[])[0],!b)return e;n&&(b=b.parentNode),a=a.slice(j.shift().value.length)}i=W.needsContext.test(a)?0:j.length;while(i--){if(k=j[i],d.relative[l=k.type])break;if((m=d.find[l])&&(f=m(k.matches[0].replace(ba,ca),_.test(j[0].type)&&oa(b.parentNode)||b))){if(j.splice(i,1),a=f.length&&qa(j),!a)return H.apply(e,f),e;break}}}return(n||h(a,o))(f,b,!p,e,!b||_.test(a)&&oa(b.parentNode)||b),e},c.sortStable=u.split("").sort(B).join("")===u,c.detectDuplicates=!!l,m(),c.sortDetached=ia(function(a){return 1&a.compareDocumentPosition(n.createElement("div"))}),ia(function(a){return a.innerHTML="","#"===a.firstChild.getAttribute("href")})||ja("type|href|height|width",function(a,b,c){return c?void 0:a.getAttribute(b,"type"===b.toLowerCase()?1:2)}),c.attributes&&ia(function(a){return a.innerHTML="",a.firstChild.setAttribute("value",""),""===a.firstChild.getAttribute("value")})||ja("value",function(a,b,c){return c||"input"!==a.nodeName.toLowerCase()?void 0:a.defaultValue}),ia(function(a){return null==a.getAttribute("disabled")})||ja(K,function(a,b,c){var d;return c?void 0:a[b]===!0?b.toLowerCase():(d=a.getAttributeNode(b))&&d.specified?d.value:null}),fa}(a);n.find=t,n.expr=t.selectors,n.expr[":"]=n.expr.pseudos,n.uniqueSort=n.unique=t.uniqueSort,n.text=t.getText,n.isXMLDoc=t.isXML,n.contains=t.contains;var u=function(a,b,c){var d=[],e=void 0!==c;while((a=a[b])&&9!==a.nodeType)if(1===a.nodeType){if(e&&n(a).is(c))break;d.push(a)}return d},v=function(a,b){for(var c=[];a;a=a.nextSibling)1===a.nodeType&&a!==b&&c.push(a);return c},w=n.expr.match.needsContext,x=/^<([\w-]+)\s*\/?>(?:<\/\1>|)$/,y=/^.[^:#\[\.,]*$/;function z(a,b,c){if(n.isFunction(b))return n.grep(a,function(a,d){return!!b.call(a,d,a)!==c});if(b.nodeType)return n.grep(a,function(a){return a===b!==c});if("string"==typeof b){if(y.test(b))return n.filter(b,a,c);b=n.filter(b,a)}return n.grep(a,function(a){return h.call(b,a)>-1!==c})}n.filter=function(a,b,c){var d=b[0];return c&&(a=":not("+a+")"),1===b.length&&1===d.nodeType?n.find.matchesSelector(d,a)?[d]:[]:n.find.matches(a,n.grep(b,function(a){return 1===a.nodeType}))},n.fn.extend({find:function(a){var b,c=this.length,d=[],e=this;if("string"!=typeof a)return this.pushStack(n(a).filter(function(){for(b=0;c>b;b++)if(n.contains(e[b],this))return!0}));for(b=0;c>b;b++)n.find(a,e[b],d);return d=this.pushStack(c>1?n.unique(d):d),d.selector=this.selector?this.selector+" "+a:a,d},filter:function(a){return this.pushStack(z(this,a||[],!1))},not:function(a){return this.pushStack(z(this,a||[],!0))},is:function(a){return!!z(this,"string"==typeof a&&w.test(a)?n(a):a||[],!1).length}});var A,B=/^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]*))$/,C=n.fn.init=function(a,b,c){var e,f;if(!a)return this;if(c=c||A,"string"==typeof a){if(e="<"===a[0]&&">"===a[a.length-1]&&a.length>=3?[null,a,null]:B.exec(a),!e||!e[1]&&b)return!b||b.jquery?(b||c).find(a):this.constructor(b).find(a);if(e[1]){if(b=b instanceof n?b[0]:b,n.merge(this,n.parseHTML(e[1],b&&b.nodeType?b.ownerDocument||b:d,!0)),x.test(e[1])&&n.isPlainObject(b))for(e in b)n.isFunction(this[e])?this[e](b[e]):this.attr(e,b[e]);return this}return f=d.getElementById(e[2]),f&&f.parentNode&&(this.length=1,this[0]=f),this.context=d,this.selector=a,this}return a.nodeType?(this.context=this[0]=a,this.length=1,this):n.isFunction(a)?void 0!==c.ready?c.ready(a):a(n):(void 0!==a.selector&&(this.selector=a.selector,this.context=a.context),n.makeArray(a,this))};C.prototype=n.fn,A=n(d);var D=/^(?:parents|prev(?:Until|All))/,E={children:!0,contents:!0,next:!0,prev:!0};n.fn.extend({has:function(a){var b=n(a,this),c=b.length;return this.filter(function(){for(var a=0;c>a;a++)if(n.contains(this,b[a]))return!0})},closest:function(a,b){for(var c,d=0,e=this.length,f=[],g=w.test(a)||"string"!=typeof a?n(a,b||this.context):0;e>d;d++)for(c=this[d];c&&c!==b;c=c.parentNode)if(c.nodeType<11&&(g?g.index(c)>-1:1===c.nodeType&&n.find.matchesSelector(c,a))){f.push(c);break}return this.pushStack(f.length>1?n.uniqueSort(f):f)},index:function(a){return a?"string"==typeof a?h.call(n(a),this[0]):h.call(this,a.jquery?a[0]:a):this[0]&&this[0].parentNode?this.first().prevAll().length:-1},add:function(a,b){return this.pushStack(n.uniqueSort(n.merge(this.get(),n(a,b))))},addBack:function(a){return this.add(null==a?this.prevObject:this.prevObject.filter(a))}});function F(a,b){while((a=a[b])&&1!==a.nodeType);return a}n.each({parent:function(a){var b=a.parentNode;return b&&11!==b.nodeType?b:null},parents:function(a){return u(a,"parentNode")},parentsUntil:function(a,b,c){return u(a,"parentNode",c)},next:function(a){return F(a,"nextSibling")},prev:function(a){return F(a,"previousSibling")},nextAll:function(a){return u(a,"nextSibling")},prevAll:function(a){return u(a,"previousSibling")},nextUntil:function(a,b,c){return u(a,"nextSibling",c)},prevUntil:function(a,b,c){return u(a,"previousSibling",c)},siblings:function(a){return v((a.parentNode||{}).firstChild,a)},children:function(a){return v(a.firstChild)},contents:function(a){return a.contentDocument||n.merge([],a.childNodes)}},function(a,b){n.fn[a]=function(c,d){var e=n.map(this,b,c);return"Until"!==a.slice(-5)&&(d=c),d&&"string"==typeof d&&(e=n.filter(d,e)),this.length>1&&(E[a]||n.uniqueSort(e),D.test(a)&&e.reverse()),this.pushStack(e)}});var G=/\S+/g;function H(a){var b={};return n.each(a.match(G)||[],function(a,c){b[c]=!0}),b}n.Callbacks=function(a){a="string"==typeof a?H(a):n.extend({},a);var b,c,d,e,f=[],g=[],h=-1,i=function(){for(e=a.once,d=b=!0;g.length;h=-1){c=g.shift();while(++h-1)f.splice(c,1),h>=c&&h--}),this},has:function(a){return a?n.inArray(a,f)>-1:f.length>0},empty:function(){return f&&(f=[]),this},disable:function(){return e=g=[],f=c="",this},disabled:function(){return!f},lock:function(){return e=g=[],c||(f=c=""),this},locked:function(){return!!e},fireWith:function(a,c){return e||(c=c||[],c=[a,c.slice?c.slice():c],g.push(c),b||i()),this},fire:function(){return j.fireWith(this,arguments),this},fired:function(){return!!d}};return j},n.extend({Deferred:function(a){var b=[["resolve","done",n.Callbacks("once memory"),"resolved"],["reject","fail",n.Callbacks("once memory"),"rejected"],["notify","progress",n.Callbacks("memory")]],c="pending",d={state:function(){return c},always:function(){return e.done(arguments).fail(arguments),this},then:function(){var a=arguments;return n.Deferred(function(c){n.each(b,function(b,f){var g=n.isFunction(a[b])&&a[b];e[f[1]](function(){var a=g&&g.apply(this,arguments);a&&n.isFunction(a.promise)?a.promise().progress(c.notify).done(c.resolve).fail(c.reject):c[f[0]+"With"](this===d?c.promise():this,g?[a]:arguments)})}),a=null}).promise()},promise:function(a){return null!=a?n.extend(a,d):d}},e={};return d.pipe=d.then,n.each(b,function(a,f){var g=f[2],h=f[3];d[f[1]]=g.add,h&&g.add(function(){c=h},b[1^a][2].disable,b[2][2].lock),e[f[0]]=function(){return e[f[0]+"With"](this===e?d:this,arguments),this},e[f[0]+"With"]=g.fireWith}),d.promise(e),a&&a.call(e,e),e},when:function(a){var b=0,c=e.call(arguments),d=c.length,f=1!==d||a&&n.isFunction(a.promise)?d:0,g=1===f?a:n.Deferred(),h=function(a,b,c){return function(d){b[a]=this,c[a]=arguments.length>1?e.call(arguments):d,c===i?g.notifyWith(b,c):--f||g.resolveWith(b,c)}},i,j,k;if(d>1)for(i=new Array(d),j=new Array(d),k=new Array(d);d>b;b++)c[b]&&n.isFunction(c[b].promise)?c[b].promise().progress(h(b,j,i)).done(h(b,k,c)).fail(g.reject):--f;return f||g.resolveWith(k,c),g.promise()}});var I;n.fn.ready=function(a){return n.ready.promise().done(a),this},n.extend({isReady:!1,readyWait:1,holdReady:function(a){a?n.readyWait++:n.ready(!0)},ready:function(a){(a===!0?--n.readyWait:n.isReady)||(n.isReady=!0,a!==!0&&--n.readyWait>0||(I.resolveWith(d,[n]),n.fn.triggerHandler&&(n(d).triggerHandler("ready"),n(d).off("ready"))))}});function J(){d.removeEventListener("DOMContentLoaded",J),a.removeEventListener("load",J),n.ready()}n.ready.promise=function(b){return I||(I=n.Deferred(),"complete"===d.readyState||"loading"!==d.readyState&&!d.documentElement.doScroll?a.setTimeout(n.ready):(d.addEventListener("DOMContentLoaded",J),a.addEventListener("load",J))),I.promise(b)},n.ready.promise();var K=function(a,b,c,d,e,f,g){var h=0,i=a.length,j=null==c;if("object"===n.type(c)){e=!0;for(h in c)K(a,b,h,c[h],!0,f,g)}else if(void 0!==d&&(e=!0,n.isFunction(d)||(g=!0),j&&(g?(b.call(a,d),b=null):(j=b,b=function(a,b,c){return j.call(n(a),c)})),b))for(;i>h;h++)b(a[h],c,g?d:d.call(a[h],h,b(a[h],c)));return e?a:j?b.call(a):i?b(a[0],c):f},L=function(a){return 1===a.nodeType||9===a.nodeType||!+a.nodeType};function M(){this.expando=n.expando+M.uid++}M.uid=1,M.prototype={register:function(a,b){var c=b||{};return a.nodeType?a[this.expando]=c:Object.defineProperty(a,this.expando,{value:c,writable:!0,configurable:!0}),a[this.expando]},cache:function(a){if(!L(a))return{};var b=a[this.expando];return b||(b={},L(a)&&(a.nodeType?a[this.expando]=b:Object.defineProperty(a,this.expando,{value:b,configurable:!0}))),b},set:function(a,b,c){var d,e=this.cache(a);if("string"==typeof b)e[b]=c;else for(d in b)e[d]=b[d];return e},get:function(a,b){return void 0===b?this.cache(a):a[this.expando]&&a[this.expando][b]},access:function(a,b,c){var d;return void 0===b||b&&"string"==typeof b&&void 0===c?(d=this.get(a,b),void 0!==d?d:this.get(a,n.camelCase(b))):(this.set(a,b,c),void 0!==c?c:b)},remove:function(a,b){var c,d,e,f=a[this.expando];if(void 0!==f){if(void 0===b)this.register(a);else{n.isArray(b)?d=b.concat(b.map(n.camelCase)):(e=n.camelCase(b),b in f?d=[b,e]:(d=e,d=d in f?[d]:d.match(G)||[])),c=d.length;while(c--)delete f[d[c]]}(void 0===b||n.isEmptyObject(f))&&(a.nodeType?a[this.expando]=void 0:delete a[this.expando])}},hasData:function(a){var b=a[this.expando];return void 0!==b&&!n.isEmptyObject(b)}};var N=new M,O=new M,P=/^(?:\{[\w\W]*\}|\[[\w\W]*\])$/,Q=/[A-Z]/g;function R(a,b,c){var d;if(void 0===c&&1===a.nodeType)if(d="data-"+b.replace(Q,"-$&").toLowerCase(),c=a.getAttribute(d),"string"==typeof c){try{c="true"===c?!0:"false"===c?!1:"null"===c?null:+c+""===c?+c:P.test(c)?n.parseJSON(c):c}catch(e){}O.set(a,b,c); @@ -2467,7 +3318,7 @@ window.matchMedia || (window.matchMedia = function() { |___/_|_|\___|_|\_(_)/ |___/ |__/ - Version: 1.4.1 + Version: 1.6.0 Author: Ken Wheeler Website: http://kenwheeler.github.io Docs: http://kenwheeler.github.io/slick @@ -2475,9 +3326,7 @@ window.matchMedia || (window.matchMedia = function() { Issues: http://github.com/kenwheeler/slick/issues */ - /* global window, document, define, jQuery, setInterval, clearInterval */ - (function(factory) { 'use strict'; if (typeof define === 'function' && define.amd) { @@ -2498,8 +3347,7 @@ window.matchMedia || (window.matchMedia = function() { function Slick(element, settings) { - var _ = this, - dataSettings, responsiveSettings, breakpoint; + var _ = this, dataSettings; _.defaults = { accessibility: true, @@ -2508,15 +3356,15 @@ window.matchMedia || (window.matchMedia = function() { appendDots: $(element), arrows: true, asNavFor: null, - prevArrow: '', - nextArrow: '', + prevArrow: '', + nextArrow: '', autoplay: false, autoplaySpeed: 3000, centerMode: false, centerPadding: '50px', cssEase: 'ease', customPaging: function(slider, i) { - return ''; + return $('